[PATCH] drm/amdgpu/vcn: fix gfxoff issue

Zhu, Changfeng Changfeng.Zhu at amd.com
Tue Apr 14 14:14:40 UTC 2020


[AMD Official Use Only - Internal Distribution Only]


Tested-by: changzhu <Changfeng.Zhu at amd.com>

BR,
Changfeng.

-----Original Message-----
From: Zhu, James <James.Zhu at amd.com> 
Sent: Tuesday, April 14, 2020 8:05 PM
To: amd-gfx at lists.freedesktop.org
Cc: Zhu, James <James.Zhu at amd.com>; Zhu, Changfeng <Changfeng.Zhu at amd.com>
Subject: [PATCH] drm/amdgpu/vcn: fix gfxoff issue

Turn off gfxoff control when vcn is gated.

Signed-off-by: James Zhu <James.Zhu at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index dab34f6..aa9a7a5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -369,9 +369,11 @@ void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
 	cancel_delayed_work_sync(&adev->vcn.idle_work);
 
 	mutex_lock(&adev->vcn.vcn_pg_lock);
-	amdgpu_gfx_off_ctrl(adev, false);
-	amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
-	       AMD_PG_STATE_UNGATE);
+	if (adev->vcn.cur_state == AMD_PG_STATE_GATE) {
+		amdgpu_gfx_off_ctrl(adev, false);
+		amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VCN,
+		       AMD_PG_STATE_UNGATE);
+	}
 
 	if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)	{
 		struct dpg_pause_state new_state;
-- 
2.7.4


More information about the amd-gfx mailing list