renderer/native: Don't queue mode set on hotplug power-save on

We need to trigger a mode set when power-save changes to 'on' if it's
purely about power saving, but when they arrive as part of a hotplug
event, we'll handle all that later, in the monitors-changed handling,
that contains the new configuration.

This avoids a crash that happens due to the mode set being queued on now
disabled connectors.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2985
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3233>
This commit is contained in:
Jonas Ådahl
2023-09-01 22:22:34 +02:00
committed by Marge Bot
parent efbb8df611
commit b20d7a5cc4
2 changed files with 105 additions and 1 deletions

View File

@ -2022,7 +2022,8 @@ on_power_save_mode_changed (MetaMonitorManager *monitor_manager,
MetaPowerSave power_save_mode;
power_save_mode = meta_monitor_manager_get_power_save_mode (monitor_manager);
if (power_save_mode == META_POWER_SAVE_ON)
if (power_save_mode == META_POWER_SAVE_ON &&
reason == META_POWER_SAVE_CHANGE_REASON_MODE_CHANGE)
meta_renderer_native_queue_modes_reset (renderer_native);
else
meta_kms_discard_pending_page_flips (kms);