From 74d17cba5c5c560bf09ce1faca56bacda455e46c Mon Sep 17 00:00:00 2001 From: Sathishkumar S Date: Fri, 2 Dec 2022 12:01:03 +0530 Subject: [PATCH] radeonsi/vcn: fix regression in yuv422 jpeg decode - yuv422 decode was blocked in 12acee17fad5, enable it back. - nv12 yuv422 and grayscale decode is supported on all versions. - JPEG2 and higher versions supports 444p decode. - add l8_unorm to supported formats, can be used for grayscale. Fixes: 12acee17fad5 (frontends/va: reallocate surface for yuv400/yuv444 picture) v2: indent the switch case correctly (Thong Thai) Signed-off-by: Sathishkumar S Reviewed-by: Thong Thai Part-of: (cherry picked from commit 7ad4a5079e8ad0b9f3ab7924cc3dfec5f74ea88d) --- .pick_status.json | 2 +- src/gallium/drivers/radeonsi/si_get.c | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f80dc8b..64677a1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -562,7 +562,7 @@ "description": "radeonsi/vcn: fix regression in yuv422 jpeg decode", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "12acee17fad5e939a4fa6ac9ce3bd4753fd0326c" }, diff --git a/src/gallium/drivers/radeonsi/si_get.c b/src/gallium/drivers/radeonsi/si_get.c index 3106332..7a362de3 100644 --- a/src/gallium/drivers/radeonsi/si_get.c +++ b/src/gallium/drivers/radeonsi/si_get.c @@ -854,12 +854,20 @@ static bool si_vid_is_format_supported(struct pipe_screen *screen, enum pipe_for /* JPEG supports YUV400 and YUV444 */ if (profile == PIPE_VIDEO_PROFILE_JPEG_BASELINE) { - if (sscreen->info.family >= CHIP_NAVI21) - return (format == PIPE_FORMAT_NV12 || format == PIPE_FORMAT_Y8_400_UNORM || - format == PIPE_FORMAT_Y8_U8_V8_444_UNORM || format == PIPE_FORMAT_YUYV); - else - return (format == PIPE_FORMAT_NV12); - + switch (format) { + case PIPE_FORMAT_NV12: + case PIPE_FORMAT_YUYV: + case PIPE_FORMAT_L8_UNORM: + case PIPE_FORMAT_Y8_400_UNORM: + return true; + case PIPE_FORMAT_Y8_U8_V8_444_UNORM: + if (sscreen->info.family >= CHIP_RENOIR) + return true; + else + return false; + default: + return false; + } } /* we can only handle this one with UVD */ -- 2.7.4