summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
diff options
context:
space:
mode:
authorLang Yu <Lang.Yu@amd.com>2023-05-09 03:26:37 +0300
committerAlex Deucher <alexander.deucher@amd.com>2023-08-31 23:34:10 +0300
commitc5d67a0ec3cc05eb640729fb61dd8810ba317fba (patch)
treef0e2dccd161596c356cc58baaee80f2aa9b783b0 /drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
parent9d4346bdbc6484a1814011315827c258509b483c (diff)
downloadlinux-c5d67a0ec3cc05eb640729fb61dd8810ba317fba.tar.xz
drm/amdgpu: add PSP loading support for VPE
Add PSP loading support for Video Processing Engine. Signed-off-by: Lang Yu <Lang.Yu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
index f573a44d5d87..a84e03a9b0fc 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
@@ -56,6 +56,22 @@ int amdgpu_vpe_init_microcode(struct amdgpu_vpe *vpe)
adev->vpe.fw_version = le32_to_cpu(vpe_hdr->header.ucode_version);
adev->vpe.feature_version = le32_to_cpu(vpe_hdr->ucode_feature_version);
+ if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
+ struct amdgpu_firmware_info *info;
+
+ info = &adev->firmware.ucode[AMDGPU_UCODE_ID_VPE_CTX];
+ info->ucode_id = AMDGPU_UCODE_ID_VPE_CTX;
+ info->fw = adev->vpe.fw;
+ adev->firmware.fw_size +=
+ ALIGN(le32_to_cpu(vpe_hdr->ctx_ucode_size_bytes), PAGE_SIZE);
+
+ info = &adev->firmware.ucode[AMDGPU_UCODE_ID_VPE_CTL];
+ info->ucode_id = AMDGPU_UCODE_ID_VPE_CTL;
+ info->fw = adev->vpe.fw;
+ adev->firmware.fw_size +=
+ ALIGN(le32_to_cpu(vpe_hdr->ctl_ucode_size_bytes), PAGE_SIZE);
+ }
+
return 0;
out:
dev_err(adev->dev, "fail to initialize vpe microcode\n");