[03/16] ac: move the Fiji kernel workaround for raster config out of the switch

Submitted by Marek Olšák on May 2, 2018, 4 a.m.

Details

Message ID 20180502040040.8499-4-maraeo@gmail.com
State New
Headers show
Series "RadeonSI: A bunch of random changes" ( rev: 2 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Marek Olšák May 2, 2018, 4 a.m.
From: Marek Olšák <marek.olsak@amd.com>

---
 src/amd/common/ac_gpu_info.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c
index da54e5f8b4a..273ccb6cb1d 100644
--- a/src/amd/common/ac_gpu_info.c
+++ b/src/amd/common/ac_gpu_info.c
@@ -587,28 +587,22 @@  ac_get_raster_config(struct radeon_info *info,
 		break;
 	case CHIP_BONAIRE:
 		raster_config = 0x16000012;
 		raster_config_1 = 0x00000000;
 		break;
 	case CHIP_HAWAII:
 		raster_config = 0x3a00161a;
 		raster_config_1 = 0x0000002e;
 		break;
 	case CHIP_FIJI:
-		if (info->cik_macrotile_mode_array[0] == 0x000000e8) {
-			/* old kernels with old tiling config */
-			raster_config = 0x16000012;
-			raster_config_1 = 0x0000002a;
-		} else {
-			raster_config = 0x3a00161a;
-			raster_config_1 = 0x0000002e;
-		}
+		raster_config = 0x3a00161a;
+		raster_config_1 = 0x0000002e;
 		break;
 	case CHIP_POLARIS10:
 		raster_config = 0x16000012;
 		raster_config_1 = 0x0000002a;
 		break;
 	case CHIP_POLARIS11:
 	case CHIP_POLARIS12:
 		raster_config = 0x16000012;
 		raster_config_1 = 0x00000000;
 		break;
@@ -641,20 +635,30 @@  ac_get_raster_config(struct radeon_info *info,
 		raster_config = 0x00000000;
 		raster_config_1 = 0x00000000;
 		break;
 	default:
 		fprintf(stderr,
 			"ac: Unknown GPU, using 0 for raster_config\n");
 		raster_config = 0x00000000;
 		raster_config_1 = 0x00000000;
 		break;
 	}
+
+	/* Fiji: Old kernels have incorrect tiling config. This decreases
+	 * RB performance by 25%. (it disables 1 RB in the second packer)
+	 */
+	if (info->family == CHIP_FIJI &&
+	    info->cik_macrotile_mode_array[0] == 0x000000e8) {
+		raster_config = 0x16000012;
+		raster_config_1 = 0x0000002a;
+	}
+
 	*raster_config_p = raster_config;
 	*raster_config_1_p = raster_config_1;
 }
 
 void
 ac_get_harvested_configs(struct radeon_info *info,
 			 unsigned raster_config,
 			 unsigned *cik_raster_config_1_p,
 			 unsigned *raster_config_se)
 {