Mesa (main): vl: fix codec checks to disable properly
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue May 17 19:47:04 UTC 2022
Module: Mesa
Branch: main
Commit: 9c45b541e642979fdea509babdabe01c2b2fe5be
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9c45b541e642979fdea509babdabe01c2b2fe5be
Author: Dave Airlie <airlied at redhat.com>
Date: Tue May 17 10:05:50 2022 +1000
vl: fix codec checks to disable properly
This was wrong and enabled codecs where they shouldn't have been.
Fixes: 7ab05e3c3fe3 ("gallium/vl: respect the video codecs configure in meson")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16542>
---
src/gallium/auxiliary/vl/vl_codec.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/src/gallium/auxiliary/vl/vl_codec.c b/src/gallium/auxiliary/vl/vl_codec.c
index 812222260a1..ce140fedcff 100644
--- a/src/gallium/auxiliary/vl/vl_codec.c
+++ b/src/gallium/auxiliary/vl/vl_codec.c
@@ -35,21 +35,26 @@ bool vl_codec_supported(struct pipe_screen *screen,
if (profile == PIPE_VIDEO_PROFILE_VC1_SIMPLE ||
profile == PIPE_VIDEO_PROFILE_VC1_MAIN ||
profile == PIPE_VIDEO_PROFILE_VC1_ADVANCED) {
- return VIDEO_CODEC_VC1DEC ? true : false;
+ if (!VIDEO_CODEC_VC1DEC)
+ return false;
}
if (profile >= PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE &&
profile <= PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH444) {
- if (encode)
- return VIDEO_CODEC_H264ENC ? true : false;
- else
- return VIDEO_CODEC_H264DEC ? true : false;
+ if (encode) {
+ if (!VIDEO_CODEC_H264ENC)
+ return false;
+ } else if (!VIDEO_CODEC_H264DEC) {
+ return false;
+ }
}
if (profile >= PIPE_VIDEO_PROFILE_HEVC_MAIN &&
profile <= PIPE_VIDEO_PROFILE_HEVC_MAIN_444) {
- if (encode)
- return VIDEO_CODEC_H265ENC ? true : false;
- else
- return VIDEO_CODEC_H265DEC ? true : false;
+ if (encode) {
+ if (!VIDEO_CODEC_H265ENC)
+ return false;
+ } else if (!VIDEO_CODEC_H265DEC) {
+ return false;
+ }
}
return screen->get_video_param(screen, profile, encode ? PIPE_VIDEO_ENTRYPOINT_ENCODE : PIPE_VIDEO_ENTRYPOINT_BITSTREAM, PIPE_VIDEO_CAP_SUPPORTED);
More information about the mesa-commit
mailing list