Mesa (master): panfrost: Fix panfrost_afbc_format_needs_fixup()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 13 14:19:34 UTC 2021


Module: Mesa
Branch: master
Commit: 09bf6910b0e7e83e9ad082c0993dcb04a975ccf0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=09bf6910b0e7e83e9ad082c0993dcb04a975ccf0

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Wed Jan 13 10:04:02 2021 +0100

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 <boris.brezillon at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8466>

---

 .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;



More information about the mesa-commit mailing list