Blame SOURCES/0006-backends-native-update-glyph-cache-on-resume.patch

776610
From 5134dd47c161a47d45e7742cbfba8a0e8cb67be5 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 6/9] backends/native: update glyph cache on resume
776610
776610
As mentioned in a previous commit, the proprietary NVIDIA
776610
driver garbles memory on suspend. That behavior, means that
776610
clutter's glyph cache (which is stored in GPU memory) gets
776610
corrupted on suspend.
776610
776610
This commit ensures the glyph cache is blown away when
776610
the logind session becomes active (on VT switch and resume).
776610
---
776610
 src/backends/native/meta-backend-native.c | 5 ++++-
776610
 1 file changed, 4 insertions(+), 1 deletion(-)
776610
776610
diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c
776610
index f87c5a066..0730a4acb 100644
776610
--- a/src/backends/native/meta-backend-native.c
776610
+++ b/src/backends/native/meta-backend-native.c
776610
@@ -626,43 +626,46 @@ meta_activate_session (void)
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
+      clutter_clear_glyph_cache ();
776610
+      g_signal_emit_by_name (display, "gl-video-memory-purged");
776610
+    }
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