Tue Nov 20 22:37:31 2012 UTC ()
Pull up following revision(s) (requested by abs in ticket #673):
	external/mit/xorg-server/dist/exa/exa_unaccel.c: revision 1.2
	external/mit/xorg-server/dist/exa/exa_priv.h: revision 1.2
Apply patch https://bugs.freedesktop.org/attachment.cgi?id=68718
(with whitespace tweaks) from
https://bugs.freedesktop.org/show_bug.cgi?id=47266
to address graphics corruption using recent Cairo, manifested most
commonly by certain rendered text sections appearing as solid rectangular
blocks of colour.
Should be pulled up to netbsd-6 (and probably -5)


(riz)
diff -r1.1.1.4 -r1.1.1.4.2.1 xsrc/external/mit/xorg-server/dist/exa/exa_priv.h
diff -r1.1.1.6 -r1.1.1.6.2.1 xsrc/external/mit/xorg-server/dist/exa/exa_unaccel.c

cvs diff -r1.1.1.4 -r1.1.1.4.2.1 xsrc/external/mit/xorg-server/dist/exa/exa_priv.h (expand / switch to unified diff)

--- xsrc/external/mit/xorg-server/dist/exa/exa_priv.h 2010/11/23 05:21:03 1.1.1.4
+++ xsrc/external/mit/xorg-server/dist/exa/exa_priv.h 2012/11/20 22:37:31 1.1.1.4.2.1
@@ -196,26 +196,27 @@ typedef struct { @@ -196,26 +196,27 @@ typedef struct {
196 /* Holds information on fallbacks that cannot be relayed otherwise. */ 196 /* Holds information on fallbacks that cannot be relayed otherwise. */
197 unsigned int fallback_flags; 197 unsigned int fallback_flags;
198 unsigned int fallback_counter; 198 unsigned int fallback_counter;
199 199
200 ExaGlyphCacheRec glyphCaches[EXA_NUM_GLYPH_CACHES]; 200 ExaGlyphCacheRec glyphCaches[EXA_NUM_GLYPH_CACHES];
201 201
202 /** 202 /**
203 * Regions affected by fallback composite source / mask operations. 203 * Regions affected by fallback composite source / mask operations.
204 */ 204 */
205 205
206 RegionRec srcReg; 206 RegionRec srcReg;
207 RegionRec maskReg; 207 RegionRec maskReg;
208 PixmapPtr srcPix; 208 PixmapPtr srcPix;
 209 PixmapPtr maskPix;
209 210
210} ExaScreenPrivRec, *ExaScreenPrivPtr; 211} ExaScreenPrivRec, *ExaScreenPrivPtr;
211 212
212/* 213/*
213 * This is the only completely portable way to 214 * This is the only completely portable way to
214 * compute this info. 215 * compute this info.
215 */ 216 */
216#ifndef BitsPerPixel 217#ifndef BitsPerPixel
217#define BitsPerPixel(d) (\ 218#define BitsPerPixel(d) (\
218 PixmapWidthPaddingInfo[d].notPower2 ? \ 219 PixmapWidthPaddingInfo[d].notPower2 ? \
219 (PixmapWidthPaddingInfo[d].bytesPerPixel * 8) : \ 220 (PixmapWidthPaddingInfo[d].bytesPerPixel * 8) : \
220 ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \ 221 ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \
221 (PixmapWidthPaddingInfo[d].padRoundUp+1))) 222 (PixmapWidthPaddingInfo[d].padRoundUp+1)))

cvs diff -r1.1.1.6 -r1.1.1.6.2.1 xsrc/external/mit/xorg-server/dist/exa/exa_unaccel.c (expand / switch to unified diff)

