Skip to contentSkip to conversation

drm/amdgpu: correct the cu count for gfx v11

PATCH In review Gao, Likun 2 participants 2 messages Jan 8, 2024 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Gao, Likun

author
#1 lore raw

PATCH v2 1/1 drm/amdgpu: correct the cu count for gfx v11

[AMD Official Use Only - General]

From: Likun Gao <[email protected]>

Correct the algorithm of active CU to skip disabled sa for gfx v11.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3 -0
index 2fbcd9765980..c7242877d5d3 100644
@@ -6383,6 +6383,9 @@ static int gfx_v11_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 (!((gfx_v11_0_get_sa_active_bitmap(adev) >> bitmap) & 1))
+                               continue;
                        mask = 1;
                        counter = 0;
                        gfx_v11_0_select_se_sh(adev, i, j, 0xffffffff, 0);

--
2.34.1

Reviewed-by on v2 1/1
#2 lore raw

[AMD Official Use Only - General]

Regards,
Hawking
-----Original Message-----
From: Gao, Likun <[email protected]>
Sent: Monday, January 8, 2024 11:31
To: amd-gfx list <[email protected]>
Cc: Zhang, Hawking <[email protected]>
Subject: [PATCH V2] drm/amdgpu: correct the cu count for gfx v11

[AMD Official Use Only - General]

From: Likun Gao <[email protected]>

Correct the algorithm of active CU to skip disabled sa for gfx v11.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3 -0
index 2fbcd9765980..c7242877d5d3 100644
@@ -6383,6 +6383,9 @@ static int gfx_v11_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 (!((gfx_v11_0_get_sa_active_bitmap(adev) >> bitmap) & 1))
+                               continue;
                        mask = 1;
                        counter = 0;
                        gfx_v11_0_select_se_sh(adev, i, j, 0xffffffff, 0);

--
2.34.1