aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
diff options
context:
space:
mode:
authorLikun Gao <Likun.Gao@amd.com>2018-08-09 12:31:42 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-08-13 18:19:46 -0400
commit4d77c0f676e910fb1f1870738aa4bd168f253621 (patch)
tree2b9c255e40439cfcf14dfe80f33c0b5ce7ac055b /drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
parent235ac9de625a0a586093ad81b3de6f7d7ab913ed (diff)
drm/amdgpu:add VCN booting with firmware loaded by PSP
Setup psp firmware loading for VCN, and make VCN block booting from tmr mac address. Signed-off-by: James Zhu <James.Zhu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Likun Gao <Likun.Gao@amd.com> Signed-off-by: Likun Gao <Likun.Gao@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 798648a19710..290d5583135b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -111,9 +111,10 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
111 version_major, version_minor, family_id); 111 version_major, version_minor, family_id);
112 } 112 }
113 113
114 bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8) 114 bo_size = AMDGPU_VCN_STACK_SIZE + AMDGPU_VCN_HEAP_SIZE
115 + AMDGPU_VCN_STACK_SIZE + AMDGPU_VCN_HEAP_SIZE
116 + AMDGPU_VCN_SESSION_SIZE * 40; 115 + AMDGPU_VCN_SESSION_SIZE * 40;
116 if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
117 bo_size += AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8);
117 r = amdgpu_bo_create_kernel(adev, bo_size, PAGE_SIZE, 118 r = amdgpu_bo_create_kernel(adev, bo_size, PAGE_SIZE,
118 AMDGPU_GEM_DOMAIN_VRAM, &adev->vcn.vcpu_bo, 119 AMDGPU_GEM_DOMAIN_VRAM, &adev->vcn.vcpu_bo,
119 &adev->vcn.gpu_addr, &adev->vcn.cpu_addr); 120 &adev->vcn.gpu_addr, &adev->vcn.cpu_addr);
@@ -189,11 +190,13 @@ int amdgpu_vcn_resume(struct amdgpu_device *adev)
189 unsigned offset; 190 unsigned offset;
190 191
191 hdr = (const struct common_firmware_header *)adev->vcn.fw->data; 192 hdr = (const struct common_firmware_header *)adev->vcn.fw->data;
192 offset = le32_to_cpu(hdr->ucode_array_offset_bytes); 193 if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) {
193 memcpy_toio(adev->vcn.cpu_addr, adev->vcn.fw->data + offset, 194 offset = le32_to_cpu(hdr->ucode_array_offset_bytes);
194 le32_to_cpu(hdr->ucode_size_bytes)); 195 memcpy_toio(adev->vcn.cpu_addr, adev->vcn.fw->data + offset,
195 size -= le32_to_cpu(hdr->ucode_size_bytes); 196 le32_to_cpu(hdr->ucode_size_bytes));
196 ptr += le32_to_cpu(hdr->ucode_size_bytes); 197 size -= le32_to_cpu(hdr->ucode_size_bytes);
198 ptr += le32_to_cpu(hdr->ucode_size_bytes);
199 }
197 memset_io(ptr, 0, size); 200 memset_io(ptr, 0, size);
198 } 201 }
199 202