]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Force flush after write to IPS driver signals
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Mon, 8 Apr 2024 14:45:04 +0000 (10:45 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 30 Apr 2024 13:46:45 +0000 (09:46 -0400)
[Why]
It's possible that the write hasn't fully completed by the time we
send (and flush) a command to DMCUB to notify idle to request IPS2
exit.

[How]
Perform a readback of the volatile structure into dc_dmub_srv state.

Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h

index 3177000335b28fb080fd3c134b885a5a3e1b1524..33d3307f5c1cffb6407dc89cb666a48ad026c82c 100644 (file)
@@ -1296,6 +1296,7 @@ static void dc_dmub_srv_notify_idle(const struct dc *dc, bool allow_idle)
                }
 
                ips_driver->signals = new_signals;
+               dc_dmub_srv->driver_signals = ips_driver->signals;
        }
 
        DC_LOG_IPS(
@@ -1339,6 +1340,7 @@ static void dc_dmub_srv_exit_low_power_state(const struct dc *dc)
                ips2_exit_count = ips_fw->ips2_exit_count;
 
                ips_driver->signals.all = 0;
+               dc_dmub_srv->driver_signals = ips_driver->signals;
 
                DC_LOG_IPS(
                        "%s (allow ips1=%d ips2=%d) (commit ips1=%d ips2=%d) (count rcg=%d ips1=%d ips2=%d)",
index 72cc483e1556ee7f9a379a08f604405b19b8dc90..3297c5b332652bea62a1c4a880bfacc32230768d 100644 (file)
@@ -53,6 +53,7 @@ struct dc_dmub_srv {
        void *dm;
 
        int32_t idle_exit_counter;
+       union dmub_shared_state_ips_driver_signals driver_signals;
        bool idle_allowed;
        bool needs_idle_wake;
 };