Skip to contentSkip to conversation

drm/radeon: fix active_cu mask on SI and CIK after re-init (v2)

PATCH In review Alex Deucher 2 participants 3 messages Aug 18, 2014 – Aug 19, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: fix active_cu mask on SI and CIK after re-init (v2)

Need to initialize the mask to 0 on init, otherwise it keeps increasing.

bug:
https://bugzilla.kernel.org/show_bug.cgi?id=82581

v2: also fix cu count

---
 drivers/gpu/drm/radeon/cik.c | 9 ++++-----
 drivers/gpu/drm/radeon/si.c  | 9 ++++-----
 2 files changed, 8 insertions(+), 10 deletions(-)
drivers/gpu/drm/radeon/cik.c +4 -5
index af2cbc6..f4e1470 100644
@@ -3483,7 +3483,7 @@ static void cik_gpu_init(struct radeon_device *rdev)
 	u32 mc_shared_chmap, mc_arb_ramcfg;
 	u32 hdp_host_path_cntl;
 	u32 tmp;
-	int i, j, k;
+	int i, j;
 
 	switch (rdev->family) {
 	case CHIP_BONAIRE:
@@ -3672,12 +3672,11 @@ static void cik_gpu_init(struct radeon_device *rdev)
 		     rdev->config.cik.max_sh_per_se,
 		     rdev->config.cik.max_backends_per_se);
 
+	rdev->config.cik.active_cus = 0;
 	for (i = 0; i < rdev->config.cik.max_shader_engines; i++) {
 		for (j = 0; j < rdev->config.cik.max_sh_per_se; j++) {
-			for (k = 0; k < rdev->config.cik.max_cu_per_sh; k++) {
-				rdev->config.cik.active_cus +=
-					hweight32(cik_get_cu_active_bitmap(rdev, i, j));
-			}
+			rdev->config.cik.active_cus +=
+				hweight32(cik_get_cu_active_bitmap(rdev, i, j));
 		}
 	}
 
drivers/gpu/drm/radeon/si.c +4 -5
index 7e58423..a1274a3 100644
@@ -3057,7 +3057,7 @@ static void si_gpu_init(struct radeon_device *rdev)
 	u32 sx_debug_1;
 	u32 hdp_host_path_cntl;
 	u32 tmp;
-	int i, j, k;
+	int i, j;
 
 	switch (rdev->family) {
 	case CHIP_TAHITI:
@@ -3255,12 +3255,11 @@ static void si_gpu_init(struct radeon_device *rdev)
 		     rdev->config.si.max_sh_per_se,
 		     rdev->config.si.max_cu_per_sh);
 
+	rdev->config.si.active_cus = 0;
 	for (i = 0; i < rdev->config.si.max_shader_engines; i++) {
 		for (j = 0; j < rdev->config.si.max_sh_per_se; j++) {
-			for (k = 0; k < rdev->config.si.max_cu_per_sh; k++) {
-				rdev->config.si.active_cus +=
-					hweight32(si_get_cu_active_bitmap(rdev, i, j));
-			}
+			rdev->config.si.active_cus +=
+				hweight32(si_get_cu_active_bitmap(rdev, i, j));
 		}
 	}
 
Signature · 1 line
1.8.3.1
#2 lore raw
Quoted 4 lines · Michel Dänzer
Quoted 3 lines · Alex Deucher

Need to initialize the mask to 0 on init, otherwise it keeps increasing.

Quoted 8 lines
Quoted 4 lines

bug:
https://bugzilla.kernel.org/show_bug.cgi?id=82581

v2: also fix cu count

Might be even nicer to keep the two fixes separate, but either way:

I've split it into two patches.

Thanks.

Alex
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel