gallium, va: add support for VASurfaceAttribDRMFormatModifiers
authorSimon Ser <contact@emersion.fr>
Fri, 9 Apr 2021 08:25:11 +0000 (10:25 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 22 Apr 2021 15:57:29 +0000 (15:57 +0000)
commit5f101e8096f719a97528c8d15b6ea8fd3a7eae4e
tree4d23b462e670c210a7fc4f96acc1f507f9330bc4
parent74685c8136d9a188764dc7c68675996f19c67248
gallium, va: add support for VASurfaceAttribDRMFormatModifiers

This new surface attribute can be supplied by the client to indicate
a list of modifiers that the driver can choose from for buffer
allocation. This is useful to make sure the buffers allocated via libva
are compatible with the intended usage (e.g. can be scanned out via KMS
or can be imported to EGL).

Introduce a new Gallium pipe_context.create_video_buffer_with_modifiers
hook that drivers can implement if they are modifiers-aware. Add a
modifiers argument to vlVaHandleSurfaceAllocate so that the
user-supplied list of modifiers can be passed down from vaCreateSurfaces
to the Gallium driver.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10237>
meson.build
src/gallium/frontends/va/picture.c
src/gallium/frontends/va/postproc.c
src/gallium/frontends/va/surface.c
src/gallium/frontends/va/va_private.h
src/gallium/include/pipe/p_context.h