• T
    vfio: ABI for mdev display dma-buf operation · e20eaa23
    Tina Zhang 提交于
    Add VFIO_DEVICE_QUERY_GFX_PLANE ioctl command to let user query and get
    a plane and its information. So far, two types of buffers are supported:
    buffers based on dma-buf and buffers based on region.
    
    This ioctl can be invoked with:
    1) Either DMABUF or REGION flag. Vendor driver returns a plane_info
    successfully only when the specific kind of buffer is supported.
    2) Flag PROBE. And at the same time either DMABUF or REGION must be set,
    so that vendor driver returns success only when the specific kind of
    buffer is supported.
    
    Add VFIO_DEVICE_GET_GFX_DMABUF ioctl command to let user get a specific
    dma-buf fd of an exposed MDEV buffer provided by dmabuf_id which was
    returned in VFIO_DEVICE_QUERY_GFX_PLANE ioctl command.
    
    The life cycle of an exposed MDEV buffer is handled by userspace and
    tracked by kernel space. The returned dmabuf_id in struct vfio_device_
    query_gfx_plane can be a new id of a new exposed buffer or an old id of
    a re-exported buffer. Host user can check the value of dmabuf_id to see
    if it needs to create new resources according to the new exposed buffer
    or just re-use the existing resource related to the old buffer.
    
    v18:
    - update comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex)
    
    v17:
    - modify VFIO_DEVICE_GET_GFX_DMABUF interface. (Alex)
    
    v16:
    - add x_hot and y_hot fields. (Gerd)
    - add comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex)
    - rebase to 4.14.0-rc6.
    
    v15:
    - add a ioctl to get a dmabuf for a given dmabuf id. (Gerd)
    
    v14:
    - add PROBE, DMABUF and REGION flags. (Alex)
    
    v12:
    - add drm_format_mod back. (Gerd and Zhenyu)
    - add region_index. (Gerd)
    
    v11:
    - rename plane_type to drm_plane_type. (Gerd)
    - move fields of vfio_device_query_gfx_plane to vfio_device_gfx_plane_info.
      (Gerd)
    - remove drm_format_mod, start fields. (Daniel)
    - remove plane_id.
    
    v10:
    - refine the ABI API VFIO_DEVICE_QUERY_GFX_PLANE. (Alex) (Gerd)
    
    v3:
    - add a field gvt_plane_info in the drm_i915_gem_obj structure to save
      the decoded plane information to avoid look up while need the plane
      info. (Gerd)
    Signed-off-by: NTina Zhang <tina.zhang@intel.com>
    Reviewed-by: NGerd Hoffmann <kraxel@redhat.com>
    Reviewed-by: NKirti Wankhede <kwankhede@nvidia.com>
    Acked-by: NAlex Williamson <alex.williamson@redhat.com>
    Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
    e20eaa23
vfio.h 27.5 KB