From 0504a3b079223ea243fa479701967ae3ead12a40 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Mon, 23 Jan 2023 18:36:26 +0800 Subject: [PATCH] radeonsi: correctly declare YUV420_10 RT Format support for AV1 This appears to have been an oversight. AV1 Main profile requires support for both 8bit and 10bit, and so we should always declare support for the YUV420_10 RT Format. This support then cascades into supporting the appropriate surface formats and meets expectations of vaapi clients (especially ffmpeg based) on how to detect support for these formats. Note that the commit [0b02db3007] was also made with the intention of fixing this problem, but it does so in a non-idiomatic way. With that change, there is still no declared YUV420_10 RT Format, and instead the P010 surface format is reported under the YUV420 RT Format. This is not going to work with all vaapi clients. I recommend that this commit be reverted. Signed-off-by: Philip Langdale Reviewed-by: Ruijing Dong Part-of: --- src/gallium/drivers/radeonsi/si_get.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_get.c b/src/gallium/drivers/radeonsi/si_get.c index aee9b7477f2..3b7ee97731b 100644 --- a/src/gallium/drivers/radeonsi/si_get.c +++ b/src/gallium/drivers/radeonsi/si_get.c @@ -854,6 +854,9 @@ static bool si_vid_is_format_supported(struct pipe_screen *screen, enum pipe_for if (profile == PIPE_VIDEO_PROFILE_VP9_PROFILE2) return (format == PIPE_FORMAT_P010) || (format == PIPE_FORMAT_P016); + if (profile == PIPE_VIDEO_PROFILE_AV1_MAIN) + return (format == PIPE_FORMAT_P010) || (format == PIPE_FORMAT_P016); + /* JPEG supports YUV400 and YUV444 */ if (profile == PIPE_VIDEO_PROFILE_JPEG_BASELINE) { switch (format) {