Re: [PATCH v6 4/6] vfio: Define vfio based vgpu's dma-buf operations

From: Gerd Hoffmann
Date: Fri Jun 02 2017 - 04:38:30 EST



> struct vfio_vgpu_surface_info {
> ÂÂÂÂÂÂÂÂ__u64 start;
> ÂÂÂÂÂÂÂÂ__u32 width;
> ÂÂÂÂÂÂÂÂ__u32 height;
> ÂÂÂÂÂÂÂÂ__u32 stride;
> ÂÂÂÂÂÂÂÂ__u32 size;
> ÂÂÂÂÂÂÂÂ__u32 x_pos;
> ÂÂÂÂÂÂÂÂ__u32 y_pos;
> ÂÂÂÂÂÂÂÂ__u32 padding;
> ÂÂÂÂÂÂÂÂ/* Only used when VFIO_VGPU_SURFACE_DMABUF_* flags set */
> ÂÂÂÂÂÂÂÂ__u64 drm_format_mod;
> ÂÂÂÂÂÂÂÂ__u32 drm_format;

Why for dmabufs only? Shouldn't the region specify the format too?
Even in case you are using a fixed one (say DRM_FORMAT_XRGB8888) you
can explicitly say so in drm_format (and set drm_format_mod to zero).

cheers,
Gerd