From ebde7d5e870d7d0d0386d553cf36854697e17824 Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Wed, 21 Feb 2024 13:33:43 +0100 Subject: [PATCH] tu/a7xx: Write even more magic regs to fix rendering issues on Android We have to write all the same regs blob is writing or we risk using stale reg value written by blob. I went through blob trace again and added all missing magic regs, I hope for the last time. This fixes screen corruption for Mobox users and in some cases for different emulators users. The reg which caused the issue is HLSQ_UNKNOWN_A9AC. Signed-off-by: Danylo Piliaiev Part-of: --- src/freedreno/common/freedreno_devices.py | 30 +++++++++++++++++++++++ src/freedreno/registers/adreno/a6xx.xml | 18 +++++++------- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/freedreno/common/freedreno_devices.py b/src/freedreno/common/freedreno_devices.py index 1dba8d2ba80..5dfe36ffd5a 100644 --- a/src/freedreno/common/freedreno_devices.py +++ b/src/freedreno/common/freedreno_devices.py @@ -851,6 +851,16 @@ a730_raw_magic_regs = [ [A6XXRegs.REG_A7XX_GRAS_UNKNOWN_80A7, 0x00000000], [A6XXRegs.REG_A7XX_GRAS_UNKNOWN_810B, 0x3], + + [A6XXRegs.REG_A7XX_HLSQ_UNKNOWN_A9AC, 0x00000000], + [A6XXRegs.REG_A7XX_RB_UNKNOWN_8E79, 0x00000000], + [A6XXRegs.REG_A7XX_RB_UNKNOWN_8899, 0x00000000], + [A6XXRegs.REG_A7XX_RB_UNKNOWN_88F5, 0x00000000], + + # Shading rate group + [A6XXRegs.REG_A6XX_RB_UNKNOWN_88F4, 0x00000000], + [A6XXRegs.REG_A7XX_HLSQ_UNKNOWN_A9AD, 0x00000000], + [A6XXRegs.REG_A7XX_GRAS_UNKNOWN_80F4, 0x00000000], ] add_gpus([ @@ -960,6 +970,16 @@ add_gpus([ [A6XXRegs.REG_A7XX_GRAS_UNKNOWN_80A7, 0x00000000], [A6XXRegs.REG_A7XX_GRAS_UNKNOWN_810B, 0x3], + + [A6XXRegs.REG_A7XX_HLSQ_UNKNOWN_A9AC, 0x00000000], + [A6XXRegs.REG_A7XX_RB_UNKNOWN_8E79, 0x00000000], + [A6XXRegs.REG_A7XX_RB_UNKNOWN_8899, 0x00000000], + [A6XXRegs.REG_A7XX_RB_UNKNOWN_88F5, 0x00000000], + + # Shading rate group + [A6XXRegs.REG_A6XX_RB_UNKNOWN_88F4, 0x00000000], + [A6XXRegs.REG_A7XX_HLSQ_UNKNOWN_A9AD, 0x00000000], + [A6XXRegs.REG_A7XX_GRAS_UNKNOWN_80F4, 0x00000000], ], )) @@ -1026,6 +1046,16 @@ add_gpus([ [A6XXRegs.REG_A7XX_GRAS_UNKNOWN_80A7, 0x00000000], [A6XXRegs.REG_A7XX_GRAS_UNKNOWN_810B, 0x3], + [A6XXRegs.REG_A7XX_HLSQ_UNKNOWN_A9AC, 0x00000000], + [A6XXRegs.REG_A7XX_RB_UNKNOWN_8E79, 0x00000000], + [A6XXRegs.REG_A7XX_RB_UNKNOWN_8899, 0x00000000], + [A6XXRegs.REG_A7XX_RB_UNKNOWN_88F5, 0x00000000], + + # Shading rate group + [A6XXRegs.REG_A6XX_RB_UNKNOWN_88F4, 0x00000000], + [A6XXRegs.REG_A7XX_HLSQ_UNKNOWN_A9AD, 0x00000000], + [A6XXRegs.REG_A7XX_GRAS_UNKNOWN_80F4, 0x00000000], + [0x930a, 0], [0x960a, 1], [A6XXRegs.REG_A7XX_SP_PS_ALIASED_COMPONENTS_CONTROL, 0], diff --git a/src/freedreno/registers/adreno/a6xx.xml b/src/freedreno/registers/adreno/a6xx.xml index 3e5e3473967..35cfcf74398 100644 --- a/src/freedreno/registers/adreno/a6xx.xml +++ b/src/freedreno/registers/adreno/a6xx.xml @@ -1996,7 +1996,7 @@ to upconvert to 32b float internally? - + @@ -2211,12 +2211,12 @@ to upconvert to 32b float internally? - - - - - - + + + + + + @@ -4329,10 +4329,10 @@ to upconvert to 32b float internally? - + - +