From 09bf6910b0e7e83e9ad082c0993dcb04a975ccf0 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Wed, 13 Jan 2021 10:04:02 +0100 Subject: [PATCH] panfrost: Fix panfrost_afbc_format_needs_fixup() This function returns true for PIPE_FORMAT_R8G8B8X8_UNORM, which is wrong. Fixes: 44217be92134 ("panfrost: Adjust the format for AFBC textures on Bifrost v7") Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- .gitlab-ci/deqp-panfrost-g52-fails.txt | 6 ------ src/panfrost/lib/pan_afbc.c | 10 +++++++++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci/deqp-panfrost-g52-fails.txt b/.gitlab-ci/deqp-panfrost-g52-fails.txt index 01c87e7c034..54827ab32cc 100644 --- a/.gitlab-ci/deqp-panfrost-g52-fails.txt +++ b/.gitlab-ci/deqp-panfrost-g52-fails.txt @@ -1,9 +1,3 @@ -dEQP-GLES3.functional.fbo.blit.conversion.rgb8_to_rgba4,Fail -dEQP-GLES3.functional.fbo.blit.conversion.rgb8_to_srgb8_alpha8,Fail -dEQP-GLES3.functional.fbo.blit.default_framebuffer.rgb8,Fail -dEQP-GLES3.functional.fbo.blit.default_framebuffer.rgb8_linear_out_of_bounds_blit_to_default,Fail -dEQP-GLES3.functional.fbo.blit.default_framebuffer.rgb8_linear_scale_blit_to_default,Fail -dEQP-GLES3.functional.fbo.blit.default_framebuffer.rgb8_nearest_scale_blit_to_default,Fail dEQP-GLES3.functional.transform_feedback.random.interleaved.lines.9,Fail dEQP-GLES3.functional.transform_feedback.random.interleaved.points.1,Fail dEQP-GLES3.functional.transform_feedback.random.interleaved.points.3,Fail diff --git a/src/panfrost/lib/pan_afbc.c b/src/panfrost/lib/pan_afbc.c index 50b379daed6..576f67fd970 100644 --- a/src/panfrost/lib/pan_afbc.c +++ b/src/panfrost/lib/pan_afbc.c @@ -151,8 +151,16 @@ panfrost_afbc_format_needs_fixup(const struct panfrost_device *dev, const struct util_format_description *desc = util_format_description(format); + unsigned nr_channels = desc->nr_channels; + + /* rgb1 is a valid component order, don't test channel 3 in that + * case. + */ + if (nr_channels == 4 && desc->swizzle[3] == PIPE_SWIZZLE_1) + nr_channels = 3; + bool identity_swizzle = true; - for (unsigned c = 0; c < desc->nr_channels; c++) { + for (unsigned c = 0; c < nr_channels; c++) { if (desc->swizzle[c] != c) { identity_swizzle = false; break;