[mutter/wip/texture-purge-on-nvidia: 14/17] wip! force texture updates



commit a5d7889fc8886088c642c8d9e924d671bc88fbff
Author: Ray Strode <rstrode redhat com>
Date:   Tue Jan 8 16:51:28 2019 -0500

    wip! force texture updates
    
    This unfinished commit makes sure all the various texture caches
    get flushed on resume, so they don't leave corruption on the
    screen with nvidia proprietary driver.
    
    There's still no answer for client redraws, but I think maybe we
    can fudge it near term, by messing with the output scale factor
    or some other trick like that.
    
    Also, this needs to conditionalize the code so it only runs for
    nvidia. That's something i'm going to experiment with next.
    
    The code detects resume via timerfd instead of ARB_robustness, so
    we don't lose our context. that code needs to be conditionalized,
    so it doesn't try to build on platforms that don't have timerfd.
    
    This whole commit needs to be broken up into subcommits.

 src/compositor/compositor.c                 | 15 ++++++++++++---
 src/compositor/meta-surface-actor-wayland.c |  2 ++
 2 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index 8c924d256..1dedd2fd8 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -54,6 +54,8 @@
 
 #include <clutter/x11/clutter-x11.h>
 
+#include <sys/timerfd.h>
+
 #include "core.h"
 #include <meta/screen.h>
 #include <meta/errors.h>
@@ -89,7 +91,6 @@ on_presented (ClutterStage     *stage,
               CoglFrameEvent    event,
               ClutterFrameInfo *frame_info,
               MetaCompositor   *compositor);
-
 static gboolean
 is_modal (MetaDisplay *display)
 {
@@ -1175,6 +1176,14 @@ meta_pre_paint_func (gpointer data)
   return TRUE;
 }
 
+static void
+purge_textures (MetaCompositor *compositor)
+{
+  clutter_clear_glyph_cache ();
+  g_signal_emit_by_name (compositor->display, "gl-video-memory-purged");
+  clutter_actor_queue_redraw (CLUTTER_ACTOR (compositor->stage));
+}
+
 static gboolean
 meta_post_paint_func (gpointer data)
 {
@@ -1190,14 +1199,14 @@ meta_post_paint_func (gpointer data)
     }
 
   status = cogl_get_graphics_reset_status (compositor->context);
+
   switch (status)
     {
     case COGL_GRAPHICS_RESET_STATUS_NO_ERROR:
       break;
 
     case COGL_GRAPHICS_RESET_STATUS_PURGED_CONTEXT_RESET:
-      g_signal_emit_by_name (compositor->display, "gl-video-memory-purged");
-      clutter_actor_queue_redraw (CLUTTER_ACTOR (compositor->stage));
+      purge_textures (compositor);
       break;
 
     default:
diff --git a/src/compositor/meta-surface-actor-wayland.c b/src/compositor/meta-surface-actor-wayland.c
index 7505b7d79..7b00b68a2 100644
--- a/src/compositor/meta-surface-actor-wayland.c
+++ b/src/compositor/meta-surface-actor-wayland.c
@@ -228,6 +228,8 @@ meta_surface_actor_wayland_class_init (MetaSurfaceActorWaylandClass *klass)
 static void
 meta_surface_actor_wayland_init (MetaSurfaceActorWayland *self)
 {
+  MetaSurfaceActorWaylandPrivate *priv =
+    meta_surface_actor_wayland_get_instance_private (self);
 }
 
 MetaSurfaceActor *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]