kms: Use MetaThread source helpers directly

No need to have thin meta_kms_* wrappers, just use the meta_thread_*
functions directly.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2777>
This commit is contained in:
Jonas Ådahl 2021-05-27 08:33:56 +02:00
parent 2e025eea0e
commit 229904cb4b
4 changed files with 16 additions and 47 deletions

View File

@ -761,7 +761,7 @@ schedule_retry_page_flip (MetaKmsImplDeviceSimple *impl_device_simple,
MetaKms *kms = meta_kms_device_get_kms (device);
GSource *source;
source = meta_kms_add_source_in_impl (kms, retry_page_flips,
source = meta_thread_add_source_in_impl (META_THREAD (kms), retry_page_flips,
impl_device_simple, NULL);
g_source_set_ready_time (source, retry_time_us);
@ -884,7 +884,7 @@ mode_set_fallback (MetaKmsImplDeviceSimple *impl_device_simple,
{
GSource *source;
source = meta_kms_add_source_in_impl (kms,
source = meta_thread_add_source_in_impl (META_THREAD (kms),
mode_set_fallback_feedback_idle,
impl_device_simple,
NULL);
@ -947,7 +947,7 @@ dispatch_page_flip (MetaKmsImplDevice *impl_device,
meta_kms_page_flip_data_make_symbolic (page_flip_data);
source = meta_kms_add_source_in_impl (kms,
source = meta_thread_add_source_in_impl (META_THREAD (kms),
symbolic_page_flip_idle,
page_flip_data,
NULL);

View File

@ -856,8 +856,10 @@ ensure_device_file (MetaKmsImplDevice *impl_device,
if (!(priv->flags & META_KMS_DEVICE_FLAG_NO_MODE_SETTING))
{
MetaKms *kms = meta_kms_impl_get_kms (priv->impl);
priv->fd_source =
meta_kms_register_fd_in_impl (meta_kms_impl_get_kms (priv->impl),
meta_thread_register_fd_in_impl (META_THREAD (kms),
meta_device_file_get_fd (device_file),
kms_event_dispatch_in_impl,
impl_device);

View File

@ -43,16 +43,6 @@ gpointer meta_kms_run_impl_task_sync (MetaKms *kms,
gpointer user_data,
GError **error);
GSource * meta_kms_add_source_in_impl (MetaKms *kms,
GSourceFunc func,
gpointer user_data,
GDestroyNotify user_data_destroy);
GSource * meta_kms_register_fd_in_impl (MetaKms *kms,
int fd,
MetaThreadTaskFunc dispatch,
gpointer user_data);
META_EXPORT_TEST
MetaKmsResourceChanges meta_kms_update_states_sync (MetaKms *kms,
GUdevDevice *udev_device);

View File

@ -239,29 +239,6 @@ meta_kms_run_impl_task_sync (MetaKms *kms,
return meta_thread_run_impl_task_sync (thread, func, user_data, error);
}
GSource *
meta_kms_add_source_in_impl (MetaKms *kms,
GSourceFunc func,
gpointer user_data,
GDestroyNotify user_data_destroy)
{
MetaThread *thread = META_THREAD (kms);
return meta_thread_add_source_in_impl (thread, func,
user_data, user_data_destroy);
}
GSource *
meta_kms_register_fd_in_impl (MetaKms *kms,
int fd,
MetaThreadTaskFunc dispatch,
gpointer user_data)
{
MetaThread *thread = META_THREAD (kms);
return meta_thread_register_fd_in_impl (thread, fd, dispatch, user_data);
}
gboolean
meta_kms_in_impl_task (MetaKms *kms)
{