Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1671443

Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf operations

From Gerd Hoffmann <kraxel@redhat.com>
Newsgroups linux.kernel
Subject Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf operations
Date 2017-06-21 09:40 +0200
Message-ID <tUIp3-38j-1@gated-at.bofh.it> (permalink)
References (6 earlier) <tTYvT-7uN-1@gated-at.bofh.it> <tU6jM-3YD-19@gated-at.bofh.it> <tUn1f-6h1-3@gated-at.bofh.it> <tUp34-7yf-13@gated-at.bofh.it> <tUsWZ-1Ny-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


  Hi,

> We already have VFIO_DEVICE_GET_INFO which returns:
> 
> struct vfio_device_info {
>         __u32   argsz;
>         __u32   flags;
> #define VFIO_DEVICE_FLAGS_RESET (1 << 0)        /* Device supports
> reset */
> #define VFIO_DEVICE_FLAGS_PCI   (1 << 1)        /* vfio-pci device */
> #define VFIO_DEVICE_FLAGS_PLATFORM (1 << 2)     /* vfio-platform
> device */
> #define VFIO_DEVICE_FLAGS_AMBA  (1 << 3)        /* vfio-amba device
> */
> #define VFIO_DEVICE_FLAGS_CCW   (1 << 4)        /* vfio-ccw device */
>         __u32   num_regions;    /* Max region index + 1 */
>         __u32   num_irqs;       /* Max IRQ index + 1 */
> };
> 
> We could use two flag bits to indicate dmabuf or graphics region
> support.

That works too.

> > Then this to query the plane:
> > 
> > struct vfio_device_gfx_query_plane {
> >         __u32 argsz;
> >         __u32 flags;
> >         struct vfio_device_gfx_plane_info plane_info;  /* out */
> >         __u32 plane_type;                              /* in  */
> > };
> 
> I'm not sure why we're using an enum for something that can currently
> be defined with 2 bits,

We can reuse the DRM_PLANE_TYPE_* then.

>  seems like this would be another good use of
> flags.  We could even embed an enum into the flags if we want to
> leave some expansion room, 4 bits maybe?  Also, I was imagining that
> a
> device could support multiple graphics regions, that's where
> specifying
> the "id" as a region index seemed useful.

Hmm, yes, possibly for multihead configurations.  But I guess for
proper multihead support we would need more than just an region id.

Or do you have something else in mind?

> > With the generation we can also do something different:  Pass in
> > plane_type and generation, and have VFIO_DEVICE_GET_DMABUF_FD
> > return
> > an error in case the generation doesn't match.  In that case it
> > doesn't
> > make much sense any more to have a separate plane_info struct,
> > which
> > was added so we don't have to duplicate things in query-plane and
> > get-
> > dmabuf ioctl structs.
> 
> I'm not sure I understand how this works for a region, the region is
> always the current generation, how can the user ever be sure the
> plane_info matches what is exposed in the region?

generation will change each time the plane configuration (not content)
changes.  Typically that will be on video mode switches.  In the dmabuf
case also on pageflips.

cheers,
  Gerd

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

RE: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf         operations "Zhang, Tina" <tina.zhang@intel.com> - 2017-06-20 10:50 +0200
  Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Gerd Hoffmann <kraxel@redhat.com> - 2017-06-20 13:00 +0200
    Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Alex Williamson <alex.williamson@redhat.com> - 2017-06-20 17:10 +0200
      Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Kirti Wankhede <kwankhede@nvidia.com> - 2017-06-20 19:10 +0200
      RE: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations "Zhang, Tina" <tina.zhang@intel.com> - 2017-06-21 01:10 +0200
        Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Alex Williamson <alex.williamson@redhat.com> - 2017-06-21 01:30 +0200
          RE: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations "Zhang, Tina" <tina.zhang@intel.com> - 2017-06-21 11:30 +0200
            Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Gerd Hoffmann <kraxel@redhat.com> - 2017-06-21 13:10 +0200
              Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Alex Williamson <alex.williamson@redhat.com> - 2017-06-21 21:00 +0200
                Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Gerd Hoffmann <kraxel@redhat.com> - 2017-06-22 10:40 +0200
                Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Alex Williamson <alex.williamson@redhat.com> - 2017-06-22 21:00 +0200
                Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Gerd Hoffmann <kraxel@redhat.com> - 2017-06-23 09:30 +0200
                Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf operations Zhi Wang <zhi.a.wang@intel.com> - 2017-06-23 10:10 +0200
                Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Gerd Hoffmann <kraxel@redhat.com> - 2017-06-23 10:40 +0200
                Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Alex Williamson <alex.williamson@redhat.com> - 2017-06-23 18:50 +0200
                Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Alex Williamson <alex.williamson@redhat.com> - 2017-06-23 19:20 +0200
                Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Gerd Hoffmann <kraxel@redhat.com> - 2017-06-26 08:20 +0200
              RE: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations "Zhang, Tina" <tina.zhang@intel.com> - 2017-06-22 02:30 +0200
      Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Gerd Hoffmann <kraxel@redhat.com> - 2017-06-21 09:40 +0200
    RE: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations "Zhang, Tina" <tina.zhang@intel.com> - 2017-06-24 00:00 +0200
      Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Gerd Hoffmann <kraxel@redhat.com> - 2017-06-26 08:40 +0200
        Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Alex Williamson <alex.williamson@redhat.com> - 2017-06-26 19:30 +0200
          Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Gerd Hoffmann <kraxel@redhat.com> - 2017-06-27 08:20 +0200
            RE: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations "Zhang, Tina" <tina.zhang@intel.com> - 2017-06-28 14:50 +0200
              Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Gerd Hoffmann <kraxel@redhat.com> - 2017-06-29 08:50 +0200
                Re: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf  operations Daniel Vetter <daniel@ffwll.ch> - 2017-06-29 10:40 +0200

csiph-web