aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2019-07-21 08:58:31 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-08-12 13:47:50 -0400
commit444a0fea5107e9ad7e3cbbafed78678489e31713 (patch)
tree346d22c85cdcda6025d42d7a3ded27daac1bbfe5
parent8deac2363638f65d08742c571b6bc26cf8ca7ed8 (diff)
drm/amdgpu: use direct loading on renoir vcn for the moment
PSP has issue for renoir, that will cause VCN fw failed to be loaded. So use direct loading for the moment till the issue is addressed. Acked-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Aaron Liu <aaron.liu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c9
-rw-r--r--drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c9
2 files changed, 12 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 7a6beb2e7c4e..0c7ac0096a7e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -100,7 +100,8 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
100 case CHIP_NAVI14: 100 case CHIP_NAVI14:
101 fw_name = FIRMWARE_NAVI14; 101 fw_name = FIRMWARE_NAVI14;
102 if ((adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) && 102 if ((adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) &&
103 (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)) 103 (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) &&
104 adev->asic_type != CHIP_RENOIR) /* to be removed while vcn psp loading works */
104 adev->vcn.indirect_sram = true; 105 adev->vcn.indirect_sram = true;
105 break; 106 break;
106 case CHIP_NAVI12: 107 case CHIP_NAVI12:
@@ -160,7 +161,8 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
160 } 161 }
161 162
162 bo_size = AMDGPU_VCN_STACK_SIZE + AMDGPU_VCN_CONTEXT_SIZE; 163 bo_size = AMDGPU_VCN_STACK_SIZE + AMDGPU_VCN_CONTEXT_SIZE;
163 if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) 164 if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP ||
165 adev->asic_type == CHIP_RENOIR)
164 bo_size += AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8); 166 bo_size += AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8);
165 167
166 for (i = 0; i < adev->vcn.num_vcn_inst; i++) { 168 for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
@@ -271,7 +273,8 @@ int amdgpu_vcn_resume(struct amdgpu_device *adev)
271 unsigned offset; 273 unsigned offset;
272 274
273 hdr = (const struct common_firmware_header *)adev->vcn.fw->data; 275 hdr = (const struct common_firmware_header *)adev->vcn.fw->data;
274 if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) { 276 if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP ||
277 adev->asic_type == CHIP_RENOIR) {
275 offset = le32_to_cpu(hdr->ucode_array_offset_bytes); 278 offset = le32_to_cpu(hdr->ucode_array_offset_bytes);
276 memcpy_toio(adev->vcn.inst[i].cpu_addr, adev->vcn.fw->data + offset, 279 memcpy_toio(adev->vcn.inst[i].cpu_addr, adev->vcn.fw->data + offset,
277 le32_to_cpu(hdr->ucode_size_bytes)); 280 le32_to_cpu(hdr->ucode_size_bytes));
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
index 36ad0c0e8efb..9a076f99bc0f 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
@@ -142,7 +142,8 @@ static int vcn_v2_0_sw_init(void *handle)
142 if (r) 142 if (r)
143 return r; 143 return r;
144 144
145 if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) { 145 if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP &&
146 adev->asic_type != CHIP_RENOIR) {
146 const struct common_firmware_header *hdr; 147 const struct common_firmware_header *hdr;
147 hdr = (const struct common_firmware_header *)adev->vcn.fw->data; 148 hdr = (const struct common_firmware_header *)adev->vcn.fw->data;
148 adev->firmware.ucode[AMDGPU_UCODE_ID_VCN].ucode_id = AMDGPU_UCODE_ID_VCN; 149 adev->firmware.ucode[AMDGPU_UCODE_ID_VCN].ucode_id = AMDGPU_UCODE_ID_VCN;
@@ -366,7 +367,8 @@ static void vcn_v2_0_mc_resume(struct amdgpu_device *adev)
366 uint32_t offset; 367 uint32_t offset;
367 368
368 /* cache window 0: fw */ 369 /* cache window 0: fw */
369 if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) { 370 if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP &&
371 adev->asic_type != CHIP_RENOIR) {
370 WREG32_SOC15(UVD, 0, mmUVD_LMI_VCPU_CACHE_64BIT_BAR_LOW, 372 WREG32_SOC15(UVD, 0, mmUVD_LMI_VCPU_CACHE_64BIT_BAR_LOW,
371 (adev->firmware.ucode[AMDGPU_UCODE_ID_VCN].tmr_mc_addr_lo)); 373 (adev->firmware.ucode[AMDGPU_UCODE_ID_VCN].tmr_mc_addr_lo));
372 WREG32_SOC15(UVD, 0, mmUVD_LMI_VCPU_CACHE_64BIT_BAR_HIGH, 374 WREG32_SOC15(UVD, 0, mmUVD_LMI_VCPU_CACHE_64BIT_BAR_HIGH,
@@ -411,7 +413,8 @@ static void vcn_v2_0_mc_resume_dpg_mode(struct amdgpu_device *adev, bool indirec
411 uint32_t offset; 413 uint32_t offset;
412 414
413 /* cache window 0: fw */ 415 /* cache window 0: fw */
414 if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) { 416 if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP &&
417 adev->asic_type != CHIP_RENOIR) {
415 if (!indirect) { 418 if (!indirect) {
416 WREG32_SOC15_DPG_MODE_2_0(SOC15_DPG_MODE_OFFSET_2_0( 419 WREG32_SOC15_DPG_MODE_2_0(SOC15_DPG_MODE_OFFSET_2_0(
417 UVD, 0, mmUVD_LMI_VCPU_CACHE_64BIT_BAR_LOW), 420 UVD, 0, mmUVD_LMI_VCPU_CACHE_64BIT_BAR_LOW),