From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752772AbdKFJBs (ORCPT ); Mon, 6 Nov 2017 04:01:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60116 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750939AbdKFJBa (ORCPT ); Mon, 6 Nov 2017 04:01:30 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 08ADB81DED Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com Message-ID: <1509958887.30277.4.camel@redhat.com> Subject: Re: [PATCH v16 5/6] vfio: ABI for mdev display dma-buf operation From: Gerd Hoffmann To: Tina Zhang , alex.williamson@redhat.com, chris@chris-wilson.co.uk, joonas.lahtinen@linux.intel.com, zhenyuw@linux.intel.com, zhiyuan.lv@intel.com, zhi.a.wang@intel.com, kevin.tian@intel.com, daniel@ffwll.ch, kwankhede@nvidia.com Cc: intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, linux-kernel@vger.kernel.org, Daniel Vetter Date: Mon, 06 Nov 2017 10:01:27 +0100 In-Reply-To: <1509934758-5003-6-git-send-email-tina.zhang@intel.com> References: <1509934758-5003-1-git-send-email-tina.zhang@intel.com> <1509934758-5003-6-git-send-email-tina.zhang@intel.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 06 Nov 2017 09:01:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > +/** > + * VFIO_DEVICE_QUERY_GFX_PLANE - _IOW(VFIO_TYPE, VFIO_BASE + 14, > + *                                    struct > vfio_device_query_gfx_plane) > + * > + * Set the drm_plane_type and flags, then retrieve the gfx plane > info. > + * > + * flags supported: > + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_DMABUF are > set > + *   to ask if the mdev supports dma-buf. 0 on support, -EINVAL on > no > + *   support for dma-buf. > + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_REGION are > set > + *   to ask if the mdev supports region. 0 on support, -EINVAL on no > + *   support for region. > + * - VFIO_GFX_PLANE_TYPE_DMABUF or VFIO_GFX_PLANE_TYPE_REGION is set > + *   with each call to query the plane info. > + * - Others are invalid and return -EINVAL. > + * > + * Return: 0 on success, -ENODEV with all out fields zero on mdev > + * device initialization, -errno on other failure. Should also not here that it is not an error if the guest has not defined a plane yet. The ioctl should return success in that case and zero-initialize plane info (drm_format + size + width + height fields). > + */ > +struct vfio_device_gfx_plane_info { > + __u32 argsz; > + __u32 flags; > +#define VFIO_GFX_PLANE_TYPE_PROBE (1 << 0) > +#define VFIO_GFX_PLANE_TYPE_DMABUF (1 << 1) > +#define VFIO_GFX_PLANE_TYPE_REGION (1 << 2) > + /* in */ > + __u32 drm_plane_type; /* type of plane: > DRM_PLANE_TYPE_* */ Add a head field here? People asked @ kvm forum about multihead support. Even if the initial driver version doesn't support it we could add a field so it becomes easier to add it at some point in the future. Probing for available heads could be done with the PROBE flag, i.e. flags = PROBE | DMABUF, plane_type = PRIMARY, head = 0, 1, ... > + __u32 x_hot;    /* horizontal position of cursor hotspot */ > + __u32 y_hot;    /* vertical position of cursor hotspot */ Needs documentation how the driver signals "no hotspot information available" (using 0xffffffff for example). cheers, Gerd