--- xsrc/external/mit/xorg-server/dist/exa/exa_unaccel.c 2011/08/02 06:56:46 1.1.1.6
+++ xsrc/external/mit/xorg-server/dist/exa/exa_unaccel.c 2012/11/20 22:37:31 1.1.1.6.2.1
@@ -439,36 +439,40 @@ ExaSrcValidate(DrawablePtr pDrawable, @@ -439,36 +439,40 @@ ExaSrcValidate(DrawablePtr pDrawable,
439 int y, 439 int y,
440 int width, 440 int width,
441 int height, 441 int height,
442 unsigned int subWindowMode) 442 unsigned int subWindowMode)
443{ 443{
444 ScreenPtr pScreen = pDrawable->pScreen; 444 ScreenPtr pScreen = pDrawable->pScreen;
445 ExaScreenPriv(pScreen); 445 ExaScreenPriv(pScreen);
446 PixmapPtr pPix = exaGetDrawablePixmap (pDrawable); 446 PixmapPtr pPix = exaGetDrawablePixmap (pDrawable);
447 BoxRec box; 447 BoxRec box;
448 RegionRec reg; 448 RegionRec reg;
449 RegionPtr dst; 449 RegionPtr dst;
450 int xoff, yoff; 450 int xoff, yoff;
451 451
 452 if (pExaScr->srcPix == pPix)
 453 dst = &pExaScr->srcReg;
 454 else if (pExaScr->maskPix == pPix)
 455 dst = &pExaScr->maskReg;
 456 else
 457 return;
 458
452 exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff); 459 exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff);
453 460
454 box.x1 = x + xoff; 461 box.x1 = x + xoff;
455 box.y1 = y + yoff; 462 box.y1 = y + yoff;
456 box.x2 = box.x1 + width; 463 box.x2 = box.x1 + width;
457 box.y2 = box.y1 + height; 464 box.y2 = box.y1 + height;
458 465
459 dst = (pExaScr->srcPix == pPix) ? &pExaScr->srcReg : 
460 &pExaScr->maskReg; 
461 
462 RegionInit(&reg, &box, 1); 466 RegionInit(&reg, &box, 1);
463 RegionUnion(dst, dst, &reg); 467 RegionUnion(dst, dst, &reg);
464 RegionUninit(&reg); 468 RegionUninit(&reg);
465 469
466 if (pExaScr->SavedSourceValidate) { 470 if (pExaScr->SavedSourceValidate) {
467 swap(pExaScr, pScreen, SourceValidate); 471 swap(pExaScr, pScreen, SourceValidate);
468 pScreen->SourceValidate(pDrawable, x, y, width, height, subWindowMode); 472 pScreen->SourceValidate(pDrawable, x, y, width, height, subWindowMode);
469 swap(pExaScr, pScreen, SourceValidate); 473 swap(pExaScr, pScreen, SourceValidate);
470 } 474 }
471} 475}
472 476
473static Bool 477static Bool
474ExaPrepareCompositeReg(ScreenPtr pScreen, 478ExaPrepareCompositeReg(ScreenPtr pScreen,
@@ -497,37 +501,40 @@ ExaPrepareCompositeReg(ScreenPtr pScree @@ -497,37 +501,40 @@ ExaPrepareCompositeReg(ScreenPtr pScree
497 501
498 502
499 RegionNull(&region); 503 RegionNull(&region);
500 504
501 if (pSrc->pDrawable) { 505 if (pSrc->pDrawable) {
502 pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable); 506 pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable);
503 RegionNull(&pExaScr->srcReg); 507 RegionNull(&pExaScr->srcReg);
504 srcReg = &pExaScr->srcReg; 508 srcReg = &pExaScr->srcReg;
505 pExaScr->srcPix = pSrcPix; 509 pExaScr->srcPix = pSrcPix;
506 if (pSrc != pDst) 510 if (pSrc != pDst)
507 RegionTranslate(pSrc->pCompositeClip, 511 RegionTranslate(pSrc->pCompositeClip,
508 -pSrc->pDrawable->x, 512 -pSrc->pDrawable->x,
509 -pSrc->pDrawable->y); 513 -pSrc->pDrawable->y);
510 } 514 } else
 515 pExaScr->srcPix = NULL;
511 516
512 if (pMask && pMask->pDrawable) { 517 if (pMask && pMask->pDrawable) {
513 pMaskPix = exaGetDrawablePixmap(pMask->pDrawable); 518 pMaskPix = exaGetDrawablePixmap(pMask->pDrawable);
514 RegionNull(&pExaScr->maskReg); 519 RegionNull(&pExaScr->maskReg);
515 maskReg = &pExaScr->maskReg; 520 maskReg = &pExaScr->maskReg;
 521 pExaScr->maskPix = pMaskPix;
516 if (pMask != pDst && pMask != pSrc) 522 if (pMask != pDst && pMask != pSrc)
517 RegionTranslate(pMask->pCompositeClip, 523 RegionTranslate(pMask->pCompositeClip,
518 -pMask->pDrawable->x, 524 -pMask->pDrawable->x,
519 -pMask->pDrawable->y); 525 -pMask->pDrawable->y);
520 } 526 } else
 527 pExaScr->maskPix = NULL;
521 528
522 RegionTranslate(pDst->pCompositeClip, 529 RegionTranslate(pDst->pCompositeClip,
523 -pDst->pDrawable->x, 530 -pDst->pDrawable->x,
524 -pDst->pDrawable->y); 531 -pDst->pDrawable->y);
525 532
526 pExaScr->SavedSourceValidate = ExaSrcValidate; 533 pExaScr->SavedSourceValidate = ExaSrcValidate;
527 swap(pExaScr, pScreen, SourceValidate); 534 swap(pExaScr, pScreen, SourceValidate);
528 ret = miComputeCompositeRegion (&region, pSrc, pMask, pDst, 535 ret = miComputeCompositeRegion (&region, pSrc, pMask, pDst,
529 xSrc, ySrc, xMask, yMask, 536 xSrc, ySrc, xMask, yMask,
530 xDst, 537 xDst,
531 yDst, 538 yDst,
532 width, height); 539 width, height);
533 swap(pExaScr, pScreen, SourceValidate); 540 swap(pExaScr, pScreen, SourceValidate);