kms: Update device state when resuming

Suspending might have changed the CRTC configuration, turning some off,
some on, etc. We need to update our internal representation of this
state, so that we know how to reconfigure upon resuming, e.g. what CRTCs
to turn off again.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1488>
This commit is contained in:
Jonas Ådahl 2020-12-15 22:42:55 +01:00 committed by Marge Bot
parent 214850143d
commit f0318d8964
4 changed files with 9 additions and 1 deletions

View File

@ -652,6 +652,7 @@ void meta_backend_native_resume (MetaBackendNative *native)
"Backend (resume)");
meta_monitor_manager_kms_resume (monitor_manager_kms);
meta_kms_resume (native->kms);
connect_udev_device_added_handler (native);

View File

@ -573,6 +573,12 @@ handle_hotplug_event (MetaKms *kms)
g_signal_emit (kms, signals[RESOURCES_CHANGED], 0);
}
void
meta_kms_resume (MetaKms *kms)
{
handle_hotplug_event (kms);
}
static void
on_udev_hotplug (MetaUdev *udev,
MetaKms *kms)

View File

@ -50,6 +50,8 @@ MetaBackend * meta_kms_get_backend (MetaKms *kms);
GList * meta_kms_get_devices (MetaKms *kms);
void meta_kms_resume (MetaKms *kms);
MetaKmsDevice * meta_kms_create_device (MetaKms *kms,
const char *path,
MetaKmsDeviceFlag flags,

View File

@ -516,7 +516,6 @@ void
meta_monitor_manager_kms_resume (MetaMonitorManagerKms *manager_kms)
{
meta_monitor_manager_kms_connect_hotplug_handler (manager_kms);
handle_hotplug_event (META_MONITOR_MANAGER (manager_kms));
}
static gboolean