[mutter/wip/rstrode/rhel-8.0.0: 117/117] native: add some logging spew



commit 31c3695314fcb6190491e016544953b675e43925
Author: Ray Strode <rstrode redhat com>
Date:   Wed Feb 13 09:53:42 2019 -0500

    native: add some logging spew
    
    hopefully this will help us get to the bottom of why jkoten's machine
    isn't fixed.

 src/backends/meta-backend.c               | 24 +++++++++++++++++++++++-
 src/backends/native/meta-backend-native.c | 20 ++++++++++++++++++--
 src/backends/native/meta-launcher.c       | 18 +++++++++++++++---
 3 files changed, 56 insertions(+), 6 deletions(-)
---
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index eb8790967..5f5682249 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -611,7 +611,15 @@ inhibit_sleep (MetaBackend *backend)
   int handle, fd;
 
   if (priv->inhibit_sleep_fd >= 0)
-    return;
+    {
+      g_warning ("tried to inhibit suspend when already inhibited");
+
+      if (priv->inhibit_sleep_fd == 0)
+        g_warning ("but, really, something went wrong, the fd is 0");
+      return;
+    }
+
+  g_warning ("inhibiting suspend temporarily");
 
   if (!login1_manager_call_inhibit_sync (priv->logind_proxy,
                                          "sleep",
@@ -645,6 +653,16 @@ uninhibit_sleep (MetaBackend *backend)
 {
   MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
 
+  if (priv->inhibit_sleep_fd < 0)
+    {
+      g_warning ("tried to uninhibit suspend when not inhibited");
+      return;
+    }
+  else if (priv->inhibit_sleep_fd == 0)
+      g_warning ("uninhibiting suspend but suspend fd is 0!");
+  else
+      g_warning ("uninhibiting suspend");
+
   close (priv->inhibit_sleep_fd);
   priv->inhibit_sleep_fd = -1;
 }
@@ -654,14 +672,18 @@ prepare_for_sleep_cb (MetaBackend *backend,
                       gboolean     suspending)
 {
   if (suspending) {
+    g_warning ("preparing to suspend");
     g_signal_emit (backend, signals[SUSPENDING], 0);
+    g_warning ("suspending");
     uninhibit_sleep (backend);
     return;
   }
 
+  g_warning ("preparing to resume");
   inhibit_sleep (backend);
   g_signal_emit (backend, signals[RESUMING], 0);
   meta_idle_monitor_reset_idletime (meta_idle_monitor_get_core ());
+  g_warning ("resuming");
 }
 
 static Login1Manager *
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
index 8cc322c6b..4b7ed4603 100644
--- a/src/backends/native/meta-backend-native.c
+++ b/src/backends/native/meta-backend-native.c
@@ -646,7 +646,12 @@ meta_backend_native_pause (MetaBackendNative *native)
     meta_backend_native_get_instance_private (native);
 
   if (priv->is_paused)
-    return;
+    {
+      g_warning ("tried to pause when already paused\n");
+      return;
+    }
+
+  g_warning ("pausing\n");
 
   clutter_evdev_release_devices ();
   clutter_egl_freeze_master_clock ();
@@ -673,14 +678,25 @@ void meta_backend_native_resume (MetaBackendNative *native)
   MetaIdleMonitor *idle_monitor;
 
   if (!priv->is_paused)
-    return;
+    {
+      g_warning ("tried to resume when not paused\n");
+      return;
+    }
+  g_warning ("resuming\n");
 
   if (cogl_has_feature (cogl_context, COGL_FEATURE_ID_UNSTABLE_TEXTURES))
     {
+      g_warning ("purging glphy cache\n");
       clutter_clear_glyph_cache ();
+      g_warning ("refreshing cursor\n");
       meta_screen_update_cursor (display->screen);
+      g_warning ("redrawing window and background textures\n");
       g_signal_emit_by_name (display, "gl-video-memory-purged");
     }
+  else
+    {
+      g_warning ("gpu doesn't have unstable textures problem, so we're good there\n");
+    }
 
   meta_monitor_manager_kms_resume (monitor_manager_kms);
 
diff --git a/src/backends/native/meta-launcher.c b/src/backends/native/meta-launcher.c
index 8b066c9ff..d0d307fde 100644
--- a/src/backends/native/meta-launcher.c
+++ b/src/backends/native/meta-launcher.c
@@ -280,14 +280,25 @@ sync_active (MetaLauncher *self)
   gboolean active = login1_session_get_active (LOGIN1_SESSION (self->session_proxy));
 
   if (active == self->session_active)
-    return;
+    {
+      g_warning ("tried to sync activeness when already in sync");
+      return;
+    }
 
+  g_warning ("syncing activeness");
   self->session_active = active;
 
   if (active)
-    meta_backend_native_resume (backend_native);
+    {
+      g_warning ("inactive -> active");
+      meta_backend_native_resume (backend_native);
+    }
   else
-    meta_backend_native_pause (backend_native);
+    {
+      g_warning ("active -> inactive");
+      meta_backend_native_pause (backend_native);
+    }
+  g_warning ("activeness synced");
 }
 
 static void
@@ -296,6 +307,7 @@ on_active_changed (Login1Session *session,
                    gpointer       user_data)
 {
   MetaLauncher *self = user_data;
+  g_warning ("got active changed notification");
   sync_active (self);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]