]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu: disable GFXOFF and PG during compute for GFX9
authorJesse Zhang <jesse.zhang@amd.com>
Fri, 13 Oct 2023 01:28:44 +0000 (09:28 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 Oct 2023 15:33:56 +0000 (11:33 -0400)
Temporary workaround to fix issues observed in some compute
applications when GFXOFF is enabled on GFX9.

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c

index d3805dbbbb6ff4ecbf1557c46238fc8725eba6af..b8412202a1b0e1339f37756a17fac6cd0733b453 100644 (file)
@@ -683,12 +683,19 @@ err:
 
 void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool idle)
 {
+       enum amd_powergating_state state = idle ? AMD_PG_STATE_GATE : AMD_PG_STATE_UNGATE;
        /* Temporary workaround to fix issues observed in some
         * compute applications when GFXOFF is enabled on GFX11.
         */
        if (IP_VERSION_MAJ(amdgpu_ip_version(adev, GC_HWIP, 0)) == 11) {
                pr_debug("GFXOFF is %s\n", idle ? "enabled" : "disabled");
                amdgpu_gfx_off_ctrl(adev, idle);
+       } else if ((IP_VERSION_MAJ(amdgpu_ip_version(adev, GC_HWIP, 0)) == 9) &&
+               (adev->flags & AMD_IS_APU)) {
+               /* Disable GFXOFF and PG. Temporary workaround
+                * to fix some compute applications issue on GFX9.
+                */
+               adev->ip_blocks[AMD_IP_BLOCK_TYPE_GFX].version->funcs->set_powergating_state((void *)adev, state);
        }
        amdgpu_dpm_switch_power_profile(adev,
                                        PP_SMC_POWER_PROFILE_COMPUTE,