Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751105AbdFTIlt (ORCPT ); Tue, 20 Jun 2017 04:41:49 -0400 Received: from mga11.intel.com ([192.55.52.93]:53058 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbdFTIlr (ORCPT ); Tue, 20 Jun 2017 04:41:47 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,364,1493708400"; d="scan'208";a="117028243" From: "Zhang, Tina" To: Alex Williamson , Gerd Hoffmann CC: "intel-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , Kirti Wankhede , "Chen, Xiaoguang" , "intel-gvt-dev@lists.freedesktop.org" , "Lv, Zhiyuan" , "Wang, Zhi A" , "Wang, Zhenyu Z" Subject: RE: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf operations Thread-Topic: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf operations Thread-Index: AQHS6Qwnmlgah+tea06vB151V/Z3CaItahsQ Date: Tue, 20 Jun 2017 08:41:44 +0000 Message-ID: <237F54289DF84E4997F34151298ABEBC7C56EBE0@SHSMSX101.ccr.corp.intel.com> References: <1497513611-2814-1-git-send-email-xiaoguang.chen@intel.com> <1497513611-2814-6-git-send-email-xiaoguang.chen@intel.com> <1497542438.29252.1.camel@redhat.com> <20170615143833.7526351b@w520.home> <24c4880b-24f5-ea07-834c-c77d3e895c78@nvidia.com> <1497854312.4207.4.camel@redhat.com> <20170619085530.1f5e46dc@w520.home> In-Reply-To: <20170619085530.1f5e46dc@w520.home> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v5K8fx5N019705 Content-Length: 2412 Lines: 76 Hi, Thanks for all the comments. Here are the summaries: 1. Modify the structures to make it more general. struct vfio_device_gfx_plane_info { __u64 start; __u64 drm_format_mod; __u32 drm_format; __u32 width; __u32 height; __u32 stride; __u32 size; __u32 x_pos; __u32 y_pos; __u32 generation; }; struct vfio_device_query_gfx_plane { __u32 argsz; __u32 flags; #define VFIO_GFX_PLANE_FLAGS_REGION_ID (1 << 0) #define VFIO_GFX_PLANE_FLAGS_PLANE_ID (1 << 1) struct vfio_device_gfx_plane_info plane_info; __u32 id; }; 2. Remove dmabuf mgr fd and add these two ioctl commands to the vfio device fd. VFIO_DEVICE_QUERY_GFX_PLANE : used to query vfio_device_gfx_plane_info. VFIO_DEVICE_GET_DMABUF_FD: used to create and return the dmabuf fd. Am I correct? Thanks. Tina > -----Original Message----- > From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of > Alex Williamson > Sent: Monday, June 19, 2017 10:56 PM > To: Gerd Hoffmann > Cc: intel-gfx@lists.freedesktop.org; linux-kernel@vger.kernel.org; Kirti > Wankhede ; Chen, Xiaoguang > ; intel-gvt-dev@lists.freedesktop.org; Lv, Zhiyuan > > Subject: Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf > operations > > On Mon, 19 Jun 2017 08:38:32 +0200 > Gerd Hoffmann wrote: > > > Hi, > > > > > My suggestion was to use vfio device fd for this ioctl and have > > > dmabuf mgr fd as member in above query_plane structure, for region > > > type it would be set to 0. > > > > Region type should be DRM_PLANE_TYPE_PRIMARY > > > > > Can't mmap that page to get surface information. There is no way to > > > synchronize between QEMU reading this mmapped region and vendor > > > driver writing it. There could be race condition in these two > > > operations. > > > Read > > > on this page should be trapped and blocking, so that surface in that > > > region is only updated when its asked for. > > > > Does it make sense to have a "generation" field in the plane_info > > struct (which gets increased each time the struct changes) ? > > It seems less cumbersome than checking each field to see if it has changed. > Thanks, > > Alex > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx