kms: Properly predict power saving effect on tracked state

Entering power saving effectively disables CRTCs, and thus the CRTC id a
connector is associated with. Make sure that the tracked state reflects
this.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2159>
This commit is contained in:
Jonas Ådahl 2021-06-28 09:16:12 +02:00 committed by Marge Bot
parent 8ea49fe9d9
commit 2478000c73
2 changed files with 11 additions and 0 deletions

View File

@ -766,6 +766,9 @@ meta_kms_connector_predict_state (MetaKmsConnector *connector,
if (!current_state) if (!current_state)
return; return;
if (meta_kms_update_is_power_save (update))
current_state->current_crtc_id = 0;
mode_sets = meta_kms_update_get_mode_sets (update); mode_sets = meta_kms_update_get_mode_sets (update);
for (l = mode_sets; l; l = l->next) for (l = mode_sets; l; l = l->next)
{ {

View File

@ -285,6 +285,14 @@ meta_kms_crtc_predict_state (MetaKmsCrtc *crtc,
GList *crtc_gammas; GList *crtc_gammas;
GList *l; GList *l;
if (meta_kms_update_is_power_save (update))
{
crtc->current_state.is_active = FALSE;
crtc->current_state.rect = (MetaRectangle) { 0 };
crtc->current_state.is_drm_mode_valid = FALSE;
crtc->current_state.drm_mode = (drmModeModeInfo) { 0 };
}
mode_sets = meta_kms_update_get_mode_sets (update); mode_sets = meta_kms_update_get_mode_sets (update);
for (l = mode_sets; l; l = l->next) for (l = mode_sets; l; l = l->next)
{ {