From: jsg Date: Thu, 15 Jun 2023 03:09:32 +0000 (+0000) Subject: drm/amdgpu/gfx10: Disable gfxoff before disabling powergating. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=702b98e64542d8788052586b23f0914bdd3d0bd4;p=openbsd drm/amdgpu/gfx10: Disable gfxoff before disabling powergating. From Bas Nieuwenhuizen abfe2ffc004a0e6d23573b52826adf3dafdd9e02 in linux-6.1.y/6.1.30 8173cab3368a13cdc3cad0bd5cf14e9399b0f501 in mainline linux --- 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;