summaryrefslogtreecommitdiff
path: root/xserver/exa
diff options
context:
space:
mode:
Diffstat (limited to 'xserver/exa')
-rw-r--r--xserver/exa/Makefile.in30
-rw-r--r--xserver/exa/exa.c85
-rw-r--r--xserver/exa/exa_accel.c98
-rw-r--r--xserver/exa/exa_classic.c15
-rw-r--r--xserver/exa/exa_driver.c7
-rw-r--r--xserver/exa/exa_glyphs.c16
-rw-r--r--xserver/exa/exa_migration_classic.c60
-rw-r--r--xserver/exa/exa_mixed.c14
-rw-r--r--xserver/exa/exa_offscreen.c8
-rw-r--r--xserver/exa/exa_priv.h30
-rw-r--r--xserver/exa/exa_render.c50
-rw-r--r--xserver/exa/exa_unaccel.c88
12 files changed, 267 insertions, 234 deletions
diff --git a/xserver/exa/Makefile.in b/xserver/exa/Makefile.in
index 095511dab..b7f145d0e 100644
--- a/xserver/exa/Makefile.in
+++ b/xserver/exa/Makefile.in
@@ -121,10 +121,6 @@ BUILDDOCS_TRUE = @BUILDDOCS_TRUE@
BUILD_DATE = @BUILD_DATE@
BUILD_KDRIVEFBDEVLIB_FALSE = @BUILD_KDRIVEFBDEVLIB_FALSE@
BUILD_KDRIVEFBDEVLIB_TRUE = @BUILD_KDRIVEFBDEVLIB_TRUE@
-BUILD_LINUXDOC_FALSE = @BUILD_LINUXDOC_FALSE@
-BUILD_LINUXDOC_TRUE = @BUILD_LINUXDOC_TRUE@
-BUILD_PDFDOC_FALSE = @BUILD_PDFDOC_FALSE@
-BUILD_PDFDOC_TRUE = @BUILD_PDFDOC_TRUE@
BUILD_TIME = @BUILD_TIME@
CC = @CC@
CCAS = @CCAS@
@@ -212,6 +208,8 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ENABLE_DEVEL_DOCS_FALSE = @ENABLE_DEVEL_DOCS_FALSE@
+ENABLE_DEVEL_DOCS_TRUE = @ENABLE_DEVEL_DOCS_TRUE@
EXEEXT = @EXEEXT@
F77 = @F77@
FBDEVHW_FALSE = @FBDEVHW_FALSE@
@@ -226,6 +224,7 @@ FONTOTFDIR = @FONTOTFDIR@
FONTROOTDIR = @FONTROOTDIR@
FONTTTFDIR = @FONTTTFDIR@
FONTTYPE1DIR = @FONTTYPE1DIR@
+FOP = @FOP@
FREEBSD_KLDLOAD_FALSE = @FREEBSD_KLDLOAD_FALSE@
FREEBSD_KLDLOAD_TRUE = @FREEBSD_KLDLOAD_TRUE@
GLIB_CFLAGS = @GLIB_CFLAGS@
@@ -243,10 +242,14 @@ HAVE_DBUS_FALSE = @HAVE_DBUS_FALSE@
HAVE_DBUS_TRUE = @HAVE_DBUS_TRUE@
HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@
HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@
-HAVE_PS2PDF_FALSE = @HAVE_PS2PDF_FALSE@
-HAVE_PS2PDF_TRUE = @HAVE_PS2PDF_TRUE@
+HAVE_FOP_FALSE = @HAVE_FOP_FALSE@
+HAVE_FOP_TRUE = @HAVE_FOP_TRUE@
HAVE_STYLESHEETS_FALSE = @HAVE_STYLESHEETS_FALSE@
HAVE_STYLESHEETS_TRUE = @HAVE_STYLESHEETS_TRUE@
+HAVE_XMLTO_FALSE = @HAVE_XMLTO_FALSE@
+HAVE_XMLTO_TEXT_FALSE = @HAVE_XMLTO_TEXT_FALSE@
+HAVE_XMLTO_TEXT_TRUE = @HAVE_XMLTO_TEXT_TRUE@
+HAVE_XMLTO_TRUE = @HAVE_XMLTO_TRUE@
HP300_VIDEO_FALSE = @HP300_VIDEO_FALSE@
HP300_VIDEO_TRUE = @HP300_VIDEO_TRUE@
HPPA_VIDEO_FALSE = @HPPA_VIDEO_FALSE@
@@ -302,10 +305,11 @@ LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIBS = @LIBDRM_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@
+LIBSHA1_LIBS = @LIBSHA1_LIBS@
LIBTOOL = @LIBTOOL@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
-LINUXDOC = @LINUXDOC@
LINUX_ALPHA_FALSE = @LINUX_ALPHA_FALSE@
LINUX_ALPHA_TRUE = @LINUX_ALPHA_TRUE@
LINUX_IA64_FALSE = @LINUX_IA64_FALSE@
@@ -323,17 +327,11 @@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAIN_LIB = @MAIN_LIB@
MAKEINFO = @MAKEINFO@
-MAKE_HTML = @MAKE_HTML@
-MAKE_PDF = @MAKE_PDF@
-MAKE_PS = @MAKE_PS@
-MAKE_TEXT = @MAKE_TEXT@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MITSHM_FALSE = @MITSHM_FALSE@
MITSHM_TRUE = @MITSHM_TRUE@
-MULTIBUFFER_FALSE = @MULTIBUFFER_FALSE@
-MULTIBUFFER_TRUE = @MULTIBUFFER_TRUE@
NEED_STRLCAT_FALSE = @NEED_STRLCAT_FALSE@
NEED_STRLCAT_TRUE = @NEED_STRLCAT_TRUE@
NEED_VSNPRINTF_FALSE = @NEED_VSNPRINTF_FALSE@
@@ -360,20 +358,23 @@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
PCIACCESS_LIBS = @PCIACCESS_LIBS@
PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@
PERL = @PERL@
+PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
+PIXMAN_LIBS = @PIXMAN_LIBS@
PKG_CONFIG = @PKG_CONFIG@
PPC_VIDEO_FALSE = @PPC_VIDEO_FALSE@
PPC_VIDEO_TRUE = @PPC_VIDEO_TRUE@
PROJECTROOT = @PROJECTROOT@
-PS2PDF = @PS2PDF@
RANLIB = @RANLIB@
RAWCPP = @RAWCPP@
RAWCPPFLAGS = @RAWCPPFLAGS@
RECORD_FALSE = @RECORD_FALSE@
RECORD_TRUE = @RECORD_TRUE@
+RELEASE_DATE = @RELEASE_DATE@
RES_FALSE = @RES_FALSE@
RES_TRUE = @RES_TRUE@
SCREENSAVER_FALSE = @SCREENSAVER_FALSE@
SCREENSAVER_TRUE = @SCREENSAVER_TRUE@
+SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@
SECURE_RPC_FALSE = @SECURE_RPC_FALSE@
SECURE_RPC_TRUE = @SECURE_RPC_TRUE@
SED = @SED@
@@ -468,6 +469,7 @@ XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@
XLIB_CFLAGS = @XLIB_CFLAGS@
XLIB_LIBS = @XLIB_LIBS@
+XMLTO = @XMLTO@
XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
XNEST_FALSE = @XNEST_FALSE@
diff --git a/xserver/exa/exa.c b/xserver/exa/exa.c
index 590d9a500..fc15c2471 100644
--- a/xserver/exa/exa.c
+++ b/xserver/exa/exa.c
@@ -37,12 +37,9 @@
#include "exa_priv.h"
#include "exa.h"
-static int exaScreenPrivateKeyIndex;
-DevPrivateKey exaScreenPrivateKey = &exaScreenPrivateKeyIndex;
-static int exaPixmapPrivateKeyIndex;
-DevPrivateKey exaPixmapPrivateKey = &exaPixmapPrivateKeyIndex;
-static int exaGCPrivateKeyIndex;
-DevPrivateKey exaGCPrivateKey = &exaGCPrivateKeyIndex;
+DevPrivateKeyRec exaScreenPrivateKeyRec;
+DevPrivateKeyRec exaPixmapPrivateKeyRec;
+DevPrivateKeyRec exaGCPrivateKeyRec;
#ifdef MITSHM
static ShmFuncs exaShmFuncs = { NULL, NULL };
@@ -161,10 +158,10 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2)
if (box.x1 >= box.x2 || box.y1 >= box.y2)
return;
- REGION_INIT(pScreen, &region, &box, 1);
+ RegionInit(&region, &box, 1);
DamageRegionAppend(&pPix->drawable, &region);
DamageRegionProcessPending(&pPix->drawable);
- REGION_UNINIT(pScreen, &region);
+ RegionUninit(&region);
}
static int
@@ -438,6 +435,29 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
(*pExaScr->info->FinishAccess) (pPixmap, i);
}
+
+/**
+ * Helper for things common to all schemes when a pixmap is destroyed
+ */
+void
+exaDestroyPixmap(PixmapPtr pPixmap)
+{
+ ExaScreenPriv(pPixmap->drawable.pScreen);
+ int i;
+
+ /* Finish access if it was prepared (e.g. pixmap created during
+ * software fallback)
+ */
+ for (i = 0; i < EXA_NUM_PREPARE_INDICES; i++) {
+ if (pExaScr->access[i].pixmap == pPixmap) {
+ exaFinishAccess(&pPixmap->drawable, i);
+ pExaScr->access[i].pixmap = NULL;
+ break;
+ }
+ }
+}
+
+
/**
* Here begins EXA's GC code.
* Do not ever access the fb/mi layer directly.
@@ -658,7 +678,7 @@ exaBitmapToRegion(PixmapPtr pPix)
exaPrepareAccess(&pPix->drawable, EXA_PREPARE_SRC);
swap(pExaScr, pScreen, BitmapToRegion);
- ret = pScreen->BitmapToRegion(pPix);
+ ret = (*pScreen->BitmapToRegion)(pPix);
swap(pExaScr, pScreen, BitmapToRegion);
exaFinishAccess(&pPix->drawable, EXA_PREPARE_SRC);
@@ -753,9 +773,7 @@ static Bool
exaCloseScreen(int i, ScreenPtr pScreen)
{
ExaScreenPriv(pScreen);
-#ifdef RENDER
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-#endif
if (ps->Glyphs == exaGlyphs)
exaGlyphsFini(pScreen);
@@ -778,18 +796,14 @@ exaCloseScreen(int i, ScreenPtr pScreen)
unwrap(pExaScr, pScreen, ChangeWindowAttributes);
unwrap(pExaScr, pScreen, BitmapToRegion);
unwrap(pExaScr, pScreen, CreateScreenResources);
-#ifdef RENDER
- if (ps) {
- unwrap(pExaScr, ps, Composite);
- if (pExaScr->SavedGlyphs)
- unwrap(pExaScr, ps, Glyphs);
- unwrap(pExaScr, ps, Trapezoids);
- unwrap(pExaScr, ps, Triangles);
- unwrap(pExaScr, ps, AddTraps);
- }
-#endif
+ unwrap(pExaScr, ps, Composite);
+ if (pExaScr->SavedGlyphs)
+ unwrap(pExaScr, ps, Glyphs);
+ unwrap(pExaScr, ps, Trapezoids);
+ unwrap(pExaScr, ps, Triangles);
+ unwrap(pExaScr, ps, AddTraps);
- xfree (pExaScr);
+ free(pExaScr);
return (*pScreen->CloseScreen) (i, pScreen);
}
@@ -800,14 +814,14 @@ exaCloseScreen(int i, ScreenPtr pScreen)
* without breaking ABI between EXA and the drivers. The driver's
* responsibility is to check beforehand that the EXA module has a matching
* major number and sufficient minor. Drivers are responsible for freeing the
- * driver structure using xfree().
+ * driver structure using free().
*
* @return a newly allocated, zero-filled driver structure
*/
ExaDriverPtr
exaDriverAlloc(void)
{
- return xcalloc(1, sizeof(ExaDriverRec));
+ return calloc(1, sizeof(ExaDriverRec));
}
/**
@@ -825,9 +839,7 @@ exaDriverInit (ScreenPtr pScreen,
ExaDriverPtr pScreenInfo)
{
ExaScreenPrivPtr pExaScr;
-#ifdef RENDER
PictureScreenPtr ps;
-#endif
if (!pScreenInfo)
return FALSE;
@@ -895,11 +907,15 @@ exaDriverInit (ScreenPtr pScreen,
pScreenInfo->maxPitchPixels = pScreenInfo->maxX;
}
-#ifdef RENDER
ps = GetPictureScreenIfSet(pScreen);
-#endif
- pExaScr = xcalloc (sizeof (ExaScreenPrivRec), 1);
+ if (!dixRegisterPrivateKey(&exaScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) {
+ LogMessage(X_WARNING, "EXA(%d): Failed to register screen private\n",
+ pScreen->myNum);
+ return FALSE;
+ }
+
+ pExaScr = calloc (sizeof (ExaScreenPrivRec), 1);
if (!pExaScr) {
LogMessage(X_WARNING, "EXA(%d): Failed to allocate screen private\n",
pScreen->myNum);
@@ -914,7 +930,7 @@ exaDriverInit (ScreenPtr pScreen,
exaDDXDriverInit(pScreen);
- if (!dixRequestPrivate(exaGCPrivateKey, sizeof(ExaGCPrivRec))) {
+ if (!dixRegisterPrivateKey(&exaGCPrivateKeyRec, PRIVATE_GC, sizeof(ExaGCPrivRec))) {
LogMessage(X_WARNING,
"EXA(%d): Failed to allocate GC private\n",
pScreen->myNum);
@@ -940,16 +956,17 @@ exaDriverInit (ScreenPtr pScreen,
wrap(pExaScr, pScreen, BitmapToRegion, exaBitmapToRegion);
wrap(pExaScr, pScreen, CreateScreenResources, exaCreateScreenResources);
-#ifdef RENDER
if (ps) {
wrap(pExaScr, ps, Composite, exaComposite);
- if (pScreenInfo->PrepareComposite)
+ if (pScreenInfo->PrepareComposite) {
wrap(pExaScr, ps, Glyphs, exaGlyphs);
+ } else {
+ wrap(pExaScr, ps, Glyphs, ExaCheckGlyphs);
+ }
wrap(pExaScr, ps, Trapezoids, exaTrapezoids);
wrap(pExaScr, ps, Triangles, exaTriangles);
wrap(pExaScr, ps, AddTraps, ExaCheckAddTraps);
}
-#endif
#ifdef MITSHM
/*
@@ -962,7 +979,7 @@ exaDriverInit (ScreenPtr pScreen,
*/
if (pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS)
{
- if (!dixRequestPrivate(exaPixmapPrivateKey, sizeof(ExaPixmapPrivRec))) {
+ if (!dixRegisterPrivateKey(&exaPixmapPrivateKeyRec, PRIVATE_PIXMAP, sizeof(ExaPixmapPrivRec))) {
LogMessage(X_WARNING,
"EXA(%d): Failed to allocate pixmap private\n",
pScreen->myNum);
diff --git a/xserver/exa/exa_accel.c b/xserver/exa/exa_accel.c
index 57029fdc5..6c677c7a1 100644
--- a/xserver/exa/exa_accel.c
+++ b/xserver/exa/exa_accel.c
@@ -81,7 +81,7 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
return;
}
- pextent = REGION_EXTENTS(pGC->pScreen, pClip);
+ pextent = RegionExtents(pClip);
extentX1 = pextent->x1;
extentY1 = pextent->y1;
extentX2 = pextent->x2;
@@ -106,7 +106,7 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
if (fullX1 >= fullX2)
continue;
- nbox = REGION_NUM_RECTS (pClip);
+ nbox = RegionNumRects (pClip);
if (nbox == 1)
{
(*pExaScr->info->Solid) (pPixmap,
@@ -115,7 +115,7 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
}
else
{
- pbox = REGION_RECTS(pClip);
+ pbox = RegionRects(pClip);
while(nbox--)
{
if (pbox->y1 <= fullY1 && fullY1 < pbox->y2)
@@ -192,8 +192,8 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
y += pDrawable->y;
pClip = fbGetCompositeClip(pGC);
- for (nbox = REGION_NUM_RECTS(pClip),
- pbox = REGION_RECTS(pClip);
+ for (nbox = RegionNumRects(pClip),
+ pbox = RegionRects(pClip);
nbox--;
pbox++)
{
@@ -394,7 +394,7 @@ exaHWCopyNtoN (DrawablePtr pSrcDrawable,
exaGetDrawableDeltas (pSrcDrawable, pSrcPixmap, &src_off_x, &src_off_y);
exaGetDrawableDeltas (pDstDrawable, pDstPixmap, &dst_off_x, &dst_off_y);
- rects = xalloc(nbox * sizeof(xRectangle));
+ rects = malloc(nbox * sizeof(xRectangle));
if (rects) {
int i;
@@ -407,7 +407,7 @@ exaHWCopyNtoN (DrawablePtr pSrcDrawable,
rects[i].height = pbox[i].y2 - pbox[i].y1;
}
- /* This must match the miRegionCopy() logic for reversing rect order */
+ /* This must match the RegionCopy() logic for reversing rect order */
if (nbox == 1 || (dx > 0 && dy > 0) ||
(pDstDrawable != pSrcDrawable &&
(pDstDrawable->type != DRAWABLE_WINDOW ||
@@ -416,15 +416,15 @@ exaHWCopyNtoN (DrawablePtr pSrcDrawable,
else
ordering = CT_UNSORTED;
- srcregion = RECTS_TO_REGION(pScreen, nbox, rects, ordering);
- xfree(rects);
+ srcregion = RegionFromRects(nbox, rects, ordering);
+ free(rects);
if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask,
pGC->fillStyle, pGC->alu,
pGC->clientClipType)) {
- dstregion = REGION_CREATE(pScreen, NullBox, 0);
- REGION_COPY(pScreen, dstregion, srcregion);
- REGION_TRANSLATE(pScreen, dstregion, dst_off_x - dx - src_off_x,
+ dstregion = RegionCreate(NullBox, 0);
+ RegionCopy(dstregion, srcregion);
+ RegionTranslate(dstregion, dst_off_x - dx - src_off_x,
dst_off_y - dy - src_off_y);
}
}
@@ -551,12 +551,12 @@ fallback:
out:
if (dstregion) {
- REGION_UNINIT(pScreen, dstregion);
- REGION_DESTROY(pScreen, dstregion);
+ RegionUninit(dstregion);
+ RegionDestroy(dstregion);
}
if (srcregion) {
- REGION_UNINIT(pScreen, srcregion);
- REGION_DESTROY(pScreen, srcregion);
+ RegionUninit(srcregion);
+ RegionDestroy(srcregion);
}
return ret;
@@ -626,7 +626,7 @@ exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
return;
}
- prect = xalloc(sizeof(xRectangle) * npt);
+ prect = malloc(sizeof(xRectangle) * npt);
for (i = 0; i < npt; i++) {
prect[i].x = ppt[i].x;
prect[i].y = ppt[i].y;
@@ -638,7 +638,7 @@ exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
prect[i].height = 1;
}
pGC->ops->PolyFillRect(pDrawable, pGC, npt, prect);
- xfree(prect);
+ free(prect);
}
/**
@@ -667,7 +667,7 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
return;
}
- prect = xalloc(sizeof(xRectangle) * (npt - 1));
+ prect = malloc(sizeof(xRectangle) * (npt - 1));
x1 = ppt[0].x;
y1 = ppt[0].y;
/* If we have any non-horizontal/vertical, fall back. */
@@ -681,7 +681,7 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
}
if (x1 != x2 && y1 != y2) {
- xfree(prect);
+ free(prect);
ExaCheckPolylines(pDrawable, pGC, mode, npt, ppt);
return;
}
@@ -705,7 +705,7 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
y1 = y2;
}
pGC->ops->PolyFillRect(pDrawable, pGC, npt - 1, prect);
- xfree(prect);
+ free(prect);
}
/**
@@ -737,7 +737,7 @@ exaPolySegment (DrawablePtr pDrawable, GCPtr pGC, int nseg,
}
}
- prect = xalloc(sizeof(xRectangle) * nseg);
+ prect = malloc(sizeof(xRectangle) * nseg);
for (i = 0; i < nseg; i++) {
if (pSeg[i].x1 < pSeg[i].x2) {
prect[i].x = pSeg[i].x1;
@@ -763,7 +763,7 @@ exaPolySegment (DrawablePtr pDrawable, GCPtr pGC, int nseg,
}
}
pGC->ops->PolyFillRect(pDrawable, pGC, nseg, prect);
- xfree(prect);
+ free(prect);
}
static Bool exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion,
@@ -788,13 +788,13 @@ exaPolyFillRect(DrawablePtr pDrawable,
int xoff, yoff;
int xorg, yorg;
int n;
- RegionPtr pReg = RECTS_TO_REGION(pScreen, nrect, prect, CT_UNSORTED);
+ RegionPtr pReg = RegionFromRects(nrect, prect, CT_UNSORTED);
/* Compute intersection of rects and clip region */
- REGION_TRANSLATE(pScreen, pReg, pDrawable->x, pDrawable->y);
- REGION_INTERSECT(pScreen, pReg, pClip, pReg);
+ RegionTranslate(pReg, pDrawable->x, pDrawable->y);
+ RegionIntersect(pReg, pClip, pReg);
- if (!REGION_NUM_RECTS(pReg)) {
+ if (!RegionNumRects(pReg)) {
goto out;
}
@@ -856,7 +856,7 @@ fallback:
xorg = pDrawable->x;
yorg = pDrawable->y;
- pextent = REGION_EXTENTS(pGC->pScreen, pClip);
+ pextent = RegionExtents(pClip);
extentX1 = pextent->x1;
extentY1 = pextent->y1;
extentX2 = pextent->x2;
@@ -883,7 +883,7 @@ fallback:
if ((fullX1 >= fullX2) || (fullY1 >= fullY2))
continue;
- n = REGION_NUM_RECTS (pClip);
+ n = RegionNumRects (pClip);
if (n == 1)
{
(*pExaScr->info->Solid) (pPixmap,
@@ -892,7 +892,7 @@ fallback:
}
else
{
- pbox = REGION_RECTS(pClip);
+ pbox = RegionRects(pClip);
/*
* clip the rectangle to each box in the clip region
* this is logically equivalent to calling Intersect(),
@@ -927,8 +927,8 @@ fallback:
exaMarkSync(pDrawable->pScreen);
out:
- REGION_UNINIT(pScreen, pReg);
- REGION_DESTROY(pScreen, pReg);
+ RegionUninit(pReg);
+ RegionDestroy(pReg);
}
const GCOps exaOps = {
@@ -964,14 +964,14 @@ exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
+ RegionTranslate(prgnSrc, -dx, -dy);
- REGION_INIT (pWin->drawable.pScreen, &rgnDst, NullBox, 0);
+ RegionInit(&rgnDst, NullBox, 0);
- REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
+ RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);
#ifdef COMPOSITE
if (pPixmap->screen_x || pPixmap->screen_y)
- REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst,
+ RegionTranslate(&rgnDst,
-pPixmap->screen_x, -pPixmap->screen_y);
#endif
@@ -987,11 +987,11 @@ exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
pExaScr->fallback_flags &= ~EXA_ACCEL_COPYWINDOW;
fallback:
- REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
+ RegionUninit(&rgnDst);
if (pExaScr->fallback_flags & EXA_FALLBACK_COPYWINDOW) {
pExaScr->fallback_flags &= ~EXA_FALLBACK_COPYWINDOW;
- REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, dx, dy);
+ RegionTranslate(prgnSrc, dx, dy);
ExaCheckCopyWindow(pWin, ptOldOrg, prgnSrc);
}
}
@@ -1007,7 +1007,7 @@ exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel,
Bool ret = FALSE;
exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
- REGION_TRANSLATE(pScreen, pRegion, xoff, yoff);
+ RegionTranslate(pRegion, xoff, yoff);
if (pExaScr->fallback_counter || pExaPixmap->accel_blocked)
goto out;
@@ -1030,8 +1030,8 @@ exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel,
int nbox;
BoxPtr pBox;
- nbox = REGION_NUM_RECTS (pRegion);
- pBox = REGION_RECTS (pRegion);
+ nbox = RegionNumRects (pRegion);
+ pBox = RegionRects (pRegion);
while (nbox--)
{
@@ -1060,18 +1060,18 @@ exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel,
*(CARD8*)pExaPixmap->sys_ptr = pixel;
}
- REGION_UNION(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys,
+ RegionUnion(&pExaPixmap->validSys, &pExaPixmap->validSys,
pRegion);
- REGION_UNION(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB,
+ RegionUnion(&pExaPixmap->validFB, &pExaPixmap->validFB,
pRegion);
- REGION_SUBTRACT(pScreen, pending_damage, pending_damage, pRegion);
+ RegionSubtract(pending_damage, pending_damage, pRegion);
}
ret = TRUE;
}
out:
- REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff);
+ RegionTranslate(pRegion, -xoff, -yoff);
return ret;
}
@@ -1090,8 +1090,8 @@ exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
ExaPixmapPrivPtr pTileExaPixmap = ExaGetPixmapPriv(pTile);
int xoff, yoff;
int tileWidth, tileHeight;
- int nbox = REGION_NUM_RECTS (pRegion);
- BoxPtr pBox = REGION_RECTS (pRegion);
+ int nbox = RegionNumRects (pRegion);
+ BoxPtr pBox = RegionRects (pRegion);
Bool ret = FALSE;
int i;
@@ -1137,7 +1137,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
if ((*pExaScr->info->PrepareCopy) (pTile, pPixmap, 1, 1, alu, planemask))
{
if (xoff || yoff)
- REGION_TRANSLATE(pScreen, pRegion, xoff, yoff);
+ RegionTranslate(pRegion, xoff, yoff);
for (i = 0; i < nbox; i++)
{
@@ -1245,7 +1245,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
exaMarkSync(pDrawable->pScreen);
if (xoff || yoff)
- REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff);
+ RegionTranslate(pRegion, -xoff, -yoff);
}
return ret;
diff --git a/xserver/exa/exa_classic.c b/xserver/exa/exa_classic.c
index 9bc369ec1..169ce3aac 100644
--- a/xserver/exa/exa_classic.c
+++ b/xserver/exa/exa_classic.c
@@ -131,8 +131,8 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
box.y1 = 0;
box.x2 = w;
box.y2 = h;
- REGION_INIT(pScreen, &pExaPixmap->validSys, &box, 0);
- REGION_INIT(pScreen, &pExaPixmap->validFB, &box, 0);
+ RegionInit(&pExaPixmap->validSys, &box, 0);
+ RegionInit(&pExaPixmap->validFB, &box, 0);
exaSetAccelBlock(pExaScr, pExaPixmap,
w, h, bpp);
@@ -148,7 +148,7 @@ Bool
exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int depth,
int bitsPerPixel, int devKind, pointer pPixData)
{
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ ScreenPtr pScreen;
ExaScreenPrivPtr pExaScr;
ExaPixmapPrivPtr pExaPixmap;
Bool ret;
@@ -156,6 +156,7 @@ exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height, int dept
if (!pPixmap)
return FALSE;
+ pScreen = pPixmap->drawable.pScreen;
pExaScr = ExaGetScreenPriv(pScreen);
pExaPixmap = ExaGetPixmapPriv(pPixmap);
@@ -220,9 +221,7 @@ exaDestroyPixmap_classic (PixmapPtr pPixmap)
{
ExaPixmapPriv (pPixmap);
- /* During a fallback we must finish access, but we don't know the index. */
- if (pExaScr->fallback_counter)
- exaFinishAccess(&pPixmap->drawable, -1);
+ exaDestroyPixmap(pPixmap);
if (pExaPixmap->area)
{
@@ -236,8 +235,8 @@ exaDestroyPixmap_classic (PixmapPtr pPixmap)
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
pPixmap->devKind = pExaPixmap->sys_pitch;
}
- REGION_UNINIT(pPixmap->drawable.pScreen, &pExaPixmap->validSys);
- REGION_UNINIT(pPixmap->drawable.pScreen, &pExaPixmap->validFB);
+ RegionUninit(&pExaPixmap->validSys);
+ RegionUninit(&pExaPixmap->validFB);
}
swap(pExaScr, pScreen, DestroyPixmap);
diff --git a/xserver/exa/exa_driver.c b/xserver/exa/exa_driver.c
index dcf1a9860..a913cfb02 100644
--- a/xserver/exa/exa_driver.c
+++ b/xserver/exa/exa_driver.c
@@ -126,7 +126,7 @@ Bool
exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height, int depth,
int bitsPerPixel, int devKind, pointer pPixData)
{
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ ScreenPtr pScreen;
ExaScreenPrivPtr pExaScr;
ExaPixmapPrivPtr pExaPixmap;
Bool ret;
@@ -134,6 +134,7 @@ exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height, int depth
if (!pPixmap)
return FALSE;
+ pScreen = pPixmap->drawable.pScreen;
pExaScr = ExaGetScreenPriv(pScreen);
pExaPixmap = ExaGetPixmapPriv(pPixmap);
@@ -192,9 +193,7 @@ exaDestroyPixmap_driver (PixmapPtr pPixmap)
{
ExaPixmapPriv (pPixmap);
- /* During a fallback we must finish access, but we don't know the index. */
- if (pExaScr->fallback_counter)
- exaFinishAccess(&pPixmap->drawable, -1);
+ exaDestroyPixmap(pPixmap);
if (pExaPixmap->driverPriv)
pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv);
diff --git a/xserver/exa/exa_glyphs.c b/xserver/exa/exa_glyphs.c
index fd14e9b87..5c46ec901 100644
--- a/xserver/exa/exa_glyphs.c
+++ b/xserver/exa/exa_glyphs.c
@@ -127,15 +127,11 @@ exaUnrealizeGlyphCaches(ScreenPtr pScreen,
cache->picture = NULL;
}
- if (cache->hashEntries) {
- xfree(cache->hashEntries);
- cache->hashEntries = NULL;
- }
+ free(cache->hashEntries);
+ cache->hashEntries = NULL;
- if (cache->glyphs) {
- xfree(cache->glyphs);
- cache->glyphs = NULL;
- }
+ free(cache->glyphs);
+ cache->glyphs = NULL;
cache->glyphCount = 0;
}
}
@@ -213,8 +209,8 @@ exaRealizeGlyphCaches(ScreenPtr pScreen,
cache->picture = pPicture;
cache->picture->refcnt++;
- cache->hashEntries = xalloc(sizeof(int) * cache->hashSize);
- cache->glyphs = xalloc(sizeof(ExaCachedGlyphRec) * cache->size);
+ cache->hashEntries = malloc(sizeof(int) * cache->hashSize);
+ cache->glyphs = malloc(sizeof(ExaCachedGlyphRec) * cache->size);
cache->glyphCount = 0;
if (!cache->hashEntries || !cache->glyphs)
diff --git a/xserver/exa/exa_migration_classic.c b/xserver/exa/exa_migration_classic.c
index 871679ffc..6c49fb798 100644
--- a/xserver/exa/exa_migration_classic.c
+++ b/xserver/exa/exa_migration_classic.c
@@ -78,8 +78,8 @@ exaPixmapIsDirty (PixmapPtr pPix)
if (!pExaPixmap->pDamage)
return FALSE;
- return REGION_NOTEMPTY (pScreen, DamageRegion(pExaPixmap->pDamage)) ||
- !REGION_EQUAL(pScreen, &pExaPixmap->validSys, &pExaPixmap->validFB);
+ return RegionNotEmpty(DamageRegion(pExaPixmap->pDamage)) ||
+ !RegionEqual(&pExaPixmap->validSys, &pExaPixmap->validFB);
}
/**
@@ -123,22 +123,22 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
/* Damaged bits are valid in current copy but invalid in other one */
if (pExaPixmap->use_gpu_copy) {
- REGION_UNION(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB,
+ RegionUnion(&pExaPixmap->validFB, &pExaPixmap->validFB,
damage);
- REGION_SUBTRACT(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys,
+ RegionSubtract(&pExaPixmap->validSys, &pExaPixmap->validSys,
damage);
} else {
- REGION_UNION(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys,
+ RegionUnion(&pExaPixmap->validSys, &pExaPixmap->validSys,
damage);
- REGION_SUBTRACT(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB,
+ RegionSubtract(&pExaPixmap->validFB, &pExaPixmap->validFB,
damage);
}
- REGION_EMPTY(pScreen, damage);
+ RegionEmpty(damage);
/* Copy bits valid in source but not in destination */
- REGION_NULL(pScreen, &CopyReg);
- REGION_SUBTRACT(pScreen, &CopyReg, pValidSrc, pValidDst);
+ RegionNull(&CopyReg);
+ RegionSubtract(&CopyReg, pValidSrc, pValidDst);
if (migrate->as_dst) {
ExaScreenPriv (pPixmap->drawable.pScreen);
@@ -153,7 +153,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage);
#if DEBUG_MIGRATE
- if (REGION_NIL(pending_damage)) {
+ if (RegionNil(pending_damage)) {
static Bool firsttime = TRUE;
if (firsttime) {
@@ -167,23 +167,23 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
* rects by filling it up to the extents of the union of the
* destination valid region and the pending damage region.
*/
- if (REGION_NUM_RECTS(pValidDst) > 10) {
+ if (RegionNumRects(pValidDst) > 10) {
BoxRec box;
BoxPtr pValidExt, pDamageExt;
RegionRec closure;
- pValidExt = REGION_EXTENTS(pScreen, pValidDst);
- pDamageExt = REGION_EXTENTS(pScreen, pending_damage);
+ pValidExt = RegionExtents(pValidDst);
+ pDamageExt = RegionExtents(pending_damage);
box.x1 = min(pValidExt->x1, pDamageExt->x1);
box.y1 = min(pValidExt->y1, pDamageExt->y1);
box.x2 = max(pValidExt->x2, pDamageExt->x2);
box.y2 = max(pValidExt->y2, pDamageExt->y2);
- REGION_INIT(pScreen, &closure, &box, 0);
- REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, &closure);
+ RegionInit(&closure, &box, 0);
+ RegionIntersect(&CopyReg, &CopyReg, &closure);
} else
- REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, pending_damage);
+ RegionIntersect(&CopyReg, &CopyReg, pending_damage);
}
/* The caller may provide a region to be subtracted from the calculated
@@ -191,17 +191,17 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
* contribute to the result of the operation.
*/
if (migrate->pReg)
- REGION_SUBTRACT(pScreen, &CopyReg, &CopyReg, migrate->pReg);
+ RegionSubtract(&CopyReg, &CopyReg, migrate->pReg);
} else {
/* The caller may restrict the region to be migrated for source pixmaps
* to what's relevant for the operation.
*/
if (migrate->pReg)
- REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, migrate->pReg);
+ RegionIntersect(&CopyReg, &CopyReg, migrate->pReg);
}
- pBox = REGION_RECTS(&CopyReg);
- nbox = REGION_NUM_RECTS(&CopyReg);
+ pBox = RegionRects(&CopyReg);
+ nbox = RegionNumRects(&CopyReg);
save_use_gpu_copy = pExaPixmap->use_gpu_copy;
save_pitch = pPixmap->devKind;
@@ -252,13 +252,13 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
* removing parts of it which are also in the destination valid region.
* Removing anything beyond that would lead to data loss.
*/
- if (REGION_NUM_RECTS(pValidSrc) > 20)
- REGION_SUBTRACT(pScreen, pValidSrc, pValidSrc, pValidDst);
+ if (RegionNumRects(pValidSrc) > 20)
+ RegionSubtract(pValidSrc, pValidSrc, pValidDst);
/* The copied bits are now valid in destination */
- REGION_UNION(pScreen, pValidDst, pValidDst, &CopyReg);
+ RegionUnion(pValidDst, pValidDst, &CopyReg);
- REGION_UNINIT(pScreen, &CopyReg);
+ RegionUninit(&CopyReg);
if (access_prepared)
exaFinishAccess(&pPixmap->drawable, fallback_index);
@@ -440,7 +440,7 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
/* Mark all FB bits as invalid, so all valid system bits get copied to FB
* next time */
- REGION_EMPTY(pPixmap->drawable.pScreen, &pExaPixmap->validFB);
+ RegionEmpty(&pExaPixmap->validFB);
}
/**
@@ -531,15 +531,15 @@ exaAssertNotDirty (PixmapPtr pPixmap)
if (exaPixmapIsPinned(pPixmap) || pExaPixmap->area == NULL)
return ret;
- REGION_NULL(pScreen, &ValidReg);
- REGION_INTERSECT(pScreen, &ValidReg, &pExaPixmap->validFB,
+ RegionNull(&ValidReg);
+ RegionIntersect(&ValidReg, &pExaPixmap->validFB,
&pExaPixmap->validSys);
- nbox = REGION_NUM_RECTS(&ValidReg);
+ nbox = RegionNumRects(&ValidReg);
if (!nbox)
goto out;
- pBox = REGION_RECTS(&ValidReg);
+ pBox = RegionRects(&ValidReg);
dst_pitch = pExaPixmap->sys_pitch;
src_pitch = pExaPixmap->fb_pitch;
@@ -586,7 +586,7 @@ skip:
pPixmap->devKind = save_pitch;
out:
- REGION_UNINIT(pScreen, &ValidReg);
+ RegionUninit(&ValidReg);
return ret;
}
diff --git a/xserver/exa/exa_mixed.c b/xserver/exa/exa_mixed.c
index 21cc3bd13..ef20eb502 100644
--- a/xserver/exa/exa_mixed.c
+++ b/xserver/exa/exa_mixed.c
@@ -124,7 +124,7 @@ Bool
exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
int bitsPerPixel, int devKind, pointer pPixData)
{
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ ScreenPtr pScreen;
ExaScreenPrivPtr pExaScr;
ExaPixmapPrivPtr pExaPixmap;
Bool ret, has_gpu_copy;
@@ -132,6 +132,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
if (!pPixmap)
return FALSE;
+ pScreen = pPixmap->drawable.pScreen;
pExaScr = ExaGetScreenPriv(pScreen);
pExaPixmap = ExaGetPixmapPriv(pPixmap);
@@ -179,7 +180,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
exaSetAccelBlock(pExaScr, pExaPixmap,
width, height, bitsPerPixel);
- REGION_EMPTY(pScreen, &pExaPixmap->validFB);
+ RegionEmpty(&pExaPixmap->validFB);
}
/* Need to re-create system copy if there's also a GPU copy */
@@ -191,7 +192,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
DamageDestroy(pExaPixmap->pDamage);
pExaPixmap->pDamage = NULL;
- REGION_EMPTY(pScreen, &pExaPixmap->validSys);
+ RegionEmpty(&pExaPixmap->validSys);
if (pExaScr->deferred_mixed_pixmap == pPixmap)
pExaScr->deferred_mixed_pixmap = NULL;
@@ -244,9 +245,7 @@ exaDestroyPixmap_mixed(PixmapPtr pPixmap)
{
ExaPixmapPriv (pPixmap);
- /* During a fallback we must finish access, but we don't know the index. */
- if (pExaScr->fallback_counter)
- exaFinishAccess(&pPixmap->drawable, -1);
+ exaDestroyPixmap(pPixmap);
if (pExaScr->deferred_mixed_pixmap == pPixmap)
pExaScr->deferred_mixed_pixmap = NULL;
@@ -256,8 +255,7 @@ exaDestroyPixmap_mixed(PixmapPtr pPixmap)
pExaPixmap->driverPriv = NULL;
if (pExaPixmap->pDamage) {
- if (pExaPixmap->sys_ptr)
- free(pExaPixmap->sys_ptr);
+ free(pExaPixmap->sys_ptr);
pExaPixmap->sys_ptr = NULL;
pExaPixmap->pDamage = NULL;
}
diff --git a/xserver/exa/exa_offscreen.c b/xserver/exa/exa_offscreen.c
index e3a9ab2f6..5abe3b891 100644
--- a/xserver/exa/exa_offscreen.c
+++ b/xserver/exa/exa_offscreen.c
@@ -245,7 +245,7 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
/* save extra space in new area */
if (real_size < area->size)
{
- ExaOffscreenArea *new_area = xalloc (sizeof (ExaOffscreenArea));
+ ExaOffscreenArea *new_area = malloc(sizeof (ExaOffscreenArea));
if (!new_area)
return NULL;
new_area->base_offset = area->base_offset;
@@ -408,7 +408,7 @@ ExaOffscreenMerge (ExaScreenPrivPtr pExaScr, ExaOffscreenArea *area)
area->next->prev = area;
else
pExaScr->info->offScreenAreas->prev = area;
- xfree (next);
+ free(next);
pExaScr->numOffscreenAvailable--;
}
@@ -655,7 +655,7 @@ exaOffscreenInit (ScreenPtr pScreen)
ExaOffscreenArea *area;
/* Allocate a big free area */
- area = xalloc (sizeof (ExaOffscreenArea));
+ area = malloc(sizeof (ExaOffscreenArea));
if (!area)
return FALSE;
@@ -691,6 +691,6 @@ ExaOffscreenFini (ScreenPtr pScreen)
while ((area = pExaScr->info->offScreenAreas))
{
pExaScr->info->offScreenAreas = area->next;
- xfree (area);
+ free(area);
}
}
diff --git a/xserver/exa/exa_priv.h b/xserver/exa/exa_priv.h
index 21d964683..e5d90d468 100644
--- a/xserver/exa/exa_priv.h
+++ b/xserver/exa/exa_priv.h
@@ -50,10 +50,8 @@
#include "dix.h"
#include "fb.h"
#include "fboverlay.h"
-#ifdef RENDER
#include "fbpict.h"
#include "glyphstr.h"
-#endif
#include "damage.h"
#define DEBUG_TRACE_FALL 0
@@ -166,13 +164,11 @@ typedef struct {
CreateScreenResourcesProcPtr SavedCreateScreenResources;
ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader;
SourceValidateProcPtr SavedSourceValidate;
-#ifdef RENDER
CompositeProcPtr SavedComposite;
TrianglesProcPtr SavedTriangles;
GlyphsProcPtr SavedGlyphs;
TrapezoidsProcPtr SavedTrapezoids;
AddTrapsProcPtr SavedAddTraps;
-#endif
void (*do_migration) (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel);
Bool (*pixmap_has_gpu_copy) (PixmapPtr pPixmap);
void (*do_move_in_pixmap) (PixmapPtr pPixmap);
@@ -225,9 +221,13 @@ typedef struct {
(PixmapWidthPaddingInfo[d].padRoundUp+1)))
#endif
-extern DevPrivateKey exaScreenPrivateKey;
-extern DevPrivateKey exaPixmapPrivateKey;
-extern DevPrivateKey exaGCPrivateKey;
+extern DevPrivateKeyRec exaScreenPrivateKeyRec;
+#define exaScreenPrivateKey (&exaScreenPrivateKeyRec)
+extern DevPrivateKeyRec exaPixmapPrivateKeyRec;
+#define exaPixmapPrivateKey (&exaPixmapPrivateKeyRec)
+extern DevPrivateKeyRec exaGCPrivateKeyRec;
+#define exaGCPrivateKey (&exaGCPrivateKeyRec)
+
#define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixLookupPrivate(&(s)->devPrivates, exaScreenPrivateKey))
#define ExaScreenPriv(s) ExaScreenPrivPtr pExaScr = ExaGetScreenPriv(s)
@@ -499,7 +499,6 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
extern const GCOps exaOps;
-#ifdef RENDER
void
ExaCheckComposite (CARD8 op,
PicturePtr pSrc,
@@ -513,7 +512,17 @@ ExaCheckComposite (CARD8 op,
INT16 yDst,
CARD16 width,
CARD16 height);
-#endif
+
+void
+ExaCheckGlyphs (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc,
+ int nlist,
+ GlyphListPtr list,
+ GlyphPtr *glyphs);
/* exa_offscreen.c */
void
@@ -542,6 +551,9 @@ void
exaFinishAccess(DrawablePtr pDrawable, int index);
void
+exaDestroyPixmap(PixmapPtr pPixmap);
+
+void
exaPixmapDirty(PixmapPtr pPix, int x1, int y1, int x2, int y2);
void
diff --git a/xserver/exa/exa_render.c b/xserver/exa/exa_render.c
index 1b68e1cdc..6f2af8a8f 100644
--- a/xserver/exa/exa_render.c
+++ b/xserver/exa/exa_render.c
@@ -30,7 +30,6 @@
#include "exa_priv.h"
-#ifdef RENDER
#include "mipict.h"
#if DEBUG_TRACE_FALL
@@ -293,7 +292,7 @@ exaTryDriverSolidFill(PicturePtr pSrc,
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y);
- REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
+ RegionTranslate(&region, dst_off_x, dst_off_y);
if (pSrc->pDrawable) {
pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
@@ -306,7 +305,7 @@ exaTryDriverSolidFill(PicturePtr pSrc,
!exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
pDst->pFormat))
{
- REGION_UNINIT(pDst->pDrawable->pScreen, &region);
+ RegionUninit(&region);
return -1;
}
@@ -321,18 +320,18 @@ exaTryDriverSolidFill(PicturePtr pSrc,
}
if (!exaPixmapHasGpuCopy(pDstPix)) {
- REGION_UNINIT(pDst->pDrawable->pScreen, &region);
+ RegionUninit(&region);
return 0;
}
if (!(*pExaScr->info->PrepareSolid) (pDstPix, GXcopy, 0xffffffff, pixel))
{
- REGION_UNINIT(pDst->pDrawable->pScreen, &region);
+ RegionUninit(&region);
return -1;
}
- nbox = REGION_NUM_RECTS(&region);
- pbox = REGION_RECTS(&region);
+ nbox = RegionNumRects(&region);
+ pbox = RegionRects(&region);
while (nbox--)
{
@@ -343,7 +342,7 @@ exaTryDriverSolidFill(PicturePtr pSrc,
(*pExaScr->info->DoneSolid) (pDstPix);
exaMarkSync(pDst->pDrawable->pScreen);
- REGION_UNINIT(pDst->pDrawable->pScreen, &region);
+ RegionUninit(&region);
return 1;
}
@@ -470,10 +469,10 @@ exaTryDriverCompositeRects(CARD8 op,
rects->width, rects->height))
goto next_rect;
- REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
+ RegionTranslate(&region, dst_off_x, dst_off_y);
- nbox = REGION_NUM_RECTS(&region);
- pbox = REGION_RECTS(&region);
+ nbox = RegionNumRects(&region);
+ pbox = RegionRects(&region);
xMask = xMask + mask_off_x - xDst - dst_off_x;
yMask = yMask + mask_off_y - yDst - dst_off_y;
@@ -495,7 +494,7 @@ exaTryDriverCompositeRects(CARD8 op,
}
next_rect:
- REGION_UNINIT(pDst->pDrawable->pScreen, &region);
+ RegionUninit(&region);
rects++;
}
@@ -576,11 +575,11 @@ exaCompositeRects(CARD8 op,
* (see use of DamagePendingRegion in exaCopyDirty)
*/
- REGION_INIT(pScreen, &region, &box, 1);
+ RegionInit(&region, &box, 1);
DamageRegionAppend(pDst->pDrawable, &region);
- REGION_UNINIT(pScreen, &region);
+ RegionUninit(&region);
}
/************************************************************/
@@ -704,7 +703,7 @@ exaTryDriverComposite(CARD8 op,
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y);
- REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
+ RegionTranslate(&region, dst_off_x, dst_off_y);
if (pExaScr->do_migration) {
ExaMigrationRec pixmaps[3];
@@ -738,7 +737,7 @@ exaTryDriverComposite(CARD8 op,
if (pSrcPix) {
pSrcPix = exaGetOffscreenPixmap (pSrc->pDrawable, &src_off_x, &src_off_y);
if (!pSrcPix) {
- REGION_UNINIT(pDst->pDrawable->pScreen, &region);
+ RegionUninit(&region);
return 0;
}
}
@@ -747,25 +746,25 @@ exaTryDriverComposite(CARD8 op,
pMaskPix = exaGetOffscreenPixmap (pMask->pDrawable, &mask_off_x,
&mask_off_y);
if (!pMaskPix) {
- REGION_UNINIT(pDst->pDrawable->pScreen, &region);
+ RegionUninit(&region);
return 0;
}
}
if (!exaPixmapHasGpuCopy(pDstPix)) {
- REGION_UNINIT(pDst->pDrawable->pScreen, &region);
+ RegionUninit(&region);
return 0;
}
if (!(*pExaScr->info->PrepareComposite) (op, pSrc, pMask, pDst, pSrcPix,
pMaskPix, pDstPix))
{
- REGION_UNINIT(pDst->pDrawable->pScreen, &region);
+ RegionUninit(&region);
return -1;
}
- nbox = REGION_NUM_RECTS(&region);
- pbox = REGION_RECTS(&region);
+ nbox = RegionNumRects(&region);
+ pbox = RegionRects(&region);
xMask = xMask + mask_off_x - xDst - dst_off_x;
yMask = yMask + mask_off_y - yDst - dst_off_y;
@@ -789,7 +788,7 @@ exaTryDriverComposite(CARD8 op,
(*pExaScr->info->DoneComposite) (pDstPix);
exaMarkSync(pDst->pDrawable->pScreen);
- REGION_UNINIT(pDst->pDrawable->pScreen, &region);
+ RegionUninit(&region);
return 1;
}
@@ -954,9 +953,9 @@ exaComposite(CARD8 op,
goto done;
ret = exaHWCopyNtoN(pSrc->pDrawable, pDst->pDrawable, NULL,
- REGION_RECTS(&region), REGION_NUM_RECTS(&region),
+ RegionRects(&region), RegionNumRects(&region),
xSrc - xDst, ySrc - yDst, FALSE, FALSE);
- REGION_UNINIT(pDst->pDrawable->pScreen, &region);
+ RegionUninit(&region);
/* Reset values to their original values. */
xDst -= pDst->pDrawable->x;
@@ -1006,7 +1005,7 @@ exaComposite(CARD8 op,
(PixmapPtr)pSrc->pDrawable,
&patOrg, FB_ALLONES, GXcopy, CT_NONE);
- REGION_UNINIT(pDst->pDrawable->pScreen, &region);
+ RegionUninit(&region);
if (ret)
goto done;
@@ -1072,7 +1071,6 @@ done:
if (pMask)
pMask->repeat = saveMaskRepeat;
}
-#endif
/**
* Same as miCreateAlphaPicture, except it uses ExaCheckPolyFillRect instead
diff --git a/xserver/exa/exa_unaccel.c b/xserver/exa/exa_unaccel.c
index 8d7009813..a078cc114 100644
--- a/xserver/exa/exa_unaccel.c
+++ b/xserver/exa/exa_unaccel.c
@@ -23,9 +23,7 @@
#include "exa_priv.h"
-#ifdef RENDER
#include "mipict.h"
-#endif
/*
* These functions wrap the low-level fb rendering functions and
@@ -133,10 +131,10 @@ ExaCheckCopyNtoN (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
PixmapPtr pPixmap = exaGetDrawablePixmap(pSrc);
exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff);
- REGION_INIT(pScreen, &reg, pbox, nbox);
- REGION_TRANSLATE(pScreen, &reg, xoff + dx, yoff + dy);
+ RegionInit(&reg, pbox, nbox);
+ RegionTranslate(&reg, xoff + dx, yoff + dy);
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, &reg);
- REGION_UNINIT(pScreen, &reg);
+ RegionUninit(&reg);
} else
exaPrepareAccess (pSrc, EXA_PREPARE_SRC);
@@ -146,10 +144,10 @@ ExaCheckCopyNtoN (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
PixmapPtr pPixmap = exaGetDrawablePixmap(pDst);
exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff);
- REGION_INIT(pScreen, &reg, pbox, nbox);
- REGION_TRANSLATE(pScreen, &reg, xoff, yoff);
+ RegionInit(&reg, pbox, nbox);
+ RegionTranslate(&reg, xoff, yoff);
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST, &reg);
- REGION_UNINIT(pScreen, &reg);
+ RegionUninit(&reg);
} else
exaPrepareAccess (pDst, EXA_PREPARE_DEST);
@@ -190,9 +188,9 @@ ExaFallbackPrepareReg(DrawablePtr pDrawable,
box.x2 = box.x1 + width;
box.y2 = box.y1 + height;
- REGION_INIT(pScreen, &reg, &box, 1);
+ RegionInit(&reg, &box, 1);
pExaScr->prepare_access_reg(pPixmap, index, &reg);
- REGION_UNINIT(pScreen, &reg);
+ RegionUninit(&reg);
} else
exaPrepareAccess(pDrawable, index);
}
@@ -384,9 +382,9 @@ ExaCheckCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
int xoff, yoff;
exaGetDrawableDeltas(&pWin->drawable, pPixmap, &xoff, &yoff);
- REGION_TRANSLATE(pScreen, prgnSrc, xoff, yoff);
+ RegionTranslate(prgnSrc, xoff, yoff);
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, prgnSrc);
- REGION_TRANSLATE(pScreen, prgnSrc, -xoff, -yoff);
+ RegionTranslate(prgnSrc, -xoff, -yoff);
} else
exaPrepareAccess(pDrawable, EXA_PREPARE_SRC);
@@ -460,9 +458,9 @@ ExaSrcValidate(DrawablePtr pDrawable,
dst = (pExaScr->srcPix == pPix) ? &pExaScr->srcReg :
&pExaScr->maskReg;
- REGION_INIT(pScreen, &reg, &box, 1);
- REGION_UNION(pScreen, dst, dst, &reg);
- REGION_UNINIT(pScreen, &reg);
+ RegionInit(&reg, &box, 1);
+ RegionUnion(dst, dst, &reg);
+ RegionUninit(&reg);
if (pExaScr->SavedSourceValidate) {
swap(pExaScr, pScreen, SourceValidate);
@@ -497,30 +495,30 @@ ExaPrepareCompositeReg(ScreenPtr pScreen,
Bool ret;
- REGION_NULL(pScreen, &region);
+ RegionNull(&region);
if (pSrc->pDrawable) {
pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable);
- REGION_NULL(pScreen, &pExaScr->srcReg);
+ RegionNull(&pExaScr->srcReg);
srcReg = &pExaScr->srcReg;
pExaScr->srcPix = pSrcPix;
if (pSrc != pDst)
- REGION_TRANSLATE(pScreen, pSrc->pCompositeClip,
+ RegionTranslate(pSrc->pCompositeClip,
-pSrc->pDrawable->x,
-pSrc->pDrawable->y);
}
if (pMask && pMask->pDrawable) {
pMaskPix = exaGetDrawablePixmap(pMask->pDrawable);
- REGION_NULL(pScreen, &pExaScr->maskReg);
+ RegionNull(&pExaScr->maskReg);
maskReg = &pExaScr->maskReg;
if (pMask != pDst && pMask != pSrc)
- REGION_TRANSLATE(pScreen, pMask->pCompositeClip,
+ RegionTranslate(pMask->pCompositeClip,
-pMask->pDrawable->x,
-pMask->pDrawable->y);
}
- REGION_TRANSLATE(pScreen, pDst->pCompositeClip,
+ RegionTranslate(pDst->pCompositeClip,
-pDst->pDrawable->x,
-pDst->pDrawable->y);
@@ -533,23 +531,23 @@ ExaPrepareCompositeReg(ScreenPtr pScreen,
width, height);
swap(pExaScr, pScreen, SourceValidate);
- REGION_TRANSLATE(pScreen, pDst->pCompositeClip,
+ RegionTranslate(pDst->pCompositeClip,
pDst->pDrawable->x,
pDst->pDrawable->y);
if (pSrc->pDrawable && pSrc != pDst)
- REGION_TRANSLATE(pScreen, pSrc->pCompositeClip,
+ RegionTranslate(pSrc->pCompositeClip,
pSrc->pDrawable->x,
pSrc->pDrawable->y);
if (pMask && pMask->pDrawable && pMask != pDst && pMask != pSrc)
- REGION_TRANSLATE(pScreen, pMask->pCompositeClip,
+ RegionTranslate(pMask->pCompositeClip,
pMask->pDrawable->x,
pMask->pDrawable->y);
if (!ret) {
if (srcReg)
- REGION_UNINIT(pScreen, srcReg);
+ RegionUninit(srcReg);
if (maskReg)
- REGION_UNINIT(pScreen, maskReg);
+ RegionUninit(maskReg);
return FALSE;
}
@@ -579,9 +577,9 @@ ExaPrepareCompositeReg(ScreenPtr pScreen,
maskReg);
if (srcReg)
- REGION_UNINIT(pScreen, srcReg);
+ RegionUninit(srcReg);
if (maskReg)
- REGION_UNINIT(pScreen, maskReg);
+ RegionUninit(maskReg);
pDstPix = exaGetDrawablePixmap(pDst->pDrawable);
if (!exaOpReadsDestination(op)) {
@@ -589,7 +587,7 @@ ExaPrepareCompositeReg(ScreenPtr pScreen,
int yoff;
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &xoff, &yoff);
- REGION_TRANSLATE(pScreen, &region, pDst->pDrawable->x + xoff,
+ RegionTranslate(&region, pDst->pDrawable->x + xoff,
pDst->pDrawable->y + yoff);
dstReg = &region;
}
@@ -600,7 +598,7 @@ ExaPrepareCompositeReg(ScreenPtr pScreen,
dstReg);
pExaScr->prepare_access_reg(pDstPix, EXA_PREPARE_DEST, dstReg);
- REGION_UNINIT(pScreen, &region);
+ RegionUninit(&region);
return TRUE;
}
@@ -619,9 +617,7 @@ ExaCheckComposite (CARD8 op,
CARD16 height)
{
ScreenPtr pScreen = pDst->pDrawable->pScreen;
-#ifdef RENDER
PictureScreenPtr ps = GetPictureScreen(pScreen);
-#endif /* RENDER */
EXA_PRE_FALLBACK(pScreen);
if (pExaScr->prepare_access_reg) {
@@ -654,7 +650,6 @@ ExaCheckComposite (CARD8 op,
exaPrepareAccess (pMask->pDrawable, EXA_PREPARE_MASK);
}
-#ifdef RENDER
swap(pExaScr, ps, Composite);
ps->Composite (op,
pSrc,
@@ -669,7 +664,6 @@ ExaCheckComposite (CARD8 op,
width,
height);
swap(pExaScr, ps, Composite);
-#endif /* RENDER */
if (pMask && pMask->pDrawable != NULL)
exaFinishAccess (pMask->pDrawable, EXA_PREPARE_MASK);
if (pSrc->pDrawable != NULL)
@@ -686,6 +680,28 @@ out_no_clip:
EXA_POST_FALLBACK(pScreen);
}
+/**
+ * Avoid migration ping-pong when using a mask.
+ */
+void
+ExaCheckGlyphs (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc,
+ int nlist,
+ GlyphListPtr list,
+ GlyphPtr *glyphs)
+{
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ EXA_PRE_FALLBACK(pScreen);
+
+ miGlyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
+
+ EXA_POST_FALLBACK(pScreen);
+}
+
void
ExaCheckAddTraps (PicturePtr pPicture,
INT16 x_off,
@@ -694,19 +710,15 @@ ExaCheckAddTraps (PicturePtr pPicture,
xTrap *traps)
{
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
-#ifdef RENDER
PictureScreenPtr ps = GetPictureScreen(pScreen);
-#endif /* RENDER */
EXA_PRE_FALLBACK(pScreen);
EXA_FALLBACK(("to pict %p (%c)\n",
exaDrawableLocation(pPicture->pDrawable)));
exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
-#ifdef RENDER
swap(pExaScr, ps, AddTraps);
ps->AddTraps (pPicture, x_off, y_off, ntrap, traps);
swap(pExaScr, ps, AddTraps);
-#endif /* RENDER */
exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST);
EXA_POST_FALLBACK(pScreen);
}