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

From: Kirti Wankhede
Date: Mon Jun 05 2017 - 04:27:14 EST




On 6/2/2017 2:08 PM, Gerd Hoffmann wrote:
>
>> 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).
>

Definitions for PIXMAN formats and DRM formats are different. I think
we need a flag to specify the format of surface that vendor driver is
going to provide, PIXMAN or DRM.
If surface is provided through region in PIXMAN format, existing
functions in QEMU can be used to get format from bpp value,
qemu_default_pixman_format(). Similarly, display surface can be updated
by QEMU using qemu_create_displaysurface_from() from mmaped region.

Thanks,
Kirti

> cheers,
> Gerd
>