Commit e8ac9e93 authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu/vcn3.0: handle harvesting in firmware setup

Only enable firmware for the instance that is enabled.

v2: use AMDGPU_UCODE_ID_VCN + i

Fixes: 1b592d00 ("drm/amdgpu/vcn: remove manual instance setting")
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1743Reviewed-by: default avatarJames Zhu <James.Zhu@amd.com>
Reviewed-by: default avatarLeo Liu <leo.liu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 33c6bd98
...@@ -123,6 +123,7 @@ static int vcn_v3_0_sw_init(void *handle) ...@@ -123,6 +123,7 @@ static int vcn_v3_0_sw_init(void *handle)
{ {
struct amdgpu_ring *ring; struct amdgpu_ring *ring;
int i, j, r; int i, j, r;
unsigned int idx;
int vcn_doorbell_index = 0; int vcn_doorbell_index = 0;
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
...@@ -133,14 +134,13 @@ static int vcn_v3_0_sw_init(void *handle) ...@@ -133,14 +134,13 @@ static int vcn_v3_0_sw_init(void *handle)
if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) { if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
const struct common_firmware_header *hdr; const struct common_firmware_header *hdr;
hdr = (const struct common_firmware_header *)adev->vcn.fw->data; hdr = (const struct common_firmware_header *)adev->vcn.fw->data;
adev->firmware.ucode[AMDGPU_UCODE_ID_VCN].ucode_id = AMDGPU_UCODE_ID_VCN;
adev->firmware.ucode[AMDGPU_UCODE_ID_VCN].fw = adev->vcn.fw; for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
adev->firmware.fw_size += if (adev->vcn.harvest_config & (1 << i))
ALIGN(le32_to_cpu(hdr->ucode_size_bytes), PAGE_SIZE); continue;
idx = AMDGPU_UCODE_ID_VCN + i;
if (adev->vcn.num_vcn_inst == VCN_INSTANCES_SIENNA_CICHLID) { adev->firmware.ucode[idx].ucode_id = idx;
adev->firmware.ucode[AMDGPU_UCODE_ID_VCN1].ucode_id = AMDGPU_UCODE_ID_VCN1; adev->firmware.ucode[idx].fw = adev->vcn.fw;
adev->firmware.ucode[AMDGPU_UCODE_ID_VCN1].fw = adev->vcn.fw;
adev->firmware.fw_size += adev->firmware.fw_size +=
ALIGN(le32_to_cpu(hdr->ucode_size_bytes), PAGE_SIZE); ALIGN(le32_to_cpu(hdr->ucode_size_bytes), PAGE_SIZE);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment