xf86-video-intel: src/sna/fb src/sna/sna_accel.c src/sna/sna.h

Chris Wilson ickle at kemper.freedesktop.org
Tue Sep 25 05:57:06 PDT 2012


 src/sna/fb/fb.h     |    1 +
 src/sna/sna.h       |    2 ++
 src/sna/sna_accel.c |    9 +++++----
 3 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 0a00c3765c3ba464bb4e9cde12e964c979421ed6
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Sep 25 13:50:33 2012 +0100

    sna: Accommodate changes to the Damage extension not unwrapping the GC
    
    commit 4dc2a76740d921c824a4d8193f39dd373475f02a
    Author: Adam Jackson <ajax at redhat.com>
    Date:   Thu Sep 20 17:57:00 2012 -0400
    
        miext/damage: Only wrap into the GC ops chain if there's a listener (v3)
    
    leaves the GC->funcs still pointing to the damage layer as it calls into
    the driver functions, so we need to be careful to restore the correct
    function table after we manipulate the GC for fallbacks.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/fb/fb.h b/src/sna/fb/fb.h
index adefaa1..e58e039 100644
--- a/src/sna/fb/fb.h
+++ b/src/sna/fb/fb.h
@@ -278,6 +278,7 @@ typedef int FbStride;
 typedef struct {
 	long changes;
 	long serial;
+	GCFuncs *old_funcs;
 	void *priv;
 
 	FbBits and, xor;            /* reduced rop values */
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 28dff6d..031be72 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -171,6 +171,8 @@ static inline struct sna_pixmap *sna_pixmap_from_drawable(DrawablePtr drawable)
 struct sna_gc {
 	long changes;
 	long serial;
+
+	GCFuncs *old_funcs;
 	void *priv;
 };
 
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index a2afce0..5e3280e 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -3178,12 +3178,13 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
 	DBG(("%s, changes=%lx\n", __FUNCTION__, changes));
 
 	assert(gc->ops == (GCOps *)&sna_gc_ops);
-	assert(gc->funcs == (GCFuncs *)&sna_gc_funcs);
+	gc->ops = (GCOps *)&sna_gc_ops__cpu;
+
+	sgc->old_funcs = gc->funcs;
+	gc->funcs = (GCFuncs *)&sna_gc_funcs__cpu;
 
 	sgc->priv = gc->pCompositeClip;
 	gc->pCompositeClip = region;
-	gc->ops = (GCOps *)&sna_gc_ops__cpu;
-	gc->funcs = (GCFuncs *)&sna_gc_funcs__cpu;
 
 	if (gc->clientClipType == CT_PIXMAP) {
 		PixmapPtr clip = gc->clientClip;
@@ -3238,7 +3239,7 @@ static void sna_gc_move_to_gpu(GCPtr gc)
 	assert(gc->funcs == (GCFuncs *)&sna_gc_funcs__cpu);
 
 	gc->ops = (GCOps *)&sna_gc_ops;
-	gc->funcs = (GCFuncs *)&sna_gc_funcs;
+	gc->funcs = sna_gc(gc)->old_funcs;
 	gc->pCompositeClip = sna_gc(gc)->priv;
 }
 


More information about the xorg-commit mailing list