From: Hawking Zhang <[email protected]> Set partition_mode and physical xcc mask fields in GFX_IMU_PARTITION_SWITCH register
v2: cleanup (Alex) Signed-off-by: Hawking Zhang <[email protected]> Reviewed-by: Likun Gao <[email protected]> Signed-off-by: Alex Deucher <[email protected]> --- drivers/gpu/drm/amd/amdgpu/amdgpu_imu.h | 3 ++- drivers/gpu/drm/amd/amdgpu/imu_v12_1.c | 4 +++- drivers/gpu/drm/amd/amdgpu/soc_v1_0.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_imu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_imu.h index 1a9b4b24dcc60..13c71edafa409 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_imu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_imu.h @@ -38,7 +38,8 @@ struct amdgpu_imu_funcs { int (*wait_for_reset_status)(struct amdgpu_device *adev); int (*get_xccs_per_xcp)(struct amdgpu_device *adev); int (*switch_compute_partition)(struct amdgpu_device *adev, - int num_xccs_per_xcp); + int num_xccs_per_xcp, + int compute_partition_mode); }; struct imu_rlc_ram_golden { diff --git a/drivers/gpu/drm/amd/amdgpu/imu_v12_1.c b/drivers/gpu/drm/amd/amdgpu/imu_v12_1.c index 2ccc5c0793bbf..aa94e598f3f14 100644 --- a/drivers/gpu/drm/amd/amdgpu/imu_v12_1.c +++ b/drivers/gpu/drm/amd/amdgpu/imu_v12_1.c @@ -144,11 +144,13 @@ static int imu_v12_1_get_xccs_per_xcp(struct amdgpu_device *adev) } static int imu_v12_1_switch_compute_partition(struct amdgpu_device *adev, - int num_xccs_per_xcp) + int num_xccs_per_xcp, + int compute_partition_mode) { int ret; if (adev->psp.funcs) { + /*TODO: revisit asp interface once it's avaialble */ ret = psp_spatial_partition(&adev->psp, NUM_XCC(adev->gfx.xcc_mask) / num_xccs_per_xcp); diff --git a/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c b/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c index 7e96c6583aa97..d4d42f2611a45 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/soc_v1_0.c @@ -652,7 +652,7 @@ static int soc_v1_0_switch_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr, num_xcc_per_xcp = __soc_v1_0_get_xcc_per_xcp(xcp_mgr, mode); if (adev->gfx.imu.funcs && adev->gfx.imu.funcs->switch_compute_partition) - adev->gfx.imu.funcs->switch_compute_partition(xcp_mgr->adev, num_xcc_per_xcp); + adev->gfx.imu.funcs->switch_compute_partition(xcp_mgr->adev, num_xcc_per_xcp, mode); /* Init info about new xcps */ *num_xcps = num_xcc / num_xcc_per_xcp; -- 2.51.1
