sna: Accommodate changes to the Damage extension not unwrapping the GC
commit 4dc2a76740d921c824a4d8193f39dd373475f02a
Author: Adam Jackson <ajax@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@chris-wilson.co.uk>
This commit is contained in:
parent
8f5a6d107b
commit
0a00c3765c
|
|
@ -278,6 +278,7 @@ typedef int FbStride;
|
|||
typedef struct {
|
||||
long changes;
|
||||
long serial;
|
||||
GCFuncs *old_funcs;
|
||||
void *priv;
|
||||
|
||||
FbBits and, xor; /* reduced rop values */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue