From 7b0fcd8932ad78d527a3b0e6e7d2d891a0d5e897 Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Mon, 18 Jul 2022 18:59:32 +0300 Subject: [PATCH] turnip: Disable LRZ fast-clear for gen1 and gen2 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 Part-of: --- src/freedreno/common/freedreno_dev_info.h | 8 ++++++++ src/freedreno/common/freedreno_devices.py | 6 ++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/freedreno/common/freedreno_dev_info.h b/src/freedreno/common/freedreno_dev_info.h index 5086344942f..a0782aca0fb 100644 --- a/src/freedreno/common/freedreno_dev_info.h +++ b/src/freedreno/common/freedreno_dev_info.h @@ -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; diff --git a/src/freedreno/common/freedreno_devices.py b/src/freedreno/common/freedreno_devices.py index 99a982d2530..ba32b6056d6 100644 --- a/src/freedreno/common/freedreno_devices.py +++ b/src/freedreno/common/freedreno_devices.py @@ -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,