drm/amdgpu: Consolidate VCN firmware setup code
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Oct 2021 17:20:37 +0000 (13:20 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 22 Oct 2021 03:38:46 +0000 (23:38 -0400)
commitc5dd5667f4196b5b3b4bc2a83ad795850c08197f
tree40847eff14a5bbd5542ab0d0d9834b7b8f1691bf
parente8ac9e93b492e281e6051aac65024b580017f850
drm/amdgpu: Consolidate VCN firmware setup code

Roughly the same code was present in all VCN versions.
Consolidate it into a single function.

v2: use AMDGPU_UCODE_ID_VCN + i, check if num_inst >= 2

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c