drm/amdgpu/vcn: Skip vcn power-gating change for sriov
authorSamir Dhume <samir.dhume@amd.com>
Mon, 17 Jul 2023 15:09:38 +0000 (11:09 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 16 Aug 2023 15:33:59 +0000 (11:33 -0400)
CG/PG is handled on the host side.

Signed-off-by: Samir Dhume <samir.dhume@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c

index 503cd26d3fdd6da88f8f12d1234c451056382eae..f85d18cd74ecab4c302e3fb0a36bbb845329c21a 100644 (file)
@@ -1536,6 +1536,15 @@ static int vcn_v4_0_3_set_powergating_state(void *handle,
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        int ret;
 
+       /* for SRIOV, guest should not control VCN Power-gating
+        * MMSCH FW should control Power-gating and clock-gating
+        * guest should avoid touching CGC and PG
+        */
+       if (amdgpu_sriov_vf(adev)) {
+               adev->vcn.cur_state = AMD_PG_STATE_UNGATE;
+               return 0;
+       }
+
        if (state == adev->vcn.cur_state)
                return 0;