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
15 #include <sys/ioctl.h>
28 struct gbm_device
*dev
;
31 bool (*alloc_bo
)(struct vugbm_buffer
*buf
);
32 void (*free_bo
)(struct vugbm_buffer
*buf
);
33 bool (*get_fd
)(struct vugbm_buffer
*buf
, int *fd
);
34 bool (*map_bo
)(struct vugbm_buffer
*buf
);
35 void (*unmap_bo
)(struct vugbm_buffer
*buf
);
36 void (*device_destroy
)(struct vugbm_device
*dev
);
40 struct vugbm_device
*dev
;
57 void vugbm_device_init(struct vugbm_device
*dev
, int fd
);
58 void vugbm_device_destroy(struct vugbm_device
*dev
);
60 bool vugbm_buffer_create(struct vugbm_buffer
*buffer
, struct vugbm_device
*dev
,
61 uint32_t width
, uint32_t height
);
62 bool vugbm_buffer_can_get_dmabuf_fd(struct vugbm_buffer
*buffer
);
63 bool vugbm_buffer_get_dmabuf_fd(struct vugbm_buffer
*buffer
, int *fd
);
64 void vugbm_buffer_destroy(struct vugbm_buffer
*buffer
);