From: Yifan Zha Date: Fri, 19 Aug 2022 03:02:19 +0000 (+0800) Subject: drm/admgpu: Skip CG/PG on SOC21 under SRIOV VF X-Git-Tag: block-6.1-2022-13-10~35^2~16^2~16 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=828418259254863e0af5805bd712284e2bd88e3b;p=linux-block.git drm/admgpu: Skip CG/PG on SOC21 under SRIOV VF [Why] There is no CG(Clock Gating)/PG(Power Gating) requirement on SRIOV VF. For multi VF, VF should not enable any CG/PG features. For one VF, PF will program CG/PG related registers. [How] Do not set any cg/pg flag bit at early init under sriov. Acked-by: Christian König Signed-off-by: Yifan Zha Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c index 47ef671543b3..34a267265971 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc21.c +++ b/drivers/gpu/drm/amd/amdgpu/soc21.c @@ -582,6 +582,10 @@ static int soc21_common_early_init(void *handle) AMD_PG_SUPPORT_JPEG | AMD_PG_SUPPORT_ATHUB | AMD_PG_SUPPORT_MMHUB; + if (amdgpu_sriov_vf(adev)) { + adev->cg_flags = 0; + adev->pg_flags = 0; + } adev->external_rev_id = adev->rev_id + 0x1; // TODO: need update break; case IP_VERSION(11, 0, 2):