Skip to content

Commit 30b5991

Browse files
YuanShangalexdeucher
authored andcommitted
drm/amdgpu: load sdma ucode in the guest machine
[why] User mode driver need to check the sdma ucode version to see whether the sdma engine supports a new type of PM4 packet. In SRIOV, sdma is loaded by the host. And, there is no way to check the sdma ucode version of CHIP_NAVI12 and CHIP_SIENNA_CICHLID of the host in the guest machine. [how] Load the sdma ucode for CHIP_NAVI12 and CHIP_SIENNA_CICHLID in the guest machine. Signed-off-by: YuanShang <YuanShang.Mao@amd.com> Reviewed-By: Horace Chen <horace.chen@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent fc8e55f commit 30b5991

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,6 @@ int amdgpu_sdma_init_microcode(struct amdgpu_device *adev,
239239
sizeof(struct amdgpu_sdma_instance));
240240
}
241241

242-
if (amdgpu_sriov_vf(adev))
243-
return 0;
244-
245242
DRM_DEBUG("psp_load == '%s'\n",
246243
adev->firmware.load_type == AMDGPU_FW_LOAD_PSP ? "true" : "false");
247244

drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,17 @@ bool amdgpu_virt_fw_load_skip_check(struct amdgpu_device *adev, uint32_t ucode_i
855855
return false;
856856
else
857857
return true;
858+
case IP_VERSION(11, 0, 9):
859+
case IP_VERSION(11, 0, 7):
860+
/* black list for CHIP_NAVI12 and CHIP_SIENNA_CICHLID */
861+
if (ucode_id == AMDGPU_UCODE_ID_RLC_G
862+
|| ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_CNTL
863+
|| ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_GPM_MEM
864+
|| ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM
865+
|| ucode_id == AMDGPU_UCODE_ID_SMC)
866+
return true;
867+
else
868+
return false;
858869
case IP_VERSION(13, 0, 10):
859870
/* white list */
860871
if (ucode_id == AMDGPU_UCODE_ID_CAP

drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,17 +237,15 @@ static void sdma_v5_0_init_golden_registers(struct amdgpu_device *adev)
237237
// emulation only, won't work on real chip
238238
// navi10 real chip need to use PSP to load firmware
239239
static int sdma_v5_0_init_microcode(struct amdgpu_device *adev)
240-
{ int ret, i;
241-
242-
if (amdgpu_sriov_vf(adev) && (adev->ip_versions[SDMA0_HWIP][0] == IP_VERSION(5, 0, 5)))
243-
return 0;
240+
{
241+
int ret, i;
244242

245243
for (i = 0; i < adev->sdma.num_instances; i++) {
246244
ret = amdgpu_sdma_init_microcode(adev, i, false);
247245
if (ret)
248246
return ret;
249247
}
250-
248+
251249
return ret;
252250
}
253251

0 commit comments

Comments
 (0)