|
|
88c283 |
From 122d7726e450712b8b2fc85db41e3c8ab7b6ad56 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
|
|
|
88c283 |
index c473681cb..f593197e7 100644
|
|
|
776610 |
--- a/src/backends/native/meta-backend-native.c
|
|
|
776610 |
+++ b/src/backends/native/meta-backend-native.c
|
|
|
88c283 |
@@ -653,8 +653,15 @@ void meta_backend_native_resume (MetaBackendNative *native)
|
|
|
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 |
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 |
--
|
|
|
88c283 |
2.21.0
|
|
|
776610 |
|