[PATCH v17 0/6] drm/i915/gvt: Dma-buf support for GVT-g
Zhang, Tina
tina.zhang at intel.com
Thu Nov 9 23:27:00 UTC 2017
And here is the "git diff" of (git://git.kraxel.org/qemu), which is used to test this version:
diff --git a/hw/vfio/display.c b/hw/vfio/display.c
index 1cdc926..06234b2 100644
--- a/hw/vfio/display.c
+++ b/hw/vfio/display.c
@@ -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;
diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h
index c80bb5e..aee81f2 100644
--- a/linux-headers/linux/vfio.h
+++ b/linux-headers/linux/vfio.h
@@ -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 */
Thanks.
BR,
Tina
> -----Original Message-----
> From: Zhang, Tina
> Sent: Friday, November 10, 2017 7:20 AM
> To: 'Gerd Hoffmann' <kraxel at redhat.com>
> Cc: Tian, Kevin <kevin.tian at intel.com>; linux-kernel at vger.kernel.org; intel-
> gfx at lists.freedesktop.org; joonas.lahtinen at linux.intel.com;
> kwankhede at nvidia.com; zhenyuw at linux.intel.com; chris at chris-wilson.co.uk;
> alex.williamson at redhat.com; Lv, Zhiyuan <zhiyuan.lv at intel.com>;
> daniel at ffwll.ch; Yuan, Hang <hang.yuan at intel.com>; intel-gvt-
> dev at lists.freedesktop.org; Wang, Zhi A <zhi.a.wang at intel.com>
> Subject: RE: [PATCH v17 0/6] drm/i915/gvt: Dma-buf support for GVT-g
>
>
>
> > -----Original Message-----
> > From: intel-gvt-dev
> > [mailto:intel-gvt-dev-bounces at lists.freedesktop.org] On Behalf Of Gerd
> > Hoffmann
> > Sent: Thursday, November 9, 2017 10:10 PM
> > To: Zhang, Tina <tina.zhang at intel.com>
> > Cc: Tian, Kevin <kevin.tian at intel.com>; linux-kernel at vger.kernel.org;
> > intel- gfx at lists.freedesktop.org; joonas.lahtinen at linux.intel.com;
> > kwankhede at nvidia.com; zhenyuw at linux.intel.com;
> > chris at chris-wilson.co.uk; alex.williamson at redhat.com; Lv, Zhiyuan
> > <zhiyuan.lv at intel.com>; daniel at ffwll.ch; Yuan, Hang
> > <hang.yuan at intel.com>; intel-gvt- dev at lists.freedesktop.org; Wang, Zhi
> > A <zhi.a.wang at intel.com>
> > Subject: Re: [PATCH v17 0/6] drm/i915/gvt: Dma-buf support for GVT-g
> >
> > On Thu, Nov 09, 2017 at 05:33:56PM +0800, Tina Zhang wrote:
> > > v16->v17:
> > > 1) modify VFIO_DEVICE_GET_GFX_DMABUF interface. (Alex)
> > > 2) add comments for x_hot/y_hot. (Gerd)
> >
> > Hmm, doesn't apply cleanly here.
> > Tried 4.14-rc8 + gem proxy v2 + this series.
> > Seems the patches depend on unmerged gvt changes.
> > Do you have a git branch somewhere?
> Please use this:
> https://github.com/intel/gvt-linux.git
> branch: topic/dmabuf
> Thanks.
>
> BR,
> Tina
> >
> > thanks,
> > Gerd
> >
> > _______________________________________________
> > intel-gvt-dev mailing list
> > intel-gvt-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev
More information about the intel-gvt-dev
mailing list