diff --git a/.gitignore b/.gitignore index e4b3d3199..27132c0f9 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ config.log config.status config.sub configure +configure.lineno depcomp install-sh libtool @@ -91,6 +92,8 @@ cfb32/cfbzerarcG.c cfb32/cfbzerarcX.c doc/Xserver.1x doc/Xserver.man +doc/SecurityPolicy.5 +doc/SecurityPolicy.man hw/dmx/Xdmx hw/dmx/Xdmx.1x hw/dmx/config/dmxtodmx @@ -206,31 +209,58 @@ hw/xfree86/xaa/mf3-xaaBitmap.c hw/xfree86/xaa/mf3-xaaStipple.c hw/xfree86/xaa/s-xaaDashLine.c hw/xfree86/xaa/s-xaaLine.c +hw/xfree86/xf1bpp/maskbits.c +hw/xfree86/xf1bpp/mfbbitblt.c hw/xfree86/xf1bpp/mfbbltC.c hw/xfree86/xf1bpp/mfbbltCI.c hw/xfree86/xf1bpp/mfbbltG.c hw/xfree86/xf1bpp/mfbbltO.c hw/xfree86/xf1bpp/mfbbltX.c +hw/xfree86/xf1bpp/mfbbres.c +hw/xfree86/xf1bpp/mfbbresd.c +hw/xfree86/xf1bpp/mfbclip.c +hw/xfree86/xf1bpp/mfbcmap.c +hw/xfree86/xf1bpp/mfbfillarc.c +hw/xfree86/xf1bpp/mfbfillrct.c +hw/xfree86/xf1bpp/mfbfillsp.c +hw/xfree86/xf1bpp/mfbfont.c +hw/xfree86/xf1bpp/mfbgc.c +hw/xfree86/xf1bpp/mfbgetsp.c hw/xfree86/xf1bpp/mfbigbblak.c hw/xfree86/xf1bpp/mfbigbwht.c +hw/xfree86/xf1bpp/mfbhrzvert.c +hw/xfree86/xf1bpp/mfbimage.c +hw/xfree86/xf1bpp/mfbline.c +hw/xfree86/xf1bpp/mfbmisc.c hw/xfree86/xf1bpp/mfbpablack.c hw/xfree86/xf1bpp/mfbpainv.c hw/xfree86/xf1bpp/mfbpawhite.c hw/xfree86/xf1bpp/mfbpgbblak.c hw/xfree86/xf1bpp/mfbpgbinv.c hw/xfree86/xf1bpp/mfbpgbwht.c +hw/xfree86/xf1bpp/mfbpixmap.c hw/xfree86/xf1bpp/mfbplyblack.c hw/xfree86/xf1bpp/mfbplyinv.c hw/xfree86/xf1bpp/mfbplywhite.c +hw/xfree86/xf1bpp/mfbpntwin.c +hw/xfree86/xf1bpp/mfbpolypnt.c +hw/xfree86/xf1bpp/mfbpushpxl.c +hw/xfree86/xf1bpp/mfbscrclse.c +hw/xfree86/xf1bpp/mfbscrinit.c hw/xfree86/xf1bpp/mfbseg.c +hw/xfree86/xf1bpp/mfbsetsp.c hw/xfree86/xf1bpp/mfbteblack.c hw/xfree86/xf1bpp/mfbtewhite.c hw/xfree86/xf1bpp/mfbtileC.c hw/xfree86/xf1bpp/mfbtileG.c +hw/xfree86/xf1bpp/mfbwindow.c +hw/xfree86/xf1bpp/mfbzerarc.c hw/xfree86/xf4bpp/mfbseg.c hw/xfree86/xf8_32bpp/cfbgc32.c hw/xfree86/xf8_32bpp/cfbgc8.c hw/xfree86/xorg.c +hw/xfree86/xorg.conf.example +hw/xfree86/xorg.conf.example.pre hw/xnest/Xnest hw/xnest/Xnest.1x hw/xnest/Xnest.man diff --git a/GL/Makefile.am b/GL/Makefile.am index df9f533e2..38cef7b39 100644 --- a/GL/Makefile.am +++ b/GL/Makefile.am @@ -1,8 +1,4 @@ -# someone could get really crazy someday and add support for the SI... - -# xwin/darwin/xfree86 have their accel support under the DDX - -if BUILD_DARWIN +if XDARWIN DARWIN_SUBDIRS = apple endif SUBDIRS = glx mesa $(DARWIN_SUBDIRS) diff --git a/Xext/Makefile.am b/Xext/Makefile.am index 3593c1428..2423c8396 100644 --- a/Xext/Makefile.am +++ b/Xext/Makefile.am @@ -97,7 +97,7 @@ endif XCALIBRATE_SRCS = xcalibrate.c if XCALIBRATE BUILTIN_SRCS += $(XCALIBRATE_SRCS) -# XCalibrare needs tslib +# XCalibrate needs tslib endif # X EVent Interception Extension: allows accessibility helpers & composite diff --git a/Xext/mbufbf.c b/Xext/mbufbf.c index e29c974a3..b879abcb0 100644 --- a/Xext/mbufbf.c +++ b/Xext/mbufbf.c @@ -504,7 +504,7 @@ bufClearImageBufferArea(pMBBuffer, x,y, w,h, generateExposures) REGION_INTERSECT(pScreen, ®, ®, &pBuffer->clipList); if (pBuffer->backgroundState != None) - (*pScreen->PaintWindowBackground)(pBuffer, ®, PW_BACKGROUND); + miPaintWindow(pBuffer, ®, PW_BACKGROUND); if (generateExposures) MultibufferExpose(pMBBuffer, ®); #ifdef _notdef @@ -517,7 +517,7 @@ bufClearImageBufferArea(pMBBuffer, x,y, w,h, generateExposures) if (generateExposures) (*pScreen->WindowExposures)(pBuffer, ®, pBSReg); else if (pBuffer->backgroundState != None) - (*pScreen->PaintWindowBackground)(pBuffer, ®, PW_BACKGROUND); + miPaintWindow(pBuffer, ®, PW_BACKGROUND); #endif REGION_UNINIT(pScreen, ®); if (pBSReg) @@ -836,8 +836,7 @@ bufClipNotify(pWin, dx,dy) /* * Updates buffer's background fields when the window's changes. - * This is necessary because pScreen->PaintWindowBackground - * is used to paint the buffer. + * This is necessary because miPaintWindow is used to paint the buffer. * * XXBS - Backingstore state will have be tracked too if it is supported. */ @@ -927,7 +926,7 @@ bufWindowExposures(pWin, prgn, other_exposed) pBuffer = (BufferPtr) pMBBuffer->pDrawable; if (i != pMBWindow->displayedMultibuffer) - (* pScreen->PaintWindowBackground)(pBuffer,&tmp_rgn,PW_BACKGROUND); + miPaintWindow(pBuffer, &tmp_rgn, PW_BACKGROUND); if ((pMBBuffer->otherEventMask | pMBBuffer->eventMask) & ExposureMask) MultibufferExpose(pMBBuffer, &tmp_rgn); } diff --git a/afb/Makefile.am b/afb/Makefile.am index d6b8901a1..9fc22ca54 100644 --- a/afb/Makefile.am +++ b/afb/Makefile.am @@ -6,7 +6,7 @@ libafb_gen_sources = afbbltC.c afbbltX.c afbbltCI.c afbbltO.c afbbltG.c afbtileC DISTCLEANFILES = $(libafb_gen_sources) -libafb_la_SOURCES = afbgc.c afbwindow.c afbfont.c afbfillrct.c afbpntwin.c afbpixmap.c \ +libafb_la_SOURCES = afbgc.c afbwindow.c afbfont.c afbfillrct.c afbpixmap.c \ afbimage.c afbline.c afbbres.c afbhrzvert.c afbbresd.c afbpushpxl.c afbply1rct.c \ afbzerarc.c afbfillarc.c afbfillsp.c afbsetsp.c afbscrinit.c afbplygblt.c \ afbclip.c afbgetsp.c afbpolypnt.c afbbitblt.c afbcmap.c afbimggblt.c afbpntarea.c \ diff --git a/afb/afb.h b/afb/afb.h index 5cfbddfb1..21110307a 100644 --- a/afb/afb.h +++ b/afb/afb.h @@ -506,11 +506,6 @@ extern void afbCopyRotatePixmap( int /*xrot*/, int /*yrot*/ ); -extern void afbPaintWindow( - WindowPtr /*pWin*/, - RegionPtr /*pRegion*/, - int /*what*/ -); /* afbpolypnt.c */ extern void afbPolyPoint( @@ -745,16 +740,6 @@ extern DevPrivateKey frameWindowPrivateKey; #define afbGetGCPrivate(pGC) \ ((afbPrivGC *)dixLookupPrivate(&(pGC)->devPrivates, afbGCPrivateKey)) -/* private field of window */ -typedef struct { - unsigned char fastBorder; /* non-zero if border tile is 32 bits wide */ - unsigned char fastBackground; - unsigned short unused; /* pad for alignment with Sun compiler */ - DDXPointRec oldRotate; - PixmapPtr pRotatedBackground; - PixmapPtr pRotatedBorder; -} afbPrivWin; - /* Common macros for extracting drawing information */ #define afbGetTypedWidth(pDrawable,wtype)( \ diff --git a/afb/afbpntwin.c b/afb/afbpntwin.c deleted file mode 100644 index 89c4489c4..000000000 --- a/afb/afbpntwin.c +++ /dev/null @@ -1,128 +0,0 @@ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "windowstr.h" -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "privates.h" - -#include "afb.h" -#include "maskbits.h" -#include "mi.h" - -void -afbPaintWindow(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; -{ - register afbPrivWin *pPrivWin; - unsigned char rrops[AFB_MAX_DEPTH]; - - pPrivWin = (afbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - afbWindowPrivateKey); - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - if (pPrivWin->fastBackground) { - afbTileAreaPPWCopy((DrawablePtr)pWin, - REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pPrivWin->pRotatedBackground, ~0); - return; - } else { - afbTileAreaCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pWin->background.pixmap, 0, 0, ~0); - return; - } - break; - case BackgroundPixel: - afbReduceRop(GXcopy, pWin->background.pixel, ~0, - pWin->drawable.depth, rrops); - afbSolidFillArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), rrops); - return; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) { - afbReduceRop(GXcopy, pWin->border.pixel, ~0, pWin->drawable.depth, - rrops); - afbSolidFillArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), rrops); - return; - } else if (pPrivWin->fastBorder) { - afbTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pPrivWin->pRotatedBorder, ~0); - return; - } - break; - } - miPaintWindow(pWin, pRegion, what); -} diff --git a/afb/afbscrinit.c b/afb/afbscrinit.c index 8615d935b..cbabb894e 100644 --- a/afb/afbscrinit.c +++ b/afb/afbscrinit.c @@ -71,7 +71,6 @@ SOFTWARE. #ifdef PIXMAP_PER_WINDOW DevPrivateKey frameWindowPrivateKey = &frameWindowPrivateKey; #endif -DevPrivateKey afbWindowPrivateKey = &afbWindowPrivateKey; DevPrivateKey afbGCPrivateKey = &afbGCPrivateKey; DevPrivateKey afbScreenPrivateKey = &afbScreenPrivateKey; @@ -135,18 +134,14 @@ afbSetWindowPixmap(WindowPtr pWin, PixmapPtr pPix) } static Bool -afbAllocatePrivates(ScreenPtr pScreen, - DevPrivateKey *pWinKey, DevPrivateKey *pGCKey) +afbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCKey) { - if (pWinKey) - *pWinKey = afbWindowPrivateKey; if (pGCKey) *pGCKey = afbGCPrivateKey; pScreen->GetWindowPixmap = afbGetWindowPixmap; pScreen->SetWindowPixmap = afbSetWindowPixmap; - return(dixRequestPrivate(afbWindowPrivateKey, sizeof(afbPrivWin)) && - dixRequestPrivate(afbGCPrivateKey, sizeof(afbPrivGC))); + return dixRequestPrivate(afbGCPrivateKey, sizeof(afbPrivGC)); } /* dts * (inch/dot) * (25.4 mm / inch) = mm */ @@ -172,7 +167,7 @@ afbScreenInit(register ScreenPtr pScreen, pointer pbits, int xsize, int ysize, i ErrorF("afbInitVisuals: FALSE\n"); return FALSE; } - if (!afbAllocatePrivates(pScreen, NULL, NULL)) { + if (!afbAllocatePrivates(pScreen, NULL)) { ErrorF("afbAllocatePrivates: FALSE\n"); return FALSE; } @@ -191,8 +186,6 @@ afbScreenInit(register ScreenPtr pScreen, pointer pbits, int xsize, int ysize, i pScreen->ChangeWindowAttributes = afbChangeWindowAttributes; pScreen->RealizeWindow = afbMapWindow; pScreen->UnrealizeWindow = afbUnmapWindow; - pScreen->PaintWindowBackground = afbPaintWindow; - pScreen->PaintWindowBorder = afbPaintWindow; pScreen->CopyWindow = afbCopyWindow; pScreen->CreatePixmap = afbCreatePixmap; pScreen->DestroyPixmap = afbDestroyPixmap; diff --git a/afb/afbwindow.c b/afb/afbwindow.c index 1d99fe14d..b2c679274 100644 --- a/afb/afbwindow.c +++ b/afb/afbwindow.c @@ -63,41 +63,16 @@ SOFTWARE. #include "maskbits.h" Bool -afbCreateWindow(pWin) - register WindowPtr pWin; +afbCreateWindow(WindowPtr pWin) { - register afbPrivWin *pPrivWin; - - pPrivWin = (afbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - afbWindowPrivateKey); - pPrivWin->pRotatedBorder = NullPixmap; - pPrivWin->pRotatedBackground = NullPixmap; - pPrivWin->fastBackground = FALSE; - pPrivWin->fastBorder = FALSE; -#ifdef PIXMAP_PER_WINDOW - dixSetPrivate(&pWin->devPrivates, frameWindowPrivateKey, - dixLookupPrivate(&pWin->pDrawable.pScreen->devPrivates, - afbScreenPrivateKey)); -#endif - return (TRUE); } /* This always returns true, because Xfree can't fail. It might be possible * on some devices for Destroy to fail */ Bool -afbDestroyWindow(pWin) - WindowPtr pWin; +afbDestroyWindow(WindowPtr pWin) { - register afbPrivWin *pPrivWin; - - pPrivWin = (afbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - afbWindowPrivateKey); - if (pPrivWin->pRotatedBorder) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder); - if (pPrivWin->pRotatedBackground) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground); - return (TRUE); } @@ -109,47 +84,10 @@ afbMapWindow(pWindow) return (TRUE); } -/* (x, y) is the upper left corner of the window on the screen - do we really need to pass this? (is it a;ready in pWin->absCorner?) - we only do the rotation for pixmaps that are 32 bits wide (padded -or otherwise.) - afbChangeWindowAttributes() has already put a copy of the pixmap -in pPrivWin->pRotated* -*/ - /*ARGSUSED*/ Bool -afbPositionWindow(pWin, x, y) - WindowPtr pWin; - int x, y; +afbPositionWindow(WindowPtr pWin, int x, int y) { - register afbPrivWin *pPrivWin; - int reset = 0; - - pPrivWin = (afbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - afbWindowPrivateKey); - if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) { - afbXRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.x - pPrivWin->oldRotate.x); - afbYRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.y - pPrivWin->oldRotate.y); - reset = 1; - } - - if (!pWin->borderIsPixel && pPrivWin->fastBorder) { - while (pWin->backgroundState == ParentRelative) - pWin = pWin->parent; - afbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - afbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - reset = 1; - } - if (reset) { - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - /* This is the "wrong" fix to the right problem, but it doesn't really * cost very much. When the window is moved, we need to invalidate any * RotatedPixmap that exists in any GC currently validated against this @@ -219,105 +157,8 @@ afbCopyWindow(pWin, ptOldOrg, prgnSrc) REGION_DESTROY(pWin->drawable.pScreen, prgnDst); } - - -/* swap in correct PaintWindow* routine. If we can use a fast output -routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy -of it in devPrivate. -*/ Bool -afbChangeWindowAttributes(pWin, mask) - register WindowPtr pWin; - register unsigned long mask; +afbChangeWindowAttributes(WindowPtr pWin, unsigned long mask) { - register unsigned long index; - register afbPrivWin *pPrivWin; - WindowPtr pBgWin; - - pPrivWin = (afbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - afbWindowPrivateKey); - /* - * When background state changes from ParentRelative and - * we had previously rotated the fast border pixmap to match - * the parent relative origin, rerotate to match window - */ - if (mask & (CWBackPixmap | CWBackPixel) && - pWin->backgroundState != ParentRelative && pPrivWin->fastBorder && - (pPrivWin->oldRotate.x != pWin->drawable.x || - pPrivWin->oldRotate.y != pWin->drawable.y)) { - afbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - afbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - while(mask) { - index = lowbit (mask); - mask &= ~index; - switch(index) { - case CWBackPixmap: - if (pWin->backgroundState == None) - pPrivWin->fastBackground = FALSE; - else if (pWin->backgroundState == ParentRelative) { - pPrivWin->fastBackground = FALSE; - /* Rotate border to match parent origin */ - if (pPrivWin->pRotatedBorder) { - for (pBgWin = pWin->parent; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - afbXRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.x - pPrivWin->oldRotate.x); - afbYRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - } else if ((pWin->background.pixmap->drawable.width <= PPW) && - !(pWin->background.pixmap->drawable.width & - (pWin->background.pixmap->drawable.width - 1))) { - afbCopyRotatePixmap(pWin->background.pixmap, - &pPrivWin->pRotatedBackground, - pWin->drawable.x, pWin->drawable.y); - if (pPrivWin->pRotatedBackground) { - pPrivWin->fastBackground = TRUE; - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } else - pPrivWin->fastBackground = FALSE; - } else - pPrivWin->fastBackground = FALSE; - break; - - case CWBackPixel: - pPrivWin->fastBackground = FALSE; - break; - - case CWBorderPixmap: - if ((pWin->border.pixmap->drawable.width <= PPW) && - !(pWin->border.pixmap->drawable.width & - (pWin->border.pixmap->drawable.width - 1))) { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - afbCopyRotatePixmap(pWin->border.pixmap, - &pPrivWin->pRotatedBorder, - pBgWin->drawable.x, pBgWin->drawable.y); - if (pPrivWin->pRotatedBorder) { - pPrivWin->fastBorder = TRUE; - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } else - pPrivWin->fastBorder = FALSE; - } else - pPrivWin->fastBorder = FALSE; - break; - case CWBorderPixel: - pPrivWin->fastBorder = FALSE; - break; - } - } - /* Again, we have no failure modes indicated by any of the routines - * we've called, so we have to assume it worked */ return (TRUE); } diff --git a/cfb/Makefile.am.inc b/cfb/Makefile.am.inc index 5aa913aee..a2ee143aa 100644 --- a/cfb/Makefile.am.inc +++ b/cfb/Makefile.am.inc @@ -8,7 +8,7 @@ DISTCLEANFILES = $(libcfb_gen_sources) CFB_INCLUDES = -I$(top_srcdir)/mfb -I$(top_srcdir)/cfb libcfb_common_sources = $(top_srcdir)/cfb/cfbgc.c $(top_srcdir)/cfb/cfbrrop.c \ - $(top_srcdir)/cfb/cfbwindow.c $(top_srcdir)/cfb/cfbpntwin.c \ + $(top_srcdir)/cfb/cfbwindow.c \ $(top_srcdir)/cfb/cfbmskbits.c $(top_srcdir)/cfb/cfbpixmap.c \ $(top_srcdir)/cfb/cfbbitblt.c $(top_srcdir)/cfb/cfbfillsp.c \ $(top_srcdir)/cfb/cfbsetsp.c $(top_srcdir)/cfb/cfbscrinit.c \ diff --git a/cfb/cfb.h b/cfb/cfb.h index 44d4ad0fd..b74a82f08 100644 --- a/cfb/cfb.h +++ b/cfb/cfb.h @@ -57,7 +57,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. */ extern DevPrivateKey cfbGCPrivateKey; -extern DevPrivateKey cfbWindowPrivateKey; /* private field of GC */ typedef struct { @@ -82,22 +81,6 @@ typedef struct { CfbBits xor, and; } cfbRRopRec, *cfbRRopPtr; -/* private field of window */ -typedef struct { - unsigned char fastBorder; /* non-zero if border is 32 bits wide */ - unsigned char fastBackground; - unsigned short unused; /* pad for alignment with Sun compiler */ - DDXPointRec oldRotate; - PixmapPtr pRotatedBackground; - PixmapPtr pRotatedBorder; - } cfbPrivWin; - -#define cfbGetWindowPrivate(_pWin) ((cfbPrivWin *)\ - dixLookupPrivate(&(_pWin)->devPrivates, cfbWindowPrivateKey)) - - -/* cfb8bit.c */ - extern int cfbSetStipple( int /*alu*/, CfbBits /*fg*/, @@ -314,7 +297,6 @@ extern int cfb8SegmentSS1RectXor( extern Bool cfbAllocatePrivates( ScreenPtr /*pScreen*/, - DevPrivateKey * /*window_key*/, DevPrivateKey * /*gc_key*/ ); /* cfbbitblt.c */ @@ -807,27 +789,6 @@ extern void cfbFillPoly1RectGeneral( int /*count*/, DDXPointPtr /*ptsIn*/ ); -/* cfbpntwin.c */ - -extern void cfbPaintWindow( - WindowPtr /*pWin*/, - RegionPtr /*pRegion*/, - int /*what*/ -); - -extern void cfbFillBoxSolid( - DrawablePtr /*pDrawable*/, - int /*nBox*/, - BoxPtr /*pBox*/, - unsigned long /*pixel*/ -); - -extern void cfbFillBoxTile32( - DrawablePtr /*pDrawable*/, - int /*nBox*/, - BoxPtr /*pBox*/, - PixmapPtr /*tile*/ -); /* cfbpolypnt.c */ extern void cfbPolyPoint( diff --git a/cfb/cfballpriv.c b/cfb/cfballpriv.c index e6ab93a87..3b58266c5 100644 --- a/cfb/cfballpriv.c +++ b/cfb/cfballpriv.c @@ -45,7 +45,6 @@ in this Software without prior written authorization from The Open Group. #include "mibstore.h" #if 1 || PSZ==8 -DevPrivateKey cfbWindowPrivateKey = &cfbWindowPrivateKey; DevPrivateKey cfbGCPrivateKey = &cfbGCPrivateKey; #endif #ifdef CFB_NEED_SCREEN_PRIVATE @@ -54,28 +53,18 @@ DevPrivateKey cfbScreenPrivateKey = &cfbScreenPrivateKey; Bool -cfbAllocatePrivates(pScreen, window_key, gc_key) - ScreenPtr pScreen; - DevPrivateKey *window_key, *gc_key; +cfbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *gc_key) { - if (!window_key || !gc_key || (!*window_key && !*gc_key)) + if (!gc_key || !*gc_key) { - if (!mfbAllocatePrivates(pScreen, - &cfbWindowPrivateKey, &cfbGCPrivateKey)) + if (!mfbAllocatePrivates(pScreen, &cfbGCPrivateKey)) return FALSE; - if (window_key) - *window_key = cfbWindowPrivateKey; if (gc_key) *gc_key = cfbGCPrivateKey; } else { - cfbWindowPrivateKey = *window_key; cfbGCPrivateKey = *gc_key; } - if (!dixRequestPrivate(cfbWindowPrivateKey, sizeof(cfbPrivWin))) - return FALSE; - if (!dixRequestPrivate(cfbGCPrivateKey, sizeof(cfbPrivGC))) - return FALSE; - return TRUE; + return dixRequestPrivate(cfbGCPrivateKey, sizeof(cfbPrivGC)); } diff --git a/cfb/cfbmap.h b/cfb/cfbmap.h index 1d6a3f850..2e709b19d 100644 --- a/cfb/cfbmap.h +++ b/cfb/cfbmap.h @@ -71,8 +71,6 @@ in this Software without prior written authorization from The Open Group. #undef cfbDoBitbltGeneral #undef cfbDoBitbltOr #undef cfbDoBitbltXor -#undef cfbFillBoxSolid -#undef cfbFillBoxTile32 #undef cfbFillBoxTile32sCopy #undef cfbFillBoxTile32sGeneral #undef cfbFillBoxTileOdd @@ -108,7 +106,6 @@ in this Software without prior written authorization from The Open Group. #undef cfbNonTEOps #undef cfbNonTEOps1Rect #undef cfbPadPixmap -#undef cfbPaintWindow #undef cfbPolyFillArcSolidCopy #undef cfbPolyFillArcSolidGeneral #undef cfbPolyFillRect @@ -250,8 +247,6 @@ cfb can not hack PSZ yet #define cfbDoBitbltOr CFBNAME(DoBitbltOr) #define cfbDoBitbltXor CFBNAME(DoBitbltXor) #define cfbExpandDirectColors CFBNAME(cfbExpandDirectColors) -#define cfbFillBoxSolid CFBNAME(FillBoxSolid) -#define cfbFillBoxTile32 CFBNAME(FillBoxTile32) #define cfbFillBoxTile32sCopy CFBNAME(FillBoxTile32sCopy) #define cfbFillBoxTile32sGeneral CFBNAME(FillBoxTile32sGeneral) #define cfbFillBoxTileOdd CFBNAME(FillBoxTileOdd) @@ -288,7 +283,6 @@ cfb can not hack PSZ yet #define cfbNonTEOps CFBNAME(NonTEOps) #define cfbNonTEOps1Rect CFBNAME(NonTEOps1Rect) #define cfbPadPixmap CFBNAME(PadPixmap) -#define cfbPaintWindow CFBNAME(PaintWindow) #define cfbPolyFillArcSolidCopy CFBNAME(PolyFillArcSolidCopy) #define cfbPolyFillArcSolidGeneral CFBNAME(PolyFillArcSolidGeneral) #define cfbPolyFillRect CFBNAME(PolyFillRect) diff --git a/cfb/cfbpntwin.c b/cfb/cfbpntwin.c deleted file mode 100644 index 32f011e23..000000000 --- a/cfb/cfbpntwin.c +++ /dev/null @@ -1,768 +0,0 @@ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "windowstr.h" -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" - -#include "cfb.h" -#include "cfbmskbits.h" -#include "mi.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -void -cfbPaintWindow(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; -{ - register cfbPrivWin *pPrivWin; - WindowPtr pBgWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - break; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - break; - case BackgroundPixmap: - if (pPrivWin->fastBackground) - { - cfbFillBoxTile32 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pPrivWin->pRotatedBackground); - } - else - { - int xorg = pWin->drawable.x; - int yorg = pWin->drawable.y; -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pWin->drawable.pScreen->myNum; - if(WindowTable[index] == pWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - cfbFillBoxTileOdd ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixmap, - xorg, yorg); - } - break; - case BackgroundPixel: - cfbFillBoxSolid ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel); - break; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - cfbFillBoxSolid ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel); - } - else if (pPrivWin->fastBorder) - { - cfbFillBoxTile32 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pPrivWin->pRotatedBorder); - } - else - { - int xorg, yorg; - - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - - xorg = pBgWin->drawable.x; - yorg = pBgWin->drawable.y; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pWin->drawable.pScreen->myNum; - if(WindowTable[index] == pBgWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - - cfbFillBoxTileOdd ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixmap, - xorg, yorg); - } - break; - } -} - -/* - * Use the RROP macros in copy mode - */ - -#define RROP GXcopy -#include "cfbrrop.h" - -#ifdef RROP_UNROLL -# define Expand(left,right,leftAdjust) {\ - int part = nmiddle & RROP_UNROLL_MASK; \ - int widthStep; \ - widthStep = widthDst - nmiddle - leftAdjust; \ - nmiddle >>= RROP_UNROLL_SHIFT; \ - while (h--) { \ - left \ - pdst += part; \ - switch (part) { \ - RROP_UNROLL_CASE(pdst) \ - } \ - m = nmiddle; \ - while (m) { \ - pdst += RROP_UNROLL; \ - RROP_UNROLL_LOOP(pdst) \ - m--; \ - } \ - right \ - pdst += widthStep; \ - } \ -} - -#else -# define Expand(left, right, leftAdjust) { \ - int widthStep; \ - widthStep = widthDst - nmiddle - leftAdjust; \ - while (h--) { \ - left \ - m = nmiddle; \ - while (m--) {\ - RROP_SOLID(pdst); \ - pdst++; \ - } \ - right \ - pdst += widthStep; \ - } \ -} -#endif - -void -cfbFillBoxSolid (pDrawable, nBox, pBox, pixel) - DrawablePtr pDrawable; - int nBox; - BoxPtr pBox; - unsigned long pixel; -{ - CfbBits *pdstBase; - int widthDst; - register int h; - register CfbBits *pdst; - int nmiddle; - int w; -#if PSZ == 24 - int leftIndex, rightIndex; - CfbBits piQxelArray[3], *pdstULC; /*upper left corner*/ - - piQxelArray[0] = (pixel&0xFFFFFF) | ((pixel&0xFF)<<24); - piQxelArray[1] = ((pixel&0xFFFF00)>>8) | ((pixel&0xFFFF)<<16); - piQxelArray[2] = ((pixel&0xFFFFFF)<<8) | ((pixel&0xFF0000)>>16); -#else - register CfbBits rrop_xor; - register CfbBits leftMask, rightMask; - register int m; -#endif - - cfbGetLongWidthAndPointer(pDrawable, widthDst, pdstBase); - -#if PSZ != 24 - rrop_xor = PFILL(pixel); -#endif - for (; nBox; nBox--, pBox++) - { - pdst = pdstBase + pBox->y1 * widthDst; - h = pBox->y2 - pBox->y1; - w = pBox->x2 - pBox->x1; -#if PSZ == 8 - if (w == 1) - { - register char *pdstb = ((char *) pdst) + pBox->x1; - int incr = widthDst * PGSZB; - - while (h--) - { - *pdstb = rrop_xor; - pdstb += incr; - } - } - else - { -#endif -#if PSZ == 24 -/* _Box has x1, y1, x2, y2*/ - leftIndex = pBox->x1 & 3; - rightIndex = ((leftIndex+w)<5)?0:(pBox->x2 &3); - nmiddle = w - rightIndex; - if(leftIndex){ - nmiddle -= (4 - leftIndex); - } - nmiddle >>= 2; - if(nmiddle < 0) - nmiddle = 0; - - pdst = pdstBase + pBox->y1 * widthDst + ((pBox->x1*3) >> 2); - - switch(leftIndex+w){ - case 4: - switch(leftIndex){ - case 0: - while(h--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst -=2; - pdst += widthDst; - } - break; - case 1: - while(h--){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst -=2; - pdst += widthDst; - } - break; - case 2: - while(h--){ - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst-- = piQxelArray[2]; - pdst += widthDst; - } - break; - case 3: - while(h--){ - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst += widthDst; - } - break; - } - break; - case 3: - switch(leftIndex){ - case 0: - while(h--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 1: - while(h--){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 2: - while(h--){ - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst += widthDst; - } - break; - } - break; - case 2: - while(h--){ - if(leftIndex){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - } - else{ - *pdst++ = piQxelArray[0]; - } - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - pdst--; - pdst += widthDst; - } - break; - case 1: /*only if leftIndex = 0 and w = 1*/ - while(h--){ - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - pdst += widthDst; - } - break; - case 0: /*never*/ - break; - default: - { - w = nmiddle; - pdstULC = pdst; -/* maskbits (pBox->x1, w, leftMask, rightMask, nmiddle);*/ - while(h--){ - nmiddle = w; - pdst = pdstULC; - switch(leftIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - break; - case 2: - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst++ = piQxelArray[2]; - break; - case 3: - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst++; - break; - } - while(nmiddle--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - } - switch(rightIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - break; - case 2: - *pdst++ = piQxelArray[0]; - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - break; - case 3: - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - break; - } - pdstULC += widthDst; - } - - } - } -#else - pdst += (pBox->x1 >> PWSH); - if ((pBox->x1 & PIM) + w <= PPW) - { - maskpartialbits(pBox->x1, w, leftMask); - while (h--) { - *pdst = (*pdst & ~leftMask) | (rrop_xor & leftMask); - pdst += widthDst; - } - } - else - { - maskbits (pBox->x1, w, leftMask, rightMask, nmiddle); - if (leftMask) - { - if (rightMask) - { - Expand (RROP_SOLID_MASK (pdst, leftMask); pdst++; , - RROP_SOLID_MASK (pdst, rightMask); , - 1) - } - else - { - Expand (RROP_SOLID_MASK (pdst, leftMask); pdst++;, - ;, - 1) - } - } - else - { - if (rightMask) - { - Expand (;, - RROP_SOLID_MASK (pdst, rightMask);, - 0) - } - else - { - Expand (;, - ;, - 0) - } - } - } -#endif -#if PSZ == 8 - } -#endif - } -} - -void -cfbFillBoxTile32 (pDrawable, nBox, pBox, tile) - DrawablePtr pDrawable; - int nBox; /* number of boxes to fill */ - BoxPtr pBox; /* pointer to list of boxes to fill */ - PixmapPtr tile; /* rotated, expanded tile */ -{ - register CfbBits *pdst; - CfbBits *psrc; - int tileHeight; - - int widthDst; - int w; - int h; - int nmiddle; - int y; - int srcy; - - CfbBits *pdstBase; -#if PSZ == 24 - int leftIndex, rightIndex; - CfbBits piQxelArray[3], *pdstULC; -#else - register CfbBits rrop_xor; - register CfbBits leftMask; - register CfbBits rightMask; - register int m; -#endif - - tileHeight = tile->drawable.height; - psrc = (CfbBits *)tile->devPrivate.ptr; - - cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase); - - while (nBox--) - { -#if PSZ == 24 - w = pBox->x2 - pBox->x1; - h = pBox->y2 - pBox->y1; - y = pBox->y1; - leftIndex = pBox->x1 & 3; -/* rightIndex = ((leftIndex+w)<5)?0:pBox->x2 &3;*/ - rightIndex = pBox->x2 &3; - nmiddle = w - rightIndex; - if(leftIndex){ - nmiddle -= (4 - leftIndex); - } - nmiddle >>= 2; - if(nmiddle < 0) - nmiddle = 0; - - pdst = pdstBase + ((pBox->x1 *3)>> 2) + pBox->y1 * widthDst; - srcy = y % tileHeight; - -#define StepTile piQxelArray[0] = (psrc[srcy] & 0xFFFFFF) | ((psrc[srcy] & 0xFF)<<24); \ - piQxelArray[1] = (psrc[srcy] & 0xFFFF00) | ((psrc[srcy] & 0xFFFF)<<16); \ - piQxelArray[2] = ((psrc[srcy] & 0xFF0000)>>16) | \ - ((psrc[srcy] & 0xFFFFFF)<<8); \ - /*rrop_xor = psrc[srcy];*/ \ - ++srcy; \ - if (srcy == tileHeight) \ - srcy = 0; - - switch(leftIndex+w){ - case 4: - switch(leftIndex){ - case 0: - while(h--){ - StepTile - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst-=2; - pdst += widthDst; - } - break; - case 1: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = piQxelArray[2]; - pdst-=2; - pdst += widthDst; - } - break; - case 2: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst-- = piQxelArray[2]; - pdst += widthDst; - } - break; - case 3: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst += widthDst; - } - break; - } - break; - case 3: - switch(leftIndex){ - case 0: - while(h--){ - StepTile - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 1: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst--; - pdst += widthDst; - } - break; - case 2: - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - pdst--; - pdst += widthDst; - } - break; - } - break; - case 2: - while(h--){ - StepTile - if(leftIndex){ - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - } - else{ - *pdst++ = piQxelArray[0]; - } - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - pdst--; - pdst += widthDst; - } - break; - case 1: /*only if leftIndex = 0 and w = 1*/ - while(h--){ - StepTile - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - pdst += widthDst; - } - break; - case 0: /*never*/ - break; - default: - { - w = nmiddle; - pdstULC = pdst; - - while(h--){ - StepTile - nmiddle = w; - pdst = pdstULC; - switch(leftIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFFFFFF) | (piQxelArray[0] & 0xFF000000); - pdst++; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - break; - case 2: - *pdst = ((*pdst) & 0xFFFF) | (piQxelArray[1] & 0xFFFF0000); - pdst++; - *pdst++ = piQxelArray[2]; - break; - case 3: - *pdst = ((*pdst) & 0xFF) | (piQxelArray[2] & 0xFFFFFF00); - pdst++; - break; - } - while(nmiddle--){ - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst++ = piQxelArray[2]; - } - switch(rightIndex){ - case 0: - break; - case 1: - *pdst = ((*pdst) & 0xFF000000) | (piQxelArray[0] & 0xFFFFFF); - break; - case 2: - *pdst++ = piQxelArray[0]; - *pdst = ((*pdst) & 0xFFFF0000) | (piQxelArray[1] & 0xFFFF); - break; - case 3: - *pdst++ = piQxelArray[0]; - *pdst++ = piQxelArray[1]; - *pdst = ((*pdst) & 0xFFFFFF00) | (piQxelArray[2] & 0xFF); - break; - } - pdstULC += widthDst; - } - } - } -#else - w = pBox->x2 - pBox->x1; - h = pBox->y2 - pBox->y1; - y = pBox->y1; - pdst = pdstBase + (pBox->y1 * widthDst) + (pBox->x1 >> PWSH); - srcy = y % tileHeight; - -#define StepTile rrop_xor = psrc[srcy]; \ - ++srcy; \ - if (srcy == tileHeight) \ - srcy = 0; - - if ( ((pBox->x1 & PIM) + w) < PPW) - { - maskpartialbits(pBox->x1, w, leftMask); - rightMask = ~leftMask; - while (h--) - { - StepTile - *pdst = (*pdst & rightMask) | (rrop_xor & leftMask); - pdst += widthDst; - } - } - else - { - maskbits(pBox->x1, w, leftMask, rightMask, nmiddle); - - if (leftMask) - { - if (rightMask) - { - Expand (StepTile - RROP_SOLID_MASK(pdst, leftMask); pdst++;, - RROP_SOLID_MASK(pdst, rightMask);, - 1) - } - else - { - Expand (StepTile - RROP_SOLID_MASK(pdst, leftMask); pdst++;, - ;, - 1) - } - } - else - { - if (rightMask) - { - Expand (StepTile - , - RROP_SOLID_MASK(pdst, rightMask);, - 0) - } - else - { - Expand (StepTile - , - ;, - 0) - } - } - } -#endif - pBox++; - } -} diff --git a/cfb/cfbscrinit.c b/cfb/cfbscrinit.c index 48e363971..6f9ba2e85 100644 --- a/cfb/cfbscrinit.c +++ b/cfb/cfbscrinit.c @@ -88,7 +88,7 @@ cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width) int dpix, dpiy; /* dots per inch */ int width; /* pixel width of frame buffer */ { - if (!cfbAllocatePrivates(pScreen, NULL, NULL)) + if (!cfbAllocatePrivates(pScreen, NULL)) return FALSE; pScreen->defColormap = FakeClientID(0); /* let CreateDefColormap do whatever it wants for pixels */ @@ -103,8 +103,6 @@ cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width) pScreen->ChangeWindowAttributes = cfbChangeWindowAttributes; pScreen->RealizeWindow = cfbMapWindow; pScreen->UnrealizeWindow = cfbUnmapWindow; - pScreen->PaintWindowBackground = cfbPaintWindow; - pScreen->PaintWindowBorder = cfbPaintWindow; pScreen->CopyWindow = cfbCopyWindow; pScreen->CreatePixmap = cfbCreatePixmap; pScreen->DestroyPixmap = cfbDestroyPixmap; diff --git a/cfb/cfbtile32.c b/cfb/cfbtile32.c index fb6a10613..90439adc3 100644 --- a/cfb/cfbtile32.c +++ b/cfb/cfbtile32.c @@ -1,5 +1,5 @@ /* - * Fill 32 bit tiled rectangles. Used by both PolyFillRect and PaintWindow. + * Fill 32 bit tiled rectangles. Used by PolyFillRect. * no depth dependencies. */ diff --git a/cfb/cfbunmap.h b/cfb/cfbunmap.h index 61c7fc942..d15c23e30 100644 --- a/cfb/cfbunmap.h +++ b/cfb/cfbunmap.h @@ -74,8 +74,6 @@ #undef cfbDoBitbltOr #undef cfbDoBitbltXor #undef cfbExpandDirectColors -#undef cfbFillBoxSolid -#undef cfbFillBoxTile32 #undef cfbFillBoxTile32sCopy #undef cfbFillBoxTile32sGeneral #undef cfbFillBoxTileOdd @@ -112,7 +110,6 @@ #undef cfbNonTEOps #undef cfbNonTEOps1Rect #undef cfbPadPixmap -#undef cfbPaintWindow #undef cfbPolyFillArcSolidCopy #undef cfbPolyFillArcSolidGeneral #undef cfbPolyFillRect diff --git a/cfb/cfbwindow.c b/cfb/cfbwindow.c index 49cc6f079..2b582d42f 100644 --- a/cfb/cfbwindow.c +++ b/cfb/cfbwindow.c @@ -60,19 +60,8 @@ SOFTWARE. #include "cfbmskbits.h" Bool -cfbCreateWindow(pWin) - WindowPtr pWin; +cfbCreateWindow(WindowPtr pWin) { - cfbPrivWin *pPrivWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - pPrivWin->pRotatedBorder = NullPixmap; - pPrivWin->pRotatedBackground = NullPixmap; - pPrivWin->fastBackground = FALSE; - pPrivWin->fastBorder = FALSE; - pPrivWin->oldRotate.x = 0; - pPrivWin->oldRotate.y = 0; - #ifdef PIXMAP_PER_WINDOW /* Setup pointer to Screen pixmap */ dixSetPrivate(&pWin->devPrivates, frameWindowPrivateKey, @@ -83,17 +72,8 @@ cfbCreateWindow(pWin) } Bool -cfbDestroyWindow(pWin) - WindowPtr pWin; +cfbDestroyWindow(WindowPtr pWin) { - cfbPrivWin *pPrivWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - - if (pPrivWin->pRotatedBorder) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder); - if (pPrivWin->pRotatedBackground) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground); return(TRUE); } @@ -105,47 +85,10 @@ cfbMapWindow(pWindow) return(TRUE); } -/* (x, y) is the upper left corner of the window on the screen - do we really need to pass this? (is it a;ready in pWin->absCorner?) - we only do the rotation for pixmaps that are 32 bits wide (padded -or otherwise.) - cfbChangeWindowAttributes() has already put a copy of the pixmap -in pPrivWin->pRotated* -*/ /*ARGSUSED*/ Bool -cfbPositionWindow(pWin, x, y) - WindowPtr pWin; - int x, y; +cfbPositionWindow(WindowPtr pWin, int x, int y) { - cfbPrivWin *pPrivWin; - int setxy = 0; - - pPrivWin = cfbGetWindowPrivate(pWin); - if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) - { - cfbXRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.y - pPrivWin->oldRotate.y); - setxy = 1; - } - - if (!pWin->borderIsPixel && pPrivWin->fastBorder) - { - while (pWin->backgroundState == ParentRelative) - pWin = pWin->parent; - cfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - setxy = 1; - } - if (setxy) - { - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } return (TRUE); } @@ -209,129 +152,9 @@ cfbCopyWindow(pWin, ptOldOrg, prgnSrc) REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); } - - -/* swap in correct PaintWindow* routine. If we can use a fast output -routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy -of it in devPrivates under cfbWindowPrivateKey. -*/ Bool -cfbChangeWindowAttributes(pWin, mask) - WindowPtr pWin; - unsigned long mask; +cfbChangeWindowAttributes(WindowPtr pWin, unsigned long mask) { - register unsigned long index; - register cfbPrivWin *pPrivWin; - int width; - WindowPtr pBgWin; - - pPrivWin = cfbGetWindowPrivate(pWin); - - /* - * When background state changes from ParentRelative and - * we had previously rotated the fast border pixmap to match - * the parent relative origin, rerotate to match window - */ - if (mask & (CWBackPixmap | CWBackPixel) && - pWin->backgroundState != ParentRelative && - pPrivWin->fastBorder && - (pPrivWin->oldRotate.x != pWin->drawable.x || - pPrivWin->oldRotate.y != pWin->drawable.y)) - { - cfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - while(mask) - { - index = lowbit (mask); - mask &= ~index; - switch(index) - { - case CWBackPixmap: - if (pWin->backgroundState == None) - { - pPrivWin->fastBackground = FALSE; - } - else if (pWin->backgroundState == ParentRelative) - { - pPrivWin->fastBackground = FALSE; - /* Rotate border to match parent origin */ - if (pPrivWin->pRotatedBorder) { - for (pBgWin = pWin->parent; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - cfbXRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.x - pPrivWin->oldRotate.x); - cfbYRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - } - else if (((width = (pWin->background.pixmap->drawable.width * PSZ)) - <= PGSZ) && !(width & (width - 1))) - { - cfbCopyRotatePixmap(pWin->background.pixmap, - &pPrivWin->pRotatedBackground, - pWin->drawable.x, - pWin->drawable.y); - if (pPrivWin->pRotatedBackground) - { - pPrivWin->fastBackground = TRUE; - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - else - { - pPrivWin->fastBackground = FALSE; - } - } - else - { - pPrivWin->fastBackground = FALSE; - } - break; - - case CWBackPixel: - pPrivWin->fastBackground = FALSE; - break; - - case CWBorderPixmap: - if (((width = (pWin->border.pixmap->drawable.width * PSZ)) <= PGSZ) && - !(width & (width - 1))) - { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - cfbCopyRotatePixmap(pWin->border.pixmap, - &pPrivWin->pRotatedBorder, - pBgWin->drawable.x, - pBgWin->drawable.y); - if (pPrivWin->pRotatedBorder) - { - pPrivWin->fastBorder = TRUE; - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - else - { - pPrivWin->fastBorder = FALSE; - } - } - else - { - pPrivWin->fastBorder = FALSE; - } - break; - case CWBorderPixel: - pPrivWin->fastBorder = FALSE; - break; - } - } return (TRUE); } diff --git a/composite/compalloc.c b/composite/compalloc.c index dbb7f3a05..4666ff01f 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -461,7 +461,6 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) ScreenPtr pScreen = pWin->drawable.pScreen; WindowPtr pParent = pWin->parent; PixmapPtr pPixmap; - GCPtr pGC; pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth); @@ -471,25 +470,63 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) pPixmap->screen_x = x; pPixmap->screen_y = y; - pGC = GetScratchGC (pWin->drawable.depth, pScreen); - - /* - * Copy bits from the parent into the new pixmap so that it will - * have "reasonable" contents in case for background None areas. - */ - if (pGC) + if (pParent->drawable.depth == pWin->drawable.depth) { - XID val = IncludeInferiors; + GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen); - ValidateGC(&pPixmap->drawable, pGC); - dixChangeGC (serverClient, pGC, GCSubwindowMode, &val, NULL); - (*pGC->ops->CopyArea) (&pParent->drawable, - &pPixmap->drawable, - pGC, - x - pParent->drawable.x, - y - pParent->drawable.y, - w, h, 0, 0); - FreeScratchGC (pGC); + /* + * Copy bits from the parent into the new pixmap so that it will + * have "reasonable" contents in case for background None areas. + */ + if (pGC) + { + XID val = IncludeInferiors; + + ValidateGC(&pPixmap->drawable, pGC); + dixChangeGC (serverClient, pGC, GCSubwindowMode, &val, NULL); + (*pGC->ops->CopyArea) (&pParent->drawable, + &pPixmap->drawable, + pGC, + x - pParent->drawable.x, + y - pParent->drawable.y, + w, h, 0, 0); + FreeScratchGC (pGC); + } + } + else + { + PictFormatPtr pSrcFormat = compWindowFormat (pParent); + PictFormatPtr pDstFormat = compWindowFormat (pWin); + XID inferiors = IncludeInferiors; + int error; + + PicturePtr pSrcPicture = CreatePicture (None, + &pParent->drawable, + pSrcFormat, + CPSubwindowMode, + &inferiors, + serverClient, &error); + + PicturePtr pDstPicture = CreatePicture (None, + &pPixmap->drawable, + pDstFormat, + 0, 0, + serverClient, &error); + + if (pSrcPicture && pDstPicture) + { + CompositePicture (PictOpSrc, + pSrcPicture, + NULL, + pDstPicture, + x - pParent->drawable.x, + y - pParent->drawable.y, + 0, 0, 0, 0, w, h); + } + if (pSrcPicture) + FreePicture (pSrcPicture, 0); + if (pDstPicture) + FreePicture (pDstPicture, 0); } return pPixmap; } diff --git a/composite/compinit.c b/composite/compinit.c index 757d92913..49b2044b0 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -69,7 +69,6 @@ compCloseScreen (int index, ScreenPtr pScreen) pScreen->ChangeBorderWidth = cs->ChangeBorderWidth; pScreen->ClipNotify = cs->ClipNotify; - pScreen->PaintWindowBackground = cs->PaintWindowBackground; pScreen->UnrealizeWindow = cs->UnrealizeWindow; pScreen->RealizeWindow = cs->RealizeWindow; pScreen->DestroyWindow = cs->DestroyWindow; @@ -411,9 +410,6 @@ compScreenInit (ScreenPtr pScreen) cs->UnrealizeWindow = pScreen->UnrealizeWindow; pScreen->UnrealizeWindow = compUnrealizeWindow; - cs->PaintWindowBackground = pScreen->PaintWindowBackground; - pScreen->PaintWindowBackground = compPaintWindowBackground; - cs->ClipNotify = pScreen->ClipNotify; pScreen->ClipNotify = compClipNotify; diff --git a/composite/compint.h b/composite/compint.h index 79699e4c1..4b0fe0834 100644 --- a/composite/compint.h +++ b/composite/compint.h @@ -124,7 +124,6 @@ typedef struct _CompScreen { DestroyWindowProcPtr DestroyWindow; RealizeWindowProcPtr RealizeWindow; UnrealizeWindowProcPtr UnrealizeWindow; - PaintWindowProcPtr PaintWindowBackground; ClipNotifyProcPtr ClipNotify; /* * Called from ConfigureWindow, these @@ -241,6 +240,9 @@ compCheckTree (ScreenPtr pScreen); #define compCheckTree(s) #endif +PictFormatPtr +compWindowFormat (WindowPtr pWin); + void compSetPixmap (WindowPtr pWin, PixmapPtr pPixmap); @@ -256,9 +258,6 @@ compRealizeWindow (WindowPtr pWin); Bool compUnrealizeWindow (WindowPtr pWin); -void -compPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what); - void compClipNotify (WindowPtr pWin, int dx, int dy); diff --git a/composite/compwindow.c b/composite/compwindow.c index a4c4e6f32..579236713 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -99,7 +99,7 @@ compRepaintBorder (ClientPtr pClient, pointer closure) REGION_NULL(pScreen, &exposed); REGION_SUBTRACT(pScreen, &exposed, &pWindow->borderClip, &pWindow->winSize); - (*pWindow->drawable.pScreen->PaintWindowBorder)(pWindow, &exposed, PW_BORDER); + miPaintWindow(pWindow, &exposed, PW_BORDER); REGION_UNINIT(pScreen, &exposed); } return TRUE; @@ -240,21 +240,6 @@ compUnrealizeWindow (WindowPtr pWin) return ret; } -void -compPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - CompSubwindowsPtr csw = GetCompSubwindows (pWin); - CompScreenPtr cs = GetCompScreen (pScreen); - - if (csw && csw->update == CompositeRedirectManual) - return; - pScreen->PaintWindowBackground = cs->PaintWindowBackground; - (*pScreen->PaintWindowBackground) (pWin, pRegion, what); - cs->PaintWindowBackground = pScreen->PaintWindowBackground; - pScreen->PaintWindowBackground = compPaintWindowBackground; -} - /* * Called after the borderClip for the window has settled down * We use this to make sure our extra borderClip has the right origin @@ -685,7 +670,7 @@ compGetWindowVisual (WindowPtr pWin) return 0; } -static PictFormatPtr +PictFormatPtr compWindowFormat (WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; diff --git a/config/dbus.c b/config/dbus.c index c6f4af0d5..c8675120f 100644 --- a/config/dbus.c +++ b/config/dbus.c @@ -74,11 +74,12 @@ add_device(DBusMessage *message, DBusMessage *reply, DBusError *error) int ret, err; DeviceIntPtr dev = NULL; + dbus_message_iter_init_append(reply, &reply_iter); + if (!dbus_message_iter_init(message, &iter)) { ErrorF("[config/dbus] couldn't initialise iterator\n"); - return BadAlloc; + MALFORMED_MESSAGE(); } - dbus_message_iter_init_append(reply, &reply_iter); options = xcalloc(sizeof(*options), 1); if (!options) { @@ -138,7 +139,7 @@ add_device(DBusMessage *message, DBusMessage *reply, DBusError *error) MALFORMED_MESSAGE(); options->value = xstrdup(tmp); if (!options->value) { - ErrorF("[config] couldn't duplicate option!\n"); + ErrorF("[config/dbus] couldn't duplicate option!\n"); ret = BadAlloc; goto unwind; } @@ -200,12 +201,13 @@ remove_device(DBusMessage *message, DBusMessage *reply, DBusError *error) DeviceIntPtr dev; DBusMessageIter iter, reply_iter; - if (!dbus_message_iter_init(message, &iter)) { - ErrorF("[config] failed to init iterator\n"); - return BadAlloc; - } dbus_message_iter_init_append(reply, &reply_iter); + if (!dbus_message_iter_init(message, &iter)) { + ErrorF("[config/dbus] failed to init iterator\n"); + MALFORMED_MESSAGE(); + } + if (!dbus_message_get_args(message, error, DBUS_TYPE_UINT32, &deviceid, DBUS_TYPE_INVALID)) { MALFORMED_MESSAGE_ERROR(); @@ -213,12 +215,12 @@ remove_device(DBusMessage *message, DBusMessage *reply, DBusError *error) dev = LookupDeviceIntRec(deviceid); if (!dev) { - DebugF("[config] bogus device id %d given\n", deviceid); + DebugF("[config/dbus] bogus device id %d given\n", deviceid); ret = BadMatch; goto unwind; } - DebugF("[config] removing device %s (id %d)\n", dev->name, deviceid); + DebugF("[config/dbus] removing device %s (id %d)\n", dev->name, deviceid); /* Call PIE here so we don't try to dereference a device that's * already been removed. */ diff --git a/configure.ac b/configure.ac index 43bc357e5..dd9d500f2 100644 --- a/configure.ac +++ b/configure.ac @@ -26,9 +26,7 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.57) -dnl This is the not the Xorg version number, it's the server version number. -dnl Yes, that's weird. -AC_INIT([xorg-server], 1.3.99.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +AC_INIT([xorg-server], 1.4.0.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([dist-bzip2 foreign]) AM_MAINTAINER_MODE @@ -97,6 +95,8 @@ AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h]) +AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], []) + dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"]) @@ -166,6 +166,9 @@ b = bswap16(a); fi fi +AC_CHECK_FUNC([dlopen], [], + AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl")) + dnl Checks for library functions. AC_FUNC_VPRINTF AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \ @@ -183,6 +186,7 @@ AC_CHECK_FUNC([getpeerucred], AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the 'getpeerucred' function.])) AC_CHECK_FUNC([strlcat], HAVE_STRLCAT=yes, HAVE_STRLCAT=no) AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno]) +AC_CHECK_FUNC([strlcpy], AC_DEFINE(HAS_STRLCPY, 1, [Have the 'strlcpy' function])) AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno]) @@ -371,14 +375,22 @@ case $host_os in esac AM_CONDITIONAL(KDRIVE_HW, test "x$KDRIVE_HW" = xyes) -DEFAULT_VENDOR_NAME="The X.Org Foundation" -DEFAULT_VENDOR_NAME_SHORT="X.Org" -DEFAULT_VERSION_MAJOR=7 -DEFAULT_VERSION_MINOR=2 -DEFAULT_VERSION_PATCH=0 -DEFAULT_VERSION_SNAP=0 -DEFAULT_RELEASE_DATE="21 December 2005" -DEFAULT_VENDOR_WEB="http://wiki.x.org" +XORG_RELEASE_VERSION +dnl augment XORG_RELEASE_VERSION for our snapshot number and to expose the +dnl major number +PVMAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1` +PVS=`echo $PACKAGE_VERSION | cut -d . -f 4` +if test "x$PVS" = "x"; then + PVS="0" +fi + +VENDOR_RELEASE="((($PVMAJOR) * 10000000) + (($PVM) * 100000) + (($PVP) * 1000) + $PVS)" +VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}" + +VENDOR_NAME="The X.Org Foundation" +VENDOR_NAME_SHORT="X.Org" +RELEASE_DATE="5 September 2007" +VENDOR_WEB="http://wiki.x.org" m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))]) @@ -394,36 +406,13 @@ AC_ARG_WITH(int10, AS_HELP_STRING([--with-int10=BACKEND], [int10 backe [INT10="$DEFAULT_INT10"]) AC_ARG_WITH(vendor-name, AS_HELP_STRING([--with-vendor-name=VENDOR], [Vendor string reported by the server]), - [ VENDOR_STRING="$withval" ], - [ VENDOR_STRING="$DEFAULT_VENDOR_NAME" ]) + [ VENDOR_NAME="$withval" ], []) AC_ARG_WITH(vendor-name-short, AS_HELP_STRING([--with-vendor-name-short=VENDOR], [Short version of vendor string reported by the server]), - [ VENDOR_STRING_SHORT="$withval" ], - [ VENDOR_STRING_SHORT="$DEFAULT_VENDOR_NAME_SHORT" ]) -AC_ARG_WITH(release-major, AS_HELP_STRING([--with-release-major=MAJOR], - [Release major number reported by the server]), - [ VERSION_MAJOR="$withval" ], - [ VERSION_MAJOR="$DEFAULT_VERSION_MAJOR" ]) -AC_ARG_WITH(release-minor, AS_HELP_STRING([--with-release-minor=MINOR], - [Release minor number reported by the server]), - [ VERSION_MINOR="$withval" ], - [ VERSION_MINOR="$DEFAULT_VERSION_MINOR" ]) -AC_ARG_WITH(release-patch, AS_HELP_STRING([--with-release-patch=PATCH], - [Release patch number reported by the server]), - [ VERSION_PATCH="$withval" ], - [ VERSION_PATCH="$DEFAULT_VERSION_PATCH" ]) -AC_ARG_WITH(release-snap, AS_HELP_STRING([--with-release-snap=SNAP], - [Release snap number reported by the server]), - [ VERSION_SNAP="$withval" ], - [ VERSION_SNAP="$DEFAULT_VERSION_SNAP" ]) -AC_ARG_WITH(release-date, AS_HELP_STRING([--with-release-date=DATE], - [Release date reported by the server]), - [ RELEASE_DATE="$withval" ], - [ RELEASE_DATE="$DEFAULT_RELEASE_DATE" ]) + [ VENDOR_NAME_SHORT="$withval" ], []) AC_ARG_WITH(vendor-web, AS_HELP_STRING([--with-vendor-web=URL], [Vendor web address reported by the server]), - [ VENDOR_WEB="$withval" ], - [ VENDOR_WEB="$DEFAULT_VENDOR_WEB" ]) + [ VENDOR_WEB="$withval" ], []) AC_ARG_WITH(module-dir, AS_HELP_STRING([--with-module-dir=DIR], [Directory where modules are installed (default: $libdir/xorg/modules)]), [ moduledir="$withval" ], @@ -538,6 +527,7 @@ AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: no)]), [DMX=$enableval], [DMX=no]) AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes]) AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto]) +AC_ARG_ENABLE(xdarwin, AS_HELP_STRING([--enable-xdarwin], [Build XDarwin server (default: auto)]), [XDARWIN=$enableval], [XDARWIN=auto]) AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto]) AC_ARG_ENABLE(xprint, AS_HELP_STRING([--enable-xprint], [Build Xprint extension and server (default: no)]), [XPRINT=$enableval], [XPRINT=no]) AC_ARG_ENABLE(xgl, AS_HELP_STRING([--enable-xgl], [Build Xgl server (default: no)]), [XGL=$enableval], [XGL=no]) @@ -625,13 +615,16 @@ XEXT_INC='-I$(top_srcdir)/Xext' XEXT_LIB='$(top_builddir)/Xext/libXext.la' XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la' -PIXMAN="[pixman-1 >= 0.9.5]" -PKG_CHECK_MODULES(PIXMAN, $PIXMAN) -AC_SUBST(PIXMAN_CFLAGS) - dnl Core modules for most extensions, et al. -REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto [xproto >= 7.0.9] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.2] [kbproto >= 1.0.3]" -REQUIRED_LIBS="xfont xau fontenc $PIXMAN" +# Require updated renderproto for ABI sanity if we're 64-bit. +if test "$ac_cv_sizeof_unsigned_long" = 8; then + RENDERPROTO="[renderproto >= 0.9.3]" +else + RENDERPROTO="renderproto" +fi + +REQUIRED_MODULES="[randrproto >= 1.2] $RENDERPROTO [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto [xproto >= 7.0.9] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4.2] [kbproto >= 1.0.3]" +REQUIRED_LIBS="xfont xau fontenc [pixman-1 >= 0.9.5]" dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas dnl CONFIG_DBUS_API is true if we want to enable the D-Bus config @@ -675,6 +668,49 @@ if test "x$NEED_DBUS" = xyes; then fi CONFIG_LIB='$(top_builddir)/config/libconfig.a' +AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes], + [AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt], + [have_clock_gettime=no])]) + +AC_MSG_CHECKING([for a useful monotonic clock ...]) + +if ! test "x$have_clock_gettime" = xno; then + if ! test "x$have_clock_gettime" = xyes; then + CLOCK_LIBS="$have_clock_gettime" + else + CLOCK_LIBS="" + fi + + LIBS_SAVE="$LIBS" + LIBS="$CLOCK_LIBS" + + AC_RUN_IFELSE([ +#define _POSIX_C_SOURCE 199309L +#include + +int main(int argc, char *argv[[]]) { + struct timespec tp; + + if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) + return 0; + else + return 1; +} + ], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no], + [MONOTONIC_CLOCK="cross compiling"]) + + LIBS="$LIBS_SAVE" +else + MONOTONIC_CLOCK=no +fi + +AC_MSG_RESULT([$MONOTONIC_CLOCK]) + +if test "x$MONOTONIC_CLOCK" = xyes; then + AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()]) + LIBS="$LIBS $CLOCK_LIBS" +fi + AM_CONDITIONAL(XV, [test "x$XV" = xyes]) if test "x$XV" = xyes; then AC_DEFINE(XV, 1, [Support Xv extension]) @@ -760,7 +796,7 @@ AM_CONDITIONAL(AIGLX, test "x$AIGLX" = xyes) if test "x$GLX_USE_TLS" = xyes -a "x$AIGLX" = xyes; then GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS" - GLX_LIBS="$GLX_LIBS -lpthread" + GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread" fi AC_SUBST([GLX_DEFINES]) @@ -969,29 +1005,13 @@ if test "x$USE_RGB_BUILTIN" = xyes; then AC_DEFINE(USE_RGB_BUILTIN, 1, [Use built-in RGB color database]) fi -VENDOR_RELEASE="((($VERSION_MAJOR) * 10000000) + (($VERSION_MINOR) * 100000) + (($VERSION_PATCH) * 1000) + $VERSION_SNAP)" - -if test $VERSION_SNAP = "0"; then - if test $VERSION_PATCH = "0"; then - VENDOR_VERSION_STRING="${VERSION_MAJOR}.${VERSION_MINOR}" - else - VENDOR_VERSION_STRING="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" - fi -else - VENDOR_VERSION_STRING="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_SNAP}" -fi - -VENDOR_RELEASE_STRING="Release ${VENDOR_VERSION_STRING}" -VENDOR_MAN_VERSION="Version ${VENDOR_VERSION_STRING}" - AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path]) AC_DEFINE_DIR(RGB_DB, RGBPATH, [Default RGB path]) AC_DEFINE_DIR(SERVERCONFIGdir, SERVERCONFIG, [Server config path]) AC_DEFINE_DIR(BASE_FONT_PATH, FONTDIR, [Default base font path]) AC_DEFINE_DIR(DRI_DRIVER_PATH, DRI_DRIVER_PATH, [Default DRI driver path]) -AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_STRING"], [Vendor name]) -AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_STRING_SHORT"], [Short vendor name]) -AC_DEFINE_UNQUOTED(XORG_RELEASE, ["$VENDOR_RELEASE_STRING"], [Vendor release]) +AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_NAME"], [Vendor name]) +AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_NAME_SHORT"], [Short vendor name]) AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release]) AC_DEFINE_UNQUOTED(XORG_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version]) AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address]) @@ -1004,8 +1024,8 @@ AC_DEFINE_UNQUOTED(OSNAME, ["$OSNAME"], [Operating System Name]) AC_DEFINE_UNQUOTED(OSVENDOR, ["$OSVENDOR"], [Operating System Vendor]) AC_DEFINE_UNQUOTED(BUILDERSTRING, ["$BUILDERSTRING"], [Builder string]) -AC_SUBST([VENDOR_STRING]) -AC_SUBST([VENDOR_STRING_SHORT]) +AC_SUBST([VENDOR_NAME]) +AC_SUBST([VENDOR_NAME_SHORT]) AC_SUBST([VENDOR_RELEASE]) AC_SUBST([VENDOR_MAN_VERSION]) @@ -1049,9 +1069,30 @@ CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include' PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS]) PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS]) +# Autotools has some unfortunate issues with library handling. In order to +# get a server to rebuild when a dependency in the tree is changed, it must +# be listed in SERVERNAME_DEPENDENCIES. However, no system libraries may be +# listed there, or some versions of autotols will break (especially if a -L +# is required to find the library). So, we keep two sets of libraries +# detected: NAMESPACE_LIBS for in-tree libraries to be linked against, which +# will go into the _DEPENDENCIES and _LDADD of the server, and +# NAMESPACE_SYS_LIBS which will go into only the _LDADD. The +# NAMESPACEMODULES_LIBS detected from pkgconfig should always go in +# NAMESPACE_SYS_LIBS. +# +# XSERVER_LIBS is the set of in-tree libraries which all servers require. +# XSERVER_SYS_LIBS is the set of out-of-tree libraries which all servers +# require. +# XSERVER_CFLAGS="${XSERVERCFLAGS_CFLAGS}" -XSERVER_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}" -AC_SUBST([SYS_LIBS]) +XSERVER_LIBS="$DIX_LIB $CONFIG_LIB $MI_LIB $OS_LIB" +XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}" +AC_SUBST([XSERVER_LIBS]) +AC_SUBST([XSERVER_SYS_LIBS]) + +if test "x$HAVE_LAUNCHD" = xyes; then + XSERVER_CFLAGS="$XSERVER_CFLAGS -DHAVE_LAUNCHD" +fi # The Xorg binary needs to export symbols so that they can be used from modules # Some platforms require extra flags to do this. gcc should set these flags @@ -1079,50 +1120,6 @@ case $host_os in esac AC_SUBST([LD_EXPORT_SYMBOLS_FLAG]) -AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes], - [AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt], - [have_clock_gettime=no])]) - -AC_MSG_CHECKING([for a useful monotonic clock ...]) - -if ! test "x$have_clock_gettime" = xno; then - if ! test "x$have_clock_gettime" = xyes; then - CLOCK_LIBS="$have_clock_gettime" - else - CLOCK_LIBS="" - fi - - LIBS_SAVE="$LIBS" - LIBS="$CLOCK_LIBS" - - AC_RUN_IFELSE([ -#define _POSIX_C_SOURCE 199309L -#include - -int main(int argc, char *argv[[]]) { - struct timespec tp; - - if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) - return 0; - else - return 1; -} - ], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no], - [MONOTONIC_CLOCK="cross compiling"]) - - LIBS="$LIBS_SAVE" -else - MONOTONIC_CLOCK=no -fi - -AC_MSG_RESULT([$MONOTONIC_CLOCK]) - -if test "x$MONOTONIC_CLOCK" = xyes; then - AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()]) - XSERVER_LIBS="$XSERVER_LIBS $CLOCK_LIBS" - LIBS="$LIBS $CLOCK_LIBS" -fi - dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so dnl we need to replicate that here until those can all be fixed AC_MSG_CHECKING([if SVR4 needs to be defined]) @@ -1149,8 +1146,6 @@ AH_VERBATIM([X_BYTE_ORDER],[ #endif ]) -AC_SUBST([XSERVER_LIBS]) - dnl --------------------------------------------------------------------------- dnl DDX section. dnl --------------------------------------------------------------------------- @@ -1158,7 +1153,7 @@ dnl --------------------------------------------------------------------------- dnl DMX DDX AC_MSG_CHECKING([whether to build Xdmx DDX]) -PKG_CHECK_MODULES([DMXMODULES], [xmuu xext x11 xrender xfixes xfont xi dmxproto xau $XDMCP_MODULES $PIXMAN], [have_dmx=yes], [have_dmx=no]) +PKG_CHECK_MODULES([DMXMODULES], [xmuu xext x11 xrender xfixes xfont xi dmxproto xau $XDMCP_MODULES], [have_dmx=yes], [have_dmx=no]) if test "x$DMX" = xauto; then DMX="$have_dmx" fi @@ -1171,8 +1166,12 @@ if test "x$DMX" = xyes; then modules not found.]) fi DMX_INCLUDES="$XEXT_INC $RENDER_INC $XTRAP_INC $RECORD_INC" - XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $CONFIG_LIB $RENDER_LIB $XTRAP_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $OS_LIB $CWRAP_LIB" + XDMX_CFLAGS="$DMXMODULES_CFLAGS" + XDMX_LIBS="$XEXT_LIB $FB_LIB $CONFIG_LIB $RENDER_LIB $XTRAP_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $CWRAP_LIB" + XDMX_SYS_LIBS="$DMXMODULES_LIBS" + AC_SUBST([XDMX_CFLAGS]) AC_SUBST([XDMX_LIBS]) + AC_SUBST([XDMX_SYS_LIBS]) dnl USB sources in DMX require AC_CHECK_HEADER([linux/input.h], DMX_BUILD_USB="yes", @@ -1210,8 +1209,10 @@ AC_MSG_RESULT([$XVFB]) AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes]) if test "x$XVFB" = xyes; then - XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS" + XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB" + XVFB_SYS_LIBS="$XVFBMODULES_LIBS" AC_SUBST([XVFB_LIBS]) + AC_SUBST([XVFB_SYS_LIBS]) fi @@ -1226,8 +1227,10 @@ AC_MSG_RESULT([$XNEST]) AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes]) if test "x$XNEST" = xyes; then - XNEST_LIBS="$MI_LIB $CONFIG_LIB $XSERVER_LIBS $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS" + XNEST_LIBS="$CONFIG_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB" + XNEST_SYS_LIBS="$XNESTMODULES_LIBS" AC_SUBST([XNEST_LIBS]) + AC_SUBST([XNEST_SYS_LIBS]) fi @@ -1238,6 +1241,7 @@ if test "x$XORG" = xauto; then XORG="yes" case $host_os in cygwin*) XORG="no" ;; + darwin*) XORG="no" ;; esac fi AC_MSG_RESULT([$XORG]) @@ -1248,14 +1252,15 @@ AC_MSG_CHECKING([whether to build Xgl DDX]) if test "x$XGL" != xno; then PKG_CHECK_MODULES([XGLMODULES], [glitz-glx >= 0.4.3], [XGL=yes], [XGL=no]) AC_SUBST(XGLMODULES_CFLAGS) - AC_SUBST(XGLMODULES_LIBS) fi AC_MSG_RESULT([$XGL]) AM_CONDITIONAL(XGL, [test "x$XGL" = xyes]) if test "x$XGL" = xyes; then - XGL_LIBS="$FB_LIB $MI_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB" + XGL_LIBS="$FB_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB" + XGL_SYS_LIBS="$XGLMODULES_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS" AC_SUBST([XGL_LIBS]) + AC_SUBST([XGL_SYS_LIBS]) AC_DEFINE(XGL_MODULAR, 1, [Use loadable XGL modules]) xglmoduledir="$moduledir/xgl" @@ -1269,14 +1274,15 @@ AC_MSG_CHECKING([whether to build Xegl DDX]) if test "x$XEGL" != xno; then PKG_CHECK_MODULES([XGLMODULES], [glitz-glx >= 0.4.3], [XEGL=yes], [XEGL=no]) AC_SUBST(XEGLMODULES_CFLAGS) - AC_SUBST(XEGLMODULES_LIBS) fi AC_MSG_RESULT([$XEGL]) AM_CONDITIONAL(XEGL, [test "x$XEGL" = xyes]) if test "x$XEGL" = xyes; then - XEGL_LIBS="$FB_LIB $MI_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB" + XEGL_LIBS="$FB_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB" + XEGL_SYS_LIBS = "$XEGL_SYS_LIBS $XEGLMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST([XEGL_LIBS]) + AC_SUBST([XEGL_SYS_LIBS]) fi dnl Xglx DDX @@ -1285,23 +1291,19 @@ AC_MSG_CHECKING([whether to build Xglx DDX]) if test "x$XGLX" != xno; then PKG_CHECK_MODULES([XGLXMODULES], [glitz-glx >= 0.4.3 xrender], [XGLX=yes], [XGLX=no]) AC_SUBST(XGLXMODULES_CFLAGS) - AC_SUBST(XGLXMODULES_LIBS) fi AC_MSG_RESULT([$XGLX]) AM_CONDITIONAL(XGLX, [test "x$XGLX" = xyes]) if test "x$XGLX" = xyes; then - XGLX_LIBS="$FB_LIB $MI_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB" + XGLX_LIBS="$FB_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB" + XGLX_SYS_LIBS="$XGLX_SYS_LIBS $XGLXMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST([XGLX_LIBS]) + AC_SUBST([XGLX_SYS_LIBS]) fi -# XORG_CORE_LIBS is needed even if you're not building the Xorg DDX -XORG_CORE_LIBS="$DIX_LIB $CONFIG_LIB" -AC_SUBST([XORG_CORE_LIBS]) - xorg_bus_linuxpci=no -xorg_bus_freebsdpci=no -xorg_bus_netbsdpci=no +xorg_bus_bsdpci=no xorg_bus_ix86pci=no xorg_bus_ppcpci=no xorg_bus_sparcpci=no @@ -1312,76 +1314,16 @@ if test "x$XORG" = xyes -o "x$XGL" = xyes; then XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os' XORG_INCS="$XORG_DDXINCS $XORG_OSINCS" XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H" - XORG_LIBS="$COMPOSITE_LIB $MI_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XPSTUBS_LIB $SELINUX_LIB $OS_LIB" + XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XPSTUBS_LIB $SELINUX_LIB" dnl Check to see if dlopen is in default libraries (like Solaris, which dnl has it in libc), or if libdl is needed to get it. - AC_CHECK_FUNC([dlopen], [], - AC_CHECK_LIB([dl], [dlopen], XORG_LIBS="$XORG_LIBS -ldl")) PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) - XSERVER_LIBS="$XSERVER_LIBS $PCIACCESS_LIBS" + XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS" XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" case $host_os in - darwin*) - XORG_OS="Darwin" - build_darwin=yes - if test "X$XQUARTZ" = Xauto; then - AC_CACHE_CHECK([for Carbon framework],xorg_cv_Carbon_framework,[ - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -framework Carbon" - AC_LINK_IFELSE([char FSFindFolder(); -int main() { -FSFindFolder(); -return 0;} - ],[xorg_cv_Carbon_framework=yes], - [xorg_cv_Carbon_framework=no]) - LDFLAGS=$save_LDFLAGS]) - if test "X$xorg_cv_Carbon_framework" = Xyes; then - AC_DEFINE([DARWIN_WITH_QUARTZ],[1], - [Have Quartz]) - XQUARTZ=yes - else - XQUARTZ=no - fi - fi -# glxAGL / glxCGL don't work yet -# AC_CACHE_CHECK([for AGL framework],xorg_cv_AGL_framework,[ -# save_LDFLAGS=$LDFLAGS -# LDFLAGS="$LDFLAGS -framework AGL" -# AC_LINK_IFELSE([char aglEnable(); -#int main() { -#aglEnable(); -#return 0;} -# ],[xorg_cv_AGL_framework=yes], -# [xorg_cv_AGL_framework=no]) -# LDFLAGS=$save_LDFLAGS -# ]) - xorg_cv_AGL_framework=no - DARWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB" - AC_SUBST([DARWIN_LIBS]) - AC_CHECK_LIB([Xplugin],[xp_init],[:]) - AC_SUBST([APPLE_APPLICATIONS_DIR]) - CFLAGS="${CFLAGS} -D__DARWIN__" - PLIST_VERSION_STRING=$VENDOR_VERSION_STRING - AC_SUBST([PLIST_VERSION_STRING]) - PLIST_VENDOR_WEB=$VENDOR_WEB - AC_SUBST([PLIST_VENDOR_WEB]) - # Not sure that we should be disabling all these... - if test "x$XF86MISC" = xyes || test "x$XF86MISC" = xauto; then - AC_MSG_NOTICE([Disabling XF86Misc extension]) - XF86MISC=no - fi - if test "x$XF86VIDMODE" = xyes || test "x$XF86VIDMODE" = xauto; then - AC_MSG_NOTICE([Disabling XF86VidMode extension]) - XF86VIDMODE=no - fi - if test "x$DGA" = xyes || test "x$DGA" = xauto; then - AC_MSG_NOTICE([Disabling DGA extension]) - DGA=no - fi - ;; linux*) if test "x$LNXAPM" = xyes; then XORG_CFLAGS="$XORG_CFLAGS -DXF86PM" @@ -1410,35 +1352,17 @@ return 0;} freebsd* | kfreebsd*-gnu) XORG_OS="freebsd" XORG_OS_SUBDIR="bsd" - case $host_cpu in - i*86) - ;; - *) - xorg_bus_freebsdpci="yes" - ;; - esac + xorg_bus_bsdpci="yes" ;; netbsd*) XORG_OS="netbsd" XORG_OS_SUBDIR="bsd" - case $host_cpu in - i*86|amd64*|x86_64*|ia64*) - ;; - *) - xorg_bus_netbsdpci="yes" - ;; - esac + xorg_bus_bsdpci="yes" ;; openbsd*) XORG_OS="openbsd" XORG_OS_SUBDIR="bsd" - case $host_cpu in - i*86|amd64*|x86_64*|ia64*) - ;; - *) - xorg_bus_freebsdpci="yes" - ;; - esac + xorg_bus_bsdpci="yes" ;; solaris*) XORG_OS="solaris" @@ -1508,6 +1432,7 @@ return 0;} i*86) case $host_os in darwin*) ;; + *bsd*) ;; *) xorg_bus_ix86pci=yes ;; esac ;; @@ -1526,8 +1451,7 @@ return 0;} ;; x86_64*|amd64*) case $host_os in - darwin*|freebsd*|kfreebsd*-gnu) - # FreeBSD uses the system pci interface + darwin*|*bsd*) ;; *) xorg_bus_ix86pci="yes" @@ -1570,10 +1494,11 @@ return 0;} if test -n "$XORG_MODULES"; then PKG_CHECK_MODULES(XORG_MODULES, [$XORG_MODULES]) XORG_CFLAGS="$XORG_CFLAGS $XORG_MODULES_CFLAGS" - XORG_LIBS="$XORG_LIBS $XORG_MODULES_LIBS" + XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS" fi AC_SUBST([XORG_LIBS]) + AC_SUBST([XORG_SYS_LIBS]) AC_SUBST([XORG_INCS]) AC_SUBST([XORG_OS]) AC_SUBST([XORG_OS_SUBDIR]) @@ -1621,8 +1546,7 @@ return 0;} fi AM_CONDITIONAL([XORG], [test "x$XORG" = xyes]) AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes]) -AM_CONDITIONAL([XORG_BUS_FREEBSDPCI], [test "x$xorg_bus_freebsdpci" = xyes]) -AM_CONDITIONAL([XORG_BUS_NETBSDPCI], [test "x$xorg_bus_netbsdpci" = xyes]) +AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes]) AM_CONDITIONAL([XORG_BUS_IX86PCI], [test "x$xorg_bus_ix86pci" = xyes]) AM_CONDITIONAL([XORG_BUS_PPCPCI], [test "x$xorg_bus_ppcpci" = xyes]) AM_CONDITIONAL([XORG_BUS_SPARCPCI], [test "x$xorg_bus_sparcpci" = xyes]) @@ -1633,8 +1557,6 @@ AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes]) AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes]) AM_CONDITIONAL([SOLARIS_USL_CONSOLE], [test "x$solaris_usl_console" = xyes]) AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes]) -AM_CONDITIONAL([BUILD_DARWIN],[test "X$build_darwin" = Xyes]) -AM_CONDITIONAL([XQUARTZ],[test "X$XQUARTZ" = Xyes]) AM_CONDITIONAL(DGA, [test "x$DGA" = xyes]) dnl legacy fb support @@ -1656,11 +1578,10 @@ AC_MSG_CHECKING([whether to build Xprint DDX]) AC_MSG_RESULT([$XPRINT]) if test "x$XPRINT" = xyes; then - PKG_CHECK_MODULES([XPRINT], [printproto x11 xfont $XDMCP_MODULES xau $PIXMAN]) - XPRINT_EXTENSIONS="$XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS" - XPRINT_LIBS="$DIX_LIB $XKB_LIB $XKB_STUB_LIB $XPRINT_EXTENSIONS $MI_LIB $MIEXT_DAMAGE_LIB $CWRAP_LIB $OS_LIB $LIBS $XPRINT_LIBS" - AC_SUBST([XPRINT_CFLAGS]) - AC_SUBST([XPRINT_LIBS]) + PKG_CHECK_MODULES([XPRINTMODULES], [printproto x11 xfont $XDMCP_MODULES xau]) + XPRINT_CFLAGS="$XPRINTMODULES_CFLAGS" + XPRINT_LIBS="$XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $RENDER_LIB $COMPOSITE_LIB $RANDR_LIB $XI_LIB $FIXES_LIB $DAMAGE_LIB $XI_LIB $GLX_LIBS $MIEXT_DAMAGE_LIB $CWRAP_LIBS $XKB_LIB $XKB_STUB_LIB" + XPRINT_SYS_LIBS="$XPRINTMODULES_LIBS" xpconfigdir=$libdir/X11/xserver AC_SUBST([xpconfigdir]) @@ -1696,10 +1617,13 @@ if test "x$XPRINT" = xyes; then FREETYPE_LIBS="" FREETYPE_REQUIRES="" fi - AC_SUBST(FREETYPE_LIBS) - AC_SUBST(FREETYPE_CFLAGS) - AC_SUBST(FREETYPE_REQUIRES) + XPRINT_CFLAGS="$XPRINT_CFLAGS $FREETYPE_CFLAGS" + XPRINT_SYS_LIBS="$XPRINT_SYS_LIBS $FREETYPE_LIBS" # end freetype support + + AC_SUBST([XPRINT_CFLAGS]) + AC_SUBST([XPRINT_LIBS]) + AC_SUBST([XPRINT_SYS_LIBS]) fi AM_CONDITIONAL(XP_USE_FREETYPE, [test "x$XPRINT" = xyes && test "x$XP_USE_FREETYPE" = xyes]) @@ -1713,7 +1637,7 @@ if test "x$XWIN" = xauto; then mingw*) XWIN="yes" ;; *) XWIN="no" ;; esac - XWIN_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $CONFIG_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $LAYER_LIB $XPSTUBS_LIB $OS_LIB $SHADOW_LIB" + XWIN_LIBS="$FB_LIB $XEXT_LIB $CONFIG_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $LAYER_LIB $XPSTUBS_LIB $SHADOW_LIB" AC_SUBST([XWIN_LIBS]) fi AC_MSG_RESULT([$XWIN]) @@ -1732,11 +1656,12 @@ if test "x$XWIN" = xyes; then XWIN_SERVER_NAME=Xming AC_DEFINE(RELOCATE_PROJECTROOT,1,[Make PROJECT_ROOT relative to the xserver location]) AC_DEFINE(HAS_WINSOCK,1,[Use Windows sockets]) - XWIN_SYSTEM_LIBS=-lwinsock2 + XWIN_SYS_LIBS=-lwinsock2 ;; esac + XWIN_SYS_LIBS="$XWIN_SYS_LIBS $(XWINMODULES_LIBS)" AC_SUBST(XWIN_SERVER_NAME) - AC_SUBST(XWIN_SYSTEM_LIBS) + AC_SUBST(XWIN_SYS_LIBS) if test "x$DEBUGGING" = xyes; then AC_DEFINE(CYGDEBUG, 1, [Simple debug messages]) @@ -1773,10 +1698,71 @@ AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes]) AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes]) dnl Darwin / OS X DDX -AM_CONDITIONAL(HAVE_X_PLUGIN, [test "x$ac_cv_lib_Xplugin_xp_init" = xyes]) -AM_CONDITIONAL(HAVE_AGL_FRAMEWORK, [test "x$xorg_cv_AGL_framework" = xyes]) -# Support for objc in autotools is minimal and not -# documented. +AC_MSG_CHECKING([whether to build XDarwin (Mac OS X) DDX]) +if test "x$XDARWIN" = xauto; then + case $host_os in + darwin*) XDARWIN="yes" ;; + *) XDARWIN="no" ;; + esac +fi +AC_MSG_RESULT([$XDARWIN]) + +if test "x$XDARWIN" = xyes; then + if test "X$XQUARTZ" = Xauto; then + AC_CACHE_CHECK([for Carbon framework],xorg_cv_Carbon_framework,[ + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -framework Carbon" + AC_LINK_IFELSE([char FSFindFolder(); +int main() { +FSFindFolder(); +return 0;} + ],[xorg_cv_Carbon_framework=yes], + [xorg_cv_Carbon_framework=no]) + LDFLAGS=$save_LDFLAGS]) + if test "X$xorg_cv_Carbon_framework" = Xyes; then + AC_DEFINE([DARWIN_WITH_QUARTZ],[1], + [Have Quartz]) + XQUARTZ=yes + else + XQUARTZ=no + fi + fi +# glxAGL / glxCGL don't work yet +# AC_CACHE_CHECK([for AGL framework],xorg_cv_AGL_framework,[ +# save_LDFLAGS=$LDFLAGS +# LDFLAGS="$LDFLAGS -framework AGL" +# AC_LINK_IFELSE([char aglEnable(); +#int main() { +#aglEnable(); +#return 0;} +# ],[xorg_cv_AGL_framework=yes], +# [xorg_cv_AGL_framework=no]) +# LDFLAGS=$save_LDFLAGS +# ]) + xorg_cv_AGL_framework=no + DARWIN_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB" + AC_SUBST([DARWIN_LIBS]) + AC_CHECK_LIB([Xplugin],[xp_init],[:]) + AC_SUBST([APPLE_APPLICATIONS_DIR]) + CFLAGS="${CFLAGS} -D__DARWIN__" + PLIST_VERSION_STRING=$PACKAGE_VERSION + AC_SUBST([PLIST_VERSION_STRING]) + PLIST_VENDOR_WEB=$VENDOR_WEB + AC_SUBST([PLIST_VENDOR_WEB]) + if test "x$XF86MISC" = xyes || test "x$XF86MISC" = xauto; then + AC_MSG_NOTICE([Disabling XF86Misc extension]) + XF86MISC=no + fi + if test "x$XF86VIDMODE" = xyes || test "x$XF86VIDMODE" = xauto; then + AC_MSG_NOTICE([Disabling XF86VidMode extension]) + XF86VIDMODE=no + fi + if test "x$DGA" = xyes || test "x$DGA" = xauto; then + AC_MSG_NOTICE([Disabling DGA extension]) + DGA=no + fi +fi +# Support for objc in autotools is minimal and not documented. OBJC='$(CC)' OBJCLD='$(CCLD)' OBJCLINK='$(LINK)' @@ -1787,7 +1773,10 @@ AC_SUBST([OBJCLINK]) AC_SUBST([OBJCFLAGS]) # internal, undocumented automake func follows :( _AM_DEPENDENCIES([OBJC]) - +AM_CONDITIONAL(HAVE_XPLUGIN, [test "x$ac_cv_lib_Xplugin_xp_init" = xyes]) +AM_CONDITIONAL(HAVE_AGL_FRAMEWORK, [test "x$xorg_cv_AGL_framework" = xyes]) +AM_CONDITIONAL(XDARWIN, [test "x$XDARWIN" = xyes]) +AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes]) dnl kdrive DDX XEPHYR_LIBS= @@ -1843,7 +1832,7 @@ if test "$KDRIVE" = yes; then if test x"$XSDL" = xyes; then # PKG_CHECK_MODULES(XSDL_EXTRA, Xfont xau $XDMCP_MODULES) AC_DEFINE(XSDLSERVER,1,[Build Xsdl server]) - XSDL_LIBS="`sdl-config --libs` $XSERVER_LIBS" + XSDL_LIBS="`sdl-config --libs`" XSDL_INCS="`sdl-config --cflags` $XSERVER_CFLAGS" fi @@ -1872,7 +1861,7 @@ if test "$KDRIVE" = yes; then KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS" - KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB" + KDRIVE_PURE_LIBS="$FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB" KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.a' case $host_os in *linux*) @@ -1881,8 +1870,10 @@ if test "$KDRIVE" = yes; then ;; esac KDRIVE_STUB_LIB='$(top_builddir)/hw/kdrive/src/libkdrivestubs.a' - KDRIVE_LOCAL_LIBS="$DIX_LIB $CONFIG_LIB $KDRIVE_LIB $TSLIB_LIBS $KDRIVE_OS_LIB $KDRIVE_PURE_LIBS $KDRIVE_STUB_LIB" - KDRIVE_LIBS="$XSERVERLIBS_LIBS $KDRIVE_LOCAL_LIBS" + KDRIVE_LOCAL_LIBS="$TSLIB_LIBS $DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB $CONFIG_LIB" + KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS" + KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB $OS_LIB" + KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVERLIBS_LIBS" # check if we can build Xephyr PKG_CHECK_MODULES(XEPHYR, x11 xext xfont xau xdmcp, [xephyr="yes"], [xephyr="no"]) @@ -1957,7 +1948,7 @@ AC_ARG_ENABLE(xorgcfg, AS_HELP_STRING([--enable-xorgcfg], if test x$XORGCFG = xyes ; then PKG_CHECK_MODULES([XORGCFG_DEP], [xkbui >= 1.0.2 xkbfile xxf86misc xxf86vm xaw7 xmu xt xpm xext x11]) - XORGCFG_DEP_CFLAGS="$XORGCFG_DEP_CFLAGS $PIXMAN_CFLAGS" + XORGCFG_DEP_CFLAGS="$XORGCFG_DEP_CFLAGS" AC_CHECK_LIB([curses],[waddstr], [XORGCFG_DEP_LIBS="$XORGCFG_DEP_LIBS -lcurses"; CURSES=yes], AC_CHECK_LIB([ncurses],[waddstr], @@ -2009,9 +2000,6 @@ AC_SUBST([libdir exec_prefix prefix]) # Man page sections - used in config utils & generating man pages XORG_MANPAGE_SECTIONS -# XORG in this case refers to the roll-up releases, not the Xorg DDX. -XORG_RELEASE_VERSION - AC_OUTPUT([ Makefile GL/Makefile diff --git a/dix/Makefile.am b/dix/Makefile.am index 1004255dd..827243a71 100644 --- a/dix/Makefile.am +++ b/dix/Makefile.am @@ -1,7 +1,7 @@ noinst_LTLIBRARIES = libdix.la libxpstubs.la AM_CFLAGS = $(DIX_CFLAGS) \ - -DVENDOR_STRING=\""@VENDOR_STRING@"\" \ + -DVENDOR_NAME=\""@VENDOR_NAME@"\" \ -DVENDOR_RELEASE="@VENDOR_RELEASE@" libdix_la_SOURCES = \ diff --git a/dix/devices.c b/dix/devices.c index dfbd2bfd8..3c2aad867 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -854,6 +854,7 @@ InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, CARD8 pModifiers else bzero((char *)keyc->modifierMap, MAP_LENGTH); bzero((char *)keyc->down, DOWN_LENGTH); + bzero((char *)keyc->postdown, DOWN_LENGTH); for (i = 0; i < 8; i++) keyc->modifierKeyCount[i] = 0; if (!SetKeySymsMap(&keyc->curKeySyms, pKeySyms) || !InitModMap(keyc)) diff --git a/dix/getevents.c b/dix/getevents.c index a12bcfd78..d6b10ff1c 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -80,6 +80,23 @@ GetMotionHistorySize(void) return MOTION_HISTORY_SIZE; } +static void +set_key_down(DeviceIntPtr pDev, int key_code) +{ + pDev->key->postdown[key_code >> 3] |= (1 << (key_code & 7)); +} + +static void +set_key_up(DeviceIntPtr pDev, int key_code) +{ + pDev->key->postdown[key_code >> 3] &= ~(1 << (key_code & 7)); +} + +static Bool +key_is_down(DeviceIntPtr pDev, int key_code) +{ + return pDev->key->postdown[key_code >> 3] >> (key_code & 7); +} /** * Allocate the motion history buffer. @@ -414,17 +431,15 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type, case XK_Shift_Lock: if (type == KeyRelease) return 0; - else if (type == KeyPress && - (pDev->key->down[key_code >> 3] & (key_code & 7)) & 1) - type = KeyRelease; + else if (type == KeyPress && key_is_down(pDev, key_code)) + type = KeyRelease; } } /* Handle core repeating, via press/release/press/release. * FIXME: In theory, if you're repeating with two keyboards in non-XKB, * you could get unbalanced events here. */ - if (type == KeyPress && - (((pDev->key->down[key_code >> 3] & (key_code & 7))) & 1)) { + if (type == KeyPress && key_is_down(pDev, key_code)) { if (!pDev->kbdfeed->ctrl.autoRepeat || pDev->key->modifierMap[key_code] || !(pDev->kbdfeed->ctrl.autoRepeats[key_code >> 3] @@ -449,6 +464,10 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type, events->u.keyButtonPointer.time = ms; events->u.u.type = type; events->u.u.detail = key_code; + if (type == KeyPress) + set_key_down(inputInfo.keyboard, key_code); + else if (type == KeyRelease) + set_key_up(inputInfo.keyboard, key_code); events++; } @@ -456,10 +475,14 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type, kbp->time = ms; kbp->deviceid = pDev->id; kbp->detail = key_code; - if (type == KeyPress) + if (type == KeyPress) { kbp->type = DeviceKeyPress; - else if (type == KeyRelease) + set_key_down(pDev, key_code); + } + else if (type == KeyRelease) { kbp->type = DeviceKeyRelease; + set_key_up(pDev, key_code); + } events++; if (num_valuators) { diff --git a/dix/main.c b/dix/main.c index 7f7bfa539..03e0013e8 100644 --- a/dix/main.c +++ b/dix/main.c @@ -499,7 +499,7 @@ main(int argc, char *argv[], char *envp[]) } static int VendorRelease = VENDOR_RELEASE; -static char *VendorString = VENDOR_STRING; +static char *VendorString = VENDOR_NAME; void SetVendorRelease(int release) diff --git a/dix/window.c b/dix/window.c index 6c6531958..597ad2ef3 100644 --- a/dix/window.c +++ b/dix/window.c @@ -1494,7 +1494,7 @@ PatchUp: REGION_NULL(pScreen, &exposed); REGION_SUBTRACT(pScreen, &exposed, &pWin->borderClip, &pWin->winSize); - (*pWin->drawable.pScreen->PaintWindowBorder)(pWin, &exposed, PW_BORDER); + miPaintWindow(pWin, &exposed, PW_BORDER); REGION_UNINIT(pScreen, &exposed); } return error; diff --git a/doc/Xserver.man.pre b/doc/Xserver.man.pre index aac3b51c3..c9ee019c6 100644 --- a/doc/Xserver.man.pre +++ b/doc/Xserver.man.pre @@ -508,8 +508,7 @@ its parent process after it has set up the various connection schemes. \fIXdm\fP uses this feature to recognize when connecting to the server is possible. .SH FONTS -The X server -can obtain fonts from directories and/or from font servers. +The X server can obtain fonts from directories and/or from font servers. The list of directories and font servers the X server uses when trying to open a font is controlled by the \fIfont path\fP. @@ -517,8 +516,45 @@ by the \fIfont path\fP. The default font path is __default_font_path__ . .LP +A special kind of directory can be specified using the the \fBcatalogue\fP: +prefix. Directories specified this way can contain symlinks pointing to the +real font directories. See the FONTPATH.D section for details. +.LP The font path can be set with the \fB\-fp\fP option or by \fIxset\fP(1) after the server has started. +.SH "FONTPATH.D" +You can specify a special kind of font path in the form \fBcatalogue:\fR. +The directory specified after the catalogue: prefix will be scanned for symlinks +and each symlink destination will be added as a local fontfile FPE. +.PP +The symlink can be suffixed by attributes such as '\fBunscaled\fR', which +will be passed through to the underlying fontfile FPE. The only exception is +the newly introduced '\fBpri\fR' attribute, which will be used for ordering +the font paths specified by the symlinks. + +An example configuration: + +.nf + 75dpi:unscaled:pri=20 \-> /usr/share/X11/fonts/75dpi + ghostscript:pri=60 \-> /usr/share/fonts/default/ghostscript + misc:unscaled:pri=10 \-> /usr/share/X11/fonts/misc + type1:pri=40 \-> /usr/share/X11/fonts/Type1 + type1:pri=50 \-> /usr/share/fonts/default/Type1 +.fi + +This will add /usr/share/X11/fonts/misc as the first FPE with the attribute +'unscaled', second FPE will be /usr/share/X11/fonts/75dpi, also with +the attribute unscaled etc. This is functionally equivalent to setting +the following font path: + +.nf + /usr/share/X11/fonts/misc:unscaled, + /usr/share/X11/fonts/75dpi:unscaled, + /usr/share/X11/fonts/Type1, + /usr/share/fonts/default/Type1, + /usr/share/fonts/default/ghostscript +.fi + .SH FILES .TP 30 .I /etc/X\fBn\fP.hosts diff --git a/exa/exa.c b/exa/exa.c index 4260cbade..8f219fbdf 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -43,6 +43,17 @@ DevPrivateKey exaScreenPrivateKey = &exaScreenPrivateKey; DevPrivateKey exaPixmapPrivateKey = &exaPixmapPrivateKey; +static _X_INLINE void* +ExaGetPixmapAddress(PixmapPtr p) +{ + ExaPixmapPriv(p); + + if (pExaPixmap->offscreen && pExaPixmap->fb_ptr) + return pExaPixmap->fb_ptr; + else + return pExaPixmap->sys_ptr; +} + /** * exaGetPixmapOffset() returns the offset (in bytes) within the framebuffer of * the beginning of the given pixmap. @@ -57,16 +68,9 @@ unsigned long exaGetPixmapOffset(PixmapPtr pPix) { ExaScreenPriv (pPix->drawable.pScreen); - ExaPixmapPriv (pPix); - void *ptr; - /* Return the offscreen pointer if we've hidden the data. */ - if (pPix->devPrivate.ptr == NULL) - ptr = pExaPixmap->fb_ptr; - else - ptr = pPix->devPrivate.ptr; - - return ((unsigned long)ptr - (unsigned long)pExaScr->info->memoryBase); + return ((unsigned long)ExaGetPixmapAddress(pPix) - + (unsigned long)pExaScr->info->memoryBase); } /** @@ -185,7 +189,8 @@ exaDestroyPixmap (PixmapPtr pPixmap) pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr; pPixmap->devKind = pExaPixmap->sys_pitch; } - REGION_UNINIT(pPixmap->drawable.pScreen, &pExaPixmap->validReg); + REGION_UNINIT(pPixmap->drawable.pScreen, &pExaPixmap->validSys); + REGION_UNINIT(pPixmap->drawable.pScreen, &pExaPixmap->validFB); } return fbDestroyPixmap (pPixmap); } @@ -239,6 +244,9 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr; pExaPixmap->sys_pitch = pPixmap->devKind; + pPixmap->devPrivate.ptr = NULL; + pExaPixmap->offscreen = FALSE; + pExaPixmap->fb_ptr = NULL; if (pExaScr->info->flags & EXA_OFFSCREEN_ALIGN_POT && w != 1) pExaPixmap->fb_pitch = (1 << (exaLog2(w - 1) + 1)) * bpp / 8; @@ -266,11 +274,33 @@ exaCreatePixmap(ScreenPtr pScreen, int w, int h, int depth) DamageSetReportAfterOp (pExaPixmap->pDamage, TRUE); /* None of the pixmap bits are valid initially */ - REGION_NULL(pScreen, &pExaPixmap->validReg); + REGION_NULL(pScreen, &pExaPixmap->validSys); + REGION_NULL(pScreen, &pExaPixmap->validFB); return pPixmap; } +static Bool +exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, + int bitsPerPixel, int devKind, pointer pPixData) +{ + ExaScreenPrivPtr pExaScr; + ExaPixmapPrivPtr pExaPixmap; + + if (!pPixmap) + return FALSE; + + pExaPixmap = ExaGetPixmapPriv(pPixmap); + + if (pExaPixmap) + pExaPixmap->sys_ptr = pPixData; + + pExaScr = ExaGetScreenPriv(pPixmap->drawable.pScreen); + + return pExaScr->SavedModifyPixmapHeader(pPixmap, width, height, depth, + bitsPerPixel, devKind, pPixData); +} + /** * exaPixmapIsOffscreen() is used to determine if a pixmap is in offscreen * memory, meaning that acceleration could probably be done to it, and that it @@ -288,18 +318,25 @@ exaPixmapIsOffscreen(PixmapPtr p) { ScreenPtr pScreen = p->drawable.pScreen; ExaScreenPriv(pScreen); + ExaPixmapPriv(p); + void *save_ptr; + Bool ret; - /* If the devPrivate.ptr is NULL, it's offscreen but we've hidden the data. - */ - if (p->devPrivate.ptr == NULL) - return TRUE; + save_ptr = p->devPrivate.ptr; + + if (!save_ptr && pExaPixmap) + p->devPrivate.ptr = ExaGetPixmapAddress(p); if (pExaScr->info->PixmapIsOffscreen) - return pExaScr->info->PixmapIsOffscreen(p); + ret = pExaScr->info->PixmapIsOffscreen(p); + else + ret = ((unsigned long) ((CARD8 *) p->devPrivate.ptr - + (CARD8 *) pExaScr->info->memoryBase) < + pExaScr->info->memorySize); - return ((unsigned long) ((CARD8 *) p->devPrivate.ptr - - (CARD8 *) pExaScr->info->memoryBase) < - pExaScr->info->memorySize); + p->devPrivate.ptr = save_ptr; + + return ret; } /** @@ -328,33 +365,24 @@ exaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp) return NULL; } -/** - * exaPrepareAccess() is EXA's wrapper for the driver's PrepareAccess() handler. - * - * It deals with waiting for synchronization with the card, determining if - * PrepareAccess() is necessary, and working around PrepareAccess() failure. - */ void -exaPrepareAccess(DrawablePtr pDrawable, int index) +ExaDoPrepareAccess(DrawablePtr pDrawable, int index) { ScreenPtr pScreen = pDrawable->pScreen; ExaScreenPriv (pScreen); - PixmapPtr pPixmap; - - pPixmap = exaGetDrawablePixmap (pDrawable); - - if (exaPixmapIsOffscreen (pPixmap)) - exaWaitSync (pDrawable->pScreen); - else - return; + PixmapPtr pPixmap = exaGetDrawablePixmap (pDrawable); + Bool offscreen = exaPixmapIsOffscreen(pPixmap); /* Unhide pixmap pointer */ if (pPixmap->devPrivate.ptr == NULL) { - ExaPixmapPriv (pPixmap); - - pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr; + pPixmap->devPrivate.ptr = ExaGetPixmapAddress(pPixmap); } + if (!offscreen) + return; + + exaWaitSync (pDrawable->pScreen); + if (pExaScr->info->PrepareAccess == NULL) return; @@ -366,6 +394,33 @@ exaPrepareAccess(DrawablePtr pDrawable, int index) } } +void +exaPrepareAccessReg(DrawablePtr pDrawable, int index, RegionPtr pReg) +{ + ExaMigrationRec pixmaps[1]; + + pixmaps[0].as_dst = index == EXA_PREPARE_DEST; + pixmaps[0].as_src = index != EXA_PREPARE_DEST; + pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); + pixmaps[0].pReg = pReg; + + exaDoMigration(pixmaps, 1, FALSE); + + ExaDoPrepareAccess(pDrawable, index); +} + +/** + * exaPrepareAccess() is EXA's wrapper for the driver's PrepareAccess() handler. + * + * It deals with waiting for synchronization with the card, determining if + * PrepareAccess() is necessary, and working around PrepareAccess() failure. + */ +void +exaPrepareAccess(DrawablePtr pDrawable, int index) +{ + exaPrepareAccessReg(pDrawable, index, NULL); +} + /** * exaFinishAccess() is EXA's wrapper for the driver's FinishAccess() handler. * @@ -376,18 +431,13 @@ exaFinishAccess(DrawablePtr pDrawable, int index) { ScreenPtr pScreen = pDrawable->pScreen; ExaScreenPriv (pScreen); - PixmapPtr pPixmap; - ExaPixmapPrivPtr pExaPixmap; - - pPixmap = exaGetDrawablePixmap (pDrawable); - - pExaPixmap = ExaGetPixmapPriv(pPixmap); + PixmapPtr pPixmap = exaGetDrawablePixmap (pDrawable); + ExaPixmapPriv (pPixmap); /* Rehide pixmap pointer if we're doing that. */ - if (pExaPixmap != NULL && pExaScr->hideOffscreenPixmapData && - pExaPixmap->fb_ptr == pPixmap->devPrivate.ptr) + if (pExaPixmap) { - pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr; + pPixmap->devPrivate.ptr = NULL; } if (pExaScr->info->FinishAccess == NULL) @@ -451,11 +501,9 @@ exaValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) if (!pGC->tileIsPixel && FbEvenTile (pGC->tile.pixmap->drawable.width * pDrawable->bitsPerPixel)) { - /* XXX This fixes corruption with tiled pixmaps, but may just be a - * workaround for broken drivers - */ - exaMoveOutPixmap(pGC->tile.pixmap); + exaPrepareAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC); fbPadPixmap (pGC->tile.pixmap); + exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC); exaPixmapDirty(pGC->tile.pixmap, 0, 0, pGC->tile.pixmap->drawable.width, pGC->tile.pixmap->drawable.height); @@ -466,7 +514,9 @@ exaValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) changes &= ~GCTile; } + exaPrepareAccessGC(pGC); fbValidateGC (pGC, changes, pDrawable); + exaFinishAccessGC(pGC); pGC->ops = (GCOps *) &exaOps; } @@ -496,6 +546,47 @@ exaCreateGC (GCPtr pGC) return TRUE; } +void +exaPrepareAccessWindow(WindowPtr pWin) +{ + if (pWin->backgroundState == BackgroundPixmap) + exaPrepareAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); + + if (pWin->borderIsPixel == FALSE) + exaPrepareAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_SRC); +} + +void +exaFinishAccessWindow(WindowPtr pWin) +{ + if (pWin->backgroundState == BackgroundPixmap) + exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); + + if (pWin->borderIsPixel == FALSE) + exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_SRC); +} + +static Bool +exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask) +{ + Bool ret; + + exaPrepareAccessWindow(pWin); + ret = fbChangeWindowAttributes(pWin, mask); + exaFinishAccessWindow(pWin); + return ret; +} + +static RegionPtr +exaBitmapToRegion(PixmapPtr pPix) +{ + RegionPtr ret; + exaPrepareAccess(&pPix->drawable, EXA_PREPARE_SRC); + ret = fbPixmapToRegion(pPix); + exaFinishAccess(&pPix->drawable, EXA_PREPARE_SRC); + return ret; +} + /** * exaCloseScreen() unwraps its wrapped screen functions and tears down EXA's * screen private, before calling down to the next CloseSccreen. @@ -512,11 +603,11 @@ exaCloseScreen(int i, ScreenPtr pScreen) pScreen->CloseScreen = pExaScr->SavedCloseScreen; pScreen->GetImage = pExaScr->SavedGetImage; pScreen->GetSpans = pExaScr->SavedGetSpans; - pScreen->PaintWindowBackground = pExaScr->SavedPaintWindowBackground; - pScreen->PaintWindowBorder = pExaScr->SavedPaintWindowBorder; pScreen->CreatePixmap = pExaScr->SavedCreatePixmap; pScreen->DestroyPixmap = pExaScr->SavedDestroyPixmap; pScreen->CopyWindow = pExaScr->SavedCopyWindow; + pScreen->ChangeWindowAttributes = pExaScr->SavedChangeWindowAttributes; + pScreen->BitmapToRegion = pExaScr->SavedBitmapToRegion; #ifdef RENDER if (ps) { ps->Composite = pExaScr->SavedComposite; @@ -648,27 +739,24 @@ exaDriverInit (ScreenPtr pScreen, pScreen->GetImage = exaGetImage; pExaScr->SavedGetSpans = pScreen->GetSpans; - pScreen->GetSpans = exaGetSpans; + pScreen->GetSpans = ExaCheckGetSpans; pExaScr->SavedCopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = exaCopyWindow; - pExaScr->SavedPaintWindowBackground = pScreen->PaintWindowBackground; - pScreen->PaintWindowBackground = exaPaintWindow; + pExaScr->SavedChangeWindowAttributes = pScreen->ChangeWindowAttributes; + pScreen->ChangeWindowAttributes = exaChangeWindowAttributes; - pExaScr->SavedPaintWindowBorder = pScreen->PaintWindowBorder; - pScreen->PaintWindowBorder = exaPaintWindow; + pExaScr->SavedBitmapToRegion = pScreen->BitmapToRegion; + pScreen->BitmapToRegion = exaBitmapToRegion; #ifdef RENDER if (ps) { pExaScr->SavedComposite = ps->Composite; ps->Composite = exaComposite; - pExaScr->SavedRasterizeTrapezoid = ps->RasterizeTrapezoid; - ps->RasterizeTrapezoid = exaRasterizeTrapezoid; - - pExaScr->SavedAddTriangles = ps->AddTriangles; - ps->AddTriangles = exaAddTriangles; + pExaScr->SavedTriangles = ps->Triangles; + ps->Triangles = exaTriangles; pExaScr->SavedGlyphs = ps->Glyphs; ps->Glyphs = exaGlyphs; @@ -703,6 +791,8 @@ exaDriverInit (ScreenPtr pScreen, pExaScr->SavedDestroyPixmap = pScreen->DestroyPixmap; pScreen->DestroyPixmap = exaDestroyPixmap; + pExaScr->SavedModifyPixmapHeader = pScreen->ModifyPixmapHeader; + pScreen->ModifyPixmapHeader = exaModifyPixmapHeader; LogMessage(X_INFO, "EXA(%d): Offscreen pixmap area of %d bytes\n", pScreen->myNum, pExaScr->info->memorySize - pExaScr->info->offScreenBase); diff --git a/exa/exa_accel.c b/exa/exa_accel.c index feedd49a2..2acade263 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -55,13 +55,13 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable); + pixmaps[0].pReg = NULL; if (pExaScr->swappedOut || pGC->fillStyle != FillSolid || pPixmap->drawable.width > pExaScr->info->maxX || pPixmap->drawable.height > pExaScr->info->maxY) { - exaDoMigration (pixmaps, 1, FALSE); ExaCheckFillSpans (pDrawable, pGC, n, ppt, pwidth, fSorted); return; } else { @@ -74,7 +74,6 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, pGC->planemask, pGC->fgPixel)) { - exaDoMigration (pixmaps, 1, FALSE); ExaCheckFillSpans (pDrawable, pGC, n, ppt, pwidth, fSorted); return; } @@ -140,10 +139,11 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, static Bool exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, - int w, int h, int leftPad, int format, char *bits, int src_stride) + int w, int h, int format, char *bits, int src_stride) { ExaScreenPriv (pDrawable->pScreen); - PixmapPtr pPix; + PixmapPtr pPix = exaGetDrawablePixmap (pDrawable); + ExaPixmapPriv(pPix); ExaMigrationRec pixmaps[1]; RegionPtr pClip; BoxPtr pbox; @@ -152,25 +152,28 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int bpp = pDrawable->bitsPerPixel; Bool access_prepared = FALSE; - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = FALSE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); - /* Don't bother with under 8bpp, XYPixmaps. */ if (format != ZPixmap || bpp < 8) - goto migrate_and_fallback; + return FALSE; /* Only accelerate copies: no rop or planemask. */ if (!EXA_PM_IS_SOLID(pDrawable, pGC->planemask) || pGC->alu != GXcopy) - goto migrate_and_fallback; + return FALSE; if (pExaScr->swappedOut) - goto fallback; + return FALSE; + pixmaps[0].as_dst = TRUE; + pixmaps[0].as_src = FALSE; + pixmaps[0].pPix = pPix; + pixmaps[0].pReg = DamagePendingRegion(pExaPixmap->pDamage); exaDoMigration (pixmaps, 1, TRUE); pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); + if (!pPix || !pExaScr->info->UploadToScreen) + return FALSE; + x += pDrawable->x; y += pDrawable->y; @@ -199,10 +202,8 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, continue; src = bits + (y1 - y) * src_stride + (x1 - x) * (bpp / 8); - ok = (pPix && pExaScr->info->UploadToScreen) ? - pExaScr->info->UploadToScreen(pPix, x1 + xoff, y1 + yoff, - x2 - x1, y2 - y1, src, src_stride) : - FALSE; + ok = pExaScr->info->UploadToScreen(pPix, x1 + xoff, y1 + yoff, + x2 - x1, y2 - y1, src, src_stride); /* If we fail to accelerate the upload, fall back to using unaccelerated * fb calls. */ @@ -213,7 +214,7 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int dstXoff, dstYoff; if (!access_prepared) { - exaPrepareAccess(pDrawable, EXA_PREPARE_DEST); + ExaDoPrepareAccess(pDrawable, EXA_PREPARE_DEST); access_prepared = TRUE; } @@ -231,54 +232,118 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, y2 - y1, GXcopy, FB_ALLONES, dstBpp); } - - if (access_prepared) - exaFinishAccess(pDrawable, EXA_PREPARE_DEST); - - exaPixmapDirty(pixmaps[0].pPix, x1 + xoff, y1 + yoff, x2 + xoff, y2 + yoff); } + if (access_prepared) + exaFinishAccess(pDrawable, EXA_PREPARE_DEST); + else + exaMarkSync(pDrawable->pScreen); + return TRUE; - -migrate_and_fallback: - exaDoMigration (pixmaps, 1, FALSE); - -fallback: - return FALSE; -} - -static void -exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, - int w, int h, int leftPad, int format, char *bits) -{ - if (!exaDoPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits, - PixmapBytePad(w, pDrawable->depth))) - ExaCheckPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, - bits); } #ifdef MITSHM -static void +static Bool +exaDoShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, + unsigned int format, int w, int h, int sx, int sy, int sw, + int sh, int dx, int dy, char *data) +{ + int src_stride = PixmapBytePad(w, depth); + + if (exaDoPutImage(pDrawable, pGC, depth, dx, dy, sw, sh, format, data + + sy * src_stride + sx * BitsPerPixel(depth) / 8, + src_stride)) + return TRUE; + + if (format == ZPixmap) + { + PixmapPtr pPixmap; + + pPixmap = GetScratchPixmapHeader(pDrawable->pScreen, w, h, depth, + BitsPerPixel(depth), PixmapBytePad(w, depth), (pointer)data); + if (!pPixmap) + return FALSE; + + if (exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle, + pGC->alu)) + exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + else + ExaDoPrepareAccess (pDrawable, EXA_PREPARE_DEST); + fbCopyArea((DrawablePtr)pPixmap, pDrawable, pGC, sx, sy, sw, sh, dx, dy); + exaFinishAccess(pDrawable, EXA_PREPARE_DEST); + + FreeScratchPixmapHeader(pPixmap); + + return TRUE; + } + + return FALSE; +} + +/* The actual ShmPutImage isn't wrapped by the damage layer, so we need to + * inform any interested parties of the damage incurred to the drawable. + * + * We also need to set the pending damage to ensure correct migration in all + * cases. + */ +void exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format, int w, int h, int sx, int sy, int sw, int sh, int dx, int dy, char *data) { - int src_stride = PixmapBytePad(w, depth); + PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); + ExaPixmapPriv(pPixmap); + BoxRec box = { .x1 = pDrawable->x + dx, .y1 = pDrawable->y + dy, + .x2 = pDrawable->x + dx + sw, .y2 = pDrawable->y + dy + sh }; + RegionRec region; + int xoff, yoff; + RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); - if (exaDoPutImage(pDrawable, pGC, depth, dx, dy, sw, sh, 0, format, data + - sy * src_stride + sx * BitsPerPixel(depth) / 8, - src_stride)) - return; + REGION_INIT(pScreen, ®ion, &box, 1); - fbShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, - data); + exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); + + REGION_TRANSLATE(pScreen, ®ion, xoff, yoff); + REGION_UNION(pScreen, pending_damage, pending_damage, ®ion); + + if (!exaDoShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh, + dx, dy, data)) { + if (exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle, + pGC->alu)) + exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + else + ExaDoPrepareAccess (pDrawable, EXA_PREPARE_DEST); + fbShmPutImage(pDrawable, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, + data); + exaFinishAccess(pDrawable, EXA_PREPARE_DEST); + } + + REGION_TRANSLATE(pScreen, ®ion, -xoff, -yoff); + DamageDamageRegion(pDrawable, ®ion); + + REGION_UNINIT(pScreen, ®ion); } ShmFuncs exaShmFuncs = { NULL, exaShmPutImage }; #endif +static void +exaPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, + int w, int h, int leftPad, int format, char *bits) +{ +#ifdef MITSHM + if (!exaDoShmPutImage(pDrawable, pGC, depth, format, w, h, 0, 0, w, h, x, y, + bits)) +#else + if (!exaDoPutImage(pDrawable, pGC, depth, x, y, w, h, format, bits, + PixmapBytePad(w, pDrawable->depth))) +#endif + ExaCheckPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, + bits); +} + static Bool inline exaCopyNtoNTwoDir (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, BoxPtr pbox, int nbox, int dx, int dy) @@ -393,8 +458,6 @@ exaCopyNtoNTwoDir (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, dst_off_y + pbox->y1 + i, pbox->x2 - pbox->x1, 1); } - exaPixmapDirty(pDstPixmap, dst_off_x + pbox->x1, dst_off_y + pbox->y1, - dst_off_x + pbox->x2, dst_off_y + pbox->y2); } if (dirsetup != 0) pExaScr->info->DoneCopy(pDstPixmap); @@ -420,14 +483,49 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, int src_off_x, src_off_y; int dst_off_x, dst_off_y; ExaMigrationRec pixmaps[2]; - Bool fallback = FALSE; + RegionPtr region = NULL; + + pSrcPixmap = exaGetDrawablePixmap (pSrcDrawable); + pDstPixmap = exaGetDrawablePixmap (pDstDrawable); + + exaGetDrawableDeltas (pSrcDrawable, pSrcPixmap, &src_off_x, &src_off_y); + exaGetDrawableDeltas (pDstDrawable, pDstPixmap, &dst_off_x, &dst_off_y); + + if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask, + pGC->fillStyle, pGC->alu)) { + xRectangle *rects = ALLOCATE_LOCAL(nbox * sizeof(xRectangle)); + + if (rects) { + int i; + + for (i = 0; i < nbox; i++) { + rects[i].x = pbox[i].x1 + dst_off_x; + rects[i].y = pbox[i].y1 + dst_off_y; + rects[i].width = pbox[i].x2 - pbox[i].x1; + rects[i].height = pbox[i].y2 - pbox[i].y1; + } + + region = RECTS_TO_REGION(pScreen, nbox, rects, CT_YXBANDED); + DEALLOCATE_LOCAL(rects); + + if (region) { + src_off_x -= dst_off_x; + src_off_y -= dst_off_y; + dst_off_x = dst_off_y = 0; + pbox = REGION_RECTS(region); + nbox = REGION_NUM_RECTS(region); + } + } + } pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; - pixmaps[0].pPix = pDstPixmap = exaGetDrawablePixmap (pDstDrawable); + pixmaps[0].pPix = pDstPixmap; + pixmaps[0].pReg = region; pixmaps[1].as_dst = FALSE; pixmaps[1].as_src = TRUE; - pixmaps[1].pPix = pSrcPixmap = exaGetDrawablePixmap (pSrcDrawable); + pixmaps[1].pPix = pSrcPixmap; + pixmaps[1].pReg = NULL; /* Respect maxX/maxY in a trivial way: don't set up drawing when we might * violate the limits. The proper solution would be a temporary pixmap @@ -438,64 +536,60 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, pDstPixmap->drawable.width > pExaScr->info->maxX || pDstPixmap->drawable.height > pExaScr->info->maxY) { - fallback = TRUE; + goto fallback; } else { exaDoMigration (pixmaps, 2, TRUE); } /* Mixed directions must be handled specially if the card is lame */ - if (!fallback && (pExaScr->info->flags & EXA_TWO_BITBLT_DIRECTIONS) && + if ((pExaScr->info->flags & EXA_TWO_BITBLT_DIRECTIONS) && reverse != upsidedown) { if (exaCopyNtoNTwoDir(pSrcDrawable, pDstDrawable, pGC, pbox, nbox, dx, dy)) - return; - fallback = TRUE; + goto out; + goto fallback; } - pSrcPixmap = exaGetDrawablePixmap (pSrcDrawable); - pDstPixmap = exaGetDrawablePixmap (pDstDrawable); - - exaGetDrawableDeltas (pSrcDrawable, pSrcPixmap, &src_off_x, &src_off_y); - exaGetDrawableDeltas (pDstDrawable, pDstPixmap, &dst_off_x, &dst_off_y); - - if (fallback || !exaPixmapIsOffscreen(pSrcPixmap) || + if (!exaPixmapIsOffscreen(pSrcPixmap) || !exaPixmapIsOffscreen(pDstPixmap) || !(*pExaScr->info->PrepareCopy) (pSrcPixmap, pDstPixmap, reverse ? -1 : 1, upsidedown ? -1 : 1, pGC ? pGC->alu : GXcopy, pGC ? pGC->planemask : FB_ALLONES)) { - fallback = TRUE; - EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable, - exaDrawableLocation(pSrcDrawable), - exaDrawableLocation(pDstDrawable))); - exaDoMigration (pixmaps, 2, FALSE); - exaPrepareAccess (pDstDrawable, EXA_PREPARE_DEST); - exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); - fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, - pbox, nbox, dx, dy, reverse, upsidedown, - bitplane, closure); - exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC); - exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST); + goto fallback; } while (nbox--) { - if (!fallback) - (*pExaScr->info->Copy) (pDstPixmap, - pbox->x1 + dx + src_off_x, - pbox->y1 + dy + src_off_y, - pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, - pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); - exaPixmapDirty (pDstPixmap, pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, - pbox->x2 + dst_off_x, pbox->y2 + dst_off_y); + (*pExaScr->info->Copy) (pDstPixmap, + pbox->x1 + dx + src_off_x, + pbox->y1 + dy + src_off_y, + pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, + pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); pbox++; } - if (fallback) - return; - (*pExaScr->info->DoneCopy) (pDstPixmap); exaMarkSync (pDstDrawable->pScreen); + + goto out; + +fallback: + EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrcDrawable, pDstDrawable, + exaDrawableLocation(pSrcDrawable), + exaDrawableLocation(pDstDrawable))); + exaPrepareAccessReg (pDstDrawable, EXA_PREPARE_DEST, region); + exaPrepareAccess (pSrcDrawable, EXA_PREPARE_SRC); + fbCopyNtoN (pSrcDrawable, pDstDrawable, pGC, pbox, nbox, dx, dy, reverse, + upsidedown, bitplane, closure); + exaFinishAccess (pSrcDrawable, EXA_PREPARE_SRC); + exaFinishAccess (pDstDrawable, EXA_PREPARE_DEST); + +out: + if (region) { + REGION_UNINIT(pScreen, region); + REGION_DESTROY(pScreen, region); + } } RegionPtr @@ -688,7 +782,8 @@ exaPolyFillRect(DrawablePtr pDrawable, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap; - + pixmaps[0].pReg = NULL; + exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); if (pExaScr->swappedOut || @@ -731,15 +826,6 @@ exaPolyFillRect(DrawablePtr pDrawable, pGC->fgPixel)) { fallback: - if (pGC->fillStyle == FillTiled && !pGC->tileIsPixel) { - pixmaps[1].as_dst = FALSE; - pixmaps[1].as_src = TRUE; - pixmaps[1].pPix = pGC->tile.pixmap; - exaDoMigration (pixmaps, 2, FALSE); - } else { - exaDoMigration (pixmaps, 1, FALSE); - } - ExaCheckPolyFillRect (pDrawable, pGC, nrect, prect); goto out; } @@ -818,100 +904,10 @@ fallback: exaMarkSync(pDrawable->pScreen); out: + REGION_UNINIT(pScreen, pReg); REGION_DESTROY(pScreen, pReg); } -static void -exaSolidBoxClipped (DrawablePtr pDrawable, - RegionPtr pClip, - FbBits pm, - FbBits fg, - int x1, - int y1, - int x2, - int y2) -{ - ExaScreenPriv (pDrawable->pScreen); - PixmapPtr pPixmap; - BoxPtr pbox; - int nbox; - int xoff, yoff; - int partX1, partX2, partY1, partY2; - ExaMigrationRec pixmaps[1]; - Bool fallback = FALSE; - - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = FALSE; - pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable); - - if (pExaScr->swappedOut || - pPixmap->drawable.width > pExaScr->info->maxX || - pPixmap->drawable.height > pExaScr->info->maxY) - { - fallback = TRUE; - } else { - exaDoMigration (pixmaps, 1, TRUE); - } - - exaGetDrawableDeltas (pDrawable, pPixmap, &xoff, &yoff); - - if (fallback || !exaPixmapIsOffscreen(pPixmap) || - !(*pExaScr->info->PrepareSolid) (pPixmap, GXcopy, pm, fg)) - { - EXA_FALLBACK(("to %p (%c)\n", pDrawable, - exaDrawableLocation(pDrawable))); - exaDoMigration (pixmaps, 1, FALSE); - fallback = TRUE; - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); - fg = fbReplicatePixel (fg, pDrawable->bitsPerPixel); - fbSolidBoxClipped (pDrawable, pClip, x1, y1, x2, y2, - fbAnd (GXcopy, fg, pm), - fbXor (GXcopy, fg, pm)); - exaFinishAccess (pDrawable, EXA_PREPARE_DEST); - } - for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip); - nbox--; - pbox++) - { - partX1 = pbox->x1; - if (partX1 < x1) - partX1 = x1; - - partX2 = pbox->x2; - if (partX2 > x2) - partX2 = x2; - - if (partX2 <= partX1) - continue; - - partY1 = pbox->y1; - if (partY1 < y1) - partY1 = y1; - - partY2 = pbox->y2; - if (partY2 > y2) - partY2 = y2; - - if (partY2 <= partY1) - continue; - - if (!fallback) { - (*pExaScr->info->Solid) (pPixmap, - partX1 + xoff, partY1 + yoff, - partX2 + xoff, partY2 + yoff); - } - - exaPixmapDirty (pPixmap, partX1 + xoff, partY1 + yoff, partX2 + xoff, - partY2 + yoff); - } - - if (fallback) - return; - - (*pExaScr->info->DoneSolid) (pPixmap); - exaMarkSync(pDrawable->pScreen); -} - static void exaImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC, @@ -928,7 +924,6 @@ exaImageGlyphBlt (DrawablePtr pDrawable, int gWidth, gHeight; /* width and height of glyph */ FbStride gStride; /* stride of glyph */ Bool opaque; - int n; int gx, gy; void (*glyph) (FbBits *, FbStride, @@ -942,37 +937,33 @@ exaImageGlyphBlt (DrawablePtr pDrawable, int dstBpp; int dstXoff, dstYoff; FbBits depthMask; + Bool fallback; PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); + ExaPixmapPriv(pPixmap); ExaMigrationRec pixmaps[1]; - int xBack, widthBack, yBack, heightBack; + RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); + BoxRec extents = *REGION_EXTENTS(pScreen, pending_damage); + int xoff, yoff; - for (ppci = ppciInit, n = nglyph, widthBack = 0; n; n--) - widthBack += (*ppci++)->metrics.characterWidth; - - xBack = x; - if (widthBack < 0) - { - xBack += widthBack; - widthBack = -widthBack; - } - yBack = y - FONTASCENT(pGC->font); - heightBack = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font); - - if (xBack >= pDrawable->width || yBack >= pDrawable->height || - (xBack + widthBack) <= 0 || (yBack + heightBack) <= 0) + if (extents.x1 >= extents.x2 || extents.y1 >= extents.y2) return; - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = pPixmap; - depthMask = FbFullMask(pDrawable->depth); - if ((pGC->planemask & depthMask) != depthMask) + fallback = (pGC->planemask & depthMask) != depthMask; + + pixmaps[0].as_dst = TRUE; + pixmaps[0].as_src = FALSE; + pixmaps[0].pPix = pPixmap; + pixmaps[0].pReg = fallback ? NULL : pending_damage; + + exaDoMigration(pixmaps, 1, FALSE); + + if (fallback) { - exaDoMigration(pixmaps, 1, FALSE); ExaCheckImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppciInit, pglyphBase); - goto damage; + return; } + glyph = NULL; switch (pDrawable->bitsPerPixel) { case 8: glyph = fbGlyph8; break; @@ -983,8 +974,14 @@ exaImageGlyphBlt (DrawablePtr pDrawable, x += pDrawable->x; y += pDrawable->y; - xBack += pDrawable->x; - yBack += pDrawable->y; + + exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); + extents.x1 -= xoff; + extents.x2 -= xoff; + extents.y1 -= yoff; + extents.y2 -= yoff; + + exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); if (TERMINALFONT (pGC->font) && !glyph) { @@ -992,20 +989,22 @@ exaImageGlyphBlt (DrawablePtr pDrawable, } else { - exaSolidBoxClipped (pDrawable, - fbGetCompositeClip(pGC), - pGC->planemask, - pGC->bgPixel, - xBack, - yBack, - xBack + widthBack, - yBack + heightBack); + FbBits fg = fbReplicatePixel (pGC->bgPixel, pDrawable->bitsPerPixel); + + fbSolidBoxClipped (pDrawable, + fbGetCompositeClip(pGC), + extents.x1, + extents.y1, + extents.x2, + extents.y2, + fbAnd (GXcopy, fg, pGC->planemask), + fbXor (GXcopy, fg, pGC->planemask)); + opaque = FALSE; } EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); - exaDoMigration(pixmaps, 1, FALSE); - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + exaPrepareAccessGC (pGC); fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); @@ -1018,9 +1017,9 @@ exaImageGlyphBlt (DrawablePtr pDrawable, gx = x + pci->metrics.leftSideBearing; gy = y - pci->metrics.ascent; - if (!gWidth || !gHeight || (gx + gWidth) <= xBack || - (gy + gHeight) <= yBack || gx >= (xBack + widthBack) || - gy >= (yBack + heightBack)) + if (!gWidth || !gHeight || (gx + gWidth) <= extents.x1 || + (gy + gHeight) <= extents.y1 || gx >= extents.x2 || + gy >= extents.y2) continue; pglyph = FONTGLYPHBITS(pglyphBase, pci); @@ -1043,11 +1042,6 @@ exaImageGlyphBlt (DrawablePtr pDrawable, } exaFinishAccessGC (pGC); exaFinishAccess (pDrawable, EXA_PREPARE_DEST); - -damage: - exaGetDrawableDeltas(pDrawable, pPixmap, &dstXoff, &dstYoff); - exaPixmapDirty(pPixmap, xBack + dstXoff, yBack + dstYoff, - xBack + dstXoff + widthBack, yBack + dstYoff + heightBack); } const GCOps exaOps = { @@ -1111,13 +1105,16 @@ exaFillRegionSolid (DrawablePtr pDrawable, PixmapPtr pPixmap; int xoff, yoff; ExaMigrationRec pixmaps[1]; - int nbox = REGION_NUM_RECTS (pRegion); - BoxPtr pBox = REGION_RECTS (pRegion); pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable); - + pixmaps[0].pReg = exaGCReadsDestination(pDrawable, planemask, FillSolid, + alu) ? NULL : pRegion; + + exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); + REGION_TRANSLATE(pScreen, pRegion, xoff, yoff); + if (pPixmap->drawable.width > pExaScr->info->maxX || pPixmap->drawable.height > pExaScr->info->maxY) { @@ -1129,29 +1126,56 @@ exaFillRegionSolid (DrawablePtr pDrawable, if ((pPixmap = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff)) && (*pExaScr->info->PrepareSolid) (pPixmap, alu, planemask, pixel)) { + int nbox; + BoxPtr pBox; + + nbox = REGION_NUM_RECTS (pRegion); + pBox = REGION_RECTS (pRegion); + while (nbox--) { - (*pExaScr->info->Solid) (pPixmap, - pBox->x1 + xoff, pBox->y1 + yoff, - pBox->x2 + xoff, pBox->y2 + yoff); + (*pExaScr->info->Solid) (pPixmap, pBox->x1, pBox->y1, pBox->x2, + pBox->y2); pBox++; } (*pExaScr->info->DoneSolid) (pPixmap); exaMarkSync(pDrawable->pScreen); + + if (pDrawable->width == 1 && pDrawable->height == 1 && + pDrawable->bitsPerPixel != 24) { + ExaPixmapPriv(pPixmap); + + switch (pDrawable->bitsPerPixel) { + case 32: + *(CARD32*)pExaPixmap->sys_ptr = pixel; + break; + case 16: + *(CARD16*)pExaPixmap->sys_ptr = pixel; + break; + case 8: + *(CARD8*)pExaPixmap->sys_ptr = pixel; + } + + REGION_UNION(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys, + pRegion); + } + + REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); + return TRUE; } - else - { + fallback: - if (alu != GXcopy || planemask != FB_ALLONES) - return FALSE; - EXA_FALLBACK(("to %p (%c)\n", pDrawable, - exaDrawableLocation(pDrawable))); - exaDoMigration (pixmaps, 1, FALSE); - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); - fbFillRegionSolid (pDrawable, pRegion, 0, - fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); - exaFinishAccess (pDrawable, EXA_PREPARE_DEST); + if (alu != GXcopy || !EXA_PM_IS_SOLID(pDrawable, planemask)) { + REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); + return FALSE; } + EXA_FALLBACK(("to %p (%c)\n", pDrawable, + exaDrawableLocation(pDrawable))); + exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); + REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); + fbFillRegionSolid (pDrawable, pRegion, 0, + fbReplicatePixel (pixel, pDrawable->bitsPerPixel)); + exaFinishAccess (pDrawable, EXA_PREPARE_DEST); return TRUE; } @@ -1189,9 +1213,15 @@ exaFillRegionTiled (DrawablePtr pDrawable, pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable); + pixmaps[0].pReg = exaGCReadsDestination(pDrawable, planemask, FillTiled, + alu) ? NULL : pRegion; pixmaps[1].as_dst = FALSE; pixmaps[1].as_src = TRUE; pixmaps[1].pPix = pTile; + pixmaps[1].pReg = NULL; + + exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); + REGION_TRANSLATE(pScreen, pRegion, xoff, yoff); if (pPixmap->drawable.width > pExaScr->info->maxX || pPixmap->drawable.height > pExaScr->info->maxY || @@ -1221,7 +1251,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, int dstY = pBox->y1; int tileY; - tileY = (dstY - pDrawable->y - pPatOrg->y) % tileHeight; + tileY = (dstY - yoff - pDrawable->y - pPatOrg->y) % tileHeight; while (height > 0) { int width = pBox->x2 - pBox->x1; int dstX = pBox->x1; @@ -1232,7 +1262,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, h = height; height -= h; - tileX = (dstX - pDrawable->x - pPatOrg->x) % tileWidth; + tileX = (dstX - xoff - pDrawable->x - pPatOrg->x) % tileWidth; while (width > 0) { int w = tileWidth - tileX; if (w > width) @@ -1241,8 +1271,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, (*pExaScr->info->Copy) (pPixmap, tileX + tileXoff, tileY + tileYoff, - dstX + xoff, dstY + yoff, - w, h); + dstX, dstY, w, h); dstX += w; tileX = 0; } @@ -1253,17 +1282,20 @@ exaFillRegionTiled (DrawablePtr pDrawable, } (*pExaScr->info->DoneCopy) (pPixmap); exaMarkSync(pDrawable->pScreen); + REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); return TRUE; } fallback: - if (alu != GXcopy || planemask != FB_ALLONES) + if (alu != GXcopy || !EXA_PM_IS_SOLID(pDrawable, planemask)) { + REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); return FALSE; + } EXA_FALLBACK(("from %p to %p (%c,%c)\n", pTile, pDrawable, exaDrawableLocation(&pTile->drawable), exaDrawableLocation(pDrawable))); - exaDoMigration (pixmaps, 2, FALSE); - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pixmaps[0].pReg); + REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); exaPrepareAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC); fbFillRegionTiled (pDrawable, pRegion, pTile); exaFinishAccess ((DrawablePtr)pTile, EXA_PREPARE_SRC); @@ -1272,77 +1304,13 @@ fallback: return TRUE; } -void -exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - ExaScreenPriv (pWin->drawable.pScreen); - PixmapPtr pPixmap = exaGetDrawablePixmap((DrawablePtr)pWin); - int xoff, yoff; - BoxPtr pBox; - int nbox = REGION_NUM_RECTS(pRegion); - - if (!nbox) - return; - - if (!pExaScr->swappedOut) { - DDXPointRec zeros = { 0, 0 }; - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixel: - exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->background.pixel, - FB_ALLONES, GXcopy); - goto damage; - case BackgroundPixmap: - exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->background.pixmap, - &zeros, FB_ALLONES, GXcopy); - goto damage; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) { - exaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->border.pixel, - FB_ALLONES, GXcopy); - goto damage; - } else { - exaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->border.pixmap, - &zeros, FB_ALLONES, GXcopy); - goto damage; - } - break; - } - } - ExaCheckPaintWindow (pWin, pRegion, what); - -damage: - exaGetDrawableDeltas((DrawablePtr)pWin, pPixmap, &xoff, &yoff); - - pBox = REGION_RECTS(pRegion); - - while (nbox--) - { - exaPixmapDirty (pPixmap, pBox->x1 + xoff, pBox->y1 + yoff, - pBox->x2 + xoff, pBox->y2 + yoff); - pBox++; - } -} /** * Accelerates GetImage for solid ZPixmap downloads from framebuffer memory. * * This is probably the only case we actually care about. The rest fall through - * to migration and ExaCheckGetImage, which hopefully will result in migration - * pushing the pixmap out of framebuffer. + * to migration and fbGetImage, which hopefully will result in migration pushing + * the pixmap out of framebuffer. */ void exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, @@ -1350,63 +1318,62 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, { ExaScreenPriv (pDrawable->pScreen); ExaMigrationRec pixmaps[1]; + BoxRec Box; + RegionRec Reg; PixmapPtr pPix; int xoff, yoff; Bool ok; - if (pExaScr->swappedOut || (w == 1 && h == 1)) + pixmaps[0].as_dst = FALSE; + pixmaps[0].as_src = TRUE; + pixmaps[0].pPix = pPix = exaGetDrawablePixmap (pDrawable); + pixmaps[0].pReg = &Reg; + + exaGetDrawableDeltas (pDrawable, pPix, &xoff, &yoff); + + Box.x1 = pDrawable->y + x + xoff; + Box.y1 = pDrawable->y + y + yoff; + Box.x2 = Box.x1 + w; + Box.y2 = Box.y1 + h; + + REGION_INIT(pScreen, &Reg, &Box, 1); + + if (pExaScr->swappedOut) goto fallback; - if (pExaScr->info->DownloadFromScreen == NULL) + exaDoMigration(pixmaps, 1, FALSE); + + pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); + + if (pPix == NULL || pExaScr->info->DownloadFromScreen == NULL) goto fallback; /* Only cover the ZPixmap, solid copy case. */ if (format != ZPixmap || !EXA_PM_IS_SOLID(pDrawable, planeMask)) - goto migrate_and_fallback; + goto fallback; /* Only try to handle the 8bpp and up cases, since we don't want to think * about <8bpp. */ if (pDrawable->bitsPerPixel < 8) - goto migrate_and_fallback; - - pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); - if (pPix == NULL) goto fallback; - xoff += pDrawable->x; - yoff += pDrawable->y; - - ok = pExaScr->info->DownloadFromScreen(pPix, x + xoff, y + yoff, w, h, d, + ok = pExaScr->info->DownloadFromScreen(pPix, pDrawable->x + x + xoff, + pDrawable->y + y + yoff, w, h, d, PixmapBytePad(w, pDrawable->depth)); if (ok) { exaWaitSync(pDrawable->pScreen); - return; + goto out; } -migrate_and_fallback: - pixmaps[0].as_dst = FALSE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); - exaDoMigration (pixmaps, 1, FALSE); fallback: - ExaCheckGetImage (pDrawable, x, y, w, h, format, planeMask, d); -} - -/** - * GetSpans isn't accelerated yet, but performs migration so that we'll - * hopefully avoid the read-from-framebuffer cost. - */ -void -exaGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, - int nspans, char *pdstStart) -{ - ExaMigrationRec pixmaps[1]; - - pixmaps[0].as_dst = FALSE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable); - exaDoMigration (pixmaps, 1, FALSE); - - ExaCheckGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); + EXA_FALLBACK(("from %p (%c)\n", pDrawable, + exaDrawableLocation(pDrawable))); + + exaPrepareAccessReg (pDrawable, EXA_PREPARE_SRC, &Reg); + fbGetImage (pDrawable, x, y, w, h, format, planeMask, d); + exaFinishAccess (pDrawable, EXA_PREPARE_SRC); + +out: + REGION_UNINIT(pScreen, &Reg); } diff --git a/exa/exa_migration.c b/exa/exa_migration.c index 5f07a8db4..c0e022ca7 100644 --- a/exa/exa_migration.c +++ b/exa/exa_migration.c @@ -90,7 +90,8 @@ exaPixmapIsDirty (PixmapPtr pPix) ExaPixmapPriv (pPix); return pExaPixmap == NULL || - REGION_NOTEMPTY (pScreen, DamageRegion(pExaPixmap->pDamage)); + REGION_NOTEMPTY (pScreen, DamageRegion(pExaPixmap->pDamage)) || + !REGION_EQUAL(pScreen, &pExaPixmap->validSys, &pExaPixmap->validFB); } /** @@ -113,24 +114,71 @@ exaPixmapShouldBeInFB (PixmapPtr pPix) /** * If the pixmap is currently dirty, this copies at least the dirty area from - * the framebuffer memory copy to the system memory copy. Both areas must be - * allocated. + * FB to system or vice versa. Both areas must be allocated. */ -static void -exaCopyDirtyToSys (PixmapPtr pPixmap) +static _X_INLINE void +exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, + Bool (*transfer) (PixmapPtr pPix, int x, int y, int w, int h, + char *sys, int sys_pitch), CARD8 *fallback_src, + CARD8 *fallback_dst, int fallback_srcpitch, int fallback_dstpitch, + int fallback_index, void (*sync) (ScreenPtr pScreen)) { - ExaScreenPriv (pPixmap->drawable.pScreen); + PixmapPtr pPixmap = migrate->pPix; ExaPixmapPriv (pPixmap); - RegionPtr pRegion = DamageRegion (pExaPixmap->pDamage); - CARD8 *save_ptr; + RegionPtr damage = DamageRegion (pExaPixmap->pDamage); + RegionRec CopyReg; + Bool save_offscreen; int save_pitch; - BoxPtr pBox = REGION_RECTS(pRegion); - int nbox = REGION_NUM_RECTS(pRegion); - Bool do_sync = FALSE; + BoxPtr pBox; + int nbox; + Bool access_prepared = FALSE; - save_ptr = pPixmap->devPrivate.ptr; + /* Damaged bits are valid in current copy but invalid in other one */ + if (exaPixmapIsOffscreen(pPixmap)) { + REGION_UNION(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB, + damage); + REGION_SUBTRACT(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys, + damage); + } else { + REGION_UNION(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys, + damage); + REGION_SUBTRACT(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB, + damage); + } + + REGION_EMPTY(pScreen, damage); + + /* Copy bits valid in source but not in destination */ + REGION_NULL(pScreen, &CopyReg); + REGION_SUBTRACT(pScreen, &CopyReg, pValidSrc, pValidDst); + + if (migrate->as_dst) { + RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); + + if (REGION_NIL(pending_damage)) { + static Bool firsttime = TRUE; + + if (firsttime) { + ErrorF("%s: Pending damage region empty!\n", __func__); + firsttime = FALSE; + } + } + + REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, pending_damage); + + if (migrate->pReg) + REGION_SUBTRACT(pScreen, &CopyReg, &CopyReg, migrate->pReg); + } else { + if (migrate->pReg) + REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, migrate->pReg); + } + + pBox = REGION_RECTS(&CopyReg); + nbox = REGION_NUM_RECTS(&CopyReg); + + save_offscreen = pExaPixmap->offscreen; save_pitch = pPixmap->devKind; - pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr; + pExaPixmap->offscreen = TRUE; pPixmap->devKind = pExaPixmap->fb_pitch; while (nbox--) { @@ -142,41 +190,57 @@ exaCopyDirtyToSys (PixmapPtr pPixmap) if (pBox->x1 >= pBox->x2 || pBox->y1 >= pBox->y2) continue; - if (pExaScr->info->DownloadFromScreen == NULL || - !pExaScr->info->DownloadFromScreen (pPixmap, - pBox->x1, pBox->y1, - pBox->x2 - pBox->x1, - pBox->y2 - pBox->y1, - pExaPixmap->sys_ptr - + pBox->y1 * pExaPixmap->sys_pitch - + pBox->x1 * pPixmap->drawable.bitsPerPixel / 8, - pExaPixmap->sys_pitch)) + if (!transfer || !transfer (pPixmap, + pBox->x1, pBox->y1, + pBox->x2 - pBox->x1, + pBox->y2 - pBox->y1, + pExaPixmap->sys_ptr + + pBox->y1 * pExaPixmap->sys_pitch + + pBox->x1 * pPixmap->drawable.bitsPerPixel / 8, + pExaPixmap->sys_pitch)) { - exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC); + if (!access_prepared) { + ExaDoPrepareAccess(&pPixmap->drawable, fallback_index); + access_prepared = TRUE; + } exaMemcpyBox (pPixmap, pBox, - pExaPixmap->fb_ptr, pExaPixmap->fb_pitch, - pExaPixmap->sys_ptr, pExaPixmap->sys_pitch); - exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC); + fallback_src, fallback_srcpitch, + fallback_dst, fallback_dstpitch); } - else - do_sync = TRUE; pBox++; } - /* Make sure the bits have actually landed, since we don't necessarily sync - * when accessing pixmaps in system memory. - */ - if (do_sync) - exaWaitSync (pPixmap->drawable.pScreen); + if (access_prepared) + exaFinishAccess(&pPixmap->drawable, fallback_index); + else + sync (pPixmap->drawable.pScreen); - pPixmap->devPrivate.ptr = save_ptr; + pExaPixmap->offscreen = save_offscreen; pPixmap->devKind = save_pitch; - /* The previously damaged bits are now no longer damaged but valid */ - REGION_UNION(pPixmap->drawable.pScreen, - &pExaPixmap->validReg, &pExaPixmap->validReg, pRegion); - DamageEmpty (pExaPixmap->pDamage); + /* The copied bits are now valid in destination */ + REGION_UNION(pScreen, pValidDst, pValidDst, &CopyReg); + + REGION_UNINIT(pScreen, &CopyReg); +} + +/** + * If the pixmap is currently dirty, this copies at least the dirty area from + * the framebuffer memory copy to the system memory copy. Both areas must be + * allocated. + */ +static void +exaCopyDirtyToSys (ExaMigrationPtr migrate) +{ + PixmapPtr pPixmap = migrate->pPix; + ExaScreenPriv (pPixmap->drawable.pScreen); + ExaPixmapPriv (pPixmap); + + exaCopyDirty(migrate, &pExaPixmap->validSys, &pExaPixmap->validFB, + pExaScr->info->DownloadFromScreen, pExaPixmap->fb_ptr, + pExaPixmap->sys_ptr, pExaPixmap->fb_pitch, + pExaPixmap->sys_pitch, EXA_PREPARE_SRC, exaWaitSync); } /** @@ -185,97 +249,16 @@ exaCopyDirtyToSys (PixmapPtr pPixmap) * allocated. */ static void -exaCopyDirtyToFb (PixmapPtr pPixmap) +exaCopyDirtyToFb (ExaMigrationPtr migrate) { + PixmapPtr pPixmap = migrate->pPix; ExaScreenPriv (pPixmap->drawable.pScreen); ExaPixmapPriv (pPixmap); - RegionPtr pRegion = DamageRegion (pExaPixmap->pDamage); - CARD8 *save_ptr; - int save_pitch; - BoxPtr pBox = REGION_RECTS(pRegion); - int nbox = REGION_NUM_RECTS(pRegion); - Bool do_sync = FALSE; - save_ptr = pPixmap->devPrivate.ptr; - save_pitch = pPixmap->devKind; - pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr; - pPixmap->devKind = pExaPixmap->fb_pitch; - - while (nbox--) { - pBox->x1 = max(pBox->x1, 0); - pBox->y1 = max(pBox->y1, 0); - pBox->x2 = min(pBox->x2, pPixmap->drawable.width); - pBox->y2 = min(pBox->y2, pPixmap->drawable.height); - - if (pBox->x1 >= pBox->x2 || pBox->y1 >= pBox->y2) - continue; - - if (pExaScr->info->UploadToScreen == NULL || - !pExaScr->info->UploadToScreen (pPixmap, - pBox->x1, pBox->y1, - pBox->x2 - pBox->x1, - pBox->y2 - pBox->y1, - pExaPixmap->sys_ptr - + pBox->y1 * pExaPixmap->sys_pitch - + pBox->x1 * pPixmap->drawable.bitsPerPixel / 8, - pExaPixmap->sys_pitch)) - { - exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_DEST); - exaMemcpyBox (pPixmap, pBox, - pExaPixmap->sys_ptr, pExaPixmap->sys_pitch, - pExaPixmap->fb_ptr, pExaPixmap->fb_pitch); - exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_DEST); - } - else - do_sync = TRUE; - - pBox++; - } - - if (do_sync) - exaMarkSync (pPixmap->drawable.pScreen); - - pPixmap->devPrivate.ptr = save_ptr; - pPixmap->devKind = save_pitch; - - /* The previously damaged bits are now no longer damaged but valid */ - REGION_UNION(pPixmap->drawable.pScreen, - &pExaPixmap->validReg, &pExaPixmap->validReg, pRegion); - DamageEmpty (pExaPixmap->pDamage); -} - -/** - * Copies out important pixmap data and removes references to framebuffer area. - * Called when the memory manager decides it's time to kick the pixmap out of - * framebuffer entirely. - */ -void -exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area) -{ - PixmapPtr pPixmap = area->privData; - ExaPixmapPriv(pPixmap); - RegionPtr pDamageReg = DamageRegion(pExaPixmap->pDamage); - - DBG_MIGRATE (("Save %p (%p) (%dx%d) (%c)\n", pPixmap, - (void*)(ExaGetPixmapPriv(pPixmap)->area ? - ExaGetPixmapPriv(pPixmap)->area->offset : 0), - pPixmap->drawable.width, - pPixmap->drawable.height, - exaPixmapIsDirty(pPixmap) ? 'd' : 'c')); - - if (exaPixmapIsOffscreen(pPixmap)) { - exaCopyDirtyToSys (pPixmap); - pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr; - pPixmap->devKind = pExaPixmap->sys_pitch; - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - - pExaPixmap->fb_ptr = NULL; - pExaPixmap->area = NULL; - - /* Mark all valid bits as damaged, so they'll get copied to FB next time */ - REGION_UNION(pPixmap->drawable.pScreen, pDamageReg, pDamageReg, - &pExaPixmap->validReg); + exaCopyDirty(migrate, &pExaPixmap->validFB, &pExaPixmap->validSys, + pExaScr->info->UploadToScreen, pExaPixmap->sys_ptr, + pExaPixmap->fb_ptr, pExaPixmap->sys_pitch, + pExaPixmap->fb_pitch, EXA_PREPARE_DEST, exaMarkSync); } /** @@ -293,10 +276,11 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area) * we mark the pixmap dirty, so that the next exaMoveInPixmap will actually move * all the data, since it's almost surely all valid now. */ -void -exaMoveInPixmap (PixmapPtr pPixmap) +static void +exaDoMoveInPixmap (ExaMigrationPtr migrate) { - ScreenPtr pScreen = pPixmap->drawable.pScreen; + PixmapPtr pPixmap = migrate->pPix; + ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv (pScreen); ExaPixmapPriv (pPixmap); @@ -304,10 +288,6 @@ exaMoveInPixmap (PixmapPtr pPixmap) if (pExaScr->swappedOut) return; - /* If we're already in FB, our work is done. */ - if (exaPixmapIsOffscreen(pPixmap)) - return; - /* If we're not allowed to move, then fail. */ if (exaPixmapIsPinned(pPixmap)) return; @@ -331,6 +311,11 @@ exaMoveInPixmap (PixmapPtr pPixmap) pExaPixmap->area->offset; } + exaCopyDirtyToFb (migrate); + + if (exaPixmapIsOffscreen(pPixmap)) + return; + DBG_MIGRATE (("-> %p (0x%x) (%dx%d) (%c)\n", pPixmap, (ExaGetPixmapPriv(pPixmap)->area ? ExaGetPixmapPriv(pPixmap)->area->offset : 0), @@ -338,28 +323,37 @@ exaMoveInPixmap (PixmapPtr pPixmap) pPixmap->drawable.height, exaPixmapIsDirty(pPixmap) ? 'd' : 'c')); - exaCopyDirtyToFb (pPixmap); + pExaPixmap->offscreen = TRUE; - if (pExaScr->hideOffscreenPixmapData) - pPixmap->devPrivate.ptr = NULL; - else - pPixmap->devPrivate.ptr = pExaPixmap->fb_ptr; pPixmap->devKind = pExaPixmap->fb_pitch; pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; } +void +exaMoveInPixmap (PixmapPtr pPixmap) +{ + static ExaMigrationRec migrate = { .as_dst = FALSE, .as_src = TRUE, + .pReg = NULL }; + + migrate.pPix = pPixmap; + exaDoMoveInPixmap (&migrate); +} + /** * Switches the current active location of the pixmap to system memory, copying * updated data out if necessary. */ -void -exaMoveOutPixmap (PixmapPtr pPixmap) +static void +exaDoMoveOutPixmap (ExaMigrationPtr migrate) { + PixmapPtr pPixmap = migrate->pPix; ExaPixmapPriv (pPixmap); - if (exaPixmapIsPinned(pPixmap)) + if (!pExaPixmap->area || exaPixmapIsPinned(pPixmap)) return; + exaCopyDirtyToSys (migrate); + if (exaPixmapIsOffscreen(pPixmap)) { DBG_MIGRATE (("<- %p (%p) (%dx%d) (%c)\n", pPixmap, @@ -369,21 +363,53 @@ exaMoveOutPixmap (PixmapPtr pPixmap) pPixmap->drawable.height, exaPixmapIsDirty(pPixmap) ? 'd' : 'c')); - exaCopyDirtyToSys (pPixmap); + pExaPixmap->offscreen = FALSE; - pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr; pPixmap->devKind = pExaPixmap->sys_pitch; pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; } } +void +exaMoveOutPixmap (PixmapPtr pPixmap) +{ + static ExaMigrationRec migrate = { .as_dst = FALSE, .as_src = TRUE, + .pReg = NULL }; + + migrate.pPix = pPixmap; + exaDoMoveOutPixmap (&migrate); +} + + +/** + * Copies out important pixmap data and removes references to framebuffer area. + * Called when the memory manager decides it's time to kick the pixmap out of + * framebuffer entirely. + */ +void +exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area) +{ + PixmapPtr pPixmap = area->privData; + ExaPixmapPriv(pPixmap); + + exaMoveOutPixmap(pPixmap); + + pExaPixmap->fb_ptr = NULL; + pExaPixmap->area = NULL; + + /* Mark all FB bits as invalid, so all valid system bits get copied to FB + * next time */ + REGION_EMPTY(pPixmap->drawable.pScreen, &pExaPixmap->validFB); +} + /** * For the "greedy" migration scheme, pushes the pixmap toward being located in * framebuffer memory. */ static void -exaMigrateTowardFb (PixmapPtr pPixmap) +exaMigrateTowardFb (ExaMigrationPtr migrate) { + PixmapPtr pPixmap = migrate->pPix; ExaPixmapPriv (pPixmap); if (pExaPixmap == NULL) { @@ -403,7 +429,7 @@ exaMigrateTowardFb (PixmapPtr pPixmap) (pointer)pPixmap, pExaPixmap->score)); if (pExaPixmap->score == EXA_PIXMAP_SCORE_INIT) { - exaMoveInPixmap(pPixmap); + exaDoMoveInPixmap(migrate); pExaPixmap->score = 0; } @@ -413,7 +439,7 @@ exaMigrateTowardFb (PixmapPtr pPixmap) if (pExaPixmap->score >= EXA_PIXMAP_SCORE_MOVE_IN && !exaPixmapIsOffscreen(pPixmap)) { - exaMoveInPixmap (pPixmap); + exaDoMoveInPixmap(migrate); } ExaOffscreenMarkUsed (pPixmap); @@ -424,8 +450,9 @@ exaMigrateTowardFb (PixmapPtr pPixmap) * system memory. */ static void -exaMigrateTowardSys (PixmapPtr pPixmap) +exaMigrateTowardSys (ExaMigrationPtr migrate) { + PixmapPtr pPixmap = migrate->pPix; ExaPixmapPriv (pPixmap); if (pExaPixmap == NULL) { @@ -447,7 +474,7 @@ exaMigrateTowardSys (PixmapPtr pPixmap) pExaPixmap->score--; if (pExaPixmap->score <= EXA_PIXMAP_SCORE_MOVE_OUT && pExaPixmap->area) - exaMoveOutPixmap (pPixmap); + exaDoMoveOutPixmap(migrate); } /** @@ -459,19 +486,29 @@ exaAssertNotDirty (PixmapPtr pPixmap) { ExaPixmapPriv (pPixmap); CARD8 *dst, *src; - RegionPtr pValidReg = &pExaPixmap->validReg; - int dst_pitch, src_pitch, cpp, y, nbox = REGION_NUM_RECTS(pValidReg); - BoxPtr pBox = REGION_RECTS(pValidReg); + RegionRec ValidReg; + int dst_pitch, src_pitch, cpp, y, nbox; + BoxPtr pBox; Bool ret = TRUE; - if (!nbox || exaPixmapIsPinned(pPixmap) || pExaPixmap->fb_ptr == NULL) + if (exaPixmapIsPinned(pPixmap) || pExaPixmap->area == NULL) return ret; + REGION_NULL(pScreen, &ValidReg); + REGION_INTERSECT(pScreen, &ValidReg, &pExaPixmap->validFB, + &pExaPixmap->validSys); + nbox = REGION_NUM_RECTS(&ValidReg); + + if (!nbox) + goto out; + + pBox = REGION_RECTS(&ValidReg); + dst_pitch = pExaPixmap->sys_pitch; src_pitch = pExaPixmap->fb_pitch; cpp = pPixmap->drawable.bitsPerPixel / 8; - exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC); + ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC); while (nbox--) { int rowbytes; @@ -499,6 +536,8 @@ exaAssertNotDirty (PixmapPtr pPixmap) } exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC); +out: + REGION_UNINIT(pScreen, &ValidReg); return ret; } @@ -553,7 +592,7 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) { for (i = 0; i < npixmaps; i++) { if (!exaPixmapIsDirty (pixmaps[i].pPix)) - exaMoveOutPixmap (pixmaps[i].pPix); + exaDoMoveOutPixmap (pixmaps + i); } return; } @@ -564,17 +603,17 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) */ if (!can_accel) { for (i = 0; i < npixmaps; i++) { - exaMigrateTowardSys (pixmaps[i].pPix); + exaMigrateTowardSys (pixmaps + i); if (!exaPixmapIsDirty (pixmaps[i].pPix)) - exaMoveOutPixmap (pixmaps[i].pPix); + exaDoMoveOutPixmap (pixmaps + i); } return; } /* Finally, the acceleration path. Move them all in. */ for (i = 0; i < npixmaps; i++) { - exaMigrateTowardFb(pixmaps[i].pPix); - exaMoveInPixmap(pixmaps[i].pPix); + exaMigrateTowardFb(pixmaps + i); + exaDoMoveInPixmap(pixmaps + i); } } else if (pExaScr->migration == ExaMigrationGreedy) { /* If we can't accelerate, either because the driver can't or because one of @@ -590,7 +629,7 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) */ if (!can_accel) { for (i = 0; i < npixmaps; i++) - exaMigrateTowardSys (pixmaps[i].pPix); + exaMigrateTowardSys (pixmaps + i); return; } @@ -598,14 +637,14 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) if (exaPixmapIsOffscreen(pixmaps[i].pPix)) { /* Found one in FB, so move all to FB. */ for (j = 0; j < npixmaps; j++) - exaMigrateTowardFb(pixmaps[j].pPix); + exaMigrateTowardFb(pixmaps + i); return; } } /* Nobody's in FB, so move all away from FB. */ for (i = 0; i < npixmaps; i++) - exaMigrateTowardSys(pixmaps[i].pPix); + exaMigrateTowardSys(pixmaps + i); } else if (pExaScr->migration == ExaMigrationAlways) { /* Always move the pixmaps out if we can't accelerate. If we can * accelerate, try to move them all in. If that fails, then move them @@ -613,23 +652,18 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel) */ if (!can_accel) { for (i = 0; i < npixmaps; i++) - exaMoveOutPixmap(pixmaps[i].pPix); + exaDoMoveOutPixmap(pixmaps + i); return; } /* Now, try to move them all into FB */ for (i = 0; i < npixmaps; i++) { - exaMoveInPixmap(pixmaps[i].pPix); + exaDoMoveInPixmap(pixmaps + i); } - /* If we couldn't fit everything in, then kick back out */ + /* If we couldn't fit everything in, abort */ for (i = 0; i < npixmaps; i++) { if (!exaPixmapIsOffscreen(pixmaps[i].pPix)) { - EXA_FALLBACK(("Pixmap %p (%dx%d) not in fb\n", pixmaps[i].pPix, - pixmaps[i].pPix->drawable.width, - pixmaps[i].pPix->drawable.height)); - for (j = 0; j < npixmaps; j++) - exaMoveOutPixmap(pixmaps[j].pPix); return; } } diff --git a/exa/exa_priv.h b/exa/exa_priv.h index b577094bc..27749d7c4 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -101,21 +101,21 @@ typedef struct { CloseScreenProcPtr SavedCloseScreen; GetImageProcPtr SavedGetImage; GetSpansProcPtr SavedGetSpans; - PaintWindowBackgroundProcPtr SavedPaintWindowBackground; CreatePixmapProcPtr SavedCreatePixmap; DestroyPixmapProcPtr SavedDestroyPixmap; - PaintWindowBorderProcPtr SavedPaintWindowBorder; CopyWindowProcPtr SavedCopyWindow; + ChangeWindowAttributesProcPtr SavedChangeWindowAttributes; + BitmapToRegionProcPtr SavedBitmapToRegion; + ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader; #ifdef RENDER CompositeProcPtr SavedComposite; - RasterizeTrapezoidProcPtr SavedRasterizeTrapezoid; - AddTrianglesProcPtr SavedAddTriangles; + TrianglesProcPtr SavedTriangles; GlyphsProcPtr SavedGlyphs; TrapezoidsProcPtr SavedTrapezoids; #endif + Bool swappedOut; enum ExaMigrationHeuristic migration; - Bool hideOffscreenPixmapData; Bool checkDirtyCorrectness; unsigned disableFbCount; } ExaScreenPrivRec, *ExaScreenPrivPtr; @@ -157,6 +157,7 @@ extern DevPrivateKey exaPixmapPrivateKey; typedef struct { ExaOffscreenArea *area; int score; /**< score for the move-in vs move-out heuristic */ + Bool offscreen; CARD8 *sys_ptr; /**< pointer to pixmap data in system memory */ int sys_pitch; /**< pitch of pixmap in system memory */ @@ -172,16 +173,17 @@ typedef struct { */ DamagePtr pDamage; /** - * The valid region marks the valid bits of a drawable (at least, as it's - * derived from damage, which may be overreported). + * The valid regions mark the valid bits (at least, as they're derived from + * damage, which may be overreported) of a pixmap's system and FB copies. */ - RegionRec validReg; + RegionRec validSys, validFB; } ExaPixmapPrivRec, *ExaPixmapPrivPtr; typedef struct _ExaMigrationRec { Bool as_dst; Bool as_src; PixmapPtr pPix; + RegionPtr pReg; } ExaMigrationRec, *ExaMigrationPtr; /** @@ -190,6 +192,12 @@ typedef struct _ExaMigrationRec { */ void exaDDXDriverInit (ScreenPtr pScreen); +void +exaPrepareAccessWindow(WindowPtr pWin); + +void +exaFinishAccessWindow(WindowPtr pWin); + /* exa_unaccel.c */ void exaPrepareAccessGC(GCPtr pGC); @@ -254,12 +262,6 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, int w, int h, int x, int y); -void -ExaCheckGetImage (DrawablePtr pDrawable, - int x, int y, int w, int h, - unsigned int format, unsigned long planeMask, - char *d); - void ExaCheckGetSpans (DrawablePtr pDrawable, int wMax, @@ -268,13 +270,20 @@ ExaCheckGetSpans (DrawablePtr pDrawable, int nspans, char *pdstStart); -void -ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what); - CARD32 exaGetPixmapFirstPixel (PixmapPtr pPixmap); /* exa_accel.c */ + +static _X_INLINE Bool +exaGCReadsDestination(DrawablePtr pDrawable, unsigned long planemask, + unsigned int fillStyle, unsigned char alu) +{ + return ((alu != GXcopy && alu != GXclear &&alu != GXset && + alu != GXcopyInverted) || fillStyle == FillStippled || + !EXA_PM_IS_SOLID(pDrawable, planemask)); +} + void exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); @@ -283,16 +292,14 @@ exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, DDXPointPtr pPatOrg, CARD32 planemask, CARD32 alu); void -exaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); +exaShmPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, unsigned int format, + int w, int h, int sx, int sy, int sw, int sh, int dx, int dy, + char *data); void exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, unsigned int format, unsigned long planeMask, char *d); -void -exaGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, - int nspans, char *pdstStart); - extern const GCOps exaOps; #ifdef MITSHM @@ -329,6 +336,12 @@ void ExaOffscreenFini (ScreenPtr pScreen); /* exa.c */ +void +ExaDoPrepareAccess(DrawablePtr pDrawable, int index); + +void +exaPrepareAccessReg(DrawablePtr pDrawable, int index, RegionPtr pReg); + void exaPrepareAccess(DrawablePtr pDrawable, int index); @@ -372,6 +385,9 @@ exaCopyNtoN (DrawablePtr pSrcDrawable, void *closure); /* exa_render.c */ +Bool +exaOpReadsDestination (CARD8 op); + void exaComposite(CARD8 op, PicturePtr pSrc, @@ -392,12 +408,9 @@ exaTrapezoids (CARD8 op, PicturePtr pSrc, PicturePtr pDst, int ntrap, xTrapezoid *traps); void -exaRasterizeTrapezoid (PicturePtr pPicture, xTrapezoid *trap, - int x_off, int y_off); - -void -exaAddTriangles (PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri, - xTriangle *tris); +exaTriangles (CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntri, xTriangle *tris); void exaGlyphs (CARD8 op, diff --git a/exa/exa_render.c b/exa/exa_render.c index 2dd3fc1ce..943a4c8f6 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -111,7 +111,7 @@ exaPrintCompositeFallback(CARD8 op, } #endif /* DEBUG_TRACE_FALL */ -static Bool +Bool exaOpReadsDestination (CARD8 op) { /* FALSE (does not read destination) is the list of ops in the protocol @@ -261,16 +261,21 @@ exaTryDriverSolidFill(PicturePtr pSrc, width, height)) return 1; + pDstPix = exaGetDrawablePixmap (pDst->pDrawable); + exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y); + + REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y); + pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable); pixel = exaGetPixmapFirstPixel (pSrcPix); pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = FALSE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable); + pixmaps[0].pPix = pDstPix; + pixmaps[0].pReg = ®ion; exaDoMigration(pixmaps, 1, TRUE); - pDstPix = exaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x, &dst_off_y); - if (!pDstPix) { + if (!exaPixmapIsOffscreen(pDstPix)) { REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); return 0; } @@ -300,9 +305,7 @@ exaTryDriverSolidFill(PicturePtr pSrc, while (nbox--) { - (*pExaScr->info->Solid) (pDstPix, - pbox->x1 + dst_off_x, pbox->y1 + dst_off_y, - pbox->x2 + dst_off_x, pbox->y2 + dst_off_y); + (*pExaScr->info->Solid) (pDstPix, pbox->x1, pbox->y1, pbox->x2, pbox->y2); pbox++; } @@ -366,28 +369,35 @@ exaTryDriverComposite(CARD8 op, xSrc += pSrc->pDrawable->x; ySrc += pSrc->pDrawable->y; + if (pExaScr->info->CheckComposite && + !(*pExaScr->info->CheckComposite) (op, pSrc, pMask, pDst)) + { + return -1; + } + if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height)) return 1; - if (pExaScr->info->CheckComposite && - !(*pExaScr->info->CheckComposite) (op, pSrc, pMask, pDst)) - { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); - return -1; - } + pDstPix = exaGetDrawablePixmap (pDst->pDrawable); + exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y); + + REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y); pixmaps[0].as_dst = TRUE; pixmaps[0].as_src = exaOpReadsDestination(op); - pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable); + pixmaps[0].pPix = pDstPix; + pixmaps[0].pReg = pixmaps[0].as_src ? NULL : ®ion; pixmaps[1].as_dst = FALSE; pixmaps[1].as_src = TRUE; pixmaps[1].pPix = exaGetDrawablePixmap (pSrc->pDrawable); + pixmaps[1].pReg = NULL; if (pMask) { pixmaps[2].as_dst = FALSE; pixmaps[2].as_src = TRUE; pixmaps[2].pPix = exaGetDrawablePixmap (pMask->pDrawable); + pixmaps[2].pReg = NULL; exaDoMigration(pixmaps, 3, TRUE); } else { exaDoMigration(pixmaps, 2, TRUE); @@ -397,9 +407,8 @@ exaTryDriverComposite(CARD8 op, if (pMask) pMaskPix = exaGetOffscreenPixmap (pMask->pDrawable, &mask_off_x, &mask_off_y); - pDstPix = exaGetOffscreenPixmap (pDst->pDrawable, &dst_off_x, &dst_off_y); - if (!pDstPix) { + if (!exaPixmapIsOffscreen(pDstPix)) { REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); return 0; } @@ -429,21 +438,21 @@ exaTryDriverComposite(CARD8 op, nbox = REGION_NUM_RECTS(®ion); pbox = REGION_RECTS(®ion); - xMask -= xDst; - yMask -= yDst; + xMask = xMask + mask_off_x - xDst - dst_off_x; + yMask = yMask + mask_off_y - yDst - dst_off_y; - xSrc -= xDst; - ySrc -= yDst; + xSrc = xSrc + src_off_x - xDst - dst_off_x; + ySrc = ySrc + src_off_y - yDst - dst_off_y; while (nbox--) { (*pExaScr->info->Composite) (pDstPix, - pbox->x1 + xSrc + src_off_x, - pbox->y1 + ySrc + src_off_y, - pbox->x1 + xMask + mask_off_x, - pbox->y1 + yMask + mask_off_y, - pbox->x1 + dst_off_x, - pbox->y1 + dst_off_y, + pbox->x1 + xSrc, + pbox->y1 + ySrc, + pbox->x1 + xMask, + pbox->y1 + yMask, + pbox->x1, + pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1); pbox++; @@ -519,9 +528,6 @@ exaTryMagicTwoPassCompositeHelper(CARD8 op, CARD16 height) { ExaScreenPriv (pDst->pDrawable->pScreen); - DrawablePtr pDstDraw = pDst->pDrawable; - PixmapPtr pDstPixmap = exaGetDrawablePixmap(pDstDraw); - int xoff, yoff; assert(op == PictOpOver); @@ -540,12 +546,6 @@ exaTryMagicTwoPassCompositeHelper(CARD8 op, exaComposite(PictOpOutReverse, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); - exaGetDrawableDeltas(pDstDraw, pDstPixmap, &xoff, &yoff); - xoff += pDstDraw->x; - yoff += pDstDraw->y; - exaPixmapDirty(pDstPixmap, xDst + xoff, yDst + yoff, xDst + xoff + width, - yDst + yoff + height); - /* Then, add in the source value times the destination alpha factors (1.0). */ exaComposite(PictOpAdd, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, @@ -572,28 +572,8 @@ exaComposite(CARD8 op, int ret = -1; Bool saveSrcRepeat = pSrc->repeat; Bool saveMaskRepeat = pMask ? pMask->repeat : 0; - ExaMigrationRec pixmaps[3]; - int npixmaps = 1; PixmapPtr pSrcPixmap = NULL; - - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = exaOpReadsDestination(op); - pixmaps[0].pPix = exaGetDrawablePixmap (pDst->pDrawable); - - if (pSrc->pDrawable) { - pSrcPixmap = exaGetDrawablePixmap (pSrc->pDrawable); - pixmaps[npixmaps].as_dst = FALSE; - pixmaps[npixmaps].as_src = TRUE; - pixmaps[npixmaps].pPix = pSrcPixmap; - npixmaps++; - } - - if (pMask && pMask->pDrawable) { - pixmaps[npixmaps].as_dst = FALSE; - pixmaps[npixmaps].as_src = TRUE; - pixmaps[npixmaps].pPix = exaGetDrawablePixmap (pMask->pDrawable); - npixmaps++; - } + RegionRec region; /* We currently don't support acceleration of gradients, or other pictures * with a NULL pDrawable. @@ -631,8 +611,6 @@ exaComposite(CARD8 op, } else if (pSrcPixmap && !pSrc->repeat && !pSrc->transform) { - RegionRec region; - xDst += pDst->pDrawable->x; yDst += pDst->pDrawable->y; xSrc += pSrc->pDrawable->x; @@ -654,7 +632,6 @@ exaComposite(CARD8 op, else if (pSrcPixmap && !pSrc->transform && pSrc->repeatType == RepeatNormal) { - RegionRec region; DDXPointRec srcOrg; /* Let's see if the driver can do the repeat in one go */ @@ -738,7 +715,6 @@ fallback: exaPrintCompositeFallback (op, pSrc, pMask, pDst); #endif - exaDoMigration(pixmaps, npixmaps, FALSE); ExaCheckComposite (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); @@ -754,7 +730,7 @@ done: * of PolyFillRect to initialize the pixmap after creating it, to prevent * the pixmap from being migrated. * - * See the comments about exaTrapezoids. + * See the comments about exaTrapezoids and exaTriangles. */ static PicturePtr exaCreateAlphaPicture (ScreenPtr pScreen, @@ -826,36 +802,70 @@ exaTrapezoids (CARD8 op, PicturePtr pSrc, PicturePtr pDst, { ScreenPtr pScreen = pDst->pDrawable->pScreen; PictureScreenPtr ps = GetPictureScreen(pScreen); + BoxRec bounds; + Bool direct = op == PictOpAdd && miIsSolidAlpha (pSrc); + + if (maskFormat || direct) { + miTrapezoidBounds (ntrap, traps, &bounds); + + if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) + return; + } /* * Check for solid alpha add */ - if (op == PictOpAdd && miIsSolidAlpha (pSrc)) + if (direct) { + DrawablePtr pDraw = pDst->pDrawable; + PixmapPtr pixmap = exaGetDrawablePixmap (pDraw); + ExaPixmapPriv (pixmap); + RegionRec migration; + RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); + int xoff, yoff; + + exaGetDrawableDeltas(pDraw, pixmap, &xoff, &yoff); + + xoff += pDraw->x; + yoff += pDraw->y; + + bounds.x1 += xoff; + bounds.y1 += yoff; + bounds.x2 += xoff; + bounds.y2 += yoff; + + REGION_INIT(pScreen, &migration, &bounds, 1); + REGION_UNION(pScreen, pending_damage, pending_damage, &migration); + REGION_UNINIT(pScreen, &migration); + + exaPrepareAccess(pDraw, EXA_PREPARE_DEST); + for (; ntrap; ntrap--, traps++) (*ps->RasterizeTrapezoid) (pDst, traps, 0, 0); + + exaFinishAccess(pDraw, EXA_PREPARE_DEST); } else if (maskFormat) { PicturePtr pPicture; - BoxRec bounds; INT16 xDst, yDst; INT16 xRel, yRel; xDst = traps[0].left.p1.x >> 16; yDst = traps[0].left.p1.y >> 16; - miTrapezoidBounds (ntrap, traps, &bounds); - if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) - return; pPicture = exaCreateAlphaPicture (pScreen, pDst, maskFormat, bounds.x2 - bounds.x1, bounds.y2 - bounds.y1); if (!pPicture) return; + + exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST); for (; ntrap; ntrap--, traps++) (*ps->RasterizeTrapezoid) (pPicture, traps, -bounds.x1, -bounds.y1); + exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST); + xRel = bounds.x1 + xSrc - xDst; yRel = bounds.y1 + ySrc - yDst; CompositePicture (op, pSrc, pPicture, pDst, @@ -875,61 +885,102 @@ exaTrapezoids (CARD8 op, PicturePtr pSrc, PicturePtr pDst, } } -#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) - /** - * exaRasterizeTrapezoid is just a wrapper around the software implementation. + * exaTriangles is essentially a copy of miTriangles that uses + * exaCreateAlphaPicture instead of miCreateAlphaPicture. * - * The trapezoid specification is basically too hard to be done in hardware (at - * the very least, without programmability), so we just do the appropriate - * Prepare/FinishAccess for it before using fbtrap.c. + * The problem with miCreateAlphaPicture is that it calls PolyFillRect + * to initialize the contents after creating the pixmap, which + * causes the pixmap to be moved in for acceleration. The subsequent + * call to AddTriangles won't be accelerated however, which forces the pixmap + * to be moved out again. + * + * exaCreateAlphaPicture avoids this roundtrip by using ExaCheckPolyFillRect + * to initialize the contents. */ void -exaRasterizeTrapezoid (PicturePtr pPicture, xTrapezoid *trap, - int x_off, int y_off) +exaTriangles (CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntri, xTriangle *tris) { - DrawablePtr pDraw = pPicture->pDrawable; - ExaMigrationRec pixmaps[1]; - int xoff, yoff; + ScreenPtr pScreen = pDst->pDrawable->pScreen; + PictureScreenPtr ps = GetPictureScreen(pScreen); + BoxRec bounds; + Bool direct = op == PictOpAdd && miIsSolidAlpha (pSrc); - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDraw); - exaDoMigration(pixmaps, 1, FALSE); + if (maskFormat || direct) { + miTriangleBounds (ntri, tris, &bounds); - exaPrepareAccess(pDraw, EXA_PREPARE_DEST); - fbRasterizeTrapezoid(pPicture, trap, x_off, y_off); - exaGetDrawableDeltas(pDraw, pixmaps[0].pPix, &xoff, &yoff); - exaPixmapDirty(pixmaps[0].pPix, pDraw->x + xoff, pDraw->y + yoff, - pDraw->x + xoff + pDraw->width, - pDraw->y + yoff + pDraw->height); - exaFinishAccess(pDraw, EXA_PREPARE_DEST); -} + if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2) + return; + } -/** - * exaAddTriangles does migration and syncing before dumping down to the - * software implementation. - */ -void -exaAddTriangles (PicturePtr pPicture, INT16 x_off, INT16 y_off, int ntri, - xTriangle *tris) -{ - DrawablePtr pDraw = pPicture->pDrawable; - ExaMigrationRec pixmaps[1]; - int xoff, yoff; + /* + * Check for solid alpha add + */ + if (direct) + { + DrawablePtr pDraw = pDst->pDrawable; + PixmapPtr pixmap = exaGetDrawablePixmap (pDraw); + ExaPixmapPriv (pixmap); + RegionRec migration; + RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); + int xoff, yoff; - pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = exaGetDrawablePixmap (pDraw); - exaDoMigration(pixmaps, 1, FALSE); + exaGetDrawableDeltas(pDraw, pixmap, &xoff, &yoff); - exaPrepareAccess(pDraw, EXA_PREPARE_DEST); - fbAddTriangles(pPicture, x_off, y_off, ntri, tris); - exaGetDrawableDeltas(pDraw, pixmaps[0].pPix, &xoff, &yoff); - exaPixmapDirty(pixmaps[0].pPix, pDraw->x + xoff, pDraw->y + yoff, - pDraw->x + xoff + pDraw->width, - pDraw->y + yoff + pDraw->height); - exaFinishAccess(pDraw, EXA_PREPARE_DEST); + xoff += pDraw->x; + yoff += pDraw->y; + + bounds.x1 += xoff; + bounds.y1 += yoff; + bounds.x2 += xoff; + bounds.y2 += yoff; + + REGION_INIT(pScreen, &migration, &bounds, 1); + REGION_UNION(pScreen, pending_damage, pending_damage, &migration); + REGION_UNINIT(pScreen, &migration); + + exaPrepareAccess(pDraw, EXA_PREPARE_DEST); + (*ps->AddTriangles) (pDst, 0, 0, ntri, tris); + exaFinishAccess(pDraw, EXA_PREPARE_DEST); + } + else if (maskFormat) + { + PicturePtr pPicture; + INT16 xDst, yDst; + INT16 xRel, yRel; + + xDst = tris[0].p1.x >> 16; + yDst = tris[0].p1.y >> 16; + + pPicture = exaCreateAlphaPicture (pScreen, pDst, maskFormat, + bounds.x2 - bounds.x1, + bounds.y2 - bounds.y1); + if (!pPicture) + return; + + exaPrepareAccess(pPicture->pDrawable, EXA_PREPARE_DEST); + (*ps->AddTriangles) (pPicture, -bounds.x1, -bounds.y1, ntri, tris); + exaFinishAccess(pPicture->pDrawable, EXA_PREPARE_DEST); + + xRel = bounds.x1 + xSrc - xDst; + yRel = bounds.y1 + ySrc - yDst; + CompositePicture (op, pSrc, pPicture, pDst, + xRel, yRel, 0, 0, bounds.x1, bounds.y1, + bounds.x2 - bounds.x1, bounds.y2 - bounds.y1); + FreePicture (pPicture, 0); + } + else + { + if (pDst->polyEdge == PolyEdgeSharp) + maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1); + else + maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8); + + for (; ntri; ntri--, tris++) + exaTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, tris); + } } /** @@ -1005,10 +1056,15 @@ exaGlyphsIntersect(int nlist, GlyphListPtr list, GlyphPtr *glyphs) return FALSE; } +#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0) + /* exaGlyphs is a slight variation on miGlyphs, to support acceleration. The * issue is that miGlyphs' use of ModifyPixmapHeader makes it impossible to * migrate these pixmaps. So, instead we create a pixmap at the beginning of * the loop and upload each glyph into the pixmap before compositing. + * + * This is now used even when Composite can't be accelerated for better + * migration control. */ void exaGlyphs (CARD8 op, @@ -1025,11 +1081,10 @@ exaGlyphs (CARD8 op, PixmapPtr pPixmap = NULL; PicturePtr pPicture; PixmapPtr pMaskPixmap = NULL; - PixmapPtr pDstPixmap = exaGetDrawablePixmap(pDst->pDrawable); PicturePtr pMask; ScreenPtr pScreen = pDst->pDrawable->pScreen; int width = 0, height = 0; - int x, y, x1, y1, xoff, yoff; + int x, y, x1, y1; int xDst = list->xOff, yDst = list->yOff; int n; int error; @@ -1057,16 +1112,6 @@ exaGlyphs (CARD8 op, } } - /* If the driver doesn't support accelerated composite, there's no point in - * going to this extra work. Assume that any driver that supports Composite - * will be able to support component alpha using the two-pass helper. - */ - if (!pExaScr->info->PrepareComposite) - { - miGlyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs); - return; - } - if (maskFormat) { GCPtr pGC; @@ -1103,8 +1148,11 @@ exaGlyphs (CARD8 op, rect.y = 0; rect.width = width; rect.height = height; - (*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect); - exaPixmapDirty(pMaskPixmap, 0, 0, width, height); + ExaCheckPolyFillRect (&pMaskPixmap->drawable, pGC, 1, &rect); + if (pExaScr->info->PrepareComposite) + (*pGC->ops->PolyFillRect) (&pMaskPixmap->drawable, pGC, 1, &rect); + else + exaPixmapDirty(pMaskPixmap, 0, 0, width, height); FreeScratchGC (pGC); x = -extents.x1; y = -extents.y1; @@ -1116,8 +1164,6 @@ exaGlyphs (CARD8 op, y = 0; } - exaGetDrawableDeltas(pDst->pDrawable, pDstPixmap, &xoff, &yoff); - while (nlist--) { GCPtr pGC = NULL; @@ -1170,8 +1216,9 @@ exaGlyphs (CARD8 op, * it'll stick there. */ pixmaps[0].as_dst = TRUE; - pixmaps[0].as_src = TRUE; + pixmaps[0].as_src = FALSE; pixmaps[0].pPix = pPixmap; + pixmaps[0].pReg = NULL; exaDoMigration (pixmaps, 1, pExaScr->info->PrepareComposite != NULL); while (n--) @@ -1235,6 +1282,15 @@ exaGlyphs (CARD8 op, pScratchPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; } +#ifdef MITSHM + if (pExaScr->info->PrepareComposite) + exaShmPutImage(&pPixmap->drawable, pGC, + pPixmap->drawable.depth, ZPixmap, + glyph->info.width, glyph->info.height, 0, 0, + glyph->info.width, glyph->info.height, 0, 0, + glyphdata); + else +#endif exaCopyArea (&pScratchPixmap->drawable, &pPixmap->drawable, pGC, 0, 0, glyph->info.width, glyph->info.height, 0, 0); } @@ -1255,10 +1311,6 @@ exaGlyphs (CARD8 op, xSrc + x1 - xDst, ySrc + y1 - yDst, 0, 0, x1, y1, glyph->info.width, glyph->info.height); - x1 += pDst->pDrawable->x + xoff; - y1 += pDst->pDrawable->y + yoff; - exaPixmapDirty(pDstPixmap, x1, y1, x1 + glyph->info.width, - y1 + glyph->info.height); } nextglyph: x += glyph->info.xOff; diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index d793ec2b9..c55ef032b 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -23,6 +23,10 @@ #include "exa_priv.h" +#ifdef RENDER +#include "mipict.h" +#endif + /* * These functions wrap the low-level fb rendering functions and * synchronize framebuffer/accelerated drawing by stalling until @@ -35,10 +39,13 @@ * * Solid doesn't use an extra pixmap source, and Stippled/OpaqueStippled are * 1bpp and never in fb, so we don't worry about them. + * We should worry about them for completeness sake and going forward. */ void exaPrepareAccessGC(GCPtr pGC) { + if (pGC->stipple) + exaPrepareAccess(&pGC->stipple->drawable, EXA_PREPARE_MASK); if (pGC->fillStyle == FillTiled) exaPrepareAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC); } @@ -50,7 +57,9 @@ void exaFinishAccessGC(GCPtr pGC) { if (pGC->fillStyle == FillTiled) - exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC); + exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_MASK); + if (pGC->stipple) + exaFinishAccess(&pGC->stipple->drawable, EXA_PREPARE_SRC); } #if DEBUG_TRACE_FALL @@ -88,15 +97,14 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits) { - PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable); - int xoff, yoff; - EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); - exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + if (exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle, + pGC->alu)) + exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + else + ExaDoPrepareAccess (pDrawable, EXA_PREPARE_DEST); fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits); exaFinishAccess (pDrawable, EXA_PREPARE_DEST); - exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); - exaPixmapDirty(pPixmap, x + xoff, y + yoff, x + xoff + w, y + yoff + h); } RegionPtr @@ -188,6 +196,12 @@ ExaCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *pArcs) { EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); + + /* Disable this as fbPolyArc can call miZeroPolyArc which in turn + * can call accelerated functions, that as yet, haven't been notified + * with exaFinishAccess(). + */ +#if 0 if (pGC->lineWidth == 0) { exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); @@ -197,6 +211,7 @@ ExaCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC, exaFinishAccess (pDrawable, EXA_PREPARE_DEST); return; } +#endif miPolyArc (pDrawable, pGC, narcs, pArcs); } @@ -250,25 +265,14 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap, exaDrawableLocation(&pBitmap->drawable), exaDrawableLocation(pDrawable))); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); + exaPrepareAccess (&pBitmap->drawable, EXA_PREPARE_SRC); exaPrepareAccessGC (pGC); fbPushPixels (pGC, pBitmap, pDrawable, w, h, x, y); exaFinishAccessGC (pGC); + exaFinishAccess (&pBitmap->drawable, EXA_PREPARE_SRC); exaFinishAccess (pDrawable, EXA_PREPARE_DEST); } -void -ExaCheckGetImage (DrawablePtr pDrawable, - int x, int y, int w, int h, - unsigned int format, unsigned long planeMask, - char *d) -{ - EXA_FALLBACK(("from %p (%c)\n", pDrawable, - exaDrawableLocation(pDrawable))); - exaPrepareAccess (pDrawable, EXA_PREPARE_SRC); - fbGetImage (pDrawable, x, y, w, h, format, planeMask, d); - exaFinishAccess (pDrawable, EXA_PREPARE_SRC); -} - void ExaCheckGetSpans (DrawablePtr pDrawable, int wMax, @@ -283,21 +287,6 @@ ExaCheckGetSpans (DrawablePtr pDrawable, exaFinishAccess (pDrawable, EXA_PREPARE_SRC); } -/* XXX: Note the lack of a prepare on the tile, if the window has a tiled - * background. This function happens to only be called if pExaScr->swappedOut, - * so we actually end up not having to do it since the tile won't be in fb. - * That doesn't make this not dirty, though. - */ -void -ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what) -{ - EXA_FALLBACK(("from %p (%c)\n", pWin, - exaDrawableLocation(&pWin->drawable))); - exaPrepareAccess (&pWin->drawable, EXA_PREPARE_DEST); - fbPaintWindow (pWin, pRegion, what); - exaFinishAccess (&pWin->drawable, EXA_PREPARE_DEST); -} - void ExaCheckComposite (CARD8 op, PicturePtr pSrc, @@ -312,9 +301,30 @@ ExaCheckComposite (CARD8 op, CARD16 width, CARD16 height) { + RegionRec region; + int xoff, yoff; + + REGION_NULL(pScreen, ®ion); + + if (!exaOpReadsDestination(op)) { + if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, + xSrc, ySrc, xMask, yMask, xDst, yDst, + width, height)) + return; + + exaGetDrawableDeltas (pDst->pDrawable, + exaGetDrawablePixmap(pDst->pDrawable), + &xoff, &yoff); + + REGION_TRANSLATE(pScreen, ®ion, xoff, yoff); + + exaPrepareAccessReg (pDst->pDrawable, EXA_PREPARE_DEST, ®ion); + } else + exaPrepareAccess (pDst->pDrawable, EXA_PREPARE_DEST); + EXA_FALLBACK(("from picts %p/%p to pict %p\n", pSrc, pMask, pDst)); - exaPrepareAccess (pDst->pDrawable, EXA_PREPARE_DEST); + if (pSrc->pDrawable != NULL) exaPrepareAccess (pSrc->pDrawable, EXA_PREPARE_SRC); if (pMask && pMask->pDrawable != NULL) @@ -336,6 +346,8 @@ ExaCheckComposite (CARD8 op, if (pSrc->pDrawable != NULL) exaFinishAccess (pSrc->pDrawable, EXA_PREPARE_SRC); exaFinishAccess (pDst->pDrawable, EXA_PREPARE_DEST); + + REGION_UNINIT(pScreen, ®ion); } /** @@ -351,21 +363,28 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap) void *fb; Bool need_finish = FALSE; BoxRec box; - ExaMigrationRec pixmaps[1]; + RegionRec migration; ExaPixmapPriv (pPixmap); + Bool sys_valid = !miPointInRegion(&pExaPixmap->validSys, 0, 0, &box); + Bool damaged = miPointInRegion(DamageRegion(pExaPixmap->pDamage), 0, 0, + &box); + Bool offscreen = exaPixmapIsOffscreen(pPixmap); fb = pExaPixmap->sys_ptr; /* Try to avoid framebuffer readbacks */ - if (exaPixmapIsOffscreen(pPixmap) && - miPointInRegion(DamageRegion(pExaPixmap->pDamage), 0, 0, &box)) + if ((!offscreen && !sys_valid && !damaged) || + (offscreen && (!sys_valid || damaged))) { + box.x1 = 0; + box.y1 = 0; + box.x2 = 1; + box.y2 = 1; + REGION_INIT(pScreen, &migration, &box, 1); + need_finish = TRUE; - pixmaps[0].as_dst = FALSE; - pixmaps[0].as_src = TRUE; - pixmaps[0].pPix = pPixmap; - exaDoMigration (pixmaps, 1, FALSE); - exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC); + + exaPrepareAccessReg(&pPixmap->drawable, EXA_PREPARE_SRC, &migration); fb = pPixmap->devPrivate.ptr; } @@ -381,8 +400,10 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap) break; } - if (need_finish) + if (need_finish) { exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC); + REGION_UNINIT(pScreen, &migration); + } return pixel; } diff --git a/fb/fb.h b/fb/fb.h index da85ecf3d..cafd8103d 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -2091,10 +2091,6 @@ fbFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile); -void -fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); - - pixman_image_t *image_from_pict (PicturePtr pict, Bool has_clip); void free_pixman_pict (PicturePtr, pixman_image_t *); diff --git a/fb/fboverlay.c b/fb/fboverlay.c index 0d3c24073..6d21362af 100644 --- a/fb/fboverlay.c +++ b/fb/fboverlay.c @@ -277,16 +277,6 @@ fbOverlayWindowExposures (WindowPtr pWin, miWindowExposures(pWin, prgn, other_exposed); } -void -fbOverlayPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - if (what == PW_BORDER) - fbOverlayUpdateLayerRegion (pWin->drawable.pScreen, - fbOverlayWindowLayer (pWin), - pRegion); - fbPaintWindow (pWin, pRegion, what); -} - Bool fbOverlaySetupScreen(ScreenPtr pScreen, pointer pbits1, @@ -434,7 +424,6 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen, pScreen->CreateWindow = fbOverlayCreateWindow; pScreen->WindowExposures = fbOverlayWindowExposures; pScreen->CopyWindow = fbOverlayCopyWindow; - pScreen->PaintWindowBorder = fbOverlayPaintWindow; #ifdef FB_24_32BIT if (bpp == 24 && imagebpp == 32) { diff --git a/fb/fboverlay.h b/fb/fboverlay.h index 85a28ec2f..f3db0bb7d 100644 --- a/fb/fboverlay.h +++ b/fb/fboverlay.h @@ -92,10 +92,6 @@ fbOverlayWindowExposures (WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed); -void -fbOverlayPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); - - Bool fbOverlaySetupScreen(ScreenPtr pScreen, pointer pbits1, diff --git a/fb/fbpseudocolor.c b/fb/fbpseudocolor.c index 1b9b18a7e..3f10faaa3 100644 --- a/fb/fbpseudocolor.c +++ b/fb/fbpseudocolor.c @@ -94,8 +94,6 @@ typedef struct { CreateScreenResourcesProcPtr CreateScreenResources; CreateWindowProcPtr CreateWindow; CopyWindowProcPtr CopyWindow; - PaintWindowProcPtr PaintWindowBackground; - PaintWindowProcPtr PaintWindowBorder; WindowExposuresProcPtr WindowExposures; CreateGCProcPtr CreateGC; CreateColormapProcPtr CreateColormap; @@ -786,70 +784,6 @@ xxWindowExposures (WindowPtr pWin, wrap(pScrPriv, pWin->drawable.pScreen, WindowExposures, xxWindowExposures); } -static void -xxPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - xxScrPriv(pWin->drawable.pScreen); - RegionRec rgni; - - DBG("xxPaintWindow\n"); - - REGION_NULL (pWin->drawable.pScreen, &rgni); -#if 0 - REGION_UNION (pWin->drawable.pScreen, &rgni, &rgni, &pWin->borderClip); - REGION_INTERSECT(pWin->drawable.pScreen, &rgni, &rgni, pRegion); -#else - REGION_UNION (pWin->drawable.pScreen, &rgni, &rgni, pRegion); -#endif - switch (what) { - case PW_BORDER: - REGION_SUBTRACT (pWin->drawable.pScreen, &rgni, &rgni, &pWin->winSize); - if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { - DBG("PaintWindowBorder\n"); - REGION_UNION (pWin->drawable.pScreen, &pScrPriv->region, - &pScrPriv->region, &rgni); - } else { - DBG("PaintWindowBorder NoOverlay\n"); - REGION_SUBTRACT (pWin->drawable.pScreen, &pScrPriv->region, - &pScrPriv->region, &rgni); - } - unwrap (pScrPriv, pWin->drawable.pScreen, PaintWindowBorder); - pWin->drawable.pScreen->PaintWindowBorder (pWin, pRegion, what); - wrap(pScrPriv, pWin->drawable.pScreen, PaintWindowBorder, - xxPaintWindow); - break; - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - break; - default: - REGION_INTERSECT (pWin->drawable.pScreen, &rgni, - &rgni,&pWin->winSize); - if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { - DBG("PaintWindowBackground\n"); - REGION_UNION (pWin->drawable.pScreen, &pScrPriv->region, - &pScrPriv->region, &rgni); - } else { - DBG("PaintWindowBackground NoOverlay\n"); - REGION_SUBTRACT (pWin->drawable.pScreen, &pScrPriv->region, - &pScrPriv->region, &rgni); - } - break; - } - - unwrap (pScrPriv, pWin->drawable.pScreen, PaintWindowBackground); - pWin->drawable.pScreen->PaintWindowBackground (pWin, pRegion, what); - wrap(pScrPriv, pWin->drawable.pScreen, PaintWindowBackground, - xxPaintWindow); - break; - } - PRINT_RECTS(rgni); - PRINT_RECTS(pScrPriv->region); -#if 1 - REGION_UNINIT(pWin->drawable.pScreen,&rgni); -#endif -} - static void xxCopyPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg, xxCmapPrivPtr pCmapPriv) @@ -1149,8 +1083,6 @@ xxSetup(ScreenPtr pScreen, int myDepth, int baseDepth, char* addr, xxSyncFunc sy wrap (pScrPriv, pScreen, CreateScreenResources, xxCreateScreenResources); wrap (pScrPriv, pScreen, CreateWindow, xxCreateWindow); wrap (pScrPriv, pScreen, CopyWindow, xxCopyWindow); - wrap (pScrPriv, pScreen, PaintWindowBorder, xxPaintWindow); - wrap (pScrPriv, pScreen, PaintWindowBackground, xxPaintWindow); #if 0 /* can we leave this out even with backing store enabled ? */ wrap (pScrPriv, pScreen, WindowExposures, xxWindowExposures); #endif diff --git a/fb/fbscreen.c b/fb/fbscreen.c index c99ba08e2..12b19e419 100644 --- a/fb/fbscreen.c +++ b/fb/fbscreen.c @@ -122,8 +122,6 @@ fbSetupScreen(ScreenPtr pScreen, pScreen->ChangeWindowAttributes = fbChangeWindowAttributes; pScreen->RealizeWindow = fbMapWindow; pScreen->UnrealizeWindow = fbUnmapWindow; - pScreen->PaintWindowBackground = fbPaintWindow; - pScreen->PaintWindowBorder = fbPaintWindow; pScreen->CopyWindow = fbCopyWindow; pScreen->CreatePixmap = fbCreatePixmap; pScreen->DestroyPixmap = fbDestroyPixmap; diff --git a/fb/fbwindow.c b/fb/fbwindow.c index 594cc612f..89f601f29 100644 --- a/fb/fbwindow.c +++ b/fb/fbwindow.c @@ -315,58 +315,3 @@ fbFillRegionTiled (DrawablePtr pDrawable, fbFinishAccess (&pTile->drawable); fbFinishAccess (pDrawable); } - -void -fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - WindowPtr pBgWin; - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - break; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - break; - case BackgroundPixmap: - fbFillRegionTiled (&pWin->drawable, - pRegion, - pWin->background.pixmap); - break; - case BackgroundPixel: - fbFillRegionSolid (&pWin->drawable, - pRegion, - 0, - fbReplicatePixel (pWin->background.pixel, - pWin->drawable.bitsPerPixel)); - break; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - fbFillRegionSolid (&pWin->drawable, - pRegion, - 0, - fbReplicatePixel (pWin->border.pixel, - pWin->drawable.bitsPerPixel)); - } - else - { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - - fbFillRegionTiled (&pBgWin->drawable, - pRegion, - pWin->border.pixmap); - } - break; - } - fbValidateDrawable (&pWin->drawable); -} diff --git a/fb/wfbrename.h b/fb/wfbrename.h index a6296fb1d..93822442f 100644 --- a/fb/wfbrename.h +++ b/fb/wfbrename.h @@ -119,14 +119,12 @@ #define fbOverlayGeneration wfbOverlayGeneration #define fbOverlayGetScreenPrivateKey wfbOverlayGetScreenPrivateKey #define fbOverlayPaintKey wfbOverlayPaintKey -#define fbOverlayPaintWindow wfbOverlayPaintWindow #define fbOverlayScreenPrivateKey wfbOverlayScreenPrivateKey #define fbOverlaySetupScreen wfbOverlaySetupScreen #define fbOverlayUpdateLayerRegion wfbOverlayUpdateLayerRegion #define fbOverlayWindowExposures wfbOverlayWindowExposures #define fbOverlayWindowLayer wfbOverlayWindowLayer #define fbPadPixmap wfbPadPixmap -#define fbPaintWindow wfbPaintWindow #define fbPictureInit wfbPictureInit #define fbPixmapToRegion wfbPixmapToRegion #define fbPolyArc wfbPolyArc diff --git a/hw/Makefile.am b/hw/Makefile.am index 99df8e230..30662ccdd 100644 --- a/hw/Makefile.am +++ b/hw/Makefile.am @@ -1,5 +1,5 @@ if DMX -if BUILD_DARWIN +if XDARWIN # Darwin does not need the dmx subdir else DMX_SUBDIRS = dmx @@ -7,12 +7,8 @@ endif endif if XORG -if BUILD_DARWIN -# Darwin does not need the xfree86 subdir -else XORG_SUBDIRS = xfree86 endif -endif if XVFB XVFB_SUBDIRS = vfb @@ -38,15 +34,15 @@ if XPRINT XPRINT_SUBDIRS = xprint endif -if BUILD_DARWIN -DARWIN_SUBDIRS = darwin +if XDARWIN +XDARWIN_SUBDIRS = darwin endif SUBDIRS = \ $(XORG_SUBDIRS) \ $(XGL_SUBDIRS) \ $(XWIN_SUBDIRS) \ - $(DARWIN_SUBDIRS) \ + $(XDARWIN_SUBDIRS) \ $(XVFB_SUBDIRS) \ $(XNEST_SUBDIRS) \ $(DMX_SUBDIRS) \ diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am index b773910fc..a6f84ee01 100644 --- a/hw/darwin/Makefile.am +++ b/hw/darwin/Makefile.am @@ -56,34 +56,29 @@ Xquartz_SOURCES = \ quartz/xpr/x-hook.c \ quartz/xpr/x-list.c -XDarwin_LDADD = \ - $(top_builddir)/dix/dixfonts.lo \ - $(top_builddir)/dix/libdix.la \ - $(top_builddir)/config/libconfig.a \ - ./libdarwinShared.a \ - ./iokit/libiokit.a \ - $(top_builddir)/miext/shadow/libshadow.la \ - $(top_builddir)/miext/cw/libcw.la \ - $(DARWIN_LIBS) \ - $(top_builddir)/miext/rootless/librootless.la \ - $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \ - $(top_builddir)/miext/rootless/accel/librlAccel.la \ - @XORG_LIBS@ \ - $(XSERVER_LIBS) +DARWIN_LIBS = \ + $(top_builddir)/dix/dixfonts.lo \ + $(top_builddir)/config/libconfig.a \ + $(top_builddir)/miext/shadow/libshadow.la \ + $(top_builddir)/miext/cw/libcw.la \ + @DARWIN_LIBS@ \ + $(top_builddir)/miext/rootless/librootless.la \ + $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \ + $(top_builddir)/miext/rootless/accel/librlAccel.la \ + ./libdarwinShared.a \ + $(XSERVER_LIBS) -Xquartz_LDADD = \ - $(top_builddir)/dix/dixfonts.lo \ - $(top_builddir)/dix/libdix.la \ - $(top_builddir)/config/libconfig.a \ - ./libdarwinShared.a \ - $(top_builddir)/miext/shadow/libshadow.la \ - $(top_builddir)/miext/cw/libcw.la \ - $(DARWIN_LIBS) \ - $(top_builddir)/miext/rootless/librootless.la \ - $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \ - $(top_builddir)/miext/rootless/accel/librlAccel.la \ - @XORG_LIBS@ \ - $(XSERVER_LIBS) -lXplugin +XDARWIN_LIBS = \ + $(DARWIN_LIBS) \ + ./iokit/libiokit.a +XQUARTZ_LIBS = \ + $(DARWIN_LIBS) + +XDarwin_DEPENDENCIES = $(XDARWIN_LIBS) +XDarwin_LDADD = $(XDARWIN_LIBS) $(XSERVER_SYS_LIBS) + +Xquartz_DEPENDENCIES = $(XQUARTZ_LIBS) +Xquartz_LDADD = $(XQUARTZ_LIBS) $(XSERVER_SYS_LIBS) -lXplugin XDarwin_LDFLAGS = \ -XCClinker -Objc \ @@ -95,6 +90,7 @@ Xquartz_LDFLAGS = \ -Wl,-u,_miDCInitialize \ -Wl,-framework,Carbon \ -Wl,-framework,OpenGL \ + -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib \ -Wl,-framework,Cocoa \ -Wl,-framework,CoreAudio \ -Wl,-framework,IOKit @@ -118,22 +114,15 @@ XDarwinApp_SOURCES = \ $(top_srcdir)/mi/miinitext.c \ $(top_srcdir)/Xi/stubs.c -XDarwinApp_LDADD = \ - $(top_builddir)/dix/dixfonts.lo \ - $(top_builddir)/dix/libdix.la \ - $(top_builddir)/config/libconfig.a \ - $(top_builddir)/os/libos.la \ - ./quartz/XApplication.o \ - ./libdarwinShared.a \ - ./quartz/libXQuartz.a \ - $(top_builddir)/miext/shadow/libshadow.la \ - $(top_builddir)/miext/cw/libcw.la \ - $(DARWIN_LIBS) \ - $(top_builddir)/miext/rootless/librootless.la \ - $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \ - $(top_builddir)/miext/rootless/accel/librlAccel.la \ - @XORG_LIBS@ \ - $(XSERVER_LIBS) +XDARWINAPP_LIBS = \ + $(DARWIN_LIBS) \ + ./quartz/XApplication.o \ + ./libdarwinShared.a \ + ./quartz/libXQuartz.a \ + $(XSERVER_LIBS) + +XDarwinApp_DEPENDENCIES = $(XDARWINAPP_LIBS) +XDarwinApp_LDADD = $(XDARWINAPP_LIBS) $(XSERVER_SYS_LIBS) XDarwinApp_LDFLAGS = \ -XCClinker -Objc \ @@ -163,6 +152,7 @@ cr_la_LIBADD = \ $(top_builddir)/miext/rootless/accel/librlAccel.la cr_la_LDFLAGS = -shrext '' -Wl,-framework,ApplicationServices \ + -lpixman-1 \ -Wl,-framework,Cocoa \ -Wl,-framework,Carbon \ -XCClinker -ObjC \ @@ -201,7 +191,7 @@ glxMesa_la_DEPENDENCIES = XDarwinApp endif endif -if HAVE_X_PLUGIN +if HAVE_XPLUGIN xprplugindir = $(darwinappdir)/Contents/Resources/xpr.bundle/Contents/MacOS xprplugin_LTLIBRARIES = xpr.la @@ -222,6 +212,7 @@ xpr_la_LIBADD = \ $(top_builddir)/miext/rootless/accel/librlAccel.la xpr_la_LDFLAGS = -shrext '' -Wl,-framework,ApplicationServices \ + -lpixman-1 \ -lXplugin \ -XCClinker -bundle_loader -XCClinker XDarwinApp \ -module -avoid-version -no-undefined diff --git a/hw/darwin/apple/X11Application.m b/hw/darwin/apple/X11Application.m index 57795f452..2d2132102 100644 --- a/hw/darwin/apple/X11Application.m +++ b/hw/darwin/apple/X11Application.m @@ -41,7 +41,7 @@ # include "micmap.h" #undef BOOL -#include "xf86Version.h" +//#include "xf86Version.h" #include #include diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c index 7b4836805..0b22141b5 100644 --- a/hw/darwin/darwin.c +++ b/hw/darwin/darwin.c @@ -6,6 +6,7 @@ **************************************************************/ /* * Copyright (c) 2001-2004 Torrey T. Lyons. All Rights Reserved. + * Copyright (c) 2007 Apple Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -46,8 +47,6 @@ #include "fb.h" // fb framebuffer code #include "site.h" #include "globals.h" -#include "xorgVersion.h" -#include "xf86Date.h" #include "dix.h" #ifdef XINPUT @@ -83,7 +82,7 @@ int darwinScreenIndex = 0; io_connect_t darwinParamConnect = 0; int darwinEventReadFD = -1; int darwinEventWriteFD = -1; -int darwinMouseAccelChange = 1; +// int darwinMouseAccelChange = 1; int darwinFakeButtons = 0; // location of X11's (0,0) point in global screen coordinates @@ -127,86 +126,23 @@ const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]); #ifndef PRE_RELEASE #define PRE_RELEASE XORG_VERSION_SNAP #endif - -void -DarwinPrintBanner() -{ -#if PRE_RELEASE - ErrorF("\n" - "This is a pre-release version of the " XVENDORNAME " X11.\n" - "Portions of this release are based on XFree86 4.4RC2 and selected\n" - "files from XFree86 4.4RC3. It is not supported in any way.\n" - "Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.\n" - "Select the \"xorg\" product for bugs you find in this release.\n" - "Before reporting bugs in pre-release versions please check the\n" - "latest version in the " XVENDORNAME " \"monolithic tree\" CVS\n" - "repository hosted at http://www.freedesktop.org/Software/xorg/"); +#ifndef BUILD_DATE +#define BUILD_DATE "" #endif -#if XORG_VERSION_SNAP > 0 - ErrorF(".%d", XORG_VERSION_SNAP); +#ifndef XORG_RELEASE +#define XORG_RELEASE "?" #endif -#if XORG_VERSION_SNAP >= 900 - ErrorF(" (%d.%d.0 RC %d)", XORG_VERSION_MAJOR, XORG_VERSION_MINOR + 1, - XORG_VERSION_SNAP - 900); -#endif - -#ifdef XORG_CUSTOM_VERSION - ErrorF(" (%s)", XF86_CUSTOM_VERSION); -#endif - ErrorF("\nRelease Date: %s\n", XF86_DATE); - ErrorF("X Protocol Version %d, Revision %d, %s\n", - X_PROTOCOL, X_PROTOCOL_REVISION, XORG_RELEASE ); - ErrorF("Build Operating System: %s %s\n", OSNAME, OSVENDOR); -#ifdef HAS_UTSNAME - { - struct utsname name; - - if (uname(&name) == 0) { - ErrorF("Current Operating System: %s %s %s %s %s\n", - name.sysname, name.nodename, name.release, name.version, name.machine); - } - } -#endif -#if defined(BUILD_DATE) && (BUILD_DATE > 19000000) - { - struct tm t; - char buf[100]; - - bzero(&t, sizeof(t)); - bzero(buf, sizeof(buf)); - t.tm_mday = BUILD_DATE % 100; - t.tm_mon = (BUILD_DATE / 100) % 100 - 1; - t.tm_year = BUILD_DATE / 10000 - 1900; - if (strftime(buf, sizeof(buf), "%d %B %Y", &t)) - ErrorF("Build Date: %s\n", buf); - } -#endif -#if defined(CLOG_DATE) && (CLOG_DATE > 19000000) - { - struct tm t; - char buf[100]; - - bzero(&t, sizeof(t)); - bzero(buf, sizeof(buf)); - t.tm_mday = CLOG_DATE % 100; - t.tm_mon = (CLOG_DATE / 100) % 100 - 1; - t.tm_year = CLOG_DATE / 10000 - 1900; - if (strftime(buf, sizeof(buf), "%d %B %Y", &t)) - ErrorF("Changelog Date: %s\n", buf); - } -#endif -#if defined(BUILDERSTRING) - ErrorF("%s \n",BUILDERSTRING); -#endif - ErrorF("\tBefore reporting problems, check "__VENDORDWEBSUPPORT__"\n" - "\tto make sure that you have the latest version.\n"); +void DDXRingBell(int volume, int pitch, int duration) { + // FIXME -- make some noise, yo } - -void DDXRingBell(int volume, int pitch, int duration) -{ - // FIXME -- make some noise, yo +void +DarwinPrintBanner(void) +{ + // this should change depending on which specific server we are building + ErrorF("X11.app starting:\n"); + ErrorF("Xquartz server based on X.org %s, built on %s\n", XORG_RELEASE, BUILD_DATE ); } @@ -359,8 +295,8 @@ static Bool DarwinAddScreen( dixScreenOrigins[index].x = dfb->x; dixScreenOrigins[index].y = dfb->y; - ErrorF("Screen %d added: %dx%d @ (%d,%d)\n", - index, dfb->width, dfb->height, dfb->x, dfb->y); + /* ErrorF("Screen %d added: %dx%d @ (%d,%d)\n", + index, dfb->width, dfb->height, dfb->x, dfb->y); */ return TRUE; } @@ -373,6 +309,7 @@ static Bool DarwinAddScreen( ============================================================================= */ +#if 0 /* * DarwinChangePointerControl * Set mouse acceleration and thresholding @@ -393,7 +330,7 @@ static void DarwinChangePointerControl( if (kr != KERN_SUCCESS) ErrorF( "Could not set mouse acceleration with kernel return = 0x%x.\n", kr ); } - +#endif /* * DarwinMouseProc @@ -416,12 +353,11 @@ static int DarwinMouseProc( map[3] = 3; map[4] = 4; map[5] = 5; - InitPointerDeviceStruct( (DevicePtr)pPointer, - map, - 5, // numbuttons (4 & 5 are scroll wheel) - GetMotionHistory, - DarwinChangePointerControl, - GetMotionHistorySize(), 2 ); + InitPointerDeviceStruct( (DevicePtr)pPointer, map, 5, + GetMotionHistory, + (PtrCtrlProcPtr)NoopDDA, + GetMotionHistorySize(), 2); + #ifdef XINPUT InitValuatorAxisStruct( pPointer, 0, // X axis @@ -643,8 +579,8 @@ DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo) for (i = 0; i < pScreenInfo->numScreens; i++) { dixScreenOrigins[i].x -= darwinMainScreenX; dixScreenOrigins[i].y -= darwinMainScreenY; - ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n", - i, dixScreenOrigins[i].x, dixScreenOrigins[i].y); + /* ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n", + i, dixScreenOrigins[i].x, dixScreenOrigins[i].y); */ } } } @@ -725,10 +661,6 @@ void OsVendorInit(void) } darwinKeymapFile = tempStr; } - - if ( !darwinKeymapFile ) { - ErrorF("Reading keymap from the system.\n"); - } } @@ -926,7 +858,7 @@ void ddxUseMsg( void ) */ void ddxGiveUp( void ) { - ErrorF( "Quitting XDarwin...\n" ); + ErrorF( "Quitting XQuartz...\n" ); DarwinModeGiveUp(); } @@ -949,7 +881,6 @@ void AbortDDX( void ) } -#ifdef DPMSExtension /* * DPMS extension stubs */ @@ -966,8 +897,6 @@ int DPMSGet(int *level) { return -1; } -#endif - #include "mivalidate.h" // for union _Validate used by windowstr.h #include "windowstr.h" // for struct _Window diff --git a/hw/darwin/darwin.h b/hw/darwin/darwin.h index 70101eca5..20f45be93 100644 --- a/hw/darwin/darwin.h +++ b/hw/darwin/darwin.h @@ -48,7 +48,7 @@ typedef struct { // From darwin.c -void DarwinPrintBanner(); +void DarwinPrintBanner(void); int DarwinParseModifierList(const char *constmodifiers); void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo); void xf86SetRootClip (ScreenPtr pScreen, BOOL enable); diff --git a/hw/darwin/iokit/xfIOKit.c b/hw/darwin/iokit/xfIOKit.c index c7ebd1c18..9de33c064 100644 --- a/hw/darwin/iokit/xfIOKit.c +++ b/hw/darwin/iokit/xfIOKit.c @@ -62,8 +62,8 @@ #define NO_CFPLUGIN #include #include +#include #include -#include // Define this to work around bugs in the display drivers for // older PowerBook G3's. If the X server starts without this diff --git a/hw/darwin/quartz/Makefile.am b/hw/darwin/quartz/Makefile.am index 993cdb0ec..f8dc16765 100644 --- a/hw/darwin/quartz/Makefile.am +++ b/hw/darwin/quartz/Makefile.am @@ -5,7 +5,7 @@ AM_OBJCFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@ INCLUDES = -I$(srcdir) -I$(srcdir)/.. @XORG_INCS@ AM_DEFS = -DHAS_CG_MACH_PORT -DHAS_KL_API -if HAVE_X_PLUGIN +if HAVE_XPLUGIN AM_DEFS += -DBUILD_XPR endif DEFS = @DEFS@ $(AM_DEFS) -DXBINDIR=\"${bindir}\" diff --git a/hw/darwin/quartz/Preferences.m b/hw/darwin/quartz/Preferences.m index eb78fd32a..a79454b13 100644 --- a/hw/darwin/quartz/Preferences.m +++ b/hw/darwin/quartz/Preferences.m @@ -356,7 +356,7 @@ static NSString *X11EnableKeyEquivalentsKey = @"EnableKeyEquivalents"; [[NSUserDefaults standardUserDefaults] setBool:newMouseAccelChange forKey:@"AllowMouseAccelChange"]; // Update the setting used by the X server thread - darwinMouseAccelChange = newMouseAccelChange; + // darwinMouseAccelChange = newMouseAccelChange; } + (void)setUseQDCursor:(int)newUseQDCursor diff --git a/hw/darwin/quartz/pseudoramiX.c b/hw/darwin/quartz/pseudoramiX.c index 7ba6d5a15..e65be69a0 100644 --- a/hw/darwin/quartz/pseudoramiX.c +++ b/hw/darwin/quartz/pseudoramiX.c @@ -43,6 +43,9 @@ Equipment Corporation. #include #include "globals.h" +extern int noPseudoramiXExtension; +extern int noPanoramiXExtension; + extern int ProcPanoramiXQueryVersion (ClientPtr client); static void PseudoramiXResetProc(ExtensionEntry *extEntry); diff --git a/hw/darwin/quartz/quartz.c b/hw/darwin/quartz/quartz.c index eac765257..0f0351652 100644 --- a/hw/darwin/quartz/quartz.c +++ b/hw/darwin/quartz/quartz.c @@ -209,7 +209,7 @@ static void QuartzUpdateScreens(void) pRoot = WindowTable[pScreen->myNum]; AppleWMSetScreenOrigin(pRoot); pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL); - pScreen->PaintWindowBackground(pRoot, &pRoot->borderClip, PW_BACKGROUND); + miPaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); // QuartzIgnoreNextWarpCursor(); DefineInitialRootWindow(pRoot); diff --git a/hw/darwin/quartz/quartzCocoa.m b/hw/darwin/quartz/quartzCocoa.m index c54c18acb..42eabcbae 100644 --- a/hw/darwin/quartz/quartzCocoa.m +++ b/hw/darwin/quartz/quartzCocoa.m @@ -66,7 +66,7 @@ void QuartzReadPreferences(void) darwinFakeButtons = [Preferences fakeButtons]; darwinFakeMouse2Mask = [Preferences button2Mask]; darwinFakeMouse3Mask = [Preferences button3Mask]; - darwinMouseAccelChange = [Preferences mouseAccelChange]; + // darwinMouseAccelChange = [Preferences mouseAccelChange]; quartzUseSysBeep = [Preferences systemBeep]; quartzEnableKeyEquivalents = [Preferences enableKeyEquivalents]; diff --git a/hw/darwin/quartz/xpr/xprScreen.c b/hw/darwin/quartz/xpr/xprScreen.c index 67a0737ef..034cbac6d 100644 --- a/hw/darwin/quartz/xpr/xprScreen.c +++ b/hw/darwin/quartz/xpr/xprScreen.c @@ -306,9 +306,6 @@ static Bool xprSetupScreen(int index, ScreenPtr pScreen) { // Add alpha protecting replacements for fb screen functions - pScreen->PaintWindowBackground = SafeAlphaPaintWindow; - pScreen->PaintWindowBorder = SafeAlphaPaintWindow; - #ifdef RENDER { PictureScreenPtr ps = GetPictureScreen(pScreen); diff --git a/hw/darwin/utils/dumpkeymap.c b/hw/darwin/utils/dumpkeymap.c index d2eeca5c2..0c8bdcd01 100644 --- a/hw/darwin/utils/dumpkeymap.c +++ b/hw/darwin/utils/dumpkeymap.c @@ -143,7 +143,7 @@ #include #include #if !defined(DUMPKEYMAP_FILE_ONLY) -#include +#include #endif #define PROG_NAME "dumpkeymap" diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am index 002ea112a..8457aea60 100644 --- a/hw/dmx/Makefile.am +++ b/hw/dmx/Makefile.am @@ -81,13 +81,16 @@ Xdmx_SOURCES = dmx.c \ #Xdmx_SOURCES += fakecw.c #endif +XDMX_LIBS = \ + @XDMX_LIBS@ \ + $(GLX_LIBS) \ + input/libdmxinput.a \ + config/libdmxconfig.a \ + $(XSERVER_LIBS) + Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) -Xdmx_LDADD = $(XORG_CORE_LIBS) \ - $(XDMX_LIBS) \ - $(GLX_LIBS) \ - input/libdmxinput.a \ - config/libdmxconfig.a \ - @DMXMODULES_LIBS@ +Xdmx_DEPENDENCIES= $(XDMX_LIBS) +Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS) # Man page appmandir = $(APP_MAN_DIR) diff --git a/hw/dmx/dmx.h b/hw/dmx/dmx.h index 37f42a76f..4fef91537 100644 --- a/hw/dmx/dmx.h +++ b/hw/dmx/dmx.h @@ -209,8 +209,6 @@ typedef struct _DMXScreenInfo { UnrealizeWindowProcPtr UnrealizeWindow; RestackWindowProcPtr RestackWindow; WindowExposuresProcPtr WindowExposures; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; ResizeWindowProcPtr ResizeWindow; diff --git a/hw/dmx/dmxinput.c b/hw/dmx/dmxinput.c index d644b5d0d..83f8a4a90 100644 --- a/hw/dmx/dmxinput.c +++ b/hw/dmx/dmxinput.c @@ -105,3 +105,14 @@ void dmxUpdateWindowInfo(DMXUpdateType type, WindowPtr pWindow) if (!dmxInput->detached && dmxInput->updateWindowInfo) dmxInput->updateWindowInfo(dmxInput, type, pWindow); } + +int +NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) +{ + return BadRequest; +} + +void +DeleteInputDeviceRequest(DeviceIntPtr pDev) +{ +} diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c index 9b15bb38c..1d12ec32d 100644 --- a/hw/dmx/dmxscrinit.c +++ b/hw/dmx/dmxscrinit.c @@ -314,9 +314,6 @@ Bool dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[]) DMX_WRAP(UnrealizeWindow, dmxUnrealizeWindow, dmxScreen, pScreen); DMX_WRAP(RestackWindow, dmxRestackWindow, dmxScreen, pScreen); DMX_WRAP(WindowExposures, dmxWindowExposures, dmxScreen, pScreen); - DMX_WRAP(PaintWindowBackground, dmxPaintWindowBackground, dmxScreen, - pScreen); - DMX_WRAP(PaintWindowBorder, dmxPaintWindowBorder, dmxScreen, pScreen); DMX_WRAP(CopyWindow, dmxCopyWindow, dmxScreen, pScreen); DMX_WRAP(ResizeWindow, dmxResizeWindow, dmxScreen, pScreen); @@ -453,8 +450,6 @@ Bool dmxCloseScreen(int idx, ScreenPtr pScreen) DMX_UNWRAP(UnrealizeWindow, dmxScreen, pScreen); DMX_UNWRAP(RestackWindow, dmxScreen, pScreen); DMX_UNWRAP(WindowExposures, dmxScreen, pScreen); - DMX_UNWRAP(PaintWindowBackground, dmxScreen, pScreen); - DMX_UNWRAP(PaintWindowBorder, dmxScreen, pScreen); DMX_UNWRAP(CopyWindow, dmxScreen, pScreen); DMX_UNWRAP(ResizeWindow, dmxScreen, pScreen); diff --git a/hw/dmx/dmxwindow.c b/hw/dmx/dmxwindow.c index fa6b9a279..7494e6df2 100644 --- a/hw/dmx/dmxwindow.c +++ b/hw/dmx/dmxwindow.c @@ -795,57 +795,6 @@ void dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn, DMX_WRAP(WindowExposures, dmxWindowExposures, dmxScreen, pScreen); } -/** Paint background of \a pWindow in \a pRegion. */ -void dmxPaintWindowBackground(WindowPtr pWindow, RegionPtr pRegion, int what) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; - dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow); - BoxPtr pBox; - int nBox; - - DMX_UNWRAP(PaintWindowBackground, dmxScreen, pScreen); -#if 0 - if (pScreen->PaintWindowBackground) - pScreen->PaintWindowBackground(pWindow, pRegion, what); -#endif - - if (pWinPriv->window) { - /* Paint window background on back-end server */ - pBox = REGION_RECTS(pRegion); - nBox = REGION_NUM_RECTS(pRegion); - while (nBox--) { - XClearArea(dmxScreen->beDisplay, pWinPriv->window, - pBox->x1 - pWindow->drawable.x, - pBox->y1 - pWindow->drawable.y, - pBox->x2 - pBox->x1, - pBox->y2 - pBox->y1, - False); - pBox++; - } - dmxSync(dmxScreen, False); - } - - DMX_WRAP(PaintWindowBackground, dmxPaintWindowBackground, dmxScreen, pScreen); -} - -/** Paint window border for \a pWindow in \a pRegion. */ -void dmxPaintWindowBorder(WindowPtr pWindow, RegionPtr pRegion, int what) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; - - DMX_UNWRAP(PaintWindowBorder, dmxScreen, pScreen); -#if 0 - if (pScreen->PaintWindowBorder) - pScreen->PaintWindowBorder(pWindow, pRegion, what); -#endif - - /* Paint window border on back-end server */ - - DMX_WRAP(PaintWindowBorder, dmxPaintWindowBorder, dmxScreen, pScreen); -} - /** Move \a pWindow on the back-end server. Determine whether or not it * is on or offscreen, and realize it if it is newly on screen and the * lazy window creation optimization is enabled. */ diff --git a/hw/dmx/dmxwindow.h b/hw/dmx/dmxwindow.h index 1a984331e..72c76aa3b 100644 --- a/hw/dmx/dmxwindow.h +++ b/hw/dmx/dmxwindow.h @@ -81,10 +81,6 @@ extern Bool dmxUnrealizeWindow(WindowPtr pWindow); extern void dmxRestackWindow(WindowPtr pWindow, WindowPtr pOldNextSib); extern void dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn, RegionPtr other_exposed); -extern void dmxPaintWindowBackground(WindowPtr pWindow, RegionPtr pRegion, - int what); -extern void dmxPaintWindowBorder(WindowPtr pWindow, RegionPtr pRegion, - int what); extern void dmxCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc); diff --git a/hw/kdrive/Makefile.am b/hw/kdrive/Makefile.am index 267d772e2..5803644d5 100644 --- a/hw/kdrive/Makefile.am +++ b/hw/kdrive/Makefile.am @@ -1,5 +1,5 @@ if KDRIVEVESA -VESA_SUBDIRS = vesa ati chips epson i810 mach64 mga neomagic nvidia pm2 r128 \ +VESA_SUBDIRS = vesa ati chips epson i810 mach64 mga nvidia pm2 r128 \ smi via endif diff --git a/hw/kdrive/ati/ChangeLog b/hw/kdrive/ati/ChangeLog deleted file mode 100644 index a76712897..000000000 --- a/hw/kdrive/ati/ChangeLog +++ /dev/null @@ -1,622 +0,0 @@ -2006-02-15 Keith Packard - - * Makefile.am: - * ati.c: (ATIMapReg): - * ati.h: - * ati_cursor.c: (ATIMoveCursor), (ClassicSetCursorColors), - (ClassicLoadCursor), (RadeonLoadCursor), (ATIUnloadCursor): - Fix kdrive pointer signed/unsigned types. - -2006-02-14 Eric Anholt - - * ati_draw.c: (ATIDrawDisable): - Remove the waitSync from KdDisableScreen and push it off to drivers' - disableAccel hook, which is more correct anyway. This makes kdrive.c - not have any knowledge of kaa, opening the way for using exa from - kdrive. - -2006-02-09 Keith Packard - - reviewed by: Eric Anholt - - * ati_video.c: (RadeonDisplayVideo): - Replace TRI_FAN with RECT_LIST to eliminate tearing - -2005-08-07 Keith Packard - - * ati_video.c: (RadeonDisplayVideo): - Build with modular X libraries and headers - -2005-06-09 Eric Anholt - - * ati.h: - * ati_video.c: - Axe a few dead fields from the port priv struct and add my name to - the "Copyright" line of the license to ati_video.c that already has my - name in the text. - -2005-06-09 Eric Anholt - - * ati_dri.c: - Perform a warnings sweep on hw/kdrive. A number of these were my fault, - but some come from others. - -2005-06-09 Eric Anholt - - * ati.c: - * ati.h: - * ati_draw.c: (ATIWaitMarker), (ATIGetOffsetPitch), - (ATIUploadToScreen), (ATIUploadToScratch), (ATIDrawInit), - (ATIDrawEnable): - * ati_dri.c: (ATIDRISwapContext): - * ati_video.c: (R128DisplayVideo), (RadeonDisplayVideo): - - Replace the syncAccel hook in the kdrive structure with a pair of - hooks in the kaa structure: markSync and waitMarker. The first, if - set, returns a hardware-dependent marker number which can then be - waited for with waitMarker. If markSync is absent (which is the case - on all drivers currently), waitMarker must wait for idle on any given - marker number. The intention is to allow for more parallelism when - we get downloading from framebuffer, or more fine-grained idling. - - Replace the KdMarkSync/KdCheckSync functions with kaaMarkSync and - kaaWaitSync. These will need to be refined when KAA starts being - smart about using them. Merge kpict.c into kasync.c since kasyn.c has - all the rest of these fallback funcs. - - Restructure all drivers to initialize a KaaInfo structure by hand - rather than statically in dubious order. - - Whack the i810 driver into shape in hopes that it'll work after this - change (it certainly wouldn't have before this). Doesn't support my - i845 though. - - Make a new KXV helper to avoid duplicated code to fill the region - with the necessary color key. Use it in i810 and mach64 (tested). - -2005-02-28 Keith Packard - - * ati_reg.h: - Add macrovision register defines - -2005-01-24 19:37 anholt - - * ati_dma.c, ati_draw.c, ati_reg.h: Finish converting RB2D_DSTCACHE - to RB3D_DSTCACHE. Remove an extra pixel cache flush in the idle - function. Init an extra reg for r200, and annotate the - TCL_BYPASS better. Also, clean up some style nits from the last - commit. - -2005-01-24 18:39 keithp - - * ati.h, ati_draw.c, ati_reg.h, radeon_composite.c: Add tracing. - Hack Radeon cache registers to use 3D addresses. Works on M6 - -2005-01-24 17:38 anholt - - * ati_dri.c: Silence a warning about uninitialized variable (though - it would be). - -2005-01-20 08:22 anholt - - * ati_dma.c, ati_dma.h, ati_dri.c: Add a set of macros for dealing - with the repeated code to wait for a while reading a - register/attempting DMA. Now it'll wait for a certain number of - seconds rather than a certain number of times through the loop - before deciding that it's timed out and resetting the hardware. - Also, add more timeout handling, and reset the draw state after - resetting the engine. - -2005-01-19 23:28 anholt - - * radeon_composite.c: Use RadeonSwitchTo3D() instead of doing the - WAIT_UNTIL ourselves (RST3D() also does DC_FLUSH, which may be - important). - -2005-01-19 23:09 anholt - - * ati_video.c: Add R200 XV support, and make R100 (hopefully) use - linear filtering instead of nearest. Also, use RadeonSwitchTo3D - instead of doing the WAIT_UNTIL ourselves. - -2005-01-19 17:09 anholt - - * ati_dma.c, ati_reg.h: Make R200 PDMA work -- primary queue sizes - are now 9 bits, not 8. - -2004-12-22 10:39 anholt - - * ati_draw.c, ati_reg.h, radeon_composite.c: Back out the previous - day's broken R200 "fix" -- the same number of coords are always - emitted. Fix the real problem, which was not enough regs being - initialized in ati_draw.c. Fix a typo that was resulting in - alpha coming out as 0 * src or 0 * broken instead of src * 1 or - src * mask. Assign the blending results to R0, as appears to be - necessary. Unbreak the dst-alpha-blend-with-no-dst-alpha code. - Yow. And set the right DMA count for the r200 traps code. - -2004-12-21 01:51 anholt - - * ati_draw.c, radeon_composite.c: Fix r200 render (for real this - time?) by setting tex1_comp_cnt right for non-mask rendering. - Reenable it. Also, R200TexFormats was used instead of R100 in - one place. Harmless so far, because the formats were in the same - order. - -2004-12-21 01:49 anholt - - * ati_dri.c: Whitespace nit. - -2004-09-19 20:12 anholt - - * ati_draw.c, ati_reg.h, radeon_composite.c: Fix the R200 Render - code. Composite and Trapezoids are now supported just as well as - on R100. - -2004-09-19 03:57 anholt - - * ati_dri.c, ati_reg.h: Unbreak the AGP DRI case. That was quite a - pile of broken code. - -2004-09-13 23:26 anholt - - * ati.c, ati_reg.h: Add proper PCI/AGP detection, based on Mike - Harris's code for Radeon, but using the MMIO mirror of the bits - instead of config space. - -2004-09-12 16:22 anholt - - * ati_draw.c: - Fix a segfault on VT switch with DRI. Still dies - due to cursor allocation troubles. - Move the - RemoveBlockAndWakeupHandlers to match - RegisterBlockAndWakeupHandlers. - Enable R100 trapezoid - "acceleration" when DRI is working, so that it can be exposed - and worked on. - -2004-09-12 16:01 anholt - - * ati_dri.c: Fix a bad argument missed in the previous commit for - ATIDRIDMA* functions. - -2004-09-12 15:21 anholt - - * ati_draw.c: Move the RegisterBlockAndWakeupHandlers to before DRI - initialization. The change to use that instead of manual - wrapping made the DMA dispatch come after the lock had been - dropped, causing lots of pain. - -2004-09-12 13:31 anholt - - * ati.h, ati_dma.c, ati_dri.c: Reset the CCE/CP on engine reset, - and make the ATIDRIDMA functions take a more useful argument. - -2004-09-12 13:19 anholt - - * ati_draw.c: Add missing kaa.h include for kaaInitTrapOffsets. - -2004-09-12 13:02 anholt - - * ati_dri.c: Fix handling of is_agp. is_agp is whether the card is - actually AGP, while using_agp should say whether AGP is being - used as part of DMA/DRI. - -2004-09-12 12:52 anholt - - * ati_dma.c, ati_dma.h, ati_dri.c: Improve error handling, - especially in the DRI case. Do some FatalErrors instead of - ErrorFs for things that are really bad, and put limits on some - loops. Now, sometimes instead of hanging the entire system, we - (mostly-) cleanly drop to console when the card has hung. - -2004-09-11 02:28 anholt - - * ati.h, ati_dma.h, ati_draw.c, ati_draw.h, ati_reg.h, - r128_composite.c, radeon_composite.c: - Add disabled WIP - trapezoid code for R128 and R100. The R128 rendering is not - doing an add of 1 per triangle like I hoped, and instead seems - to be saturating all the pixels or something. The R100 - acceleration renders pretty well, with some gaps. Note that - both are slower than software due to lack of DMA to submit - vertices. - Mostly fix R128 and Radeon transform support, - including supporting bilinear filtering on R128. Subpixel - offsets are still probably an issue (reported by rendercheck), - but I want to make 100% sure about my understanding of the - protocol before changing everybody, including fb. - Add support - for dst formats without alpha to R128 Composite. - Remove the - R128 Blend code, which has long outlived its usefulness. (I - kept it around for one reason: It could be useful for the w/h - > 1024 case with no mask and a non-src op. That seems pretty - infrequent and not worth the trouble). - -2004-07-24 10:02 keithp - - * ati.c: Check for mmio before restoring crtc/crtc2 pitch registers - -2004-07-22 11:17 keithp - - * ati.c, ati.h, ati_cursor.c, ati_reg.h: 2004-07-22 Keith Packard - - - reviewed by: - - * hw/kdrive/ati/ati.c: (ATISetOffscreen), (ATISetPitch), - (ATIRandRSetConfig), (ATIPreserve), (ATIRestore), - (ATIEnable): - * hw/kdrive/ati/ati.h: - * hw/kdrive/ati/ati_cursor.c: (RadeonLoadCursor), - (ATIUnloadCursor), (ATICursorEnable): - * hw/kdrive/ati/ati_reg.h: - Correct pitch so that accelerator can run on 1400x1050 - screens. - Add a few more register sets for cursors. - -2004-07-19 05:07 anholt - - * radeon_composite.c: Add support for a8b8g8r8 and x8b8g8r8 - pictures, which showed up frequently with metacity usage. - -2004-07-19 04:42 anholt - - * ati_cursor.c: Breakage in last commit to this file: - pCurPriv->area isn't set up until Enable, these days. - -2004-07-19 04:19 anholt - - * ati_draw.c: Set the right number of texture coordinates for r200 - Render support (still disabled, needs to be tested). - -2004-07-19 04:16 anholt - - * r128_composite.c, radeon_composite.c: - Add Radeon picture - transform support. - On R128, don't refer to an old Composite's - mask transform when the current Composite doesn't have a mask. - - Staticize some global variables in r128_composite.c. - -2004-07-19 00:53 anholt - - * ati.c, ati.h, ati_cursor.c, ati_draw.c, ati_draw.h: Use the - offscreen memory manager as much as possible to do the - reservation of memory at startup. Do some drive-by cleanups - while I'm here (sorry!). - -2004-07-19 00:20 anholt - - * r128_composite.c: Add support for transforms of textures on R128. - -2004-07-03 03:23 anholt - - * r128_composite.c: Clean up Rage 128 composite code. Now it - composites more operations correctly and is simpler. - -2004-06-27 17:48 keithp - - * ati.c, ati.h, ati_cursor.c, ati_draw.c: 2004-06-27 Keith Packard - - - * hw/kdrive/ati/ati.c: (ATICardInit), (ATISetOffscreen), - (ATIScreenInit), (ATIRandRSetConfig), (ATIRandRInit), - (ATIFinishInitScreen), (ATIEnable): - * hw/kdrive/ati/ati.h: - * hw/kdrive/ati/ati_cursor.c: (ATICursorInit): - * hw/kdrive/ati/ati_draw.c: (RadeonSwitchTo2D), - (RadeonSwitchTo3D), - (ATIBlockHandler), (ATIWakeupHandler), (ATIDrawEnable), - (ATIDrawDisable), (ATIDrawFini): - Separate out off-screen allocation from Init. - Fix Enable to update off-screen addresses. - Wrap RandR to update off-screen addresses. - - * hw/kdrive/fbdev/fbdev.c: (fbdevMapFramebuffer): - Set off_screen_base and memory_size fields correctly. - -2004-06-25 21:13 keithp - - * ati.c, ati_cursor.c, ati_draw.c, ati_reg.h: 2004-06-25 Keith - Packard - - * hw/kdrive/ati/ati.c: (ATIScreenInit): - * hw/kdrive/ati/ati_cursor.c: (ATIMoveCursor), - (ClassicAllocCursorColors), (ClassicSetCursorColors), - (ClassicRecolorCursor), (ClassicLoadCursor), - (RadeonLoadCursor), - (ATIRealizeCursor), (ATISetCursor), (ATICursorEnable), - (ATIRecolorCursor): - * hw/kdrive/ati/ati_draw.c: (ATIDrawFini): - * hw/kdrive/ati/ati_reg.h: - Add ARGB cursor support for Radeon cards. - -2004-06-10 12:22 anholt - - * ati_draw.c: - Pass the right pixel mask (all ones) in to - PrepareSolid in the solid-fill-based composite acceleration. - - Use a real pixmap when doing an UploadToScratch (For - pDrawable->type == DRAWABLE_WINDOW, you need to get the backing - pixmap). - Pass back the x/y offsets from kaaGetOffscreenPixmap - unconditionally, because they'll be used in the scratch case. - - Turn on the Render acceleration for Rage 128 and Radeon - 100-series at last! - -2004-06-10 02:50 anholt - - * ati_draw.c: Align scratch area offsets to the offscreen byte - alignment. - -2004-06-10 01:37 anholt - - * ati_dma.c: Oops, testers reported that the last patch actually - didn't work (conflicts occurred), so the R300 PDMA doesn't work. - Disable. - -2004-06-09 22:57 anholt - - * ati_dma.c, ati_microcode.c: Bug #242: Fix setup of R300 cards, by - providing R300 CP code from volodya-project and initializing - PDMA. - -2004-05-17 13:18 anholt - - * Makefile.am, ati.c, ati.h, ati_cursor.c, ati_dma.c, ati_dma.h, - ati_draw.c, ati_draw.h, ati_dri.c, ati_microcode.c, ati_reg.h, - ati_video.c, r128_composite.c, radeon_composite.c: Overhaul of - the ATI driver: - Add monochrome hardware cursor support. - Try - to auto-detect AGP support for DRI on Radeons. And fail. - Detect it properly on R128. - Set up card for pseudo-DMA if - possible. Convert 2D rendering code to prepare DMA packets - only. Use generic code to decode DMA packets to MMIO if PDMA - is unavailable. Add WIP code to support "real" DMA without DRM - support. - Dispatch pending DMA commands when the server sleeps. - Otherwise some things, such as typing in an xterm, wouldn't - show up for a time. - Fix Radeon Composite acceleration in - many ways, and add Rage 128 Composite acceleration. Disable - them both due to still-not-understood issues they have. They - fail with In, Out, AtopReverse, and Xor, and text rendering is - strange. - Add textured XV support for R100 and Rage 128. No - brightness/sat controls, but it does support multiple ports, - and cooperates with Composite. - Add WIP code for hostdata - uploads. - Many cleanups and fixes. - -2004-01-24 21:31 anholt - - * ati_dri.c: Disable GLX visuals code on !GLXEXT, and remove a - useless prototype. - -2004-01-24 17:30 anholt - - * ati.c, ati.h, ati_dri.c, radeon_composite.c: - Add glx visuals - code based on XFree86's Radeon driver. - Reserve areas for - back/depth/span when USING_DRI && GLXEXT. This would be better - in a TransitionTo3d, but we'd need to work with the offscreen - memory manager for that. - Misc. fixes to ati_dri.c for DRI+GLX. - Needs more work still. - -2004-01-24 17:16 anholt - - * ati_draw.h: Oops, turn fallback output back off. - -2004-01-24 17:04 anholt - - * ati_dri.c: Whitespace cleanup. - -2004-01-10 16:10 anholt - - * ati_draw.c, r128_blendtmp.h: Support 1x1 repeat sources in R128's - Blend. - -2004-01-09 00:43 anholt - - * ati.c, ati.h, ati_draw.c, ati_draw.h, ati_dri.c: Change PCI ID - information field to be one of r128, r100, r200, r300. This is - all the information we need so far. Put that information into - atic, and use it correctly in the code (unlike before). - -2004-01-08 12:18 anholt - - * ati_draw.c, radeon_composite.c: Compile fixes for non-DRI case - and for non-C99 compiler. - -2004-01-08 00:25 anholt - - * ati.c: Forced commit: Previous commit included the removal of the - 8192 scanline limit on offscreen memory in the fbdev case. I - remember daenzer (who originally put that code in) saying he - wasn't sure of it, and there doesn't seem to be any reason for - that limit given how acceleration is done. - -2004-01-08 00:16 anholt - - * ati.c, ati.h, ati_draw.c: - Add a new UploadToScratch kaa hook - for putting the data for a single pixmap into temporary - offscreen storage. Subsequent UploadToScratch may clobber the - data of previous ones. This allows hardware acceleration of - composite operations on glyphs. - Add a new UploadToScreen kaa - hook for doing the actual moving of data to framebuffer. This - would allow us to do things like hostdata blits or memcpy to - agp and then blit. - Add an UploadToScreen on ATI which is just - memcpy, but which will be replaced with a hostdata blit soon. - - Add UploadToScratch on ATI and reserve 64k of scratch space. - This provided a 3x speedup of rgb24text on my Radeon. - -2004-01-06 18:30 anholt - - * radeon_composite.c: Speed things up slightly by removing Z values - from emitted vertices and by emitting as a tri fan rather than a - tri list. A rect list would save an additional vertex (out of 4) - per rectangle, but there's no measurable speed difference and the - tri fan may be useful when transforms come into play. - -2004-01-04 12:47 anholt - - * ati_draw.c, radeon_composite.c: - Correctly set the texture - coordinate set source for the second texture unit. - Re-enable - Radeon's Composite accel now that fonts work again. - -2004-01-03 03:46 anholt - - * ati_draw.c, radeon_composite.c: - Add more Composite operations, - including Saturate, to Radeon Composite accel. I don't 100% - trust that the math works for Saturate, but I can't tell from - existing information. - Fix texture pitch fallback checks. - - Fallback when src or mask have transforms. - Disable Radeon - Composite accel until the offset thing is fixed. - Set - offscreenPitch to 64 on Radeon thanks to new information and a - kaa fix. Fixes acceleration at width!=1024. - -2003-12-31 15:24 anholt - - * radeon_composite.c: Some strange \240 character snuck into the - original commit of this file. - -2003-12-30 00:45 anholt - - * ati_drawtmp.h: There's never a copy between different depths. - Remove the check. - -2003-12-30 00:23 anholt - - * Makefile.am, ati_draw.c, ati_draw.h, ati_drawtmp.h, ati_reg.h, - radeon_composite.c: - Add new Composite hook for kdrive drivers, - which only ensures that the pixmaps are offscreen and don't - have alpha maps. It is the last case checked before going to - software fallback - Use the new Composite hook in the ati driver - to implement acceleration of most Composites that get done in - an xcompmgr environment on r100 series cards. It is only - available when using the DRM. There are still some corruption - issues, but the DRI is still non-default and I need to get this - into version control. - -2003-12-29 01:04 anholt - - * Makefile.am: Add dependency lines so that servers are rebuilt - when server libraries are changed. - -2003-12-28 22:24 anholt - - * Makefile.am, ati.c, ati.h, ati_draw.c, ati_draw.h, ati_drawtmp.h, - ati_dri.c, ati_dri.h, ati_dripriv.h, ati_reg.h, ati_sarea.h, - ati_stub.c, r128_blendtmp.h, r128_common.h, r128_sarea.h, - radeon_common.h, radeon_sarea.h: Merge dri-0-1-branch to trunk. - Notable changes: - Add libdrm and libdri. Portions of the DRI - extension are stubbed out. - Use the DRM in the ATI driver - when available. This provides a minor performance improvement - in x11perf, and opens the possibility of using the 3d hardware - for acceleration in the future. - Implement solid fill - acceleration for Composite in KAA. - Implement Blend hook for - Composite and use it on r128. - Fix a bug of mine that resulted - in overuse of offscreen memory. - Fix many miscellaneous bugs in - ATI driver and add PCI IDs. - -2003-12-28 21:10 anholt - - * ati_drawtmp.h, r128_blendtmp.h: - Disable libdrm verbosity. It - isn't important enough yet to make a run-time flag for it. - - Fix the (void)atic; tricks to quiet unused variable warnings in - ATI template files. Mixing statements and variable defines works - in newer compilers, but not pdx's. - -2003-12-28 01:16 anholt - - * ati.h, ati_draw.c, ati_draw.h, ati_drawtmp.h, ati_dri.c, - r128_blendtmp.h: - Allow acceleration between same-depth pixmaps, - rather than between anything and a dst that matched the screen - depth (fixes corruption for non-screen-depth src and makes more - acceleration possible). - Add ATI_FALLBACK macro and use it to - allow verbose descriptions of why hardware acceleration fails. - - Check that src and dst alignment meet requirements of the card - before accelerating. The BIOS may set up screens that don't - meet the requirements. - Fix the R128 offset alignment (32 - bytes, not 8). - Enable Blend operation even if screen is 24bpp - (it will fail if the dest is 24bpp anyway). - -2003-12-27 02:46 anholt - - * ati_reg.h, r128_blendtmp.h: Properly initialize texture registers - in Blend. Fixes problems with blending code such as whiteness in - test-render, or no blending at all. - - Tested by: andersca - -2003-12-23 14:29 anholt - - * Makefile.am, ati_draw.c, ati_drawtmp.h, ati_reg.h, - r128_blendtmp.h: - Implement acceleration of Composite on R128 - when there is no mask, no transformation, no repeat, and only - certain ops are used. - Add debugging output for software - fallbacks for Composite. - Allow pixmaps in offscreen that don't - match root depth. - Clean up some mess in ati_reg.h. - - Many thanks to andersca for a lot of this code. - -2003-12-09 21:01 anholt - - * ati_draw.c: Add missing kaaDrawFini to ATI driver. - -2003-12-01 14:56 anholt - - * Makefile.am, ati.c, ati.h, ati_draw.c, ati_draw.h, ati_drawtmp.h, - ati_dri.c, ati_dri.h, ati_dripriv.h, ati_reg.h, ati_sarea.h, - ati_stub.c, r128_common.h, r128_sarea.h, radeon_common.h, - radeon_sarea.h: - Initial add of enough of the DRI to create a 2d - driver that uses the DRM for its acceleration. - Converted the - ATI driver to use the DRM to execute rendering commands using - DMA instead of MMIO when available. - -2003-11-30 20:33 anholt - - * Makefile.am, ati.c, ati.h, ati_stub.c: - Add fbdev mode-setting - backend to Xati. It and vesa are compiled in when available, - with fbdev being used by default. - Use depth 16 by default when - vesa backend is used. - Add MMIO defines for PowerPC (should be - in a common location). - - Many thanks for Michel Daenzer for much of this code. - -2003-11-30 19:15 anholt - - * ati.c: Add more RV250 PCI IDs. - -2003-11-30 17:46 anholt - - * ati_draw.c: Remove sys/io.h inclusion from some files that didn't - need it, and change asm/io.h to sys/io.h in vga.c, which newer - Linux complains about. - -2003-11-25 14:39 anholt - - * ati.c: Add new Radeon 9200 PCI IDs. - -2003-11-23 02:12 anholt - - * ati_draw.c: - Fix Radeon offscreen pixmap pitch alignment. - - Remove usleeps from idle and waitavail code, recommended by - keithp. - Add a workaround for apparent broken acceleration with - Rage 128 and offset alignment with 8-bit acceleration (24-hack - and plain 8-bit). - Minor cleanup of setup code. - -2003-11-22 18:08 anholt - - * ati.c: Add RV250 PCI IDs. - -2003-11-19 23:49 anholt - - * ati.c, ati.h, ati_draw.c, ati_reg.h: - Fix a bug in pitch - alignment for offscren pixmaps. - Add 24-bit acceleration for - Xati using the 8-bit trick from mach64. - Add offscreen pixmap - support to Xati. - -2003-11-19 16:05 anholt - - * ati.c, ati_draw.c: - Fix confusion of depth/bitsPerPixel in - ati_draw.c - Disable acceleration with 24bpp due to apparent - broken acceleration. Accel at 24bpp was the cause of the - crashes when people tried to use any depth over 16. XFree86 - doesn't support 24 either. - Disable at < 8bpp, too. - Add the - other Rage 128 PCI IDs. - Remove unnecessary setting of scissor - registers (only default scissor gets used). - -2003-11-19 00:32 anholt - - * .cvsignore, Makefile.am, ati.c, ati.h, ati_draw.c, ati_reg.h, - ati_stub.c: - Add PCI information (device/vendor id, bus - location) to KdCardAttr to help with ati, and future DRM - drivers. - Add new "ati" kdrive driver. It has ancestry in the - r128 driver from andersca, but took a detour through being the - WIP SiS 300 driver on the way. It supports Radeons (tested on - QD VIVO and 7500) and Rage 128. Current limitations include - that it requires depth 16 and that the other Rage 128 PCI IDs - aren't included yet. - diff --git a/hw/kdrive/ati/Makefile.am b/hw/kdrive/ati/Makefile.am index 9e1fc7f57..8429250f3 100644 --- a/hw/kdrive/ati/Makefile.am +++ b/hw/kdrive/ati/Makefile.am @@ -60,8 +60,7 @@ ATI_LIBS = \ Xati_LDADD = \ $(ATI_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xati_DEPENDENCIES = \ libati.a \ diff --git a/hw/kdrive/chips/Makefile.am b/hw/kdrive/chips/Makefile.am index 8188a8e7e..51b0edf31 100644 --- a/hw/kdrive/chips/Makefile.am +++ b/hw/kdrive/chips/Makefile.am @@ -22,8 +22,7 @@ CHIPS_LIBS = \ Xchips_LDADD = \ $(CHIPS_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xchips_DEPENDENCIES = \ libchips.a \ diff --git a/hw/kdrive/ephyr/ephyr_draw.c b/hw/kdrive/ephyr/ephyr_draw.c index 84faecc00..93ef27ad3 100644 --- a/hw/kdrive/ephyr/ephyr_draw.c +++ b/hw/kdrive/ephyr/ephyr_draw.c @@ -520,6 +520,5 @@ exaDDXDriverInit(ScreenPtr pScreen) ExaScreenPriv(pScreen); pExaScr->migration = ExaMigrationSmart; - pExaScr->hideOffscreenPixmapData = TRUE; pExaScr->checkDirtyCorrectness = TRUE; } diff --git a/hw/kdrive/epson/Makefile.am b/hw/kdrive/epson/Makefile.am index cd2057132..2a440149d 100644 --- a/hw/kdrive/epson/Makefile.am +++ b/hw/kdrive/epson/Makefile.am @@ -22,8 +22,7 @@ EPSON_LIBS = \ Xepson_LDADD = \ $(EPSON_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xepson_DEPENDENCIES = \ libepson.a \ diff --git a/hw/kdrive/fbdev/Makefile.am b/hw/kdrive/fbdev/Makefile.am index ea2aff3b3..1ce4833a7 100644 --- a/hw/kdrive/fbdev/Makefile.am +++ b/hw/kdrive/fbdev/Makefile.am @@ -16,8 +16,7 @@ Xfbdev_SOURCES = \ Xfbdev_LDADD = \ libfbdev.a \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xfbdev_DEPENDENCIES = \ libfbdev.a \ diff --git a/hw/kdrive/i810/Makefile.am b/hw/kdrive/i810/Makefile.am index e3a702dde..ea02cb67d 100644 --- a/hw/kdrive/i810/Makefile.am +++ b/hw/kdrive/i810/Makefile.am @@ -25,8 +25,7 @@ I810_LIBS = \ Xi810_LDADD = \ $(I810_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xi810_DEPENDENCIES = \ libi810.a \ diff --git a/hw/kdrive/igs/igsdraw.c b/hw/kdrive/igs/igsdraw.c index d2ae098a6..e1ff2befc 100644 --- a/hw/kdrive/igs/igsdraw.c +++ b/hw/kdrive/igs/igsdraw.c @@ -1367,74 +1367,6 @@ igsCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); } -void -igsPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - KdScreenPriv(pWin->drawable.pScreen); - PixmapPtr pTile; - - if (!REGION_NUM_RECTS(pRegion)) - return; - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - pTile = pWin->background.pixmap; - if (igsPatternDimOk (pTile->drawable.width) && - igsPatternDimOk (pTile->drawable.height)) - { - igsFillBoxTiled ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pTile, - pWin->drawable.x, pWin->drawable.y, GXcopy); - return; - } - break; - case BackgroundPixel: - igsFillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel, GXcopy, ~0); - return; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - igsFillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel, GXcopy, ~0); - return; - } - else - { - pTile = pWin->border.pixmap; - if (igsPatternDimOk (pTile->drawable.width) && - igsPatternDimOk (pTile->drawable.height)) - { - igsFillBoxTiled ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pTile, - pWin->drawable.x, pWin->drawable.y, GXcopy); - return; - } - } - break; - } - KdCheckPaintWindow (pWin, pRegion, what); -} Bool igsDrawInit (ScreenPtr pScreen) @@ -1453,9 +1385,7 @@ igsDrawInit (ScreenPtr pScreen) */ pScreen->CreateGC = igsCreateGC; pScreen->CopyWindow = igsCopyWindow; - pScreen->PaintWindowBackground = igsPaintWindow; - pScreen->PaintWindowBorder = igsPaintWindow; - + /* * Initialize patterns */ diff --git a/hw/kdrive/mach64/Makefile.am b/hw/kdrive/mach64/Makefile.am index 537939083..746ffff8f 100644 --- a/hw/kdrive/mach64/Makefile.am +++ b/hw/kdrive/mach64/Makefile.am @@ -29,8 +29,7 @@ MACH64_LIBS = \ Xmach64_LDADD = \ $(MACH64_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xmach64_DEPENDENCIES = \ libmach64.a \ diff --git a/hw/kdrive/mga/Makefile.am b/hw/kdrive/mga/Makefile.am index 0598651d6..37bc50cf2 100644 --- a/hw/kdrive/mga/Makefile.am +++ b/hw/kdrive/mga/Makefile.am @@ -24,8 +24,7 @@ MGA_LIBS = \ Xmga_LDADD = \ $(MGA_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xmga_DEPENDENCIES = \ libmga.a \ diff --git a/hw/kdrive/neomagic/ChangeLog b/hw/kdrive/neomagic/ChangeLog deleted file mode 100644 index 4e0788e5a..000000000 --- a/hw/kdrive/neomagic/ChangeLog +++ /dev/null @@ -1,98 +0,0 @@ -2006-02-15 Keith Packard - - * Makefile.am: - Add XSERVER_LIBS to build in xorg tree - -2005-08-07 Keith Packard - - * neo_draw.c: - Build with modular X libraries and headers - -2005-06-09 Eric Anholt - - * neo_draw.c: - * neomagic.c: (neoScreenInit): - Perform a warnings sweep on hw/kdrive. A number of these were my fault, - but some come from others. - -2005-06-09 Eric Anholt - - * neo_draw.c: (neoWaitMarker), (neoDrawInit): - * neomagic.c: - * neomagic.h: - - Replace the syncAccel hook in the kdrive structure with a pair of - hooks in the kaa structure: markSync and waitMarker. The first, if - set, returns a hardware-dependent marker number which can then be - waited for with waitMarker. If markSync is absent (which is the case - on all drivers currently), waitMarker must wait for idle on any given - marker number. The intention is to allow for more parallelism when - we get downloading from framebuffer, or more fine-grained idling. - - Replace the KdMarkSync/KdCheckSync functions with kaaMarkSync and - kaaWaitSync. These will need to be refined when KAA starts being - smart about using them. Merge kpict.c into kasync.c since kasyn.c has - all the rest of these fallback funcs. - - Restructure all drivers to initialize a KaaInfo structure by hand - rather than statically in dubious order. - - Whack the i810 driver into shape in hopes that it'll work after this - change (it certainly wouldn't have before this). Doesn't support my - i845 though. - - Make a new KXV helper to avoid duplicated code to fill the region - with the necessary color key. Use it in i810 and mach64 (tested). - -2005-02-08 Keith Packard - - reviewed by: - - * ChangeLog: - * neomagicstub.c: (InitInput): - -2005-02-08 Keith Packard - - reviewed by: - - * ChangeLog: - * neomagicstub.c: (InitInput): - -2005-02-08 Keith Packard - - reviewed by: - - * ChangeLog: - * neomagicstub.c: (InitInput): - -2005-02-08 Keith Packard - - reviewed by: - - * ChangeLog: - * neomagicstub.c: (InitInput): - -2005-02-08 Keith Packard - - reviewed by: - - * neomagicstub.c: (InitInput): - -2004-07-21 Phil Blundell - - * Makefile.am (Xneomagic_LDADD): Include -lts if appropriate. - Patch from pattieja@bentham.ispvip.biz. - -2004-06-07 Franco Catrin L. - * Small fix for depth calculation - -2004-04-11 Franco Catrin L. - - * Basic bitblt implementation - * Fixed width and height calculation in solids - * Added ROP (not tested) - -2004-04-10 Franco Catrin L. - - * MMIO enabled after switching to new VT - * First acceleration function implemented (DrawSolid) - -2004-04-06 Franco Catrin L. - - * Returned to a working state. Brent will - continue working on a backend in a separate CVS branch diff --git a/hw/kdrive/neomagic/Makefile.am b/hw/kdrive/neomagic/Makefile.am index 468654711..95f0e1eaa 100644 --- a/hw/kdrive/neomagic/Makefile.am +++ b/hw/kdrive/neomagic/Makefile.am @@ -19,8 +19,6 @@ bin_PROGRAMS = Xneomagic noinst_LIBRARIES = libneomagic.a libneomagic_a_SOURCES = \ - backend.h \ - backend.c \ neomagic.c \ neomagic.h \ neo_draw.c diff --git a/hw/kdrive/neomagic/backend.c b/hw/kdrive/neomagic/backend.c deleted file mode 100644 index 12fbf030a..000000000 --- a/hw/kdrive/neomagic/backend.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Generic card driving functions. - * Essentially, cascades calls to fbdev and vesa to initialize cards that - * do not have hardware-specific routines yet. Copied from the ati driver. - * - * Copyright (c) 2004 Brent Cook - * - * This code is licensed under the GPL. See the file COPYING in the root - * directory of the sources for details. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "backend.h" - -Bool -backendInitialize(KdCardInfo *card, BackendInfo *backend) -{ - Bool success = FALSE; - -#ifdef KDRIVEVESA - if (!success && vesaInitialize(card, &backend->priv.vesa)) { - success = TRUE; - backend->type = VESA; - backend->cardfini = vesaCardFini; - backend->scrfini = vesaScreenFini; - backend->initScreen = vesaInitScreen; - backend->finishInitScreen = vesaFinishInitScreen; - backend->createRes = vesaCreateResources; - backend->preserve = vesaPreserve; - backend->restore = vesaRestore; - backend->dpms = vesaDPMS; - backend->enable = vesaEnable; - backend->disable = vesaDisable; - backend->getColors = vesaGetColors; - backend->putColors = vesaPutColors; - } -#endif -#ifdef KDRIVEFBDEV - if (!success && fbdevInitialize(card, &backend->priv.fbdev)) { - success = TRUE; - backend->type = FBDEV; - backend->cardfini = fbdevCardFini; - backend->scrfini = fbdevScreenFini; - backend->initScreen = fbdevInitScreen; - backend->finishInitScreen = fbdevFinishInitScreen; - backend->createRes = fbdevCreateResources; - backend->preserve = fbdevPreserve; - backend->restore = fbdevRestore; - backend->dpms = fbdevDPMS; - backend->enable = fbdevEnable; - backend->disable = fbdevDisable; - backend->getColors = fbdevGetColors; - backend->putColors = fbdevPutColors; - } -#endif - return success; -} - -Bool -backendScreenInitialize(KdScreenInfo *screen, BackendScreen *backendScreen, - BackendInfo *backendCard) -{ - Bool success = FALSE; - -#ifdef KDRIVEFBDEV - if (backendCard->type == FBDEV) { - screen->card->driver = &backendCard->priv.fbdev; - success = fbdevScreenInitialize(screen, &backendScreen->fbdev); - screen->memory_size = backendCard->priv.fbdev.fix.smem_len; - screen->off_screen_base = backendCard->priv.fbdev.var.yres_virtual - * screen->fb[0].byteStride; - } -#endif -#ifdef KDRIVEVESA - if (backendCard->type == VESA) { - screen->card->driver = &backendCard->priv.vesa; - if (screen->fb[0].depth == 0) { - screen->fb[0].depth = 16; - } - success = vesaScreenInitialize(screen, &backendScreen->vesa); - } -#endif - return success; -} diff --git a/hw/kdrive/neomagic/backend.h b/hw/kdrive/neomagic/backend.h deleted file mode 100644 index 33eae2680..000000000 --- a/hw/kdrive/neomagic/backend.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Generic card driving functions. - * Essentially, cascades calls to fbdev and vesa to initialize cards that - * do not have hardware-specific routines yet. Copied from the ati driver. - * - * Copyright (c) 2004 Brent Cook - * - * This code is licensed under the GPL. See the file COPYING in the root - * directory of the sources for details. - */ - -#ifndef _BACKEND_H_ -#define _BACKEND_H_ -#include "kdrive.h" - -#ifdef KDRIVEFBDEV -#include -#endif -#ifdef KDRIVEVESA -#include -#endif - -typedef enum _BackendType {VESA, FBDEV} BackendType; - -typedef struct _BackendInfo { - // backend info - BackendType type; - - // backend internal structures - union { -#ifdef KDRIVEFBDEV - FbdevPriv fbdev; -#endif -#ifdef KDRIVEVESA - VesaCardPrivRec vesa; -#endif - } priv; - - // pointers to helper functions for this backend - void (*cardfini)(KdCardInfo *); - void (*scrfini)(KdScreenInfo *); - Bool (*initScreen)(ScreenPtr); - Bool (*finishInitScreen)(ScreenPtr pScreen); - Bool (*createRes)(ScreenPtr); - void (*preserve)(KdCardInfo *); - void (*restore)(KdCardInfo *); - Bool (*dpms)(ScreenPtr, int); - Bool (*enable)(ScreenPtr); - void (*disable)(ScreenPtr); - void (*getColors)(ScreenPtr, int, int, xColorItem *); - void (*putColors)(ScreenPtr, int, int, xColorItem *); -} BackendInfo; - -typedef union _BackendScreen { -#ifdef KDRIVEFBDEV - FbdevScrPriv fbdev; -#endif -#ifdef KDRIVEVESA - VesaScreenPrivRec vesa; -#endif -} BackendScreen; - -Bool -backendInitialize(KdCardInfo *card, BackendInfo *backend); - -Bool -backendScreenInitialize(KdScreenInfo *screen, BackendScreen *backendScreen, - BackendInfo *backendCard); - -#endif diff --git a/hw/kdrive/nvidia/Makefile.am b/hw/kdrive/nvidia/Makefile.am index 8ebfec9de..b380e44ee 100644 --- a/hw/kdrive/nvidia/Makefile.am +++ b/hw/kdrive/nvidia/Makefile.am @@ -25,8 +25,7 @@ NVIDIA_LIBS = \ Xnvidia_LDADD = \ $(NVIDIA_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xnvidia_DEPENDENCIES = \ libnvidia.a \ diff --git a/hw/kdrive/pm2/Makefile.am b/hw/kdrive/pm2/Makefile.am index b2b48ba6a..208d0319e 100644 --- a/hw/kdrive/pm2/Makefile.am +++ b/hw/kdrive/pm2/Makefile.am @@ -23,8 +23,7 @@ PM2_LIBS = \ Xpm2_LDADD = \ $(PM2_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xpm2_DEPENDENCIES = \ libpm2.a \ diff --git a/hw/kdrive/r128/Makefile.am b/hw/kdrive/r128/Makefile.am index 609e0f5d2..62c1fcfa3 100644 --- a/hw/kdrive/r128/Makefile.am +++ b/hw/kdrive/r128/Makefile.am @@ -22,8 +22,7 @@ R128_LIBS = \ Xr128_LDADD = \ $(R128_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xr128_DEPENDENCIES = \ libr128.a \ diff --git a/hw/kdrive/savage/s3.h b/hw/kdrive/savage/s3.h index 628abc806..d8db0ebbf 100644 --- a/hw/kdrive/savage/s3.h +++ b/hw/kdrive/savage/s3.h @@ -470,7 +470,6 @@ void s3CursorDisable (ScreenPtr pScreen); void s3CursorFini (ScreenPtr pScreen); void s3RecolorCursor (ScreenPtr pScreen, int ndef, xColorItem *pdefs); -void s3DumbPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what); void s3DumbCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); Bool s3DrawInit (ScreenPtr pScreen); diff --git a/hw/kdrive/savage/s3draw.c b/hw/kdrive/savage/s3draw.c index 39cc256b3..311a7dc01 100644 --- a/hw/kdrive/savage/s3draw.c +++ b/hw/kdrive/savage/s3draw.c @@ -2260,71 +2260,6 @@ s3PaintKey (DrawablePtr pDrawable, } #endif -void -s3PaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - SetupS3(pWin->drawable.pScreen); - s3ScreenInfo(pScreenPriv); - s3PatternPtr pPattern; - - DRAW_DEBUG ((DEBUG_PAINT_WINDOW, "s3PaintWindow 0x%x extents %d %d %d %d n %d", - pWin->drawable.id, - pRegion->extents.x1, pRegion->extents.y1, - pRegion->extents.x2, pRegion->extents.y2, - REGION_NUM_RECTS(pRegion))); - if (!REGION_NUM_RECTS(pRegion)) - return; - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - pPattern = s3GetWindowPrivate(pWin); - if (pPattern) - { - s3FillBoxPattern ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - GXcopy, ~0, pPattern); - return; - } - break; - case BackgroundPixel: - s3FillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel, GXcopy, ~0); - return; - } - break; - case PW_BORDER: -#ifndef S3_TRIO - if (s3s->fbmap[1] >= 0) - fbOverlayUpdateLayerRegion (pWin->drawable.pScreen, - fbOverlayWindowLayer (pWin), - pRegion); -#endif - if (pWin->borderIsPixel) - { - s3FillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel, GXcopy, ~0); - return; - } - break; - } - KdCheckPaintWindow (pWin, pRegion, what); -} - void s3CopyWindowProc (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, @@ -3005,55 +2940,6 @@ s3_24CreateWindow(WindowPtr pWin) return fbCreateWindow (pWin); } -void -s3_24PaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - SetupS3(pWin->drawable.pScreen); - s3PatternPtr pPattern; - - DRAW_DEBUG ((DEBUG_PAINT_WINDOW, "s3PaintWindow 0x%x extents %d %d %d %d n %d", - pWin->drawable.id, - pRegion->extents.x1, pRegion->extents.y1, - pRegion->extents.x2, pRegion->extents.y2, - REGION_NUM_RECTS(pRegion))); - if (!REGION_NUM_RECTS(pRegion)) - return; - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixel: - if (ok24(pWin->background.pixel)) - { - s3_24FillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel, GXcopy, ~0); - return; - } - } - break; - case PW_BORDER: - if (pWin->borderIsPixel && ok24(pWin->border.pixel)) - { - s3_24FillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel, GXcopy, ~0); - return; - } - break; - } - KdCheckPaintWindow (pWin, pRegion, what); -} Bool s3DrawInit (ScreenPtr pScreen) @@ -3088,8 +2974,6 @@ s3DrawInit (ScreenPtr pScreen) { pScreen->CreateGC = s3_24CreateGC; pScreen->CreateWindow = s3_24CreateWindow; - pScreen->PaintWindowBackground = s3_24PaintWindow; - pScreen->PaintWindowBorder = s3_24PaintWindow; pScreen->CopyWindow = s3CopyWindow; } else @@ -3100,8 +2984,6 @@ s3DrawInit (ScreenPtr pScreen) pScreen->CreateWindow = s3CreateWindow; pScreen->ChangeWindowAttributes = s3ChangeWindowAttributes; pScreen->DestroyWindow = s3DestroyWindow; - pScreen->PaintWindowBackground = s3PaintWindow; - pScreen->PaintWindowBorder = s3PaintWindow; #ifndef S3_TRIO if (pScreenPriv->screen->fb[1].depth) { diff --git a/hw/kdrive/sdl/Makefile.am b/hw/kdrive/sdl/Makefile.am index e74249967..fe9309e46 100644 --- a/hw/kdrive/sdl/Makefile.am +++ b/hw/kdrive/sdl/Makefile.am @@ -7,9 +7,8 @@ bin_PROGRAMS = Xsdl Xsdl_SOURCES = sdl.c -Xsdl_LDADD = @KDRIVE_PURE_LIBS@ \ +Xsdl_LDADD = \ @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ \ @XSDL_LIBS@ Xsdl_DEPENDENCIES = @KDRIVE_LOCAL_LIBS@ diff --git a/hw/kdrive/sis530/sisdraw.c b/hw/kdrive/sis530/sisdraw.c index fd80fa76a..f2b39a477 100644 --- a/hw/kdrive/sis530/sisdraw.c +++ b/hw/kdrive/sis530/sisdraw.c @@ -1537,75 +1537,6 @@ sisCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); } -void -sisPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - KdScreenPriv(pWin->drawable.pScreen); - PixmapPtr pTile; - - if (!REGION_NUM_RECTS(pRegion)) - return; - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - pTile = pWin->background.pixmap; - if (sisPatternDimOk (pTile->drawable.width) && - sisPatternDimOk (pTile->drawable.height)) - { - sisFillBoxTiled ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pTile, - pWin->drawable.x, pWin->drawable.y, GXcopy); - return; - } - break; - case BackgroundPixel: - sisFillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel, GXcopy); - return; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - sisFillBoxSolid((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel, GXcopy); - return; - } - else - { - pTile = pWin->border.pixmap; - if (sisPatternDimOk (pTile->drawable.width) && - sisPatternDimOk (pTile->drawable.height)) - { - sisFillBoxTiled ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pTile, - pWin->drawable.x, pWin->drawable.y, GXcopy); - return; - } - } - break; - } - KdCheckPaintWindow (pWin, pRegion, what); -} - Bool sisDrawInit (ScreenPtr pScreen) { @@ -1621,9 +1552,7 @@ sisDrawInit (ScreenPtr pScreen) */ pScreen->CreateGC = sisCreateGC; pScreen->CopyWindow = sisCopyWindow; - pScreen->PaintWindowBackground = sisPaintWindow; - pScreen->PaintWindowBorder = sisPaintWindow; - + return TRUE; } diff --git a/hw/kdrive/smi/Makefile.am b/hw/kdrive/smi/Makefile.am index 6cee31610..a4d6624c5 100644 --- a/hw/kdrive/smi/Makefile.am +++ b/hw/kdrive/smi/Makefile.am @@ -27,8 +27,7 @@ SMI_LIBS = \ Xsmi_LDADD = \ $(SMI_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xsmi_DEPENDENCIES = \ libsmi.a \ diff --git a/hw/kdrive/src/kaa.c b/hw/kdrive/src/kaa.c index da618bee5..486967783 100644 --- a/hw/kdrive/src/kaa.c +++ b/hw/kdrive/src/kaa.c @@ -1008,52 +1008,6 @@ kaaFillRegionTiled (DrawablePtr pDrawable, } #endif -static void -kaaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - - if (!REGION_NUM_RECTS(pRegion)) - return; - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixel: - kaaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->background.pixel); - return; -#if 0 - case BackgroundPixmap: - kaaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->background.pixmap); - return; -#endif - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - kaaFillRegionSolid((DrawablePtr)pWin, pRegion, pWin->border.pixel); - return; - } -#if 0 - else - { - kaaFillRegionTiled((DrawablePtr)pWin, pRegion, pWin->border.pixmap); - return; - } -#endif - break; - } - KdCheckPaintWindow (pWin, pRegion, what); -} - Bool kaaDrawInit (ScreenPtr pScreen, KaaScreenInfoPtr pScreenInfo) @@ -1083,8 +1037,6 @@ kaaDrawInit (ScreenPtr pScreen, */ pScreen->CreateGC = kaaCreateGC; pScreen->CopyWindow = kaaCopyWindow; - pScreen->PaintWindowBackground = kaaPaintWindow; - pScreen->PaintWindowBorder = kaaPaintWindow; #ifdef RENDER if (ps) { ps->Composite = kaaComposite; diff --git a/hw/kdrive/src/kasync.c b/hw/kdrive/src/kasync.c index 51909630e..5388f217d 100644 --- a/hw/kdrive/src/kasync.c +++ b/hw/kdrive/src/kasync.c @@ -223,14 +223,6 @@ KdCheckGetSpans (DrawablePtr pDrawable, fbGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); } -void -KdCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what) -{ - kaaWaitSync (pWin->drawable.pScreen); - kaaDrawableDirty ((DrawablePtr)pWin); - fbPaintWindow (pWin, pRegion, what); -} - void KdCheckCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { @@ -265,8 +257,6 @@ KdScreenInitAsync (ScreenPtr pScreen) { pScreen->GetImage = KdCheckGetImage; pScreen->GetSpans = KdCheckGetSpans; - pScreen->PaintWindowBackground = KdCheckPaintWindow; - pScreen->PaintWindowBorder = KdCheckPaintWindow; pScreen->CopyWindow = KdCheckCopyWindow; #ifdef RENDER KdPictureInitAsync (pScreen); diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h index d6646f0ef..8722ba303 100644 --- a/hw/kdrive/src/kdrive.h +++ b/hw/kdrive/src/kdrive.h @@ -611,9 +611,6 @@ KdCheckGetSpans (DrawablePtr pDrawable, int nspans, char *pdstStart); -void -KdCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what); - void KdCheckCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); diff --git a/hw/kdrive/vesa/Makefile.am b/hw/kdrive/vesa/Makefile.am index d58f20f95..ac50d2bf5 100644 --- a/hw/kdrive/vesa/Makefile.am +++ b/hw/kdrive/vesa/Makefile.am @@ -21,8 +21,7 @@ Xvesa_SOURCES = \ Xvesa_LDADD = \ libvesa.a \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xvesa_DEPENDENCIES = \ libvesa.a \ diff --git a/hw/kdrive/via/Makefile.am b/hw/kdrive/via/Makefile.am index 8c8189d12..249b3f31e 100644 --- a/hw/kdrive/via/Makefile.am +++ b/hw/kdrive/via/Makefile.am @@ -23,8 +23,7 @@ VIA_LIBS = \ Xvia_LDADD = \ $(VIA_LIBS) \ - @KDRIVE_LIBS@ \ - @XSERVER_LIBS@ + @KDRIVE_LIBS@ Xvia_DEPENDENCIES = \ libvia.a \ diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am index 6842b45a5..9ceecccc0 100644 --- a/hw/vfb/Makefile.am +++ b/hw/vfb/Makefile.am @@ -19,12 +19,13 @@ libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c Xvfb_SOURCES = $(SRCS) -Xvfb_LDADD = $(XORG_CORE_LIBS) \ - $(XVFB_LIBS) \ - $(XSERVER_LIBS) \ - $(EXTENSION_LIBS) \ - $(XVFBMODULES_LIBS) \ - libfbcmap.a +XVFB_LIBS = \ + @XVFB_LIBS@ \ + libfbcmap.a \ + $(XSERVER_LIBS) + +Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS) +Xvfb_DEPENDENCIES = $(XVFB_LIBS) # Man page include $(top_srcdir)/cpprules.in diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am index 3ba6adc16..9be022010 100644 --- a/hw/xfree86/Makefile.am +++ b/hw/xfree86/Makefile.am @@ -48,7 +48,7 @@ osandcommon.c xorg.c: DISTCLEANFILES = osandcommon.c xorg.c XORG_LIBS = \ - @XORG_CORE_LIBS@ \ + $(XSERVER_LIBS) \ common/libinit.a \ loader/libloader.a \ libosandcommon.la \ @@ -59,14 +59,14 @@ XORG_LIBS = \ ramdac/libramdac.a \ ddc/libddc.a \ i2c/libi2c.a \ - @XORG_LIBS@ + dixmods/libxorgxkb.la \ + $(top_builddir)/mi/libmi.la \ + $(top_builddir)/os/libos.la \ + @XORG_LIBS@ \ + dixmods/libxorgxkb.la -Xorg_DEPENDENCIES = \ - $(XORG_LIBS) - -Xorg_LDADD = $(XORG_LIBS) \ - @XSERVER_LIBS@ \ - dixmods/libxorgxkb.la +Xorg_DEPENDENCIES = $(XORG_LIBS) +Xorg_LDADD = $(XORG_LIBS) $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) diff --git a/hw/xfree86/common/atKeynames.h b/hw/xfree86/common/atKeynames.h index f31f53377..85f13ac32 100644 --- a/hw/xfree86/common/atKeynames.h +++ b/hw/xfree86/common/atKeynames.h @@ -66,7 +66,7 @@ #define KanaMask Mod4Mask #define ScrollLockMask Mod5Mask -#define KeyPressed(k) (keyc->down[k >> 3] & (1 << (k & 7))) +#define KeyPressed(k) (keyc->postdown[k >> 3] & (1 << (k & 7))) #define ModifierDown(k) ((keyc->state & (k)) == (k)) /* diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index f8febc5a4..183c3cdb3 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -138,12 +138,6 @@ Bool xf86IsEntityPrimary(int entityIndex); resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes); resPtr xf86SetOperatingState(resList list, int entityIndex, int mask); void xf86EnterServerState(xf86State state); -resRange xf86GetBlock(unsigned long type, memType size, - memType window_start, memType window_end, - memType align_mask, resPtr avoid); -resRange xf86GetSparse(unsigned long type, memType fixed_bits, - memType decode_mask, memType address_mask, - resPtr avoid); memType xf86ChkConflict(resRange *rgp, int entityIndex); ScrnInfoPtr xf86FindScreenForEntity(int entityIndex); Bool xf86NoSharedResources(int screenIndex, resType res); diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 537ddf7a4..3dc08f8a2 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -77,9 +77,6 @@ static resPtr AccReducers = NULL; resPtr Acc = NULL; resPtr osRes = NULL; -/* allocatable ranges */ -resPtr ResRange = NULL; - /* predefined special resources */ _X_EXPORT resRange resVgaExclusive[] = {_VGA_EXCLUSIVE, _END}; _X_EXPORT resRange resVgaShared[] = {_VGA_SHARED, _END}; @@ -1366,11 +1363,6 @@ xf86ResourceBrokerInit(void) osRes = NULL; - /* Get the addressable ranges */ - ResRange = xf86BusAccWindowsFromOS(); - xf86MsgVerb(X_INFO, 3, "Addressable bus resource ranges are\n"); - xf86PrintResList(3, ResRange); - /* Get the ranges used exclusively by the system */ osRes = xf86AccResFromOS(osRes); xf86MsgVerb(X_INFO, 3, "OS-reported resource ranges:\n"); @@ -1548,213 +1540,6 @@ RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment, Bool useEstimated #endif -/* - * Resource request code - */ - -#define ALIGN(x,a) ((x) + a) &~(a) - -_X_EXPORT resRange -xf86GetBlock(unsigned long type, memType size, - memType window_start, memType window_end, - memType align_mask, resPtr avoid) -{ - memType min, max, tmp; - resRange r = {ResEnd,0,0}; - resPtr res_range = ResRange; - - if (!size) return r; - if (window_end < window_start || (window_end - window_start) < (size - 1)) { - ErrorF("Requesting insufficient memory window!:" - " start: 0x%lx end: 0x%lx size 0x%lx\n", - window_start,window_end,size); - return r; - } - type = (type & ~(ResExtMask | ResBios | ResEstimated)) | ResBlock; - - while (res_range) { - if ((type & ResTypeMask) == (res_range->res_type & ResTypeMask)) { - if (res_range->block_begin > window_start) - min = res_range->block_begin; - else - min = window_start; - if (res_range->block_end < window_end) - max = res_range->block_end; - else - max = window_end; - min = ALIGN(min,align_mask); - /* do not produce an overflow! */ - while (min < max && (max - min) >= (size - 1)) { - RANGE(r,min,min + size - 1,type); - tmp = ChkConflict(&r,Acc,SETUP); - if (!tmp) { - tmp = ChkConflict(&r,avoid,SETUP); - if (!tmp) { - return r; - } - } - min = ALIGN(tmp,align_mask); - } - } - res_range = res_range->next; - } - RANGE(r,0,0,ResEnd); - return r; -} - -#define mt_max ~(memType)0 -#define length sizeof(memType) * 8 -/* - * make_base() -- assign the lowest bits to the bits set in mask. - * example: mask 011010 val 0000110 -> 011000 - */ -static memType -make_base(memType val, memType mask) -{ - int i,j = 0; - memType ret = 0 - ; - for (i = 0;i> j) & 1) << i); - j++; - } - } - return ret; -} - -/* - * make_base() -- assign the bits set in mask to the lowest bits. - * example: mask 011010 , val 010010 -> 000011 - */ -static memType -unmake_base(memType val, memType mask) -{ - int i,j = 0; - memType ret = 0; - - for (i = 0;i> i) & 1) << j); - j++; - } - } - return ret; -} - -static memType -fix_counter(memType val, memType old_mask, memType mask) -{ - mask = old_mask & mask; - - val = make_base(val,old_mask); - return unmake_base(val,mask); -} - -_X_EXPORT resRange -xf86GetSparse(unsigned long type, memType fixed_bits, - memType decode_mask, memType address_mask, resPtr avoid) -{ - resRange r = {ResEnd,0,0}; - memType new_mask; - memType mask1; - memType base; - memType counter = 0; - memType counter1; - memType max_counter = ~(memType)0; - memType max_counter1; - memType conflict = 0; - - /* for sanity */ - type = (type & ~(ResExtMask | ResBios | ResEstimated)) | ResSparse; - - /* - * a sparse address consists of 3 parts: - * fixed_bits: F bits which hard decoded by the hardware - * decode_bits: D bits which are used to decode address - * but which may be set by software - * address_bits: A bits which are used to address the - * sparse range. - * the decode_mask marks all decode bits while the address_mask - * masks out all address_bits: - * F D A - * decode_mask: 0 1 0 - * address_mask: 1 1 0 - */ - decode_mask &= address_mask; - new_mask = decode_mask; - - /* - * We start by setting the decode_mask bits to different values - * when a conflict is found the address_mask of the conflicting - * resource is returned. We remove those bits from decode_mask - * that are also set in the returned address_mask as they always - * conflict with resources which use them as address masks. - * The resoulting mask is stored in new_mask. - * We continue until no conflict is found or until we have - * tried all possible settings of new_mask. - */ - while (1) { - base = make_base(counter,new_mask) | fixed_bits; - RANGE(r,base,address_mask,type); - conflict = ChkConflict(&r,Acc,SETUP); - if (!conflict) { - conflict = ChkConflict(&r,avoid,SETUP); - if (!conflict) { - return r; - } - } - counter = fix_counter(counter,new_mask,conflict); - max_counter = fix_counter(max_counter,new_mask,conflict); - new_mask &= conflict; - counter ++; - if (counter > max_counter) break; - } - if (!new_mask && (new_mask == decode_mask)) { - RANGE(r,0,0,ResEnd); - return r; - } - /* - * if we haven't been successful we also try to modify those - * bits in decode_mask that are not at the same time set in - * new mask. These bits overlap with address_bits of some - * resources. If a conflict with a resource of this kind is - * found (ie. returned_mask & mask1 != mask1) with - * mask1 = decode_mask & ~new_mask we cannot - * use our choice of bits in the new_mask part. We try - * another choice. - */ - max_counter = fix_counter(mt_max,mt_max,new_mask); - mask1 = decode_mask & ~new_mask; - max_counter1 = fix_counter(mt_max,mt_max,mask1); - counter = 0; - - while (1) { - counter1 = 0; - while (1) { - base = make_base(counter1,mask1); - RANGE(r,base,address_mask,type); - conflict = ChkConflict(&r,Acc,SETUP); - if (!conflict) { - conflict = ChkConflict(&r,avoid,SETUP); - if (!conflict) { - return r; - } - } - counter1 ++; - if ((mask1 & conflict) != mask1 || counter1 > max_counter1) - break; - } - counter ++; - if (counter > max_counter) break; - } - RANGE(r,0,0,ResEnd); - return r; -} - -#undef length -#undef mt_max - /* * Resource registrarion */ diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 7c2c2503f..c31879ca3 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -811,9 +811,11 @@ xf86ReleaseKeys(DeviceIntPtr pDev) (*pDev->public.processInputProc) (&ke, pDev, 1); } else { + int sigstate = xf86BlockSIGIO (); nevents = GetKeyboardEvents(xf86Events, pDev, KeyRelease, i); for (j = 0; j < nevents; j++) - EqEnqueue(pDev, xf86Events + i); + mieqEnqueue(pDev, xf86Events + j); + xf86UnblockSIGIO(sigstate); } break; } diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 06af74f43..9ff2da73a 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1813,7 +1813,7 @@ xf86PrintBanner() "latest version in the X.Org Foundation git repository.\n" "See http://wiki.x.org/wiki/GitPage for git access instructions.\n"); #endif - ErrorF("\nX Window System Version %d.%d.%d", + ErrorF("\nX.Org X Server %d.%d.%d", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH); @@ -1847,8 +1847,8 @@ xf86PrintBanner() #define XORG_DATE XF86_DATE #endif ErrorF("\nRelease Date: %s\n", XORG_DATE); - ErrorF("X Protocol Version %d, Revision %d, %s\n", - X_PROTOCOL, X_PROTOCOL_REVISION, XORG_RELEASE ); + ErrorF("X Protocol Version %d, Revision %d\n", + X_PROTOCOL, X_PROTOCOL_REVISION); ErrorF("Build Operating System: %s %s\n", OSNAME, OSVENDOR); #ifdef HAS_UTSNAME { diff --git a/hw/xfree86/common/xf86Resources.h b/hw/xfree86/common/xf86Resources.h index 97bf817fe..15bd32c69 100644 --- a/hw/xfree86/common/xf86Resources.h +++ b/hw/xfree86/common/xf86Resources.h @@ -133,7 +133,5 @@ extern resRange res8514Shared[]; {ResExcIoSparse | ResBus, 0x0200, 0x0200},\ {ResExcMemBlock | ResBus, 0xA0000,0xFFFFF} -extern resRange PciAvoid[]; - #define RES_UNDEFINED NULL #endif diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index ce54ea982..54d8eaa87 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -293,15 +293,50 @@ server searches for font databases. Multiple .B FontPath entries may be specified, and they will be concatenated to build up the -fontpath used by the server. Font path elements may be either absolute -directory paths, or a font server identifier. -Font server identifiers have the form: +fontpath used by the server. Font path elements can be absolute +directory paths, catalogue directories or a font server identifier. The +formats of the later two are explained below: +.PP +.RS 7 +Catalogue directories: +.PP +.RS 4 +Catalogue directories can be specified using the prefix \fBcatalogue:\fR +before the directory name. The directory can then be populated with +symlinks pointing to the real font directories, using the following +syntax in the symlink name: +.PP +.RS 4 +.IR : [attribute]: pri= +.RE +.PP +where +.I +is an alphanumeric identifier, +.I [attribute] +is an attribute wich will be passed to the underlying FPE and +.I +is a number used to order the fontfile FPEs. Examples: +.PP +.RS 4 +.nf +.I 75dpi:unscaled:pri=20 -> /usr/share/X11/fonts/75dpi +.I gscript:pri=60 -> /usr/share/fonts/default/ghostscript +.I misc:unscaled:pri=10 \-> /usr/share/X11/fonts/misc +.fi +.PP +.RE .RE .RE +.PP +.RS 7 +Font server identifiers: +.PP +.RS 4 +Font server identifiers have the form: +.RS 4 .PP -.RS 11 .IR / : .RE .PP -.RS 7 where .I is the transport type to use to connect to the font server (e.g., @@ -313,10 +348,11 @@ for a TCP/IP connection), is the hostname of the machine running the font server, and .I is the port number that the font server is listening on (usually 7100). +.RE .PP When this entry is not specified in the config file, the server falls back to the compiled\-in default font path, which contains the following -font path elements: +font path elements (which can be set inside a catalogue directory): .PP .RS 4 .nf diff --git a/hw/xfree86/exa/exa.man.pre b/hw/xfree86/exa/exa.man.pre index b0eecd5cc..31e1cfe34 100644 --- a/hw/xfree86/exa/exa.man.pre +++ b/hw/xfree86/exa/exa.man.pre @@ -37,4 +37,4 @@ default is intended to be the best performing one for general use, though others may help with specific use cases. Available options include \*qalways\*q, \*qgreedy\*q, and \*qsmart\*q. Default: always. .SH AUTHORS -Authors include: Keith Packard, Eric Anholt, Zack Rusin, and Michel Dänzer +Authors include: Keith Packard, Eric Anholt, Zack Rusin, and Michel D\(:anzer diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c index 00c7752b7..837d2b12b 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.c +++ b/hw/xfree86/fbdevhw/fbdevhw.c @@ -239,7 +239,7 @@ static Bool fbdev_modes_equal(struct fb_var_screeninfo *set, struct fb_var_screeninfo *req) { return (set->xres_virtual >= req->xres_virtual && - set->yres_virtual == req->yres_virtual && + set->yres_virtual >= req->yres_virtual && set->bits_per_pixel == req->bits_per_pixel && set->red.length == req->red.length && set->green.length == req->green.length && diff --git a/hw/xfree86/fbdevhw/fbdevhwstub.c b/hw/xfree86/fbdevhw/fbdevhwstub.c index 56ba92901..191a6d33d 100644 --- a/hw/xfree86/fbdevhw/fbdevhwstub.c +++ b/hw/xfree86/fbdevhw/fbdevhwstub.c @@ -1,4 +1,3 @@ - #ifdef HAVE_XORG_CONFIG_H #include #endif @@ -23,13 +22,13 @@ fbdevHWFreeRec(ScrnInfoPtr pScrn) Bool -fbdevHWProbe(pciVideoPtr pPci, char *device, char **namep) +fbdevHWProbe(struct pci_device *pPci, char *device, char **namep) { return FALSE; } Bool -fbdevHWInit(ScrnInfoPtr pScrn, pciVideoPtr pPci, char *device) +fbdevHWInit(ScrnInfoPtr pScrn, struct pci_device *pPci, char *device) { xf86Msg(X_ERROR, "fbdevhw is not available on this platform\n"); return FALSE; diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c index 53382a859..5cc83faa3 100644 --- a/hw/xfree86/i2c/xf86i2c.c +++ b/hw/xfree86/i2c/xf86i2c.c @@ -883,7 +883,7 @@ xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus) continue; *pppI2CBus = xnfrealloc(*pppI2CBus, n * sizeof(I2CBusPtr)); - *pppI2CBus[n - 1] = pI2CBus; + (*pppI2CBus)[n - 1] = pI2CBus; } return n; diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c index 3e1051dc2..e8334262e 100644 --- a/hw/xfree86/int10/helper_exec.c +++ b/hw/xfree86/int10/helper_exec.c @@ -3,8 +3,8 @@ * execute BIOS int 10h calls in x86 real mode environment * Copyright 1999 Egbert Eich * - * Part of this is based on code taken from DOSEMU - * (C) Copyright 1992, ..., 1999 the "DOSEMU-Development-Team" + * Part of this code was inspired by the VBIOS POSTing code in DOSEMU + * developed by the "DOSEMU-Development-Team" */ /* diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index 7beef3193..67a2fe784 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -333,8 +333,6 @@ _X_HIDDEN void *xfree86LookupTab[] = { SYMFUNC(xf86IsEntityPrimary) SYMFUNC(xf86SetOperatingState) SYMFUNC(xf86EnterServerState) - SYMFUNC(xf86GetBlock) - SYMFUNC(xf86GetSparse) SYMFUNC(xf86ChkConflict) SYMFUNC(xf86FindScreenForEntity) SYMFUNC(xf86RegisterStateChangeNotificationCallback) @@ -1116,7 +1114,6 @@ _X_HIDDEN void *xfree86LookupTab[] = { SYMVAR(resVgaSparseShared) SYMVAR(res8514Exclusive) SYMVAR(res8514Shared) - SYMVAR(PciAvoid) #if defined(__powerpc__) && (!defined(NO_INLINE) || defined(Lynx)) SYMVAR(ioBase) diff --git a/hw/xfree86/os-support/bsd/Makefile.am b/hw/xfree86/os-support/bsd/Makefile.am index 0432ba931..446b69ee2 100644 --- a/hw/xfree86/os-support/bsd/Makefile.am +++ b/hw/xfree86/os-support/bsd/Makefile.am @@ -57,7 +57,6 @@ libbsd_la_SOURCES = \ $(srcdir)/../shared/libc_wrapper.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/sigio.c \ - $(srcdir)/../shared/stdPci.c \ $(srcdir)/../shared/vidmem.c \ bsd_VTsw.c \ bsd_init.c \ diff --git a/hw/xfree86/os-support/bsd/bsdResource.c b/hw/xfree86/os-support/bsd/bsdResource.c index 37749c913..fe166c845 100644 --- a/hw/xfree86/os-support/bsd/bsdResource.c +++ b/hw/xfree86/os-support/bsd/bsdResource.c @@ -17,65 +17,10 @@ /* Avoid Imakefile changes */ #include "bus/Pci.h" -_X_EXPORT resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END}; - #ifdef INCLUDE_XF86_NO_DOMAIN #if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) -resPtr -xf86BusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -resPtr -xf86PciBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - /* - * Only allow the upper half of the pci memory range to be used - * for allocation. The lower half includes magic regions for DMA. - * XXX this is not right for XP1000's and similar where we use the - * region 0x40000000-0xbfffffff for DMA but this only matters if - * the bios screws up the pci region mappings. - */ - RANGE(range, 0x80000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#ifdef INCLUDE_UNUSED - -resPtr -xf86IsaBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#endif /* INCLUDE_UNUSED */ - resPtr xf86AccResFromOS(resPtr ret) { @@ -117,52 +62,6 @@ xf86AccResFromOS(resPtr ret) #elif defined(__powerpc__) -resPtr -xf86BusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -resPtr -xf86PciBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#ifdef INCLUDE_UNUSED - -resPtr -xf86IsaBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#endif /* INCLUDE_UNUSED */ - resPtr xf86AccResFromOS(resPtr ret) { diff --git a/hw/xfree86/os-support/bus/Makefile.am b/hw/xfree86/os-support/bus/Makefile.am index fba6e5421..381b9923c 100644 --- a/hw/xfree86/os-support/bus/Makefile.am +++ b/hw/xfree86/os-support/bus/Makefile.am @@ -7,12 +7,8 @@ if XORG_BUS_LINUXPCI PCI_SOURCES += linuxPci.c endif -if XORG_BUS_FREEBSDPCI -PCI_SOURCES += freebsdPci.c -endif - -if XORG_BUS_NETBSDPCI -PCI_SOURCES += netbsdPci.c +if XORG_BUS_BSDPCI +PCI_SOURCES += bsd_pci.c endif if XORG_BUS_IX86PCI diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c index 31e9023f0..a34ed99d0 100644 --- a/hw/xfree86/os-support/bus/Pci.c +++ b/hw/xfree86/os-support/bus/Pci.c @@ -286,21 +286,3 @@ xf86scanpci(void) return success; } - -#ifdef INCLUDE_XF86_NO_DOMAIN - -_X_EXPORT pointer -xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev, - ADDRESS Base, unsigned long Size) -{ - return xf86MapVidMem(ScreenNum, Flags, Base, Size); -} - -IOADDRESS -xf86MapLegacyIO(struct pci_device *dev) -{ - (void) dev; - return 0; -} - -#endif /* INCLUDE_XF86_NO_DOMAIN */ diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h index 632a7a048..bb93260d1 100644 --- a/hw/xfree86/os-support/bus/Pci.h +++ b/hw/xfree86/os-support/bus/Pci.h @@ -184,35 +184,30 @@ #define PCI_CFGMECH1_MAXDEV 32 +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || \ + defined(__DragonFly__) +#define ARCH_PCI_INIT bsdPciInit +#endif + +#if !defined(ARCH_PCI_INIT) /* * Select architecture specific PCI init function */ #if defined(__alpha__) # if defined(linux) # define ARCH_PCI_INIT axpPciInit -# elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) -# define ARCH_PCI_INIT freebsdPciInit -# define INCLUDE_XF86_NO_DOMAIN -# elif defined(__NetBSD__) -# define ARCH_PCI_INIT netbsdPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__arm__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__hppa__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__ia64__) # if defined(linux) # define ARCH_PCI_INIT ia64linuxPciInit -# elif defined(FreeBSD) -# define ARCH_PCI_INIT freebsdPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif # define XF86SCANPCI_WRAPPER ia64ScanPCIWrapper #elif defined(__i386__) || defined(i386) @@ -221,70 +216,50 @@ # else # define ARCH_PCI_INIT ix86PciInit # endif -# define INCLUDE_XF86_NO_DOMAIN #elif defined(__mc68000__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__mips__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__powerpc__) || defined(__powerpc64__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_NO_DOMAIN /* Needs kernel work to remove */ -# elif defined(__FreeBSD__) || defined(__OpenBSD__) -# define ARCH_PCI_INIT freebsdPciInit -# define INCLUDE_XF86_NO_DOMAIN -# elif defined(__NetBSD__) -# define ARCH_PCI_INIT netbsdPciInit -# define INCLUDE_XF86_NO_DOMAIN # else # define ARCH_PCI_INIT ppcPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__s390__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__sh__) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif #elif defined(__sparc__) || defined(sparc) # if defined(linux) # define ARCH_PCI_INIT linuxPciInit # elif defined(sun) # define ARCH_PCI_INIT sparcPciInit -# elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc64__) -# define ARCH_PCI_INIT freebsdPciInit -# define INCLUDE_XF86_NO_DOMAIN # endif # if !defined(__FreeBSD__) && !defined(linux) # define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge # endif #elif defined(__amd64__) || defined(__amd64) -# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -# define ARCH_PCI_INIT freebsdPciInit -# elif defined(linux) +# if defined(linux) # define ARCH_PCI_INIT linuxPciInit # else # define ARCH_PCI_INIT ix86PciInit # endif -# define INCLUDE_XF86_NO_DOMAIN #endif +#endif /* !defined(ARCH_PCI_INIT) */ #ifndef ARCH_PCI_INIT #error No PCI support available for this architecture/OS combination #endif -#undef INCLUDE_XF86_NO_DOMAIN - extern void ARCH_PCI_INIT(void); #if defined(XF86SCANPCI_WRAPPER) diff --git a/hw/xfree86/os-support/bus/axpPci.c b/hw/xfree86/os-support/bus/axpPci.c index e2f086c53..c59c06804 100644 --- a/hw/xfree86/os-support/bus/axpPci.c +++ b/hw/xfree86/os-support/bus/axpPci.c @@ -362,34 +362,6 @@ xf86MapLegacyIO(struct pci_device *dev) return pDomain->mapped_io; } -resPtr -xf86PciBusAccWindowsFromOS(void) -{ - resPtr pRes = NULL; - resRange range; - int domain; - - for(domain = 0; domain < pciNumDomains; domain++) { - if (!xf86DomainInfo[domain]) continue; - - RANGE(range, 0, 0xffffffffUL, - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - - RANGE(range, 0, 0x0000ffffUL, - RANGE_TYPE(ResExcIoBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - } - - return pRes; -} - -resPtr -xf86BusAccWindowsFromOS(void) -{ - return xf86PciBusAccWindowsFromOS(); -} - resPtr xf86AccResFromOS(resPtr pRes) { diff --git a/hw/xfree86/os-support/bus/bsd_pci.c b/hw/xfree86/os-support/bus/bsd_pci.c new file mode 100644 index 000000000..bceb1087f --- /dev/null +++ b/hw/xfree86/os-support/bus/bsd_pci.c @@ -0,0 +1,84 @@ +/* + * Copyright © 2007 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Eric Anholt + * + */ + +/** + * @file bsd_pci.c + * + * This is a trivial implementation of the remaining PCI support hooks in the + * X Server that is unaware of domains. + * + * Most of even this should go away once drivers are converted and the + * old interfaces are confirmed to all be obsolete. + */ + +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + +#include +#include "compiler.h" +#include "xf86.h" +#include "xf86Priv.h" +#include "xf86_OSlib.h" +#include "Pci.h" + +#include "pciaccess.h" + +static pciBusFuncs_t bsd_funcs = { + .pciAddrBusToHost = pciAddrNOOP, +}; + +static pciBusInfo_t bsd_pci = { + .configMech = PCI_CFG_MECH_OTHER, + .numDevices = 32, + .secondary = FALSE, + .primary_bus = 0, + .funcs = &bsd_funcs, + .pciBusPriv = NULL, + .bridge = NULL, +}; + +_X_EXPORT pointer +xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev, + ADDRESS Base, unsigned long Size) +{ + return xf86MapVidMem(ScreenNum, Flags, Base, Size); +} + +IOADDRESS +xf86MapLegacyIO(struct pci_device *dev) +{ + (void)dev; + return 0; +} + +void +bsdPciInit(void) +{ + pciNumBuses = 1; + pciBusInfo[0] = &bsd_pci; +} diff --git a/hw/xfree86/os-support/bus/freebsdPci.c b/hw/xfree86/os-support/bus/freebsdPci.c deleted file mode 100644 index ff11c72f4..000000000 --- a/hw/xfree86/os-support/bus/freebsdPci.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright 1998 by Concurrent Computer Corporation - * - * Permission to use, copy, modify, distribute, and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Concurrent Computer - * Corporation not be used in advertising or publicity pertaining to - * distribution of the software without specific, written prior - * permission. Concurrent Computer Corporation makes no representations - * about the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty. - * - * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD - * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE - * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY - * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - * Copyright 1998 by Metro Link Incorporated - * - * Permission to use, copy, modify, distribute, and sell this software - * and its documentation for any purpose is hereby granted without fee, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of Metro Link - * Incorporated not be used in advertising or publicity pertaining to - * distribution of the software without specific, written prior - * permission. Metro Link Incorporated makes no representations - * about the suitability of this software for any purpose. It is - * provided "as is" without express or implied warranty. - * - * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD - * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE - * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY - * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "compiler.h" -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" -#include "Pci.h" - -#include - -/* - * freebsd platform specific PCI access functions -- using /dev/pci - * needs kernel version 2.2.x - */ -static CARD32 freebsdPciCfgRead(PCITAG tag, int off); -static void freebsdPciCfgWrite(PCITAG, int off, CARD32 val); -static void freebsdPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits); - -static pciBusFuncs_t freebsdFuncs0 = { -/* pciReadLong */ freebsdPciCfgRead, -/* pciWriteLong */ freebsdPciCfgWrite, -/* pciSetBitsLong */ freebsdPciCfgSetBits, -/* pciAddrHostToBus */ pciAddrNOOP, -/* pciAddrBusToHost */ pciAddrNOOP -}; - -static pciBusInfo_t freebsdPci0 = { -/* configMech */ PCI_CFG_MECH_OTHER, -/* numDevices */ 32, -/* secondary */ FALSE, -/* primary_bus */ 0, -/* funcs */ &freebsdFuncs0, -/* pciBusPriv */ NULL, -/* bridge */ NULL -}; - -#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__) -#if X_BYTE_ORDER == X_BIG_ENDIAN -#ifdef __sparc__ -#ifndef ASI_PL -#define ASI_PL 0x88 -#endif -#define PCI_CPU(val) ({ \ -int __ret; \ -__asm__ __volatile__("lduwa [%1] %2, %0" : "=r" (__ret) : "r" (&val), "i" (ASI_PL)); \ -__ret; \ -}) -#else -#define PCI_CPU(val) (((val >> 24) & 0x000000ff) | \ - ((val >> 8) & 0x0000ff00) | \ - ((val << 8) & 0x00ff0000) | \ - ((val << 24) & 0xff000000)) -#endif -#else -#define PCI_CPU(val) (val) -#endif -#else /* ! OpenBSD */ -/* OpenBSD has already the bytes in the right order - for all architectures */ -#define PCI_CPU(val) (val) -#endif - - -#define BUS(tag) (((tag)>>16)&0xff) -#define DFN(tag) (((tag)>>8)&0xff) - -static int pciFd = -1; - -void -freebsdPciInit() -{ - pciFd = open("/dev/pci", O_RDWR); - if (pciFd < 0) - return; - - pciNumBuses = 1; - pciBusInfo[0] = &freebsdPci0; -} - -static CARD32 -freebsdPciCfgRead(PCITAG tag, int off) -{ - struct pci_io io; - int error; - io.pi_sel.pc_bus = BUS(tag); - io.pi_sel.pc_dev = DFN(tag) >> 3; - io.pi_sel.pc_func = DFN(tag) & 7; - io.pi_reg = off; - io.pi_width = 4; - error = ioctl(pciFd, PCIOCREAD, &io); - if (error) - return ~0; - return PCI_CPU(io.pi_data); -} - -static void -freebsdPciCfgWrite(PCITAG tag, int off, CARD32 val) -{ - struct pci_io io; - io.pi_sel.pc_bus = BUS(tag); - io.pi_sel.pc_dev = DFN(tag) >> 3; - io.pi_sel.pc_func = DFN(tag) & 7; - io.pi_reg = off; - io.pi_width = 4; - io.pi_data = PCI_CPU(val); - ioctl(pciFd, PCIOCWRITE, &io); -} - -static void -freebsdPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits) -{ - CARD32 val = freebsdPciCfgRead(tag, off); - val = (val & ~mask) | (bits & mask); - freebsdPciCfgWrite(tag, off, val); -} diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c index b88fae6c7..11eb4f9e8 100644 --- a/hw/xfree86/os-support/bus/linuxPci.c +++ b/hw/xfree86/os-support/bus/linuxPci.c @@ -548,49 +548,6 @@ xf86MapLegacyIO(struct pci_device *dev) return (IOADDRESS)DomainMmappedIO[domain]; } -resPtr -xf86BusAccWindowsFromOS(void) -{ - struct pci_device *dev; - struct pci_device_iterator *iter; - resPtr pRes = NULL; - resRange range; - - iter = pci_id_match_iterator_create(& match_host_bridge); - while ((dev = pci_device_next(iter)) != NULL) { - const int domain = dev->domain; - const struct pciSizes * const sizes = linuxGetSizesStruct(dev); - - RANGE(range, 0, (ADDRESS)(sizes->mem_size - 1), - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - - RANGE(range, 0, (IOADDRESS)(sizes->io_size - 1), - RANGE_TYPE(ResExcIoBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - - /* FIXME: The old code reserved domain 0 for a special purpose. The - * FIXME: new code just uses whatever domains the kernel tells it, - * FIXME: but there is no way to get a domain < 0. What should - * FIXME: happen here? - * - if (domain <= 0) - break; - */ - } - - pci_iterator_destroy(iter); - - return pRes; -} - -resPtr -xf86PciBusAccWindowsFromOS(void) -{ - return xf86BusAccWindowsFromOS(); -} - - resPtr xf86AccResFromOS(resPtr pRes) { diff --git a/hw/xfree86/os-support/bus/netbsdPci.c b/hw/xfree86/os-support/bus/netbsdPci.c deleted file mode 100644 index 760302752..000000000 --- a/hw/xfree86/os-support/bus/netbsdPci.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE - * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project - * shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written - * authorization from the XFree86 Project. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86OSpriv.h" - -#include "Pci.h" - -static CARD32 netbsdPciConfRead(PCITAG, int); -static void netbsdPciConfWrite(PCITAG, int, CARD32); -static void netbsdPciSetBits(PCITAG, int, CARD32, CARD32); - -static int devpci = -1; - -static pciBusFuncs_t netbsdFuncs0 = { -/* pciReadLong */ netbsdPciConfRead, -/* pciWriteLong */ netbsdPciConfWrite, -/* pciSetBitsLong */ netbsdPciSetBits, -/* pciAddrHostToBus */ pciAddrNOOP, -/* pciAddrBusToHost */ pciAddrNOOP -}; - -static pciBusInfo_t netbsdPci0 = { -/* configMech */ PCI_CFG_MECH_OTHER, -/* numDevices */ 32, -/* secondary */ FALSE, -/* primary_bus */ 0, -/* funcs */ &netbsdFuncs0, -/* pciBusPriv */ NULL, -/* bridge */ NULL -}; - -void -netbsdPciInit() -{ - struct pciio_businfo pci_businfo; - - devpci = open("/dev/pci0", O_RDWR); - if (devpci == -1) - FatalError("netbsdPciInit: can't open /dev/pci0\n"); - - pciNumBuses = 1; - pciBusInfo[0] = &netbsdPci0; - /* use businfo to get the number of devs */ - if (ioctl(devpci, PCI_IOC_BUSINFO, &pci_businfo) != 0) - FatalError("netbsdPciInit: not a PCI bus device"); - netbsdPci0.numDevices = pci_businfo.maxdevs; -} - -static CARD32 -netbsdPciConfRead(PCITAG tag, int reg) -{ - struct pciio_bdf_cfgreg bdfr; - - bdfr.bus = PCI_BUS_FROM_TAG(tag); - bdfr.device = PCI_DEV_FROM_TAG(tag); - bdfr.function = PCI_FUNC_FROM_TAG(tag); - bdfr.cfgreg.reg = reg; - - if (ioctl(devpci, PCI_IOC_BDF_CFGREAD, &bdfr) == -1) - FatalError("netbsdPciConfRead: failed on %d/%d/%d\n", - bdfr.bus, bdfr.device, bdfr.function); - - return (bdfr.cfgreg.val); -} - -static void -netbsdPciConfWrite(PCITAG tag, int reg, CARD32 val) -{ - struct pciio_bdf_cfgreg bdfr; - - bdfr.bus = PCI_BUS_FROM_TAG(tag); - bdfr.device = PCI_DEV_FROM_TAG(tag); - bdfr.function = PCI_FUNC_FROM_TAG(tag); - bdfr.cfgreg.reg = reg; - bdfr.cfgreg.val = val; - - if (ioctl(devpci, PCI_IOC_BDF_CFGWRITE, &bdfr) == -1) - FatalError("netbsdPciConfWrite: failed on %d/%d/%d\n", - bdfr.bus, bdfr.device, bdfr.function); -} - -static void -netbsdPciSetBits(PCITAG tag, int reg, CARD32 mask, CARD32 bits) -{ - CARD32 val; - - val = netbsdPciConfRead(tag, reg); - val = (val & ~mask) | (bits & mask); - netbsdPciConfWrite(tag, reg, val); -} diff --git a/hw/xfree86/os-support/bus/sparcPci.c b/hw/xfree86/os-support/bus/sparcPci.c index 82b1d89b9..6f7113f15 100644 --- a/hw/xfree86/os-support/bus/sparcPci.c +++ b/hw/xfree86/os-support/bus/sparcPci.c @@ -648,54 +648,6 @@ xf86MapLegacyIO(int ScreenNum, int Flags, PCITAG Tag, return (IOADDRESS)pDomain->io + Base; } -resPtr -xf86BusAccWindowsFromOS(void) -{ - sparcDomainPtr pDomain; - resPtr pRes = NULL; - resRange range; - int domain; - - for (domain = 1; domain < pciNumDomains; domain++) { - if (!(pDomain = xf86DomainInfo[domain])) - continue; - - RANGE(range, 0, pDomain->mem_size - 1, - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - - RANGE(range, 0, pDomain->io_size - 1, - RANGE_TYPE(ResExcIoBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - } - - return pRes; -} - -resPtr -xf86PciBusAccWindowsFromOS(void) -{ - sparcDomainPtr pDomain; - resPtr pRes = NULL; - resRange range; - int domain; - - for (domain = 1; domain < pciNumDomains; domain++) { - if (!(pDomain = xf86DomainInfo[domain])) - continue; - - RANGE(range, 0, pDomain->mem_size - 1, - RANGE_TYPE(ResExcMemBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - - RANGE(range, 0, pDomain->io_size - 1, - RANGE_TYPE(ResExcIoBlock, domain)); - pRes = xf86AddResToList(pRes, &range, -1); - } - - return pRes; -} - resPtr xf86AccResFromOS(resPtr pRes) { diff --git a/hw/xfree86/os-support/hurd/Makefile.am b/hw/xfree86/os-support/hurd/Makefile.am index 731ff083d..e6543e133 100644 --- a/hw/xfree86/os-support/hurd/Makefile.am +++ b/hw/xfree86/os-support/hurd/Makefile.am @@ -6,7 +6,6 @@ libhurd_la_SOURCES = hurd_bell.c hurd_init.c hurd_mmap.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/libc_wrapper.c \ $(srcdir)/../shared/stdResource.c \ - $(srcdir)/../shared/stdPci.c \ $(srcdir)/../shared/sigiostubs.c \ $(srcdir)/../shared/pm_noop.c \ $(srcdir)/../shared/kmod_noop.c \ diff --git a/hw/xfree86/os-support/linux/lnxResource.c b/hw/xfree86/os-support/linux/lnxResource.c index 6f89cdb07..67af9db3d 100644 --- a/hw/xfree86/os-support/linux/lnxResource.c +++ b/hw/xfree86/os-support/linux/lnxResource.c @@ -18,133 +18,10 @@ /* Avoid Imakefile changes */ #include "bus/Pci.h" -_X_EXPORT resRange PciAvoid[] = -{ -#if !defined(__sparc__) || !defined(INCLUDE_XF86_NO_DOMAIN) - _PCI_AVOID_PC_STYLE, -#endif - _END -}; - #ifdef INCLUDE_XF86_NO_DOMAIN #ifdef __alpha__ -resPtr -xf86BusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -resPtr -xf86PciBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - /* - * On the Alpha the first 16MB of every 128 Mb segment in - * sparse address space are an image of the ISA bus range - */ - if (_bus_base_sparse()) { - RANGE(range, 0x00000000, 0x07ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x09000000, 0x0fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x11000000, 0x17ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x19000000, 0x1fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x21000000, 0x27ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x29000000, 0x2fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x31000000, 0x37ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x39000000, 0x3fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x41000000, 0x47ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x49000000, 0x4fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x51000000, 0x57ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x59000000, 0x5fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x61000000, 0x67ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x69000000, 0x6fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x71000000, 0x77ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x79000000, 0x7fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x81000000, 0x87ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x89000000, 0x8fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x91000000, 0x97ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0x99000000, 0x9fffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xa1000000, 0xa7ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xa9000000, 0xafffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xb1000000, 0xb7ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xb9000000, 0xbfffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xc1000000, 0xc7ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xc9000000, 0xcfffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xd1000000, 0xd7ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xd9000000, 0xdfffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xe1000000, 0xe7ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xe9000000, 0xefffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xf1000000, 0xf7ffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - RANGE(range, 0xf9000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - } else { - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - } - RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#ifdef INCLUDE_UNUSED - -resPtr -xf86IsaBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#endif /* INCLUDE_UNUSED */ - resPtr xf86AccResFromOS(resPtr ret) { @@ -193,69 +70,6 @@ xf86AccResFromOS(resPtr ret) defined(__s390__) || \ defined(__hppa__) - /* - * XXX this isn't exactly correct but it will get the server working - * for now until we get something better. - */ - -resPtr -xf86BusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - -#if defined(__sparc__) || defined(__powerpc__) - RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock); -#else - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); -#endif - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -resPtr -xf86PciBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - -#if defined(__sparc__) || defined(__powerpc__) - RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock); -#else - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); -#endif - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#ifdef INCLUDE_UNUSED - -resPtr -xf86IsaBusAccWindowsFromOS(void) -{ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - -#if defined(__sparc__) || defined(__powerpc__) - RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock); -#else - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); -#endif - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#endif /* INCLUDE_UNUSED */ - resPtr xf86AccResFromOS(resPtr ret) { diff --git a/hw/xfree86/os-support/linux/lnx_pci.c b/hw/xfree86/os-support/linux/lnx_pci.c index 8415aa01c..53818f2dc 100644 --- a/hw/xfree86/os-support/linux/lnx_pci.c +++ b/hw/xfree86/os-support/linux/lnx_pci.c @@ -147,69 +147,6 @@ int lnxPciInit(void) { return xf86OSLinuxNumPciDevs; } -Bool -xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits) -{ - signed PCIADDR_TYPE Size; - struct pci_dev *device; - - if (index >= 7) - return FALSE; - - if (!xf86OSLinuxPCIDevs) { - xf86OSLinuxPCIDevs = xf86OSLinuxGetPciDevs(); - } - if (!xf86OSLinuxPCIDevs) - return FALSE; - - for (device = xf86OSLinuxPCIDevs; device; device = device->next) { - if (tag == PCI_MAKE_TAG(PCI_MAKE_BUS(device->domain, device->bus), - device->dev, device->fn)) { - if (device->size[index] != 0) { - Size = device->size[index] - ((PCIADDR_TYPE) 1); - while (Size & ((PCIADDR_TYPE) 0x01)) { - Size = Size >> ((PCIADDR_TYPE) 1); - (*bits)++; - } - } - return TRUE; - } - } - - return FALSE; -} - - - -#if 0 -/* Query the kvirt address (64bit) of a BAR range from TAG */ -Bool -xf86GetPciOffsetFromOS(PCITAG tag, int index, unsigned long* bases) -{ - struct pci_dev *device; - - if (index >= 7) - return FALSE; - - if (!xf86OSLinuxPCIDevs) { - xf86OSLinuxPCIDevs = xf86OSLinuxGetPciDevs(); - } - if (!xf86OSLinuxPCIDevs) - return FALSE; - - for (device = xf86OSLinuxPCIDevs; device; device = device->next) { - if (tag == PCI_MAKE_TAG(PCI_MAKE_BUS(device->domain, device->bus), - device->dev, device->fn)) { - /* return the offset for the index requested */ - *bases = device->offset[index]; - return TRUE; - } - } - - return FALSE; -} -#endif - /* Query the kvirt address (64bit) of a BAR range from size for a given TAG */ unsigned long xf86GetOSOffsetFromPCI(PCITAG tag, int space, unsigned long base) diff --git a/hw/xfree86/os-support/shared/stdPci.c b/hw/xfree86/os-support/shared/stdPci.c deleted file mode 100644 index 6777c6a1f..000000000 --- a/hw/xfree86/os-support/shared/stdPci.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1999-2003 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86Privstr.h" -#include "xf86Pci.h" -#define NEED_OS_RAC_PROTOS -#include "xf86_OSlib.h" - -#ifndef HAVE_PCI_SIZE_FUNC -#define xf86StdGetPciSizeFromOS xf86GetPciSizeFromOS -#endif - -Bool -xf86StdGetPciSizeFromOS(PCITAG tag, int index, int* bits) -{ - return FALSE; -} diff --git a/hw/xfree86/os-support/shared/stdResource.c b/hw/xfree86/os-support/shared/stdResource.c index 555f80526..7229d55b5 100644 --- a/hw/xfree86/os-support/shared/stdResource.c +++ b/hw/xfree86/os-support/shared/stdResource.c @@ -43,69 +43,11 @@ /* Avoid Imakefile changes */ #include "bus/Pci.h" -#ifdef USESTDRES -#define xf86StdBusAccWindowsFromOS xf86BusAccWindowsFromOS +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \ + defined(__DragonFly__) #define xf86StdAccResFromOS xf86AccResFromOS -#define xf86StdPciBusAccWindowsFromOS xf86PciBusAccWindowsFromOS -#define xf86StdIsaBusAccWindowsFromOS xf86IsaBusAccWindowsFromOS - -_X_EXPORT resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END}; #endif -#ifdef INCLUDE_XF86_NO_DOMAIN - -resPtr -xf86StdBusAccWindowsFromOS(void) -{ - /* Fallback is to allow addressing of all memory space */ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - /* Fallback is to allow addressing of all I/O space */ - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -resPtr -xf86StdPciBusAccWindowsFromOS(void) -{ - /* Fallback is to allow addressing of all memory space */ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - /* Fallback is to allow addressing of all I/O space */ - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#ifdef INCLUDE_UNUSED - -resPtr -xf86StdIsaBusAccWindowsFromOS(void) -{ - /* Fallback is to allow addressing of all memory space */ - resPtr ret = NULL; - resRange range; - - RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock); - ret = xf86AddResToList(ret, &range, -1); - - /* Fallback is to allow addressing of all I/O space */ - RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock); - ret = xf86AddResToList(ret, &range, -1); - return ret; -} - -#endif /* INCLUDE_UNUSED */ - resPtr xf86StdAccResFromOS(resPtr ret) { @@ -172,5 +114,3 @@ xf86StdAccResFromOS(resPtr ret) /* XXX add others */ return ret; } - -#endif /* INCLUDE_XF86_NO_DOMAIN */ diff --git a/hw/xfree86/os-support/solaris/Makefile.am b/hw/xfree86/os-support/solaris/Makefile.am index c027d9a3e..5ed60bc55 100644 --- a/hw/xfree86/os-support/solaris/Makefile.am +++ b/hw/xfree86/os-support/solaris/Makefile.am @@ -23,7 +23,7 @@ libsolaris_la_SOURCES = sun_bios.c sun_init.c \ $(srcdir)/../shared/libc_wrapper.c \ $(srcdir)/../shared/kmod_noop.c \ $(srcdir)/../shared/posix_tty.c $(srcdir)/../shared/sigiostubs.c \ - $(srcdir)/../shared/stdPci.c $(srcdir)/../shared/stdResource.c \ + $(srcdir)/../shared/stdResource.c \ $(VTSW_SRC) nodist_libsolaris_la_SOURCES = $(SOLARIS_INOUT_SRC) diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h index 6f0391dc7..abf5a47c2 100644 --- a/hw/xfree86/os-support/xf86_OSproc.h +++ b/hw/xfree86/os-support/xf86_OSproc.h @@ -228,22 +228,12 @@ extern PMClose xf86OSPMOpen(void); #ifdef NEED_OS_RAC_PROTOS /* RAC-related privs */ /* internal to os-support layer */ -resPtr xf86StdBusAccWindowsFromOS(void); -resPtr xf86StdPciAccWindowsFromOS(void); -resPtr xf86StdIsaAccWindowsFromOS(void); resPtr xf86StdAccResFromOS(resPtr ret); /* available to the common layer */ -resPtr xf86BusAccWindowsFromOS(void); -resPtr xf86PciBusAccWindowsFromOS(void); -#ifdef INCLUDE_UNUSED -resPtr xf86IsaBusAccWindowsFromOS(void); -#endif resPtr xf86AccResFromOS(resPtr ret); #endif /* NEED_OS_RAC_PROTOS */ -extern Bool xf86GetPciSizeFromOS(PCITAG tag, int indx, int* bits); -extern Bool xf86GetPciOffsetFromOS(PCITAG tag, int indx, unsigned long* bases); extern unsigned long xf86GetOSOffsetFromPCI(PCITAG tag, int space, unsigned long base); extern void xf86MakeNewMapping(int, int, unsigned long, unsigned long, pointer); diff --git a/hw/xfree86/rac/xf86RAC.c b/hw/xfree86/rac/xf86RAC.c index 5302a86b2..eb05f2e14 100644 --- a/hw/xfree86/rac/xf86RAC.c +++ b/hw/xfree86/rac/xf86RAC.c @@ -96,8 +96,6 @@ typedef struct _RACScreen { GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; SourceValidateProcPtr SourceValidate; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; CreatePixmapProcPtr CreatePixmap; @@ -137,8 +135,6 @@ static void RACGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart); static void RACSourceValidate (DrawablePtr pDrawable, int x, int y, int width, int height ); -static void RACPaintWindowBackground(WindowPtr pWin, RegionPtr prgn, int what); -static void RACPaintWindowBorder(WindowPtr pWin, RegionPtr prgn, int what); static void RACCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc ); static void RACClearToBackground (WindowPtr pWin, int x, int y, @@ -286,8 +282,6 @@ xf86RACInit(ScreenPtr pScreen, unsigned int flag) WRAP_SCREEN_COND(GetImage, RACGetImage, RAC_FB); WRAP_SCREEN_COND(GetSpans, RACGetSpans, RAC_FB); WRAP_SCREEN_COND(SourceValidate, RACSourceValidate, RAC_FB); - WRAP_SCREEN_COND(PaintWindowBackground, RACPaintWindowBackground, RAC_FB); - WRAP_SCREEN_COND(PaintWindowBorder, RACPaintWindowBorder, RAC_FB); WRAP_SCREEN_COND(CopyWindow, RACCopyWindow, RAC_FB); WRAP_SCREEN_COND(ClearToBackground, RACClearToBackground, RAC_FB); WRAP_SCREEN_COND(CreatePixmap, RACCreatePixmap, RAC_FB); @@ -331,8 +325,6 @@ RACCloseScreen (int i, ScreenPtr pScreen) UNWRAP_SCREEN(GetImage); UNWRAP_SCREEN(GetSpans); UNWRAP_SCREEN(SourceValidate); - UNWRAP_SCREEN(PaintWindowBackground); - UNWRAP_SCREEN(PaintWindowBorder); UNWRAP_SCREEN(CopyWindow); UNWRAP_SCREEN(ClearToBackground); UNWRAP_SCREEN(SaveScreen); @@ -416,38 +408,6 @@ RACSourceValidate ( SCREEN_EPILOG (SourceValidate, RACSourceValidate); } -static void -RACPaintWindowBackground( - WindowPtr pWin, - RegionPtr prgn, - int what - ) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - DPRINT_S("RACPaintWindowBackground",pScreen->myNum); - SCREEN_PROLOG (PaintWindowBackground); - ENABLE; - (*pScreen->PaintWindowBackground) (pWin, prgn, what); - SCREEN_EPILOG (PaintWindowBackground, RACPaintWindowBackground); -} - -static void -RACPaintWindowBorder( - WindowPtr pWin, - RegionPtr prgn, - int what -) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - DPRINT_S("RACPaintWindowBorder",pScreen->myNum); - SCREEN_PROLOG (PaintWindowBorder); - ENABLE; - (*pScreen->PaintWindowBorder) (pWin, prgn, what); - SCREEN_EPILOG (PaintWindowBorder, RACPaintWindowBorder); -} - static void RACCopyWindow( WindowPtr pWin, diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c index ba6e3a8ee..c3bd61c1e 100644 --- a/hw/xfree86/shadowfb/shadow.c +++ b/hw/xfree86/shadowfb/shadow.c @@ -35,11 +35,6 @@ #define MAX(a,b) (((a)>(b))?(a):(b)) static Bool ShadowCloseScreen (int i, ScreenPtr pScreen); -static void ShadowPaintWindow ( - WindowPtr pWin, - RegionPtr prgn, - int what -); static void ShadowCopyWindow( WindowPtr pWin, DDXPointRec ptOldOrg, @@ -82,8 +77,6 @@ typedef struct { RefreshAreaFuncPtr preRefresh; RefreshAreaFuncPtr postRefresh; CloseScreenProcPtr CloseScreen; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; CreateGCProcPtr CreateGC; ModifyPixmapHeaderProcPtr ModifyPixmapHeader; @@ -192,8 +185,6 @@ ShadowFBInit2 ( pPriv->vtSema = TRUE; pPriv->CloseScreen = pScreen->CloseScreen; - pPriv->PaintWindowBackground = pScreen->PaintWindowBackground; - pPriv->PaintWindowBorder = pScreen->PaintWindowBorder; pPriv->CopyWindow = pScreen->CopyWindow; pPriv->CreateGC = pScreen->CreateGC; pPriv->ModifyPixmapHeader = pScreen->ModifyPixmapHeader; @@ -202,8 +193,6 @@ ShadowFBInit2 ( pPriv->LeaveVT = pScrn->LeaveVT; pScreen->CloseScreen = ShadowCloseScreen; - pScreen->PaintWindowBackground = ShadowPaintWindow; - pScreen->PaintWindowBorder = ShadowPaintWindow; pScreen->CopyWindow = ShadowCopyWindow; pScreen->CreateGC = ShadowCreateGC; pScreen->ModifyPixmapHeader = ShadowModifyPixmapHeader; @@ -268,8 +257,6 @@ ShadowCloseScreen (int i, ScreenPtr pScreen) #endif /* RENDER */ pScreen->CloseScreen = pPriv->CloseScreen; - pScreen->PaintWindowBackground = pPriv->PaintWindowBackground; - pScreen->PaintWindowBorder = pPriv->PaintWindowBorder; pScreen->CopyWindow = pPriv->CopyWindow; pScreen->CreateGC = pPriv->CreateGC; pScreen->ModifyPixmapHeader = pPriv->ModifyPixmapHeader; @@ -288,35 +275,6 @@ ShadowCloseScreen (int i, ScreenPtr pScreen) return (*pScreen->CloseScreen) (i, pScreen); } -static void -ShadowPaintWindow( - WindowPtr pWin, - RegionPtr prgn, - int what -){ - ScreenPtr pScreen = pWin->drawable.pScreen; - ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen); - int num = 0; - - if(pPriv->vtSema && (num = REGION_NUM_RECTS(prgn))) - if(pPriv->preRefresh) - (*pPriv->preRefresh)(pPriv->pScrn, num, REGION_RECTS(prgn)); - - if(what == PW_BACKGROUND) { - pScreen->PaintWindowBackground = pPriv->PaintWindowBackground; - (*pScreen->PaintWindowBackground) (pWin, prgn, what); - pScreen->PaintWindowBackground = ShadowPaintWindow; - } else { - pScreen->PaintWindowBorder = pPriv->PaintWindowBorder; - (*pScreen->PaintWindowBorder) (pWin, prgn, what); - pScreen->PaintWindowBorder = ShadowPaintWindow; - } - - if(num && pPriv->postRefresh) - (*pPriv->postRefresh)(pPriv->pScrn, num, REGION_RECTS(prgn)); -} - - static void ShadowCopyWindow( WindowPtr pWin, diff --git a/hw/xfree86/xaa/Makefile.am b/hw/xfree86/xaa/Makefile.am index 6ed8303a4..58c8e885f 100644 --- a/hw/xfree86/xaa/Makefile.am +++ b/hw/xfree86/xaa/Makefile.am @@ -16,7 +16,7 @@ libxaa_la_SOURCES = xaaInit.c xaaGC.c xaaInitAccel.c xaaFallback.c \ xaaBitBlt.c xaaCpyArea.c xaaGCmisc.c xaaCpyWin.c \ xaaCpyPlane.c xaaFillRect.c xaaTEText.c xaaNonTEText.c \ xaaPCache.c xaaSpans.c xaaROP.c xaaImage.c xaaWrapper.c \ - xaaPaintWin.c xaaRect.c xaaLineMisc.c xaaBitOrder.c \ + xaaRect.c xaaLineMisc.c xaaBitOrder.c \ xaaFillPoly.c xaaWideLine.c xaaTables.c xaaFillArc.c \ xaaLine.c xaaDashLine.c xaaOverlay.c xaaOffscreen.c \ xaaOverlayDF.c xaaStateChange.c xaaPict.c $(POLYSEG) \ diff --git a/hw/xfree86/xaa/xaa.h b/hw/xfree86/xaa/xaa.h index c8d0467e9..1dc7ed2d5 100644 --- a/hw/xfree86/xaa/xaa.h +++ b/hw/xfree86/xaa/xaa.h @@ -1238,8 +1238,6 @@ typedef struct _XAAInfoRec { GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; BackingStoreSaveAreasProcPtr SaveAreas; BackingStoreRestoreAreasProcPtr RestoreAreas; diff --git a/hw/xfree86/xaa/xaaGC.c b/hw/xfree86/xaa/xaaGC.c index 65a482fe7..e6083d529 100644 --- a/hw/xfree86/xaa/xaaGC.c +++ b/hw/xfree86/xaa/xaaGC.c @@ -81,10 +81,11 @@ XAAValidateGC( } if(pGC->depth != 32) { - if(pGC->bgPixel == -1) /* -1 is reserved for transparency */ - pGC->bgPixel = 0x7fffffff; - if(pGC->fgPixel == -1) /* -1 is reserved for transparency */ - pGC->fgPixel = 0x7fffffff; + /* 0xffffffff is reserved for transparency */ + if(pGC->bgPixel == 0xffffffff) + pGC->bgPixel = 0x7fffffff; + if(pGC->fgPixel == 0xffffffff) + pGC->fgPixel = 0x7fffffff; } if((pDraw->type == DRAWABLE_PIXMAP) && !IS_OFFSCREEN_PIXMAP(pDraw)){ diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c index 614ecf751..f1757c866 100644 --- a/hw/xfree86/xaa/xaaInit.c +++ b/hw/xfree86/xaa/xaaInit.c @@ -136,10 +136,6 @@ XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec) infoRec->GetImage = XAAGetImage; if(!infoRec->GetSpans) infoRec->GetSpans = XAAGetSpans; - if(!infoRec->PaintWindowBackground) - infoRec->PaintWindowBackground = XAAPaintWindow; - if(!infoRec->PaintWindowBorder) - infoRec->PaintWindowBorder = XAAPaintWindow; if(!infoRec->CopyWindow) infoRec->CopyWindow = XAACopyWindow; @@ -151,10 +147,6 @@ XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec) pScreen->GetImage = infoRec->GetImage; pScreenPriv->GetSpans = pScreen->GetSpans; pScreen->GetSpans = infoRec->GetSpans; - pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground; - pScreen->PaintWindowBackground = infoRec->PaintWindowBackground; - pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder; - pScreen->PaintWindowBorder = infoRec->PaintWindowBorder; pScreenPriv->CopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = infoRec->CopyWindow; pScreenPriv->CreatePixmap = pScreen->CreatePixmap; @@ -225,8 +217,6 @@ XAACloseScreen (int i, ScreenPtr pScreen) pScreen->CloseScreen = pScreenPriv->CloseScreen; pScreen->GetImage = pScreenPriv->GetImage; pScreen->GetSpans = pScreenPriv->GetSpans; - pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground; - pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder; pScreen->CopyWindow = pScreenPriv->CopyWindow; pScreen->WindowExposures = pScreenPriv->WindowExposures; pScreen->CreatePixmap = pScreenPriv->CreatePixmap; diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c index 016459091..86b30ff22 100644 --- a/hw/xfree86/xaa/xaaOverlay.c +++ b/hw/xfree86/xaa/xaaOverlay.c @@ -93,183 +93,6 @@ XAACopyWindow8_32( REGION_DESTROY(pScreen, borderClip); } - - - -static void -XAAPaintWindow8_32( - WindowPtr pWin, - RegionPtr prgn, - int what -){ - ScreenPtr pScreen = pWin->drawable.pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable)); - int nBox = REGION_NUM_RECTS(prgn); - BoxPtr pBox = REGION_RECTS(prgn); - PixmapPtr pPix = NULL; - int depth = pWin->drawable.depth; - int fg = 0, pm; - - if(!infoRec->pScrn->vtSema) goto BAILOUT; - - switch (what) { - case PW_BACKGROUND: - switch(pWin->backgroundState) { - case None: return; - case ParentRelative: - do { pWin = pWin->parent; } - while(pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, what); - return; - case BackgroundPixel: - fg = pWin->background.pixel; - break; - case BackgroundPixmap: - pPix = pWin->background.pixmap; - break; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - fg = pWin->border.pixel; - else /* pixmap */ - pPix = pWin->border.pixmap; - break; - default: return; - } - - if(depth == 8) { - pm = 0xff000000; - fg <<= 24; - } else - pm = 0x00ffffff; - - if(!pPix) { - if(infoRec->FillSolidRects && - !(infoRec->FillSolidRectsFlags & NO_PLANEMASK) && - (!(infoRec->FillSolidRectsFlags & RGB_EQUAL) || - (depth == 8) || CHECK_RGB_EQUAL(fg))) - { - (*infoRec->FillSolidRects)(infoRec->pScrn, fg, GXcopy, - pm, nBox, pBox); - return; - } - } else { /* pixmap */ - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix); - WindowPtr pBgWin = pWin; - int xorg, yorg; - - if (what == PW_BORDER) { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - } - - xorg = pBgWin->drawable.x; - yorg = pBgWin->drawable.y; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pScreen->myNum; - if(WindowTable[index] == pBgWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - - if(IS_OFFSCREEN_PIXMAP(pPix) && infoRec->FillCacheBltRects) { - XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec); - - pCache->x = pPriv->offscreenArea->box.x1; - pCache->y = pPriv->offscreenArea->box.y1; - pCache->w = pCache->orig_w = - pPriv->offscreenArea->box.x2 - pCache->x; - pCache->h = pCache->orig_h = - pPriv->offscreenArea->box.y2 - pCache->y; - pCache->trans_color = -1; - - (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, pm, - nBox, pBox, xorg, yorg, pCache); - - return; - } - - if(pPriv->flags & DIRTY) { - pPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK); - pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - - if(!(pPriv->flags & REDUCIBILITY_CHECKED) && - (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) { - XAACheckTileReducibility(pPix, infoRec->CanDoMono8x8); - } - - if(pPriv->flags & REDUCIBLE_TO_8x8) { - if((pPriv->flags & REDUCIBLE_TO_2_COLOR) && - infoRec->CanDoMono8x8 && infoRec->FillMono8x8PatternRects && - !(infoRec->FillMono8x8PatternRectsFlags & NO_PLANEMASK) && - !(infoRec->FillMono8x8PatternRectsFlags & TRANSPARENCY_ONLY) && - (!(infoRec->FillMono8x8PatternRectsFlags & RGB_EQUAL) || - (CHECK_RGB_EQUAL(pPriv->fg) && CHECK_RGB_EQUAL(pPriv->bg)))) - { - (*infoRec->FillMono8x8PatternRects)(infoRec->pScrn, - pPriv->fg, pPriv->bg, GXcopy, pm, nBox, pBox, - pPriv->pattern0, pPriv->pattern1, xorg, yorg); - return; - } - if(infoRec->CanDoColor8x8 && infoRec->FillColor8x8PatternRects && - !(infoRec->FillColor8x8PatternRectsFlags & NO_PLANEMASK)) - { - XAACacheInfoPtr pCache = (*infoRec->CacheColor8x8Pattern)( - infoRec->pScrn, pPix, -1, -1); - - (*infoRec->FillColor8x8PatternRects) (infoRec->pScrn, - GXcopy, pm, nBox, pBox, xorg, yorg, pCache); - return; - } - } - - if(infoRec->UsingPixmapCache && infoRec->FillCacheBltRects && - !(infoRec->FillCacheBltRectsFlags & NO_PLANEMASK) && - (pPix->drawable.height <= infoRec->MaxCacheableTileHeight) && - (pPix->drawable.width <= infoRec->MaxCacheableTileWidth)) - { - XAACacheInfoPtr pCache = - (*infoRec->CacheTile)(infoRec->pScrn, pPix); - (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, pm, - nBox, pBox, xorg, yorg, pCache); - return; - } - - if(infoRec->FillImageWriteRects && - !(infoRec->FillImageWriteRectsFlags & NO_PLANEMASK)) - { - (*infoRec->FillImageWriteRects) (infoRec->pScrn, GXcopy, - pm, nBox, pBox, xorg, yorg, pPix); - return; - } - } - - if(infoRec->NeedToSync) { - (*infoRec->Sync)(infoRec->pScrn); - infoRec->NeedToSync = FALSE; - } - -BAILOUT: - - if(what == PW_BACKGROUND) { - XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBackground); - (*pScreen->PaintWindowBackground) (pWin, prgn, what); - XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBackground, XAAPaintWindow8_32); - } else { - XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBorder); - (*pScreen->PaintWindowBorder) (pWin, prgn, what); - XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBorder, XAAPaintWindow8_32); - } -} - - static void XAASetColorKey8_32( ScreenPtr pScreen, @@ -295,8 +118,6 @@ XAASetupOverlay8_32Planar(ScreenPtr pScreen) XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); int i; - pScreen->PaintWindowBackground = XAAPaintWindow8_32; - pScreen->PaintWindowBorder = XAAPaintWindow8_32; pScreen->CopyWindow = XAACopyWindow8_32; if(!(infoRec->FillSolidRectsFlags & NO_PLANEMASK)) diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c index 77c9cb1c9..508b5c6f1 100644 --- a/hw/xfree86/xaa/xaaOverlayDF.c +++ b/hw/xfree86/xaa/xaaOverlayDF.c @@ -28,7 +28,6 @@ /* Screen funcs */ static void XAAOverCopyWindow(WindowPtr, DDXPointRec, RegionPtr); -static void XAAOverPaintWindow(WindowPtr, RegionPtr, int); static void XAAOverWindowExposures(WindowPtr, RegionPtr, RegionPtr); static int XAAOverStippledFillChooser(GCPtr); @@ -185,8 +184,6 @@ XAAInitDualFramebufferOverlay( /* Overwrite key screen functions. The XAA core will clean up */ pScreen->CopyWindow = XAAOverCopyWindow; - pScreen->PaintWindowBackground = XAAOverPaintWindow; - pScreen->PaintWindowBorder = XAAOverPaintWindow; pScreen->WindowExposures = XAAOverWindowExposures; pOverPriv->StippledFillChooser = infoRec->StippledFillChooser; @@ -401,56 +398,6 @@ XAAOverCopyWindow( } -static void -XAAOverPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what -){ - ScreenPtr pScreen = pWin->drawable.pScreen; - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen); - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - ScrnInfoPtr pScrn = infoRec->pScrn; - - if(pScrn->vtSema) { - if(what == PW_BACKGROUND) { - SWITCH_DEPTH(pWin->drawable.depth); - (*infoRec->PaintWindowBackground)(pWin, pRegion, what); - return; - } else { - if(pWin->drawable.bitsPerPixel == 8) { - SWITCH_DEPTH(8); - (*infoRec->PaintWindowBorder)(pWin, pRegion, what); - return; - } else if (infoRec->FillSolidRects) { - SWITCH_DEPTH(8); - (*infoRec->FillSolidRects)(pScrn, pScrn->colorKey, GXcopy, - ~0, REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion)); - - SWITCH_DEPTH(pWin->drawable.depth); - (*infoRec->PaintWindowBorder)(pWin, pRegion, what); - return; - } - } - - if(infoRec->NeedToSync) { - (*infoRec->Sync)(infoRec->pScrn); - infoRec->NeedToSync = FALSE; - } - } - - if(what == PW_BACKGROUND) { - XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBackground); - (*pScreen->PaintWindowBackground) (pWin, pRegion, what); - XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBackground, XAAOverPaintWindow); - } else { - XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBorder); - (*pScreen->PaintWindowBorder) (pWin, pRegion, what); - XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBorder, XAAOverPaintWindow); - } -} - - void XAAOverWindowExposures( WindowPtr pWin, diff --git a/hw/xfree86/xaa/xaaPaintWin.c b/hw/xfree86/xaa/xaaPaintWin.c deleted file mode 100644 index af5680c67..000000000 --- a/hw/xfree86/xaa/xaaPaintWin.c +++ /dev/null @@ -1,200 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "windowstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "xaawrap.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -void -XAAPaintWindow( - WindowPtr pWin, - RegionPtr prgn, - int what -) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable)); - int nBox = REGION_NUM_RECTS(prgn); - BoxPtr pBox = REGION_RECTS(prgn); - int fg = -1; - PixmapPtr pPix = NULL; - - if(!infoRec->pScrn->vtSema) goto BAILOUT; - - switch (what) { - case PW_BACKGROUND: - switch(pWin->backgroundState) { - case None: return; - case ParentRelative: - do { pWin = pWin->parent; } - while(pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, what); - return; - case BackgroundPixel: - fg = pWin->background.pixel; - break; - case BackgroundPixmap: - pPix = pWin->background.pixmap; - break; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - fg = pWin->border.pixel; - else /* pixmap */ - pPix = pWin->border.pixmap; - break; - default: return; - } - - - if(!pPix) { - if(infoRec->FillSolidRects && - (!(infoRec->FillSolidRectsFlags & RGB_EQUAL) || - (CHECK_RGB_EQUAL(fg))) ) { - (*infoRec->FillSolidRects)(infoRec->pScrn, fg, GXcopy, ~0, - nBox, pBox); - return; - } - } else { /* pixmap */ - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix); - WindowPtr pBgWin = pWin; - Bool NoCache = FALSE; - int xorg, yorg; - - /* Hack so we can use this with the dual framebuffer layers - which only support the pixmap cache in the primary bpp */ - if(pPix->drawable.bitsPerPixel != infoRec->pScrn->bitsPerPixel) - NoCache = TRUE; - - if (what == PW_BORDER) { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - } - - xorg = pBgWin->drawable.x; - yorg = pBgWin->drawable.y; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pScreen->myNum; - if(WindowTable[index] == pBgWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - - if(IS_OFFSCREEN_PIXMAP(pPix) && infoRec->FillCacheBltRects) { - XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec); - - pCache->x = pPriv->offscreenArea->box.x1; - pCache->y = pPriv->offscreenArea->box.y1; - pCache->w = pCache->orig_w = - pPriv->offscreenArea->box.x2 - pCache->x; - pCache->h = pCache->orig_h = - pPriv->offscreenArea->box.y2 - pCache->y; - pCache->trans_color = -1; - - (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, ~0, - nBox, pBox, xorg, yorg, pCache); - return; - } - - if(pPriv->flags & DIRTY) { - pPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK); - pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - - if(!(pPriv->flags & REDUCIBILITY_CHECKED) && - (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) { - XAACheckTileReducibility(pPix, infoRec->CanDoMono8x8); - } - - if(pPriv->flags & REDUCIBLE_TO_8x8) { - if((pPriv->flags & REDUCIBLE_TO_2_COLOR) && - infoRec->CanDoMono8x8 && infoRec->FillMono8x8PatternRects && - !(infoRec->FillMono8x8PatternRectsFlags & TRANSPARENCY_ONLY) && - (!(infoRec->FillMono8x8PatternRectsFlags & RGB_EQUAL) || - (CHECK_RGB_EQUAL(pPriv->fg) && CHECK_RGB_EQUAL(pPriv->bg)))) { - - (*infoRec->FillMono8x8PatternRects)(infoRec->pScrn, - pPriv->fg, pPriv->bg, GXcopy, ~0, nBox, pBox, - pPriv->pattern0, pPriv->pattern1, xorg, yorg); - return; - } - if(infoRec->CanDoColor8x8 && !NoCache && - infoRec->FillColor8x8PatternRects) { - XAACacheInfoPtr pCache = (*infoRec->CacheColor8x8Pattern)( - infoRec->pScrn, pPix, -1, -1); - - (*infoRec->FillColor8x8PatternRects) ( infoRec->pScrn, - GXcopy, ~0, nBox, pBox, xorg, yorg, pCache); - return; - } - } - - /* The window size check is to reduce pixmap cache thrashing - when there are lots of little windows with pixmap backgrounds - like are sometimes used for buttons, etc... */ - - if(infoRec->UsingPixmapCache && - infoRec->FillCacheBltRects && !NoCache && - ((what == PW_BORDER) || - (pPix->drawable.height != pWin->drawable.height) || - (pPix->drawable.width != pWin->drawable.width)) && - (pPix->drawable.height <= infoRec->MaxCacheableTileHeight) && - (pPix->drawable.width <= infoRec->MaxCacheableTileWidth)) { - - XAACacheInfoPtr pCache = - (*infoRec->CacheTile)(infoRec->pScrn, pPix); - (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, ~0, - nBox, pBox, xorg, yorg, pCache); - return; - } - - if(infoRec->FillImageWriteRects && - !(infoRec->FillImageWriteRectsFlags & NO_GXCOPY)) { - (*infoRec->FillImageWriteRects) (infoRec->pScrn, GXcopy, - ~0, nBox, pBox, xorg, yorg, pPix); - return; - } - } - - - if(infoRec->NeedToSync) { - (*infoRec->Sync)(infoRec->pScrn); - infoRec->NeedToSync = FALSE; - } - -BAILOUT: - - if(what == PW_BACKGROUND) { - XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBackground); - (*pScreen->PaintWindowBackground) (pWin, prgn, what); - XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBackground, XAAPaintWindow); - } else { - XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBorder); - (*pScreen->PaintWindowBorder) (pWin, prgn, what); - XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBorder, XAAPaintWindow); - } - -} diff --git a/hw/xfree86/xaa/xaaStateChange.c b/hw/xfree86/xaa/xaaStateChange.c index 39ad046c5..443bda628 100644 --- a/hw/xfree86/xaa/xaaStateChange.c +++ b/hw/xfree86/xaa/xaaStateChange.c @@ -259,8 +259,6 @@ typedef struct _XAAStateWrapRec { XAACacheInfoPtr pCache); GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; #ifdef RENDER Bool (*SetupForCPUToScreenAlphaTexture2)(ScrnInfoPtr pScrn, int op, @@ -1448,26 +1446,6 @@ static void XAAStateWrapGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr pp pwidth, nspans, pdstStart); } -static void XAAStateWrapPaintWindowBackground(WindowPtr pWindow, RegionPtr pRegion, - int what) -{ - GET_STATEPRIV_SCREEN(pWindow->drawable.pScreen); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PaintWindowBackground)(pWindow, pRegion, - what); -} - -static void XAAStateWrapPaintWindowBorder(WindowPtr pWindow, RegionPtr pRegion, - int what) -{ - GET_STATEPRIV_SCREEN(pWindow->drawable.pScreen); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PaintWindowBorder)(pWindow, pRegion, - what); -} - static void XAAStateWrapCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { @@ -1644,8 +1622,6 @@ XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec) XAA_STATE_WRAP(WriteColor8x8PatternToCache); XAA_STATE_WRAP(GetImage); XAA_STATE_WRAP(GetSpans); - XAA_STATE_WRAP(PaintWindowBackground); - XAA_STATE_WRAP(PaintWindowBorder); XAA_STATE_WRAP(CopyWindow); #ifdef RENDER XAA_STATE_WRAP(SetupForCPUToScreenAlphaTexture2); diff --git a/hw/xfree86/xaa/xaaWrapper.c b/hw/xfree86/xaa/xaaWrapper.c index 642ef8c39..5d6ea05cf 100644 --- a/hw/xfree86/xaa/xaaWrapper.c +++ b/hw/xfree86/xaa/xaaWrapper.c @@ -54,8 +54,6 @@ typedef struct { CreateScreenResourcesProcPtr CreateScreenResources; CreateWindowProcPtr CreateWindow; CopyWindowProcPtr CopyWindow; - PaintWindowProcPtr PaintWindowBackground; - PaintWindowProcPtr PaintWindowBorder; WindowExposuresProcPtr WindowExposures; CreateGCProcPtr CreateGC; CreateColormapProcPtr CreateColormap; @@ -73,8 +71,6 @@ typedef struct { CreateScreenResourcesProcPtr wrapCreateScreenResources; CreateWindowProcPtr wrapCreateWindow; CopyWindowProcPtr wrapCopyWindow; - PaintWindowProcPtr wrapPaintWindowBackground; - PaintWindowProcPtr wrapPaintWindowBorder; WindowExposuresProcPtr wrapWindowExposures; CreateGCProcPtr wrapCreateGC; CreateColormapProcPtr wrapCreateColormap; @@ -205,33 +201,6 @@ xaaWrapperWindowExposures (WindowPtr pWin, WindowExposures, wrapWindowExposures, xaaWrapperWindowExposures); } -static void -xaaWrapperPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) -{ - xaaWrapperScrPriv(pWin->drawable.pScreen); - - switch (what) { - case PW_BORDER: - cond_unwrap(pScrPriv, &pWin->drawable, pWin->drawable.pScreen, - PaintWindowBorder, wrapPaintWindowBorder); - - pWin->drawable.pScreen->PaintWindowBorder (pWin, pRegion, what); - cond_wrap(pScrPriv, &pWin->drawable, pWin->drawable.pScreen, - PaintWindowBorder, wrapPaintWindowBorder, - xaaWrapperPaintWindow); - break; - case PW_BACKGROUND: - cond_unwrap(pScrPriv, &pWin->drawable, pWin->drawable.pScreen, - PaintWindowBackground, wrapPaintWindowBackground); - - pWin->drawable.pScreen->PaintWindowBackground (pWin, pRegion, what); - cond_wrap(pScrPriv, &pWin->drawable, pWin->drawable.pScreen, - PaintWindowBackground, wrapPaintWindowBackground, - xaaWrapperPaintWindow); - break; - } -} - static Bool xaaWrapperCreateColormap(ColormapPtr pmap) { @@ -314,8 +283,6 @@ xaaSetupWrapper(ScreenPtr pScreen, XAAInfoRecPtr infoPtr, int depth, SyncFunc *f get (pScrPriv, pScreen, CreateScreenResources, wrapCreateScreenResources); get (pScrPriv, pScreen, CreateWindow, wrapCreateWindow); get (pScrPriv, pScreen, CopyWindow, wrapCopyWindow); - get (pScrPriv, pScreen, PaintWindowBorder, wrapPaintWindowBorder); - get (pScrPriv, pScreen, PaintWindowBackground, wrapPaintWindowBackground); get (pScrPriv, pScreen, WindowExposures, wrapWindowExposures); get (pScrPriv, pScreen, CreateGC, wrapCreateGC); get (pScrPriv, pScreen, CreateColormap, wrapCreateColormap); @@ -338,8 +305,6 @@ xaaSetupWrapper(ScreenPtr pScreen, XAAInfoRecPtr infoPtr, int depth, SyncFunc *f xaaWrapperCreateScreenResources); wrap (pScrPriv, pScreen, CreateWindow, xaaWrapperCreateWindow); wrap (pScrPriv, pScreen, CopyWindow, xaaWrapperCopyWindow); - wrap (pScrPriv, pScreen, PaintWindowBorder, xaaWrapperPaintWindow); - wrap (pScrPriv, pScreen, PaintWindowBackground, xaaWrapperPaintWindow); wrap (pScrPriv, pScreen, WindowExposures, xaaWrapperWindowExposures); wrap (pScrPriv, pScreen, CreateGC, xaaWrapperCreateGC); wrap (pScrPriv, pScreen, CreateColormap, xaaWrapperCreateColormap); diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h index 1e536c1fa..e25b9df52 100644 --- a/hw/xfree86/xaa/xaalocal.h +++ b/hw/xfree86/xaa/xaalocal.h @@ -45,8 +45,6 @@ typedef struct _XAAScreen { CloseScreenProcPtr CloseScreen; GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; WindowExposuresProcPtr WindowExposures; CreatePixmapProcPtr CreatePixmap; @@ -1315,14 +1313,6 @@ XAAWritePixmapToCacheLinear( int bpp, int depth ); - -void -XAAPaintWindow( - WindowPtr pWin, - RegionPtr prgn, - int what -); - void XAASolidHorVertLineAsRects( ScrnInfoPtr pScrn, diff --git a/hw/xfree86/xf1bpp/Makefile.am b/hw/xfree86/xf1bpp/Makefile.am index 4ea7ef0c1..c724f760f 100644 --- a/hw/xfree86/xf1bpp/Makefile.am +++ b/hw/xfree86/xf1bpp/Makefile.am @@ -45,7 +45,6 @@ libxf1bppmfb_a_SOURCES = \ mfbline.c \ mfbmisc.c \ mfbpixmap.c \ - mfbpntwin.c \ mfbpolypnt.c \ mfbpushpxl.c \ mfbscrclse.c \ diff --git a/hw/xfree86/xf1bpp/mfbmap.h b/hw/xfree86/xf1bpp/mfbmap.h index 5825c1cf4..e330ebd5b 100644 --- a/hw/xfree86/xf1bpp/mfbmap.h +++ b/hw/xfree86/xf1bpp/mfbmap.h @@ -61,7 +61,6 @@ #define mfbListInstalledColormaps xf1bppListInstalledColormaps #define mfbMapWindow xf1bppMapWindow #define mfbPadPixmap xf1bppPadPixmap -#define mfbPaintWindow xf1bppPaintWindow #define mfbPixmapToRegion xf1bppPixmapToRegion #define mfbPixmapToRegionWeak xf1bppPixmapToRegionWeak #define mfbPolyFillArcSolid xf1bppPolyFillArcSolid diff --git a/hw/xfree86/xf1bpp/mfbunmap.h b/hw/xfree86/xf1bpp/mfbunmap.h index 16237a163..56b734bcd 100644 --- a/hw/xfree86/xf1bpp/mfbunmap.h +++ b/hw/xfree86/xf1bpp/mfbunmap.h @@ -53,7 +53,6 @@ #undef mfbListInstalledColormaps #undef mfbMapWindow #undef mfbPadPixmap -#undef mfbPaintWindow #undef mfbPixmapToRegion #undef mfbPixmapToRegionWeak #undef mfbPolyFillArcSolid diff --git a/hw/xfree86/xf4bpp/Makefile.am b/hw/xfree86/xf4bpp/Makefile.am index 8665b2a6b..1414a0d0f 100644 --- a/hw/xfree86/xf4bpp/Makefile.am +++ b/hw/xfree86/xf4bpp/Makefile.am @@ -17,7 +17,6 @@ libxf4bpp_la_SOURCES = \ ppcGetSp.c \ ppcImg.c \ ppcPixmap.c \ - ppcPntWin.c \ ppcPolyPnt.c \ ppcQuery.c \ ppcRslvC.c \ diff --git a/hw/xfree86/xf4bpp/ppcGC.c b/hw/xfree86/xf4bpp/ppcGC.c index ca3c5e984..7ef312d39 100644 --- a/hw/xfree86/xf4bpp/ppcGC.c +++ b/hw/xfree86/xf4bpp/ppcGC.c @@ -176,8 +176,7 @@ register GCPtr pGC ; pGC->fExpose = TRUE; pGC->freeCompClip = FALSE; - pGC->pRotatedPixmap = NullPixmap; - + /* GJA: I don't like this code: * they allocated a mfbPrivGC, ignore the allocated data and place * a pointer to a ppcPrivGC in its slot. @@ -200,12 +199,6 @@ xf4bppDestroyGC( pGC ) { TRACE( ( "xf4bppDestroyGC(pGC=0x%x)\n", pGC ) ) ; - /* (ef) 11/9/87 -- ppc doesn't use rotated tile or stipple, but */ - /* *does* call mfbValidateGC under some conditions. */ - /* mfbValidateGC *does* use rotated tile and stipple */ - if ( pGC->pRotatedPixmap ) - mfbDestroyPixmap( pGC->pRotatedPixmap ) ; - if ( pGC->freeCompClip && pGC->pCompositeClip ) REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip); if(pGC->ops->devPrivate.val) xfree( pGC->ops ); diff --git a/hw/xfree86/xf4bpp/ppcIO.c b/hw/xfree86/xf4bpp/ppcIO.c index bd20218d3..313fcb0f8 100644 --- a/hw/xfree86/xf4bpp/ppcIO.c +++ b/hw/xfree86/xf4bpp/ppcIO.c @@ -205,8 +205,6 @@ xf4bppScreenInit( pScreen, pbits, virtx, virty, dpix, dpiy, width ) pScreen-> CreateWindow = xf4bppCreateWindowForXYhardware; pScreen-> DestroyWindow = xf4bppDestroyWindow; pScreen-> PositionWindow = xf4bppPositionWindow; - pScreen-> PaintWindowBackground = xf4bppPaintWindow; - pScreen-> PaintWindowBorder = xf4bppPaintWindow; pScreen-> CopyWindow = xf4bppCopyWindow; pScreen-> CreatePixmap = xf4bppCreatePixmap; pScreen-> CreateGC = xf4bppCreateGC; @@ -219,7 +217,7 @@ xf4bppScreenInit( pScreen, pbits, virtx, virty, dpix, dpiy, width ) pScreen-> ResolveColor = xf4bppResolveColor; mfbFillInScreen(pScreen); - if (!mfbAllocatePrivates(pScreen, NULL, NULL)) + if (!mfbAllocatePrivates(pScreen, NULL)) return FALSE; if (!miScreenInit(pScreen, pbits, virtx, virty, dpix, dpiy, width, diff --git a/hw/xfree86/xf4bpp/ppcPntWin.c b/hw/xfree86/xf4bpp/ppcPntWin.c deleted file mode 100644 index 482b34b5d..000000000 --- a/hw/xfree86/xf4bpp/ppcPntWin.c +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright IBM Corporation 1987,1988,1989 - * - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation, and that the name of IBM not be - * used in advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * - * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL - * IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR - * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * -*/ - -/*********************************************************** - -Copyright (c) 1987 X Consortium - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of the X Consortium shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from the X Consortium. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf4bpp.h" -#include "mfbmap.h" -#include "mfb.h" -#include "mi.h" -#include "scrnintstr.h" -#include "ibmTrace.h" - -/* NOTE: These functions only work for visuals up to 31-bits deep */ -static void xf4bppPaintWindowSolid( - WindowPtr, - RegionPtr, - int -); -static void xf4bppPaintWindowTile( - WindowPtr, - RegionPtr, - int -); - -void -xf4bppPaintWindow(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; -{ - - register mfbPrivWin *pPrivWin; - pPrivWin = (mfbPrivWin *)dixLookupPrivate(&pWin->devPrivates, mfbGetWindowPrivateKey()); - - TRACE(("xf4bppPaintWindow( pWin= 0x%x, pRegion= 0x%x, what= %d )\n", - pWin,pRegion,what)); - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - if (pPrivWin->fastBackground) - { - xf4bppPaintWindowTile(pWin, pRegion, what); - return; - } - break; - case BackgroundPixel: - xf4bppPaintWindowSolid(pWin, pRegion, what); - return; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - xf4bppPaintWindowSolid(pWin, pRegion, what); - return; - } - else if (pPrivWin->fastBorder) - { - xf4bppPaintWindowTile(pWin, pRegion, what); - return; - } - break; - } - miPaintWindow(pWin, pRegion, what); -} - -static void -xf4bppPaintWindowSolid(pWin, pRegion, what) - register WindowPtr pWin; - register RegionPtr pRegion; - int what; -{ - register int nbox; - register BoxPtr pbox; - register unsigned long int pixel; - register unsigned long int pm ; - - TRACE(("xf4bppPaintWindowSolid(pWin= 0x%x, pRegion= 0x%x, what= %d)\n", pWin, pRegion, what)); - - if ( !( nbox = REGION_NUM_RECTS(pRegion))) - return ; - pbox = REGION_RECTS(pRegion); - - if (what == PW_BACKGROUND) - pixel = pWin->background.pixel; - else - pixel = pWin->border.pixel; - - pm = ( 1 << pWin->drawable.depth ) - 1 ; - for ( ; nbox-- ; pbox++ ) { - /* - * call fill routine, the parms are: - * fill(color, alu, planes, x, y, width, height); - */ - xf4bppFillSolid( pWin, pixel, GXcopy, pm, pbox->x1, pbox->y1, - pbox->x2 - pbox->x1, pbox->y2 - pbox->y1 ) ; - } - return ; -} - -static void -xf4bppPaintWindowTile(pWin, pRegion, what) - register WindowPtr pWin; - register RegionPtr pRegion; - int what; -{ - register int nbox; - register BoxPtr pbox; - register PixmapPtr pTile; - register unsigned long int pm ; - - TRACE(("xf4bppPaintWindowTile(pWin= 0x%x, pRegion= 0x%x, what= %d)\n", pWin, pRegion, what)); - - if ( !( nbox = REGION_NUM_RECTS(pRegion))) - return ; - pbox = REGION_RECTS(pRegion); - - if (what == PW_BACKGROUND) - pTile = pWin->background.pixmap; - else - pTile = pWin->border.pixmap; - - pm = ( 1 << pWin->drawable.depth ) - 1 ; - for ( ; nbox-- ; pbox++ ) { - /* - * call tile routine, the parms are: - * tile(tile, alu, planes, x, y, width, height,xSrc,ySrc); - */ - xf4bppTileRect(pWin, pTile, GXcopy, pm, - pbox->x1, pbox->y1, - pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, - pWin->drawable.x, pWin->drawable.y ); - } - return ; -} diff --git a/hw/xfree86/xf4bpp/ppcWindow.c b/hw/xfree86/xf4bpp/ppcWindow.c index 055466738..8261af183 100644 --- a/hw/xfree86/xf4bpp/ppcWindow.c +++ b/hw/xfree86/xf4bpp/ppcWindow.c @@ -214,15 +214,7 @@ Bool xf4bppCreateWindowForXYhardware(pWin) register WindowPtr pWin ; { - register mfbPrivWin *pPrivWin; - TRACE(("xf4bppCreateWindowForXYhardware (pWin= 0x%x)\n", pWin)); - pPrivWin = (mfbPrivWin *)dixLookupPrivate(&pWin->devPrivates, mfbGetWindowPrivateKey()); - pPrivWin->pRotatedBorder = NullPixmap; - pPrivWin->pRotatedBackground = NullPixmap; - pPrivWin->fastBackground = 0; - pPrivWin->fastBorder = 0; - return TRUE; } diff --git a/hw/xfree86/xf4bpp/xf4bpp.h b/hw/xfree86/xf4bpp/xf4bpp.h index 5d5dcdd9f..e7e3721f7 100644 --- a/hw/xfree86/xf4bpp/xf4bpp.h +++ b/hw/xfree86/xf4bpp/xf4bpp.h @@ -189,13 +189,6 @@ PixmapPtr xf4bppCopyPixmap( PixmapPtr ); -/* ppcPntWin.c */ -void xf4bppPaintWindow( - WindowPtr, - RegionPtr, - int -); - /* ppcPolyPnt.c */ void xf4bppPolyPoint( DrawablePtr, diff --git a/hw/xfree86/xf8_32bpp/cfb8_32.h b/hw/xfree86/xf8_32bpp/cfb8_32.h index 281e5f2e0..6e985da20 100644 --- a/hw/xfree86/xf8_32bpp/cfb8_32.h +++ b/hw/xfree86/xf8_32bpp/cfb8_32.h @@ -109,13 +109,6 @@ cfb8_32GetImage ( char *pdstLine ); -void -cfb8_32PaintWindow ( - WindowPtr pWin, - RegionPtr pRegion, - int what -); - Bool cfb8_32ScreenInit ( ScreenPtr pScreen, @@ -133,15 +126,6 @@ cfb8_32FillBoxSolid8 ( unsigned long color ); - -void -cfb8_32FillBoxSolid32 ( - DrawablePtr pDraw, - int nbox, - BoxPtr pBox, - unsigned long color -); - RegionPtr cfb8_32CopyPlane( DrawablePtr pSrc, diff --git a/hw/xfree86/xf8_32bpp/cfbpntwin.c b/hw/xfree86/xf8_32bpp/cfbpntwin.c index a1b988716..fbf597d22 100644 --- a/hw/xfree86/xf8_32bpp/cfbpntwin.c +++ b/hw/xfree86/xf8_32bpp/cfbpntwin.c @@ -22,97 +22,6 @@ #include "panoramiXsrv.h" #endif -void -cfb8_32PaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what -){ - WindowPtr pBgWin; - int xorg, yorg; - - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - break; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)( - pWin, pRegion, what); - break; - case BackgroundPixmap: - xorg = pWin->drawable.x; - yorg = pWin->drawable.y; -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pWin->drawable.pScreen->myNum; - if(WindowTable[index] == pWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - cfb32FillBoxTileOddGeneral ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion), - pWin->background.pixmap, xorg, yorg, GXcopy, - (pWin->drawable.depth == 24) ? 0x00ffffff : 0xff000000); - break; - case BackgroundPixel: - if(pWin->drawable.depth == 24) - cfb8_32FillBoxSolid32 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel); - else - cfb8_32FillBoxSolid8 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->background.pixel); - break; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) { - if(pWin->drawable.depth == 24) { - cfb8_32FillBoxSolid32 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel); - } else - cfb8_32FillBoxSolid8 ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), - pWin->border.pixel); - } else { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - - xorg = pBgWin->drawable.x; - yorg = pBgWin->drawable.y; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) { - int index = pWin->drawable.pScreen->myNum; - if(WindowTable[index] == pBgWin) { - xorg -= panoramiXdataPtr[index].x; - yorg -= panoramiXdataPtr[index].y; - } - } -#endif - cfb32FillBoxTileOddGeneral ((DrawablePtr)pWin, - (int)REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion), - pWin->border.pixmap, xorg, yorg, GXcopy, - (pWin->drawable.depth == 24) ? 0x00ffffff : 0xff000000); - } - break; - } - -} - void cfb8_32FillBoxSolid8( DrawablePtr pDraw, @@ -140,41 +49,3 @@ cfb8_32FillBoxSolid8( pbox++; } } - - -void -cfb8_32FillBoxSolid32( - DrawablePtr pDraw, - int nbox, - BoxPtr pbox, - unsigned long color -){ - CARD8 *ptr, *data; - CARD16 *ptr2, *data2; - int pitch, pitch2; - int height, width, i; - CARD8 c = (CARD8)(color >> 16); - CARD16 c2 = (CARD16)color; - - cfbGetByteWidthAndPointer(pDraw, pitch, ptr); - cfbGetTypedWidthAndPointer(pDraw, pitch2, ptr2, CARD16, CARD16); - ptr += 2; /* point to the third byte */ - - while(nbox--) { - data = ptr + (pbox->y1 * pitch) + (pbox->x1 << 2); - data2 = ptr2 + (pbox->y1 * pitch2) + (pbox->x1 << 1); - width = (pbox->x2 - pbox->x1) << 1; - height = pbox->y2 - pbox->y1; - - while(height--) { - for(i = 0; i < width; i+=2) { - data[i << 1] = c; - data2[i] = c2; - } - data += pitch; - data2 += pitch2; - } - pbox++; - } -} - diff --git a/hw/xfree86/xf8_32bpp/cfbscrinit.c b/hw/xfree86/xf8_32bpp/cfbscrinit.c index fffd8d392..c3432b803 100644 --- a/hw/xfree86/xf8_32bpp/cfbscrinit.c +++ b/hw/xfree86/xf8_32bpp/cfbscrinit.c @@ -55,11 +55,7 @@ cfb8_32AllocatePrivates(ScreenPtr pScreen) /* All cfb will have the same GC and Window private indicies */ - if(!mfbAllocatePrivates(pScreen, &cfbWindowPrivateKey, &cfbGCPrivateKey)) - return FALSE; - - /* The cfb indicies are the mfb indicies. Reallocating them resizes them */ - if(!dixRequestPrivate(cfbWindowPrivateKey, sizeof(cfbPrivWin))) + if(!mfbAllocatePrivates(pScreen, &cfbGCPrivateKey)) return FALSE; if(!dixRequestPrivate(cfbGCPrivateKey, sizeof(cfbPrivGC))) @@ -108,8 +104,6 @@ cfb8_32SetupScreen( pScreen->ChangeWindowAttributes = cfb8_32ChangeWindowAttributes; pScreen->RealizeWindow = cfb32MapWindow; /* OK */ pScreen->UnrealizeWindow = cfb32UnmapWindow; /* OK */ - pScreen->PaintWindowBackground = cfb8_32PaintWindow; - pScreen->PaintWindowBorder = cfb8_32PaintWindow; pScreen->CopyWindow = cfb8_32CopyWindow; pScreen->CreatePixmap = cfb32CreatePixmap; /* OK */ pScreen->DestroyPixmap = cfb32DestroyPixmap; /* OK */ diff --git a/hw/xfree86/xf8_32bpp/cfbwindow.c b/hw/xfree86/xf8_32bpp/cfbwindow.c index ce741cb55..787cbdec6 100644 --- a/hw/xfree86/xf8_32bpp/cfbwindow.c +++ b/hw/xfree86/xf8_32bpp/cfbwindow.c @@ -27,11 +27,6 @@ Bool cfb8_32CreateWindow(WindowPtr pWin) { - cfbPrivWin *pPrivWin = cfbGetWindowPrivate(pWin); - - pPrivWin->fastBackground = FALSE; - pPrivWin->fastBorder = FALSE; - pWin->drawable.bitsPerPixel = 32; return TRUE; } diff --git a/hw/xfree86/xf8_32bpp/xf86overlay.c b/hw/xfree86/xf8_32bpp/xf86overlay.c index bab014b8c..700c71ada 100644 --- a/hw/xfree86/xf8_32bpp/xf86overlay.c +++ b/hw/xfree86/xf8_32bpp/xf86overlay.c @@ -34,7 +34,6 @@ static Bool OverlayCreateGC(GCPtr pGC); static Bool OverlayDestroyPixmap(PixmapPtr); static PixmapPtr OverlayCreatePixmap(ScreenPtr, int, int, int); static Bool OverlayChangeWindowAttributes(WindowPtr, unsigned long); -static void OverlayPaintWindow(WindowPtr, RegionPtr, int); /** Funcs **/ static void OverlayValidateGC(GCPtr, unsigned long, DrawablePtr); @@ -159,8 +158,6 @@ typedef struct { CreatePixmapProcPtr CreatePixmap; DestroyPixmapProcPtr DestroyPixmap; ChangeWindowAttributesProcPtr ChangeWindowAttributes; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; int LockPrivate; } OverlayScreenRec, *OverlayScreenPtr; @@ -273,16 +270,12 @@ xf86Overlay8Plus32Init (ScreenPtr pScreen) pScreenPriv->CreatePixmap = pScreen->CreatePixmap; pScreenPriv->DestroyPixmap = pScreen->DestroyPixmap; pScreenPriv->ChangeWindowAttributes = pScreen->ChangeWindowAttributes; - pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground; - pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder; pScreen->CreateGC = OverlayCreateGC; pScreen->CloseScreen = OverlayCloseScreen; pScreen->CreatePixmap = OverlayCreatePixmap; pScreen->DestroyPixmap = OverlayDestroyPixmap; pScreen->ChangeWindowAttributes = OverlayChangeWindowAttributes; - pScreen->PaintWindowBackground = OverlayPaintWindow; - pScreen->PaintWindowBorder = OverlayPaintWindow; pScreenPriv->LockPrivate = 0; @@ -391,8 +384,6 @@ OverlayCloseScreen (int i, ScreenPtr pScreen) pScreen->CreatePixmap = pScreenPriv->CreatePixmap; pScreen->DestroyPixmap = pScreenPriv->DestroyPixmap; pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes; - pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground; - pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder; xfree ((pointer) pScreenPriv); @@ -424,62 +415,6 @@ OverlayChangeWindowAttributes (WindowPtr pWin, unsigned long mask) return result; } -static void -OverlayPaintWindow( - WindowPtr pWin, - RegionPtr pReg, - int what -){ - ScreenPtr pScreen = pWin->drawable.pScreen; - OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen); - OverlayPixmapPtr pixPriv; - PixmapPtr oldPix = NULL; - - if(what == PW_BACKGROUND) { - if(pWin->drawable.depth == 8) { - if(pWin->backgroundState == ParentRelative) { - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - } - - if(pWin->backgroundState == BackgroundPixmap) { - oldPix = pWin->background.pixmap; - pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(oldPix); - /* have to do this here because alot of applications - incorrectly assume changes to a pixmap that is - a window background go into effect immediatedly */ - if(pixPriv->dirty & IS_DIRTY) - OverlayRefreshPixmap(pWin->background.pixmap); - pWin->background.pixmap = pixPriv->pix32; - } - } - - pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground; - (*pScreen->PaintWindowBackground) (pWin, pReg, what); - pScreen->PaintWindowBackground = OverlayPaintWindow; - - if(oldPix) - pWin->background.pixmap = oldPix; - } else { - if((pWin->drawable.depth == 8) && !pWin->borderIsPixel) { - oldPix = pWin->border.pixmap; - pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(oldPix); - if(pixPriv->dirty & IS_DIRTY) - OverlayRefreshPixmap(pWin->border.pixmap); - pWin->border.pixmap = pixPriv->pix32; - } - - pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder; - (*pScreen->PaintWindowBorder) (pWin, pReg, what); - pScreen->PaintWindowBorder = OverlayPaintWindow; - - if(oldPix) - pWin->border.pixmap = oldPix; - } -} - - /*********************** GC Funcs *****************************/ diff --git a/hw/xgl/Makefile.am b/hw/xgl/Makefile.am index 81484b99a..ef9fc0ea9 100644 --- a/hw/xgl/Makefile.am +++ b/hw/xgl/Makefile.am @@ -70,12 +70,14 @@ Xgl_SOURCES = \ $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/fb/fbcmap.c -Xgl_LDADD = \ + +XGL_LIBS = \ libxgl.a \ - $(XORG_CORE_LIBS) \ - $(XGL_LIBS) \ - $(XSERVER_LIBS) \ - $(EXTENSION_LIBS) -lglitz -ldl + @XGL_LIBS@ \ + $(XSERVER_LIBS) + +Xgl_DEPENDENCIES = $(XGL_LIBS) +Xgl_LDADD = $(XGL_LIBS) $(XSERVER_SYS_LIBS) $(XGL_SYS_LIBS) Xgl_programs = Xgl bin_PROGRAMS = $(Xgl_programs) diff --git a/hw/xgl/egl/Makefile.am b/hw/xgl/egl/Makefile.am index 5136e58b1..8c4e9af75 100644 --- a/hw/xgl/egl/Makefile.am +++ b/hw/xgl/egl/Makefile.am @@ -24,7 +24,12 @@ libxegl_la_SOURCES = \ kinput.c \ evdev.c -Xegl_DEPENDENCIES = @XEGL_LIBS@ +XEGL_LIBS = \ + @XEGL_LIBS@ \ + libxegl.la \ + ../libxgl.a \ + $XSERVER_LIBS + Xegl_LDFLAGS = -export-dynamic Xegl_SOURCES = \ xeglinit.c \ @@ -32,14 +37,8 @@ Xegl_SOURCES = \ $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/fb/fbcmap.c -Xegl_LDADD = \ - libxegl.la \ - ../libxgl.a \ - $(XORG_CORE_LIBS) \ - $(XEGL_LIBS) \ - $(XSERVER_LIBS) \ - $(EXTENSION_LIBS) \ - $(XGLXMODULES_LIBS) -Xegl_programs = Xegl -bin_PROGRAMS = $(Xegl_programs) +Xegl_DEPENDENCIES = $(XEGL_LIBS) +Xegl_LDADD = $(XEGL_LIBS) $(XSERVER_SYS_LIBS) $(XEGL_SYS_LIBS) + +bin_PROGRAMS = Xegl diff --git a/hw/xgl/glx/xglx.c b/hw/xgl/glx/xglx.c index d7f0ed3f9..89bd72e41 100644 --- a/hw/xgl/glx/xglx.c +++ b/hw/xgl/glx/xglx.c @@ -917,7 +917,7 @@ xglxWindowExposures (WindowPtr pWin, REGION_SUBTRACT (pScreen, &ClipList, &pWin->borderClip, &pWin->winSize); REGION_INTERSECT (pScreen, &ClipList, &ClipList, (RegionPtr) pReg); - (*pScreen->PaintWindowBorder) (pWin, &ClipList, PW_BORDER); + miPaintWindow(pWin, &ClipList, PW_BORDER); REGION_UNINIT (pScreen, &ClipList); } diff --git a/hw/xgl/xgl.h b/hw/xgl/xgl.h index ea28ea11d..46747a217 100644 --- a/hw/xgl/xgl.h +++ b/hw/xgl/xgl.h @@ -273,8 +273,6 @@ typedef struct _xglScreen { CreateWindowProcPtr CreateWindow; DestroyWindowProcPtr DestroyWindow; ChangeWindowAttributesProcPtr ChangeWindowAttributes; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; CreateGCProcPtr CreateGC; CloseScreenProcPtr CloseScreen; @@ -1091,16 +1089,6 @@ xglCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); -void -xglPaintWindowBackground (WindowPtr pWin, - RegionPtr pRegion, - int what); - -void -xglPaintWindowBorder (WindowPtr pWin, - RegionPtr pRegion, - int what); - PixmapPtr xglGetWindowPixmap (WindowPtr pWin); diff --git a/hw/xgl/xglscreen.c b/hw/xgl/xglscreen.c index e46869770..9b7297b91 100644 --- a/hw/xgl/xglscreen.c +++ b/hw/xgl/xglscreen.c @@ -210,8 +210,6 @@ xglScreenInit (ScreenPtr pScreen) XGL_SCREEN_WRAP (CreateWindow, xglCreateWindow); XGL_SCREEN_WRAP (DestroyWindow, xglDestroyWindow); XGL_SCREEN_WRAP (ChangeWindowAttributes, xglChangeWindowAttributes); - XGL_SCREEN_WRAP (PaintWindowBackground, xglPaintWindowBackground); - XGL_SCREEN_WRAP (PaintWindowBorder, xglPaintWindowBorder); XGL_SCREEN_WRAP (CreateGC, xglCreateGC); diff --git a/hw/xgl/xglwindow.c b/hw/xgl/xglwindow.c index 967d10f77..393f01df1 100644 --- a/hw/xgl/xglwindow.c +++ b/hw/xgl/xglwindow.c @@ -141,181 +141,6 @@ xglCopyWindow (WindowPtr pWin, REGION_UNINIT (pWin->drawable.pScreen, &rgnDst); } -static Bool -xglFillRegionSolid (DrawablePtr pDrawable, - RegionPtr pRegion, - Pixel pixel) -{ - glitz_pixel_format_t format; - glitz_surface_t *solid; - glitz_buffer_t *buffer; - BoxPtr pExtent; - Bool ret; - - XGL_DRAWABLE_PIXMAP_PRIV (pDrawable); - XGL_SCREEN_PRIV (pDrawable->pScreen); - - if (!xglPrepareTarget (pDrawable)) - return FALSE; - - solid = glitz_surface_create (pScreenPriv->drawable, - pPixmapPriv->pVisual->format.surface, - 1, 1, 0, NULL); - if (!solid) - return FALSE; - - glitz_surface_set_fill (solid, GLITZ_FILL_REPEAT); - - format.fourcc = GLITZ_FOURCC_RGB; - format.masks = pPixmapPriv->pVisual->pPixel->masks; - format.xoffset = 0; - format.skip_lines = 0; - format.bytes_per_line = sizeof (CARD32); - format.scanline_order = GLITZ_PIXEL_SCANLINE_ORDER_BOTTOM_UP; - - buffer = glitz_buffer_create_for_data (&pixel); - - glitz_set_pixels (solid, 0, 0, 1, 1, &format, buffer); - - glitz_buffer_destroy (buffer); - - pExtent = REGION_EXTENTS (pDrawable->pScreen, pRegion); - - ret = xglSolid (pDrawable, - GLITZ_OPERATOR_SRC, - solid, - NULL, - pExtent->x1, pExtent->y1, - pExtent->x2 - pExtent->x1, pExtent->y2 - pExtent->y1, - REGION_RECTS (pRegion), - REGION_NUM_RECTS (pRegion)); - - glitz_surface_destroy (solid); - - return ret; -} - -static Bool -xglFillRegionTiled (DrawablePtr pDrawable, - RegionPtr pRegion, - PixmapPtr pTile, - int tileX, - int tileY) -{ - BoxPtr pExtent; - - pExtent = REGION_EXTENTS (pDrawable->pScreen, pRegion); - - if (xglTile (pDrawable, - GLITZ_OPERATOR_SRC, - pTile, - tileX, tileY, - NULL, - pExtent->x1, pExtent->y1, - pExtent->x2 - pExtent->x1, pExtent->y2 - pExtent->y1, - REGION_RECTS (pRegion), - REGION_NUM_RECTS (pRegion))) - return TRUE; - - return FALSE; -} - -void -xglPaintWindowBackground (WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - XGL_SCREEN_PRIV (pScreen); - - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - - (*pScreen->PaintWindowBackground) (pWin, pRegion, what); - return; - case BackgroundPixmap: - if (xglFillRegionTiled (&pWin->drawable, - pRegion, - pWin->background.pixmap, - -pWin->drawable.x, - -pWin->drawable.y)) - { - xglAddCurrentBitDamage (&pWin->drawable); - return; - } - - if (!xglSyncBits (&pWin->background.pixmap->drawable, NullBox)) - FatalError (XGL_SW_FAILURE_STRING); - break; - case BackgroundPixel: - if (xglFillRegionSolid (&pWin->drawable, - pRegion, - pWin->background.pixel)) - { - xglAddCurrentBitDamage (&pWin->drawable); - return; - } - break; - } - - XGL_WINDOW_FALLBACK_PROLOGUE (pWin, PaintWindowBackground); - (*pScreen->PaintWindowBackground) (pWin, pRegion, what); - XGL_WINDOW_FALLBACK_EPILOGUE (pWin, pRegion, PaintWindowBackground, - xglPaintWindowBackground); -} - -void -xglPaintWindowBorder (WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - XGL_SCREEN_PRIV (pScreen); - - if (pWin->borderIsPixel) - { - if (xglFillRegionSolid (&pWin->drawable, - pRegion, - pWin->border.pixel)) - { - xglAddCurrentBitDamage (&pWin->drawable); - return; - } - } - else - { - WindowPtr pBgWin = pWin; - - while (pBgWin->backgroundState == ParentRelative) - pBgWin = pBgWin->parent; - - if (xglFillRegionTiled (&pBgWin->drawable, - pRegion, - pWin->border.pixmap, - -pBgWin->drawable.x, - -pBgWin->drawable.y)) - { - xglAddCurrentBitDamage (&pWin->drawable); - return; - } - - if (!xglSyncBits (&pWin->border.pixmap->drawable, NullBox)) - FatalError (XGL_SW_FAILURE_STRING); - } - - XGL_WINDOW_FALLBACK_PROLOGUE (pWin, PaintWindowBorder); - (*pScreen->PaintWindowBorder) (pWin, pRegion, what); - XGL_WINDOW_FALLBACK_EPILOGUE (pWin, pRegion, PaintWindowBorder, - xglPaintWindowBorder); -} - PixmapPtr xglGetWindowPixmap (WindowPtr pWin) { diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am index 99dba60bd..92f840c97 100644 --- a/hw/xnest/Makefile.am +++ b/hw/xnest/Makefile.am @@ -48,12 +48,15 @@ SRCS = Args.c \ libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c libfbcmap_a_CFLAGS = $(AM_CFLAGS) +XNEST_LIBS = \ + @XNEST_LIBS@ \ + libfbcmap.a \ + $(XSERVER_LIBS) + Xnest_SOURCES = $(SRCS) -Xnest_LDADD = $(XORG_CORE_LIBS) \ - $(XNEST_LIBS) \ - $(XNESTMODULES_LIBS) \ - libfbcmap.a +Xnest_DEPENDENCIES = $(XNEST_LIBS) +Xnest_LDADD = $(XNEST_LIBS) $(XNEST_SYS_LIBS) $(XSERVER_SYS_LIBS) EXTRA_DIST = icon \ screensaver \ diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c index f91454928..83590bced 100644 --- a/hw/xnest/Screen.c +++ b/hw/xnest/Screen.c @@ -284,8 +284,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) pScreen->UnrealizeWindow = xnestUnrealizeWindow; pScreen->PostValidateTree = NULL; pScreen->WindowExposures = xnestWindowExposures; - pScreen->PaintWindowBackground = xnestPaintWindowBackground; - pScreen->PaintWindowBorder = xnestPaintWindowBorder; pScreen->CopyWindow = xnestCopyWindow; pScreen->ClipNotify = xnestClipNotify; diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c index 0955e61b9..bc9d8bed2 100644 --- a/hw/xnest/Window.c +++ b/hw/xnest/Window.c @@ -378,30 +378,6 @@ xnestUnrealizeWindow(WindowPtr pWin) return True; } -void -xnestPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what) -{ - int i; - BoxPtr pBox; - - xnestConfigureWindow(pWin, CWWidth | CWHeight); - - pBox = REGION_RECTS(pRegion); - for (i = 0; i < REGION_NUM_RECTS(pRegion); i++) - XClearArea(xnestDisplay, xnestWindow(pWin), - pBox[i].x1 - pWin->drawable.x, - pBox[i].y1 - pWin->drawable.y, - pBox[i].x2 - pBox[i].x1, - pBox[i].y2 - pBox[i].y1, - False); -} - -void -xnestPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what) -{ - xnestConfigureWindow(pWin, CWBorderWidth); -} - void xnestCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion) { diff --git a/hw/xnest/XNWindow.h b/hw/xnest/XNWindow.h index 1aaf4e153..4cb66c8ce 100644 --- a/hw/xnest/XNWindow.h +++ b/hw/xnest/XNWindow.h @@ -64,8 +64,6 @@ void xnestConfigureWindow(WindowPtr pWin, unsigned int mask); Bool xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask); Bool xnestRealizeWindow(WindowPtr pWin); Bool xnestUnrealizeWindow(WindowPtr pWin); -void xnestPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what); -void xnestPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what); void xnestCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion); void xnestClipNotify(WindowPtr pWin, int dx, int dy); void xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, diff --git a/hw/xprint/Makefile.am b/hw/xprint/Makefile.am index dc8764a02..c440473a0 100644 --- a/hw/xprint/Makefile.am +++ b/hw/xprint/Makefile.am @@ -9,10 +9,22 @@ Xprt_CFLAGS = @DIX_CFLAGS@ @XPRINT_CFLAGS@ \ -DXFree86Server Xprt_LDFLAGS = -L$(top_srcdir) -Xprt_LDADD = @XPRINT_LIBS@ ps/libps.la raster/libraster.la \ - pcl/libpcl.la pcl-mono/libpcl.la $(top_builddir)/fb/libfb.la \ - $(top_builddir)/render/librender.la $(top_builddir)/mi/libmi.la \ - $(top_builddir)/Xext/libXext.la @FREETYPE_LIBS@ +XPRINT_LIBS = \ + @XPRINT_LIBS@ \ + ps/libps.la \ + raster/libraster.la \ + pcl/libpcl.la \ + pcl-mono/libpcl.la \ + $(top_builddir)/fb/libfb.la \ + $(top_builddir)/render/librender.la \ + $(XSERVER_LIBS) \ + $(top_builddir)/Xext/libXext.la \ + $(top_builddir)/xkb/libxkb.la \ + $(top_builddir)/xkb/libxkbstubs.la \ + $(top_builddir)/os/libos.la # for Xprintf + +Xprt_DEPENDENCIES = $(XPRINT_LIBS) +Xprt_LDADD = $(XPRINT_LIBS) $(XPRINT_SYS_LIBS) $(XSERVER_SYS_LIBS) miinitext-wrapper.c: echo "#include \"$(top_srcdir)/mi/miinitext.c\"" >> $@ diff --git a/hw/xprint/ddxInit.c b/hw/xprint/ddxInit.c index a465c4c6d..1e7652e60 100644 --- a/hw/xprint/ddxInit.c +++ b/hw/xprint/ddxInit.c @@ -310,6 +310,17 @@ ChangeDeviceControl ( return BadMatch; } +int +NewInputDeviceRequest(InputOption *options, DeviceIntPtr *pdev) +{ + return BadValue; +} + +void +DeleteInputDeviceRequest(DeviceIntPtr dev) +{ +} + void OpenInputDevice ( DeviceIntPtr dev, diff --git a/hw/xprint/pcl/Pcl.h b/hw/xprint/pcl/Pcl.h index 216353be8..d46a03401 100644 --- a/hw/xprint/pcl/Pcl.h +++ b/hw/xprint/pcl/Pcl.h @@ -568,10 +568,6 @@ extern void PclCopyWindow( extern Bool PclChangeWindowAttributes( register WindowPtr pWin, register unsigned long mask); -extern void PclPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what); /****** * Functions in PclFonts.c diff --git a/hw/xprint/pcl/PclInit.c b/hw/xprint/pcl/PclInit.c index 478a34244..e738e3e54 100644 --- a/hw/xprint/pcl/PclInit.c +++ b/hw/xprint/pcl/PclInit.c @@ -202,8 +202,6 @@ InitializePclDriver( pScreen->RealizeWindow = PclMapWindow; pScreen->UnrealizeWindow = PclUnmapWindow; */ - pScreen->PaintWindowBackground = PclPaintWindow; - pScreen->PaintWindowBorder = PclPaintWindow; pScreen->CopyWindow = PclCopyWindow; /* XXX Hard routine to write! */ pScreen->CreatePixmap = fbCreatePixmap; diff --git a/hw/xprint/pcl/PclWindow.c b/hw/xprint/pcl/PclWindow.c index 997cfe4f0..a87dc0e7a 100644 --- a/hw/xprint/pcl/PclWindow.c +++ b/hw/xprint/pcl/PclWindow.c @@ -199,232 +199,6 @@ PclChangeWindowAttributes( return TRUE; } - -/* - * This function is largely ripped from miPaintWindow, but modified so - * that the background is not painted to the root window, and so that - * the backing store is not referenced. - */ -void -PclPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - -#define FUNCTION 0 -#define FOREGROUND 1 -#define TILE 2 -#define FILLSTYLE 3 -#define ABSX 4 -#define ABSY 5 -#define CLIPMASK 6 -#define SUBWINDOW 7 -#define COUNT_BITS 8 - - pointer gcval[7]; - pointer newValues [COUNT_BITS]; - - BITS32 gcmask, index, mask; - RegionRec prgnWin; - DDXPointRec oldCorner; - BoxRec box; - WindowPtr pBgWin; - GCPtr pGC; - register int i; - register BoxPtr pbox; - register ScreenPtr pScreen = pWin->drawable.pScreen; - register xRectangle *prect; - int numRects; - - gcmask = 0; - - /* - * We don't want to paint a window that has no place to put the - * PCL output. - */ - if( PclGetContextFromWindow( pWin ) == (XpContextPtr)NULL ) - return; - - if (what == PW_BACKGROUND) - { - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - (*pWin->parent->drawable.pScreen->PaintWindowBackground) - (pWin->parent, pRegion, what); - return; - case BackgroundPixel: - newValues[FOREGROUND] = (pointer)pWin->background.pixel; - newValues[FILLSTYLE] = (pointer)FillSolid; - gcmask |= GCForeground | GCFillStyle; - break; - case BackgroundPixmap: - newValues[TILE] = (pointer)pWin->background.pixmap; - newValues[FILLSTYLE] = (pointer)FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | - GCTileStipYOrigin; - break; - } - } - else - { - if (pWin->borderIsPixel) - { - newValues[FOREGROUND] = (pointer)pWin->border.pixel; - newValues[FILLSTYLE] = (pointer)FillSolid; - gcmask |= GCForeground | GCFillStyle; - } - else - { - newValues[TILE] = (pointer)pWin->border.pixmap; - newValues[FILLSTYLE] = (pointer)FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin - | GCTileStipYOrigin; - } - } - - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(pRegion) * - sizeof(xRectangle)); - if (!prect) - return; - - newValues[FUNCTION] = (pointer)GXcopy; - gcmask |= GCFunction | GCClipMask; - - i = pScreen->myNum; - - pBgWin = pWin; - if (what == PW_BORDER) - { - while (pBgWin->backgroundState == ParentRelative) - pBgWin = pBgWin->parent; - } - - pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); - if (!pGC) - { - DEALLOCATE_LOCAL(prect); - return; - } - /* - * mash the clip list so we can paint the border by - * mangling the window in place, pretending it - * spans the entire screen - */ - if (what == PW_BORDER) - { - prgnWin = pWin->clipList; - oldCorner.x = pWin->drawable.x; - oldCorner.y = pWin->drawable.y; - pWin->drawable.x = pWin->drawable.y = 0; - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - newValues[ABSX] = (pointer)(long)pBgWin->drawable.x; - newValues[ABSY] = (pointer)(long)pBgWin->drawable.y; - } - else - { - newValues[ABSX] = (pointer)0; - newValues[ABSY] = (pointer)0; - } - - mask = gcmask; - gcmask = 0; - i = 0; - while (mask) { - index = lowbit (mask); - mask &= ~index; - switch (index) { - case GCFunction: - if ((pointer)(long) pGC->alu != newValues[FUNCTION]) { - gcmask |= index; - gcval[i++] = newValues[FUNCTION]; - } - break; - case GCTileStipXOrigin: - if ((pointer)(long) pGC->patOrg.x != newValues[ABSX]) { - gcmask |= index; - gcval[i++] = newValues[ABSX]; - } - break; - case GCTileStipYOrigin: - if ((pointer)(long) pGC->patOrg.y != newValues[ABSY]) { - gcmask |= index; - gcval[i++] = newValues[ABSY]; - } - break; - case GCClipMask: - if ((pointer)(long) pGC->clientClipType != (pointer)CT_NONE) { - gcmask |= index; - gcval[i++] = (pointer)CT_NONE; - } - break; - case GCSubwindowMode: - if ((pointer)(long) pGC->subWindowMode != newValues[SUBWINDOW]) { - gcmask |= index; - gcval[i++] = newValues[SUBWINDOW]; - } - break; - case GCTile: - if (pGC->tileIsPixel || - (pointer) pGC->tile.pixmap != newValues[TILE]) - { - gcmask |= index; - gcval[i++] = newValues[TILE]; - } - break; - case GCFillStyle: - if ((pointer)(long) pGC->fillStyle != newValues[FILLSTYLE]) { - gcmask |= index; - gcval[i++] = newValues[FILLSTYLE]; - } - break; - case GCForeground: - if ((pointer) pGC->fgPixel != newValues[FOREGROUND]) { - gcmask |= index; - gcval[i++] = newValues[FOREGROUND]; - } - break; - } - } - - if (gcmask) - DoChangeGC(pGC, gcmask, (XID *)gcval, 1); - - if (pWin->drawable.serialNumber != pGC->serialNumber) - ValidateGC((DrawablePtr)pWin, pGC); - - numRects = REGION_NUM_RECTS(pRegion); - pbox = REGION_RECTS(pRegion); - for (i= numRects; --i >= 0; pbox++, prect++) - { - prect->x = pbox->x1 - pWin->drawable.x; - prect->y = pbox->y1 - pWin->drawable.y; - prect->width = pbox->x2 - pbox->x1; - prect->height = pbox->y2 - pbox->y1; - } - prect -= numRects; - (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect); - DEALLOCATE_LOCAL(prect); - - if (what == PW_BORDER) - { - REGION_UNINIT(pScreen, &pWin->clipList); - pWin->clipList = prgnWin; - pWin->drawable.x = oldCorner.x; - pWin->drawable.y = oldCorner.y; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - FreeScratchGC(pGC); - -} - /*ARGSUSED*/ Bool PclDestroyWindow( diff --git a/hw/xprint/pcl/Pclmap.h b/hw/xprint/pcl/Pclmap.h index 79724213f..18ac31d90 100644 --- a/hw/xprint/pcl/Pclmap.h +++ b/hw/xprint/pcl/Pclmap.h @@ -105,7 +105,6 @@ copyright holders. #define PclUnmapWindow PCLNAME(UnmapWindow) #define PclCopyWindow PCLNAME(CopyWindow) #define PclChangeWindowAttributes PCLNAME(ChangeWindowAttributes) -#define PclPaintWindow PCLNAME(PaintWindow) #define PclDestroyWindow PCLNAME(DestroyWindow) /* PclGC.c */ diff --git a/hw/xprint/ps/Ps.h b/hw/xprint/ps/Ps.h index db1dd9129..415c9296a 100644 --- a/hw/xprint/ps/Ps.h +++ b/hw/xprint/ps/Ps.h @@ -517,7 +517,6 @@ extern Bool PsUnmapWindow(WindowPtr pWin); extern void PsCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); extern Bool PsChangeWindowAttributes(WindowPtr pWin, unsigned long mask); -extern void PsPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); extern Bool PsDestroyWindow(WindowPtr pWin); /* diff --git a/hw/xprint/ps/PsInit.c b/hw/xprint/ps/PsInit.c index 6c86fa221..72bd7bd7c 100644 --- a/hw/xprint/ps/PsInit.c +++ b/hw/xprint/ps/PsInit.c @@ -170,8 +170,6 @@ InitializePsDriver(ndx, pScreen, argc, argv) pScreen->ChangeWindowAttributes = PsChangeWindowAttributes; pScreen->RealizeWindow = PsMapWindow; pScreen->UnrealizeWindow = PsUnmapWindow; - pScreen->PaintWindowBackground = PsPaintWindow; - pScreen->PaintWindowBorder = PsPaintWindow; pScreen->CloseScreen = PsCloseScreen; pScreen->CopyWindow = PsCopyWindow; /* XXX Hard routine to write! */ diff --git a/hw/xprint/ps/PsWindow.c b/hw/xprint/ps/PsWindow.c index d107e5c26..d17cf8ce0 100644 --- a/hw/xprint/ps/PsWindow.c +++ b/hw/xprint/ps/PsWindow.c @@ -214,230 +214,6 @@ PsChangeWindowAttributes( return TRUE; } - -void -PsPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - WindowPtr pRoot; - -#define FUNCTION 0 -#define FOREGROUND 1 -#define TILE 2 -#define FILLSTYLE 3 -#define ABSX 4 -#define ABSY 5 -#define CLIPMASK 6 -#define SUBWINDOW 7 -#define COUNT_BITS 8 - - pointer gcval[7]; - pointer newValues [COUNT_BITS]; - - BITS32 gcmask, index, mask; - RegionRec prgnWin; - DDXPointRec oldCorner; - BoxRec box; - WindowPtr pBgWin; - GCPtr pGC; - register int i; - register BoxPtr pbox; - register ScreenPtr pScreen = pWin->drawable.pScreen; - register xRectangle *prect; - int numRects; - - gcmask = 0; - - /* - * We don't want to paint a window that has no place to put the - * PS output. - */ - if( PsGetContextFromWindow(pWin)==(XpContextPtr)NULL ) return; - - if( what==PW_BACKGROUND ) - { - switch(pWin->backgroundState) - { - case None: return; - case ParentRelative: - (*pWin->parent->drawable.pScreen->PaintWindowBackground) - (pWin->parent, pRegion, what); - return; - case BackgroundPixel: - newValues[FOREGROUND] = (pointer)pWin->background.pixel; - newValues[FILLSTYLE] = (pointer)FillSolid; - gcmask |= GCForeground | GCFillStyle; - break; - case BackgroundPixmap: - newValues[TILE] = (pointer)pWin->background.pixmap; - newValues[FILLSTYLE] = (pointer)FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - break; - } - } - else - { - if( pWin->borderIsPixel ) - { - newValues[FOREGROUND] = (pointer)pWin->border.pixel; - newValues[FILLSTYLE] = (pointer)FillSolid; - gcmask |= GCForeground | GCFillStyle; - } - else - { - newValues[TILE] = (pointer)pWin->border.pixmap; - newValues[FILLSTYLE] = (pointer)FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - } - } - - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(pRegion) * - sizeof(xRectangle)); - if( !prect ) return; - - newValues[FUNCTION] = (pointer)GXcopy; - gcmask |= GCFunction | GCClipMask; - - i = pScreen->myNum; - pRoot = WindowTable[i]; - - pBgWin = pWin; - if (what == PW_BORDER) - { - while( pBgWin->backgroundState==ParentRelative ) pBgWin = pBgWin->parent; - } - - pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); - if( !pGC ) - { - DEALLOCATE_LOCAL(prect); - return; - } - /* - * mash the clip list so we can paint the border by - * mangling the window in place, pretending it - * spans the entire screen - */ - if( what==PW_BORDER ) - { - prgnWin = pWin->clipList; - oldCorner.x = pWin->drawable.x; - oldCorner.y = pWin->drawable.y; - pWin->drawable.x = pWin->drawable.y = 0; - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - newValues[ABSX] = (pointer)(long)pBgWin->drawable.x; - newValues[ABSY] = (pointer)(long)pBgWin->drawable.y; - } - else - { - newValues[ABSX] = (pointer)0; - newValues[ABSY] = (pointer)0; - } - - mask = gcmask; - gcmask = 0; - i = 0; - while( mask ) - { - index = lowbit (mask); - mask &= ~index; - switch(index) - { - case GCFunction: - if( (pointer)(long)pGC->alu!=newValues[FUNCTION] ) - { - gcmask |= index; - gcval[i++] = newValues[FUNCTION]; - } - break; - case GCTileStipXOrigin: - if( (pointer)(long)pGC->patOrg.x!=newValues[ABSX] ) - { - gcmask |= index; - gcval[i++] = newValues[ABSX]; - } - break; - case GCTileStipYOrigin: - if( (pointer)(long)pGC->patOrg.y!=newValues[ABSY] ) - { - gcmask |= index; - gcval[i++] = newValues[ABSY]; - } - break; - case GCClipMask: - if( (pointer)pGC->clientClipType!=(pointer)CT_NONE ) - { - gcmask |= index; - gcval[i++] = (pointer)CT_NONE; - } - break; - case GCSubwindowMode: - if( (pointer)pGC->subWindowMode!=newValues[SUBWINDOW] ) - { - gcmask |= index; - gcval[i++] = newValues[SUBWINDOW]; - } - break; - case GCTile: - if( pGC->tileIsPixel || (pointer)pGC->tile.pixmap!=newValues[TILE] ) - { - gcmask |= index; - gcval[i++] = newValues[TILE]; - } - break; - case GCFillStyle: - if( (pointer)pGC->fillStyle!=newValues[FILLSTYLE] ) - { - gcmask |= index; - gcval[i++] = newValues[FILLSTYLE]; - } - break; - case GCForeground: - if( (pointer)pGC->fgPixel!=newValues[FOREGROUND] ) - { - gcmask |= index; - gcval[i++] = newValues[FOREGROUND]; - } - break; - } - } - - if( gcmask ) DoChangeGC(pGC, gcmask, (XID *)gcval, 1); - - if( pWin->drawable.serialNumber!=pGC->serialNumber ) - ValidateGC((DrawablePtr)pWin, pGC); - - numRects = REGION_NUM_RECTS(pRegion); - pbox = REGION_RECTS(pRegion); - for( i=numRects ; --i >= 0 ; pbox++,prect++ ) - { - prect->x = pbox->x1 - pWin->drawable.x; - prect->y = pbox->y1 - pWin->drawable.y; - prect->width = pbox->x2 - pbox->x1; - prect->height = pbox->y2 - pbox->y1; - } - prect -= numRects; - (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect); - DEALLOCATE_LOCAL(prect); - - if( what==PW_BORDER ) - { - REGION_UNINIT(pScreen, &pWin->clipList); - pWin->clipList = prgnWin; - pWin->drawable.x = oldCorner.x; - pWin->drawable.y = oldCorner.y; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - FreeScratchGC(pGC); -} - /*ARGSUSED*/ Bool PsDestroyWindow(WindowPtr pWin) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 57e20102e..5ffba1274 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -45,7 +45,6 @@ SRCS_NATIVEGDI = \ wingetsp.c \ winnativegdi.c \ winpixmap.c \ - winpntwin.c \ winpolyline.c \ winpushpxl.c \ winrop.c \ @@ -146,10 +145,12 @@ XWin_SOURCES = $(SRCS) INCLUDES = -I$(top_srcdir)/miext/rootless \ -I$(top_srcdir)/miext/rootless/safeAlpha -XWin_LDADD = $(XORG_CORE_LIBS) \ - $(top_builddir)/fb/libfb.la \ - $(XWIN_LIBS) \ - $(XWINMODULES_LIBS) +XWIN_LIBS = \ + $(top_builddir)/fb/libfb.la \ + $(XSERVER_LIBS) + +XWin_DEPENDENCIES = $(XWIN_LIBS) +XWin_LDADD = $(XWIN_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) XWin_LDFLAGS = -mwindows -static diff --git a/hw/xwin/win.h b/hw/xwin/win.h index fad5e2b2e..45a6ca3c2 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -579,8 +579,6 @@ typedef struct _winPrivScreenRec ValidateTreeProcPtr ValidateTree; PostValidateTreeProcPtr PostValidateTree; WindowExposuresProcPtr WindowExposures; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; ClipNotifyProcPtr ClipNotify; @@ -1052,17 +1050,6 @@ winModifyPixmapHeaderNativeGDI (PixmapPtr pPixmap, pointer pPixData); #endif - -#ifdef XWIN_NATIVEGDI -/* - * winpntwin.c - */ - -void -winPaintWindowNativeGDI (WindowPtr pWin, RegionPtr pRegion, int what); -#endif - - #ifdef XWIN_NATIVEGDI /* * winpolyline.c diff --git a/hw/xwin/winpntwin.c b/hw/xwin/winpntwin.c deleted file mode 100644 index caee712c9..000000000 --- a/hw/xwin/winpntwin.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - *Copyright (C) 2001-2004 Harold L Hunt II All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of Harold L Hunt II - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from Harold L Hunt II. - * - * Authors: Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include -#endif -#include "win.h" - -/* See Porting Layer Definition - p. 39 - * Sometimes implemented as two functions: - * PaintWindowBackground (nKind = PW_BACKGROUND) - * PaintWindowBorder (nKind = PW_BORDER) - */ -void -winPaintWindowNativeGDI (WindowPtr pWin, - RegionPtr pRegion, - int nKind) -{ - ErrorF ("winPaintWindow()\n"); -} diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c index 2038e6fe5..9dc4c3da5 100644 --- a/hw/xwin/winscrinit.c +++ b/hw/xwin/winscrinit.c @@ -714,8 +714,6 @@ winFinishScreenInitNativeGDI (int index, pScreen->UnrealizeWindow = winUnmapWindowNativeGDI; /* Paint window */ - pScreen->PaintWindowBackground = miPaintWindow; - pScreen->PaintWindowBorder = miPaintWindow; pScreen->CopyWindow = winCopyWindowNativeGDI; /* Fonts */ diff --git a/include/inputstr.h b/include/inputstr.h index bb7f35096..6a1d5c9d7 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -123,6 +123,7 @@ typedef struct _GrabRec { typedef struct _KeyClassRec { CARD8 down[DOWN_LENGTH]; + CARD8 postdown[DOWN_LENGTH]; KeyCode *modifierKeyMap; KeySymsRec curKeySyms; int modifierKeyCount[8]; diff --git a/include/scrnintstr.h b/include/scrnintstr.h index a24c5f528..6b329d6e3 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -472,8 +472,8 @@ typedef struct _Screen { ValidateTreeProcPtr ValidateTree; PostValidateTreeProcPtr PostValidateTree; WindowExposuresProcPtr WindowExposures; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; + PaintWindowBackgroundProcPtr PaintWindowBackground; /** unused */ + PaintWindowBorderProcPtr PaintWindowBorder; /** unused */ CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; ClipNotifyProcPtr ClipNotify; diff --git a/mfb/Makefile.am b/mfb/Makefile.am index 8ff0260e7..274a32d7d 100644 --- a/mfb/Makefile.am +++ b/mfb/Makefile.am @@ -12,7 +12,7 @@ libmfb_gen_sources = mfbseg.c mfbpgbwht.c mfbpgbblak.c mfbpgbinv.c mfbigbwht.c \ DISTCLEANFILES = $(libmfb_gen_sources) libmfb_la_SOURCES = mfbgc.c mfbwindow.c mfbfont.c \ - mfbfillrct.c mfbpntwin.c maskbits.c mfbpixmap.c \ + mfbfillrct.c maskbits.c mfbpixmap.c \ mfbimage.c mfbline.c mfbbres.c mfbhrzvert.c mfbbresd.c \ mfbpushpxl.c mfbzerarc.c mfbfillarc.c \ mfbfillsp.c mfbsetsp.c mfbscrinit.c mfbscrclse.c mfbclip.c \ diff --git a/mfb/mfb.h b/mfb/mfb.h index 42f3002f2..4d503f9f3 100644 --- a/mfb/mfb.h +++ b/mfb/mfb.h @@ -650,13 +650,6 @@ extern void mfbFillPolyWhite( int /*count*/, DDXPointPtr /*ptsIn*/ ); -/* mfbpntwin.c */ - -extern void mfbPaintWindow( - WindowPtr /*pWin*/, - RegionPtr /*pRegion*/, - int /*what*/ -); /* mfbpolypnt.c */ extern void mfbPolyPoint( @@ -705,8 +698,7 @@ extern Bool mfbCloseScreen( extern Bool mfbAllocatePrivates( ScreenPtr /*pScreen*/, - DevPrivateKey *pWinKey, - DevPrivateKey *pGCIndex + DevPrivateKey * /*pGCKey*/ ); extern Bool mfbScreenInit( @@ -892,22 +884,11 @@ typedef mfbPrivGC *mfbPrivGCPtr; #endif extern DevPrivateKey mfbGetGCPrivateKey(void); -extern DevPrivateKey mfbGetWindowPrivateKey(void); #ifdef PIXMAP_PER_WINDOW extern DevPrivateKey frameGetWindowPrivateKey(void); #endif #ifndef MFB_PROTOTYPES_ONLY -/* private field of window */ -typedef struct { - unsigned char fastBorder; /* non-zero if border tile is 32 bits wide */ - unsigned char fastBackground; - unsigned short unused; /* pad for alignment with Sun compiler */ - DDXPointRec oldRotate; - PixmapPtr pRotatedBackground; - PixmapPtr pRotatedBorder; - } mfbPrivWin; - /* Common macros for extracting drawing information */ #define mfbGetTypedWidth(pDrawable,wtype) (\ diff --git a/mfb/mfbpntwin.c b/mfb/mfbpntwin.c deleted file mode 100644 index 725d6beb8..000000000 --- a/mfb/mfbpntwin.c +++ /dev/null @@ -1,127 +0,0 @@ -/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "windowstr.h" -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "privates.h" - -#include "mfb.h" -#include "maskbits.h" -#include "mi.h" - -void -mfbPaintWindow(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; -{ - register mfbPrivWin *pPrivWin; - - pPrivWin = (mfbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - mfbGetWindowPrivateKey()); - switch (what) { - case PW_BACKGROUND: - switch (pWin->backgroundState) { - case None: - return; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - return; - case BackgroundPixmap: - if (pPrivWin->fastBackground) - { - mfbTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pPrivWin->pRotatedBackground); - return; - } - break; - case BackgroundPixel: - if (pWin->background.pixel & 1) - mfbSolidWhiteArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXset, NullPixmap); - else - mfbSolidBlackArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXclear, NullPixmap); - return; - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - if (pWin->border.pixel & 1) - mfbSolidWhiteArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXset, NullPixmap); - else - mfbSolidBlackArea((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXclear, NullPixmap); - return; - } - else if (pPrivWin->fastBorder) - { - mfbTileAreaPPWCopy((DrawablePtr)pWin, REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), GXcopy, - pPrivWin->pRotatedBorder); - return; - } - break; - } - miPaintWindow(pWin, pRegion, what); -} diff --git a/mfb/mfbscrinit.c b/mfb/mfbscrinit.c index 515e9e3ce..8873a1ba1 100644 --- a/mfb/mfbscrinit.c +++ b/mfb/mfbscrinit.c @@ -71,8 +71,6 @@ SOFTWARE. static DevPrivateKey frameWindowPrivateKey = &frameWindowPrivateKey; DevPrivateKey frameGetWindowPrivateKey(void) { return frameWindowPrivateKey; } #endif -static DevPrivateKey mfbWindowPrivateKey = &mfbWindowPrivateKey; -DevPrivateKey mfbGetWindowPrivateKey(void) { return mfbWindowPrivateKey; } static DevPrivateKey mfbGCPrivateKey = &mfbGCPrivateKey; DevPrivateKey mfbGetGCPrivateKey(void) { return mfbGCPrivateKey; } static unsigned long mfbGeneration = 0; @@ -90,8 +88,7 @@ static DepthRec depth = { }; Bool -mfbAllocatePrivates(ScreenPtr pScreen, - DevPrivateKey *pWinIndex, DevPrivateKey *pGCIndex) +mfbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCKey) { if (mfbGeneration != serverGeneration) { @@ -99,14 +96,11 @@ mfbAllocatePrivates(ScreenPtr pScreen, VID = visual.vid; mfbGeneration = serverGeneration; } - if (pWinIndex) - *pWinIndex = mfbWindowPrivateKey; - if (pGCIndex) - *pGCIndex = mfbGCPrivateKey; + if (pGCKey) + *pGCKey = mfbGCPrivateKey; pScreen->GetWindowPixmap = mfbGetWindowPixmap; pScreen->SetWindowPixmap = mfbSetWindowPixmap; - return (dixRequestPrivate(mfbWindowPrivateKey, sizeof(mfbPrivWin)) && - dixRequestPrivate(mfbGCPrivateKey, sizeof(mfbPrivGC))); + return dixRequestPrivate(mfbGCPrivateKey, sizeof(mfbPrivGC)); } @@ -119,7 +113,7 @@ mfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) int dpix, dpiy; /* dots per inch */ int width; /* pixel width of frame buffer */ { - if (!mfbAllocatePrivates(pScreen, NULL, NULL)) + if (!mfbAllocatePrivates(pScreen, NULL)) return FALSE; pScreen->defColormap = (Colormap) FakeClientID(0); /* whitePixel, blackPixel */ @@ -128,13 +122,9 @@ mfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) pScreen->GetImage = mfbGetImage; pScreen->GetSpans = mfbGetSpans; pScreen->CreateWindow = mfbCreateWindow; - pScreen->DestroyWindow = mfbDestroyWindow; pScreen->PositionWindow = mfbPositionWindow; - pScreen->ChangeWindowAttributes = mfbChangeWindowAttributes; pScreen->RealizeWindow = mfbMapWindow; pScreen->UnrealizeWindow = mfbUnmapWindow; - pScreen->PaintWindowBackground = mfbPaintWindow; - pScreen->PaintWindowBorder = mfbPaintWindow; pScreen->CopyWindow = mfbCopyWindow; pScreen->CreatePixmap = mfbCreatePixmap; pScreen->DestroyPixmap = mfbDestroyPixmap; diff --git a/mfb/mfbwindow.c b/mfb/mfbwindow.c index c522b07a3..e0bff8bea 100644 --- a/mfb/mfbwindow.c +++ b/mfb/mfbwindow.c @@ -65,32 +65,14 @@ Bool mfbCreateWindow(pWin) register WindowPtr pWin; { - register mfbPrivWin *pPrivWin; - - pPrivWin = (mfbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - mfbGetWindowPrivateKey()); - pPrivWin->pRotatedBorder = NullPixmap; - pPrivWin->pRotatedBackground = NullPixmap; - pPrivWin->fastBackground = FALSE; - pPrivWin->fastBorder = FALSE; - return (TRUE); } /* This always returns true, because Xfree can't fail. It might be possible * on some devices for Destroy to fail */ Bool -mfbDestroyWindow(pWin) - WindowPtr pWin; +mfbDestroyWindow(WindowPtr pWin) { - register mfbPrivWin *pPrivWin; - - pPrivWin = (mfbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - mfbGetWindowPrivateKey()); - if (pPrivWin->pRotatedBorder) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBorder); - if (pPrivWin->pRotatedBackground) - (*pWin->drawable.pScreen->DestroyPixmap)(pPrivWin->pRotatedBackground); return (TRUE); } @@ -115,36 +97,6 @@ mfbPositionWindow(pWin, x, y) register WindowPtr pWin; int x, y; { - register mfbPrivWin *pPrivWin; - int reset = 0; - - pPrivWin = (mfbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - mfbGetWindowPrivateKey()); - if (pWin->backgroundState == BackgroundPixmap && pPrivWin->fastBackground) - { - mfbXRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBackground, - pWin->drawable.y - pPrivWin->oldRotate.y); - reset = 1; - } - - if (!pWin->borderIsPixel && pPrivWin->fastBorder) - { - while (pWin->backgroundState == ParentRelative) - pWin = pWin->parent; - mfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - reset = 1; - } - if (reset) - { - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - /* This is the "wrong" fix to the right problem, but it doesn't really * cost very much. When the window is moved, we need to invalidate any * RotatedPixmap that exists in any GC currently validated against this @@ -214,132 +166,3 @@ mfbCopyWindow(pWin, ptOldOrg, prgnSrc) DEALLOCATE_LOCAL(pptSrc); REGION_DESTROY(pWin->drawable.pScreen, prgnDst); } - - - -/* swap in correct PaintWindow* routine. If we can use a fast output -routine (i.e. the pixmap is paddable to 32 bits), also pre-rotate a copy -of it in devPrivate. -*/ -Bool -mfbChangeWindowAttributes(pWin, mask) - register WindowPtr pWin; - register unsigned long mask; -{ - register unsigned long index; - register mfbPrivWin *pPrivWin; - WindowPtr pBgWin; - - pPrivWin = (mfbPrivWin *)dixLookupPrivate(&pWin->devPrivates, - mfbGetWindowPrivateKey()); - /* - * When background state changes from ParentRelative and - * we had previously rotated the fast border pixmap to match - * the parent relative origin, rerotate to match window - */ - if (mask & (CWBackPixmap | CWBackPixel) && - pWin->backgroundState != ParentRelative && - pPrivWin->fastBorder && - (pPrivWin->oldRotate.x != pWin->drawable.x || - pPrivWin->oldRotate.y != pWin->drawable.y)) - { - mfbXRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBorder, - pWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - while(mask) - { - index = lowbit (mask); - mask &= ~index; - switch(index) - { - case CWBackPixmap: - if (pWin->backgroundState == None) - { - pPrivWin->fastBackground = FALSE; - } - else if (pWin->backgroundState == ParentRelative) - { - pPrivWin->fastBackground = FALSE; - /* Rotate border to match parent origin */ - if (pPrivWin->pRotatedBorder) { - for (pBgWin = pWin->parent; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - mfbXRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.x - pPrivWin->oldRotate.x); - mfbYRotatePixmap(pPrivWin->pRotatedBorder, - pBgWin->drawable.y - pPrivWin->oldRotate.y); - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - } - else if ((pWin->background.pixmap->drawable.width <= PPW) && - !(pWin->background.pixmap->drawable.width & - (pWin->background.pixmap->drawable.width - 1))) - { - mfbCopyRotatePixmap(pWin->background.pixmap, - &pPrivWin->pRotatedBackground, - pWin->drawable.x, - pWin->drawable.y); - if (pPrivWin->pRotatedBackground) - { - pPrivWin->fastBackground = TRUE; - pPrivWin->oldRotate.x = pWin->drawable.x; - pPrivWin->oldRotate.y = pWin->drawable.y; - } - else - { - pPrivWin->fastBackground = FALSE; - } - } - else - { - pPrivWin->fastBackground = FALSE; - } - break; - - case CWBackPixel: - pPrivWin->fastBackground = FALSE; - break; - - case CWBorderPixmap: - if ((pWin->border.pixmap->drawable.width <= PPW) && - !(pWin->border.pixmap->drawable.width & - (pWin->border.pixmap->drawable.width - 1))) - { - for (pBgWin = pWin; - pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - mfbCopyRotatePixmap(pWin->border.pixmap, - &pPrivWin->pRotatedBorder, - pBgWin->drawable.x, - pBgWin->drawable.y); - if (pPrivWin->pRotatedBorder) - { - pPrivWin->fastBorder = TRUE; - pPrivWin->oldRotate.x = pBgWin->drawable.x; - pPrivWin->oldRotate.y = pBgWin->drawable.y; - } - else - { - pPrivWin->fastBorder = FALSE; - } - } - else - { - pPrivWin->fastBorder = FALSE; - } - break; - case CWBorderPixel: - pPrivWin->fastBorder = FALSE; - break; - } - } - /* Again, we have no failure modes indicated by any of the routines - * we've called, so we have to assume it worked */ - return (TRUE); -} diff --git a/mi/mibank.c b/mi/mibank.c index b52399cfe..05813e561 100644 --- a/mi/mibank.c +++ b/mi/mibank.c @@ -121,8 +121,6 @@ typedef struct _miBankScreen GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; CreateGCProcPtr CreateGC; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; } miBankScreenRec, *miBankScreenPtr; @@ -1712,8 +1710,6 @@ miBankCloseScreen( SCREEN_UNWRAP(GetImage); SCREEN_UNWRAP(GetSpans); SCREEN_UNWRAP(CreateGC); - SCREEN_UNWRAP(PaintWindowBackground); - SCREEN_UNWRAP(PaintWindowBorder); SCREEN_UNWRAP(CopyWindow); Xfree(pScreenPriv); @@ -1877,71 +1873,6 @@ miBankCreateGC( return ret; } -static void -miBankPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what -) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - RegionRec tmpReg; - int i; - PaintWindowProcPtr PaintWindow; - - SCREEN_INIT; - SCREEN_SAVE; - - if (what == PW_BORDER) - { - SCREEN_UNWRAP(PaintWindowBorder); - PaintWindow = pScreen->PaintWindowBorder; - } - else - { - SCREEN_UNWRAP(PaintWindowBackground); - PaintWindow = pScreen->PaintWindowBackground; - } - - if (!IS_BANKED(pWin)) - { - (*PaintWindow)(pWin, pRegion, what); - } - else - { - REGION_NULL(pScreen, &tmpReg); - - for (i = 0; i < pScreenPriv->nBanks; i++) - { - if (!pScreenPriv->pBanks[i]) - continue; - - REGION_INTERSECT(pScreen, &tmpReg, pRegion, - pScreenPriv->pBanks[i]); - - if (REGION_NIL(&tmpReg)) - continue; - - SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i); - - (*PaintWindow)(pWin, &tmpReg, what); - } - - REGION_UNINIT(pScreen, &tmpReg); - } - - if (what == PW_BORDER) - { - SCREEN_WRAP(PaintWindowBorder, miBankPaintWindow); - } - else - { - SCREEN_WRAP(PaintWindowBackground, miBankPaintWindow); - } - - SCREEN_RESTORE; -} - static void miBankCopyWindow( WindowPtr pWindow, @@ -2263,8 +2194,6 @@ miInitializeBanking( SCREEN_WRAP(GetImage, miBankGetImage); SCREEN_WRAP(GetSpans, miBankGetSpans); SCREEN_WRAP(CreateGC, miBankCreateGC); - SCREEN_WRAP(PaintWindowBackground, miBankPaintWindow); - SCREEN_WRAP(PaintWindowBorder, miBankPaintWindow); SCREEN_WRAP(CopyWindow, miBankCopyWindow); dixSetPrivate(&pScreen->devPrivates, miBankScreenKey, pScreenPriv); diff --git a/mi/miexpose.c b/mi/miexpose.c index 352a160c6..6ace9f589 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -307,8 +307,7 @@ miHandleExposures(pSrcDrawable, pDstDrawable, /* PaintWindowBackground doesn't clip, so we have to */ REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, &pWin->clipList); } - (*pWin->drawable.pScreen->PaintWindowBackground)( - (WindowPtr)pDstDrawable, &rgnExposed, PW_BACKGROUND); + miPaintWindow((WindowPtr)pDstDrawable, &rgnExposed, PW_BACKGROUND); if (extents) { @@ -517,7 +516,7 @@ miWindowExposures(pWin, prgn, other_exposed) REGION_INTERSECT( pWin->drawable.pScreen, prgn, prgn, &pWin->clipList); } if (prgn && !REGION_NIL(prgn)) - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, PW_BACKGROUND); + miPaintWindow(pWin, prgn, PW_BACKGROUND); if (clientInterested && exposures && !REGION_NIL(exposures)) miSendExposures(pWin, exposures, pWin->drawable.x, pWin->drawable.y); @@ -534,126 +533,91 @@ miWindowExposures(pWin, prgn, other_exposed) REGION_DESTROY( pWin->drawable.pScreen, exposures); } - -/* - this code is highly unlikely. it is not haile selassie. - - there is some hair here. we can't just use the window's -clip region as it is, because if we are painting the border, -the border is not in the client area and so we will be excluded -when we validate the GC, and if we are painting a parent-relative -background, the area we want to paint is in some other window. -since we trust the code calling us to tell us to paint only areas -that are really ours, we will temporarily give the window a -clipList the size of the whole screen and an origin at (0,0). -this more or less assumes that ddX code will do translation -based on the window's absolute position, and that ValidateGC will -look at clipList, and that no other fields from the -window will be used. it's not possible to just draw -in the root because it may be a different depth. - -to get the tile to align correctly we set the GC's tile origin to -be the (x,y) of the window's upper left corner, after which we -get the right bits when drawing into the root. - -because the clip_mask is being set to None, we may call DoChangeGC with -fPointer set true, thus we no longer need to install the background or -border tile in the resource table. -*/ - -static RESTYPE ResType = 0; -static int numGCs = 0; -static GCPtr screenContext[MAXSCREENS]; - -/*ARGSUSED*/ -static int -tossGC ( - pointer value, - XID id) -{ - GCPtr pGC = (GCPtr)value; - screenContext[pGC->pScreen->myNum] = (GCPtr)NULL; - FreeGC (pGC, id); - numGCs--; - if (!numGCs) - ResType = 0; - - return 0; -} - - _X_EXPORT void -miPaintWindow(pWin, prgn, what) -WindowPtr pWin; -RegionPtr prgn; -int what; +miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) { - int status; - - Bool usingScratchGC = FALSE; - WindowPtr pRoot; - -#define FUNCTION 0 -#define FOREGROUND 1 -#define TILE 2 -#define FILLSTYLE 3 -#define ABSX 4 -#define ABSY 5 -#define CLIPMASK 6 -#define SUBWINDOW 7 -#define COUNT_BITS 8 - - ChangeGCVal gcval[7]; - ChangeGCVal newValues [COUNT_BITS]; - - BITS32 gcmask, index, mask; - RegionRec prgnWin; - DDXPointRec oldCorner; - BoxRec box; - WindowPtr pBgWin; - GCPtr pGC; - int i; - BoxPtr pbox; - ScreenPtr pScreen = pWin->drawable.pScreen; - xRectangle *prect; - int numRects; - - gcmask = 0; + ScreenPtr pScreen = pWin->drawable.pScreen; + ChangeGCVal gcval[5]; + BITS32 gcmask; + GCPtr pGC; + int i; + BoxPtr pbox; + xRectangle *prect; + int numRects; + /* + * Distance from screen to destination drawable, use this + * to adjust rendering coordinates which come in in screen space + */ + int draw_x_off, draw_y_off; + /* + * Tile offset for drawing; these need to align the tile + * to the appropriate window origin + */ + int tile_x_off, tile_y_off; + PixUnion fill; + Bool solid = TRUE; + DrawablePtr drawable = &pWin->drawable; if (what == PW_BACKGROUND) { + while (pWin->backgroundState == ParentRelative) + pWin = pWin->parent; + + draw_x_off = drawable->x; + draw_y_off = drawable->y; + + tile_x_off = 0; + tile_y_off = 0; + fill = pWin->background; switch (pWin->backgroundState) { case None: return; - case ParentRelative: - (*pWin->parent->drawable.pScreen->PaintWindowBackground)(pWin->parent, prgn, what); - return; - case BackgroundPixel: - newValues[FOREGROUND].val = pWin->background.pixel; - newValues[FILLSTYLE].val = FillSolid; - gcmask |= GCForeground | GCFillStyle; - break; case BackgroundPixmap: - newValues[TILE].ptr = (pointer)pWin->background.pixmap; - newValues[FILLSTYLE].val = FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; + solid = FALSE; break; } } else { - if (pWin->borderIsPixel) - { - newValues[FOREGROUND].val = pWin->border.pixel; - newValues[FILLSTYLE].val = FillSolid; - gcmask |= GCForeground | GCFillStyle; - } - else - { - newValues[TILE].ptr = (pointer)pWin->border.pixmap; - newValues[FILLSTYLE].val = FillTiled; - gcmask |= GCTile | GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin; - } + PixmapPtr pixmap; + + tile_x_off = drawable->x; + tile_y_off = drawable->y; + + /* servers without pixmaps draw their own borders */ + if (!pScreen->GetWindowPixmap) + return; + pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable); + drawable = &pixmap->drawable; +#ifdef COMPOSITE + draw_x_off = pixmap->screen_x; + draw_y_off = pixmap->screen_y; + tile_x_off -= draw_x_off; + tile_y_off -= draw_y_off; +#else + draw_x_off = 0; + draw_y_off = 0; +#endif + fill = pWin->border; + solid = pWin->borderIsPixel; + } + + gcval[0].val = GXcopy; + gcmask = GCFunction; + + if (solid) + { + gcval[1].val = fill.pixel; + gcval[2].val = FillSolid; + gcmask |= GCForeground | GCFillStyle; + } + else + { + gcval[1].val = FillTiled; + gcval[2].ptr = (pointer)fill.pixmap; + gcval[3].val = tile_x_off; + gcval[4].val = tile_y_off; + gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; } prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) * @@ -661,169 +625,30 @@ int what; if (!prect) return; - newValues[FUNCTION].val = GXcopy; - gcmask |= GCFunction | GCClipMask; - - i = pScreen->myNum; - pRoot = WindowTable[i]; - - pBgWin = pWin; - if (what == PW_BORDER) + pGC = GetScratchGC(drawable->depth, drawable->pScreen); + if (!pGC) { - while (pBgWin->backgroundState == ParentRelative) - pBgWin = pBgWin->parent; - } - - if ((pWin->drawable.depth != pRoot->drawable.depth) || - (pWin->drawable.bitsPerPixel != pRoot->drawable.bitsPerPixel)) - { - usingScratchGC = TRUE; - pGC = GetScratchGC(pWin->drawable.depth, pWin->drawable.pScreen); - if (!pGC) - { - DEALLOCATE_LOCAL(prect); - return; - } - /* - * mash the clip list so we can paint the border by - * mangling the window in place, pretending it - * spans the entire screen - */ - if (what == PW_BORDER) - { - prgnWin = pWin->clipList; - oldCorner.x = pWin->drawable.x; - oldCorner.y = pWin->drawable.y; - pWin->drawable.x = pWin->drawable.y = 0; - box.x1 = 0; - box.y1 = 0; - box.x2 = pScreen->width; - box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - newValues[ABSX].val = pBgWin->drawable.x; - newValues[ABSY].val = pBgWin->drawable.y; - } - else - { - newValues[ABSX].val = 0; - newValues[ABSY].val = 0; - } - } else { - /* - * draw the background to the root window - */ - if (screenContext[i] == (GCPtr)NULL) - { - if (!ResType && !(ResType = CreateNewResourceType(tossGC))) - return; - screenContext[i] = CreateGC((DrawablePtr)pWin, (BITS32) 0, - (XID *)NULL, &status, 0, serverClient); - if (!screenContext[i]) - return; - numGCs++; - if (!AddResource(FakeClientID(0), ResType, - (pointer)screenContext[i])) - return; - } - pGC = screenContext[i]; - newValues[SUBWINDOW].val = IncludeInferiors; - newValues[ABSX].val = pBgWin->drawable.x; - newValues[ABSY].val = pBgWin->drawable.y; - gcmask |= GCSubwindowMode; - pWin = pRoot; + DEALLOCATE_LOCAL(prect); + return; } - mask = gcmask; - gcmask = 0; - i = 0; - while (mask) { - index = lowbit (mask); - mask &= ~index; - switch (index) { - case GCFunction: - if (pGC->alu != newValues[FUNCTION].val) { - gcmask |= index; - gcval[i++].val = newValues[FUNCTION].val; - } - break; - case GCTileStipXOrigin: - if ( pGC->patOrg.x != newValues[ABSX].val) { - gcmask |= index; - gcval[i++].val = newValues[ABSX].val; - } - break; - case GCTileStipYOrigin: - if ( pGC->patOrg.y != newValues[ABSY].val) { - gcmask |= index; - gcval[i++].val = newValues[ABSY].val; - } - break; - case GCClipMask: - if ( pGC->clientClipType != CT_NONE) { - gcmask |= index; - gcval[i++].val = CT_NONE; - } - break; - case GCSubwindowMode: - if ( pGC->subWindowMode != newValues[SUBWINDOW].val) { - gcmask |= index; - gcval[i++].val = newValues[SUBWINDOW].val; - } - break; - case GCTile: - if (pGC->tileIsPixel || pGC->tile.pixmap != newValues[TILE].ptr) - { - gcmask |= index; - gcval[i++].ptr = newValues[TILE].ptr; - } - break; - case GCFillStyle: - if ( pGC->fillStyle != newValues[FILLSTYLE].val) { - gcmask |= index; - gcval[i++].val = newValues[FILLSTYLE].val; - } - break; - case GCForeground: - if ( pGC->fgPixel != newValues[FOREGROUND].val) { - gcmask |= index; - gcval[i++].val = newValues[FOREGROUND].val; - } - break; - } - } - - if (gcmask) - dixChangeGC(NullClient, pGC, gcmask, NULL, gcval); - - if (pWin->drawable.serialNumber != pGC->serialNumber) - ValidateGC((DrawablePtr)pWin, pGC); + dixChangeGC (NullClient, pGC, gcmask, NULL, gcval); + ValidateGC (drawable, pGC); numRects = REGION_NUM_RECTS(prgn); pbox = REGION_RECTS(prgn); for (i= numRects; --i >= 0; pbox++, prect++) { - prect->x = pbox->x1 - pWin->drawable.x; - prect->y = pbox->y1 - pWin->drawable.y; + prect->x = pbox->x1 - draw_x_off; + prect->y = pbox->y1 - draw_y_off; prect->width = pbox->x2 - pbox->x1; prect->height = pbox->y2 - pbox->y1; } prect -= numRects; - (*pGC->ops->PolyFillRect)((DrawablePtr)pWin, pGC, numRects, prect); + (*pGC->ops->PolyFillRect)(drawable, pGC, numRects, prect); DEALLOCATE_LOCAL(prect); - if (usingScratchGC) - { - if (what == PW_BORDER) - { - REGION_UNINIT(pScreen, &pWin->clipList); - pWin->clipList = prgnWin; - pWin->drawable.x = oldCorner.x; - pWin->drawable.y = oldCorner.y; - pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - FreeScratchGC(pGC); - } + FreeScratchGC(pGC); } diff --git a/mi/mioverlay.c b/mi/mioverlay.c index a1f32ad60..a0adac54d 100644 --- a/mi/mioverlay.c +++ b/mi/mioverlay.c @@ -856,9 +856,10 @@ miOverlayHandleExposures(WindowPtr pWin) while (1) { if((mival = pTree->valdata)) { if(!((*pPriv->InOverlay)(pTree->pWin))) { - if (REGION_NOTEMPTY(pScreen, &mival->borderExposed)) - (*pWin->drawable.pScreen->PaintWindowBorder)( - pTree->pWin, &mival->borderExposed, PW_BORDER); + if (REGION_NOTEMPTY(pScreen, &mival->borderExposed)) { + miPaintWindow(pTree->pWin, &mival->borderExposed, + PW_BORDER); + } REGION_UNINIT(pScreen, &mival->borderExposed); (*WindowExposures)(pTree->pWin,&mival->exposed,NullRegion); @@ -894,10 +895,10 @@ miOverlayHandleExposures(WindowPtr pWin) REGION_RECTS(&val->after.exposed)); } } else { - if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) - (*pChild->drawable.pScreen->PaintWindowBorder)(pChild, - &val->after.borderExposed, - PW_BORDER); + if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) { + miPaintWindow(pChild, &val->after.borderExposed, + PW_BORDER); + } (*WindowExposures)(pChild, &val->after.exposed, NullRegion); } REGION_UNINIT(pScreen, &val->after.borderExposed); @@ -1057,8 +1058,7 @@ miOverlayWindowExposures( REGION_INTERSECT(pScreen, prgn, prgn, &pWin->clipList); } if (prgn && !REGION_NIL(prgn)) - (*pScreen->PaintWindowBackground)( - pWin, prgn, PW_BACKGROUND); + miPaintWindow(pWin, prgn, PW_BACKGROUND); if (clientInterested && exposures && !REGION_NIL(exposures)) miSendExposures(pWin, exposures, pWin->drawable.x, pWin->drawable.y); @@ -1729,7 +1729,7 @@ miOverlayClearToBackground( if (generateExposures) (*pScreen->WindowExposures)(pWin, ®, pBSReg); else if (pWin->backgroundState != None) - (*pScreen->PaintWindowBackground)(pWin, ®, PW_BACKGROUND); + miPaintWindow(pWin, ®, PW_BACKGROUND); REGION_UNINIT(pScreen, ®); if (pBSReg) REGION_DESTROY(pScreen, pBSReg); diff --git a/mi/miscrinit.c b/mi/miscrinit.c index 2dd8cd955..0dc6a437a 100644 --- a/mi/miscrinit.c +++ b/mi/miscrinit.c @@ -251,7 +251,7 @@ miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, pScreen->ValidateTree = miValidateTree; pScreen->PostValidateTree = (PostValidateTreeProcPtr) 0; pScreen->WindowExposures = miWindowExposures; - /* PaintWindowBackground, PaintWindowBorder, CopyWindow */ + /* CopyWindow */ pScreen->ClearToBackground = miClearToBackground; pScreen->ClipNotify = (ClipNotifyProcPtr) 0; pScreen->RestackWindow = (RestackWindowProcPtr) 0; diff --git a/mi/miwindow.c b/mi/miwindow.c index cab67ea07..77cb75009 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -118,7 +118,7 @@ miClearToBackground(pWin, x, y, w, h, generateExposures) if (generateExposures) (*pScreen->WindowExposures)(pWin, ®, pBSReg); else if (pWin->backgroundState != None) - (*pScreen->PaintWindowBackground)(pWin, ®, PW_BACKGROUND); + miPaintWindow(pWin, ®, PW_BACKGROUND); REGION_UNINIT(pScreen, ®); if (pBSReg) REGION_DESTROY(pScreen, pBSReg); @@ -451,9 +451,7 @@ miHandleValidateExposures(pWin) if ( (val = pChild->valdata) ) { if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) - (*pChild->drawable.pScreen->PaintWindowBorder)(pChild, - &val->after.borderExposed, - PW_BORDER); + miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER); REGION_UNINIT(pScreen, &val->after.borderExposed); (*WindowExposures)(pChild, &val->after.exposed, NullRegion); REGION_UNINIT(pScreen, &val->after.exposed); diff --git a/miext/cw/cw.c b/miext/cw/cw.c index df4b121d8..efb046948 100644 --- a/miext/cw/cw.c +++ b/miext/cw/cw.c @@ -379,149 +379,6 @@ cwGetSpans(DrawablePtr pSrc, int wMax, DDXPointPtr ppt, int *pwidth, SCREEN_EPILOGUE(pScreen, GetSpans, cwGetSpans); } -static void -cwFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, unsigned long pixel) -{ - ScreenPtr pScreen = pDrawable->pScreen; - GCPtr pGC; - BoxPtr pBox; - int nbox, i; - ChangeGCVal v[3]; - - pGC = GetScratchGC(pDrawable->depth, pScreen); - v[0].val = GXcopy; - v[1].val = pixel; - v[2].val = FillSolid; - dixChangeGC(NullClient, pGC, (GCFunction | GCForeground | GCFillStyle), - NULL, v); - ValidateGC(pDrawable, pGC); - - pBox = REGION_RECTS(pRegion); - nbox = REGION_NUM_RECTS(pRegion); - - for (i = 0; i < nbox; i++, pBox++) { - xRectangle rect; - rect.x = pBox->x1; - rect.y = pBox->y1; - rect.width = pBox->x2 - pBox->x1; - rect.height = pBox->y2 - pBox->y1; - (*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &rect); - } - - FreeScratchGC(pGC); -} - -static void -cwFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, - int x_off, int y_off) -{ - ScreenPtr pScreen = pDrawable->pScreen; - GCPtr pGC; - BoxPtr pBox; - int nbox, i; - ChangeGCVal v[5]; - - pGC = GetScratchGC(pDrawable->depth, pScreen); - v[0].val = GXcopy; - v[1].val = FillTiled; - v[2].ptr = (pointer) pTile; - v[3].val = x_off; - v[4].val = y_off; - dixChangeGC(NullClient, pGC, (GCFunction | GCFillStyle | GCTile | - GCTileStipXOrigin | GCTileStipYOrigin), NULL, v); - - ValidateGC(pDrawable, pGC); - - pBox = REGION_RECTS(pRegion); - nbox = REGION_NUM_RECTS(pRegion); - - for (i = 0; i < nbox; i++, pBox++) { - xRectangle rect; - rect.x = pBox->x1; - rect.y = pBox->y1; - rect.width = pBox->x2 - pBox->x1; - rect.height = pBox->y2 - pBox->y1; - (*pGC->ops->PolyFillRect)(pDrawable, pGC, 1, &rect); - } - - FreeScratchGC(pGC); -} - -static void -cwPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - SCREEN_PROLOGUE(pScreen, PaintWindowBackground); - - if (!cwDrawableIsRedirWindow((DrawablePtr)pWin)) { - (*pScreen->PaintWindowBackground)(pWin, pRegion, what); - } else { - DrawablePtr pBackingDrawable; - int x_off, y_off, x_screen, y_screen; - - while (pWin->backgroundState == ParentRelative) - pWin = pWin->parent; - - pBackingDrawable = cwGetBackingDrawable((DrawablePtr)pWin, &x_off, - &y_off); - - x_screen = x_off - pWin->drawable.x; - y_screen = y_off - pWin->drawable.y; - - if (pWin && (pWin->backgroundState == BackgroundPixel || - pWin->backgroundState == BackgroundPixmap)) - { - REGION_TRANSLATE(pScreen, pRegion, x_screen, y_screen); - - if (pWin->backgroundState == BackgroundPixel) { - cwFillRegionSolid(pBackingDrawable, pRegion, - pWin->background.pixel); - } else { - cwFillRegionTiled(pBackingDrawable, pRegion, - pWin->background.pixmap, x_off, y_off); - } - - REGION_TRANSLATE(pScreen, pRegion, -x_screen, -y_screen); - } - } - - SCREEN_EPILOGUE(pScreen, PaintWindowBackground, cwPaintWindowBackground); -} - -static void -cwPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - SCREEN_PROLOGUE(pScreen, PaintWindowBorder); - - if (!cwDrawableIsRedirWindow((DrawablePtr)pWin)) { - (*pScreen->PaintWindowBorder)(pWin, pRegion, what); - } else { - DrawablePtr pBackingDrawable; - int x_off, y_off, x_screen, y_screen; - - pBackingDrawable = cwGetBackingDrawable((DrawablePtr)pWin, &x_off, - &y_off); - - x_screen = x_off - pWin->drawable.x; - y_screen = y_off - pWin->drawable.y; - - REGION_TRANSLATE(pScreen, pRegion, x_screen, y_screen); - - if (pWin->borderIsPixel) { - cwFillRegionSolid(pBackingDrawable, pRegion, pWin->border.pixel); - } else { - cwFillRegionTiled(pBackingDrawable, pRegion, pWin->border.pixmap, - x_off, y_off); - } - - REGION_TRANSLATE(pScreen, pRegion, -x_screen, -y_screen); - } - - SCREEN_EPILOGUE(pScreen, PaintWindowBorder, cwPaintWindowBorder); -} static void cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) @@ -633,8 +490,6 @@ miInitializeCompositeWrapper(ScreenPtr pScreen) SCREEN_EPILOGUE(pScreen, GetImage, cwGetImage); SCREEN_EPILOGUE(pScreen, GetSpans, cwGetSpans); SCREEN_EPILOGUE(pScreen, CreateGC, cwCreateGC); - SCREEN_EPILOGUE(pScreen, PaintWindowBackground, cwPaintWindowBackground); - SCREEN_EPILOGUE(pScreen, PaintWindowBorder, cwPaintWindowBorder); SCREEN_EPILOGUE(pScreen, CopyWindow, cwCopyWindow); SCREEN_EPILOGUE(pScreen, SetWindowPixmap, cwSetWindowPixmap); @@ -660,8 +515,6 @@ cwCloseScreen (int i, ScreenPtr pScreen) pScreen->GetImage = pScreenPriv->GetImage; pScreen->GetSpans = pScreenPriv->GetSpans; pScreen->CreateGC = pScreenPriv->CreateGC; - pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground; - pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder; pScreen->CopyWindow = pScreenPriv->CopyWindow; #ifdef RENDER diff --git a/miext/cw/cw.h b/miext/cw/cw.h index 45247d670..47c4ee3b8 100644 --- a/miext/cw/cw.h +++ b/miext/cw/cw.h @@ -85,8 +85,6 @@ typedef struct { GetSpansProcPtr GetSpans; CreateGCProcPtr CreateGC; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; GetWindowPixmapProcPtr GetWindowPixmap; diff --git a/miext/damage/damage.c b/miext/damage/damage.c index b7f6fb550..350819be3 100755 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -1633,35 +1633,6 @@ damageDestroyPixmap (PixmapPtr pPixmap) return TRUE; } -static void -damagePaintWindow(WindowPtr pWindow, - RegionPtr prgn, - int what) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - damageScrPriv(pScreen); - - /* - * Painting background none doesn't actually *do* anything, so - * no damage is recorded - */ - if ((what != PW_BACKGROUND || pWindow->backgroundState != None) && - getWindowDamage (pWindow)) - damageDamageRegion (&pWindow->drawable, prgn, FALSE, -1); - if(what == PW_BACKGROUND) { - unwrap (pScrPriv, pScreen, PaintWindowBackground); - (*pScreen->PaintWindowBackground) (pWindow, prgn, what); - damageReportPostOp (&pWindow->drawable); - wrap (pScrPriv, pScreen, PaintWindowBackground, damagePaintWindow); - } else { - unwrap (pScrPriv, pScreen, PaintWindowBorder); - (*pScreen->PaintWindowBorder) (pWindow, prgn, what); - damageReportPostOp (&pWindow->drawable); - wrap (pScrPriv, pScreen, PaintWindowBorder, damagePaintWindow); - } -} - - static void damageCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, @@ -1762,8 +1733,6 @@ damageCloseScreen (int i, ScreenPtr pScreen) unwrap (pScrPriv, pScreen, DestroyPixmap); unwrap (pScrPriv, pScreen, CreateGC); - unwrap (pScrPriv, pScreen, PaintWindowBackground); - unwrap (pScrPriv, pScreen, PaintWindowBorder); unwrap (pScrPriv, pScreen, CopyWindow); unwrap (pScrPriv, pScreen, CloseScreen); xfree (pScrPriv); @@ -1793,8 +1762,6 @@ DamageSetup (ScreenPtr pScreen) wrap (pScrPriv, pScreen, DestroyPixmap, damageDestroyPixmap); wrap (pScrPriv, pScreen, CreateGC, damageCreateGC); - wrap (pScrPriv, pScreen, PaintWindowBackground, damagePaintWindow); - wrap (pScrPriv, pScreen, PaintWindowBorder, damagePaintWindow); wrap (pScrPriv, pScreen, DestroyWindow, damageDestroyWindow); wrap (pScrPriv, pScreen, SetWindowPixmap, damageSetWindowPixmap); wrap (pScrPriv, pScreen, CopyWindow, damageCopyWindow); @@ -1966,6 +1933,12 @@ DamageRegion (DamagePtr pDamage) return &pDamage->damage; } +_X_EXPORT RegionPtr +DamagePendingRegion (DamagePtr pDamage) +{ + return &pDamage->pendingDamage; +} + _X_EXPORT void DamageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion) diff --git a/miext/damage/damage.h b/miext/damage/damage.h index 4cfc8127d..102da6ebe 100755 --- a/miext/damage/damage.h +++ b/miext/damage/damage.h @@ -75,6 +75,9 @@ DamageEmpty (DamagePtr pDamage); RegionPtr DamageRegion (DamagePtr pDamage); +RegionPtr +DamagePendingRegion (DamagePtr pDamage); + void DamageDamageRegion (DrawablePtr pDrawable, const RegionPtr pRegion); diff --git a/miext/damage/damagestr.h b/miext/damage/damagestr.h index 9f3dd6684..2f6d53844 100755 --- a/miext/damage/damagestr.h +++ b/miext/damage/damagestr.h @@ -61,8 +61,6 @@ typedef struct _damageScrPriv { */ DamagePtr pScreenDamage; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; CloseScreenProcPtr CloseScreen; CreateGCProcPtr CreateGC; diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h index 5ebe35e63..537ffdae4 100644 --- a/miext/rootless/rootlessCommon.h +++ b/miext/rootless/rootlessCommon.h @@ -86,8 +86,6 @@ typedef struct _RootlessScreenRec { ChangeWindowAttributesProcPtr ChangeWindowAttributes; CreateGCProcPtr CreateGC; - PaintWindowBackgroundProcPtr PaintWindowBackground; - PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; GetImageProcPtr GetImage; SourceValidateProcPtr SourceValidate; diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index f647893de..06ba53a4b 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -583,8 +583,6 @@ RootlessWrap(ScreenPtr pScreen) WRAP(CreateScreenResources); WRAP(CloseScreen); WRAP(CreateGC); - WRAP(PaintWindowBackground); - WRAP(PaintWindowBorder); WRAP(CopyWindow); WRAP(GetImage); WRAP(SourceValidate); diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index 687748c2d..512a4949f 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -217,10 +217,8 @@ RootlessSetShape(WindowPtr pWin) /* Disallow ParentRelative background on top-level windows - because the root window doesn't really have the right background - and fb will try to draw on the root instead of on the window. - ParentRelative prevention is also in PaintWindowBackground/Border() - so it is no longer really needed here. */ + because the root window doesn't really have the right background. + */ Bool RootlessChangeWindowAttributes(WindowPtr pWin, unsigned long vmask) { @@ -670,7 +668,7 @@ RootlessResizeCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, /* * RootlessCopyWindow * Update *new* location of window. Old location is redrawn with - * PaintWindowBackground/Border. Cloned from fbCopyWindow. + * miPaintWindow. Cloned from fbCopyWindow. * The original always draws on the root pixmap, which we don't have. * Instead, draw on the parent window's pixmap. */ @@ -1326,96 +1324,6 @@ out: } } - -/* - * SetPixmapOfAncestors - * Set the Pixmaps on all ParentRelative windows up the ancestor chain. - */ -static void -SetPixmapOfAncestors(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - WindowPtr topWin = TopLevelParent(pWin); - RootlessWindowRec *topWinRec = WINREC(topWin); - - while (pWin->backgroundState == ParentRelative) { - if (pWin == topWin) { - // disallow ParentRelative background state on top level - XID pixel = 0; - ChangeWindowAttributes(pWin, CWBackPixel, &pixel, serverClient); - RL_DEBUG_MSG("Cleared ParentRelative on 0x%x.\n", pWin); - break; - } - - pWin = pWin->parent; - pScreen->SetWindowPixmap(pWin, topWinRec->pixmap); - } -} - - -/* - * RootlessPaintWindowBackground - */ -void -RootlessPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - if (IsRoot(pWin)) - return; - - RL_DEBUG_MSG("paintwindowbackground start (win 0x%x, framed %i) ", - pWin, IsFramedWindow(pWin)); - - if (IsFramedWindow(pWin)) { - RootlessStartDrawing(pWin); - RootlessDamageRegion(pWin, pRegion); - - // For ParentRelative windows, we have to make sure the window - // pixmap is set correctly all the way up the ancestor chain. - if (pWin->backgroundState == ParentRelative) { - SetPixmapOfAncestors(pWin); - } - } - - SCREEN_UNWRAP(pScreen, PaintWindowBackground); - pScreen->PaintWindowBackground(pWin, pRegion, what); - SCREEN_WRAP(pScreen, PaintWindowBackground); - - RL_DEBUG_MSG("paintwindowbackground end\n"); -} - - -/* - * RootlessPaintWindowBorder - */ -void -RootlessPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what) -{ - RL_DEBUG_MSG("paintwindowborder start (win 0x%x) ", pWin); - - if (IsFramedWindow(pWin)) { - RootlessStartDrawing(pWin); - RootlessDamageRegion(pWin, pRegion); - - // For ParentRelative windows with tiled borders, we have to make - // sure the window pixmap is set correctly all the way up the - // ancestor chain. - if (!pWin->borderIsPixel && - pWin->backgroundState == ParentRelative) - { - SetPixmapOfAncestors(pWin); - } - } - - SCREEN_UNWRAP(pWin->drawable.pScreen, PaintWindowBorder); - pWin->drawable.pScreen->PaintWindowBorder(pWin, pRegion, what); - SCREEN_WRAP(pWin->drawable.pScreen, PaintWindowBorder); - - RL_DEBUG_MSG("paintwindowborder end\n"); -} - - /* * RootlessChangeBorderWidth * FIXME: untested! diff --git a/miext/rootless/rootlessWindow.h b/miext/rootless/rootlessWindow.h index 093a2b384..9573068b4 100644 --- a/miext/rootless/rootlessWindow.h +++ b/miext/rootless/rootlessWindow.h @@ -54,10 +54,6 @@ void RootlessMoveWindow(WindowPtr pWin,int x,int y,WindowPtr pSib,VTKind kind); void RootlessResizeWindow(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, WindowPtr pSib); void RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent); -void RootlessPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, - int what); -void RootlessPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, - int what); void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width); #endif diff --git a/miext/rootless/safeAlpha/Makefile.am b/miext/rootless/safeAlpha/Makefile.am index 7592c1840..823fb777d 100644 --- a/miext/rootless/safeAlpha/Makefile.am +++ b/miext/rootless/safeAlpha/Makefile.am @@ -6,7 +6,6 @@ INCLUDES = -I$(srcdir)/.. -I$(top_srcdir)/hw/xfree86/os-support noinst_LTLIBRARIES = libsafeAlpha.la -libsafeAlpha_la_SOURCES = safeAlphaPicture.c \ - safeAlphaWindow.c +libsafeAlpha_la_SOURCES = safeAlphaPicture.c EXTRA_DIST = safeAlpha.h diff --git a/miext/rootless/safeAlpha/safeAlpha.h b/miext/rootless/safeAlpha/safeAlpha.h index bd1ce3203..9b9b39c92 100644 --- a/miext/rootless/safeAlpha/safeAlpha.h +++ b/miext/rootless/safeAlpha/safeAlpha.h @@ -32,8 +32,6 @@ #include "picturestr.h" -void SafeAlphaPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what); - #ifdef RENDER void SafeAlphaComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, diff --git a/miext/rootless/safeAlpha/safeAlphaWindow.c b/miext/rootless/safeAlpha/safeAlphaWindow.c deleted file mode 100644 index 5226782fe..000000000 --- a/miext/rootless/safeAlpha/safeAlphaWindow.c +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Specialized window functions to protect the alpha channel - */ -/* - * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name(s) of the above copyright - * holders shall not be used in advertising or otherwise to promote the sale, - * use or other dealings in this Software without prior written authorization. - */ -/* Portions of this file are based on fbwindow.c, which contains the - * following copyright: - * - * Copyright © 1998 Keith Packard - */ - - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif -#include "fb.h" -#include "safeAlpha.h" -#include "rootlessCommon.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -/* - * SafeAlphaFillRegionTiled - * Fill using a tile while leaving the alpha channel untouched. - * Based on fbfillRegionTiled. - */ -void -SafeAlphaFillRegionTiled( - DrawablePtr pDrawable, - RegionPtr pRegion, - PixmapPtr pTile) -{ - FbBits *dst; - FbStride dstStride; - int dstBpp; - int dstXoff, dstYoff; - FbBits *tile; - FbStride tileStride; - int tileBpp; - int tileXoff, tileYoff; /* XXX assumed to be zero */ - int tileWidth, tileHeight; - int n = REGION_NUM_RECTS(pRegion); - BoxPtr pbox = REGION_RECTS(pRegion); - int xRot = pDrawable->x; - int yRot = pDrawable->y; - FbBits planeMask; - -#ifdef PANORAMIX - if(!noPanoramiXExtension) - { - int index = pDrawable->pScreen->myNum; - if(&WindowTable[index]->drawable == pDrawable) - { - xRot -= panoramiXdataPtr[index].x; - yRot -= panoramiXdataPtr[index].y; - } - } -#endif - fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp, - tileXoff, tileYoff); - tileWidth = pTile->drawable.width; - tileHeight = pTile->drawable.height; - xRot += dstXoff; - yRot += dstYoff; - planeMask = FB_ALLONES & ~RootlessAlphaMask(dstBpp); - - while (n--) - { - fbTile (dst + (pbox->y1 + dstYoff) * dstStride, - dstStride, - (pbox->x1 + dstXoff) * dstBpp, - (pbox->x2 - pbox->x1) * dstBpp, - pbox->y2 - pbox->y1, - tile, - tileStride, - tileWidth * dstBpp, - tileHeight, - GXcopy, - planeMask, - dstBpp, - xRot * dstBpp, - yRot - pbox->y1); - pbox++; - } -} - - -/* - * SafeAlphaPaintWindow - * Paint the window while filling in the alpha channel with all on. - * We can't use fbPaintWindow because it zeros the alpha channel. - */ -void -SafeAlphaPaintWindow( - WindowPtr pWin, - RegionPtr pRegion, - int what) -{ - switch (what) { - case PW_BACKGROUND: - - switch (pWin->backgroundState) { - case None: - break; - case ParentRelative: - do { - pWin = pWin->parent; - } while (pWin->backgroundState == ParentRelative); - (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion, - what); - break; - case BackgroundPixmap: - SafeAlphaFillRegionTiled (&pWin->drawable, - pRegion, - pWin->background.pixmap); - break; - case BackgroundPixel: - { - Pixel pixel = pWin->background.pixel | - RootlessAlphaMask(pWin->drawable.bitsPerPixel); - fbFillRegionSolid (&pWin->drawable, pRegion, 0, - fbReplicatePixel (pixel, - pWin->drawable.bitsPerPixel)); - break; - } - } - break; - case PW_BORDER: - if (pWin->borderIsPixel) - { - Pixel pixel = pWin->border.pixel | - RootlessAlphaMask(pWin->drawable.bitsPerPixel); - fbFillRegionSolid (&pWin->drawable, pRegion, 0, - fbReplicatePixel (pixel, - pWin->drawable.bitsPerPixel)); - } - else - { - WindowPtr pBgWin; - for (pBgWin = pWin; pBgWin->backgroundState == ParentRelative; - pBgWin = pBgWin->parent); - - SafeAlphaFillRegionTiled (&pBgWin->drawable, - pRegion, - pWin->border.pixmap); - } - break; - } - fbValidateDrawable (&pWin->drawable); -} diff --git a/os/connection.c b/os/connection.c index afe392c66..3d9d2e919 100644 --- a/os/connection.c +++ b/os/connection.c @@ -74,6 +74,9 @@ SOFTWARE. #define TRANS_SERVER #define TRANS_REOPEN #include +#ifdef HAVE_LAUNCHD +#include +#endif #include #include #include @@ -657,10 +660,21 @@ ClientAuthorized(ClientPtr client, XID auth_id; char *reason = NULL; XtransConnInfo trans_conn; +#ifdef HAVE_LAUNCHD + struct sockaddr *saddr; +#endif priv = (OsCommPtr)client->osPrivate; trans_conn = priv->trans_conn; +#ifdef HAVE_LAUNCHD + saddr = (struct sockaddr *) (trans_conn->addr); + /* Allow any client to connect without authorization on a launchd socket, + because it is securely created -- this prevents a race condition on launch */ + if (saddr->sa_len > 11 && saddr->sa_family == AF_UNIX && + !strncmp(saddr->sa_data, "/tmp/launch", 11)) goto done; +#endif + auth_id = CheckAuthorization (proto_n, auth_proto, string_n, auth_string, client, &reason); @@ -710,6 +724,7 @@ ClientAuthorized(ClientPtr client, } } priv->auth_id = auth_id; + done: priv->conn_time = 0; #ifdef XDMCP diff --git a/os/io.c b/os/io.c index 835af54d9..9de75eeaa 100644 --- a/os/io.c +++ b/os/io.c @@ -304,12 +304,14 @@ ReadRequestFromClient(ClientPtr client) */ oci->lenLastReq = 0; - if (needed > MAXBUFSIZE) +#ifdef BIGREQS + if (needed > maxBigRequestSize << 2) { /* request is too big for us to handle */ YieldControlDeath(); return -1; } +#endif if ((gotnow == 0) || ((oci->bufptr - oci->buffer + needed) > oci->size)) { diff --git a/os/osdep.h b/os/osdep.h index 0c07a9004..b6894c146 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -55,9 +55,6 @@ SOFTWARE. #define BOTIMEOUT 200 /* in milliseconds */ #define BUFSIZE 4096 #define BUFWATERMARK 8192 -#ifndef MAXBUFSIZE -#define MAXBUFSIZE (1 << 22) -#endif #include diff --git a/os/utils.c b/os/utils.c index 3bb7dbeba..144098b37 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1720,6 +1720,8 @@ static struct pid { int pid; } *pidlist; +void (*old_alarm)(int) = NULL; /* XXX horrible awful hack */ + pointer Popen(char *command, char *type) { @@ -1741,11 +1743,15 @@ Popen(char *command, char *type) return NULL; } + /* Ignore the smart scheduler while this is going on */ + old_alarm = signal(SIGALRM, SIG_IGN); + switch (pid = fork()) { case -1: /* error */ close(pdes[0]); close(pdes[1]); xfree(cur); + signal(SIGALRM, old_alarm); return NULL; case 0: /* child */ if (setgid(getgid()) == -1) @@ -1921,6 +1927,8 @@ Pclose(pointer iop) /* allow EINTR again */ OsReleaseSignals (); + signal(SIGALRM, old_alarm); + return pid == -1 ? -1 : pstat; } diff --git a/randr/rroutput.c b/randr/rroutput.c index a67e4931a..c1e971ddc 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -95,6 +95,7 @@ RROutputCreate (ScreenPtr pScreen, output->numUserModes = 0; output->userModes = NULL; output->properties = NULL; + output->pendingProperties = FALSE; output->changed = FALSE; output->devPrivate = devPrivate; diff --git a/randr/rrscreen.c b/randr/rrscreen.c index 8798b4244..811a5571b 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -766,7 +766,6 @@ ProcRRSetScreenConfig (ClientPtr client) pScrPriv = rrGetScrPriv(pScreen); time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); if (!pScrPriv) { @@ -788,11 +787,15 @@ ProcRRSetScreenConfig (ClientPtr client) crtc = output->crtc; /* - * if the client's config timestamp is not the same as the last config + * If the client's config timestamp is not the same as the last config * timestamp, then the config information isn't up-to-date and - * can't even be validated + * can't even be validated. + * + * Note that the client only knows about the milliseconds part of the + * timestamp, so using CompareTimeStamps here would cause randr to suddenly + * stop working after several hours have passed (freedesktop bug #6502). */ - if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) + if (stuff->configTimestamp != pScrPriv->lastConfigTime.milliseconds) { rep.status = RRSetConfigInvalidConfigTime; goto sendReply; diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c index 2a57e4e32..896f61fb5 100644 --- a/randr/rrxinerama.c +++ b/randr/rrxinerama.c @@ -147,12 +147,6 @@ ProcRRXineramaGetState(ClientPtr client) return client->noClientException; } -static Bool -RRXineramaScreenActive (ScreenPtr pScreen) -{ - return rrGetScrPriv(pScreen) != NULL; -} - static Bool RRXineramaCrtcActive (RRCrtcPtr crtc) { @@ -165,7 +159,7 @@ RRXineramaScreenCount (ScreenPtr pScreen) int i, n; n = 0; - if (RRXineramaScreenActive (pScreen)) + if (rrGetScrPriv (pScreen)) { rrScrPriv(pScreen); for (i = 0; i < pScrPriv->numCrtcs; i++) @@ -175,6 +169,12 @@ RRXineramaScreenCount (ScreenPtr pScreen) return n; } +static Bool +RRXineramaScreenActive (ScreenPtr pScreen) +{ + return RRXineramaScreenCount (pScreen) > 0; +} + int ProcRRXineramaGetScreenCount(ClientPtr client) { diff --git a/render/picturestr.h b/render/picturestr.h index fad974168..5444e519c 100644 --- a/render/picturestr.h +++ b/render/picturestr.h @@ -24,8 +24,8 @@ #ifndef _PICTURESTR_H_ #define _PICTURESTR_H_ -#include "glyphstr.h" #include "scrnintstr.h" +#include "glyphstr.h" #include "resource.h" #include "privates.h" diff --git a/xorg-server.pc.in b/xorg-server.pc.in index fba3b15a6..d3ffaa2f8 100644 --- a/xorg-server.pc.in +++ b/xorg-server.pc.in @@ -8,5 +8,6 @@ sdkdir=@sdkdir@ Name: xorg-server Description: Modular X.Org X Server Version: @PACKAGE_VERSION@ -Cflags: -I${sdkdir} @PIXMAN_CFLAGS@ +Requires.private: pixman-1 +Cflags: -I${sdkdir} Libs: -L${libdir}