aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLijo Lazar <[email protected]>2022-10-06 15:25:08 +0530
committerAlex Deucher <[email protected]>2023-06-09 09:47:03 -0400
commit955220b04d42c41050158fec0f53957f320b96f9 (patch)
tree16152ea7e74af0402a33799b5c6daf510588e2d5
parentf5fe7edfd6ce62cd23fbd707e7f9fe0f56a45e94 (diff)
drm/amdgpu: Fix programming of initial XCP mode
On initialization set the partition mode correctly to SPX (default) or any other user specified partition mode. Use switch_compute_partition API so that all settings are initialized correctly. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
index 73f652ad5b00..b6b7dbb62448 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
@@ -1891,6 +1891,11 @@ static int gfx_v9_4_3_cp_resume(struct amdgpu_device *adev)
return r;
}
+ if (adev->gfx.partition_mode ==
+ AMDGPU_UNKNOWN_COMPUTE_PARTITION_MODE)
+ gfx_v9_4_3_switch_compute_partition(
+ adev, amdgpu_user_partt_mode);
+
/* set the virtual and physical id based on partition_mode */
gfx_v9_4_3_program_xcc_id(adev, i);
@@ -2112,28 +2117,7 @@ static int gfx_v9_4_3_early_init(void *handle)
num_xcc = NUM_XCC(adev->gfx.xcc_mask);
- adev->gfx.partition_mode = amdgpu_user_partt_mode;
- /* calculate the num_xcc_in_xcp for the partition mode*/
- switch (amdgpu_user_partt_mode) {
- case AMDGPU_SPX_PARTITION_MODE:
- adev->gfx.num_xcc_per_xcp = num_xcc;
- break;
- case AMDGPU_DPX_PARTITION_MODE:
- adev->gfx.num_xcc_per_xcp = num_xcc / 2;
- break;
- case AMDGPU_TPX_PARTITION_MODE:
- adev->gfx.num_xcc_per_xcp = num_xcc / 3;
- break;
- case AMDGPU_QPX_PARTITION_MODE:
- adev->gfx.num_xcc_per_xcp = num_xcc / 4;
- break;
- case AMDGPU_CPX_PARTITION_MODE:
- adev->gfx.num_xcc_per_xcp = 1;
- break;
- default:
- adev->gfx.num_xcc_per_xcp = num_xcc;
- break;
- }
+ adev->gfx.partition_mode = AMDGPU_UNKNOWN_COMPUTE_PARTITION_MODE;
adev->gfx.num_compute_rings = min(amdgpu_gfx_get_num_kcq(adev),
AMDGPU_MAX_COMPUTE_RINGS);