@@ -36,7 +36,7 @@ static VFIODMABuf *vfio_display_get_dmabuf(VFIOPCIDevice *vdev,
uint32_t plane_type)
{
struct vfio_device_gfx_plane_info plane;
- struct vfio_device_gfx_dmabuf_fd gfd;
+ int dmabuf_fd;
VFIODMABuf *dmabuf;
static int errcnt;
int ret;
@@ -84,11 +84,10 @@ static VFIODMABuf *vfio_display_get_dmabuf(VFIOPCIDevice *vdev,
}
}
- memset(&gfd, 0, sizeof(gfd));
- gfd.argsz = sizeof(gfd);
- gfd.dmabuf_id = plane.dmabuf_id;
- ret = ioctl(vdev->vbasedev.fd, VFIO_DEVICE_GET_GFX_DMABUF, &gfd);
- if (ret < 0) {
+
+
+ dmabuf_fd = ioctl(vdev->vbasedev.fd, VFIO_DEVICE_GET_GFX_DMABUF, &plane.dmabuf_id);
+ if (dmabuf_fd < 0) {
fprintf(stderr, "(%d) ioctl VFIO_DEVICE_GET_GFX_DMABUF: %s\r",
++errcnt, strerror(errno));
return NULL;
@@ -103,7 +102,7 @@ static VFIODMABuf *vfio_display_get_dmabuf(VFIOPCIDevice *vdev,
(plane.drm_format >> 16) & 0xff,
(plane.drm_format >> 24) & 0xff,
(plane_type == DRM_PLANE_TYPE_PRIMARY) ? "primary" : "cursor",
- gfd.dmabuf_fd);
+ dmabuf_fd);
dmabuf = g_new0(VFIODMABuf, 1);
dmabuf->dmabuf_id = plane.dmabuf_id;
@@ -111,7 +110,7 @@ static VFIODMABuf *vfio_display_get_dmabuf(VFIOPCIDevice *vdev,
dmabuf->buf.height = plane.height;
dmabuf->buf.stride = plane.stride;
dmabuf->buf.fourcc = plane.drm_format;
- dmabuf->buf.fd = gfd.dmabuf_fd;
+ dmabuf->buf.fd = dmabuf_fd;
QTAILQ_INSERT_HEAD(&vdev->dmabufs, dmabuf, next);
return dmabuf;
@@ -536,6 +536,8 @@ struct vfio_device_gfx_plane_info {
__u32 size; /* size of plane in bytes, align on page*/
__u32 x_pos; /* horizontal position of cursor plane, upper left corner in pixels */
__u32 y_pos; /* vertical position of cursor plane, upper left corner in lines*/
+ __u32 x_hot;
+ __u32 y_hot;
union {
__u32 region_index; /* region index */
__u32 dmabuf_id; /* dma-buf id */