diff options
| author | Dongwon Kim <dongwon.kim@intel.com> | 2024-05-08 10:53:59 -0700 |
|---|---|---|
| committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2024-05-14 17:14:12 +0400 |
| commit | 6e6ae491dad9a7ba813c7f1e70ce972c35c2d4ab (patch) | |
| tree | 5bb2bb1729ce040f07eefc20f926f3c0b7b017e8 /include/ui/console.h | |
| parent | e4e62514e3cc2fc9dbae44af8b80f61c730beab4 (diff) | |
| download | focaccia-qemu-6e6ae491dad9a7ba813c7f1e70ce972c35c2d4ab.tar.gz focaccia-qemu-6e6ae491dad9a7ba813c7f1e70ce972c35c2d4ab.zip | |
ui/console: new dmabuf.h and dmabuf.c for QemuDmaBuf struct and helpers
New header and source files are added for containing QemuDmaBuf struct
definition and newly introduced helpers for creating/freeing the struct
and accessing its data.
v10: Change the license type for both dmabuf.h and dmabuf.c from MIT to
GPL to be in line with QEMU's default license
v11: -- Added new helpers, qemu_dmabuf_close for closing dmabuf->fd,
qemu_dmabuf_dup_fd for duplicating dmabuf->fd
(Daniel P. Berrangé <berrange@redhat.com>)
-- Let qemu_dmabuf_fee to call qemu_dmabuf_close before freeing
the struct to make sure fd is closed.
(Daniel P. Berrangé <berrange@redhat.com>)
v12: Not closing fd in qemu_dmabuf_free because there are cases fd
should still be available even after the struct is destroyed
(e.g. virtio-gpu: res->dmabuf_fd).
Suggested-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Cc: Daniel P. Berrangé <berrange@redhat.com>
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Message-Id: <20240508175403.3399895-3-dongwon.kim@intel.com>
Diffstat (limited to 'include/ui/console.h')
| -rw-r--r-- | include/ui/console.h | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/include/ui/console.h b/include/ui/console.h index 0bc7a00ac0..a208a68b88 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -7,6 +7,7 @@ #include "qapi/qapi-types-ui.h" #include "ui/input.h" #include "ui/surface.h" +#include "ui/dmabuf.h" #define TYPE_QEMU_CONSOLE "qemu-console" OBJECT_DECLARE_TYPE(QemuConsole, QemuConsoleClass, QEMU_CONSOLE) @@ -185,25 +186,6 @@ struct QEMUGLParams { int minor_ver; }; -typedef struct QemuDmaBuf { - int fd; - uint32_t width; - uint32_t height; - uint32_t stride; - uint32_t fourcc; - uint64_t modifier; - uint32_t texture; - uint32_t x; - uint32_t y; - uint32_t backing_width; - uint32_t backing_height; - bool y0_top; - void *sync; - int fence_fd; - bool allow_fences; - bool draw_submitted; -} QemuDmaBuf; - enum display_scanout { SCANOUT_NONE, SCANOUT_SURFACE, |