]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: Init partition_mode and xcc_mask for GFX_IMU_PARTITION_SWITCH
authorHawking Zhang <Hawking.Zhang@amd.com>
Sun, 15 Jun 2025 06:28:20 +0000 (14:28 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Dec 2025 22:39:29 +0000 (17:39 -0500)
Set partition_mode and physical xcc mask fields in
GFX_IMU_PARTITION_SWITCH register

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>
drivers/gpu/drm/amd/amdgpu/amdgpu_imu.h
drivers/gpu/drm/amd/amdgpu/imu_v12_1.c
drivers/gpu/drm/amd/amdgpu/soc_v1_0.c

index ac4fd4f46133578c5a244009b004bd37890e2b40..eb8537558f5fb6b94b831f7ca97217ade0853cbb 100644 (file)
@@ -37,7 +37,8 @@ struct amdgpu_imu_funcs {
     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);
+                                   int num_xccs_per_xcp,
+                                   int compute_partition_mode);
 };
 
 struct imu_rlc_ram_golden {
index 9dc4bf2493cfd6dbf587de392162982e0a0bdc00..8e33ffcdfa4ccb6a9bb86ef9653493eadc4a0fa5 100644 (file)
@@ -134,11 +134,13 @@ static int imu_v12_1_load_microcode(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);
index 0d8b245d49cf6446d4d65ff03d952e58003a9393..ec9754f687d00c1318c667f3720c1e9a1b50eaa4 100644 (file)
@@ -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;