From patchwork Thu Nov 9 23:27:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Tina" X-Patchwork-Id: 10052073 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7556C60631 for ; Thu, 9 Nov 2017 23:27:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67F5F2AD6B for ; Thu, 9 Nov 2017 23:27:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CA142AD6E; Thu, 9 Nov 2017 23:27:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B8F892AD6B for ; Thu, 9 Nov 2017 23:27:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 436416E161; Thu, 9 Nov 2017 23:27:06 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 87E646E161; Thu, 9 Nov 2017 23:27:05 +0000 (UTC) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Nov 2017 15:27:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,371,1505804400"; d="scan'208";a="171841830" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga005.jf.intel.com with ESMTP; 09 Nov 2017 15:27:04 -0800 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 9 Nov 2017 15:27:04 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 9 Nov 2017 15:27:03 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.159]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.213]) with mapi id 14.03.0319.002; Fri, 10 Nov 2017 07:27:01 +0800 From: "Zhang, Tina" To: Gerd Hoffmann Thread-Topic: [PATCH v17 0/6] drm/i915/gvt: Dma-buf support for GVT-g Thread-Index: AQHTWT6ottzChnke50+tkiuwB+EKP6MLkD8AgAEe7tCAAAGkQA== Date: Thu, 9 Nov 2017 23:27:00 +0000 Message-ID: <237F54289DF84E4997F34151298ABEBC7C62C124@SHSMSX101.ccr.corp.intel.com> References: <1510220042-4931-1-git-send-email-tina.zhang@intel.com> <20171109140958.ia3jeudgjc6skihy@sirius.home.kraxel.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTYzNzk3ZjctODNkYi00Mjk4LTliOTgtY2RiMjY4NTU0YWQ5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiI1T0czdE0wcVJDS2JnUjVMbUg3cGVXQ3ZuXC85QUJzMlZ4QVduTWFsQUlVQnF2S3hBVFJ4dHVramsyU09UeFA1dSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Cc: "intel-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "kwankhede@nvidia.com" , "Lv, Zhiyuan" , "Yuan, Hang" , "intel-gvt-dev@lists.freedesktop.org" Subject: Re: [Intel-gfx] [PATCH v17 0/6] drm/i915/gvt: Dma-buf support for GVT-g X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP And here is the "git diff" of (git://git.kraxel.org/qemu), which is used to test this version: Thanks. BR, Tina > -----Original Message----- > From: Zhang, Tina > Sent: Friday, November 10, 2017 7:20 AM > To: 'Gerd Hoffmann' > Cc: Tian, Kevin ; linux-kernel@vger.kernel.org; intel- > gfx@lists.freedesktop.org; joonas.lahtinen@linux.intel.com; > kwankhede@nvidia.com; zhenyuw@linux.intel.com; chris@chris-wilson.co.uk; > alex.williamson@redhat.com; Lv, Zhiyuan ; > daniel@ffwll.ch; Yuan, Hang ; intel-gvt- > dev@lists.freedesktop.org; Wang, Zhi A > 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@lists.freedesktop.org] On Behalf Of Gerd > > Hoffmann > > Sent: Thursday, November 9, 2017 10:10 PM > > To: Zhang, Tina > > Cc: Tian, Kevin ; linux-kernel@vger.kernel.org; > > intel- gfx@lists.freedesktop.org; joonas.lahtinen@linux.intel.com; > > kwankhede@nvidia.com; zhenyuw@linux.intel.com; > > chris@chris-wilson.co.uk; alex.williamson@redhat.com; Lv, Zhiyuan > > ; daniel@ffwll.ch; Yuan, Hang > > ; intel-gvt- dev@lists.freedesktop.org; Wang, Zhi > > A > > 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@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev 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 */