[mutter/wip/texture-purge-on-nvidia: 61/66] backend/native: Add frame clock inhibitation API
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/texture-purge-on-nvidia: 61/66] backend/native: Add frame clock inhibitation API
- Date: Tue, 8 Jan 2019 22:03:33 +0000 (UTC)
commit 59448e21be9973680fccdde9b288fcf8110c13d5
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Jan 2 12:40:07 2019 +0100
backend/native: Add frame clock inhibitation API
Add a counting clutter master frame clock inhibitation API so that multiple
users can inhibit/uninhibit the master frame clock.
src/backends/native/meta-backend-native.c | 30 ++++++++++++++++++++++++++++--
src/backends/native/meta-backend-native.h | 4 ++++
2 files changed, 32 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
index 042d96ec6..0f6a00248 100644
--- a/src/backends/native/meta-backend-native.c
+++ b/src/backends/native/meta-backend-native.c
@@ -60,6 +60,8 @@ struct _MetaBackendNativePrivate
{
MetaLauncher *launcher;
MetaBarrierManagerNative *barrier_manager;
+
+ int frame_freeze_count;
};
typedef struct _MetaBackendNativePrivate MetaBackendNativePrivate;
@@ -623,6 +625,28 @@ meta_activate_session (void)
return TRUE;
}
+void
+meta_backend_native_freeze_frame_clock (MetaBackendNative *native)
+{
+ MetaBackendNativePrivate *priv =
+ meta_backend_native_get_instance_private (native);
+
+ priv->frame_freeze_count++;
+ if (priv->frame_freeze_count == 1)
+ clutter_egl_freeze_master_clock ();
+}
+
+void
+meta_backend_native_thaw_frame_clock (MetaBackendNative *native)
+{
+ MetaBackendNativePrivate *priv =
+ meta_backend_native_get_instance_private (native);
+
+ priv->frame_freeze_count--;
+ if (priv->frame_freeze_count == 0)
+ clutter_egl_thaw_master_clock ();
+}
+
void
meta_backend_native_pause (MetaBackendNative *native)
{
@@ -633,7 +657,8 @@ meta_backend_native_pause (MetaBackendNative *native)
META_MONITOR_MANAGER_KMS (monitor_manager);
clutter_evdev_release_devices ();
- clutter_egl_freeze_master_clock ();
+
+ meta_backend_native_freeze_frame_clock (native);
meta_monitor_manager_kms_pause (monitor_manager_kms);
}
@@ -651,7 +676,8 @@ void meta_backend_native_resume (MetaBackendNative *native)
meta_monitor_manager_kms_resume (monitor_manager_kms);
clutter_evdev_reclaim_devices ();
- clutter_egl_thaw_master_clock ();
+
+ meta_backend_native_thaw_frame_clock (native);
stage = meta_backend_get_stage (backend);
clutter_actor_queue_redraw (stage);
diff --git a/src/backends/native/meta-backend-native.h b/src/backends/native/meta-backend-native.h
index d69fbe057..6de203304 100644
--- a/src/backends/native/meta-backend-native.h
+++ b/src/backends/native/meta-backend-native.h
@@ -35,6 +35,10 @@ G_DECLARE_FINAL_TYPE (MetaBackendNative, meta_backend_native,
gboolean meta_activate_vt (int vt, GError **error);
+void meta_backend_native_freeze_frame_clock (MetaBackendNative *native);
+
+void meta_backend_native_thaw_frame_clock (MetaBackendNative *native);
+
void meta_backend_native_pause (MetaBackendNative *backend_native);
void meta_backend_native_resume (MetaBackendNative *backend_native);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]