[AMD Official Use Only - Internal Distribution Only] Tested-by: changzhu <Changfeng.Zhu@xxxxxxx> BR, Changfeng. -----Original Message----- From: Zhu, James <James.Zhu@xxxxxxx> Sent: Tuesday, April 14, 2020 8:05 PM To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx Cc: Zhu, James <James.Zhu@xxxxxxx>; Zhu, Changfeng <Changfeng.Zhu@xxxxxxx> Subject: [PATCH] drm/amdgpu/vcn: fix gfxoff issue Turn off gfxoff control when vcn is gated. Signed-off-by: James Zhu <James.Zhu@xxxxxxx> --- 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 _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx