drm/amdgpu: Remove extra checks for CPX
authorAmber Lin <Amber.Lin@amd.com>
Wed, 12 Feb 2025 19:26:00 +0000 (14:26 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 17 Feb 2025 19:08:49 +0000 (14:08 -0500)
As far as the number of XCCs, the number of compute partitions, and the
number of memory partitions qualify, CPX is valid.

Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c

index e157d6d857b6ed4167b27c41d237d89ca2413299..2753f282e42d5354c51830d4564723bd2d9cfd1e 100644 (file)
@@ -559,8 +559,11 @@ static bool __aqua_vanjaram_is_valid_mode(struct amdgpu_xcp_mgr *xcp_mgr,
                        adev->gmc.num_mem_partitions == 4) &&
                       (num_xccs_per_xcp >= 2);
        case AMDGPU_CPX_PARTITION_MODE:
+               /* (num_xcc > 1) because 1 XCC is considered SPX, not CPX.
+                * (num_xcc % adev->gmc.num_mem_partitions) == 0 because
+                * num_compute_partitions can't be less than num_mem_partitions
+                */
                return ((num_xcc > 1) &&
-                      (adev->gmc.num_mem_partitions == 1 || adev->gmc.num_mem_partitions == 4) &&
                       (num_xcc % adev->gmc.num_mem_partitions) == 0);
        default:
                return false;