drm/amd: Optimize SRIOV switch/case for PSP microcode load
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 3 Jan 2023 21:58:52 +0000 (15:58 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 Jan 2023 19:32:57 +0000 (14:32 -0500)
Now that IP version decoding is used, a number of case statements
can be combined.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index a9496a0..0b59465 100644 (file)
@@ -133,14 +133,8 @@ static int psp_init_sriov_microcode(struct psp_context *psp)
 
        switch (adev->ip_versions[MP0_HWIP][0]) {
        case IP_VERSION(9, 0, 0):
-               adev->virt.autoload_ucode_id = AMDGPU_UCODE_ID_CP_MEC2;
-               ret = psp_init_cap_microcode(psp, ucode_prefix);
-               break;
-       case IP_VERSION(11, 0, 9):
-               adev->virt.autoload_ucode_id = AMDGPU_UCODE_ID_CP_MEC2;
-               ret = psp_init_cap_microcode(psp, ucode_prefix);
-               break;
        case IP_VERSION(11, 0, 7):
+       case IP_VERSION(11, 0, 9):
                adev->virt.autoload_ucode_id = AMDGPU_UCODE_ID_CP_MEC2;
                ret = psp_init_cap_microcode(psp, ucode_prefix);
                break;