Skip to contentSkip to conversation

drm/amdgpu: correct the cu and rb info for sienna cichlid

PATCH In review Likun Gao 3 participants 3 messages Oct 21, 2020 – Oct 22, 2020

Subsystems (2)
lore
Share & tools
lore

Likun Gao

author
#0 lore raw

PATCH 1/1 drm/amdgpu: correct the cu and rb info for sienna cichlid

From: Likun Gao <[email protected]>

Skip disabled sa to correct the cu_info and active_rbs for sienna cichlid.

Change-Id I271682e11f3472cb5ba882e04329976059e06a13
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +9 -0
index 402fe623c5d8..49ce4aaa2bac 100644
@@ -4579,12 +4579,17 @@ static void gfx_v10_0_setup_rb(struct amdgpu_device *adev)
 	int i, j;
 	u32 data;
 	u32 active_rbs = 0;
+	u32 bitmap;
 	u32 rb_bitmap_width_per_sh = adev->gfx.config.max_backends_per_se /
 					adev->gfx.config.max_sh_per_se;
 
 	mutex_lock(&adev->grbm_idx_mutex);
 	for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
 		for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
+			bitmap = i * adev->gfx.config.max_sh_per_se + j;
+			if ((adev->asic_type == CHIP_SIENNA_CICHLID) &&
+			    ((gfx_v10_3_get_disabled_sa(adev) >> bitmap) & 1))
+				continue;
 			gfx_v10_0_select_se_sh(adev, i, j, 0xffffffff);
 			data = gfx_v10_0_get_rb_active_bitmap(adev);
 			active_rbs |= data << ((i * adev->gfx.config.max_sh_per_se + j) *
@@ -8829,6 +8834,10 @@ static int gfx_v10_0_get_cu_info(struct amdgpu_device *adev,
 	mutex_lock(&adev->grbm_idx_mutex);
 	for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
 		for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
+			bitmap = i * adev->gfx.config.max_sh_per_se + j;
+			if ((adev->asic_type == CHIP_SIENNA_CICHLID) &&
+			    ((gfx_v10_3_get_disabled_sa(adev) >> bitmap) & 1))
+				continue;
 			mask = 1;
 			ao_bitmap = 0;
 			counter = 0;
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw
Quoted 18 lines · Likun Gao

From: Likun Gao <[email protected]>

Skip disabled sa to correct the cu_info and active_rbs for sienna cichlid.

Change-Id I271682e11f3472cb5ba882e04329976059e06a13
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -0
index 402fe623c5d8..49ce4aaa2bac 100644
@@ -4579,12 +4579,17 @@ static void gfx_v10_0_setup_rb(struct amdgpu_device *adev)
        int i, j;
        u32 data;

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c static void gfx_v10_0_setup_rb(struct amdgpu_device *adev) · line 4590

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -0
        u32 active_rbs = 0;
+       u32 bitmap;
        u32 rb_bitmap_width_per_sh = adev->gfx.config.max_backends_per_se /
                                        adev->gfx.config.max_sh_per_se;
 
        mutex_lock(&adev->grbm_idx_mutex);
        for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
                for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
+                       bitmap = i * adev->gfx.config.max_sh_per_se + j;
+                       if ((adev->asic_type == CHIP_SIENNA_CICHLID) &&

I think this should be >= CHIP_SIENNA_CICHLID?

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c static int gfx_v10_0_get_cu_info(struct amdgpu_device *adev, · line 8838

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +4 -0
+                           ((gfx_v10_3_get_disabled_sa(adev) >> bitmap) & 1))
+                               continue;
                        gfx_v10_0_select_se_sh(adev, i, j, 0xffffffff);
                        data = gfx_v10_0_get_rb_active_bitmap(adev);
                        active_rbs |= data << ((i * adev->gfx.config.max_sh_per_se + j) *
@@ -8829,6 +8834,10 @@ static int gfx_v10_0_get_cu_info(struct amdgpu_device *adev,
        mutex_lock(&adev->grbm_idx_mutex);
        for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
                for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
+                       bitmap = i * adev->gfx.config.max_sh_per_se + j;
+                       if ((adev->asic_type == CHIP_SIENNA_CICHLID) &&

Same here?

Alex

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2 -1
+                           ((gfx_v10_3_get_disabled_sa(adev) >> bitmap) & 1))
+                               continue;
                        mask = 1;
                        ao_bitmap = 0;
                        counter = 0;
--

2.25.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by on v1 1/1
#2 lore raw
In reply to Likun Gao

[AMD Public Use]

Regards,
Hawking
-----Original Message-----
From: Gao, Likun <[email protected]>
Sent: Thursday, October 22, 2020 00:55
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Gao, Likun <[email protected]>
Subject: [PATCH] drm/amdgpu: correct the cu and rb info for sienna cichlid

From: Likun Gao <[email protected]>

Skip disabled sa to correct the cu_info and active_rbs for sienna cichlid.

Change-Id I271682e11f3472cb5ba882e04329976059e06a13
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +5 -0
index 402fe623c5d8..49ce4aaa2bac 100644
@@ -4579,12 +4579,17 @@ static void gfx_v10_0_setup_rb(struct amdgpu_device *adev)
 	int i, j;
 	u32 data;
 	u32 active_rbs = 0;
+	u32 bitmap;
 	u32 rb_bitmap_width_per_sh = adev->gfx.config.max_backends_per_se /
 					adev->gfx.config.max_sh_per_se;
 
 	mutex_lock(&adev->grbm_idx_mutex);
 	for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
 		for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
+			bitmap = i * adev->gfx.config.max_sh_per_se + j;
+			if ((adev->asic_type == CHIP_SIENNA_CICHLID) &&
+			    ((gfx_v10_3_get_disabled_sa(adev) >> bitmap) & 1))
+				continue;
 			gfx_v10_0_select_se_sh(adev, i, j, 0xffffffff);
 			data = gfx_v10_0_get_rb_active_bitmap(adev);
 			active_rbs |= data << ((i * adev->gfx.config.max_sh_per_se + j) * @@ -8829,6 +8834,10 @@ static int gfx_v10_0_get_cu_info(struct amdgpu_device *adev,

mutex_lock(&adev->grbm_idx_mutex);
for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
+ bitmap = i * adev->gfx.config.max_sh_per_se + j;
+ if ((adev->asic_type == CHIP_SIENNA_CICHLID) &&
+ ((gfx_v10_3_get_disabled_sa(adev) >> bitmap) & 1))
+ continue;
mask = 1;
ao_bitmap = 0;
counter = 0;
--
2.25.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx