From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937195AbdEWOKO convert rfc822-to-8bit (ORCPT ); Tue, 23 May 2017 10:10:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39506 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936261AbdEWOKL (ORCPT ); Tue, 23 May 2017 10:10:11 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 89C6D7F4A4 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kraxel@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 89C6D7F4A4 Message-ID: <1495548597.30747.8.camel@redhat.com> Subject: Re: [PATCH v5 5/5] drm/i915/gvt: Adding interface so user space can get the dma-buf From: Gerd Hoffmann To: Xiaoguang Chen , alex.williamson@redhat.com, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, zhenyuw@linux.intel.com, zhiyuan.lv@intel.com, intel-gvt-dev@lists.freedesktop.org, zhi.a.wang@intel.com, kevin.tian@intel.com Date: Tue, 23 May 2017 16:09:57 +0200 In-Reply-To: <1495535521-2120-6-git-send-email-xiaoguang.chen@intel.com> References: <1495535521-2120-1-git-send-email-xiaoguang.chen@intel.com> <1495535521-2120-6-git-send-email-xiaoguang.chen@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 23 May 2017 14:10:01 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > index ae46105..285dc16 100644 > --- a/include/uapi/linux/vfio.h > +++ b/include/uapi/linux/vfio.h > @@ -502,10 +502,58 @@ struct vfio_pci_hot_reset { >   >  #define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + > 13) >   > +/** > + * VFIO_DEVICE_GET_FD - _IO(VFIO_TYPE, VFIO_BASE + 14, __u32) > + * > + * Create a fd for a vfio device based on the input type > + * Vendor driver should handle this ioctl to create a fd and manage > the > + * life cycle of this fd. > + * > + * Return: a fd if vendor support that type, -errno if not supported > + */ > + > +#define VFIO_DEVICE_GET_FD _IO(VFIO_TYPE, VFIO_BASE + 14) > + > +#define VFIO_DEVICE_DMABUF_MGR_FD 0 /* Supported fd types */ > + > +/* > + * VFIO_DEVICE_QUERY_PLANE - _IO(VFIO_TYPE, VFIO_BASE + 15, struct > plane_info) > + * Query plane information for a plane > + */ > +struct plane_info { That is a pretty generic name. vfio_vgpu_plane_info? Or vfio_dmabuf_plane_info? > + __u32 plane_id; > + __u32 drm_format; > + __u32 width; > + __u32 height; > + __u32 stride; > + __u32 start; > + __u32 x_pos; > + __u32 y_pos; > + __u32 size; > + __u64 drm_format_mod; > +}; > + > +#define VFIO_PRIMARY_PLANE 1 > +#define VFIO_CURSOR_PLANE 2 I think we should use "enum drm_plane_type" values instead of creating something new. cheers, Gerd