drm/amd/display: fix hibernate entry for DCN35+
authorHamza Mahfooz <hamza.mahfooz@amd.com>
Fri, 4 Oct 2024 19:22:57 +0000 (15:22 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Oct 2024 18:59:28 +0000 (14:59 -0400)
Since, two suspend-resume cycles are required to enter hibernate and,
since we only need to enable idle optimizations in the first cycle
(which is pretty much equivalent to s2idle). We can check in_s0ix, to
prevent the system from entering idle optimizations before it actually
enters hibernate (from display's perspective). Also, call
dc_set_power_state() before dc_allow_idle_optimizations(), since it's
safer to do so because dc_set_power_state() writes to DMUB.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 2fe79508d9c393bb9931b0037c5ecaee09a8dc39)
Cc: stable@vger.kernel.org # 6.10+
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 60c617fcc97ee783aa7fa3d3451e453d9bd07767..6b5e2206e6879d9c5c559da0bcf7354ede41134e 100644 (file)
@@ -2972,10 +2972,11 @@ static int dm_suspend(void *handle)
 
        hpd_rx_irq_work_suspend(dm);
 
-       if (adev->dm.dc->caps.ips_support)
-               dc_allow_idle_optimizations(adev->dm.dc, true);
-
        dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D3);
+
+       if (dm->dc->caps.ips_support && adev->in_s0ix)
+               dc_allow_idle_optimizations(dm->dc, true);
+
        dc_dmub_srv_set_power_state(dm->dc->ctx->dmub_srv, DC_ACPI_CM_POWER_STATE_D3);
 
        return 0;