[virglrenderer-devel] coherent memory access for virgl

Gurchetan Singh gurchetansingh at chromium.org
Wed Oct 3 03:56:54 UTC 2018


On Mon, Oct 1, 2018 at 10:38 PM Gerd Hoffmann <kraxel at redhat.com> wrote:
>
>   Hi,
>
> > > > For example, on some ARM devices, AFBC can be only used on the (host)
> > > > primary KMS plane.
> > >
> > > What is AFBC?  Some drm format modifier?
> >
> > Yes, it stands for ARM frame buffer compression and it's widely used
> > on that architecture.
>
> Speaking of compression:  How does buffer size calculation and buffer
> allocation work in case compression is used?

There's a header + compressed data or an auxiliary buffer.  Here are
some examples:

https://chromium.googlesource.com/chromiumos/platform/minigbm/+/master/rockchip.c#33
https://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/drivers/dri/i965/intel_screen.c#n735

>
> > Speaking of reallocation, the current Linux modifier API
> > (gbm_bo_create_with_modifiers) passes in a list of supported modifiers
> > for gbm to allocate from.  Assuming we do think of a way to notify the
> > guest about the available KMS-supported modifiers, any new allocation
> > ioctl will probably need to pass the modifier list to the host.
>
> How does mesa handle modifiers?  Does it use the drm modifiers directly?
> Or has mesa/gallium its own naming scheme?
>
> Right now the format specification used by virtio is based on gallium
> formats ...

The modifiers are from DRM, and drm_fourcc.h is considered the source
of truth (I guess that's where some of the problems with v4l2
integration arise).

Anyways, here are the conclusions that I can discern from this discussion:

1) Host mapped memory should be fine, as long it's optional for the VMM
2) Texture uploads can be improved.  BTW, what's the benefit of
udmabuf over an iov with one element for say a 5-level texture?
3) Coherent memory ioctl needed for Vulkan/gl4.5
4) The new ioctl should take into account format modifiers
5) The DRM_VIRTGPU_RESOURCE_INFO needs to be fixed and expanded for
(1), (3) and (4)
6) There's no clear path forward on how to pipe host display
information to the guest, such that the guest can know which modifier
is the best.  Hopefully, the wayland proxying Collabora is working on
can clear this up..

Let me know if anything is incorrect, since we may start implementing
(1) and (2) for performance reasons ;-)

>
> cheers,
>   Gerd
>


More information about the virglrenderer-devel mailing list