From 4c513e3e19937efcd0bf0acebf96e2c70dab5c6c Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Fri, 31 Jul 2020 15:06:38 +0800 Subject: [PATCH] backends/native: Remove unused `meta_gpu_kms_wait_for_flip` and more Remove unused function `meta_gpu_kms_wait_for_flip` and other code which only existed to support `meta_gpu_kms_wait_for_flip`. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1388 --- src/backends/native/meta-gpu-kms.c | 10 ------ src/backends/native/meta-gpu-kms.h | 3 -- src/backends/native/meta-kms-device.c | 47 -------------------------- src/backends/native/meta-kms-device.h | 3 -- src/backends/native/meta-kms-private.h | 2 -- src/backends/native/meta-kms.c | 11 ------ 6 files changed, 76 deletions(-) diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c index 072f64e3b..fa50c98a8 100644 --- a/src/backends/native/meta-gpu-kms.c +++ b/src/backends/native/meta-gpu-kms.c @@ -183,16 +183,6 @@ timespec_to_nanoseconds (const struct timespec *ts) return ((int64_t) ts->tv_sec) * one_billion + ts->tv_nsec; } -gboolean -meta_gpu_kms_wait_for_flip (MetaGpuKms *gpu_kms, - GError **error) -{ - if (meta_kms_device_dispatch_sync (gpu_kms->kms_device, error) < 0) - return FALSE; - - return TRUE; -} - MetaKmsDevice * meta_gpu_kms_get_kms_device (MetaGpuKms *gpu_kms) { diff --git a/src/backends/native/meta-gpu-kms.h b/src/backends/native/meta-gpu-kms.h index f14e385b7..5ddf31a7c 100644 --- a/src/backends/native/meta-gpu-kms.h +++ b/src/backends/native/meta-gpu-kms.h @@ -48,9 +48,6 @@ gboolean meta_gpu_kms_is_crtc_active (MetaGpuKms *gpu_kms, gboolean meta_gpu_kms_is_boot_vga (MetaGpuKms *gpu_kms); gboolean meta_gpu_kms_is_platform_device (MetaGpuKms *gpu_kms); -gboolean meta_gpu_kms_wait_for_flip (MetaGpuKms *gpu_kms, - GError **error); - MetaKmsDevice * meta_gpu_kms_get_kms_device (MetaGpuKms *gpu_kms); int meta_gpu_kms_get_fd (MetaGpuKms *gpu_kms); diff --git a/src/backends/native/meta-kms-device.c b/src/backends/native/meta-kms-device.c index a31dce8bd..57f1f0c9f 100644 --- a/src/backends/native/meta-kms-device.c +++ b/src/backends/native/meta-kms-device.c @@ -174,53 +174,6 @@ meta_kms_device_predict_states_in_impl (MetaKmsDevice *device, meta_kms_impl_device_predict_states (impl_device, update); } -static gpointer -dispatch_in_impl (MetaKmsImpl *impl, - gpointer user_data, - GError **error) -{ - MetaKmsImplDevice *impl_device = META_KMS_IMPL_DEVICE (user_data); - gboolean ret; - - ret = meta_kms_impl_device_dispatch (impl_device, error); - return GINT_TO_POINTER (ret); -} - -static gpointer -dispatch_idle_in_impl (MetaKmsImpl *impl, - gpointer user_data, - GError **error) -{ - meta_kms_impl_dispatch_idle (impl); - - return GINT_TO_POINTER (TRUE); -} - -int -meta_kms_device_dispatch_sync (MetaKmsDevice *device, - GError **error) -{ - int callback_count; - - if (!meta_kms_run_impl_task_sync (device->kms, - dispatch_idle_in_impl, - device->impl_device, - error)) - return -1; - - callback_count = meta_kms_flush_callbacks (device->kms); - if (callback_count > 0) - return TRUE; - - if (!meta_kms_run_impl_task_sync (device->kms, - dispatch_in_impl, - device->impl_device, - error)) - return -1; - - return meta_kms_flush_callbacks (device->kms); -} - void meta_kms_device_add_fake_plane_in_impl (MetaKmsDevice *device, MetaKmsPlaneType plane_type, diff --git a/src/backends/native/meta-kms-device.h b/src/backends/native/meta-kms-device.h index 9f83d3855..10fe787f1 100644 --- a/src/backends/native/meta-kms-device.h +++ b/src/backends/native/meta-kms-device.h @@ -49,9 +49,6 @@ MetaKmsPlane * meta_kms_device_get_primary_plane_for (MetaKmsDevice *device, MetaKmsPlane * meta_kms_device_get_cursor_plane_for (MetaKmsDevice *device, MetaKmsCrtc *crtc); -int meta_kms_device_dispatch_sync (MetaKmsDevice *device, - GError **error); - MetaKmsDevice * meta_kms_device_new (MetaKms *kms, const char *path, MetaKmsDeviceFlag flags, diff --git a/src/backends/native/meta-kms-private.h b/src/backends/native/meta-kms-private.h index 65d441b2b..8d0954c72 100644 --- a/src/backends/native/meta-kms-private.h +++ b/src/backends/native/meta-kms-private.h @@ -36,8 +36,6 @@ void meta_kms_queue_callback (MetaKms *kms, gpointer user_data, GDestroyNotify user_data_destroy); -int meta_kms_flush_callbacks (MetaKms *kms); - gpointer meta_kms_run_impl_task_sync (MetaKms *kms, MetaKmsImplTaskFunc func, gpointer user_data, diff --git a/src/backends/native/meta-kms.c b/src/backends/native/meta-kms.c index 96bfe3eb2..a14b69f40 100644 --- a/src/backends/native/meta-kms.c +++ b/src/backends/native/meta-kms.c @@ -318,17 +318,6 @@ meta_kms_queue_callback (MetaKms *kms, kms->callback_source_id = g_idle_add (callback_idle, kms); } -int -meta_kms_flush_callbacks (MetaKms *kms) -{ - int callback_count; - - callback_count = flush_callbacks (kms); - g_clear_handle_id (&kms->callback_source_id, g_source_remove); - - return callback_count; -} - gpointer meta_kms_run_impl_task_sync (MetaKms *kms, MetaKmsImplTaskFunc func,