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

657d8e
From 122d7726e450712b8b2fc85db41e3c8ab7b6ad56 Mon Sep 17 00:00:00 2001
657d8e
From: Ray Strode <rstrode@redhat.com>
657d8e
Date: Tue, 15 Jan 2019 10:29:55 -0500
657d8e
Subject: [PATCH 5/9] backends/native: emit gl-video-memory-purged when
657d8e
 becoming active
657d8e
657d8e
The proprietary NVIDIA driver garbles memory on suspend.  In order
657d8e
to work around that limitation, mutter needs to refresh all its
657d8e
textures on resuem.
657d8e
657d8e
This commit lays the way toward doing that by emitting the
657d8e
"gl-video-memory-purged" signal when the compositor becomes active
657d8e
by logind (which happens on VT switch and on resume).
657d8e
---
657d8e
 src/backends/native/meta-backend-native.c | 7 +++++++
657d8e
 1 file changed, 7 insertions(+)
657d8e
657d8e
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
657d8e
index c473681cb..f593197e7 100644
657d8e
--- a/src/backends/native/meta-backend-native.c
657d8e
+++ b/src/backends/native/meta-backend-native.c
657d8e
@@ -653,8 +653,15 @@ void meta_backend_native_resume (MetaBackendNative *native)
657d8e
     meta_backend_get_monitor_manager (backend);
657d8e
   MetaMonitorManagerKms *monitor_manager_kms =
657d8e
     META_MONITOR_MANAGER_KMS (monitor_manager);
657d8e
+  MetaDisplay *display = meta_get_display ();
657d8e
+  ClutterBackend *clutter_backend = clutter_get_default_backend ();
657d8e
+  CoglContext *cogl_context =
657d8e
+    clutter_backend_get_cogl_context (clutter_backend);
657d8e
   MetaIdleMonitor *idle_monitor;
657d8e
 
657d8e
+  if (cogl_has_feature (cogl_context, COGL_FEATURE_ID_UNSTABLE_TEXTURES))
657d8e
+    g_signal_emit_by_name (display, "gl-video-memory-purged");
657d8e
+
657d8e
   meta_monitor_manager_kms_resume (monitor_manager_kms);
657d8e
 
657d8e
   clutter_evdev_reclaim_devices ();
657d8e
-- 
657d8e
2.21.0
657d8e