From b39d328dcb0e07ed0295fdf73eb5e75ae2b0a93e Mon Sep 17 00:00:00 2001 From: Ruijing Dong Date: Fri, 25 Aug 2023 17:44:29 -0400 Subject: [PATCH] frontends/va: checking va version for av1enc support need to ensure va version >= 1.16 to support av1enc. Reviewed-by: Leo Liu Signed-off-by: Ruijing Dong Part-of: --- src/gallium/frontends/va/config.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gallium/frontends/va/config.c b/src/gallium/frontends/va/config.c index 84742148e3f..f669a57540f 100644 --- a/src/gallium/frontends/va/config.c +++ b/src/gallium/frontends/va/config.c @@ -77,6 +77,7 @@ vlVaQueryConfigEntrypoints(VADriverContextP ctx, VAProfile profile, { struct pipe_screen *pscreen; enum pipe_video_profile p; + bool check_av1enc_support = false; if (!ctx) return VA_STATUS_ERROR_INVALID_CONTEXT; @@ -98,8 +99,14 @@ vlVaQueryConfigEntrypoints(VADriverContextP ctx, VAProfile profile, if (vl_codec_supported(pscreen, p, false)) entrypoint_list[(*num_entrypoints)++] = VAEntrypointVLD; - if (vl_codec_supported(pscreen, p, true)) - entrypoint_list[(*num_entrypoints)++] = VAEntrypointEncSlice; +#if VA_CHECK_VERSION(1, 16, 0) + if (p == PIPE_VIDEO_PROFILE_AV1_MAIN) + check_av1enc_support = true; +#endif + + if (p != PIPE_VIDEO_PROFILE_AV1_MAIN || check_av1enc_support == true) + if (vl_codec_supported(pscreen, p, true)) + entrypoint_list[(*num_entrypoints)++] = VAEntrypointEncSlice; if (*num_entrypoints == 0) return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;