public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: "Zhang, Tina" <tina.zhang@intel.com>
Cc: "Tian, Kevin" <kevin.tian@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"kwankhede@nvidia.com" <kwankhede@nvidia.com>,
	"kraxel@redhat.com" <kraxel@redhat.com>,
	"intel-gvt-dev@lists.freedesktop.org"
	<intel-gvt-dev@lists.freedesktop.org>,
	"Wang, Zhi A" <zhi.a.wang@intel.com>,
	"Lv, Zhiyuan" <zhiyuan.lv@intel.com>
Subject: Re: [PATCH v13 5/7] vfio: ABI for mdev display dma-buf operation
Date: Wed, 2 Aug 2017 21:37:43 -0600	[thread overview]
Message-ID: <20170802213743.6390b4d9@w520.home> (raw)
In-Reply-To: <237F54289DF84E4997F34151298ABEBC7C58C778@SHSMSX101.ccr.corp.intel.com>

On Thu, 3 Aug 2017 03:17:09 +0000
"Zhang, Tina" <tina.zhang@intel.com> wrote:

> > -----Original Message-----
> > From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of
> > Alex Williamson
> > Sent: Wednesday, August 2, 2017 5:18 AM
> > To: Zhang, Tina <tina.zhang@intel.com>
> > Cc: Tian, Kevin <kevin.tian@intel.com>; kraxel@redhat.com; intel-
> > gfx@lists.freedesktop.org; Wang, Zhi A <zhi.a.wang@intel.com>;
> > kwankhede@nvidia.com; dri-devel@lists.freedesktop.org; intel-gvt-
> > dev@lists.freedesktop.org; Lv, Zhiyuan <zhiyuan.lv@intel.com>
> > Subject: Re: [PATCH v13 5/7] vfio: ABI for mdev display dma-buf operation
> > 
> > On Tue, 25 Jul 2017 17:28:18 +0800
> > Tina Zhang <tina.zhang@intel.com> 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 needs to create new resource according to
> > > the new fd or just use the existed resource related to the old fd.
> > >
> > > Signed-off-by: Tina Zhang <tina.zhang@intel.com>
> > > ---
> > >  include/uapi/linux/vfio.h | 28 ++++++++++++++++++++++++++++
> > >  1 file changed, 28 insertions(+)
> > >
> > > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
> > > index ae46105..827a230 100644
> > > --- a/include/uapi/linux/vfio.h
> > > +++ b/include/uapi/linux/vfio.h
> > > @@ -502,6 +502,34 @@ 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)
> > > + *
> > > + * Set the drm_plane_type and retrieve information about the gfx plane.
> > > + *
> > > + * Return: 0 on success, -errno on failure.
> > > + */
> > > +struct vfio_device_gfx_plane_info {
> > > +	__u32 argsz;
> > > +	__u32 flags;
> > > +	/* in */
> > > +	__u32 drm_plane_type;	/* type of plane: DRM_PLANE_TYPE_* */
> > > +	/* out */
> > > +	__u32 drm_format;	/* drm format of plane */
> > > +	__u64 drm_format_mod;   /* tiled mode */
> > > +	__u32 width;	/* width of plane */
> > > +	__u32 height;	/* height of plane */
> > > +	__u32 stride;	/* stride of plane */
> > > +	__u32 size;	/* size of plane in bytes, align on page*/
> > > +	__u32 x_pos;	/* horizontal position of cursor plane, upper left corner  
> > in pixels */  
> > > +	__u32 y_pos;	/* vertical position of cursor plane, upper left corner in  
> > lines*/  
> > > +	__u32 region_index;
> > > +	__s32 fd;	/* dma-buf fd */  
> > 
> > How do I know which of these is valid, region_index or fd?  Can I ask for one vs
> > the other?  What are the errno values to differentiate unsupported vs not
> > initialized?  Is there a "probe" flag that I can use to determine what the device
> > supports without allocating those resources yet?  
> Dma-buf won't use region_index, which means region_index is zero all the time for dma-buf usage. 
> As we discussed, there won't be errno if not initialized, just keep all fields zero.
> I will add the comments about these in the next version. Thanks

Zero is a valid region index.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-08-03  3:37 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25  9:28 [PATCH v13 0/7] drm/i915/gvt: Dma-buf support for GVT-g Tina Zhang
2017-07-25  9:28 ` [PATCH v13 1/7] drm/i915/gvt: Add framebuffer decoder support Tina Zhang
2017-07-25  9:28 ` [PATCH v13 2/7] drm: Introduce RGB 64-bit 16:16:16:16 float format Tina Zhang
2017-08-15 14:49   ` Daniel Vetter
2017-08-16  3:16     ` Zhang, Tina
2017-08-16  7:31       ` Daniel Vetter
2017-07-25  9:28 ` [PATCH v13 3/7] drm/i915/gvt: Add RGB 64-bit 16:16:16:16 float format support Tina Zhang
2017-07-25  9:28 ` [PATCH v13 4/7] drm/i915/gvt: Add opregion support Tina Zhang
2017-07-25  9:28 ` [PATCH v13 5/7] vfio: ABI for mdev display dma-buf operation Tina Zhang
2017-07-28  8:27   ` Gerd Hoffmann
2017-07-31  0:31     ` Zhang, Tina
2017-08-01 21:18   ` Alex Williamson
2017-08-02 15:56     ` Kirti Wankhede
2017-08-03  3:17     ` Zhang, Tina
2017-08-03  3:37       ` Alex Williamson [this message]
2017-08-03  7:08         ` Zhang, Tina
2017-08-03 14:42           ` Alex Williamson
2017-08-07  3:22             ` Zhang, Tina
2017-08-07  8:11             ` Zhang, Tina
2017-08-07 17:43               ` Alex Williamson
2017-08-08  8:48                 ` Kirti Wankhede
2017-08-08 18:07                   ` Alex Williamson
2017-08-09 13:57                     ` Kirti Wankhede
2017-08-09  8:31                 ` Zhang, Tina
2017-08-09 16:57                   ` Alex Williamson
2017-08-22  8:24                     ` Gerd Hoffmann
2017-07-25  9:28 ` [PATCH v13 6/7] drm/i915: Introduce GEM proxy Tina Zhang
2017-08-07  8:24   ` [Intel-gfx] " Joonas Lahtinen
2017-08-09  6:25     ` Zhang, Tina
2017-07-25  9:28 ` [PATCH v13 7/7] drm/i915/gvt: Dmabuf support for GVT-g Tina Zhang
2017-07-25  9:55 ` ✗ Fi.CI.BAT: warning for drm/i915/gvt: Dma-buf " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170802213743.6390b4d9@w520.home \
    --to=alex.williamson@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=kevin.tian@intel.com \
    --cc=kraxel@redhat.com \
    --cc=kwankhede@nvidia.com \
    --cc=tina.zhang@intel.com \
    --cc=zhi.a.wang@intel.com \
    --cc=zhiyuan.lv@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox