kms: Only emit resources-changed signal if we recorded a change

Since we cache already all the KMS parameters we care about let's check at
each device update if anything has really changed and only in such case
emit a resources-changed signal.

In this way we can also filter out the DRM parameters that when changed
don't require a full monitors rebuild.

Examples are the gamma settings or the privacy screen parameters, that
emits an udev "hotplug" event when changed, but we want to register those
only when we handle the changed property.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1964>
This commit is contained in:
Marco Trevisan (Treviño)
2020-07-31 21:37:17 +02:00
committed by Marge Bot
parent d2eec866ed
commit a8d11161b6
16 changed files with 364 additions and 93 deletions

View File

@ -186,15 +186,19 @@ meta_kms_device_get_fallback_modes (MetaKmsDevice *device)
return device->fallback_modes;
}
void
MetaKmsUpdateChanges
meta_kms_device_update_states_in_impl (MetaKmsDevice *device)
{
MetaKmsImplDevice *impl_device = meta_kms_device_get_impl_device (device);
MetaKmsUpdateChanges changes;
meta_assert_in_kms_impl (device->kms);
meta_assert_is_waiting_for_kms_impl_task (device->kms);
meta_kms_impl_device_update_states (impl_device);
changes = meta_kms_impl_device_update_states (impl_device);
if (changes == META_KMS_UPDATE_CHANGE_NONE)
return changes;
g_list_free (device->crtcs);
device->crtcs = meta_kms_impl_device_copy_crtcs (impl_device);
@ -204,6 +208,8 @@ meta_kms_device_update_states_in_impl (MetaKmsDevice *device)
g_list_free (device->planes);
device->planes = meta_kms_impl_device_copy_planes (impl_device);
return changes;
}
void