Mesa (main): panfrost: Inline pan_fbd_has_zs_crc_ext

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 13 16:02:52 UTC 2022


Module: Mesa
Branch: main
Commit: cac0578ee58c5b0838ececbe2b7aa5f7c29874c3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cac0578ee58c5b0838ececbe2b7aa5f7c29874c3

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Fri Jun 10 11:43:53 2022 -0400

panfrost: Inline pan_fbd_has_zs_crc_ext

It has a single user -- in a section of code that only runs for MFBD GPUs and
that has already decided whether to use CRCs -- so inlining it simplifies its
definition greatly and may avoid redeciding the CRC setting.

[Note for mesa-stable maintainers: This is not a bug fix but is marked for
backport so the next patch applies cleanly.]

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16983>

---

 src/panfrost/lib/pan_cs.c | 2 +-
 src/panfrost/lib/pan_cs.h | 8 --------
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/src/panfrost/lib/pan_cs.c b/src/panfrost/lib/pan_cs.c
index 41b46a9a441..3e115a050d3 100644
--- a/src/panfrost/lib/pan_cs.c
+++ b/src/panfrost/lib/pan_cs.c
@@ -694,7 +694,7 @@ GENX(pan_emit_fbd)(const struct panfrost_device *dev,
         unsigned tile_size;
         unsigned internal_cbuf_size = pan_internal_cbuf_size(fb, &tile_size);
         int crc_rt = GENX(pan_select_crc_rt)(fb);
-        bool has_zs_crc_ext = pan_fbd_has_zs_crc_ext(fb);
+        bool has_zs_crc_ext = (fb->zs.view.zs || fb->zs.view.s || crc_rt >= 0);
 
         pan_section_pack(fbd, FRAMEBUFFER, PARAMETERS, cfg) {
 #if PAN_ARCH >= 6
diff --git a/src/panfrost/lib/pan_cs.h b/src/panfrost/lib/pan_cs.h
index 6e134d76556..1ea04123905 100644
--- a/src/panfrost/lib/pan_cs.h
+++ b/src/panfrost/lib/pan_cs.h
@@ -154,14 +154,6 @@ GENX(pan_emit_tls)(const struct pan_tls_info *info,
 int
 GENX(pan_select_crc_rt)(const struct pan_fb_info *fb);
 
-static inline bool
-pan_fbd_has_zs_crc_ext(const struct pan_fb_info *fb)
-{
-        return PAN_ARCH >= 5 &&
-               (fb->zs.view.zs || fb->zs.view.s ||
-                GENX(pan_select_crc_rt)(fb) >= 0);
-}
-
 unsigned
 GENX(pan_emit_fbd)(const struct panfrost_device *dev,
                    const struct pan_fb_info *fb,



More information about the mesa-commit mailing list