Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752121AbdFOQAm (ORCPT ); Thu, 15 Jun 2017 12:00:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5694 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751979AbdFOQAl (ORCPT ); Thu, 15 Jun 2017 12:00:41 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6AB7DC04B326 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kraxel@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6AB7DC04B326 Message-ID: <1497542438.29252.1.camel@redhat.com> Subject: Re: [PATCH v9 5/7] vfio: Define vfio based dma-buf operations From: Gerd Hoffmann To: Kirti Wankhede , Xiaoguang Chen , alex.williamson@redhat.com, chris@chris-wilson.co.uk, 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: Thu, 15 Jun 2017 18:00:38 +0200 In-Reply-To: References: <1497513611-2814-1-git-send-email-xiaoguang.chen@intel.com> <1497513611-2814-6-git-send-email-xiaoguang.chen@intel.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 15 Jun 2017 16:00:40 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1105 Lines: 45 Hi, > > +struct vfio_dmabuf_mgr_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 padding; > > +}; > > + > > This structure is generic, can remove dmabuf from its name, > vfio_plane_info or vfio_vgpu_surface_info since this will only be > used > by vgpu. Agree. > > +struct vfio_dmabuf_mgr_query_plane { > > + __u32 argsz; > > + __u32 flags; > > + struct vfio_dmabuf_mgr_plane_info plane_info; > > + __u32 plane_id; > > +}; > > + > > +#define VFIO_DMABUF_MGR_QUERY_PLANE _IO(VFIO_TYPE, VFIO_BASE + 15) > > + > > This same interface can be used to query surface/plane information > for > both, dmabuf and region, case. Here also 'DMABUF' can be removed and > define flags if you want to differentiate query for 'dmabuf' and > 'region'. Hmm, any specific reason why you want use a ioctl for that? I would simply place a "struct vfio_dmabuf_mgr_plane_info" (or whatever the final name will be) at the start of the region. cheers, Gerd