From: Mario Limonciello Date: Tue, 3 Jan 2023 21:58:52 +0000 (-0600) Subject: drm/amd: Optimize SRIOV switch/case for PSP microcode load X-Git-Tag: v6.6.17~5375^2~29^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=62a27480b78ad0f7e80c844a3a93974051579983;p=platform%2Fkernel%2Flinux-rpi.git drm/amd: Optimize SRIOV switch/case for PSP microcode load Now that IP version decoding is used, a number of case statements can be combined. Reviewed-by: Alex Deucher Reviewed-by: Christian König Reviewed-by: Lijo Lazar Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index a9496a0..0b59465 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -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;