All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: fix active_cu mask on SI and CIK after re-init (v2)
@ 2014-08-18 21:12 Alex Deucher
  2014-08-19  2:25 ` Michel Dänzer
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2014-08-18 21:12 UTC (permalink / raw)
  To: dri-devel; +Cc: Alex Deucher, stable

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/radeon/cik.c | 9 ++++-----
 drivers/gpu/drm/radeon/si.c  | 9 ++++-----
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index af2cbc6..f4e1470 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -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));
 		}
 	}
 
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 7e58423..a1274a3 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -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));
 		}
 	}
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/radeon: fix active_cu mask on SI and CIK after re-init (v2)
  2014-08-18 21:12 [PATCH] drm/radeon: fix active_cu mask on SI and CIK after re-init (v2) Alex Deucher
@ 2014-08-19  2:25 ` Michel Dänzer
  2014-08-19 16:02   ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Michel Dänzer @ 2014-08-19  2:25 UTC (permalink / raw)
  To: Alex Deucher; +Cc: dri-devel

On 19.08.2014 06:12, Alex Deucher wrote:
> 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

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

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>


-- 
Earthling Michel Dänzer            |                  http://www.amd.com
Libre software enthusiast          |                Mesa and X developer

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/radeon: fix active_cu mask on SI and CIK after re-init (v2)
  2014-08-19  2:25 ` Michel Dänzer
@ 2014-08-19 16:02   ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2014-08-19 16:02 UTC (permalink / raw)
  To: Michel Dänzer; +Cc: Maling list - DRI developers

On Mon, Aug 18, 2014 at 10:25 PM, Michel Dänzer <michel@daenzer.net> wrote:
> On 19.08.2014 06:12, Alex Deucher wrote:
>> 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
>
> Might be even nicer to keep the two fixes separate, but either way:
>
> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>

I've split it into two patches.

Thanks.

Alex
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-19 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-18 21:12 [PATCH] drm/radeon: fix active_cu mask on SI and CIK after re-init (v2) Alex Deucher
2014-08-19  2:25 ` Michel Dänzer
2014-08-19 16:02   ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.