Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756214AbdGLCUL (ORCPT ); Tue, 11 Jul 2017 22:20:11 -0400 Received: from mga11.intel.com ([192.55.52.93]:34507 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756063AbdGLCUI (ORCPT ); Tue, 11 Jul 2017 22:20:08 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,347,1496127600"; d="scan'208";a="126024670" From: "Zhang, Tina" To: Kirti Wankhede , "alex.williamson@redhat.com" , "kraxel@redhat.com" , "chris@chris-wilson.co.uk" , "zhenyuw@linux.intel.com" , "Lv, Zhiyuan" , "Wang, Zhi A" , "Tian, Kevin" , "daniel@ffwll.ch" CC: "intel-gfx@lists.freedesktop.org" , "intel-gvt-dev@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v10] vfio: ABI for mdev display dma-buf operation Thread-Topic: [PATCH v10] vfio: ABI for mdev display dma-buf operation Thread-Index: AQHS9d72/JOqiz5kqkOIoMWmOT5rIKJGTuYAgAkv4iA= Date: Wed, 12 Jul 2017 02:20:04 +0000 Message-ID: <237F54289DF84E4997F34151298ABEBC7C57BF60@SHSMSX101.ccr.corp.intel.com> References: <1499293795-6265-1-git-send-email-tina.zhang@intel.com> <980a5c09-fa8a-255d-19ad-acf4bb29d271@nvidia.com> In-Reply-To: <980a5c09-fa8a-255d-19ad-acf4bb29d271@nvidia.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 nfs id v6C2KIgI024282 Content-Length: 2551 Lines: 83 > -----Original Message----- > From: Kirti Wankhede [mailto:kwankhede@nvidia.com] > Sent: Thursday, July 6, 2017 10:02 PM > To: Zhang, Tina ; alex.williamson@redhat.com; > kraxel@redhat.com; chris@chris-wilson.co.uk; zhenyuw@linux.intel.com; Lv, > Zhiyuan ; Wang, Zhi A ; Tian, > Kevin ; daniel@ffwll.ch > Cc: intel-gfx@lists.freedesktop.org; intel-gvt-dev@lists.freedesktop.org; linux- > kernel@vger.kernel.org > Subject: Re: [PATCH v10] vfio: ABI for mdev display dma-buf operation > > > > On 7/6/2017 3:59 AM, Tina Zhang wrote: > > Add VFIO_DEVICE_QUERY_GFX_PLANE ioctl command to let user mode query > > and get the plan and its related information. > > > > The dma-buf's life cycle is handled by user mode and tracked by kernel. > > The returned fd in struct vfio_device_query_gfx_plane can be a new fd > > or an old fd of a re-exported dma-buf. Host User mode can check the > > value of fd and to see if it need to creat new resource according to > > the new fd or just use the existed resource related to the old fd. > > > > Signed-off-by: Tina Zhang > > > > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > > index ae46105..c92bc69 100644 > > --- a/include/uapi/linux/vfio.h > > +++ b/include/uapi/linux/vfio.h > > @@ -502,6 +502,36 @@ struct vfio_pci_hot_reset { > > > > #define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + > 13) > > > > +/** > > + * VFIO_DEVICE_QUERY_GFX_PLANE - _IOW(VFIO_TYPE, VFIO_BASE + 14, > > + * struct vfio_device_query_gfx_plane) > > + * Return: 0 on success, -errno on failure. > > + */ > > + > > +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; > > +}; > > + > > Above structure looks good to me. > > > +struct vfio_device_query_gfx_plane { > > + __u32 argsz; > > + __u32 flags; > > + struct vfio_device_gfx_plane_info plane_info; > > + __u32 plane_type; > > + __s32 fd; /* dma-buf fd */ > > + __u32 plane_id; > > +}; > > + > > It would be better to have comment here about what are expected values for > plane_type and plane_id. I will add the comments for these fields. Thanks. Tina > > Thanks, > Kirti > > > +#define VFIO_DEVICE_QUERY_GFX_PLANE _IO(VFIO_TYPE, VFIO_BASE + 14) > > + > > + > > /* -------- API for Type1 VFIO IOMMU -------- */ > > > > /** > >