Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752155AbdFVAVO (ORCPT ); Wed, 21 Jun 2017 20:21:14 -0400 Received: from mga01.intel.com ([192.55.52.88]:64885 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689AbdFVAVN (ORCPT ); Wed, 21 Jun 2017 20:21:13 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,370,1493708400"; d="scan'208";a="115994559" From: "Zhang, Tina" To: Gerd Hoffmann , Alex Williamson CC: "Wang, Zhenyu Z" , "intel-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "Chen, Xiaoguang" , Kirti Wankhede , "Lv, Zhiyuan" , "intel-gvt-dev@lists.freedesktop.org" , "Wang, Zhi A" 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: AQHS6bQOm048yqQnv0S7uYOCurj/4KItUkcAgAEHvtD//4SEAIABJF3Q//+fnoCAAV/ZYA== Date: Thu, 22 Jun 2017 00:21:02 +0000 Message-ID: <237F54289DF84E4997F34151298ABEBC7C5720BD@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> <237F54289DF84E4997F34151298ABEBC7C56EBE0@SHSMSX101.ccr.corp.intel.com> <1497956256.16795.7.camel@redhat.com> <20170620090004.44ac7fbc@w520.home> <237F54289DF84E4997F34151298ABEBC7C56F3DC@SHSMSX101.ccr.corp.intel.com> <20170620172204.09405cf4@w520.home> <237F54289DF84E4997F34151298ABEBC7C56F843@SHSMSX101.ccr.corp.intel.com> <1498043011.5802.5.camel@redhat.com> In-Reply-To: <1498043011.5802.5.camel@redhat.com> 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 v5M0LJeL007625 Content-Length: 3153 Lines: 93 > -----Original Message----- > From: intel-gvt-dev [mailto:intel-gvt-dev-bounces@lists.freedesktop.org] On > Behalf Of Gerd Hoffmann > Sent: Wednesday, June 21, 2017 7:04 PM > To: Zhang, Tina ; Alex Williamson > > Cc: Wang, Zhenyu Z ; intel- > gfx@lists.freedesktop.org; linux-kernel@vger.kernel.org; Chen, Xiaoguang > ; Kirti Wankhede ; Lv, > Zhiyuan ; intel-gvt-dev@lists.freedesktop.org; Wang, > Zhi A > Subject: Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf > operations > > On Wed, 2017-06-21 at 09:20 +0000, Zhang, Tina wrote: > > Thanks for all the comments. I'm planning to cook the next version of > > this patch set > > How about posting only this patch instead of the whole series until we've settled > the interfaces? OK. > > > Could the following two works? > > #define VFIO_DEVICE_FLAGS_DMABUF  (1 << 5)        /* vfio-dmabuf > > device */ > > VFIO_DEVICE_FLAGS_GFX_DMABUF? > > > 2. vfio_device_gfx_plane_info > > struct vfio_device_gfx_plane_info { > > __u64 start;-> offset > > __u64 drm_format_mod; > > __u32 drm_format; > > __u32 width; > > __u32 height; > > __u32 stride; > > __u32 size; > > __u32 x_pos; > > __u32 y_pos; > > }; > > > Does it make sense to have a "generation" field in the plane_info > > > struct (which gets increased each time the struct changes) ? > > > Well,  Gerd, can you share more details about how to use this field in > > user mode, so that we can figure out a way to support it? Thanks. > > generation would be increased each time one of the fields in > vfio_device_gfx_plane_info changes, typically on mode switches (width/height > changes) and pageflips (offset changes). So userspace can simply compare > generation instead of comparing every field to figure whenever something > changed compared to the previous poll. Make sense for dma-buf. Thanks. > > > > > 3. vfio_device_query_gfx_plane > > 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; > > __u32 plane_type; > > }; > > So far, dmabuf use id for DRM_PLANE_TYPE_PRIMARY or > > DRM_PLANE_TYPE_CURSOR. > > > > If the newly added plane_type is used for this, the id field may be > > useless in dmabuf usage. Do you have any idea about the usage of this > > id field in dmabuf usage? > > plane_type should be DRM_PLANE_TYPE_PRIMARY or > DRM_PLANE_TYPE_CURSOR for dmabuf. > > Given that nvidia doesn't support a separate cursor plane in their region they > would support DRM_PLANE_TYPE_PRIMARY only. > > I can't see yet what id would be useful for. > > Likewise I can't see yet what the VFIO_GFX_PLANE_FLAGS_* are good for. > > cheers, > Gerd > > _______________________________________________ > intel-gvt-dev mailing list > intel-gvt-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev