Skip to content

Commit e341631

Browse files
Jie1zhangalexdeucher
authored andcommitted
drm/amdgpu: disable GFXOFF and PG during compute for GFX9
Temporary workaround to fix issues observed in some compute applications when GFXOFF is enabled on GFX9. Signed-off-by: Jesse Zhang <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent ef2354c commit e341631

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,12 +683,19 @@ int amdgpu_amdkfd_submit_ib(struct amdgpu_device *adev,
683683

684684
void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool idle)
685685
{
686+
enum amd_powergating_state state = idle ? AMD_PG_STATE_GATE : AMD_PG_STATE_UNGATE;
686687
/* Temporary workaround to fix issues observed in some
687688
* compute applications when GFXOFF is enabled on GFX11.
688689
*/
689690
if (IP_VERSION_MAJ(amdgpu_ip_version(adev, GC_HWIP, 0)) == 11) {
690691
pr_debug("GFXOFF is %s\n", idle ? "enabled" : "disabled");
691692
amdgpu_gfx_off_ctrl(adev, idle);
693+
} else if ((IP_VERSION_MAJ(amdgpu_ip_version(adev, GC_HWIP, 0)) == 9) &&
694+
(adev->flags & AMD_IS_APU)) {
695+
/* Disable GFXOFF and PG. Temporary workaround
696+
* to fix some compute applications issue on GFX9.
697+
*/
698+
adev->ip_blocks[AMD_IP_BLOCK_TYPE_GFX].version->funcs->set_powergating_state((void *)adev, state);
692699
}
693700
amdgpu_dpm_switch_power_profile(adev,
694701
PP_SMC_POWER_PROFILE_COMPUTE,

0 commit comments

Comments
 (0)