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