Skip to content

Commit 49c9ffa

Browse files
hkasivisalexdeucher
authored andcommitted
drm/amdgpu: Indicate CU havest info to CP
To achieve full occupancy CP hardware needs to know if CUs in SE are symmetrically or asymmetrically harvested v2: Reset is_symmetric_cus for each loop Signed-off-by: Harish Kasiviswanathan <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 56342da commit 49c9ffa

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4195,9 +4195,10 @@ static u32 gfx_v9_4_3_get_cu_active_bitmap(struct amdgpu_device *adev, int xcc_i
41954195
static int gfx_v9_4_3_get_cu_info(struct amdgpu_device *adev,
41964196
struct amdgpu_cu_info *cu_info)
41974197
{
4198-
int i, j, k, counter, xcc_id, active_cu_number = 0;
4199-
u32 mask, bitmap, ao_bitmap, ao_cu_mask = 0;
4198+
int i, j, k, prev_counter, counter, xcc_id, active_cu_number = 0;
4199+
u32 mask, bitmap, ao_bitmap, ao_cu_mask = 0, tmp;
42004200
unsigned disable_masks[4 * 4];
4201+
bool is_symmetric_cus;
42014202

42024203
if (!adev || !cu_info)
42034204
return -EINVAL;
@@ -4215,6 +4216,7 @@ static int gfx_v9_4_3_get_cu_info(struct amdgpu_device *adev,
42154216

42164217
mutex_lock(&adev->grbm_idx_mutex);
42174218
for (xcc_id = 0; xcc_id < NUM_XCC(adev->gfx.xcc_mask); xcc_id++) {
4219+
is_symmetric_cus = true;
42184220
for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
42194221
for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
42204222
mask = 1;
@@ -4242,6 +4244,15 @@ static int gfx_v9_4_3_get_cu_info(struct amdgpu_device *adev,
42424244
ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8));
42434245
cu_info->ao_cu_bitmap[i][j] = ao_bitmap;
42444246
}
4247+
if (i && is_symmetric_cus && prev_counter != counter)
4248+
is_symmetric_cus = false;
4249+
prev_counter = counter;
4250+
}
4251+
if (is_symmetric_cus) {
4252+
tmp = RREG32_SOC15(GC, GET_INST(GC, xcc_id), regCP_CPC_DEBUG);
4253+
tmp = REG_SET_FIELD(tmp, CP_CPC_DEBUG, CPC_HARVESTING_RELAUNCH_DISABLE, 1);
4254+
tmp = REG_SET_FIELD(tmp, CP_CPC_DEBUG, CPC_HARVESTING_DISPATCH_DISABLE, 1);
4255+
WREG32_SOC15(GC, GET_INST(GC, xcc_id), regCP_CPC_DEBUG, tmp);
42454256
}
42464257
gfx_v9_4_3_xcc_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff,
42474258
xcc_id);

0 commit comments

Comments
 (0)