From 527def0171b0eeaa66ddfe7d0b82ee8b29cd2837 Mon Sep 17 00:00:00 2001 From: Sil Vilerino Date: Sat, 28 Oct 2023 11:19:10 -0400 Subject: [PATCH] gallium/vl: Check for VP9 and AV1 meson option support flags Reviewed-by: Jesse Natalie Reviewed-by: Ruijing Dong Part-of: --- src/gallium/auxiliary/vl/vl_codec.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gallium/auxiliary/vl/vl_codec.c b/src/gallium/auxiliary/vl/vl_codec.c index ce140fedcff..b7876f6e645 100644 --- a/src/gallium/auxiliary/vl/vl_codec.c +++ b/src/gallium/auxiliary/vl/vl_codec.c @@ -32,6 +32,20 @@ bool vl_codec_supported(struct pipe_screen *screen, enum pipe_video_profile profile, bool encode) { + static_assert(PIPE_VIDEO_PROFILE_MAX == 26, "Update table below when adding new video profiles"); + if (profile == PIPE_VIDEO_PROFILE_AV1_MAIN) { + if (encode) { + if (!VIDEO_CODEC_AV1ENC) + return false; + } else if (!VIDEO_CODEC_AV1DEC) { + return false; + } + } + if (profile == PIPE_VIDEO_PROFILE_VP9_PROFILE0 || + profile == PIPE_VIDEO_PROFILE_VP9_PROFILE2) { + if (!VIDEO_CODEC_VP9DEC) + return false; + } if (profile == PIPE_VIDEO_PROFILE_VC1_SIMPLE || profile == PIPE_VIDEO_PROFILE_VC1_MAIN || profile == PIPE_VIDEO_PROFILE_VC1_ADVANCED) {