mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
kms/connector: Properly predict connectors turning off
The connector state wasn't properly predicted, as it earlied out if the connector wasn't part of a mode set connector list. Instead use the old CRTC to check whether it was used in any mode set, and whether the connector was part of any new mode set, to predict whether the connector is inactive or active. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1821>
This commit is contained in:
parent
4b78c8d84f
commit
e956078052
@ -498,28 +498,34 @@ void
|
|||||||
meta_kms_connector_predict_state (MetaKmsConnector *connector,
|
meta_kms_connector_predict_state (MetaKmsConnector *connector,
|
||||||
MetaKmsUpdate *update)
|
MetaKmsUpdate *update)
|
||||||
{
|
{
|
||||||
|
MetaKmsConnectorState *current_state;
|
||||||
GList *mode_sets;
|
GList *mode_sets;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
current_state = connector->current_state;
|
||||||
if (!connector->current_state)
|
if (!current_state)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
MetaKmsModeSet *mode_set = l->data;
|
MetaKmsModeSet *mode_set = l->data;
|
||||||
MetaKmsCrtc *crtc;
|
MetaKmsCrtc *crtc = mode_set->crtc;
|
||||||
|
|
||||||
if (!g_list_find (mode_set->connectors, connector))
|
if (current_state->current_crtc_id == meta_kms_crtc_get_id (crtc))
|
||||||
continue;
|
{
|
||||||
|
if (g_list_find (mode_set->connectors, connector))
|
||||||
crtc = mode_set->crtc;
|
break;
|
||||||
if (crtc)
|
else
|
||||||
connector->current_state->current_crtc_id = meta_kms_crtc_get_id (crtc);
|
current_state->current_crtc_id = 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
connector->current_state->current_crtc_id = 0;
|
{
|
||||||
|
if (g_list_find (mode_set->connectors, connector))
|
||||||
break;
|
{
|
||||||
|
current_state->current_crtc_id = meta_kms_crtc_get_id (crtc);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user