2 * Virtio vhost-user GPU Device
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
10 #ifndef VHOST_USER_GPU_VUGBM_H
11 #define VHOST_USER_GPU_VUGBM_H
13 #include "qemu/osdep.h"
17 #include <sys/ioctl.h>
30 struct gbm_device
*dev
;
33 bool (*alloc_bo
)(struct vugbm_buffer
*buf
);
34 void (*free_bo
)(struct vugbm_buffer
*buf
);
35 bool (*get_fd
)(struct vugbm_buffer
*buf
, int *fd
);
36 bool (*map_bo
)(struct vugbm_buffer
*buf
);
37 void (*unmap_bo
)(struct vugbm_buffer
*buf
);
38 void (*device_destroy
)(struct vugbm_device
*dev
);
42 struct vugbm_device
*dev
;
59 bool vugbm_device_init(struct vugbm_device
*dev
, int fd
);
60 void vugbm_device_destroy(struct vugbm_device
*dev
);
62 bool vugbm_buffer_create(struct vugbm_buffer
*buffer
, struct vugbm_device
*dev
,
63 uint32_t width
, uint32_t height
);
64 bool vugbm_buffer_can_get_dmabuf_fd(struct vugbm_buffer
*buffer
);
65 bool vugbm_buffer_get_dmabuf_fd(struct vugbm_buffer
*buffer
, int *fd
);
66 void vugbm_buffer_destroy(struct vugbm_buffer
*buffer
);