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>
This commit is contained in:
Simon Ser
2021-04-09 10:25:11 +02:00
committed by Marge Bot
parent 74685c8136
commit 5f101e8096
6 changed files with 69 additions and 14 deletions
+8
View File
@@ -1101,6 +1101,14 @@ struct pipe_context {
void (*set_context_param)(struct pipe_context *ctx,
enum pipe_context_param param,
unsigned value);
/**
* Creates a video buffer as decoding target, with modifiers.
*/
struct pipe_video_buffer *(*create_video_buffer_with_modifiers)(struct pipe_context *context,
const struct pipe_video_buffer *templat,
const uint64_t *modifiers,
unsigned int modifiers_count);
};