kms/crtc: Don't report predicted gamma changes

We started to report resource changes using prediction when an update
had been successfully committed. While at it, gamma changes were
reported too, but this was problematic, as gsd-color will listen for the
MonitorsChanged D-Bus signal and naively set the gamma again, even if it
didn't change. There aren't currently any actual use cases for being
told when gamma changes from a prediction, so just ignore it and just
report privacy screen changes.

This avoids a feedback loop between mutter and gsd-color.

Fixes: 81b28a1d97
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2531>
This commit is contained in:
Jonas Ådahl 2022-07-26 11:02:32 +02:00
parent d928b6baa6
commit d985069542
3 changed files with 4 additions and 13 deletions

View File

@ -42,7 +42,7 @@ MetaKmsResourceChanges meta_kms_crtc_update_state (MetaKmsCrtc *crtc);
void meta_kms_crtc_disable (MetaKmsCrtc *crtc);
MetaKmsResourceChanges meta_kms_crtc_predict_state (MetaKmsCrtc *crtc,
void meta_kms_crtc_predict_state (MetaKmsCrtc *crtc,
MetaKmsUpdate *update);
uint32_t meta_kms_crtc_get_prop_id (MetaKmsCrtc *crtc,

View File

@ -278,14 +278,13 @@ meta_kms_crtc_disable (MetaKmsCrtc *crtc)
crtc->current_state.drm_mode = (drmModeModeInfo) { 0 };
}
MetaKmsResourceChanges
void
meta_kms_crtc_predict_state (MetaKmsCrtc *crtc,
MetaKmsUpdate *update)
{
GList *mode_sets;
GList *crtc_gammas;
GList *l;
MetaKmsResourceChanges changes = META_KMS_RESOURCE_CHANGE_NONE;
mode_sets = meta_kms_update_get_mode_sets (update);
for (l = mode_sets; l; l = l->next)
@ -338,11 +337,8 @@ meta_kms_crtc_predict_state (MetaKmsCrtc *crtc,
crtc->current_state.gamma.blue =
g_memdup2 (gamma->blue, gamma->size * sizeof (uint16_t));
changes |= META_KMS_RESOURCE_CHANGE_GAMMA;
break;
}
return changes;
}
static void

View File

@ -923,12 +923,7 @@ meta_kms_impl_device_predict_states (MetaKmsImplDevice *impl_device,
MetaKmsResourceChanges changes = META_KMS_RESOURCE_CHANGE_NONE;
GList *l;
for (l = priv->crtcs; l; l = l->next)
{
MetaKmsCrtc *crtc = l->data;
changes |= meta_kms_crtc_predict_state (crtc, update);
}
g_list_foreach (priv->crtcs, (GFunc) meta_kms_crtc_predict_state, update);
for (l = priv->connectors; l; l = l->next)
{