turnip: Disable LRZ fast-clear for gen1 and gen2
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Mon, 18 Jul 2022 15:59:32 +0000 (18:59 +0300)
committerMarge Bot <emma+marge@anholt.net>
Wed, 20 Jul 2022 02:58:44 +0000 (02:58 +0000)
LRZ fast-clear works on all gens, however blob disables it on
gen1 and gen2. We also elect to disable fast-clear on these gens
because for close to none gains it adds complexity and seem to work
a bit differently from gen3+. Which creates at least one edge case:
if first draw which uses LRZ fast-clear doesn't lock LRZ direction
the fast-clear value is undefined.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6829

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17599>

src/freedreno/common/freedreno_dev_info.h
src/freedreno/common/freedreno_devices.py

index 5086344..a0782ac 100644 (file)
@@ -133,6 +133,14 @@ struct fd_dev_info {
          bool has_dp2acc;
          bool has_dp4acc;
 
+         /* LRZ fast-clear works on all gens, however blob disables it on
+          * gen1 and gen2. We also elect to disable fast-clear on these gens
+          * because for close to none gains it adds complexity and seem to work
+          * a bit differently from gen3+. Which creates at least one edge case:
+          * if first draw which uses LRZ fast-clear doesn't lock LRZ direction
+          * the fast-clear value is undefined. For details see
+          * https://gitlab.freedesktop.org/mesa/mesa/-/issues/6829
+          */
          bool enable_lrz_fast_clear;
          bool has_lrz_dir_tracking;
          bool lrz_track_quirk;
index 99a982d..ba32b60 100644 (file)
@@ -138,10 +138,6 @@ class A6xxGPUInfo(GPUInfo):
         self.a6xx.has_cp_reg_write = True
         self.a6xx.has_8bpp_ubwc = True
 
-        # All a6xx gens support lrz fast-clear, however newer blob driver
-        # (v615) doesn't use it for gen1 and gen2.
-        self.a6xx.enable_lrz_fast_clear = True
-
         for name, val in template.items():
             if name == "magic": # handled above
                 continue
@@ -250,6 +246,7 @@ a6xx_gen3 = dict(
         has_8bpp_ubwc = False,
         has_dp2acc = True,
         has_lrz_dir_tracking = True,
+        enable_lrz_fast_clear = True,
         lrz_track_quirk = True,
         magic = dict(
             # this seems to be a chicken bit that fixes cubic filtering:
@@ -277,6 +274,7 @@ a6xx_gen4 = dict(
         has_getfiberid = True,
         has_dp2acc = True,
         has_dp4acc = True,
+        enable_lrz_fast_clear = True,
         has_lrz_dir_tracking = True,
         magic = dict(
             TPL1_DBG_ECO_CNTL = 0x5008000,