mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 23:22:31 +02:00
drm/amdgpu: Add switch_compute_partition callback for imu v12_1
To enable switching compute partition mode v2: cleanup (Alex) Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com> Reviewed-by: Likun Gao <Likun.Gao@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
7ce7234189
commit
84d8beaf11
|
|
@ -36,6 +36,8 @@ struct amdgpu_imu_funcs {
|
|||
int (*start_imu)(struct amdgpu_device *adev);
|
||||
void (*program_rlc_ram)(struct amdgpu_device *adev);
|
||||
int (*wait_for_reset_status)(struct amdgpu_device *adev);
|
||||
int (*switch_compute_partition)(struct amdgpu_device *adev,
|
||||
int num_xccs_per_xcp);
|
||||
};
|
||||
|
||||
struct imu_rlc_ram_golden {
|
||||
|
|
|
|||
|
|
@ -133,7 +133,26 @@ static int imu_v12_1_load_microcode(struct amdgpu_device *adev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int imu_v12_1_switch_compute_partition(struct amdgpu_device *adev,
|
||||
int num_xccs_per_xcp)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (adev->psp.funcs) {
|
||||
ret = psp_spatial_partition(&adev->psp,
|
||||
NUM_XCC(adev->gfx.xcc_mask) /
|
||||
num_xccs_per_xcp);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
adev->gfx.num_xcc_per_xcp = num_xccs_per_xcp;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct amdgpu_imu_funcs gfx_v12_1_imu_funcs = {
|
||||
.init_microcode = imu_v12_1_init_microcode,
|
||||
.load_microcode = imu_v12_1_load_microcode,
|
||||
.switch_compute_partition = imu_v12_1_switch_compute_partition,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user