From 1e922099599d41948a68e0a320275556c40e845d Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Thu, 15 Jun 2023 03:09:33 +0000 Subject: drm/amdgpu/gfx10: Disable gfxoff before disabling powergating. From Bas Nieuwenhuizen abfe2ffc004a0e6d23573b52826adf3dafdd9e02 in linux-6.1.y/6.1.30 8173cab3368a13cdc3cad0bd5cf14e9399b0f501 in mainline linux --- sys/dev/pci/drm/amd/amdgpu/gfx_v10_0.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/dev/pci/drm/amd/amdgpu/gfx_v10_0.c b/sys/dev/pci/drm/amd/amdgpu/gfx_v10_0.c index f03de718c71..634a71a8c7a 100644 --- a/sys/dev/pci/drm/amd/amdgpu/gfx_v10_0.c +++ b/sys/dev/pci/drm/amd/amdgpu/gfx_v10_0.c @@ -8236,8 +8236,14 @@ static int gfx_v10_0_set_powergating_state(void *handle, case IP_VERSION(10, 3, 3): case IP_VERSION(10, 3, 6): case IP_VERSION(10, 3, 7): + if (!enable) + amdgpu_gfx_off_ctrl(adev, false); + gfx_v10_cntl_pg(adev, enable); - amdgpu_gfx_off_ctrl(adev, enable); + + if (enable) + amdgpu_gfx_off_ctrl(adev, true); + break; default: break; -- cgit v1.2.3