mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
virtio-gpu: Add helpers to create and destroy dmabuf objects
These helpers can be useful for creating dmabuf objects from blobs and submitting them to the UI. Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210526231429.1045476-12-vivek.kasireddy@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
8069b73bee
commit
5752519e93
3 changed files with 89 additions and 0 deletions
|
@ -150,6 +150,12 @@ struct VirtIOGPUBaseClass {
|
|||
DEFINE_PROP_UINT32("xres", _state, _conf.xres, 1024), \
|
||||
DEFINE_PROP_UINT32("yres", _state, _conf.yres, 768)
|
||||
|
||||
typedef struct VGPUDMABuf {
|
||||
QemuDmaBuf buf;
|
||||
uint32_t scanout_id;
|
||||
QTAILQ_ENTRY(VGPUDMABuf) next;
|
||||
} VGPUDMABuf;
|
||||
|
||||
struct VirtIOGPU {
|
||||
VirtIOGPUBase parent_obj;
|
||||
|
||||
|
@ -178,6 +184,11 @@ struct VirtIOGPU {
|
|||
uint32_t req_3d;
|
||||
uint32_t bytes_3d;
|
||||
} stats;
|
||||
|
||||
struct {
|
||||
QTAILQ_HEAD(, VGPUDMABuf) bufs;
|
||||
VGPUDMABuf *primary;
|
||||
} dmabuf;
|
||||
};
|
||||
|
||||
struct VirtIOGPUClass {
|
||||
|
@ -259,6 +270,10 @@ void virtio_gpu_update_cursor_data(VirtIOGPU *g,
|
|||
bool virtio_gpu_have_udmabuf(void);
|
||||
void virtio_gpu_init_udmabuf(struct virtio_gpu_simple_resource *res);
|
||||
void virtio_gpu_fini_udmabuf(struct virtio_gpu_simple_resource *res);
|
||||
int virtio_gpu_update_dmabuf(VirtIOGPU *g,
|
||||
uint32_t scanout_id,
|
||||
struct virtio_gpu_simple_resource *res,
|
||||
struct virtio_gpu_framebuffer *fb);
|
||||
|
||||
/* virtio-gpu-3d.c */
|
||||
void virtio_gpu_virgl_process_cmd(VirtIOGPU *g,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue