Blame SOURCES/0005-backends-native-emit-gl-video-memory-purged-when-bec.patch

776610
From 0af0c75dc60166d2755537b8499e9e4a1501e4a8 Mon Sep 17 00:00:00 2001
776610
From: Ray Strode <rstrode@redhat.com>
776610
Date: Tue, 15 Jan 2019 10:29:55 -0500
776610
Subject: [PATCH 5/9] backends/native: emit gl-video-memory-purged when
776610
 becoming active
776610
776610
The proprietary NVIDIA driver garbles memory on suspend.  In order
776610
to work around that limitation, mutter needs to refresh all its
776610
textures on resuem.
776610
776610
This commit lays the way toward doing that by emitting the
776610
"gl-video-memory-purged" signal when the compositor becomes active
776610
by logind (which happens on VT switch and on resume).
776610
---
776610
 src/backends/native/meta-backend-native.c | 7 +++++++
776610
 1 file changed, 7 insertions(+)
776610
776610
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
776610
index 042d96ec6..f87c5a066 100644
776610
--- a/src/backends/native/meta-backend-native.c
776610
+++ b/src/backends/native/meta-backend-native.c
776610
@@ -618,44 +618,51 @@ meta_activate_session (void)
776610
       g_warning ("Could not activate session: %s\n", error->message);
776610
       g_error_free (error);
776610
       return FALSE;
776610
     }
776610
 
776610
   return TRUE;
776610
 }
776610
 
776610
 void
776610
 meta_backend_native_pause (MetaBackendNative *native)
776610
 {
776610
   MetaBackend *backend = META_BACKEND (native);
776610
   MetaMonitorManager *monitor_manager =
776610
     meta_backend_get_monitor_manager (backend);
776610
   MetaMonitorManagerKms *monitor_manager_kms =
776610
     META_MONITOR_MANAGER_KMS (monitor_manager);
776610
 
776610
   clutter_evdev_release_devices ();
776610
   clutter_egl_freeze_master_clock ();
776610
 
776610
   meta_monitor_manager_kms_pause (monitor_manager_kms);
776610
 }
776610
 
776610
 void meta_backend_native_resume (MetaBackendNative *native)
776610
 {
776610
   MetaBackend *backend = META_BACKEND (native);
776610
   MetaMonitorManager *monitor_manager =
776610
     meta_backend_get_monitor_manager (backend);
776610
   MetaMonitorManagerKms *monitor_manager_kms =
776610
     META_MONITOR_MANAGER_KMS (monitor_manager);
776610
+  MetaDisplay *display = meta_get_display ();
776610
+  ClutterBackend *clutter_backend = clutter_get_default_backend ();
776610
+  CoglContext *cogl_context =
776610
+    clutter_backend_get_cogl_context (clutter_backend);
776610
   ClutterActor *stage;
776610
   MetaIdleMonitor *idle_monitor;
776610
 
776610
+  if (cogl_has_feature (cogl_context, COGL_FEATURE_ID_UNSTABLE_TEXTURES))
776610
+    g_signal_emit_by_name (display, "gl-video-memory-purged");
776610
+
776610
   meta_monitor_manager_kms_resume (monitor_manager_kms);
776610
 
776610
   clutter_evdev_reclaim_devices ();
776610
   clutter_egl_thaw_master_clock ();
776610
 
776610
   stage = meta_backend_get_stage (backend);
776610
   clutter_actor_queue_redraw (stage);
776610
 
776610
   idle_monitor = meta_backend_get_idle_monitor (backend, 0);
776610
   meta_idle_monitor_reset_idletime (idle_monitor);
776610
 }
776610
-- 
776610
2.18.1
776610