Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <Harish.Kasiviswanathan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Harish Kasiviswanathan and committed by
Alex Deucher
49c9ffab 56342da3

+13 -2
+13 -2
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
··· 4195 4195 static int gfx_v9_4_3_get_cu_info(struct amdgpu_device *adev, 4196 4196 struct amdgpu_cu_info *cu_info) 4197 4197 { 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; 4200 4200 unsigned disable_masks[4 * 4]; 4201 + bool is_symmetric_cus; 4201 4202 4202 4203 if (!adev || !cu_info) 4203 4204 return -EINVAL; ··· 4216 4215 4217 4216 mutex_lock(&adev->grbm_idx_mutex); 4218 4217 for (xcc_id = 0; xcc_id < NUM_XCC(adev->gfx.xcc_mask); xcc_id++) { 4218 + is_symmetric_cus = true; 4219 4219 for (i = 0; i < adev->gfx.config.max_shader_engines; i++) { 4220 4220 for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) { 4221 4221 mask = 1; ··· 4244 4242 ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8)); 4245 4243 cu_info->ao_cu_bitmap[i][j] = ao_bitmap; 4246 4244 } 4245 + if (i && is_symmetric_cus && prev_counter != counter) 4246 + is_symmetric_cus = false; 4247 + prev_counter = counter; 4248 + } 4249 + if (is_symmetric_cus) { 4250 + tmp = RREG32_SOC15(GC, GET_INST(GC, xcc_id), regCP_CPC_DEBUG); 4251 + tmp = REG_SET_FIELD(tmp, CP_CPC_DEBUG, CPC_HARVESTING_RELAUNCH_DISABLE, 1); 4252 + tmp = REG_SET_FIELD(tmp, CP_CPC_DEBUG, CPC_HARVESTING_DISPATCH_DISABLE, 1); 4253 + WREG32_SOC15(GC, GET_INST(GC, xcc_id), regCP_CPC_DEBUG, tmp); 4247 4254 } 4248 4255 gfx_v9_4_3_xcc_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff, 4249 4256 xcc_id);