From 5f95146fcfcae60cc29265799ba3b851647105d6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 1 Apr 2006 22:35:16 +0000 Subject: [PATCH] Export exaPrepare/FinishGC to the rest of EXA, and use it in the ImageGlyph implementation to avoid unprepared access to the tile. Also, relocate the fbGetDrawable to avoid using a stale dest pointer after exaSolidBoxClipped() may have migrated it. Revealed by xtest. --- ChangeLog | 10 ++++++++++ exa/exa_accel.c | 7 +++++-- exa/exa_priv.h | 6 ++++++ exa/exa_unaccel.c | 4 ++-- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0dd8eb00..b14d7205a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-04-01 Eric Anholt + + * exa/exa_accel.c: (exaImageGlyphBlt): + * exa/exa_priv.h: + * exa/exa_unaccel.c: + Export exaPrepare/FinishGC to the rest of EXA, and use it in the + ImageGlyph implementation to avoid unprepared access to the tile. Also, + relocate the fbGetDrawable to avoid using a stale dest pointer after + exaSolidBoxClipped() may have migrated it. Revealed by xtest. + 2006-04-01 Eric Anholt * exa/exa_priv.h: diff --git a/exa/exa_accel.c b/exa/exa_accel.c index c51312126..1978852b6 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -695,8 +695,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable, return; } glyph = NULL; - fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - switch (dstBpp) { + switch (pDrawable->bitsPerPixel) { case 8: glyph = fbGlyph8; break; case 16: glyph = fbGlyph16; break; case 24: glyph = fbGlyph24; break; @@ -742,6 +741,9 @@ exaImageGlyphBlt (DrawablePtr pDrawable, EXA_FALLBACK(("to 0x%lx\n", (long)pDrawable)); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + exaPrepareAccessGC (pGC); + + fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); ppci = ppciInit; while (nglyph--) @@ -787,6 +789,7 @@ exaImageGlyphBlt (DrawablePtr pDrawable, } x += pci->metrics.characterWidth; } + exaFinishAccessGC (pGC); exaFinishAccess (pDrawable, EXA_PREPARE_DEST); } diff --git a/exa/exa_priv.h b/exa/exa_priv.h index 3c09560c2..18550eec0 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -188,6 +188,12 @@ typedef struct _ExaMigrationRec { void exaDDXDriverInit (ScreenPtr pScreen); /* exa_unaccel.c */ +void +exaPrepareAccessGC(GCPtr pGC); + +void +exaFinishAccessGC(GCPtr pGC); + void ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans, DDXPointPtr ppt, int *pwidth, int fSorted); diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index fcce67b91..b28c5a5b0 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -36,7 +36,7 @@ * Solid doesn't use an extra pixmap source, and Stippled/OpaqueStippled are * 1bpp and never in fb, so we don't worry about them. */ -static void +void exaPrepareAccessGC(GCPtr pGC) { if (pGC->fillStyle == FillTiled) @@ -46,7 +46,7 @@ exaPrepareAccessGC(GCPtr pGC) /** * Finishes access to the tile in the GC, if used. */ -static void +void exaFinishAccessGC(GCPtr pGC) { if (pGC->fillStyle == FillTiled)