Author: arekm Date: Sat Feb 28 17:19:25 2009 GMT Module: SOURCES Tag: HEAD ---- Log message: - updates from xserver master git; should help kde4 with open source radeon
---- Files affected: SOURCES: xorg-xserver-server-exa.patch (1.5 -> 1.6) ---- Diffs: ================================================================ Index: SOURCES/xorg-xserver-server-exa.patch diff -u SOURCES/xorg-xserver-server-exa.patch:1.5 SOURCES/xorg-xserver-server-exa.patch:1.6 --- SOURCES/xorg-xserver-server-exa.patch:1.5 Sat Nov 8 01:50:27 2008 +++ SOURCES/xorg-xserver-server-exa.patch Sat Feb 28 18:19:20 2009 @@ -1,2158 +1,742 @@ -From e99347a3e82e6db47dd482169b6799968afc3893 Mon Sep 17 00:00:00 2001 -From: Dave Airlie <[email protected]> -Date: Wed, 20 Aug 2008 10:11:07 -0400 -Subject: [PATCH] Upgrade to master EXA - ---- - - -diff --git a/exa/Makefile.am b/exa/Makefile.am -index e2f7ed3..2b3f1e4 100644 ---- a/exa/Makefile.am -+++ b/exa/Makefile.am -@@ -18,6 +18,7 @@ libexa_la_SOURCES = \ - exa.c \ - exa.h \ - exa_accel.c \ -+ exa_glyphs.c \ - exa_migration.c \ - exa_offscreen.c \ - exa_render.c \ -diff --git a/exa/exa.c b/exa/exa.c -index ccf148a..12c1549 100644 ---- a/exa/exa.c -+++ b/exa/exa.c -@@ -35,8 +35,6 @@ - #include <stdlib.h> - - #include "exa_priv.h" --#include <X11/fonts/fontstruct.h> --#include "dixfontstr.h" - #include "exa.h" - #include "cw.h" - -@@ -161,7 +159,7 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2) - RegionPtr pDamageReg; - RegionRec region; - -- if (!pExaPixmap) -+ if (!pExaPixmap || !pExaPixmap->pDamage) - return; - - box.x1 = max(x1, 0); -@@ -261,6 +259,21 @@ exaSetFbPitch(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap, - pExaScr->info->pixmapPitchAlign); - } - -+ -+static void -+ExaDamageReport(DamagePtr pDamage, RegionPtr pReg, void *pClosure) -+{ -+ PixmapPtr pPixmap = pClosure; -+ ExaPixmapPriv(pPixmap); -+ RegionPtr pDamageReg = DamageRegion(pDamage); -+ -+ if (pExaPixmap->pendingDamage) { -+ REGION_UNION(pScreen, pDamageReg, pDamageReg, pReg); -+ pExaPixmap->pendingDamage = FALSE; -+ } -+} -+ -+ - /** - * exaCreatePixmap() creates a new pixmap. - * -@@ -321,6 +334,7 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, - paddedWidth, NULL); - pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED; - pExaPixmap->fb_ptr = NULL; -+ pExaPixmap->pDamage = NULL; - } else { - pExaPixmap->driverPriv = NULL; - /* Scratch pixmaps may have w/h equal to zero, and may not be -@@ -345,21 +359,22 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, - fbDestroyPixmap(pPixmap); - return NULL; - } -- } -- -- pExaPixmap->area = NULL; - -- /* Set up damage tracking */ -- pExaPixmap->pDamage = DamageCreate (NULL, NULL, DamageReportNone, TRUE, -- pScreen, pPixmap); -+ /* Set up damage tracking */ -+ pExaPixmap->pDamage = DamageCreate (ExaDamageReport, NULL, -+ DamageReportRawRegion, TRUE, -+ pScreen, pPixmap); - -- if (pExaPixmap->pDamage == NULL) { -- fbDestroyPixmap (pPixmap); -- return NULL; +--- xorg/exa/exa_render.c~ 2009-02-25 20:12:11.000000000 +0100 ++++ xorg/exa/exa_render.c 2009-02-28 18:09:52.562970685 +0100 +@@ -342,7 +342,6 @@ + int src_off_x, src_off_y, dst_off_x, dst_off_y; + PixmapPtr pSrcPix, pDstPix; + ExaPixmapPrivPtr pSrcExaPix, pDstExaPix; +- struct _Pixmap scratch; + ExaMigrationRec pixmaps[2]; + + if (!pExaScr->info->PrepareComposite) +@@ -386,13 +385,6 @@ + if (!exaPixmapIsOffscreen(pDstPix)) + return 0; + +- if (!pSrcPix && pExaScr->info->UploadToScratch) +- { +- pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable); +- if ((*pExaScr->info->UploadToScratch) (pSrcPix, &scratch)) +- pSrcPix = &scratch; - } -+ if (pExaPixmap->pDamage == NULL) { -+ fbDestroyPixmap (pPixmap); -+ return NULL; -+ } +- + if (!pSrcPix) + return 0; -- DamageRegister (&pPixmap->drawable, pExaPixmap->pDamage); -- DamageSetReportAfterOp (pExaPixmap->pDamage, TRUE); -+ DamageRegister (&pPixmap->drawable, pExaPixmap->pDamage); -+ DamageSetReportAfterOp (pExaPixmap->pDamage, TRUE); -+ } -+ -+ pExaPixmap->area = NULL; +@@ -573,7 +565,6 @@ + int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y; + PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix; + ExaPixmapPrivPtr pSrcExaPix, pMaskExaPix = NULL, pDstExaPix; +- struct _Pixmap scratch; + ExaMigrationRec pixmaps[3]; + + pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable); +@@ -652,16 +643,6 @@ + return 0; + } - /* None of the pixmap bits are valid initially */ - REGION_NULL(pScreen, &pExaPixmap->validSys); -@@ -656,34 +671,25 @@ exaCreateGC (GCPtr pGC) - return TRUE; - } +- if (!pSrcPix && (!pMask || pMaskPix) && pExaScr->info->UploadToScratch) { +- pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable); +- if ((*pExaScr->info->UploadToScratch) (pSrcPix, &scratch)) +- pSrcPix = &scratch; +- } else if (pSrcPix && pMask && !pMaskPix && pExaScr->info->UploadToScratch) { +- pMaskPix = exaGetDrawablePixmap (pMask->pDrawable); +- if ((*pExaScr->info->UploadToScratch) (pMaskPix, &scratch)) +- pMaskPix = &scratch; +- } +- + if (!pSrcPix || (pMask && !pMaskPix)) { + REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + return 0; +commit f07f18231a921d3ae9dd9b75881c9e58e9e2e235 +Author: Michel Dänzer <[email protected]> +Date: Thu Feb 26 10:35:44 2009 +0100 + + EXA: Allow using exaCompositeRects also when we can't use a mask in exaGlyphs. + + This should give the full benefits of the glyph cache even when we can't use a + mask. + + This also means we no longer need to scan the glyphs to see if they overlap, + we can just use a mask or not as the client asks. + + Signed-off-by: Michel Dänzer <[email protected]> + +diff --git a/exa/exa_glyphs.c b/exa/exa_glyphs.c +index 688081d..918fd85 100644 +--- a/exa/exa_glyphs.c ++++ b/exa/exa_glyphs.c +@@ -68,7 +68,7 @@ + #define GLYPH_BUFFER_SIZE 256 --void --exaPrepareAccessWindow(WindowPtr pWin) -+static Bool -+exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask) + typedef struct { +- PicturePtr source; ++ PicturePtr mask; + ExaCompositeRectRec rects[GLYPH_BUFFER_SIZE]; + int count; + } ExaGlyphBuffer, *ExaGlyphBufferPtr; +@@ -144,7 +144,7 @@ exaUnrealizeGlyphCaches(ScreenPtr pScreen, + + /* All caches for a single format share a single pixmap for glyph storage, + * allowing mixing glyphs of different sizes without paying a penalty +- * for switching between source pixmaps. (Note that for a size of font ++ * for switching between mask pixmaps. (Note that for a size of font + * right at the border between two sizes, we might be switching for almost + * every glyph.) + * +@@ -417,13 +417,19 @@ exaGlyphCacheBufferGlyph(ScreenPtr pScreen, + ExaGlyphCachePtr cache, + ExaGlyphBufferPtr buffer, + GlyphPtr pGlyph, +- int xGlyph, +- int yGlyph) ++ PicturePtr pSrc, ++ PicturePtr pDst, ++ INT16 xSrc, ++ INT16 ySrc, ++ INT16 xMask, ++ INT16 yMask, ++ INT16 xDst, ++ INT16 yDst) { -- if (pWin->backgroundState == BackgroundPixmap) -+ Bool ret; -+ -+ if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap) - exaPrepareAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); - -- if (pWin->borderIsPixel == FALSE) -- exaPrepareAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_SRC); --} -+ if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE) -+ exaPrepareAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK); - --void --exaFinishAccessWindow(WindowPtr pWin) --{ -- if (pWin->backgroundState == BackgroundPixmap) -- exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); -+ ret = fbChangeWindowAttributes(pWin, mask); - -- if (pWin->borderIsPixel == FALSE) -- exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_SRC); --} -+ if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE) -+ exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK); - --static Bool --exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask) --{ -- Bool ret; -+ if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap) -+ exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); - -- exaPrepareAccessWindow(pWin); -- ret = fbChangeWindowAttributes(pWin, mask); -- exaFinishAccessWindow(pWin); - return ret; - } + ExaCompositeRectPtr rect; + int pos; + +- if (buffer->source && buffer->source != cache->picture) ++ if (buffer->mask && buffer->mask != cache->picture) + return ExaGlyphNeedFlush; -@@ -737,6 +743,9 @@ exaCloseScreen(int i, ScreenPtr pScreen) - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - #endif + if (!cache->picture) { +@@ -497,13 +503,28 @@ exaGlyphCacheBufferGlyph(ScreenPtr pScreen, -+ if (ps->Glyphs == exaGlyphs) -+ exaGlyphsFini(pScreen); -+ - pScreen->CreateGC = pExaScr->SavedCreateGC; - pScreen->CloseScreen = pExaScr->SavedCloseScreen; - pScreen->GetImage = pExaScr->SavedGetImage; -@@ -750,8 +759,9 @@ exaCloseScreen(int i, ScreenPtr pScreen) - #ifdef RENDER - if (ps) { - ps->Composite = pExaScr->SavedComposite; -+ ps->Glyphs = pExaScr->SavedGlyphs; - ps->Trapezoids = pExaScr->SavedTrapezoids; -- ps->AddTraps = pExaScr->SavedAddTraps; -+ ps->Triangles = pExaScr->SavedTriangles; } - #endif -@@ -913,14 +923,16 @@ exaDriverInit (ScreenPtr pScreen, - pExaScr->SavedComposite = ps->Composite; - ps->Composite = exaComposite; - -+ if (pScreenInfo->PrepareComposite) { -+ pExaScr->SavedGlyphs = ps->Glyphs; -+ ps->Glyphs = exaGlyphs; -+ } -+ - pExaScr->SavedTriangles = ps->Triangles; - ps->Triangles = exaTriangles; +- buffer->source = cache->picture; ++ buffer->mask = cache->picture; + + rect = &buffer->rects[buffer->count]; +- rect->xSrc = CACHE_X(pos); +- rect->ySrc = CACHE_Y(pos); +- rect->xDst = xGlyph - pGlyph->info.x; +- rect->yDst = yGlyph - pGlyph->info.y; ++ ++ if (pSrc) ++ { ++ rect->xSrc = xSrc; ++ rect->ySrc = ySrc; ++ rect->xMask = CACHE_X(pos); ++ rect->yMask = CACHE_Y(pos); ++ } ++ else ++ { ++ rect->xSrc = CACHE_X(pos); ++ rect->ySrc = CACHE_Y(pos); ++ rect->xMask = 0; ++ rect->yMask = 0; ++ } ++ ++ rect->pDst = pDst; ++ rect->xDst = xDst - pGlyph->info.x; ++ rect->yDst = yDst - pGlyph->info.y; + rect->width = pGlyph->info.width; + rect->height = pGlyph->info.height; + +@@ -519,15 +540,21 @@ static ExaGlyphCacheResult + exaBufferGlyph(ScreenPtr pScreen, + ExaGlyphBufferPtr buffer, + GlyphPtr pGlyph, +- int xGlyph, +- int yGlyph) ++ PicturePtr pSrc, ++ PicturePtr pDst, ++ INT16 xSrc, ++ INT16 ySrc, ++ INT16 xMask, ++ INT16 yMask, ++ INT16 xDst, ++ INT16 yDst) + { + ExaScreenPriv(pScreen); + unsigned int format = (GlyphPicture(pGlyph)[pScreen->myNum])->format; + int width = pGlyph->info.width; + int height = pGlyph->info.height; + ExaCompositeRectPtr rect; +- PicturePtr source; ++ PicturePtr mask; + int i; + + if (buffer->count == GLYPH_BUFFER_SIZE) +@@ -542,9 +569,15 @@ exaBufferGlyph(ScreenPtr pScreen, + if (format == cache->format && + width <= cache->glyphWidth && + height <= cache->glyphHeight) { +- ExaGlyphCacheResult result = exaGlyphCacheBufferGlyph(pScreen, &pExaScr->glyphCaches[i], ++ ExaGlyphCacheResult result = exaGlyphCacheBufferGlyph(pScreen, ++ &pExaScr->glyphCaches[i], + buffer, +- pGlyph, xGlyph, yGlyph); ++ pGlyph, ++ pSrc, ++ pDst, ++ xSrc, ySrc, ++ xMask, yMask, ++ xDst, yDst); + switch (result) { + case ExaGlyphFail: + break; +@@ -557,19 +590,21 @@ exaBufferGlyph(ScreenPtr pScreen, + + /* Couldn't find the glyph in the cache, use the glyph picture directly */ + +- source = GlyphPicture(pGlyph)[pScreen->myNum]; +- if (buffer->source && buffer->source != source) ++ mask = GlyphPicture(pGlyph)[pScreen->myNum]; ++ if (buffer->mask && buffer->mask != mask) + return ExaGlyphNeedFlush; + +- buffer->source = source; +- ++ buffer->mask = mask; ++ + rect = &buffer->rects[buffer->count]; +- rect->xSrc = 0; +- rect->ySrc = 0; +- rect->xDst = xGlyph - pGlyph->info.x; +- rect->yDst = yGlyph - pGlyph->info.y; +- rect->width = pGlyph->info.width; +- rect->height = pGlyph->info.height; ++ rect->xSrc = xSrc; ++ rect->ySrc = ySrc; ++ rect->xMask = xMask; ++ rect->yMask = yMask; ++ rect->xDst = xDst - pGlyph->info.x; ++ rect->yDst = yDst - pGlyph->info.y; ++ rect->width = width; ++ rect->height = height; + + buffer->count++; + +@@ -580,44 +615,23 @@ static void + exaGlyphsToMask(PicturePtr pMask, + ExaGlyphBufferPtr buffer) + { +- exaCompositeRects(PictOpAdd, buffer->source, pMask, ++ exaCompositeRects(PictOpAdd, buffer->mask, NULL, pMask, + buffer->count, buffer->rects); + + buffer->count = 0; +- buffer->source = NULL; ++ buffer->mask = NULL; + } - pExaScr->SavedTrapezoids = ps->Trapezoids; - ps->Trapezoids = exaTrapezoids; + static void +-exaGlyphsToDst(CARD8 op, +- PicturePtr pSrc, ++exaGlyphsToDst(PicturePtr pSrc, + PicturePtr pDst, +- ExaGlyphBufferPtr buffer, +- INT16 xSrc, +- INT16 ySrc, +- INT16 xDst, +- INT16 yDst) ++ ExaGlyphBufferPtr buffer) + { +- int i; - -- pExaScr->SavedAddTraps = ps->AddTraps; -- ps->AddTraps = ExaCheckAddTraps; - } - #endif +- for (i = 0; i < buffer->count; i++) { +- ExaCompositeRectPtr rect = &buffer->rects[i]; +- +- CompositePicture (op, +- pSrc, +- buffer->source, +- pDst, +- xSrc + rect->xDst - xDst, +- ySrc + rect->yDst - yDst, +- rect->xSrc, +- rect->ySrc, +- rect->xDst, +- rect->yDst, +- rect->width, +- rect->height); +- } ++ exaCompositeRects(PictOpOver, pSrc, buffer->mask, pDst, buffer->count, ++ buffer->rects); + + buffer->count = 0; +- buffer->source = NULL; ++ buffer->mask = NULL; + } -@@ -968,6 +980,9 @@ exaDriverInit (ScreenPtr pScreen, - } + /* Cut and paste from render/glyph.c - probably should export it instead */ +@@ -673,79 +687,6 @@ GlyphExtents (int nlist, } + } -+ if (ps->Glyphs == exaGlyphs) -+ exaGlyphsInit(pScreen); -+ - LogMessage(X_INFO, "EXA(%d): Driver registered support for the following" - " operations:\n", pScreen->myNum); - assert(pScreenInfo->PrepareSolid != NULL); -diff --git a/exa/exa.h b/exa/exa.h -index 2562094..8d9bcea 100644 ---- a/exa/exa.h -+++ b/exa/exa.h -@@ -744,21 +744,36 @@ typedef struct _ExaDriver { - - /** @} */ - -+/* in exa.c */ - ExaDriverPtr - exaDriverAlloc(void); - - Bool --exaDriverInit(ScreenPtr pScreen, -+exaDriverInit(ScreenPtr pScreen, - ExaDriverPtr pScreenInfo); - - void --exaDriverFini(ScreenPtr pScreen); -+exaDriverFini(ScreenPtr pScreen); - - void - exaMarkSync(ScreenPtr pScreen); - void - exaWaitSync(ScreenPtr pScreen); - -+unsigned long -+exaGetPixmapOffset(PixmapPtr pPix); -+ -+unsigned long -+exaGetPixmapPitch(PixmapPtr pPix); -+ -+unsigned long -+exaGetPixmapSize(PixmapPtr pPix); -+ -+void * -+exaGetPixmapDriverPrivate(PixmapPtr p); -+ -+ -+/* in exa_offscreen.c */ - ExaOffscreenArea * - exaOffscreenAlloc(ScreenPtr pScreen, int size, int align, - Bool locked, -@@ -786,15 +786,6 @@ - void - ExaOffscreenMarkUsed (PixmapPtr pPixmap); - --unsigned long --exaGetPixmapOffset(PixmapPtr pPix); -- --unsigned long --exaGetPixmapPitch(PixmapPtr pPix); +-/** +- * Returns TRUE if the glyphs in the lists intersect. Only checks based on +- * bounding box, which appears to be good enough to catch most cases at least. +- */ +-static Bool +-exaGlyphsIntersect(int nlist, GlyphListPtr list, GlyphPtr *glyphs) +-{ +- int x1, x2, y1, y2; +- int n; +- GlyphPtr glyph; +- int x, y; +- BoxRec extents; +- Bool first = TRUE; +- +- x = 0; +- y = 0; +- while (nlist--) { +- x += list->xOff; +- y += list->yOff; +- n = list->len; +- list++; +- while (n--) { +- glyph = *glyphs++; +- +- if (glyph->info.width == 0 || glyph->info.height == 0) { +- x += glyph->info.xOff; +- y += glyph->info.yOff; +- continue; +- } +- +- x1 = x - glyph->info.x; +- if (x1 < MINSHORT) +- x1 = MINSHORT; +- y1 = y - glyph->info.y; +- if (y1 < MINSHORT) +- y1 = MINSHORT; +- x2 = x1 + glyph->info.width; +- if (x2 > MAXSHORT) +- x2 = MAXSHORT; +- y2 = y1 + glyph->info.height; +- if (y2 > MAXSHORT) +- y2 = MAXSHORT; +- +- if (first) { +- extents.x1 = x1; +- extents.y1 = y1; +- extents.x2 = x2; +- extents.y2 = y2; +- first = FALSE; +- } else { +- if (x1 < extents.x2 && x2 > extents.x1 && +- y1 < extents.y2 && y2 > extents.y1) +- { +- return TRUE; +- } +- +- if (x1 < extents.x1) +- extents.x1 = x1; +- if (x2 > extents.x2) +- extents.x2 = x2; +- if (y1 < extents.y1) +- extents.y1 = y1; +- if (y2 > extents.y2) +- extents.y2 = y2; +- } +- x += glyph->info.xOff; +- y += glyph->info.yOff; +- } +- } - --unsigned long --exaGetPixmapSize(PixmapPtr pPix); +- return FALSE; +-} - <<Diff was trimmed, longer than 597 lines>> ---- CVS-web: http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/xorg-xserver-server-exa.patch?r1=1.5&r2=1.6&f=u _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
