frontends/va: Assert maximum number of temporal layers

There is a hardcoded limit of 4 layers in all structs, so make sure
drivers will not return more.

Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30151>
This commit is contained in:
David Rosca 2024-07-15 16:46:40 +02:00 committed by Marge Bot
parent 384057076a
commit 1283f43527

View file

@ -281,6 +281,7 @@ vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint en
value = pscreen->get_video_param(pscreen, ProfileToPipe(profile),
PIPE_VIDEO_ENTRYPOINT_ENCODE,
PIPE_VIDEO_CAP_MAX_TEMPORAL_LAYERS);
assert(value <= 4);
if (value > 0) {
value -= 1;
value |= (1 << 8); /* temporal_layer_bitrate_control_flag */