Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu/vcn2.5: fix a bug for the 2nd vcn instance (v2)

Fix a bug for the 2nd vcn instance at start and stop.

v2: squash in unused label removal.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

James Zhu and committed by
Alex Deucher
62884a7b b6501217

+8 -5
+8 -5
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
··· 891 891 for (i = 0; i < adev->vcn.num_vcn_inst; ++i) { 892 892 if (adev->vcn.harvest_config & (1 << i)) 893 893 continue; 894 - if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) 895 - return vcn_v2_5_start_dpg_mode(adev, i, adev->vcn.indirect_sram); 894 + if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) { 895 + r = vcn_v2_5_start_dpg_mode(adev, i, adev->vcn.indirect_sram); 896 + continue; 897 + } 896 898 897 899 /* disable register anti-hang mechanism */ 898 900 WREG32_P(SOC15_REG_OFFSET(UVD, i, mmUVD_POWER_STATUS), 0, ··· 904 902 tmp = RREG32_SOC15(UVD, i, mmUVD_STATUS) | UVD_STATUS__UVD_BUSY; 905 903 WREG32_SOC15(UVD, i, mmUVD_STATUS, tmp); 906 904 } 905 + 906 + if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) 907 + return 0; 907 908 908 909 /*SW clock gating */ 909 910 vcn_v2_5_disable_clock_gating(adev); ··· 1299 1294 for (i = 0; i < adev->vcn.num_vcn_inst; ++i) { 1300 1295 if (adev->vcn.harvest_config & (1 << i)) 1301 1296 continue; 1302 - 1303 1297 if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) { 1304 1298 r = vcn_v2_5_stop_dpg_mode(adev, i); 1305 - goto power_off; 1299 + continue; 1306 1300 } 1307 1301 1308 1302 /* wait for vcn idle */ ··· 1353 1349 ~UVD_POWER_STATUS__UVD_POWER_STATUS_MASK); 1354 1350 } 1355 1351 1356 - power_off: 1357 1352 if (adev->pm.dpm_enabled) 1358 1353 amdgpu_dpm_enable_uvd(adev, false); 1359 1354