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:
parent
d928b6baa6
commit
d985069542
@ -42,7 +42,7 @@ MetaKmsResourceChanges meta_kms_crtc_update_state (MetaKmsCrtc *crtc);
|
|||||||
|
|
||||||
void meta_kms_crtc_disable (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);
|
MetaKmsUpdate *update);
|
||||||
|
|
||||||
uint32_t meta_kms_crtc_get_prop_id (MetaKmsCrtc *crtc,
|
uint32_t meta_kms_crtc_get_prop_id (MetaKmsCrtc *crtc,
|
||||||
|
@ -278,14 +278,13 @@ meta_kms_crtc_disable (MetaKmsCrtc *crtc)
|
|||||||
crtc->current_state.drm_mode = (drmModeModeInfo) { 0 };
|
crtc->current_state.drm_mode = (drmModeModeInfo) { 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaKmsResourceChanges
|
void
|
||||||
meta_kms_crtc_predict_state (MetaKmsCrtc *crtc,
|
meta_kms_crtc_predict_state (MetaKmsCrtc *crtc,
|
||||||
MetaKmsUpdate *update)
|
MetaKmsUpdate *update)
|
||||||
{
|
{
|
||||||
GList *mode_sets;
|
GList *mode_sets;
|
||||||
GList *crtc_gammas;
|
GList *crtc_gammas;
|
||||||
GList *l;
|
GList *l;
|
||||||
MetaKmsResourceChanges changes = META_KMS_RESOURCE_CHANGE_NONE;
|
|
||||||
|
|
||||||
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)
|
||||||
@ -338,11 +337,8 @@ meta_kms_crtc_predict_state (MetaKmsCrtc *crtc,
|
|||||||
crtc->current_state.gamma.blue =
|
crtc->current_state.gamma.blue =
|
||||||
g_memdup2 (gamma->blue, gamma->size * sizeof (uint16_t));
|
g_memdup2 (gamma->blue, gamma->size * sizeof (uint16_t));
|
||||||
|
|
||||||
changes |= META_KMS_RESOURCE_CHANGE_GAMMA;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return changes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -923,12 +923,7 @@ meta_kms_impl_device_predict_states (MetaKmsImplDevice *impl_device,
|
|||||||
MetaKmsResourceChanges changes = META_KMS_RESOURCE_CHANGE_NONE;
|
MetaKmsResourceChanges changes = META_KMS_RESOURCE_CHANGE_NONE;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
for (l = priv->crtcs; l; l = l->next)
|
g_list_foreach (priv->crtcs, (GFunc) meta_kms_crtc_predict_state, update);
|
||||||
{
|
|
||||||
MetaKmsCrtc *crtc = l->data;
|
|
||||||
|
|
||||||
changes |= meta_kms_crtc_predict_state (crtc, update);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (l = priv->connectors; l; l = l->next)
|
for (l = priv->connectors; l; l = l->next)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user