summaryrefslogtreecommitdiff
path: root/hw/xfree86/xaa
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/xaa')
-rw-r--r--hw/xfree86/xaa/xaaBitBlt.c4
-rw-r--r--hw/xfree86/xaa/xaaCpyPlane.c4
-rw-r--r--hw/xfree86/xaa/xaaCpyWin.c4
-rw-r--r--hw/xfree86/xaa/xaaFillPoly.c8
-rw-r--r--hw/xfree86/xaa/xaaFillRect.c6
-rw-r--r--hw/xfree86/xaa/xaaImage.c5
-rw-r--r--hw/xfree86/xaa/xaaNonTEText.c2
-rw-r--r--hw/xfree86/xaa/xaaOverlay.c4
-rw-r--r--hw/xfree86/xaa/xaaOverlayDF.c6
-rw-r--r--hw/xfree86/xaa/xaaPCache.c14
-rw-r--r--hw/xfree86/xaa/xaaPict.c12
-rw-r--r--hw/xfree86/xaa/xaaStateChange.c5
-rw-r--r--hw/xfree86/xaa/xaaStipple.c66
-rw-r--r--hw/xfree86/xaa/xaaWideLine.c4
-rw-r--r--hw/xfree86/xaa/xaalocal.h4
15 files changed, 88 insertions, 60 deletions
diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c
index 015b539e5..83850767a 100644
--- a/hw/xfree86/xaa/xaaBitBlt.c
+++ b/hw/xfree86/xaa/xaaBitBlt.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitBlt.c,v 1.3 1998/12/06 06:08:39 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitBlt.c,v 1.4 2003/11/10 18:22:39 tsi Exp $ */
/*
This is a lighter version of cfbBitBlt. We calculate the boxes
@@ -161,7 +161,7 @@ XAABitBlt(
/* Check to see if the region is empty */
if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) {
- REGION_INIT(pGC->pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pGC->pScreen, &rgnDst);
} else {
REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
}
diff --git a/hw/xfree86/xaa/xaaCpyPlane.c b/hw/xfree86/xaa/xaaCpyPlane.c
index 74dcdfd31..d3d1c8a5c 100644
--- a/hw/xfree86/xaa/xaaCpyPlane.c
+++ b/hw/xfree86/xaa/xaaCpyPlane.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyPlane.c,v 1.13 2001/10/01 13:44:15 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyPlane.c,v 1.14 2003/11/10 18:22:40 tsi Exp $ */
/*
A CopyPlane function that handles bitmap->screen copies and
@@ -186,7 +186,7 @@ XAAPushPixelsSolidColorExpansion(
if(!pClipBoxes) return;
} else pClipBoxes = (BoxPtr)infoRec->PreAllocMem;
- nboxes = XAAGetRectClipBoxes(pGC->pCompositeClip, pClipBoxes, 1, &TheRect);
+ nboxes = XAAGetRectClipBoxes(pGC, pClipBoxes, 1, &TheRect);
pbox = pClipBoxes;
while(nboxes--) {
diff --git a/hw/xfree86/xaa/xaaCpyWin.c b/hw/xfree86/xaa/xaaCpyWin.c
index 1c5ecf38e..b77be1ad6 100644
--- a/hw/xfree86/xaa/xaaCpyWin.c
+++ b/hw/xfree86/xaa/xaaCpyWin.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyWin.c,v 1.3 2003/02/17 16:08:29 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyWin.c,v 1.4 2003/11/10 18:22:40 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -47,7 +47,7 @@ XAACopyWindow(
pwinRoot = WindowTable[pScreen->myNum];
- REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pScreen, &rgnDst);
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
diff --git a/hw/xfree86/xaa/xaaFillPoly.c b/hw/xfree86/xaa/xaaFillPoly.c
index 164887afe..5566f51e6 100644
--- a/hw/xfree86/xaa/xaaFillPoly.c
+++ b/hw/xfree86/xaa/xaaFillPoly.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillPoly.c,v 1.15 2001/10/28 03:34:04 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillPoly.c,v 1.16 2003/03/23 03:41:44 mvojkovi Exp $ */
/*
* Copyright 1996 The XFree86 Project
@@ -770,7 +770,11 @@ XAAFillPolygonStippled(
pCache = (*infoRec->CacheMono8x8Pattern)(
infoRec->pScrn, patx, paty);
patx = pCache->x; paty = pCache->y;
- }
+ } else {
+ pCache = &(infoRec->ScratchCacheInfoRec);
+ pCache->pat0 = patx;
+ pCache->pat1 = paty;
+ }
RectFunc = Mono8x8PatternRectHelper;
}
diff --git a/hw/xfree86/xaa/xaaFillRect.c b/hw/xfree86/xaa/xaaFillRect.c
index 1d9cd54c1..cda56e327 100644
--- a/hw/xfree86/xaa/xaaFillRect.c
+++ b/hw/xfree86/xaa/xaaFillRect.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillRect.c,v 1.15 2001/12/13 18:01:51 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillRect.c,v 1.16 2003/11/10 18:22:40 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -1018,7 +1018,7 @@ XAAClipAndRenderRects(
int
XAAGetRectClipBoxes(
- RegionPtr prgnClip,
+ GCPtr pGC,
BoxPtr pboxClippedBase,
int nrectFill,
xRectangle *prectInit
@@ -1026,7 +1026,7 @@ XAAGetRectClipBoxes(
int Right, Bottom;
BoxPtr pextent, pboxClipped = pboxClippedBase;
xRectangle *prect = prectInit;
-
+ RegionPtr prgnClip = pGC->pCompositeClip;
if (REGION_NUM_RECTS(prgnClip) == 1) {
pextent = REGION_RECTS(prgnClip);
diff --git a/hw/xfree86/xaa/xaaImage.c b/hw/xfree86/xaa/xaaImage.c
index 6da601faf..c3db7ff57 100644
--- a/hw/xfree86/xaa/xaaImage.c
+++ b/hw/xfree86/xaa/xaaImage.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaImage.c,v 1.20 2000/09/25 23:56:14 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaImage.c,v 1.21 2003/11/10 18:22:41 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -444,8 +444,7 @@ XAAPutImage(
if(!pClipBoxes) return;
} else pClipBoxes = (BoxPtr)infoRec->PreAllocMem;
- nboxes =
- XAAGetRectClipBoxes(pGC->pCompositeClip, pClipBoxes, 1, &TheRect);
+ nboxes = XAAGetRectClipBoxes(pGC, pClipBoxes, 1, &TheRect);
pbox = pClipBoxes;
if(format == XYBitmap) {
diff --git a/hw/xfree86/xaa/xaaNonTEText.c b/hw/xfree86/xaa/xaaNonTEText.c
index 914631b58..e1c57588a 100644
--- a/hw/xfree86/xaa/xaaNonTEText.c
+++ b/hw/xfree86/xaa/xaaNonTEText.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaNonTEText.c,v 1.12 2000/04/07 19:11:10 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaNonTEText.c,v 1.14 2003/11/14 21:54:51 dawes Exp $ */
/********************************************************************
diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c
index 9651ca6a3..d527b7c15 100644
--- a/hw/xfree86/xaa/xaaOverlay.c
+++ b/hw/xfree86/xaa/xaaOverlay.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlay.c,v 1.14 2002/12/10 04:18:20 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlay.c,v 1.15 2003/11/10 18:22:41 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -57,7 +57,7 @@ XAACopyWindow8_32(
if(doUnderlay)
freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
- REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pScreen, &rgnDst);
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c
index 82a2011a4..5cce3e7ed 100644
--- a/hw/xfree86/xaa/xaaOverlayDF.c
+++ b/hw/xfree86/xaa/xaaOverlayDF.c
@@ -3,7 +3,7 @@
Written by Mark Vojkovich
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlayDF.c,v 1.1 1999/03/28 15:33:03 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlayDF.c,v 1.2 2003/11/10 18:22:41 tsi Exp $ */
#include "misc.h"
@@ -355,7 +355,7 @@ XAAOverCopyWindow(
infoRec->ScratchGC.alu = GXcopy;
infoRec->ScratchGC.planemask = ~0;
- REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pScreen, &rgnDst);
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
@@ -388,7 +388,7 @@ XAAOverCopyWindow(
REGION_UNINIT(pScreen, &rgnDst);
if(pWin->drawable.depth == 8) {
- REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pScreen, &rgnDst);
miSegregateChildren(pWin, &rgnDst, pScrn->depth);
if(REGION_NOTEMPTY(pScreen, &rgnDst)) {
REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc);
diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c
index e6163b33a..c7756ba93 100644
--- a/hw/xfree86/xaa/xaaPCache.c
+++ b/hw/xfree86/xaa/xaaPCache.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPCache.c,v 1.30 2000/09/25 23:56:14 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPCache.c,v 1.33 2003/11/03 05:11:54 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -321,13 +321,11 @@ ConvertAllPartialsTo8x8(
Bool DoMono = (infoRec->PixmapCacheFlags & CACHE_MONO_8x8);
CacheLinkPtr pLink = ListPartial;
CacheLinkPtr MonoList = *ListMono, ColorList = *ListColor;
- int MonosPerColor = 1;
if(DoColor && DoMono) {
/* we assume color patterns take more space than color ones */
if(MonoH > ColorH) ColorH = MonoH;
if(MonoW > ColorW) ColorW = MonoW;
- MonosPerColor = (ColorH/MonoH) * (ColorW/MonoW);
}
/* Break up the area into as many Color and Mono slots as we can */
@@ -763,6 +761,7 @@ XAAInitPixmapCache(
1) Don't take up more than half the memory.
2) Don't bother if you can't get at least four.
3) Don't make more than MAX_512.
+ 4) Don't have any of there are no 256x256s.
256x256 -
1) Don't take up more than a quarter of the memory enless there
@@ -786,6 +785,13 @@ XAAInitPixmapCache(
else Target256 = ntotal >> 4;
if(Target256 < 4) Target256 = 0;
+ if(Num512 && Num256 < 4) {
+ while(Num512 && Num256 < Target256) {
+ SubdivideList(&List512, &List256);
+ Num256 += 4; Num512--;
+ }
+ }
+
if(!Num512) { /* no room */
} else if((Num512 < 4) || (!Target512)) {
while(Num512) {
@@ -2044,7 +2050,7 @@ XAAWriteColor8x8PatternToCache(
nw = w;
memcpy(dstPtr, srcPtr, w * Bpp);
while (nw != 8) {
- memcpy(dstPtr + (nw * Bpp), srcPtr, nw * Bpp);
+ memcpy(dstPtr + (nw * Bpp), dstPtr, nw * Bpp);
nw <<= 1;
}
}
diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c
index 4b7e3d0f0..fecbbcfa0 100644
--- a/hw/xfree86/xaa/xaaPict.c
+++ b/hw/xfree86/xaa/xaaPict.c
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c,v 1.17 2002/12/10 04:17:21 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c,v 1.18 2003/04/23 18:35:34 eich Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -432,10 +432,11 @@ XAAComposite (CARD8 op,
xSrc, ySrc, xMask, yMask, xDst, yDst,
width, height))
{
- if(pSrc->pDrawable->type == DRAWABLE_WINDOW ||
+ if((pSrc->pDrawable->type == DRAWABLE_WINDOW ||
pDst->pDrawable->type == DRAWABLE_WINDOW ||
IS_OFFSCREEN_PIXMAP(pSrc->pDrawable) ||
- IS_OFFSCREEN_PIXMAP(pDst->pDrawable)) {
+ IS_OFFSCREEN_PIXMAP(pDst->pDrawable))
+ && infoRec->pScrn->vtSema) {
SYNC_CHECK(pDst->pDrawable);
}
(*GetPictureScreen(pScreen)->Composite) (op,
@@ -666,10 +667,11 @@ XAAGlyphs (CARD8 op,
!(*infoRec->Glyphs)(op, pSrc, pDst, maskFormat,
xSrc, ySrc, nlist, list, glyphs))
{
- if((pSrc->pDrawable->type == DRAWABLE_WINDOW) ||
+ if(((pSrc->pDrawable->type == DRAWABLE_WINDOW) ||
(pDst->pDrawable->type == DRAWABLE_WINDOW) ||
IS_OFFSCREEN_PIXMAP(pSrc->pDrawable) ||
- IS_OFFSCREEN_PIXMAP(pDst->pDrawable)) {
+ IS_OFFSCREEN_PIXMAP(pDst->pDrawable))
+ && infoRec->pScrn->vtSema) {
SYNC_CHECK(pDst->pDrawable);
}
(*GetPictureScreen(pScreen)->Glyphs) (op, pSrc, pDst, maskFormat,
diff --git a/hw/xfree86/xaa/xaaStateChange.c b/hw/xfree86/xaa/xaaStateChange.c
index 512c6a260..b27a54e81 100644
--- a/hw/xfree86/xaa/xaaStateChange.c
+++ b/hw/xfree86/xaa/xaaStateChange.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStateChange.c,v 3.2 2003/02/04 01:44:07 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStateChange.c,v 3.3 2003/08/22 19:27:31 eich Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -1670,8 +1670,9 @@ XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
XAA_STATE_WRAP(CopyWindow);
XAA_STATE_WRAP(SaveAreas);
XAA_STATE_WRAP(RestoreAreas);
+#ifdef RENDER
XAA_STATE_WRAP(SetupForCPUToScreenAlphaTexture);
XAA_STATE_WRAP(SetupForCPUToScreenTexture);
-
+#endif
return TRUE;
}
diff --git a/hw/xfree86/xaa/xaaStipple.c b/hw/xfree86/xaa/xaaStipple.c
index 8037a3eaf..862f50ba0 100644
--- a/hw/xfree86/xaa/xaaStipple.c
+++ b/hw/xfree86/xaa/xaaStipple.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStipple.c,v 1.11 2001/10/28 03:34:04 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStipple.c,v 1.12 2003/08/04 22:18:31 mvojkovi Exp $ */
#include "xaa.h"
#include "xaalocal.h"
@@ -762,20 +762,28 @@ StippleOver32(
){
CARD32* srcp;
CARD32 bits;
- int bitsleft, shift;
+ int bitsleft, shift, usable;
while(dwords--) {
- bitsleft = width - offset;
- srcp = src + (offset >> 5);
- shift = offset & 31;
-
- if(bitsleft < 32)
- bits = SHIFT_L(*src,bitsleft) |
- (SHIFT_R(*srcp,shift) & XAAShiftMasks[bitsleft]);
- else if(shift)
- bits = SHIFT_R(*srcp,shift) | SHIFT_L(srcp[1],32-shift);
- else
- bits = *srcp;
+ bitsleft = width - offset;
+ srcp = src + (offset >> 5);
+ shift = offset & 31;
+ usable = 32 - shift;
+
+ if(bitsleft < 32) {
+ if(bitsleft <= usable) {
+ bits = SHIFT_L(*src,bitsleft) |
+ (SHIFT_R(*srcp,shift) & XAAShiftMasks[bitsleft]);
+ } else {
+ bits = SHIFT_L(*src,bitsleft) |
+ (SHIFT_L(srcp[1],usable) & XAAShiftMasks[bitsleft]) |
+ (SHIFT_R(*srcp,shift) & XAAShiftMasks[usable]);
+ }
+ }
+ else if(shift)
+ bits = SHIFT_R(*srcp,shift) | SHIFT_L(srcp[1],usable);
+ else
+ bits = *srcp;
#ifdef TRIPLE_BITS
if(dwords >= 2) {
@@ -805,20 +813,28 @@ StippleOver32_Inverted(
){
CARD32* srcp;
CARD32 bits;
- int bitsleft, shift;
+ int bitsleft, shift, usable;
while(dwords--) {
- bitsleft = width - offset;
- srcp = src + (offset >> 5);
- shift = offset & 31;
-
- if(bitsleft < 32)
- bits = SHIFT_L(*src,bitsleft) |
- (SHIFT_R(*srcp,shift) & XAAShiftMasks[bitsleft]);
- else if(shift)
- bits = SHIFT_R(*srcp,shift) | SHIFT_L(srcp[1],32-shift);
- else
- bits = *srcp;
+ bitsleft = width - offset;
+ srcp = src + (offset >> 5);
+ shift = offset & 31;
+ usable = 32 - shift;
+
+ if(bitsleft < 32) {
+ if(bitsleft <= usable) {
+ bits = SHIFT_L(*src,bitsleft) |
+ (SHIFT_R(*srcp,shift) & XAAShiftMasks[bitsleft]);
+ } else {
+ bits = SHIFT_L(*src,bitsleft) |
+ (SHIFT_L(srcp[1],usable) & XAAShiftMasks[bitsleft]) |
+ (SHIFT_R(*srcp,shift) & XAAShiftMasks[usable]);
+ }
+ }
+ else if(shift)
+ bits = SHIFT_R(*srcp,shift) | SHIFT_L(srcp[1],usable);
+ else
+ bits = *srcp;
bits = ~bits;
diff --git a/hw/xfree86/xaa/xaaWideLine.c b/hw/xfree86/xaa/xaaWideLine.c
index 7425f9d20..f999b425f 100644
--- a/hw/xfree86/xaa/xaaWideLine.c
+++ b/hw/xfree86/xaa/xaaWideLine.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaWideLine.c,v 1.10 2001/11/16 16:47:56 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaWideLine.c,v 1.11 2003/07/16 01:38:48 dawes Exp $ */
/*
@@ -32,7 +32,7 @@ Original mi code written by Keith Packard.
#include "X.h"
#include "windowstr.h"
#include "gcstruct.h"
-#include "miscstruct.h"
+#include "regionstr.h"
#include "miwideline.h"
#include "mi.h"
#include "xf86str.h"
diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h
index 0c239c234..4504deffd 100644
--- a/hw/xfree86/xaa/xaalocal.h
+++ b/hw/xfree86/xaa/xaalocal.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaalocal.h,v 1.36 2003/02/17 16:08:29 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaalocal.h,v 1.37 2003/11/10 18:22:41 tsi Exp $ */
#ifndef _XAALOCAL_H
#define _XAALOCAL_H
@@ -1485,7 +1485,7 @@ void XAAMoveDWORDS(
int
XAAGetRectClipBoxes(
- RegionPtr prgnClip,
+ GCPtr pGC,
BoxPtr pboxClippedBase,
int nrectFill,
xRectangle *prectInit