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;