kms-impl-simple: Handle lack of cached mode set in flip fallback

When a page flip fails with a certain error code, we've treated this as
a hint that page flipping is broken and we should try to use mode
setting instead.

On some drivers, it seems that this error is also reported when there
was no mode set, which means we'll have no cached mode set to use in the
fallback. The lack of prior mode set tends to happen when we hit a race
when the DRM objects change before we have the time to process a hotplug
event.

Handle the lack a missing mode set in the flip fallback path, with the
assumption that we'll get a hotplug event that'll fix things up for us
eventually.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/917
This commit is contained in:
Jonas Ådahl 2020-01-17 08:28:17 +01:00 committed by Robert Mader
parent db9b60cc63
commit c9a5b2b22f

View File

@ -567,7 +567,12 @@ mode_set_fallback (MetaKmsImplSimple *impl_simple,
cached_mode_set = g_hash_table_lookup (impl_simple->cached_mode_sets, cached_mode_set = g_hash_table_lookup (impl_simple->cached_mode_sets,
crtc); crtc);
g_assert (cached_mode_set); if (!cached_mode_set)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Missing mode set for page flip fallback");
return FALSE;
}
fill_connector_ids_array (cached_mode_set->connectors, fill_connector_ids_array (cached_mode_set->connectors,
&connectors, &connectors,