drm/amd: Add concept of running prepare_suspend() sequence for IP blocks
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 6 Oct 2023 18:50:21 +0000 (13:50 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 Oct 2023 15:00:58 +0000 (11:00 -0400)
commitcb11ca3233aa3303dc11dca25977d2e7f24be00f
treef5db9dae24f87c141651d6e4685a045e11547665
parent5095d5418193eb2748c7d8553c7150b8f1c44696
drm/amd: Add concept of running prepare_suspend() sequence for IP blocks

If any IP blocks allocate memory during their hw_fini() sequence
this can cause the suspend to fail under memory pressure.  Introduce
a new phase that IP blocks can use to allocate memory before suspend
starts so that it can potentially be evicted into swap instead.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/include/amd_shared.h