This patch should be applied to an un-modified XFree86 version 4.5.0 source tree. It is patch 2 of 4 patches that will will convert the source tree to XFree86 version 4.6.0. To apply this patch, run the following from the directory containing your 'xc' directory: patch -p0 -E < XFree86-4.5.0-4.6.0.diff1 patch -p0 -E < XFree86-4.5.0-4.6.0.diff2 patch -p0 -E < XFree86-4.5.0-4.6.0.diff3 patch -p0 -E < XFree86-4.5.0-4.6.0.diff4 sh XFree86-4.5.0-4.6.0-cleanup.sh gzip -d < XFree86-4.5.0-4.6.0-diff0.tgz | tar vxf - ------------------------------------------------------------------------------- Index: xc/programs/Xserver/cfb/cfbrrop.c diff -u xc/programs/Xserver/cfb/cfbrrop.c:1.6 xc/programs/Xserver/cfb/cfbrrop.c:1.8 --- xc/programs/Xserver/cfb/cfbrrop.c:1.6 Fri Dec 14 14:59:24 2001 +++ xc/programs/Xserver/cfb/cfbrrop.c Fri Oct 14 11:16:19 2005 @@ -1,5 +1,5 @@ +/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.c,v 1.8 2005/10/14 15:16:19 tsi Exp $ */ /* - * $Xorg: cfbrrop.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ * Copyright 1989, 1998 The Open Group @@ -25,13 +25,12 @@ * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.c,v 1.6 2001/12/14 19:59:24 dawes Exp $ */ /* cfb reduced rasterop computations */ -#include "X.h" -#include "Xmd.h" -#include "Xproto.h" +#include +#include +#include #include "cfb.h" #include "cfbmskbits.h" @@ -122,10 +121,7 @@ */ int -cfbReduceRasterOp (rop, fg, pm, andp, xorp) - int rop; - CfbBits fg, pm; - CfbBits *andp, *xorp; +cfbReduceRasterOp(int rop, CfbBits fg, CfbBits pm, CfbBits *andp, CfbBits *xorp) { CfbBits and, xor; int rrop; Index: xc/programs/Xserver/cfb/cfbrrop.h diff -u xc/programs/Xserver/cfb/cfbrrop.h:3.11 xc/programs/Xserver/cfb/cfbrrop.h:3.13 --- xc/programs/Xserver/cfb/cfbrrop.h:3.11 Wed Oct 29 17:44:53 2003 +++ xc/programs/Xserver/cfb/cfbrrop.h Fri Oct 14 11:16:19 2005 @@ -1,5 +1,4 @@ /* - * $Xorg: cfbrrop.h,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ * Copyright 1989, 1998 The Open Group @@ -26,10 +25,10 @@ * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.h,v 3.11 2003/10/29 22:44:53 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.h,v 3.13 2005/10/14 15:16:19 tsi Exp $ */ #ifndef GXcopy -#include "X.h" +#include #endif #define RROP_FETCH_GC(gc) \ @@ -41,7 +40,7 @@ #if RROP == GXcopy #if PSZ == 24 -#define RROP_DECLARE register CfbBits rrop_xor; \ +#define RROP_DECLARE CfbBits rrop_xor; \ CfbBits piQxelXor[3], spiQxelXor[8]; #define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; \ spiQxelXor[0] = rrop_xor & 0xFFFFFF; \ @@ -55,7 +54,7 @@ piQxelXor[1] = (rrop_xor << 16)|((rrop_xor & 0xFFFF00)>> 8); \ piQxelXor[2] = (rrop_xor << 8)|((rrop_xor & 0xFF0000)>> 16); #define RROP_SOLID24(dst,index) {\ - register int idx = ((index) & 3)<< 1; \ + int idx = ((index) & 3)<< 1; \ *(dst) = (*(dst) & cfbrmask[idx])|spiQxelXor[idx]; \ if (idx == 2 || idx == 4){ \ idx++; \ @@ -69,7 +68,7 @@ #define RROP_UNDECLARE (void)piQxelXor; (void)spiQxelXor; #else #define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; -#define RROP_DECLARE register CfbBits rrop_xor; +#define RROP_DECLARE CfbBits rrop_xor; #define RROP_SOLID(dst) (*(dst) = (rrop_xor)) #define RROP_SOLID_MASK(dst,mask) (*(dst) = (*(dst) & ~(mask)) | ((rrop_xor) & (mask))) #define RROP_UNDECLARE @@ -79,7 +78,7 @@ #if RROP == GXxor #if PSZ == 24 -#define RROP_DECLARE register CfbBits rrop_xor; \ +#define RROP_DECLARE CfbBits rrop_xor; \ CfbBits piQxelXor[3], spiQxelXor[8]; #define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; \ spiQxelXor[0] = rrop_xor & 0xFFFFFF; \ @@ -93,7 +92,7 @@ piQxelXor[1] = (rrop_xor << 16)|((rrop_xor & 0xFFFF00)>> 8); \ piQxelXor[2] = (rrop_xor << 8)|((rrop_xor & 0xFF0000)>> 16); #define RROP_SOLID24(dst,index) {\ - register int idx = ((index) & 3)<< 1; \ + int idx = ((index) & 3)<< 1; \ *(dst) ^= spiQxelXor[idx]; \ if (idx == 2 || idx == 4) \ *((dst)+1) ^= spiQxelXor[idx+1]; \ @@ -104,7 +103,7 @@ (*(dst) ^= (piQxelXor[(idx)] & (mask))) #define RROP_UNDECLARE (void)piQxelXor; (void)spiQxelXor; #else -#define RROP_DECLARE register CfbBits rrop_xor; +#define RROP_DECLARE CfbBits rrop_xor; #define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; #define RROP_SOLID(dst) (*(dst) ^= (rrop_xor)) #define RROP_SOLID_MASK(dst,mask) (*(dst) ^= ((rrop_xor) & (mask))) @@ -115,7 +114,7 @@ #if RROP == GXand #if PSZ == 24 -#define RROP_DECLARE register CfbBits rrop_and; \ +#define RROP_DECLARE CfbBits rrop_and; \ CfbBits piQxelAnd[3], spiQxelAnd[6]; #define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; \ spiQxelAnd[0] = (rrop_and & 0xFFFFFF) | 0xFF000000; \ @@ -151,7 +150,7 @@ (*(dst) &= (piQxelAnd[(idx)] | ~(mask))) #define RROP_UNDECLARE (void)piQxelAnd; (void)spiQxelAnd; #else -#define RROP_DECLARE register CfbBits rrop_and; +#define RROP_DECLARE CfbBits rrop_and; #define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; #define RROP_SOLID(dst) (*(dst) &= (rrop_and)) #define RROP_SOLID_MASK(dst,mask) (*(dst) &= ((rrop_and) | ~(mask))) @@ -162,7 +161,7 @@ #if RROP == GXor #if PSZ == 24 -#define RROP_DECLARE register CfbBits rrop_or; \ +#define RROP_DECLARE CfbBits rrop_or; \ CfbBits piQxelOr[3], spiQxelOr[6]; #define RROP_FETCH_GCPRIV(devPriv) rrop_or = (devPriv)->xor; \ spiQxelOr[0] = rrop_or & 0xFFFFFF; \ @@ -198,7 +197,7 @@ (*(dst) |= (piQxelOr[(idx)] & (mask))) #define RROP_UNDECLARE (void)piQxelOr; (void)spiQxelOr; #else -#define RROP_DECLARE register CfbBits rrop_or; +#define RROP_DECLARE CfbBits rrop_or; #define RROP_FETCH_GCPRIV(devPriv) rrop_or = (devPriv)->xor; #define RROP_SOLID(dst) (*(dst) |= (rrop_or)) #define RROP_SOLID_MASK(dst,mask) (*(dst) |= ((rrop_or) & (mask))) @@ -218,7 +217,7 @@ #if RROP == GXset #if PSZ == 24 -#define RROP_DECLARE register CfbBits rrop_and, rrop_xor; \ +#define RROP_DECLARE CfbBits rrop_and, rrop_xor; \ CfbBits piQxelAnd[3], piQxelXor[3], spiQxelAnd[6], spiQxelXor[6]; #define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; \ rrop_xor = (devPriv)->xor; \ @@ -265,7 +264,7 @@ #define RROP_UNDECLARE (void)piQxelAnd; (void)piQxelXor; \ (void)spiQxelAnd; (void)spiQxelXor; #else -#define RROP_DECLARE register CfbBits rrop_and, rrop_xor; +#define RROP_DECLARE CfbBits rrop_and, rrop_xor; #define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; \ rrop_xor = (devPriv)->xor; #define RROP_SOLID(dst) (*(dst) = DoRRop (*(dst), rrop_and, rrop_xor)) Index: xc/programs/Xserver/cfb/cfbscrinit.c diff -u xc/programs/Xserver/cfb/cfbscrinit.c:1.20 xc/programs/Xserver/cfb/cfbscrinit.c:1.22 --- xc/programs/Xserver/cfb/cfbscrinit.c:1.20 Tue Jul 15 21:38:37 2003 +++ xc/programs/Xserver/cfb/cfbscrinit.c Fri Oct 14 11:16:19 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbscrinit.c,v 1.20 2003/07/16 01:38:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbscrinit.c,v 1.22 2005/10/14 15:16:19 tsi Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -27,10 +27,9 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $Xorg: cfbscrinit.c,v 1.3 2000/08/17 19:48:15 cpqbld Exp $ */ -#include "X.h" -#include "Xmd.h" +#include +#include #include "servermd.h" #include "scrnintstr.h" #include "pixmapstr.h" @@ -53,9 +52,7 @@ }; Bool -cfbCloseScreen (index, pScreen) - int index; - ScreenPtr pScreen; +cfbCloseScreen(int index, ScreenPtr pScreen) { int d; DepthPtr depths = pScreen->allowedDepths; @@ -72,27 +69,21 @@ return TRUE; } -static void DestroyColormapNoop( - ColormapPtr pColormap) +static void +DestroyColormapNoop(ColormapPtr pColormap) { /* NOOP */ } -static void StoreColorsNoop( - ColormapPtr pColormap, - int ndef, - xColorItem * pdef) +static void +StoreColorsNoop(ColormapPtr pColormap, int ndef, xColorItem *pdef) { /* NOOP */ } Bool -cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width) - register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bitmap */ - int xsize, ysize; /* in pixels */ - int dpix, dpiy; /* dots per inch */ - int width; /* pixel width of frame buffer */ +cfbSetupScreen(ScreenPtr pScreen, pointer pbits, int xsize, int ysize, + int dpix, int dpiy, int width) { if (!cfbAllocatePrivates(pScreen, (int *) 0, (int *) 0)) return FALSE; @@ -132,8 +123,7 @@ #ifdef CFB_NEED_SCREEN_PRIVATE Bool -cfbCreateScreenResources(pScreen) - ScreenPtr pScreen; +cfbCreateScreenResources(ScreenPtr pScreen) { Bool retval; @@ -147,12 +137,8 @@ #endif Bool -cfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) - register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bitmap */ - int xsize, ysize; /* in pixels */ - int dpix, dpiy; /* dots per inch */ - int width; /* pixel width of frame buffer */ +cfbFinishScreenInit(ScreenPtr pScreen, pointer pbits, int xsize, int ysize, + int dpix, int dpiy, int width) { #ifdef CFB_NEED_SCREEN_PRIVATE pointer oldDevPrivate; @@ -190,12 +176,8 @@ /* dts * (inch/dot) * (25.4 mm / inch) = mm */ Bool -cfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) - register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bitmap */ - int xsize, ysize; /* in pixels */ - int dpix, dpiy; /* dots per inch */ - int width; /* pixel width of frame buffer */ +cfbScreenInit(ScreenPtr pScreen, pointer pbits, int xsize, int ysize, + int dpix, int dpiy, int width) { if (!cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width)) return FALSE; @@ -203,8 +185,7 @@ } PixmapPtr -cfbGetScreenPixmap(pScreen) - ScreenPtr pScreen; +cfbGetScreenPixmap(ScreenPtr pScreen) { #ifdef CFB_NEED_SCREEN_PRIVATE return (PixmapPtr)pScreen->devPrivates[cfbScreenPrivateIndex].ptr; @@ -214,8 +195,7 @@ } void -cfbSetScreenPixmap(pPix) - PixmapPtr pPix; +cfbSetScreenPixmap(PixmapPtr pPix) { #ifdef CFB_NEED_SCREEN_PRIVATE if (pPix) Index: xc/programs/Xserver/cfb/cfbsetsp.c diff -u xc/programs/Xserver/cfb/cfbsetsp.c:3.6 xc/programs/Xserver/cfb/cfbsetsp.c:3.8 --- xc/programs/Xserver/cfb/cfbsetsp.c:3.6 Wed Oct 29 17:44:53 2003 +++ xc/programs/Xserver/cfb/cfbsetsp.c Fri Oct 14 11:16:19 2005 @@ -1,4 +1,4 @@ -/* $Xorg: cfbsetsp.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbsetsp.c,v 3.8 2005/10/14 15:16:19 tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,10 +45,9 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbsetsp.c,v 3.6 2003/10/29 22:44:53 tsi Exp $ */ -#include "X.h" -#include "Xmd.h" +#include +#include #include "servermd.h" #include "misc.h" @@ -68,32 +67,33 @@ * boxes, we may not want to start grabbing bits at psrc but at some offset * further on.) */ +/* + int xOrigin; where this scanline starts + int xStart; first bit to use from scanline + int xEnd; last bit to use from scanline + 1 + int alu; raster op + int *pdstBase; start of the drawable + int widthDst; width of drawable in words +*/ + void -cfbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst, planemask) - int y; - int xOrigin; /* where this scanline starts */ - int xStart; /* first bit to use from scanline */ - int xEnd; /* last bit to use from scanline + 1 */ - register unsigned int *psrc; - register int alu; /* raster op */ - int *pdstBase; /* start of the drawable */ - int widthDst; /* width of drawable in words */ - unsigned long planemask; +cfbSetScanline(int y, int xOrigin, int xStart, int xEnd, unsigned int *psrc, + int alu, int *pdstBase, int widthDst, unsigned long planemask) { int w; /* width of scanline in bits */ - register int *pdst; /* where to put the bits */ - register int tmpSrc; /* scratch buffer to collect bits in */ + int *pdst; /* where to put the bits */ + int tmpSrc; /* scratch buffer to collect bits in */ int offSrc; int nl; #if PSZ == 24 - register char *psrcb, *pdstb; - register int xIndex; + char *psrcb, *pdstb; + int xIndex; #else int dstBit; /* offset in bits from beginning of * word */ - register int nstart; /* number of bits from first partial */ + int nstart; /* number of bits from first partial */ #if PSZ != 32 || PPW != 1 - register int nend; /* " " last partial word */ + int nend; /* " " last partial word */ #endif int startmask, endmask, nlMiddle; #endif @@ -184,20 +184,14 @@ * on a word boundary. */ void -cfbSetSpans(pDrawable, pGC, pcharsrc, ppt, pwidth, nspans, fSorted) - DrawablePtr pDrawable; - GCPtr pGC; - char *pcharsrc; - register DDXPointPtr ppt; - int *pwidth; - int nspans; - int fSorted; +cfbSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *pcharsrc, DDXPointPtr ppt, + int *pwidth, int nspans, int fSorted) { unsigned int *psrc = (unsigned int *)pcharsrc; CfbBits *pdstBase; /* start of dst bitmap */ int widthDst; /* width of bitmap in words */ - register BoxPtr pbox, pboxLast, pboxTest; - register DDXPointPtr pptLast; + BoxPtr pbox, pboxLast, pboxTest; + DDXPointPtr pptLast; int alu; RegionPtr prgnDst; int xStart, xEnd; Index: xc/programs/Xserver/cfb/cfbsolid.c diff -u xc/programs/Xserver/cfb/cfbsolid.c:3.9 xc/programs/Xserver/cfb/cfbsolid.c:3.11 --- xc/programs/Xserver/cfb/cfbsolid.c:3.9 Wed Oct 29 17:44:53 2003 +++ xc/programs/Xserver/cfb/cfbsolid.c Fri Oct 14 11:16:19 2005 @@ -1,5 +1,5 @@ +/* $XFree86: xc/programs/Xserver/cfb/cfbsolid.c,v 3.11 2005/10/14 15:16:19 tsi Exp $ */ /* - * $Xorg: cfbsolid.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ * Copyright 1990, 1998 The Open Group @@ -25,11 +25,10 @@ * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/cfbsolid.c,v 3.9 2003/10/29 22:44:53 tsi Exp $ */ -#include "X.h" -#include "Xmd.h" +#include +#include #include "servermd.h" #include "gcstruct.h" #include "window.h" @@ -111,14 +110,11 @@ void -RROP_NAME(cfbFillRectSolid) (pDrawable, pGC, nBox, pBox) - DrawablePtr pDrawable; - GCPtr pGC; - int nBox; - BoxPtr pBox; +RROP_NAME(cfbFillRectSolid)(DrawablePtr pDrawable, GCPtr pGC, int nBox, + BoxPtr pBox) { - register int m; - register CfbBits *pdst; + int m; + CfbBits *pdst; RROP_DECLARE CfbBits *pdstBase, *pdstRect; int nmiddle; @@ -128,7 +124,7 @@ #if PSZ == 24 int leftIndex, rightIndex; #else - register CfbBits leftMask, rightMask; + CfbBits leftMask, rightMask; #endif cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase) @@ -143,7 +139,7 @@ #if PSZ == 8 if (w == 1) { - register char *pdstb = ((char *) pdstRect) + pBox->x1; + char *pdstb = ((char *) pdstRect) + pBox->x1; int incr = widthDst * PGSZB; while (h--) @@ -775,22 +771,17 @@ } void -RROP_NAME(cfbSolidSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) - DrawablePtr pDrawable; - GCPtr pGC; - int nInit; /* number of spans to fill */ - DDXPointPtr pptInit; /* pointer to list of start points */ - int *pwidthInit; /* pointer to list of n widths */ - int fSorted; +RROP_NAME(cfbSolidSpans)(DrawablePtr pDrawable, GCPtr pGC, int nInit, + DDXPointPtr pptInit, int *pwidthInit, int fSorted) { CfbBits *pdstBase; int widthDst; RROP_DECLARE - register CfbBits *pdst; - register int nlmiddle; - register int w; + CfbBits *pdst; + int nlmiddle; + int w; int x; /* next three parameters are post-clip */ @@ -803,7 +794,7 @@ #if PSZ == 24 int leftIndex, rightIndex; #else - register CfbBits startmask, endmask; + CfbBits startmask, endmask; #endif devPriv = cfbGetGCPrivate(pGC); @@ -1322,7 +1313,7 @@ #if PSZ == 8 if (w <= PGSZB) { - register char *addrb; + char *addrb; addrb = ((char *) pdst) + x; while (w--) Index: xc/programs/Xserver/cfb/cfbteblt8.c diff -u xc/programs/Xserver/cfb/cfbteblt8.c:1.7 xc/programs/Xserver/cfb/cfbteblt8.c:1.9 --- xc/programs/Xserver/cfb/cfbteblt8.c:1.7 Thu Dec 30 21:56:03 2004 +++ xc/programs/Xserver/cfb/cfbteblt8.c Fri Oct 14 11:16:19 2005 @@ -3,7 +3,7 @@ * 8 bit displays, in Copy mode with no clipping. */ -/* $XFree86: xc/programs/Xserver/cfb/cfbteblt8.c,v 1.7 2004/12/31 02:56:03 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbteblt8.c,v 1.9 2005/10/14 15:16:19 tsi Exp $ */ /* Copyright 1989, 1998 The Open Group @@ -29,15 +29,13 @@ in this Software without prior written authorization from The Open Group. */ -/* $Xorg: cfbteblt8.c,v 1.4 2001/02/09 02:04:38 xorgcvs Exp $ */ - #if PSZ == 8 -#include "X.h" -#include "Xmd.h" -#include "Xproto.h" +#include +#include +#include #include "cfb.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" #include "gcstruct.h" #include "windowstr.h" @@ -321,29 +319,24 @@ void -CFBTEGBLT8 (pDrawable, pGC, xInit, yInit, nglyph, ppci, pglyphBase) - DrawablePtr pDrawable; - GC *pGC; - int xInit, yInit; - unsigned int nglyph; - CharInfoPtr *ppci; /* array of character info */ - pointer pglyphBase; /* start of array of glyphs */ +CFBTEGBLT8(DrawablePtr pDrawable, GC *pGC, int xInit, int yInit, + unsigned int nglyph, CharInfoPtr *ppci, pointer pglyphBase) { - register CfbBits c; - register CfbBits *dst; - register CfbBits leftMask, rightMask; - register int hTmp; - register int xoff1; - register glyphPointer char1; - register glyphPointer char2; + CfbBits c; + CfbBits *dst; + CfbBits leftMask, rightMask; + int hTmp; + int xoff1; + glyphPointer char1; + glyphPointer char2; #if NGLYPHS >= 3 - register glyphPointer char3; + glyphPointer char3; #endif #if NGLYPHS >= 4 - register glyphPointer char4; + glyphPointer char4; #endif #if NGLYPHS >= 5 - register glyphPointer char5; + glyphPointer char5; #endif #ifdef ALL_LEFTBITS int xoff2, xoff3, xoff4, xoff5; @@ -366,9 +359,9 @@ int lshift; int widthGlyphs; #ifdef USE_LEFTBITS - register CfbBits glyphMask; - register CfbBits tmpSrc; - register int glyphBytes; + CfbBits glyphMask; + CfbBits tmpSrc; + int glyphBytes; #endif widthGlyph = FONTMAXBOUNDS(pfont,characterWidth); Index: xc/programs/Xserver/cfb/cfbtegblt.c diff -u xc/programs/Xserver/cfb/cfbtegblt.c:3.7 xc/programs/Xserver/cfb/cfbtegblt.c:3.9 --- xc/programs/Xserver/cfb/cfbtegblt.c:3.7 Wed Oct 29 17:44:53 2003 +++ xc/programs/Xserver/cfb/cfbtegblt.c Fri Oct 14 11:16:19 2005 @@ -1,4 +1,4 @@ -/* $Xorg: cfbtegblt.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbtegblt.c,v 3.9 2005/10/14 15:16:19 tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,13 +45,12 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbtegblt.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */ -#include "X.h" -#include "Xmd.h" -#include "Xproto.h" +#include +#include +#include #include "cfb.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" #include "gcstruct.h" #include "windowstr.h" @@ -83,13 +82,8 @@ */ void -cfbTEGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) - DrawablePtr pDrawable; - GC *pGC; - int x, y; - unsigned int nglyph; - CharInfoPtr *ppci; /* array of character info */ - pointer pglyphBase; /* start of array of glyphs */ +cfbTEGlyphBlt(DrawablePtr pDrawable, GC *pGC, int x, int y, + unsigned int nglyph, CharInfoPtr *ppci, pointer pglyphBase) { FontPtr pfont = pGC->font; int widthDst; @@ -98,16 +92,16 @@ int w; /* width of glyph and char */ int h; /* height of glyph and char */ - register int xpos=x; /* current x%32 */ + int xpos=x; /* current x%32 */ int ypos=y; /* current y%32 */ - register unsigned char *pglyph; + unsigned char *pglyph; int widthGlyph; - register CfbBits *pdst;/* pointer to current longword in dst */ + CfbBits *pdst;/* pointer to current longword in dst */ int hTmp; /* counter for height */ BoxRec bbox; /* for clipping */ - register int wtmp,xtemp,width; + int wtmp,xtemp,width; CfbBits bgfill,fgfill,*ptemp,tmpDst1,tmpDst2,*pdtmp; #if PSZ != 24 int tmpx; Index: xc/programs/Xserver/cfb/cfbtile32.c diff -u xc/programs/Xserver/cfb/cfbtile32.c:3.7 xc/programs/Xserver/cfb/cfbtile32.c:3.10 --- xc/programs/Xserver/cfb/cfbtile32.c:3.7 Wed Oct 29 17:44:53 2003 +++ xc/programs/Xserver/cfb/cfbtile32.c Fri Oct 14 11:16:19 2005 @@ -2,7 +2,7 @@ * Fill 32 bit tiled rectangles. Used by both PolyFillRect and PaintWindow. * no depth dependencies. */ -/* $XFree86: xc/programs/Xserver/cfb/cfbtile32.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbtile32.c,v 3.10 2005/10/14 15:16:19 tsi Exp $ */ /* @@ -29,10 +29,8 @@ in this Software without prior written authorization from The Open Group. */ -/* $Xorg: cfbtile32.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ - -#include "X.h" -#include "Xmd.h" +#include +#include #include "servermd.h" #include "gcstruct.h" #include "window.h" @@ -53,73 +51,24 @@ #define SHARED_IDCACHE #endif -#if PSZ == 24 #define STORE(p) (*(p) = MROP_PREBUILT_SOLID(srcpix,*(p))) -/*#define STORE24(p,index) {\ - register int idx = ((index) & 3)<< 1; \ - *(p) = (((MROP_PREBUILT_SOLID(srcpix,*(p))<>cfb24Shift[idx])&cfbmask[idx])| \ - (*(p)&cfbrmask[idx])); \ - (p)--; \ - }*/ -#define STORE24(p,index) MROP_PREBUILT_SOLID24(srcpix, (p), index) - -#define STORE_MASK(p,mask) (*(p) = MROP_PREBUILT_MASK(srcpix,*(p),(mask))) -#define QSTORE(p) ((*(p) = MROP_PREBUILT_SOLID(((srcpix<<24)|srcpix),*(p))), \ - (p)++,(*(p) = MROP_PREBUILT_SOLID(((srcpix<<16)|(srcpix>>8)),*(p))), \ - (p)++,(*(p) = MROP_PREBUILT_SOLID(((srcpix<<8)|(srcpix>>16)),*(p)))) -#if (MROP == Mcopy) && defined(FAST_CONSTANT_OFFSET_MODE) && defined(SHARED_IDCACHE) -# define Expand(left,right) {\ - int part = nlwMiddle & ((PGSZB*2)-1); \ - nlwMiddle *= 3; \ - nlwMiddle >>= PWSH + 3; \ - while (h--) { \ - srcpix = psrc[srcy]; \ - MROP_PREBUILD(srcpix); \ - ++srcy; \ - if (srcy == tileHeight) \ - srcy = 0; \ - left \ - p += part; \ - switch (part) { \ - case 7: \ - STORE24(p - 7, xtmp - 7); \ - case 6: \ - STORE24(p - 6, xtmp - 6); \ - case 5: \ - STORE24(p - 5, xtmp - 5); \ - case 4: \ - STORE24(p - 4, xtmp - 4); \ - case 3: \ - STORE24(p - 3, xtmp - 3); \ - case 2: \ - STORE24(p - 2, xtmp - 2); \ - case 1: \ - STORE24(p - 1, xtmp - 1); \ - } \ - nlw = nlwMiddle; \ - while (nlw) { \ - STORE24 (p + 0, xtmp + 0); \ - STORE24 (p + 1, xtmp + 1); \ - STORE24 (p + 2, xtmp + 2); \ - STORE24 (p + 3, xtmp + 3); \ - STORE24 (p + 4, xtmp + 4); \ - STORE24 (p + 5, xtmp + 5); \ - STORE24 (p + 6, xtmp + 6); \ - STORE24 (p + 7, xtmp + 7); \ - p += 8; \ - xtmp += 8; \ - nlw--; \ - } \ - right \ - p += nlwExtra; \ - } \ -} -#else +#if PSZ == 24 + +#define STORE24(p,index) \ + MROP_PREBUILT_SOLID24(srcpix, (p), index) + +#define STORE_MASK(p,mask) \ + (*(p) = MROP_PREBUILT_MASK(srcpix,*(p),(mask))) +#define QSTORE(p) \ + ( \ + (*(p) = MROP_PREBUILT_SOLID(((srcpix<<24)|srcpix), *(p))), \ + (p)++, \ + (*(p) = MROP_PREBUILT_SOLID(((srcpix<<16)|(srcpix>>8)), *(p))), \ + (p)++, \ + (*(p) = MROP_PREBUILT_SOLID(((srcpix<<8)|(srcpix>>16)), *(p))) \ + ) + #define Expand(left,right) {\ while (h--) { \ srcpix = psrc[srcy]; \ @@ -128,6 +77,7 @@ if (srcy == tileHeight) \ srcy = 0; \ left \ + nlw = nlwMiddle; \ while (nlw--) \ { \ STORE24(p,xtmp); \ @@ -138,14 +88,15 @@ p += nlwExtra; \ } \ } -#endif + #else /*PSZ != 24*/ -#define STORE(p) (*(p) = MROP_PREBUILT_SOLID(srcpix,*(p))) -#if (MROP == Mcopy) && defined(FAST_CONSTANT_OFFSET_MODE) && defined(SHARED_IDCACHE) +#if (MROP == Mcopy) && \ + defined(FAST_CONSTANT_OFFSET_MODE) && \ + defined(SHARED_IDCACHE) # define Expand(left,right) {\ int part = nlwMiddle & ((PGSZB*2)-1); \ - nlwMiddle >>= PWSH + 1; \ + nlwMiddle >>= 3; \ while (h--) { \ srcpix = psrc[srcy]; \ MROP_PREBUILD(srcpix); \ @@ -207,28 +158,26 @@ } \ } #endif -#endif /*PSZ == 24*/ + +#endif /* PSZ == 24 */ void -MROP_NAME(cfbFillRectTile32) (pDrawable, pGC, nBox, pBox) - DrawablePtr pDrawable; - GCPtr pGC; - int nBox; /* number of boxes to fill */ - BoxPtr pBox; /* pointer to list of boxes to fill */ +MROP_NAME(cfbFillRectTile32)(DrawablePtr pDrawable, GCPtr pGC, int nBox, + BoxPtr pBox) { - register CfbBits srcpix; + CfbBits srcpix; CfbBits *psrc; /* pointer to bits in tile, if needed */ int tileHeight; /* height of the tile */ int nlwDst; /* width in longwords of the dest pixmap */ int w; /* width of current box */ - register int h; /* height of current box */ - register CfbBits startmask; - register CfbBits endmask; /* masks for reggedy bits at either end of line */ + int h; /* height of current box */ + CfbBits startmask; + CfbBits endmask; /* masks for reggedy bits at either end of line */ int nlwMiddle; /* number of longwords between sides of boxes */ int nlwExtra; /* to get from right of box to left of next span */ - register int nlw = 0; /* loop version of nlwMiddle */ - register CfbBits *p; /* pointer to bits we're writing */ + int nlw = 0; /* loop version of nlwMiddle */ + CfbBits *p; /* pointer to bits we're writing */ int y; /* current scan line */ int srcy; /* current tile position */ @@ -322,18 +271,13 @@ } } } - pBox++; + pBox++; } } void -MROP_NAME(cfbTile32FS)(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) - DrawablePtr pDrawable; - GCPtr pGC; - int nInit; /* number of spans to fill */ - DDXPointPtr pptInit; /* pointer to list of start points */ - int *pwidthInit; /* pointer to list of n widths */ - int fSorted; +MROP_NAME(cfbTile32FS)(DrawablePtr pDrawable, GCPtr pGC, int nInit, + DDXPointPtr pptInit, int *pwidthInit, int fSorted) { /* next three parameters are post-clip */ int n; /* number of spans to fill */ @@ -341,13 +285,13 @@ int *pwidth;/* pointer to list of n widths */ CfbBits *pbits; /* pointer to start of bitmap */ int nlwDst; /* width in longwords of bitmap */ - register CfbBits *p; /* pointer to current longword in bitmap */ - register int w; /* current span width */ - register int nlw; - register int x; - register CfbBits startmask; - register CfbBits endmask; - register CfbBits srcpix; + CfbBits *p; /* pointer to current longword in bitmap */ + int w; /* current span width */ + int nlw; + int x; + CfbBits startmask; + CfbBits endmask; + CfbBits srcpix; int y; int *pwidthFree;/* copies of the pointers to free */ DDXPointPtr pptFree; @@ -360,7 +304,7 @@ MROP_DECLARE_REG() #endif MROP_PREBUILT_DECLARE() -#if PSZ == 24 +#if PSZ == 24 CfbBits xtmp; #endif @@ -395,8 +339,8 @@ if (!(tileHeight & (tileHeight-1))) { tileHeight--; - while (n--) - { + while (n--) + { x = ppt->x; y = ppt->y; ++ppt; @@ -410,21 +354,21 @@ #endif srcpix = psrc[y & tileHeight]; MROP_PREBUILD(srcpix); - + #if PSZ == 24 if ((x & 3) + w < 5) #else if ((x & PIM) + w < PPW) #endif { - maskpartialbits(x, w, startmask); - *p = MROP_PREBUILT_MASK (srcpix, *p, startmask); + maskpartialbits(x, w, startmask); + *p = MROP_PREBUILT_MASK (srcpix, *p, startmask); } else { - maskbits(x, w, startmask, endmask, nlw); - if (startmask) - { + maskbits(x, w, startmask, endmask, nlw); + if (startmask) + { *p = MROP_PREBUILT_MASK(srcpix, *p, startmask); #if PSZ == 24 if(xtmp&3) p++; @@ -432,9 +376,9 @@ #else p++; #endif - } - while (nlw--) - { + } + while (nlw--) + { #if PSZ == 24 STORE24(p,xtmp); if(xtmp&3) p++; @@ -443,19 +387,19 @@ STORE(p); ++p; #endif - } - if (endmask) - { + } + if (endmask) + { *p = MROP_PREBUILT_MASK(srcpix, *p, endmask); - } + } } - } + } } else #endif { - while (n--) - { + while (n--) + { x = ppt->x; y = ppt->y; ++ppt; @@ -469,21 +413,21 @@ #endif srcpix = psrc[y % tileHeight]; MROP_PREBUILD(srcpix); - + #if PSZ == 24 if ((x & 3) + w < 5) #else if ((x & PIM) + w < PPW) #endif { - maskpartialbits(x, w, startmask); - *p = MROP_PREBUILT_MASK (srcpix, *p, startmask); + maskpartialbits(x, w, startmask); + *p = MROP_PREBUILT_MASK (srcpix, *p, startmask); } else { - maskbits(x, w, startmask, endmask, nlw); - if (startmask) - { + maskbits(x, w, startmask, endmask, nlw); + if (startmask) + { *p = MROP_PREBUILT_MASK(srcpix, *p, startmask); #if PSZ == 24 if(xtmp&3)p++; @@ -491,9 +435,9 @@ #else p++; #endif - } - while (nlw--) - { + } + while (nlw--) + { #if PSZ == 24 STORE24(p,xtmp); if(xtmp&3)p++; @@ -502,13 +446,13 @@ STORE(p); ++p; #endif - } - if (endmask) - { + } + if (endmask) + { *p = MROP_PREBUILT_MASK(srcpix, *p, endmask); - } + } } - } + } } DEALLOCATE_LOCAL(pptFree); DEALLOCATE_LOCAL(pwidthFree); Index: xc/programs/Xserver/cfb/cfbtileodd.c diff -u xc/programs/Xserver/cfb/cfbtileodd.c:3.7 xc/programs/Xserver/cfb/cfbtileodd.c:3.9 --- xc/programs/Xserver/cfb/cfbtileodd.c:3.7 Wed Oct 29 17:44:53 2003 +++ xc/programs/Xserver/cfb/cfbtileodd.c Fri Oct 14 11:16:19 2005 @@ -2,7 +2,7 @@ * Fill odd tiled rectangles and spans. * no depth dependencies. */ -/* $XFree86: xc/programs/Xserver/cfb/cfbtileodd.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbtileodd.c,v 3.9 2005/10/14 15:16:19 tsi Exp $ */ /* @@ -29,10 +29,8 @@ in this Software without prior written authorization from The Open Group. */ -/* $Xorg: cfbtileodd.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ - -#include "X.h" -#include "Xmd.h" +#include +#include #include "servermd.h" #include "gcstruct.h" #include "window.h" @@ -112,14 +110,9 @@ } void -MROP_NAME(cfbFillBoxTileOdd) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, planemask) - DrawablePtr pDrawable; - int nBox; /* number of boxes to fill */ - register BoxPtr pBox; /* pointer to list of boxes to fill */ - PixmapPtr tile; /* tile */ - int xrot, yrot; - int alu; - unsigned long planemask; +MROP_NAME(cfbFillBoxTileOdd)(DrawablePtr pDrawable, int nBox, BoxPtr pBox, + PixmapPtr tile, int xrot, int yrot, int alu, + unsigned long planemask) { int tileWidth; /* width of tile in pixels */ int tileHeight; /* height of the tile */ @@ -133,7 +126,7 @@ int nlwMiddle; /* number of longwords between sides of boxes */ int nlwSrc; /* number of whole longwords in source */ - register int nlw; /* loop version of nlwMiddle */ + int nlw; /* loop version of nlwMiddle */ int srcy; /* current tile y position */ int srcx; /* current tile x position */ int xoffDst, xoffSrc; @@ -149,9 +142,9 @@ CfbBits *pDstLine; /* poitner to start of dest box */ CfbBits *pSrcBase; /* pointer to start of source */ CfbBits *pSrcLine; /* pointer to start of source line */ - register CfbBits *pDst; - register CfbBits *pSrc; - register CfbBits bits, tmp = 0; + CfbBits *pDst; + CfbBits *pSrc; + CfbBits bits, tmp = 0; int xoffStart, xoff; int leftShiftStart, rightShiftStart, nlwSrcStart; CfbBits tileEndMask; @@ -377,15 +370,9 @@ } void -MROP_NAME(cfbFillSpanTileOdd) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu, planemask) - DrawablePtr pDrawable; - int n; - DDXPointPtr ppt; - int *pwidth; - PixmapPtr tile; - int xrot, yrot; - int alu; - unsigned long planemask; +MROP_NAME(cfbFillSpanTileOdd)(DrawablePtr pDrawable, int n, DDXPointPtr ppt, + int *pwidth, PixmapPtr tile, int xrot, int yrot, + int alu, unsigned long planemask) { int tileWidth; /* width of tile in pixels */ int tileHeight; /* height of the tile */ @@ -397,7 +384,7 @@ CfbBits endmask; /* masks for reggedy bits at either end of line */ int nlwSrc; /* number of whole longwords in source */ - register int nlw; /* loop version of nlwMiddle */ + int nlw; /* loop version of nlwMiddle */ int srcy; /* current tile y position */ int srcx; /* current tile x position */ int xoffDst, xoffSrc; @@ -413,9 +400,9 @@ CfbBits *pDstLine; /* poitner to start of dest box */ CfbBits *pSrcBase; /* pointer to start of source */ CfbBits *pSrcLine; /* pointer to start of source line */ - register CfbBits *pDst; - register CfbBits *pSrc; - register CfbBits bits, tmp = 0; + CfbBits *pDst; + CfbBits *pSrc; + CfbBits bits, tmp = 0; int xoffStart, xoff; int leftShiftStart, rightShiftStart, nlwSrcStart; CfbBits tileEndMask; @@ -631,14 +618,9 @@ #define IncSrcPtr psrc++; if (!--srcRemaining) { srcRemaining = widthSrc; psrc = psrcStart; } void -MROP_NAME(cfbFillBoxTile32s) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, planemask) - DrawablePtr pDrawable; - int nBox; /* number of boxes to fill */ - register BoxPtr pBox; /* pointer to list of boxes to fill */ - PixmapPtr tile; /* tile */ - int xrot, yrot; - int alu; - unsigned long planemask; +MROP_NAME(cfbFillBoxTile32s)(DrawablePtr pDrawable, int nBox, BoxPtr pBox, + PixmapPtr tile, int xrot, int yrot, int alu, + unsigned long planemask) { int tileWidth; /* width of tile */ int tileHeight; /* height of the tile */ @@ -651,7 +633,7 @@ CfbBits endmask;/* masks for reggedy bits at either end of line */ int nlMiddle; /* number of longwords between sides of boxes */ - register int nl; /* loop version of nlMiddle */ + int nl; /* loop version of nlMiddle */ int srcy; /* current tile y position */ int srcx; /* current tile x position */ int srcRemaining; /* number of longwords remaining in source */ @@ -670,10 +652,10 @@ CfbBits *psrcBase; /* pointer to start of source */ CfbBits *psrcLine; /* pointer to fetch point of source */ CfbBits *psrcStart; /* pointer to start of source line */ - register CfbBits *pdst; - register CfbBits *psrc; - register CfbBits bits, bits1; - register int nlTemp; + CfbBits *pdst; + CfbBits *psrc; + CfbBits bits, bits1; + int nlTemp; #if MROP == 0 && PSZ == 24 InitializeMergeRop24 (alu, planemask) @@ -950,15 +932,9 @@ } void -MROP_NAME(cfbFillSpanTile32s) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu, planemask) - DrawablePtr pDrawable; - int n; - DDXPointPtr ppt; - int *pwidth; - PixmapPtr tile; - int xrot, yrot; - int alu; - unsigned long planemask; +MROP_NAME(cfbFillSpanTile32s)(DrawablePtr pDrawable, int n, DDXPointPtr ppt, + int *pwidth, PixmapPtr tile, int xrot, int yrot, + int alu, unsigned long planemask) { int tileWidth; /* width of tile */ int tileHeight; /* height of the tile */ @@ -970,7 +946,7 @@ CfbBits endmask;/* masks for reggedy bits at either end of line */ int nlMiddle; /* number of longwords between sides of boxes */ - register int nl; /* loop version of nlMiddle */ + int nl; /* loop version of nlMiddle */ int srcy; /* current tile y position */ int srcx; /* current tile x position */ int srcRemaining; /* number of longwords remaining in source */ @@ -989,10 +965,10 @@ CfbBits *psrcBase; /* pointer to start of source */ CfbBits *psrcLine; /* pointer to fetch point of source */ CfbBits *psrcStart; /* pointer to start of source line */ - register CfbBits *pdst; - register CfbBits *psrc; - register CfbBits bits, bits1; - register int nlTemp; + CfbBits *pdst; + CfbBits *psrc; + CfbBits bits, bits1; + int nlTemp; #if MROP == 0 && PSZ == 24 InitializeMergeRop24 (alu, planemask) Index: xc/programs/Xserver/cfb/cfbwindow.c diff -u xc/programs/Xserver/cfb/cfbwindow.c:1.6 xc/programs/Xserver/cfb/cfbwindow.c:1.8 --- xc/programs/Xserver/cfb/cfbwindow.c:1.6 Mon Nov 10 13:21:45 2003 +++ xc/programs/Xserver/cfb/cfbwindow.c Fri Oct 14 11:16:20 2005 @@ -1,4 +1,4 @@ -/* $Xorg: cfbwindow.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbwindow.c,v 1.8 2005/10/14 15:16:20 tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,9 +45,8 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbwindow.c,v 1.6 2003/11/10 18:21:45 tsi Exp $ */ -#include "X.h" +#include #include "scrnintstr.h" #include "windowstr.h" #include "cfb.h" @@ -56,8 +55,7 @@ #include "cfbmskbits.h" Bool -cfbCreateWindow(pWin) - WindowPtr pWin; +cfbCreateWindow(WindowPtr pWin) { cfbPrivWin *pPrivWin; @@ -79,8 +77,7 @@ } Bool -cfbDestroyWindow(pWin) - WindowPtr pWin; +cfbDestroyWindow(WindowPtr pWin) { cfbPrivWin *pPrivWin; @@ -95,8 +92,7 @@ /*ARGSUSED*/ Bool -cfbMapWindow(pWindow) - WindowPtr pWindow; +cfbMapWindow(WindowPtr pWindow) { return(TRUE); } @@ -110,9 +106,7 @@ */ /*ARGSUSED*/ Bool -cfbPositionWindow(pWin, x, y) - WindowPtr pWin; - int x, y; +cfbPositionWindow(WindowPtr pWin, int x, int y) { cfbPrivWin *pPrivWin; int setxy = 0; @@ -147,8 +141,7 @@ /*ARGSUSED*/ Bool -cfbUnmapWindow(pWindow) - WindowPtr pWindow; +cfbUnmapWindow(WindowPtr pWindow) { return (TRUE); } @@ -162,17 +155,14 @@ void -cfbCopyWindow(pWin, ptOldOrg, prgnSrc) - WindowPtr pWin; - DDXPointRec ptOldOrg; - RegionPtr prgnSrc; +cfbCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { DDXPointPtr pptSrc; - register DDXPointPtr ppt; + DDXPointPtr ppt; RegionRec rgnDst; - register BoxPtr pbox; - register int dx, dy; - register int i, nbox; + BoxPtr pbox; + int dx, dy; + int i, nbox; WindowPtr pwinRoot; pwinRoot = WindowTable[pWin->drawable.pScreen->myNum]; @@ -212,12 +202,10 @@ of it in devPrivates[cfbWindowPrivateIndex].ptr. */ Bool -cfbChangeWindowAttributes(pWin, mask) - WindowPtr pWin; - unsigned long mask; +cfbChangeWindowAttributes(WindowPtr pWin, unsigned long mask) { - register unsigned long index; - register cfbPrivWin *pPrivWin; + unsigned long index; + cfbPrivWin *pPrivWin; int width; WindowPtr pBgWin; Index: xc/programs/Xserver/cfb/cfbzerarc.c diff -u xc/programs/Xserver/cfb/cfbzerarc.c:3.5 xc/programs/Xserver/cfb/cfbzerarc.c:3.7 --- xc/programs/Xserver/cfb/cfbzerarc.c:3.5 Wed Oct 29 17:44:53 2003 +++ xc/programs/Xserver/cfb/cfbzerarc.c Fri Oct 14 11:16:20 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbzerarc.c,v 3.5 2003/10/29 22:44:53 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbzerarc.c,v 3.7 2005/10/14 15:16:20 tsi Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -25,16 +25,14 @@ ********************************************************/ -/* $Xorg: cfbzerarc.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ - /* Derived from: * "Algorithm for drawing ellipses or hyperbolae with a digital plotter" * by M. L. V. Pitteway * The Computer Journal, November 1967, Volume 10, Number 3, pp. 282-289 */ -#include "X.h" -#include "Xprotostr.h" +#include +#include #include "regionstr.h" #include "gcstruct.h" #include "pixmapstr.h" @@ -48,25 +46,22 @@ #ifdef PIXEL_ADDR static void -RROP_NAME(cfbZeroArcSS8)( - DrawablePtr pDraw, - GCPtr pGC, - xArc *arc) +RROP_NAME(cfbZeroArcSS8)(DrawablePtr pDraw, GCPtr pGC, xArc *arc) { miZeroArcRec info; Bool do360; - register int x; + int x; PixelType *addrp; - register PixelType *yorgp, *yorgop; + PixelType *yorgp, *yorgop; #if PSZ == 24 int xorg, xorg3, xorgo, xorgo3; - register int xtmp; + int xtmp; #endif RROP_DECLARE - register int yoffset; + int yoffset; int npwidth, dyoffset; - register int y, a, b, d, mask; - register int k1, k3, dx, dy; + int y, a, b, d, mask; + int k1, k3, dx, dy; cfbGetPixelWidthAndPointer(pDraw,npwidth, addrp) @@ -109,10 +104,10 @@ } if (do360 && (arc->width == arc->height) && !(arc->width & 1)) { - register int xoffset = npwidth; + int xoffset = npwidth; #if PSZ == 24 PixelType *yorghb = yorgp + (info.h * npwidth); - register int tmp1, tmp2, tmp1_3, tmp2_3; + int tmp1, tmp2, tmp1_3, tmp2_3; tmp1 = xorg + info.h; tmp1_3 = tmp1 * 3; @@ -270,14 +265,11 @@ } void -RROP_NAME (cfbZeroPolyArcSS8) (pDraw, pGC, narcs, parcs) - register DrawablePtr pDraw; - GCPtr pGC; - int narcs; - xArc *parcs; +RROP_NAME(cfbZeroPolyArcSS8)(DrawablePtr pDraw, GCPtr pGC, int narcs, + xArc *parcs) { - register xArc *arc; - register int i; + xArc *arc; + int i; BoxRec box; int x2, y2; RegionPtr cclip; Index: xc/programs/Xserver/cfb/stip68kgnu.h diff -u xc/programs/Xserver/cfb/stip68kgnu.h:3.4 xc/programs/Xserver/cfb/stip68kgnu.h:3.5 --- xc/programs/Xserver/cfb/stip68kgnu.h:3.4 Fri Dec 14 14:59:25 2001 +++ xc/programs/Xserver/cfb/stip68kgnu.h Mon Jan 9 09:59:45 2006 @@ -1,5 +1,4 @@ /* - * $Xorg: stip68kgnu.h,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ * Copyright 1990, 1998 The Open Group @@ -25,7 +24,7 @@ * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/stip68kgnu.h,v 3.4 2001/12/14 19:59:25 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/stip68kgnu.h,v 3.5 2006/01/09 14:59:45 dawes Exp $ */ /* * Stipple stack macro for 68k GCC Index: xc/programs/Xserver/cfb/stipmips.s diff -u xc/programs/Xserver/cfb/stipmips.s:1.2 xc/programs/Xserver/cfb/stipmips.s:1.3 --- xc/programs/Xserver/cfb/stipmips.s:1.2 Fri Dec 14 14:59:26 2001 +++ xc/programs/Xserver/cfb/stipmips.s Mon Jan 9 09:59:45 2006 @@ -1,5 +1,5 @@ +/* $XFree86: xc/programs/Xserver/cfb/stipmips.s,v 1.3 2006/01/09 14:59:45 dawes Exp $ */ /* - * $Xorg: stipmips.s,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ * Copyright 1990, 1998 The Open Group Index: xc/programs/Xserver/cfb/stipple68k.s diff -u xc/programs/Xserver/cfb/stipple68k.s:3.3 xc/programs/Xserver/cfb/stipple68k.s:3.4 --- xc/programs/Xserver/cfb/stipple68k.s:3.3 Fri Dec 14 14:59:26 2001 +++ xc/programs/Xserver/cfb/stipple68k.s Mon Jan 9 09:59:45 2006 @@ -1,5 +1,4 @@ /* - * $Xorg: stipple68k.s,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ * Copyright 1990, 1998 The Open Group @@ -25,7 +24,7 @@ * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/stipple68k.s,v 3.3 2001/12/14 19:59:26 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/stipple68k.s,v 3.4 2006/01/09 14:59:45 dawes Exp $ */ /* * Stipple code for 68k processors Index: xc/programs/Xserver/cfb/stipsparc.s diff -u xc/programs/Xserver/cfb/stipsparc.s:1.5 xc/programs/Xserver/cfb/stipsparc.s:1.6 --- xc/programs/Xserver/cfb/stipsparc.s:1.5 Fri Dec 14 14:59:26 2001 +++ xc/programs/Xserver/cfb/stipsparc.s Mon Jan 9 09:59:45 2006 @@ -1,5 +1,4 @@ /* - * $Xorg: stipsparc.s,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ * Copyright 1990, 1998 The Open Group @@ -25,7 +24,7 @@ * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/stipsparc.s,v 1.5 2001/12/14 19:59:26 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/stipsparc.s,v 1.6 2006/01/09 14:59:45 dawes Exp $ */ /* * SPARC assembly code for optimized text rendering. Index: xc/programs/Xserver/cfb/stipsprc32.s diff -u xc/programs/Xserver/cfb/stipsprc32.s:1.5 xc/programs/Xserver/cfb/stipsprc32.s:1.6 --- xc/programs/Xserver/cfb/stipsprc32.s:1.5 Fri Dec 14 14:59:26 2001 +++ xc/programs/Xserver/cfb/stipsprc32.s Mon Jan 9 09:59:45 2006 @@ -1,5 +1,4 @@ /* - * $Xorg: stipsprc32.s,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ * Copyright 1990, 1998 The Open Group @@ -25,7 +24,7 @@ * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/stipsprc32.s,v 1.5 2001/12/14 19:59:26 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/stipsprc32.s,v 1.6 2006/01/09 14:59:45 dawes Exp $ */ /* * SPARC assembly code for optimized text rendering. Index: xc/programs/Xserver/cfb16/Imakefile diff -u xc/programs/Xserver/cfb16/Imakefile:1.3 xc/programs/Xserver/cfb16/Imakefile:1.4 --- xc/programs/Xserver/cfb16/Imakefile:1.3 Fri May 31 12:12:19 2002 +++ xc/programs/Xserver/cfb16/Imakefile Mon Jan 9 09:59:46 2006 @@ -1,8 +1,4 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ - - - -XCOMM $XFree86: xc/programs/Xserver/cfb16/Imakefile,v 1.3 2002/05/31 16:12:19 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/cfb16/Imakefile,v 1.4 2006/01/09 14:59:46 dawes Exp $ #define PixelSize 16 #define LinkDirectory ../cfb Index: xc/programs/Xserver/cfb16/cfbmodule.c diff -u xc/programs/Xserver/cfb16/cfbmodule.c:1.9 xc/programs/Xserver/cfb16/cfbmodule.c:1.10 --- xc/programs/Xserver/cfb16/cfbmodule.c:1.9 Fri Feb 13 18:58:31 2004 +++ xc/programs/Xserver/cfb16/cfbmodule.c Thu Mar 16 11:49:51 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/cfb16/cfbmodule.c,v 1.9 2004/02/13 23:58:31 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb16/cfbmodule.c,v 1.10 2006/03/16 16:49:51 dawes Exp $ */ /* - * Copyright (C) 1998 The XFree86 Project, Inc. + * Copyright (C) 1998-2006 The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -70,7 +70,7 @@ XF86ModuleData cfb16ModuleData = { &VersRec, cfb16Setup, NULL }; static pointer -cfb16Setup(pointer module, pointer opts, int *errmaj, int *errmin) +cfb16Setup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { /* This modules requires cfb, so load it */ return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL, Index: xc/programs/Xserver/cfb16/module/Imakefile diff -u xc/programs/Xserver/cfb16/module/Imakefile:1.2 xc/programs/Xserver/cfb16/module/Imakefile:1.3 --- xc/programs/Xserver/cfb16/module/Imakefile:1.2 Sun Jun 30 22:25:56 2002 +++ xc/programs/Xserver/cfb16/module/Imakefile Fri May 13 17:02:30 2005 @@ -1,8 +1,4 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ - - - -XCOMM $XFree86: xc/programs/Xserver/cfb16/module/Imakefile,v 1.2 2002/07/01 02:25:56 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/cfb16/module/Imakefile,v 1.3 2005/05/13 21:02:30 dawes Exp $ #define IHaveModules Index: xc/programs/Xserver/cfb24/cfbmodule.c diff -u xc/programs/Xserver/cfb24/cfbmodule.c:1.9 xc/programs/Xserver/cfb24/cfbmodule.c:1.10 --- xc/programs/Xserver/cfb24/cfbmodule.c:1.9 Fri Feb 13 18:58:31 2004 +++ xc/programs/Xserver/cfb24/cfbmodule.c Thu Mar 16 11:49:51 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/cfb24/cfbmodule.c,v 1.9 2004/02/13 23:58:31 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb24/cfbmodule.c,v 1.10 2006/03/16 16:49:51 dawes Exp $ */ /* - * Copyright (C) 1998 The XFree86 Project, Inc. + * Copyright (C) 1998-2006 The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -70,7 +70,7 @@ XF86ModuleData cfb24ModuleData = { &VersRec, cfb24Setup, NULL }; static pointer -cfb24Setup(pointer module, pointer opts, int *errmaj, int *errmin) +cfb24Setup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { /* This modules requires cfb, so load it */ return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL, Index: xc/programs/Xserver/cfb24/module/Imakefile diff -u xc/programs/Xserver/cfb24/module/Imakefile:1.2 xc/programs/Xserver/cfb24/module/Imakefile:1.3 --- xc/programs/Xserver/cfb24/module/Imakefile:1.2 Sun Jun 30 22:25:57 2002 +++ xc/programs/Xserver/cfb24/module/Imakefile Fri May 13 17:02:31 2005 @@ -1,8 +1,4 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ - - - -XCOMM $XFree86: xc/programs/Xserver/cfb24/module/Imakefile,v 1.2 2002/07/01 02:25:57 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/cfb24/module/Imakefile,v 1.3 2005/05/13 21:02:31 dawes Exp $ #define IHaveModules Index: xc/programs/Xserver/cfb32/Imakefile diff -u xc/programs/Xserver/cfb32/Imakefile:1.3 xc/programs/Xserver/cfb32/Imakefile:1.4 --- xc/programs/Xserver/cfb32/Imakefile:1.3 Fri May 31 12:12:19 2002 +++ xc/programs/Xserver/cfb32/Imakefile Mon Jan 9 09:59:46 2006 @@ -1,8 +1,4 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ - - - -XCOMM $XFree86: xc/programs/Xserver/cfb32/Imakefile,v 1.3 2002/05/31 16:12:19 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/cfb32/Imakefile,v 1.4 2006/01/09 14:59:46 dawes Exp $ #define PixelSize 32 #define LinkDirectory ../cfb Index: xc/programs/Xserver/cfb32/cfbmodule.c diff -u xc/programs/Xserver/cfb32/cfbmodule.c:1.9 xc/programs/Xserver/cfb32/cfbmodule.c:1.10 --- xc/programs/Xserver/cfb32/cfbmodule.c:1.9 Fri Feb 13 18:58:31 2004 +++ xc/programs/Xserver/cfb32/cfbmodule.c Thu Mar 16 11:49:51 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/cfb32/cfbmodule.c,v 1.9 2004/02/13 23:58:31 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb32/cfbmodule.c,v 1.10 2006/03/16 16:49:51 dawes Exp $ */ /* - * Copyright (C) 1998 The XFree86 Project, Inc. + * Copyright (C) 1998-2006 The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -70,7 +70,7 @@ XF86ModuleData cfb32ModuleData = { &VersRec, cfb32Setup, NULL }; static pointer -cfb32Setup(pointer module, pointer opts, int *errmaj, int *errmin) +cfb32Setup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { /* This modules requires cfb, so load it */ return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL, Index: xc/programs/Xserver/cfb32/module/Imakefile diff -u xc/programs/Xserver/cfb32/module/Imakefile:1.2 xc/programs/Xserver/cfb32/module/Imakefile:1.3 --- xc/programs/Xserver/cfb32/module/Imakefile:1.2 Sun Jun 30 22:25:57 2002 +++ xc/programs/Xserver/cfb32/module/Imakefile Fri May 13 17:02:31 2005 @@ -1,8 +1,4 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ - - - -XCOMM $XFree86: xc/programs/Xserver/cfb32/module/Imakefile,v 1.2 2002/07/01 02:25:57 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/cfb32/module/Imakefile,v 1.3 2005/05/13 21:02:31 dawes Exp $ #define IHaveModules Index: xc/programs/Xserver/dbe/Imakefile diff -u xc/programs/Xserver/dbe/Imakefile:3.11 xc/programs/Xserver/dbe/Imakefile:3.15 --- xc/programs/Xserver/dbe/Imakefile:3.11 Mon Dec 17 15:00:39 2001 +++ xc/programs/Xserver/dbe/Imakefile Sun Feb 19 10:51:18 2006 @@ -1,36 +1,103 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ +XCOMM $XFree86: xc/programs/Xserver/dbe/Imakefile,v 3.15 2006/02/19 15:51:18 tsi Exp $ - - - -XCOMM $XFree86: xc/programs/Xserver/dbe/Imakefile,v 3.11 2001/12/17 20:00:39 dawes Exp $ +/* + * Copyright (c) 1994-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ #if DoLoadableServer +#if !BuildModuleInSubdir +#define IHaveModules +#elif !defined(IHaveModules) #define IHaveSubdirs +SUBDIRS = module +#endif #endif #include -#if DoLoadableServer - SUBDIRS = module +#ifdef IHaveModules +MODSRC = dbemodule.c +MODOBJ = dbemodule.o #endif - SRCS = dbe.c midbe.c - OBJS = dbe.o midbe.o - INCLUDES = -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(EXTINCSRC) $(EXTRAINCLUDES) - LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln +#ifndef LinkDefines +#define LinkDefines /**/ +#endif + SRCS = dbe.c midbe.c $(MODSRC) + OBJS = dbe.o midbe.o $(MODOBJ) + INCLUDES = -I$(SERVERSRC)/dbe -I$(SERVERSRC)/include + LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/llib-los.ln + DEFINES = -DIN_DBE $(EXT_DEFINES) LinkDefines + +#ifdef IHaveModules +ModuleObjectRule() +LibraryModuleTarget(dbe,$(OBJS),extensions) +#else NormalLibraryObjectRule() - NormalLibraryTarget(dbe,$(OBJS)) +#endif LintLibraryTarget(dbe,$(SRCS)) NormalLintTarget($(SRCS)) -#if DoLoadableServer +#ifdef IHaveModules +InstallLibraryModule(dbe,$(MODULEDIR),extensions) +#endif + +#ifdef IHaveSubdirs MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) #endif DependTarget() +#ifdef LinkDirectory +LinkSourceFile(dbe.c,LinkDirectory) +LinkSourceFile(midbe.c,LinkDirectory) +LinkSourceFile(dbemodule.c,LinkDirectory) +#endif + Index: xc/programs/Xserver/dbe/dbe.c diff -u xc/programs/Xserver/dbe/dbe.c:3.11 xc/programs/Xserver/dbe/dbe.c:3.14 --- xc/programs/Xserver/dbe/dbe.c:3.11 Sat Oct 27 23:33:04 2001 +++ xc/programs/Xserver/dbe/dbe.c Sun Feb 19 10:51:18 2006 @@ -1,4 +1,3 @@ -/* $Xorg: dbe.c,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */ /****************************************************************************** * * Copyright (c) 1994, 1995 Hewlett-Packard Company @@ -30,20 +29,16 @@ * DIX DBE code * *****************************************************************************/ -/* $XFree86: xc/programs/Xserver/dbe/dbe.c,v 3.11 2001/10/28 03:33:04 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/dbe/dbe.c,v 3.14 2006/02/19 15:51:18 tsi Exp $ */ /* INCLUDES */ #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" -#include "scrnintstr.h" + #include "extnsionst.h" -#include "gcstruct.h" #include "dixstruct.h" -#define NEED_DBE_PROTOCOL -#include "dbestruct.h" +#include "dbeproc.h" #include "midbe.h" #ifdef XFree86LOADER @@ -53,7 +48,7 @@ /* GLOBALS */ /* Per-screen initialization functions [init'ed by DbeRegisterFunction()] */ -static Bool (* DbeInitFunct[MAXSCREENS])(); /* pScreen, pDbeScreenPriv */ +static DbeInitFuncPtr DbeInitFunct[MAXSCREENS]; /* These are static globals copied to DBE's screen private for use by DDX */ static int dbeScreenPrivIndex; @@ -75,6 +70,7 @@ static Bool firstRegistrationPass = TRUE; +#if defined(NEED_DBE_BUF_BITS) && defined(NEED_DBE_BUF_VALIDATE) /****************************************************************************** * * DBE DIX Procedure: DbeValidateBuffer @@ -97,15 +93,13 @@ *****************************************************************************/ void -DbeValidateBuffer(pWin, drawID, dstbuf) - WindowPtr pWin; - XID drawID; - Bool dstbuf; +DbeValidateBuffer(WindowPtr pWin, XID drawID, Bool dstbuf) { DbeScreenPrivPtr pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin); - if (pDbeScreenPriv->ValidateBuffer) + if (pDbeScreenPriv && pDbeScreenPriv->ValidateBuffer) (*pDbeScreenPriv->ValidateBuffer)(pWin, drawID, dstbuf); } +#endif /****************************************************************************** @@ -119,9 +113,7 @@ *****************************************************************************/ void -DbeRegisterFunction(pScreen, funct) - ScreenPtr pScreen; - Bool (*funct)(); +DbeRegisterFunction(ScreenPtr pScreen, DbeInitFuncPtr funct) { int i; @@ -136,6 +128,11 @@ } firstRegistrationPass = FALSE; +#if defined(NEED_DBE_BUF_BITS) && defined(NEED_DBE_BUF_VALIDATE) +#ifdef XFree86LOADER + xf86DbeRegisterValidateBuffer(); +#endif +#endif } DbeInitFunct[pScreen->myNum] = funct; @@ -155,16 +152,15 @@ * *****************************************************************************/ static DbeWindowPrivPtr -DbeAllocWinPriv(pScreen) - ScreenPtr pScreen; +DbeAllocWinPriv(ScreenPtr pScreen) { DbeWindowPrivPtr pDbeWindowPriv; DbeScreenPrivPtr pDbeScreenPriv; - register char *ptr; - register DevUnion *ppriv; - register unsigned int *sizes; - register unsigned int size; - register int i; + char *ptr; + DevUnion *ppriv; + unsigned int *sizes; + unsigned int size; + int i; pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen); pDbeWindowPriv = (DbeWindowPrivPtr)xalloc(pDbeScreenPriv->totalWinPrivSize); @@ -225,7 +221,7 @@ *****************************************************************************/ static int -DbeAllocWinPrivPrivIndex() +DbeAllocWinPrivPrivIndex(void) { return winPrivPrivCount++; @@ -245,10 +241,7 @@ *****************************************************************************/ static Bool -DbeAllocWinPrivPriv(pScreen, index, amount) - register ScreenPtr pScreen; - int index; - unsigned int amount; +DbeAllocWinPrivPriv(ScreenPtr pScreen, int index, unsigned int amount) { DbeScreenPrivPtr pDbeScreenPriv; unsigned int oldamount; @@ -299,9 +292,7 @@ *****************************************************************************/ static void -DbeStubScreen(pDbeScreenPriv, nStubbedScreens) - DbeScreenPrivPtr pDbeScreenPriv; - int *nStubbedScreens; +DbeStubScreen(DbeScreenPrivPtr pDbeScreenPriv, int *nStubbedScreens) { /* Stub DIX. */ pDbeScreenPriv->SetupBackgroundPainter = NULL; @@ -348,12 +339,11 @@ *****************************************************************************/ static int -ProcDbeGetVersion(client) - ClientPtr client; +ProcDbeGetVersion(ClientPtr client) { /* REQUEST(xDbeGetVersionReq); */ xDbeGetVersionReply rep; - register int n; + int n; REQUEST_SIZE_MATCH(xDbeGetVersionReq); @@ -400,15 +390,14 @@ *****************************************************************************/ static int -ProcDbeAllocateBackBufferName(client) - ClientPtr client; +ProcDbeAllocateBackBufferName(ClientPtr client) { REQUEST(xDbeAllocateBackBufferNameReq); WindowPtr pWin; DbeScreenPrivPtr pDbeScreenPriv; DbeWindowPrivPtr pDbeWindowPriv; XdbeScreenVisualInfo scrVisInfo; - register int i; + int i; Bool visualMatched = FALSE; xDbeSwapAction swapAction; VisualID visual; @@ -635,8 +624,7 @@ *****************************************************************************/ static int -ProcDbeDeallocateBackBufferName(client) - ClientPtr client; +ProcDbeDeallocateBackBufferName(ClientPtr client) { REQUEST(xDbeDeallocateBackBufferNameReq); DbeWindowPrivPtr pDbeWindowPriv; @@ -707,8 +695,7 @@ *****************************************************************************/ static int -ProcDbeSwapBuffers(client) - ClientPtr client; +ProcDbeSwapBuffers(ClientPtr client) { REQUEST(xDbeSwapBuffersReq); WindowPtr pWin; @@ -716,7 +703,7 @@ DbeSwapInfoPtr swapInfo; xDbeSwapInfo *dbeSwapInfo; int error; - register int i, j; + int i, j; int nStuff; @@ -832,12 +819,11 @@ *****************************************************************************/ static int -ProcDbeBeginIdiom(client) - ClientPtr client; +ProcDbeBeginIdiom(ClientPtr client) { /* REQUEST(xDbeBeginIdiomReq); */ DbeScreenPrivPtr pDbeScreenPriv; - register int i; + int i; REQUEST_SIZE_MATCH(xDbeBeginIdiomReq); @@ -876,17 +862,16 @@ *****************************************************************************/ static int -ProcDbeGetVisualInfo(client) - ClientPtr client; +ProcDbeGetVisualInfo(ClientPtr client) { REQUEST(xDbeGetVisualInfoReq); DbeScreenPrivPtr pDbeScreenPriv; xDbeGetVisualInfoReply rep; Drawable *drawables; DrawablePtr *pDrawables = NULL; - register int i, j, n; - register int count; /* number of visual infos in reply */ - register int length; /* length of reply */ + int i, j, n; + int count; /* number of visual infos in reply */ + int length; /* length of reply */ ScreenPtr pScreen; XdbeScreenVisualInfo *pScrVisInfo; @@ -1053,8 +1038,7 @@ *****************************************************************************/ static int -ProcDbeGetBackBufferAttributes(client) - ClientPtr client; +ProcDbeGetBackBufferAttributes(ClientPtr client) { REQUEST(xDbeGetBackBufferAttributesReq); xDbeGetBackBufferAttributesReply rep; @@ -1103,8 +1087,7 @@ *****************************************************************************/ static int -ProcDbeDispatch(client) - ClientPtr client; +ProcDbeDispatch(ClientPtr client) { REQUEST(xReq); @@ -1159,11 +1142,10 @@ *****************************************************************************/ static int -SProcDbeGetVersion(client) - ClientPtr client; +SProcDbeGetVersion(ClientPtr client) { REQUEST(xDbeGetVersionReq); - register int n; + int n; swaps(&stuff->length, n); @@ -1196,11 +1178,10 @@ *****************************************************************************/ static int -SProcDbeAllocateBackBufferName(client) - ClientPtr client; +SProcDbeAllocateBackBufferName(ClientPtr client) { REQUEST(xDbeAllocateBackBufferNameReq); - register int n; + int n; swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq); @@ -1232,11 +1213,10 @@ *****************************************************************************/ static int -SProcDbeDeallocateBackBufferName(client) - ClientPtr client; +SProcDbeDeallocateBackBufferName(ClientPtr client) { REQUEST (xDbeDeallocateBackBufferNameReq); - register int n; + int n; swaps(&stuff->length, n); @@ -1271,11 +1251,10 @@ *****************************************************************************/ static int -SProcDbeSwapBuffers(client) - ClientPtr client; +SProcDbeSwapBuffers(ClientPtr client) { REQUEST(xDbeSwapBuffersReq); - register int i, n; + int i, n; xDbeSwapInfo *pSwapInfo; @@ -1320,11 +1299,10 @@ *****************************************************************************/ static int -SProcDbeBeginIdiom(client) - ClientPtr client; +SProcDbeBeginIdiom(ClientPtr client) { REQUEST(xDbeBeginIdiomReq); - register int n; + int n; swaps(&stuff->length, n); return(ProcDbeBeginIdiom(client)); @@ -1350,11 +1328,10 @@ *****************************************************************************/ static int -SProcDbeGetVisualInfo(client) - ClientPtr client; +SProcDbeGetVisualInfo(ClientPtr client) { REQUEST(xDbeGetVisualInfoReq); - register int n; + int n; swaps(&stuff->length, n); @@ -1385,11 +1362,10 @@ *****************************************************************************/ static int -SProcDbeGetBackBufferAttributes(client) - ClientPtr client; +SProcDbeGetBackBufferAttributes(ClientPtr client) { REQUEST (xDbeGetBackBufferAttributesReq); - register int n; + int n; swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq); @@ -1412,8 +1388,7 @@ *****************************************************************************/ static int -SProcDbeDispatch(client) - ClientPtr client; +SProcDbeDispatch(ClientPtr client) { REQUEST(xReq); @@ -1467,9 +1442,7 @@ *****************************************************************************/ static Bool -DbeSetupBackgroundPainter(pWin, pGC) - WindowPtr pWin; - GCPtr pGC; +DbeSetupBackgroundPainter(WindowPtr pWin, GCPtr pGC) { pointer gcvalues[4]; int ts_x_origin, ts_y_origin; @@ -1542,9 +1515,7 @@ * *****************************************************************************/ static int -DbeDrawableDelete(pDrawable, id) - pointer pDrawable; - XID id; +DbeDrawableDelete(pointer pDrawable, XID id) { return(Success); @@ -1563,9 +1534,7 @@ * *****************************************************************************/ static int -DbeWindowPrivDelete(pDbeWinPriv, id) - pointer pDbeWinPriv; - XID id; +DbeWindowPrivDelete(pointer pDbeWinPriv, XID id) { DbeScreenPrivPtr pDbeScreenPriv; DbeWindowPrivPtr pDbeWindowPriv = (DbeWindowPrivPtr)pDbeWinPriv; @@ -1672,8 +1641,7 @@ * *****************************************************************************/ static void -DbeResetProc(extEntry) - ExtensionEntry *extEntry; +DbeResetProc(ExtensionEntry *extEntry) { int i; ScreenPtr pScreen; @@ -1728,8 +1696,7 @@ *****************************************************************************/ static Bool -DbeDestroyWindow(pWin) - WindowPtr pWin; +DbeDestroyWindow(WindowPtr pWin) { DbeScreenPrivPtr pDbeScreenPriv; DbeWindowPrivPtr pDbeWindowPriv; @@ -1811,17 +1778,18 @@ *****************************************************************************/ void -DbeExtensionInit() +DbeExtensionInit(void) { ExtensionEntry *extEntry; - register int i, j; + int i, j; ScreenPtr pScreen = NULL; DbeScreenPrivPtr pDbeScreenPriv; int nStubbedScreens = 0; Bool ddxInitSuccess; #ifdef PANORAMIX - if(!noPanoramiXExtension) return; + if(!noPanoramiXExtension) + return; #endif /* Allocate private pointers in windows and screens. */ Index: xc/programs/Xserver/dbe/dbemodule.c diff -u xc/programs/Xserver/dbe/dbemodule.c:1.7 xc/programs/Xserver/dbe/dbemodule.c:1.8 --- xc/programs/Xserver/dbe/dbemodule.c:1.7 Tue Jan 25 13:37:37 2000 +++ xc/programs/Xserver/dbe/dbemodule.c Thu Mar 16 11:49:52 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dbe/dbemodule.c,v 1.7 2000/01/25 18:37:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dbe/dbemodule.c,v 1.8 2006/03/16 16:49:52 dawes Exp $ */ #include "xf86Module.h" @@ -34,7 +34,7 @@ XF86ModuleData dbeModuleData = { &VersRec, dbeSetup, NULL }; static pointer -dbeSetup(pointer module, pointer opts, int *errmaj, int *errmin) +dbeSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { LoadExtension(&dbeExt, FALSE); Index: xc/programs/Xserver/dbe/dbeproc.h diff -u /dev/null xc/programs/Xserver/dbe/dbeproc.h:1.2 --- /dev/null Tue May 9 21:55:59 2006 +++ xc/programs/Xserver/dbe/dbeproc.h Sun Feb 19 10:51:18 2006 @@ -0,0 +1,21 @@ +/* $XFree86: xc/programs/Xserver/dbe/dbeproc.h,v 1.2 2006/02/19 15:51:18 tsi Exp $ */ + +#ifndef DBEPROC_H +#define DBEPROC_H 1 + +#ifndef DBE_EXT_INIT_ONLY + +#include "dbestruct.h" + +typedef Bool (*DbeInitFuncPtr)(ScreenPtr pScreen, + DbeScreenPrivPtr pDbeScreenPriv); + +/* DbeValidateBuffer declaration moved to dix.h */ + +void DbeRegisterFunction(ScreenPtr pScreen, DbeInitFuncPtr funct); + +#endif /* DBE_EXT_INIT_ONLY */ + +void DbeExtensionInit(void); + +#endif /* DBEPROC_H */ Index: xc/programs/Xserver/dbe/dbestruct.h diff -u xc/programs/Xserver/dbe/dbestruct.h:3.2 xc/programs/Xserver/dbe/dbestruct.h:3.5 --- xc/programs/Xserver/dbe/dbestruct.h:3.2 Mon Nov 17 17:20:32 2003 +++ xc/programs/Xserver/dbe/dbestruct.h Sun Feb 19 10:51:18 2006 @@ -1,4 +1,3 @@ -/* $Xorg: dbestruct.h,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */ /****************************************************************************** * * Copyright (c) 1994, 1995 Hewlett-Packard Company @@ -30,7 +29,7 @@ * Header file for DIX-related DBE * *****************************************************************************/ -/* $XFree86: xc/programs/Xserver/dbe/dbestruct.h,v 3.2 2003/11/17 22:20:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dbe/dbestruct.h,v 3.5 2006/02/19 15:51:18 tsi Exp $ */ #ifndef DBE_STRUCT_H @@ -40,8 +39,9 @@ /* INCLUDES */ #define NEED_DBE_PROTOCOL -#include "Xdbeproto.h" +#include #include "windowstr.h" +#include "scrnintstr.h" /* DEFINES */ @@ -156,6 +156,25 @@ ****************************************************************************** */ +typedef Bool (*DbeSetupBackgroundPainterProcPtr)(WindowPtr pWin, GCPtr pGC); +typedef DbeWindowPrivPtr (*DbeAllocWinPrivProcPtr)(ScreenPtr); +typedef int (*DbeAllocWinPrivPrivIndexProcPtr)(void); +typedef Bool (*DbeAllocWinPrivPrivProcPtr)(ScreenPtr pScreen, int index, + unsigned amount); + +typedef Bool (*DbeGetVisualInfoProcPtr)(ScreenPtr pScreen, + XdbeScreenVisualInfo *pVisInfo); +typedef int (*DbeAllocBackBufferNameProcPtr)(WindowPtr pWin, XID bufId, + int swapAction); +typedef int (*DbeSwapBuffersProcPtr)(ClientPtr client, int *pNumWindows, + DbeSwapInfoPtr swapInfo); +typedef void (*DbeBeginIdiomProcPtr)(ClientPtr client); +typedef void (*DbeEndIdiomProcPtr)(ClientPtr client); +typedef void (*DbeWinPrivDeleteProcPtr)(DbeWindowPrivPtr pDbeWindowPriv, + XID bufId); +typedef void (*DbeResetProcPtr)(ScreenPtr pScreen); +typedef void (*DbeValidateBufferProcPtr)(WindowPtr pWin, XID bufId, + Bool dstbuffer); typedef struct _DbeScreenPrivRec { /* Info for creating window privs */ @@ -179,55 +198,20 @@ DestroyWindowProcPtr DestroyWindow; /* Per-screen DIX routines */ - Bool (*SetupBackgroundPainter)( - WindowPtr /*pWin*/, - GCPtr /*pGC*/ -); - DbeWindowPrivPtr (*AllocWinPriv)( - ScreenPtr /*pScreen*/ -); - int (*AllocWinPrivPrivIndex)( - void -); - Bool (*AllocWinPrivPriv)( - ScreenPtr /*pScreen*/, - int /*index*/, - unsigned /*amount*/ -); + DbeSetupBackgroundPainterProcPtr SetupBackgroundPainter; + DbeAllocWinPrivProcPtr AllocWinPriv; + DbeAllocWinPrivPrivIndexProcPtr AllocWinPrivPrivIndex; + DbeAllocWinPrivPrivProcPtr AllocWinPrivPriv; /* Per-screen DDX routines */ - Bool (*GetVisualInfo)( - ScreenPtr /*pScreen*/, - XdbeScreenVisualInfo * /*pVisInfo*/ -); - int (*AllocBackBufferName)( - WindowPtr /*pWin*/, - XID /*bufId*/, - int /*swapAction*/ -); - int (*SwapBuffers)( - ClientPtr /*client*/, - int * /*pNumWindows*/, - DbeSwapInfoPtr /*swapInfo*/ -); - void (*BeginIdiom)( - ClientPtr /*client*/ -); - void (*EndIdiom)( - ClientPtr /*client*/ -); - void (*WinPrivDelete)( - DbeWindowPrivPtr /*pDbeWindowPriv*/, - XID /*bufId*/ -); - void (*ResetProc)( - ScreenPtr /*pScreen*/ -); - void (*ValidateBuffer)( - WindowPtr /*pWin*/, - XID /*bufId*/, - Bool /*dstbuffer*/ -); + DbeGetVisualInfoProcPtr GetVisualInfo; + DbeAllocBackBufferNameProcPtr AllocBackBufferName; + DbeSwapBuffersProcPtr SwapBuffers; + DbeBeginIdiomProcPtr BeginIdiom; + DbeEndIdiomProcPtr EndIdiom; + DbeWinPrivDeleteProcPtr WinPrivDelete; + DbeResetProcPtr ResetProc; + DbeValidateBufferProcPtr ValidateBuffer; /* Device-specific private information. */ Index: xc/programs/Xserver/dbe/midbe.c diff -u xc/programs/Xserver/dbe/midbe.c:3.5 xc/programs/Xserver/dbe/midbe.c:3.8 --- xc/programs/Xserver/dbe/midbe.c:3.5 Thu Aug 23 10:19:24 2001 +++ xc/programs/Xserver/dbe/midbe.c Sun Feb 19 10:51:18 2006 @@ -1,4 +1,3 @@ -/* $Xorg: midbe.c,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */ /****************************************************************************** * * Copyright (c) 1994, 1995 Hewlett-Packard Company @@ -30,29 +29,17 @@ * Machine-independent DBE code * *****************************************************************************/ -/* $XFree86: xc/programs/Xserver/dbe/midbe.c,v 3.5 2001/08/23 14:19:24 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/dbe/midbe.c,v 3.8 2006/02/19 15:51:18 tsi Exp $ */ /* INCLUDES */ #define NEED_REPLIES #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "os.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "extnsionst.h" -#include "dixstruct.h" -#include "resource.h" -#include "opaque.h" -#include "dbestruct.h" -#include "midbestr.h" -#include "regionstr.h" + #include "gcstruct.h" -#include "inputstr.h" +#include "midbe.h" +#include "midbestr.h" #ifndef IN_MODULE #include @@ -94,9 +81,7 @@ *****************************************************************************/ static Bool -miDbeGetVisualInfo(pScreen, pScrVisInfo) - ScreenPtr pScreen; - XdbeScreenVisualInfo *pScrVisInfo; +miDbeGetVisualInfo(ScreenPtr pScreen, XdbeScreenVisualInfo *pScrVisInfo) { register int i, j, k; register int count; @@ -158,10 +143,7 @@ *****************************************************************************/ static int -miDbeAllocBackBufferName(pWin, bufId, swapAction) - WindowPtr pWin; - XID bufId; - int swapAction; +miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) { ScreenPtr pScreen; DbeWindowPrivPtr pDbeWindowPriv; @@ -272,8 +254,7 @@ *****************************************************************************/ static void -miDbeAliasBuffers(pDbeWindowPriv) - DbeWindowPrivPtr pDbeWindowPriv; +miDbeAliasBuffers(DbeWindowPrivPtr pDbeWindowPriv) { int i; MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv = @@ -299,10 +280,7 @@ *****************************************************************************/ static int -miDbeSwapBuffers(client, pNumWindows, swapInfo) - ClientPtr client; - int *pNumWindows; - DbeSwapInfoPtr swapInfo; +miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo) { DbeScreenPrivPtr pDbeScreenPriv; GCPtr pGC; @@ -481,9 +459,7 @@ *****************************************************************************/ static void -miDbeWinPrivDelete(pDbeWindowPriv, bufId) - DbeWindowPrivPtr pDbeWindowPriv; - XID bufId; +miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId) { MiDbeWindowPrivPrivPtr pDbeWindowPrivPriv; @@ -530,10 +506,7 @@ *****************************************************************************/ static Bool -miDbePositionWindow(pWin, x, y) - WindowPtr pWin; - int x; - int y; +miDbePositionWindow(WindowPtr pWin, int x, int y) { ScreenPtr pScreen; DbeScreenPrivPtr pDbeScreenPriv; @@ -771,8 +744,7 @@ *****************************************************************************/ static void -miDbeResetProc(pScreen) - ScreenPtr pScreen; +miDbeResetProc(ScreenPtr pScreen) { DbeScreenPrivPtr pDbeScreenPriv; @@ -796,9 +768,7 @@ *****************************************************************************/ Bool -miDbeInit(pScreen, pDbeScreenPriv) - ScreenPtr pScreen; - DbeScreenPrivPtr pDbeScreenPriv; +miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv) { /* Copy resource types created by DIX */ dbeDrawableResType = pDbeScreenPriv->dbeDrawableResType; @@ -844,7 +814,7 @@ pDbeScreenPriv->WinPrivDelete = miDbeWinPrivDelete; /* The mi implementation doesn't need buffer validation. */ - pDbeScreenPriv->ValidateBuffer = (void (*)())NoopDDA; + pDbeScreenPriv->ValidateBuffer = (DbeValidateBufferProcPtr)NoopDDA; return(TRUE); Index: xc/programs/Xserver/dbe/midbe.h diff -u xc/programs/Xserver/dbe/midbe.h:3.2 xc/programs/Xserver/dbe/midbe.h:3.4 --- xc/programs/Xserver/dbe/midbe.h:3.2 Mon Nov 17 17:20:32 2003 +++ xc/programs/Xserver/dbe/midbe.h Sun Feb 19 10:51:18 2006 @@ -1,4 +1,4 @@ -/* $Xorg: midbe.h,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */ +/* $XFree86: xc/programs/Xserver/dbe/midbe.h,v 3.4 2006/02/19 15:51:18 tsi Exp $ */ /****************************************************************************** * * Copyright (c) 1994, 1995 Hewlett-Packard Company @@ -30,12 +30,15 @@ * Header file for users of machine-independent DBE code * *****************************************************************************/ -/* $XFree86: xc/programs/Xserver/dbe/midbe.h,v 3.2 2003/11/17 22:20:32 dawes Exp $ */ #ifndef MIDBE_H #define MIDBE_H +/* INCLUDES */ + +#include "dbestruct.h" + /* EXTERNS */ extern Bool miDbeInit( Index: xc/programs/Xserver/dbe/midbestr.h diff -u xc/programs/Xserver/dbe/midbestr.h:3.1 xc/programs/Xserver/dbe/midbestr.h:3.3 --- xc/programs/Xserver/dbe/midbestr.h:3.1 Wed Jan 17 17:36:42 2001 +++ xc/programs/Xserver/dbe/midbestr.h Sun Feb 19 10:51:18 2006 @@ -1,4 +1,4 @@ -/* $Xorg: midbestr.h,v 1.3 2000/08/17 19:48:16 cpqbld Exp $ */ +/* $XFree86: xc/programs/Xserver/dbe/midbestr.h,v 3.3 2006/02/19 15:51:18 tsi Exp $ */ /****************************************************************************** * * Copyright (c) 1994, 1995 Hewlett-Packard Company @@ -35,6 +35,9 @@ #ifndef MIDBE_STRUCT_H #define MIDBE_STRUCT_H +/* INCLUDES */ + +#include "dbestruct.h" /* DEFINES */ Index: xc/programs/Xserver/dbe/module/Imakefile diff -u xc/programs/Xserver/dbe/module/Imakefile:1.4 xc/programs/Xserver/dbe/module/Imakefile:1.5 --- xc/programs/Xserver/dbe/module/Imakefile:1.4 Mon May 31 20:16:59 2004 +++ xc/programs/Xserver/dbe/module/Imakefile Fri May 13 17:02:31 2005 @@ -1,77 +1,6 @@ -XCOMM $XFree86: xc/programs/Xserver/dbe/module/Imakefile,v 1.4 2004/06/01 00:16:59 dawes Exp $ -/* - * Copyright (c) 1994-2004 by 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: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution, and in the same place and form as other copyright, - * license and disclaimer information. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: "This product - * includes software developed by The XFree86 Project, Inc - * (http://www.xfree86.org/) and its contributors", in the same - * place and form as other third-party acknowledgments. Alternately, - * this acknowledgment may appear in the software itself, in the - * same form and location as other such third-party acknowledgments. - * - * 4. Except as contained in this notice, the name of The XFree86 - * Project, Inc 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, Inc. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +XCOMM $XFree86: xc/programs/Xserver/dbe/module/Imakefile,v 1.5 2005/05/13 21:02:31 dawes Exp $ #define IHaveModules -#include +#define LinkDirectory .. +#include "../Imakefile" -#if DoLoadableServer - MSRCS = dbemodule.c - MOBJS = dbemodule.o -#endif - - SRCS = dbe.c midbe.c $(MSRCS) - OBJS = dbe.o midbe.o $(MOBJS) - INCLUDES = -I.. -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(EXTINCSRC) $(EXTRAINCLUDES) - LINTLIBS = ../../dix/llib-ldix.ln ../../os/llib-los.ln - -LinkSourceFile(dbemodule.c,..) -LinkSourceFile(midbe.c,..) -LinkSourceFile(dbe.c,..) - -ModuleObjectRule() - -LibraryModuleTarget(dbe,$(OBJS),extensions) - -LintLibraryTarget(dbe,$(SRCS)) -NormalLintTarget($(SRCS)) - -InstallLibraryModule(dbe,$(MODULEDIR),extensions) - -DependTarget() - -InstallDriverSDKLibraryModule(dbe,$(DRIVERSDKMODULEDIR),extensions) Index: xc/programs/Xserver/dix/Imakefile diff -u xc/programs/Xserver/dix/Imakefile:3.20 xc/programs/Xserver/dix/Imakefile:3.24 --- xc/programs/Xserver/dix/Imakefile:3.20 Tue Sep 21 14:37:48 2004 +++ xc/programs/Xserver/dix/Imakefile Sun Feb 19 10:51:19 2006 @@ -1,7 +1,7 @@ -XCOMM $XFree86: xc/programs/Xserver/dix/Imakefile,v 3.20 2004/09/21 18:37:48 torrey Exp $ +XCOMM $XFree86: xc/programs/Xserver/dix/Imakefile,v 3.24 2006/02/19 15:51:19 tsi Exp $ /* - * Copyright (c) 1994-2004 by The XFree86 Project, Inc. + * Copyright (c) 1994-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -47,38 +47,28 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - - -#if BuildSeparateTinyDIX && !BuildTinyDIX -#define IHaveSubdirs -SUBDIRS = tiny -#endif - #include -#if PrintOnlyServer -XPSRC = xpstubs.c -XPOBJ = xpstubs.o -#endif - #if !HasFfs -FFS_SRC = ffs.c -FFS_OBJ = ffs.o + FFS_SRC = ffs.c + FFS_OBJ = ffs.o #endif -SRCS = atom.c colormap.c cursor.c devices.c dispatch.c dixutils.c events.c \ - extension.c gc.c globals.c glyphcurs.c grabs.c \ - main.c property.c resource.c swaprep.c swapreq.c \ - tables.c window.c initatoms.c dixfonts.c privates.c pixmap.c $(FFS_SRC) -OBJS = atom.o colormap.o cursor.o devices.o dispatch.o dixutils.o events.o \ - extension.o gc.o globals.o glyphcurs.o grabs.o \ - main.o property.o resource.o swaprep.o swapreq.o \ - tables.o window.o initatoms.o dixfonts.o privates.o pixmap.o $(FFS_OBJ) - - INCLUDES = -I$(SERVERSRC)/dix -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) -I$(EXTINCSRC) -I$(SERVERSRC)/Xext \ - -I$(SERVERSRC)/lbx - LINTLIBS = ../os/llib-los.ln + SRCS = atom.c colormap.c cursor.c devices.c dispatch.c \ + dixutils.c events.c extension.c gc.c globals.c \ + glyphcurs.c grabs.c main.c property.c resource.c \ + swaprep.c swapreq.c tables.c window.c initatoms.c \ + dixfonts.c privates.c pixmap.c $(FFS_SRC) + OBJS = atom.o colormap.o cursor.o devices.o dispatch.o \ + dixutils.o events.o extension.o gc.o globals.o \ + glyphcurs.o grabs.o main.o property.o resource.o \ + swaprep.o swapreq.o tables.o window.o initatoms.o \ + dixfonts.o privates.o pixmap.o $(FFS_OBJ) + + INCLUDES = -I$(SERVERSRC)/include -I$(SERVERSRC)/dix \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/lbx \ + -I$(SERVERSRC)/Xprint + LINTLIBS = ../os/llib-los.ln /* * The following configuration parameters may be set in the appropriate @@ -93,74 +83,70 @@ */ #ifdef DefaultFontPath -DEFAULTFONTPATH = DefaultFontPath -SITE_FONT_PATH = -DCOMPILEDDEFAULTFONTPATH=\"$(DEFAULTFONTPATH)\" + DEFAULTFONTPATH = DefaultFontPath + SITE_FONT_PATH = -DCOMPILEDDEFAULTFONTPATH=\"$(DEFAULTFONTPATH)\" #endif #ifdef DefaultRGBDatabase -DEFAULTRGBDATABASE = DefaultRGBDatabase - SITE_RGB_DB = -DRGB_DB=\"$(DEFAULTRGBDATABASE)\" + DEFAULTRGBDATABASE = DefaultRGBDatabase + SITE_RGB_DB = -DRGB_DB=\"$(DEFAULTRGBDATABASE)\" #endif #ifdef DefaultDisplayClass DEFAULTDISPLAYCLASS = DefaultDisplayClass - SITE_DISPLAY_CLASS = -DCOMPILEDDISPLAYCLASS=\"$(DEFAULTDISPLAYCLASS)\" + SITE_DISPLAY_CLASS = -DCOMPILEDDISPLAYCLASS=\"$(DEFAULTDISPLAYCLASS)\" #endif #ifdef XVendorString -VENDORSTRING = XVendorString - VENDOR_STRING = -DVENDOR_STRING=\"$(VENDORSTRING)\" + VENDORSTRING = XVendorString + VENDOR_STRING = -DVENDOR_STRING=\"$(VENDORSTRING)\" #endif #ifdef XVendorRelease -VENDORRELEASE = XVendorRelease - VENDOR_RELEASE = -DVENDOR_RELEASE="$(VENDORRELEASE)" + VENDORRELEASE = XVendorRelease + VENDOR_RELEASE = -DVENDOR_RELEASE="$(VENDORRELEASE)" #endif #if HasKrb5 - K5DEFS = Krb5Defines + K5DEFS = Krb5Defines #endif #ifdef DarwinArchitecture #if DarwinQuartzSupport - QUARTZ_DEFINES = -DDARWIN_WITH_QUARTZ -DROOTLESS + QUARTZ_DEFINES = -DDARWIN_WITH_QUARTZ -DROOTLESS #endif #endif -SITE_DEFINES = $(SITE_FONT_PATH) $(SITE_RGB_DB) $(SITE_DISPLAY_CLASS) + SITE_DEFINES = $(SITE_FONT_PATH) $(SITE_RGB_DB) $(SITE_DISPLAY_CLASS) -VENDOR_DEFINES = $(VENDOR_STRING) $(VENDOR_RELEASE) $(QUARTZ_DEFINES) + VENDOR_DEFINES = $(VENDOR_STRING) $(VENDOR_RELEASE) $(QUARTZ_DEFINES) -#if BuildTinyDIX -TINY_DEFINES = TinyDIXDefines +#ifndef LinkDefines +#define LinkDefines /**/ #endif -DEFINES = $(TINY_DEFINES) +/* + * Insert EXT_DEFINES just in case the list of pervasive extensions isn't + * being kept up to date. + */ + DEFINES = $(EXT_DEFINES) LinkDefines NormalLibraryObjectRule() NormalLibraryTarget(dix,$(OBJS)) -LintLibraryTarget(dix,$(SRCS) $(XPSRC)) -NormalLintTarget($(SRCS) $(XPSRC)) +LintLibraryTarget(dix,$(SRCS)) +NormalLintTarget($(SRCS)) SpecialCObjectRule(globals,$(ICONFIGFILES),$(SITE_DEFINES)) SpecialCObjectRule(tables,$(ICONFIGFILES),$(K5DEFS)) SpecialCObjectRule(dispatch,$(ICONFIGFILES),$(K5DEFS)) SpecialCObjectRule(main,$(ICONFIGFILES),$(VENDOR_DEFINES)) -SpecialCObjectRule(pixmap,$(ICONFIGFILES),$(_NOOP_)) -SpecialCObjectRule(privates,$(ICONFIGFILES),$(_NOOP_)) +SpecialCObjectRule(events,$(ICONFIGFILES),NullParameter) +SpecialCObjectRule(pixmap,$(ICONFIGFILES),NullParameter) +SpecialCObjectRule(privates,$(ICONFIGFILES),NullParameter) SpecialCObjectRule(window,$(ICONFIGFILES),$(QUARTZ_DEFINES)) -#if PrintOnlyServer -NormalLibraryTarget(xpstubs,$(XPOBJ)) -#endif - DependTarget() -#ifdef IHaveSubdirs -MakeSubdirs($(SUBDIRS)) -DependSubdirs($(SUBDIRS)) -#endif - #ifdef LinkDirectory LinkSourceFile(atom.c,LinkDirectory) LinkSourceFile(colormap.c,LinkDirectory) @@ -186,6 +172,5 @@ LinkSourceFile(swapreq.c,LinkDirectory) LinkSourceFile(tables.c,LinkDirectory) LinkSourceFile(window.c,LinkDirectory) -LinkSourceFile(xpstubs.c,LinkDirectory) #endif Index: xc/programs/Xserver/dix/atom.c diff -u xc/programs/Xserver/dix/atom.c:3.4 xc/programs/Xserver/dix/atom.c:3.6 --- xc/programs/Xserver/dix/atom.c:3.4 Tue Feb 19 06:09:21 2002 +++ xc/programs/Xserver/dix/atom.c Fri Oct 14 11:16:21 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/atom.c,v 3.4 2002/02/19 11:09:21 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/atom.c,v 3.6 2005/10/14 15:16:21 tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -46,10 +46,8 @@ ******************************************************************/ -/* $Xorg: atom.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ - -#include "X.h" -#include "Xatom.h" +#include +#include #include "misc.h" #include "resource.h" #include "dix.h" @@ -71,15 +69,12 @@ void FreeAtom(NodePtr patom); Atom -MakeAtom(string, len, makeit) - char *string; - unsigned len; - Bool makeit; +MakeAtom(char *string, unsigned len, Bool makeit) { - register NodePtr * np; + NodePtr * np; unsigned i; int comp; - register unsigned int fp = 0; + unsigned int fp = 0; np = &atomRoot; for (i = 0; i < (len+1)/2; i++) @@ -106,7 +101,7 @@ } if (makeit) { - register NodePtr nd; + NodePtr nd; nd = (NodePtr) xalloc(sizeof(NodeRec)); if (!nd) @@ -151,15 +146,13 @@ } Bool -ValidAtom(atom) - Atom atom; +ValidAtom(Atom atom) { return (atom != None) && (atom <= lastAtom); } char * -NameForAtom(atom) - Atom atom; +NameForAtom(Atom atom) { NodePtr node; if (atom > lastAtom) return 0; Index: xc/programs/Xserver/dix/colormap.c diff -u xc/programs/Xserver/dix/colormap.c:3.12 xc/programs/Xserver/dix/colormap.c:3.14 --- xc/programs/Xserver/dix/colormap.c:3.12 Mon Nov 17 17:20:33 2003 +++ xc/programs/Xserver/dix/colormap.c Fri Oct 14 11:16:21 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.12 2003/11/17 22:20:33 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.14 2005/10/14 15:16:21 tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -46,11 +46,9 @@ ******************************************************************/ -/* $Xorg: colormap.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ - -#include "X.h" +#include #define NEED_EVENTS -#include "Xproto.h" +#include #include "misc.h" #include "dix.h" #include "colormapst.h" @@ -93,8 +91,8 @@ ); static void FreePixels( - register ColormapPtr /*pmap*/, - register int /*client*/ + ColormapPtr /*pmap*/, + int /*client*/ ); static void CopyFree( @@ -239,20 +237,15 @@ /* Create and initialize the color map */ int -CreateColormap (mid, pScreen, pVisual, ppcmap, alloc, client) - Colormap mid; /* resource to use for this colormap */ - ScreenPtr pScreen; - VisualPtr pVisual; - ColormapPtr *ppcmap; - int alloc; /* 1 iff all entries are allocated writeable */ - int client; +CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, + ColormapPtr *ppcmap, int alloc, int client) { int class, size; unsigned long sizebytes; ColormapPtr pmap; - register EntryPtr pent; + EntryPtr pent; int i; - register Pixel *ppix, **pptr; + Pixel *ppix, **pptr; class = pVisual->class; if(!(class & DynamicClass) && (alloc != AllocNone) && (client != SERVER_ID)) @@ -407,12 +400,10 @@ } int -FreeColormap (value, mid) - pointer value; /* must conform to DeleteType */ - XID mid; +FreeColormap(pointer value, XID mid) { int i; - register EntryPtr pent; + EntryPtr pent; ColormapPtr pmap = (ColormapPtr)value; if(CLIENT_ID(mid) != SERVER_ID) @@ -466,9 +457,7 @@ /* Tell window that pmid has disappeared */ static int -TellNoMap (pwin, pmid) - WindowPtr pwin; - Colormap *pmid; +TellNoMap(WindowPtr pwin, Colormap *pmid) { xEvent xE; @@ -495,9 +484,7 @@ /* Tell window that pmid got uninstalled */ int -TellLostMap (pwin, value) - WindowPtr pwin; - pointer value; +TellLostMap(WindowPtr pwin, pointer value) { Colormap *pmid = (Colormap *)value; xEvent xE; @@ -522,9 +509,7 @@ /* Tell window that pmid got installed */ int -TellGainedMap (pwin, value) - WindowPtr pwin; - pointer value; +TellGainedMap(WindowPtr pwin, pointer value) { Colormap *pmid = (Colormap *)value; xEvent xE; @@ -549,10 +534,7 @@ int -CopyColormapAndFree (mid, pSrc, client) - Colormap mid; - ColormapPtr pSrc; - int client; +CopyColormapAndFree(Colormap mid, ColormapPtr pSrc, int client) { ColormapPtr pmap = (ColormapPtr) NULL; int result, alloc, size; @@ -599,9 +581,7 @@ /* Helper routine for freeing large numbers of cells from a map */ static void -CopyFree (channel, client, pmapSrc, pmapDst) - int channel, client; - ColormapPtr pmapSrc, pmapDst; +CopyFree(int channel, int client, ColormapPtr pmapSrc, ColormapPtr pmapDst) { int z, npix; EntryPtr pentSrcFirst, pentDstFirst; @@ -688,10 +668,7 @@ /* Free the ith entry in a color map. Must handle freeing of * colors allocated through AllocColorPlanes */ static void -FreeCell (pmap, i, channel) - ColormapPtr pmap; - Pixel i; - int channel; +FreeCell(ColormapPtr pmap, Pixel i, int channel) { EntryPtr pent; int *pCount; @@ -738,13 +715,12 @@ } static void -UpdateColors (pmap) - ColormapPtr pmap; +UpdateColors(ColormapPtr pmap) { xColorItem *defs; - register xColorItem *pdef; - register EntryPtr pent; - register VisualPtr pVisual; + xColorItem *pdef; + EntryPtr pent; + VisualPtr pVisual; int i, n, size; pVisual = pmap->pVisual; @@ -806,11 +782,8 @@ * Returns by changing the value in pred, pgreen, pblue and pPix */ int -AllocColor (pmap, pred, pgreen, pblue, pPix, client) - ColormapPtr pmap; - unsigned short *pred, *pgreen, *pblue; - Pixel *pPix; - int client; +AllocColor(ColormapPtr pmap, unsigned short *pred, unsigned short *pgreen, + unsigned short *pblue, Pixel *pPix, int client) { Pixel pixR, pixG, pixB; int entries; @@ -990,16 +963,14 @@ */ void -FakeAllocColor (pmap, item) - register ColormapPtr pmap; - register xColorItem *item; +FakeAllocColor(ColormapPtr pmap, xColorItem *item) { Pixel pixR, pixG, pixB; Pixel temp; int entries; xrgb rgb; int class; - register VisualPtr pVisual; + VisualPtr pVisual; pVisual = pmap->pVisual; rgb.red = item->red; @@ -1058,11 +1029,9 @@ /* free a pixel value obtained from FakeAllocColor */ void -FakeFreeColor(pmap, pixel) - register ColormapPtr pmap; - Pixel pixel; +FakeFreeColor(ColormapPtr pmap, Pixel pixel) { - register VisualPtr pVisual; + VisualPtr pVisual; Pixel pixR, pixG, pixB; switch (pmap->class) { @@ -1111,7 +1080,7 @@ ((r)->lower = BIGNUMLOWER-1)) static void -BigNumAdd (BigNumPtr x, BigNumPtr y, BigNumPtr r) +BigNumAdd(BigNumPtr x, BigNumPtr y, BigNumPtr r) { BigNumLower lower, carry = 0; @@ -1125,11 +1094,7 @@ } static Pixel -FindBestPixel(pentFirst, size, prgb, channel) - EntryPtr pentFirst; - int size; - xrgb *prgb; - int channel; +FindBestPixel(EntryPtr pentFirst, int size, xrgb *prgb, int channel) { EntryPtr pent; Pixel pixel, final; @@ -1176,14 +1141,9 @@ } static void -FindColorInRootCmap (pmap, pentFirst, size, prgb, pPixel, channel, comp) - ColormapPtr pmap; - EntryPtr pentFirst; - int size; - xrgb* prgb; - Pixel* pPixel; - int channel; - ColorCompareProcPtr comp; +FindColorInRootCmap(ColormapPtr pmap, EntryPtr pentFirst, int size, + xrgb *prgb, Pixel *pPixel, int channel, + ColorCompareProcPtr comp) { EntryPtr pent; Pixel pixel; @@ -1220,15 +1180,8 @@ * load *pPixel with that value, otherwise set it to 0 */ int -FindColor (pmap, pentFirst, size, prgb, pPixel, channel, client, comp) - ColormapPtr pmap; - EntryPtr pentFirst; - int size; - xrgb *prgb; - Pixel *pPixel; - int channel; - int client; - ColorCompareProcPtr comp; +FindColor(ColormapPtr pmap, EntryPtr pentFirst, int size, xrgb *prgb, + Pixel *pPixel, int channel, int client, ColorCompareProcPtr comp) { EntryPtr pent; Bool foundFree; @@ -1401,9 +1354,7 @@ /* Comparison functions -- passed to FindColor to determine if an * entry is already the color we're looking for or not */ static int -AllComp (pent, prgb) - EntryPtr pent; - xrgb *prgb; +AllComp(EntryPtr pent, xrgb *prgb) { if((pent->co.local.red == prgb->red) && (pent->co.local.green == prgb->green) && @@ -1413,9 +1364,7 @@ } static int -RedComp (pent, prgb) - EntryPtr pent; - xrgb *prgb; +RedComp(EntryPtr pent, xrgb *prgb) { if (pent->co.local.red == prgb->red) return (1); @@ -1423,9 +1372,7 @@ } static int -GreenComp (pent, prgb) - EntryPtr pent; - xrgb *prgb; +GreenComp(EntryPtr pent, xrgb *prgb) { if (pent->co.local.green == prgb->green) return (1); @@ -1433,9 +1380,7 @@ } static int -BlueComp (pent, prgb) - EntryPtr pent; - xrgb *prgb; +BlueComp(EntryPtr pent, xrgb *prgb) { if (pent->co.local.blue == prgb->blue) return (1); @@ -1446,11 +1391,7 @@ /* Read the color value of a cell */ int -QueryColors (pmap, count, ppixIn, prgbList) - ColormapPtr pmap; - int count; - Pixel *ppixIn; - xrgb *prgbList; +QueryColors(ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList) { Pixel *ppix, pixel; xrgb *prgb; @@ -1535,12 +1476,10 @@ } static void -FreePixels(pmap, client) - register ColormapPtr pmap; - register int client; +FreePixels(ColormapPtr pmap, int client) { - register Pixel *ppix, *ppixStart; - register int n; + Pixel *ppix, *ppixStart; + int n; int class; #ifdef LBX Bool grabbed; @@ -1629,9 +1568,7 @@ /* Free all of a client's colors and cells */ /*ARGSUSED*/ int -FreeClientPixels (value, fakeid) - pointer value; /* must conform to DeleteType */ - XID fakeid; +FreeClientPixels(pointer value, XID fakeid) { ColormapPtr pmap; colorResource *pcr = (colorResource *)value; @@ -1644,13 +1581,8 @@ } int -AllocColorCells (client, pmap, colors, planes, contig, ppix, masks) - int client; - ColormapPtr pmap; - int colors, planes; - Bool contig; - Pixel *ppix; - Pixel *masks; +AllocColorCells(int client, ColormapPtr pmap, int colors, int planes, + Bool contig, Pixel *ppix, Pixel *masks) { Pixel rmask, gmask, bmask, *ppixFirst, r, g, b; int n, class; @@ -1721,19 +1653,14 @@ int -AllocColorPlanes (client, pmap, colors, r, g, b, contig, pixels, - prmask, pgmask, pbmask) - int client; - ColormapPtr pmap; - int colors, r, g, b; - Bool contig; - Pixel *pixels; - Pixel *prmask, *pgmask, *pbmask; +AllocColorPlanes(int client, ColormapPtr pmap, int colors, int r, int g, int b, + Bool contig, Pixel *pixels, Pixel *prmask, Pixel *pgmask, + Pixel *pbmask) { int ok; Pixel mask, *ppixFirst; - register Pixel shift; - register int i; + Pixel shift; + int i; int class; int oldcount; colorResource *pcr = (colorResource *)NULL; @@ -1816,13 +1743,9 @@ } static int -AllocDirect (client, pmap, c, r, g, b, contig, pixels, prmask, pgmask, pbmask) - int client; - ColormapPtr pmap; - int c, r, g, b; - Bool contig; - Pixel *pixels; - Pixel *prmask, *pgmask, *pbmask; +AllocDirect(int client, ColormapPtr pmap, int c, int r, int g, int b, + Bool contig, Pixel *pixels, Pixel *prmask, Pixel *pgmask, + Pixel *pbmask) { Pixel *ppixRed, *ppixGreen, *ppixBlue; Pixel *ppix, *pDst, *p; @@ -1936,14 +1859,8 @@ } static int -AllocPseudo (client, pmap, c, r, contig, pixels, pmask, pppixFirst) - int client; - ColormapPtr pmap; - int c, r; - Bool contig; - Pixel *pixels; - Pixel *pmask; - Pixel **pppixFirst; +AllocPseudo(int client, ColormapPtr pmap, int c, int r, Bool contig, + Pixel *pixels, Pixel *pmask, Pixel **pppixFirst) { Pixel *ppix, *p, *pDst, *ppixTemp; int npix; @@ -1997,13 +1914,8 @@ * (see AllocShared for why we care) */ static Bool -AllocCP (pmap, pentFirst, count, planes, contig, pixels, pMask) - ColormapPtr pmap; - EntryPtr pentFirst; - int count, planes; - Bool contig; - Pixel *pixels, *pMask; - +AllocCP(ColormapPtr pmap, EntryPtr pentFirst, int count, int planes, + Bool contig, Pixel *pixels, Pixel *pMask) { EntryPtr ent; Pixel pixel, base, entries, maxp, save; @@ -2173,12 +2085,8 @@ } static Bool -AllocShared (pmap, ppix, c, r, g, b, rmask, gmask, bmask, ppixFirst) - ColormapPtr pmap; - Pixel *ppix; - int c, r, g, b; - Pixel rmask, gmask, bmask; - Pixel *ppixFirst; /* First of the client's new pixels */ +AllocShared(ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b, + Pixel rmask, Pixel gmask, Pixel bmask, Pixel *ppixFirst) { Pixel *pptr, *cptr; int npix, z, npixClientNew, npixShared; @@ -2310,11 +2218,7 @@ /* Free colors and/or cells (probably slow for large numbers) */ int -FreeColors (pmap, client, count, pixels, mask) - ColormapPtr pmap; - int client, count; - Pixel *pixels; - Pixel mask; +FreeColors(ColormapPtr pmap, int client, int count, Pixel *pixels, Pixel mask) { int rval, result, class; Pixel rmask; @@ -2356,13 +2260,13 @@ * which the client has allocated in channel colormap cells of pmap. * doesn't change newpixels if it doesn't need to */ static int -FreeCo (pmap, client, color, npixIn, ppixIn, mask) - ColormapPtr pmap; /* which colormap head */ - int client; - int color; /* which sub-map, eg RED, BLUE, PSEUDO */ - int npixIn; /* number of pixels passed in */ - Pixel *ppixIn; /* list of base pixels */ - Pixel mask; /* mask client gave us */ +FreeCo( + ColormapPtr pmap, /* which colormap head */ + int client, + int color, /* which sub-map, eg RED, BLUE, PSEUDO */ + int npixIn, /* number of pixels passed in */ + Pixel *ppixIn, /* list of base pixels */ + Pixel mask) /* mask client gave us */ { Pixel *ppixClient, pixTest; @@ -2557,15 +2461,12 @@ /* Redefine color values */ int -StoreColors (pmap, count, defs) - ColormapPtr pmap; - int count; - xColorItem *defs; +StoreColors(ColormapPtr pmap, int count, xColorItem *defs) { - register Pixel pix; - register xColorItem *pdef; - register EntryPtr pent, pentT, pentLast; - register VisualPtr pVisual; + Pixel pix; + xColorItem *pdef; + EntryPtr pent, pentT, pentLast; + VisualPtr pVisual; SHAREDCOLOR *pred, *pgreen, *pblue; int n, ChgRed, ChgGreen, ChgBlue, idef; int class, errVal = Success; @@ -2827,9 +2728,7 @@ } int -IsMapInstalled(map, pWin) - Colormap map; - WindowPtr pWin; +IsMapInstalled(Colormap map, WindowPtr pWin) { Colormap *pmaps; int imap, nummaps, found; Index: xc/programs/Xserver/dix/cursor.c diff -u xc/programs/Xserver/dix/cursor.c:3.9 xc/programs/Xserver/dix/cursor.c:3.11 --- xc/programs/Xserver/dix/cursor.c:3.9 Mon Nov 17 17:20:33 2003 +++ xc/programs/Xserver/dix/cursor.c Fri Oct 14 11:16:21 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/cursor.c,v 3.9 2003/11/17 22:20:33 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/cursor.c,v 3.11 2005/10/14 15:16:21 tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -46,11 +46,8 @@ ******************************************************************/ - -/* $Xorg: cursor.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ - -#include "X.h" -#include "Xmd.h" +#include +#include #include "servermd.h" #include "scrnintstr.h" #include "dixstruct.h" @@ -80,7 +77,7 @@ #endif if (bits->refcnt == 0) { - register GlyphSharePtr *prev, this; + GlyphSharePtr *prev, this; for (prev = &sharedGlyphs; (this = *prev) && (this->bits != bits); @@ -101,9 +98,7 @@ */ /*ARGSUSED*/ int -FreeCursor(value, cid) - pointer value; /* must conform to DeleteType */ - XID cid; +FreeCursor(pointer value, XID cid) { int nscr; CursorPtr pCurs = (CursorPtr)value; @@ -130,7 +125,7 @@ static void CheckForEmptyMask(CursorBitsPtr bits) { - register unsigned char *msk = bits->mask; + unsigned char *msk = bits->mask; int n = BitmapBytePad(bits->width) * bits->height; bits->emptyMask = FALSE; @@ -153,14 +148,10 @@ * does not copy the src and mask bits */ CursorPtr -AllocCursorARGB(psrcbits, pmaskbits, argb, cm, - foreRed, foreGreen, foreBlue, backRed, backGreen, backBlue) - unsigned char * psrcbits; /* server-defined padding */ - unsigned char * pmaskbits; /* server-defined padding */ - CARD32 * argb; /* no padding */ - CursorMetricPtr cm; - unsigned foreRed, foreGreen, foreBlue; - unsigned backRed, backGreen, backBlue; +AllocCursorARGB(unsigned char *psrcbits, unsigned char *pmaskbits, + CARD32 *argb, CursorMetricPtr cm, + unsigned foreRed, unsigned foreGreen, unsigned foreBlue, + unsigned backRed, unsigned backGreen, unsigned backBlue) { CursorBitsPtr bits; CursorPtr pCurs; @@ -220,13 +211,10 @@ } CursorPtr -AllocCursor(psrcbits, pmaskbits, cm, - foreRed, foreGreen, foreBlue, backRed, backGreen, backBlue) - unsigned char * psrcbits; /* server-defined padding */ - unsigned char * pmaskbits; /* server-defined padding */ - CursorMetricPtr cm; - unsigned foreRed, foreGreen, foreBlue; - unsigned backRed, backGreen, backBlue; +AllocCursor(unsigned char *psrcbits, unsigned char *pmaskbits, + CursorMetricPtr cm, + unsigned foreRed, unsigned foreGreen, unsigned foreBlue, + unsigned backRed, unsigned backGreen, unsigned backBlue) { return AllocCursorARGB (psrcbits, pmaskbits, (CARD32 *) 0, cm, foreRed, foreGreen, foreBlue, @@ -234,15 +222,11 @@ } int -AllocGlyphCursor(source, sourceChar, mask, maskChar, - foreRed, foreGreen, foreBlue, backRed, backGreen, backBlue, - ppCurs, client) - Font source, mask; - unsigned int sourceChar, maskChar; - unsigned foreRed, foreGreen, foreBlue; - unsigned backRed, backGreen, backBlue; - CursorPtr *ppCurs; - ClientPtr client; +AllocGlyphCursor(Font source, unsigned int sourceChar, + Font mask, unsigned int maskChar, + unsigned foreRed, unsigned foreGreen, unsigned foreBlue, + unsigned backRed, unsigned backGreen, unsigned backBlue, + CursorPtr *ppCurs, ClientPtr client) { FontPtr sourcefont, maskfont; unsigned char *srcbits; @@ -299,8 +283,8 @@ } if (!maskfont) { - register long n; - register unsigned char *mskptr; + long n; + unsigned char *mskptr; n = BitmapBytePad(cm.width)*(long)cm.height; mskptr = mskbits = (unsigned char *)xalloc(n); @@ -421,9 +405,7 @@ *************************************************************/ CursorPtr -CreateRootCursor(pfilename, glyph) - char * pfilename; - unsigned int glyph; +CreateRootCursor(char *pfilename, unsigned int glyph) { CursorPtr curs; FontPtr cursorfont; Index: xc/programs/Xserver/dix/devices.c diff -u xc/programs/Xserver/dix/devices.c:3.21 xc/programs/Xserver/dix/devices.c:3.23 --- xc/programs/Xserver/dix/devices.c:3.21 Mon Nov 17 17:20:33 2003 +++ xc/programs/Xserver/dix/devices.c Fri Oct 14 11:16:21 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/devices.c,v 3.21 2003/11/17 22:20:33 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/devices.c,v 3.23 2005/10/14 15:16:21 tsi Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -46,15 +46,12 @@ ********************************************************/ - -/* $Xorg: devices.c,v 1.4 2001/02/09 02:04:39 xorgcvs Exp $ */ - -#include "X.h" +#include #include "misc.h" #include "resource.h" #define NEED_EVENTS #define NEED_REPLIES -#include "Xproto.h" +#include #include "windowstr.h" #include "inputstr.h" #include "scrnintstr.h" @@ -63,11 +60,11 @@ #include "site.h" #define XKB_IN_SERVER #ifdef XKB -#include "XKBsrv.h" +#include #endif #ifdef XCSECURITY #define _SECURITY_SERVER -#include "security.h" +#include #endif #ifdef LBX #include "lbxserve.h" @@ -78,11 +75,9 @@ #include "dixevents.h" DeviceIntPtr -_AddInputDevice(deviceProc, autoStart) - DeviceProc deviceProc; - Bool autoStart; +_AddInputDevice(DeviceProc deviceProc, Bool autoStart) { - register DeviceIntPtr dev; + DeviceIntPtr dev; if (inputInfo.numDevices >= MAX_DEVICES) return (DeviceIntPtr)NULL; @@ -127,10 +122,9 @@ } Bool -EnableDevice(dev) - register DeviceIntPtr dev; +EnableDevice(DeviceIntPtr dev) { - register DeviceIntPtr *prev; + DeviceIntPtr *prev; for (prev = &inputInfo.off_devices; *prev && (*prev != dev); @@ -146,10 +140,9 @@ } Bool -DisableDevice(dev) - register DeviceIntPtr dev; +DisableDevice(DeviceIntPtr dev) { - register DeviceIntPtr *prev; + DeviceIntPtr *prev; for (prev = &inputInfo.devices; *prev && (*prev != dev); @@ -167,7 +160,7 @@ int InitAndStartDevices() { - register DeviceIntPtr dev, next; + DeviceIntPtr dev, next; for (dev = inputInfo.off_devices; dev; dev = dev->next) dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success); @@ -197,7 +190,7 @@ } static void -CloseDevice(register DeviceIntPtr dev) +CloseDevice(DeviceIntPtr dev) { KbdFeedbackPtr k, knext; PtrFeedbackPtr p, pnext; @@ -283,7 +276,7 @@ void CloseDownDevices() { - register DeviceIntPtr dev, next; + DeviceIntPtr dev, next; for (dev = inputInfo.devices; dev; dev = next) { @@ -302,10 +295,9 @@ } void -RemoveDevice(dev) - register DeviceIntPtr dev; +RemoveDevice(DeviceIntPtr dev) { - register DeviceIntPtr prev,tmp,next; + DeviceIntPtr prev,tmp,next; prev= NULL; for (tmp= inputInfo.devices; tmp; (prev = tmp), (tmp = next)) { @@ -353,8 +345,7 @@ } void -_RegisterPointerDevice(device) - DeviceIntPtr device; +_RegisterPointerDevice(DeviceIntPtr device) { inputInfo.pointer = device; #ifdef XKB @@ -380,8 +371,7 @@ } void -_RegisterKeyboardDevice(device) - DeviceIntPtr device; +_RegisterKeyboardDevice(DeviceIntPtr device) { inputInfo.keyboard = device; #ifdef XKB @@ -419,8 +409,7 @@ } DevicePtr -LookupDevice(id) - int id; +LookupDevice(int id) { DeviceIntPtr dev; @@ -436,8 +425,7 @@ } void -QueryMinMaxKeyCodes(minCode, maxCode) - KeyCode *minCode, *maxCode; +QueryMinMaxKeyCodes(KeyCode *minCode, KeyCode *maxCode) { if (inputInfo.keyboard) { *minCode = inputInfo.keyboard->key->curKeySyms.minKeyCode; @@ -446,8 +434,7 @@ } Bool -SetKeySymsMap(dst, src) - register KeySymsPtr dst, src; +SetKeySymsMap(KeySymsPtr dst, KeySymsPtr src) { int i, j; int rowDif = src->minKeyCode - dst->minKeyCode; @@ -496,7 +483,7 @@ } static Bool -InitModMap(register KeyClassPtr keyc) +InitModMap(KeyClassPtr keyc) { int i, j; CARD8 keysPerModifier[8]; @@ -538,13 +525,11 @@ } Bool -InitKeyClassDeviceStruct(dev, pKeySyms, pModifiers) - DeviceIntPtr dev; - KeySymsPtr pKeySyms; - CARD8 pModifiers[]; +InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, + CARD8 pModifiers[]) { int i; - register KeyClassPtr keyc; + KeyClassPtr keyc; keyc = (KeyClassPtr)xalloc(sizeof(KeyClassRec)); if (!keyc) @@ -579,12 +564,9 @@ } Bool -InitButtonClassDeviceStruct(dev, numButtons, map) - register DeviceIntPtr dev; - int numButtons; - CARD8 *map; +InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, CARD8 *map) { - register ButtonClassPtr butc; + ButtonClassPtr butc; int i; butc = (ButtonClassPtr)xalloc(sizeof(ButtonClassRec)); @@ -605,15 +587,12 @@ } Bool -InitValuatorClassDeviceStruct(dev, numAxes, motionProc, numMotionEvents, mode) - DeviceIntPtr dev; - ValuatorMotionProcPtr motionProc; - int numAxes; - int numMotionEvents; - int mode; +InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, + ValuatorMotionProcPtr motionProc, + int numMotionEvents, int mode) { int i; - register ValuatorClassPtr valc; + ValuatorClassPtr valc; valc = (ValuatorClassPtr)xalloc(sizeof(ValuatorClassRec) + numAxes * sizeof(AxisInfo) + @@ -634,10 +613,9 @@ } Bool -InitFocusClassDeviceStruct(dev) - DeviceIntPtr dev; +InitFocusClassDeviceStruct(DeviceIntPtr dev) { - register FocusClassPtr focc; + FocusClassPtr focc; focc = (FocusClassPtr)xalloc(sizeof(FocusClassRec)); if (!focc) @@ -653,12 +631,10 @@ } Bool -InitKbdFeedbackClassDeviceStruct(dev, bellProc, controlProc) - DeviceIntPtr dev; - BellProcPtr bellProc; - KbdCtrlProcPtr controlProc; +InitKbdFeedbackClassDeviceStruct(DeviceIntPtr dev, BellProcPtr bellProc, + KbdCtrlProcPtr controlProc) { - register KbdFeedbackPtr feedc; + KbdFeedbackPtr feedc; feedc = (KbdFeedbackPtr)xalloc(sizeof(KbdFeedbackClassRec)); if (!feedc) @@ -683,11 +659,9 @@ } Bool -InitPtrFeedbackClassDeviceStruct(dev, controlProc) - DeviceIntPtr dev; - PtrCtrlProcPtr controlProc; +InitPtrFeedbackClassDeviceStruct(DeviceIntPtr dev, PtrCtrlProcPtr controlProc) { - register PtrFeedbackPtr feedc; + PtrFeedbackPtr feedc; feedc = (PtrFeedbackPtr)xalloc(sizeof(PtrFeedbackClassRec)); if (!feedc) @@ -726,16 +700,14 @@ 0}; Bool -InitStringFeedbackClassDeviceStruct (dev, controlProc, max_symbols, - num_symbols_supported, symbols) - DeviceIntPtr dev; - StringCtrlProcPtr controlProc; - int max_symbols; - int num_symbols_supported; - KeySym *symbols; +InitStringFeedbackClassDeviceStruct(DeviceIntPtr dev, + StringCtrlProcPtr controlProc, + int max_symbols, + int num_symbols_supported, + KeySym *symbols) { int i; - register StringFeedbackPtr feedc; + StringFeedbackPtr feedc; feedc = (StringFeedbackPtr)xalloc(sizeof(StringFeedbackClassRec)); if (!feedc) @@ -770,12 +742,10 @@ } Bool -InitBellFeedbackClassDeviceStruct (dev, bellProc, controlProc) - DeviceIntPtr dev; - BellProcPtr bellProc; - BellCtrlProcPtr controlProc; +InitBellFeedbackClassDeviceStruct(DeviceIntPtr dev, BellProcPtr bellProc, + BellCtrlProcPtr controlProc) { - register BellFeedbackPtr feedc; + BellFeedbackPtr feedc; feedc = (BellFeedbackPtr)xalloc(sizeof(BellFeedbackClassRec)); if (!feedc) @@ -792,11 +762,9 @@ } Bool -InitLedFeedbackClassDeviceStruct (dev, controlProc) - DeviceIntPtr dev; - LedCtrlProcPtr controlProc; +InitLedFeedbackClassDeviceStruct(DeviceIntPtr dev, LedCtrlProcPtr controlProc) { - register LedFeedbackPtr feedc; + LedFeedbackPtr feedc; feedc = (LedFeedbackPtr)xalloc(sizeof(LedFeedbackClassRec)); if (!feedc) @@ -815,11 +783,10 @@ } Bool -InitIntegerFeedbackClassDeviceStruct (dev, controlProc) - DeviceIntPtr dev; - IntegerCtrlProcPtr controlProc; +InitIntegerFeedbackClassDeviceStruct(DeviceIntPtr dev, + IntegerCtrlProcPtr controlProc) { - register IntegerFeedbackPtr feedc; + IntegerFeedbackPtr feedc; feedc = (IntegerFeedbackPtr)xalloc(sizeof(IntegerFeedbackClassRec)); if (!feedc) @@ -835,14 +802,9 @@ } Bool -InitPointerDeviceStruct(device, map, numButtons, motionProc, controlProc, - numMotionEvents) - DevicePtr device; - CARD8 *map; - int numButtons; - PtrCtrlProcPtr controlProc; - ValuatorMotionProcPtr motionProc; - int numMotionEvents; +InitPointerDeviceStruct(DevicePtr device, CARD8 *map, int numButtons, + ValuatorMotionProcPtr motionProc, + PtrCtrlProcPtr controlProc, int numMotionEvents) { DeviceIntPtr dev = (DeviceIntPtr)device; @@ -853,12 +815,9 @@ } Bool -InitKeyboardDeviceStruct(device, pKeySyms, pModifiers, bellProc, controlProc) - DevicePtr device; - KeySymsPtr pKeySyms; - CARD8 pModifiers[]; - BellProcPtr bellProc; - KbdCtrlProcPtr controlProc; +InitKeyboardDeviceStruct(DevicePtr device, KeySymsPtr pKeySyms, + CARD8 pModifiers[], BellProcPtr bellProc, + KbdCtrlProcPtr controlProc) { DeviceIntPtr dev = (DeviceIntPtr)device; @@ -868,10 +827,8 @@ } void -SendMappingNotify(request, firstKeyCode, count, client) - unsigned int request, count; - unsigned int firstKeyCode; - ClientPtr client; +SendMappingNotify(unsigned int request, unsigned int firstKeyCode, + unsigned int count, ClientPtr client) { int i; xEvent event; @@ -914,13 +871,9 @@ * sort it to do the checking. How often is it called? Just being lazy? */ Bool -BadDeviceMap(buff, length, low, high, errval) - register BYTE *buff; - int length; - unsigned low, high; - XID *errval; +BadDeviceMap(BYTE *buff, int length, unsigned low, unsigned high, XID *errval) { - register int i, j; + int i, j; for (i = 0; i < length; i++) if (buff[i]) /* only check non-zero elements */ @@ -941,13 +894,11 @@ } Bool -AllModifierKeysAreUp(dev, map1, per1, map2, per2) - register DeviceIntPtr dev; - register CARD8 *map1, *map2; - int per1, per2; +AllModifierKeysAreUp(DeviceIntPtr dev, CARD8 *map1, int per1, + CARD8 *map2, int per2) { - register int i, j, k; - register CARD8 *down = dev->key->down; + int i, j, k; + CARD8 *down = dev->key->down; for (i = 8; --i >= 0; map2 += per2) { @@ -966,16 +917,15 @@ } int -ProcSetModifierMapping(client) - ClientPtr client; +ProcSetModifierMapping(ClientPtr client) { xSetModifierMappingReply rep; REQUEST(xSetModifierMappingReq); KeyCode *inputMap; int inputMapLen; - register int i; + int i; DeviceIntPtr keybd = inputInfo.keyboard; - register KeyClassPtr keyc = keybd->key; + KeyClassPtr keyc = keybd->key; REQUEST_AT_LEAST_SIZE(xSetModifierMappingReq); @@ -1078,11 +1028,10 @@ } int -ProcGetModifierMapping(client) - ClientPtr client; +ProcGetModifierMapping(ClientPtr client) { xGetModifierMappingReply rep; - register KeyClassPtr keyc = inputInfo.keyboard->key; + KeyClassPtr keyc = inputInfo.keyboard->key; REQUEST_SIZE_MATCH(xReq); rep.type = X_Reply; @@ -1100,13 +1049,12 @@ } int -ProcChangeKeyboardMapping(client) - ClientPtr client; +ProcChangeKeyboardMapping(ClientPtr client) { REQUEST(xChangeKeyboardMappingReq); unsigned len; KeySymsRec keysyms; - register KeySymsPtr curKeySyms = &inputInfo.keyboard->key->curKeySyms; + KeySymsPtr curKeySyms = &inputInfo.keyboard->key->curKeySyms; REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq); len = client->req_len - (sizeof(xChangeKeyboardMappingReq) >> 2); @@ -1146,13 +1094,12 @@ } int -ProcSetPointerMapping(client) - ClientPtr client; +ProcSetPointerMapping(ClientPtr client) { REQUEST(xSetPointerMappingReq); BYTE *map; xSetPointerMappingReply rep; - register unsigned int i; + unsigned int i; DeviceIntPtr mouse = inputInfo.pointer; REQUEST_AT_LEAST_SIZE(xSetPointerMappingReq); @@ -1186,8 +1133,7 @@ } int -ProcGetKeyboardMapping(client) - ClientPtr client; +ProcGetKeyboardMapping(ClientPtr client) { xGetKeyboardMappingReply rep; REQUEST(xGetKeyboardMappingReq); @@ -1225,8 +1171,7 @@ } int -ProcGetPointerMapping(client) - ClientPtr client; +ProcGetPointerMapping(ClientPtr client) { xGetPointerMappingReply rep; ButtonClassPtr butc = inputInfo.pointer->button; @@ -1242,10 +1187,7 @@ } void -NoteLedState(keybd, led, on) - DeviceIntPtr keybd; - int led; - Bool on; +NoteLedState(DeviceIntPtr keybd, int led, Bool on) { KeybdCtrl *ctrl = &keybd->kbdfeed->ctrl; if (on) @@ -1255,10 +1197,9 @@ } int -Ones(mask) /* HACKMEM 169 */ - unsigned long mask; +Ones(unsigned long mask) /* HACKMEM 169 */ { - register unsigned long y; + unsigned long y; y = (mask >> 1) &033333333333; y = mask - y - ((y >>1) & 033333333333); @@ -1266,8 +1207,7 @@ } int -ProcChangeKeyboardControl (client) - ClientPtr client; +ProcChangeKeyboardControl(ClientPtr client) { #define DO_ALL (-1) KeybdCtrl ctrl; @@ -1457,11 +1397,10 @@ } int -ProcGetKeyboardControl (client) - ClientPtr client; +ProcGetKeyboardControl(ClientPtr client) { int i; - register KeybdCtrl *ctrl = &inputInfo.keyboard->kbdfeed->ctrl; + KeybdCtrl *ctrl = &inputInfo.keyboard->kbdfeed->ctrl; xGetKeyboardControlReply rep; REQUEST_SIZE_MATCH(xReq); @@ -1481,10 +1420,9 @@ } int -ProcBell(client) - ClientPtr client; +ProcBell(ClientPtr client) { - register DeviceIntPtr keybd = inputInfo.keyboard; + DeviceIntPtr keybd = inputInfo.keyboard; int base = keybd->kbdfeed->ctrl.bell; int newpercent; REQUEST(xBellReq); @@ -1511,8 +1449,7 @@ } int -ProcChangePointerControl(client) - ClientPtr client; +ProcChangePointerControl(ClientPtr client) { DeviceIntPtr mouse = inputInfo.pointer; PtrCtrl ctrl; /* might get BadValue part way through */ @@ -1566,10 +1503,9 @@ } int -ProcGetPointerControl(client) - ClientPtr client; +ProcGetPointerControl(ClientPtr client) { - register PtrCtrl *ctrl = &inputInfo.pointer->ptrfeed->ctrl; + PtrCtrl *ctrl = &inputInfo.pointer->ptrfeed->ctrl; xGetPointerControlReply rep; REQUEST_SIZE_MATCH(xReq); @@ -1584,9 +1520,7 @@ } void -MaybeStopHint(dev, client) - register DeviceIntPtr dev; - ClientPtr client; +MaybeStopHint(DeviceIntPtr dev, ClientPtr client) { GrabPtr grab = dev->grab; @@ -1602,8 +1536,7 @@ } int -ProcGetMotionEvents(client) - ClientPtr client; +ProcGetMotionEvents(ClientPtr client) { WindowPtr pWin; xTimecoord * coords = (xTimecoord *) NULL; @@ -1670,8 +1603,7 @@ } int -ProcQueryKeymap(client) - ClientPtr client; +ProcQueryKeymap(ClientPtr client) { xQueryKeymapReply rep; int i; @@ -1703,9 +1635,7 @@ #undef AddInputDevice DevicePtr -AddInputDevice( - DeviceProc deviceProc, - Bool autoStart) +AddInputDevice(DeviceProc deviceProc, Bool autoStart) { return (DevicePtr)_AddInputDevice(deviceProc, autoStart); } Index: xc/programs/Xserver/dix/dispatch.c diff -u xc/programs/Xserver/dix/dispatch.c:3.34 xc/programs/Xserver/dix/dispatch.c:3.36 --- xc/programs/Xserver/dix/dispatch.c:3.34 Wed Jun 23 15:40:15 2004 +++ xc/programs/Xserver/dix/dispatch.c Fri Oct 14 11:16:21 2005 @@ -1,4 +1,3 @@ -/* $Xorg: dispatch.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ /************************************************************ Copyright 1987, 1989, 1998 The Open Group @@ -68,7 +67,7 @@ * * *****************************************************************/ -/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.34 2004/06/23 19:40:15 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/dispatch.c,v 3.36 2005/10/14 15:16:21 tsi Exp $ */ #ifdef PANORAMIX_DEBUG #include @@ -76,7 +75,7 @@ #endif #include "windowstr.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" #include "gcstruct.h" #include "selection.h" @@ -97,15 +96,15 @@ #endif #ifdef XCSECURITY #define _SECURITY_SERVER -#include "security.h" +#include #endif #ifdef XAPPGROUP -#include "Xagsrv.h" +#include #endif #ifdef XKB #define XKB_IN_SERVER #include "inputstr.h" -#include "XKBsrv.h" +#include #endif #ifdef LBX #include "lbxserve.h" @@ -162,8 +161,7 @@ (a.pScreen == b.pScreen)) void -SetInputCheck(c0, c1) - HWEventQueuePtr c0, c1; +SetInputCheck(HWEventQueuePtr c0, HWEventQueuePtr c1) { checkForInput[0] = c0; checkForInput[1] = c1; @@ -211,11 +209,10 @@ } void -FlushClientCaches(id) - XID id; +FlushClientCaches(XID id) { int i; - register ClientPtr client; + ClientPtr client; client = clients[CLIENT_ID(id)]; if (client == NullClient) @@ -262,7 +259,7 @@ void InitProcVectors(void); int -SmartScheduleClient (int *clientReady, int nready) +SmartScheduleClient(int *clientReady, int nready) { ClientPtr pClient; int i; @@ -347,11 +344,11 @@ void Dispatch(void) { - register int *clientReady; /* array of request ready clients */ - register int result; - register ClientPtr client; - register int nready; - register HWEventQueuePtr* icheck = checkForInput; + int *clientReady; /* array of request ready clients */ + int result; + ClientPtr client; + int nready; + HWEventQueuePtr* icheck = checkForInput; #ifdef SMART_SCHEDULE int start_tick; #endif @@ -475,17 +472,15 @@ /*ARGSUSED*/ int -ProcBadRequest(client) - ClientPtr client; +ProcBadRequest(ClientPtr client) { return (BadRequest); } int -ProcCreateWindow(client) - register ClientPtr client; +ProcCreateWindow(ClientPtr client) { - register WindowPtr pParent, pWin; + WindowPtr pParent, pWin; REQUEST(xCreateWindowReq); int result; int len; @@ -526,12 +521,11 @@ } int -ProcChangeWindowAttributes(client) - register ClientPtr client; +ProcChangeWindowAttributes(ClientPtr client) { - register WindowPtr pWin; + WindowPtr pWin; REQUEST(xChangeWindowAttributesReq); - register int result; + int result; int len; REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); @@ -553,10 +547,9 @@ } int -ProcGetWindowAttributes(client) - register ClientPtr client; +ProcGetWindowAttributes(ClientPtr client) { - register WindowPtr pWin; + WindowPtr pWin; REQUEST(xResourceReq); xGetWindowAttributesReply wa; @@ -571,10 +564,9 @@ } int -ProcDestroyWindow(client) - register ClientPtr client; +ProcDestroyWindow(ClientPtr client) { - register WindowPtr pWin; + WindowPtr pWin; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); @@ -588,10 +580,9 @@ } int -ProcDestroySubwindows(client) - register ClientPtr client; +ProcDestroySubwindows(ClientPtr client) { - register WindowPtr pWin; + WindowPtr pWin; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); @@ -604,12 +595,11 @@ } int -ProcChangeSaveSet(client) - register ClientPtr client; +ProcChangeSaveSet(ClientPtr client) { - register WindowPtr pWin; + WindowPtr pWin; REQUEST(xChangeSaveSetReq); - register int result; + int result; REQUEST_SIZE_MATCH(xChangeSaveSetReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, @@ -634,12 +624,11 @@ } int -ProcReparentWindow(client) - register ClientPtr client; +ProcReparentWindow(ClientPtr client) { - register WindowPtr pWin, pParent; + WindowPtr pWin, pParent; REQUEST(xReparentWindowReq); - register int result; + int result; REQUEST_SIZE_MATCH(xReparentWindowReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, @@ -670,10 +659,9 @@ } int -ProcMapWindow(client) - register ClientPtr client; +ProcMapWindow(ClientPtr client) { - register WindowPtr pWin; + WindowPtr pWin; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); @@ -687,10 +675,9 @@ } int -ProcMapSubwindows(client) - register ClientPtr client; +ProcMapSubwindows(ClientPtr client) { - register WindowPtr pWin; + WindowPtr pWin; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); @@ -704,10 +691,9 @@ } int -ProcUnmapWindow(client) - register ClientPtr client; +ProcUnmapWindow(ClientPtr client) { - register WindowPtr pWin; + WindowPtr pWin; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); @@ -721,10 +707,9 @@ } int -ProcUnmapSubwindows(client) - register ClientPtr client; +ProcUnmapSubwindows(ClientPtr client) { - register WindowPtr pWin; + WindowPtr pWin; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); @@ -737,12 +722,11 @@ } int -ProcConfigureWindow(client) - register ClientPtr client; +ProcConfigureWindow(ClientPtr client) { - register WindowPtr pWin; + WindowPtr pWin; REQUEST(xConfigureWindowReq); - register int result; + int result; int len; REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); @@ -762,10 +746,9 @@ } int -ProcCirculateWindow(client) - register ClientPtr client; +ProcCirculateWindow(ClientPtr client) { - register WindowPtr pWin; + WindowPtr pWin; REQUEST(xCirculateWindowReq); REQUEST_SIZE_MATCH(xCirculateWindowReq); @@ -784,11 +767,9 @@ } int -GetGeometry(client, rep) - register ClientPtr client; - xGetGeometryReply *rep; +GetGeometry(ClientPtr client, xGetGeometryReply *rep) { - register DrawablePtr pDraw; + DrawablePtr pDraw; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); @@ -812,7 +793,7 @@ if ((pDraw->type == UNDRAWABLE_WINDOW) || ((pDraw->type == DRAWABLE_WINDOW) && (stuff->id == pDraw->id))) { - register WindowPtr pWin = (WindowPtr)pDraw; + WindowPtr pWin = (WindowPtr)pDraw; rep->x = pWin->origin.x - wBorderWidth (pWin); rep->y = pWin->origin.y - wBorderWidth (pWin); rep->borderWidth = pWin->borderWidth; @@ -827,8 +808,7 @@ int -ProcGetGeometry(client) - register ClientPtr client; +ProcGetGeometry(ClientPtr client) { xGetGeometryReply rep; int status; @@ -842,12 +822,11 @@ int -ProcQueryTree(client) - register ClientPtr client; +ProcQueryTree(ClientPtr client) { xQueryTreeReply reply; int numChildren = 0; - register WindowPtr pChild, pWin, pHead; + WindowPtr pChild, pWin, pHead; Window *childIDs = (Window *)NULL; REQUEST(xResourceReq); @@ -892,8 +871,7 @@ } int -ProcInternAtom(client) - register ClientPtr client; +ProcInternAtom(ClientPtr client) { Atom atom; char *tchar; @@ -922,8 +900,7 @@ } int -ProcGetAtomName(client) - register ClientPtr client; +ProcGetAtomName(ClientPtr client) { char *str; xGetAtomNameReply reply; @@ -954,8 +931,7 @@ #endif int -ProcSetSelectionOwner(client) - register ClientPtr client; +ProcSetSelectionOwner(ClientPtr client) { WindowPtr pWin; TimeStamp time; @@ -1043,8 +1019,7 @@ } int -ProcGetSelectionOwner(client) - register ClientPtr client; +ProcGetSelectionOwner(ClientPtr client) { REQUEST(xResourceReq); @@ -1075,8 +1050,7 @@ } int -ProcConvertSelection(client) - register ClientPtr client; +ProcConvertSelection(ClientPtr client) { Bool paramsOkay; xEvent event; @@ -1140,8 +1114,7 @@ } int -ProcGrabServer(client) - register ClientPtr client; +ProcGrabServer(ClientPtr client) { REQUEST_SIZE_MATCH(xReq); if (grabState != GrabNone && client != grabClient) @@ -1195,8 +1168,7 @@ } int -ProcUngrabServer(client) - register ClientPtr client; +ProcUngrabServer(ClientPtr client) { REQUEST_SIZE_MATCH(xReq); UngrabServer(client); @@ -1204,12 +1176,11 @@ } int -ProcTranslateCoords(client) - register ClientPtr client; +ProcTranslateCoords(ClientPtr client) { REQUEST(xTranslateCoordsReq); - register WindowPtr pWin, pDst; + WindowPtr pWin, pDst; xTranslateCoordsReply rep; REQUEST_SIZE_MATCH(xTranslateCoordsReq); @@ -1277,8 +1248,7 @@ } int -ProcOpenFont(client) - register ClientPtr client; +ProcOpenFont(ClientPtr client) { int err; REQUEST(xOpenFontReq); @@ -1297,8 +1267,7 @@ } int -ProcCloseFont(client) - register ClientPtr client; +ProcCloseFont(ClientPtr client) { FontPtr pFont; REQUEST(xResourceReq); @@ -1319,12 +1288,11 @@ } int -ProcQueryFont(client) - register ClientPtr client; +ProcQueryFont(ClientPtr client) { xQueryFontReply *reply; FontPtr pFont; - register GC *pGC; + GC *pGC; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); @@ -1379,8 +1347,7 @@ } int -ProcQueryTextExtents(client) - register ClientPtr client; +ProcQueryTextExtents(ClientPtr client) { REQUEST(xQueryTextExtentsReq); xQueryTextExtentsReply reply; @@ -1430,8 +1397,7 @@ } int -ProcListFonts(client) - register ClientPtr client; +ProcListFonts(ClientPtr client) { REQUEST(xListFontsReq); @@ -1442,8 +1408,7 @@ } int -ProcListFontsWithInfo(client) - register ClientPtr client; +ProcListFontsWithInfo(ClientPtr client) { REQUEST(xListFontsWithInfoReq); @@ -1455,23 +1420,20 @@ /*ARGSUSED*/ int -dixDestroyPixmap(value, pid) - pointer value; /* must conform to DeleteType */ - XID pid; +dixDestroyPixmap(pointer value, XID pid) { PixmapPtr pPixmap = (PixmapPtr)value; return (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap); } int -ProcCreatePixmap(client) - register ClientPtr client; +ProcCreatePixmap(ClientPtr client) { PixmapPtr pMap; - register DrawablePtr pDraw; + DrawablePtr pDraw; REQUEST(xCreatePixmapReq); DepthPtr pDepth; - register int i; + int i; REQUEST_SIZE_MATCH(xCreatePixmapReq); client->errorValue = stuff->pid; @@ -1507,8 +1469,7 @@ } int -ProcFreePixmap(client) - register ClientPtr client; +ProcFreePixmap(ClientPtr client) { PixmapPtr pMap; @@ -1530,12 +1491,11 @@ } int -ProcCreateGC(client) - register ClientPtr client; +ProcCreateGC(ClientPtr client) { int error; GC *pGC; - register DrawablePtr pDraw; + DrawablePtr pDraw; unsigned len; REQUEST(xCreateGCReq); @@ -1557,8 +1517,7 @@ } int -ProcChangeGC(client) - register ClientPtr client; +ProcChangeGC(ClientPtr client) { GC *pGC; REQUEST(xChangeGCReq); @@ -1582,11 +1541,10 @@ } int -ProcCopyGC(client) - register ClientPtr client; +ProcCopyGC(ClientPtr client) { - register GC *dstGC; - register GC *pGC; + GC *dstGC; + GC *pGC; int result; REQUEST(xCopyGCReq); @@ -1606,10 +1564,9 @@ } int -ProcSetDashes(client) - register ClientPtr client; +ProcSetDashes(ClientPtr client) { - register GC *pGC; + GC *pGC; int result; REQUEST(xSetDashesReq); @@ -1634,12 +1591,11 @@ } int -ProcSetClipRectangles(client) - register ClientPtr client; +ProcSetClipRectangles(ClientPtr client) { int nr; int result; - register GC *pGC; + GC *pGC; REQUEST(xSetClipRectanglesReq); REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); @@ -1664,10 +1620,9 @@ } int -ProcFreeGC(client) - register ClientPtr client; +ProcFreeGC(ClientPtr client) { - register GC *pGC; + GC *pGC; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); @@ -1677,11 +1632,10 @@ } int -ProcClearToBackground(client) - register ClientPtr client; +ProcClearToBackground(ClientPtr client) { REQUEST(xClearAreaReq); - register WindowPtr pWin; + WindowPtr pWin; REQUEST_SIZE_MATCH(xClearAreaReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, @@ -1705,12 +1659,11 @@ } int -ProcCopyArea(client) - register ClientPtr client; +ProcCopyArea(ClientPtr client) { - register DrawablePtr pDst; - register DrawablePtr pSrc; - register GC *pGC; + DrawablePtr pDst; + DrawablePtr pSrc; + GC *pGC; REQUEST(xCopyAreaReq); RegionPtr pRgn; @@ -1747,11 +1700,10 @@ } int -ProcCopyPlane(client) - register ClientPtr client; +ProcCopyPlane(ClientPtr client) { - register DrawablePtr psrcDraw, pdstDraw; - register GC *pGC; + DrawablePtr psrcDraw, pdstDraw; + GC *pGC; REQUEST(xCopyPlaneReq); RegionPtr pRgn; @@ -1795,12 +1747,11 @@ } int -ProcPolyPoint(client) - register ClientPtr client; +ProcPolyPoint(ClientPtr client) { int npoint; - register GC *pGC; - register DrawablePtr pDraw; + GC *pGC; + DrawablePtr pDraw; REQUEST(xPolyPointReq); REQUEST_AT_LEAST_SIZE(xPolyPointReq); @@ -1819,12 +1770,11 @@ } int -ProcPolyLine(client) - register ClientPtr client; +ProcPolyLine(ClientPtr client) { int npoint; - register GC *pGC; - register DrawablePtr pDraw; + GC *pGC; + DrawablePtr pDraw; REQUEST(xPolyLineReq); REQUEST_AT_LEAST_SIZE(xPolyLineReq); @@ -1843,12 +1793,11 @@ } int -ProcPolySegment(client) - register ClientPtr client; +ProcPolySegment(ClientPtr client) { int nsegs; - register GC *pGC; - register DrawablePtr pDraw; + GC *pGC; + DrawablePtr pDraw; REQUEST(xPolySegmentReq); REQUEST_AT_LEAST_SIZE(xPolySegmentReq); @@ -1863,12 +1812,11 @@ } int -ProcPolyRectangle (client) - register ClientPtr client; +ProcPolyRectangle(ClientPtr client) { int nrects; - register GC *pGC; - register DrawablePtr pDraw; + GC *pGC; + DrawablePtr pDraw; REQUEST(xPolyRectangleReq); REQUEST_AT_LEAST_SIZE(xPolyRectangleReq); @@ -1884,12 +1832,11 @@ } int -ProcPolyArc(client) - register ClientPtr client; +ProcPolyArc(ClientPtr client) { int narcs; - register GC *pGC; - register DrawablePtr pDraw; + GC *pGC; + DrawablePtr pDraw; REQUEST(xPolyArcReq); REQUEST_AT_LEAST_SIZE(xPolyArcReq); @@ -1904,12 +1851,11 @@ } int -ProcFillPoly(client) - register ClientPtr client; +ProcFillPoly(ClientPtr client) { int things; - register GC *pGC; - register DrawablePtr pDraw; + GC *pGC; + DrawablePtr pDraw; REQUEST(xFillPolyReq); REQUEST_AT_LEAST_SIZE(xFillPolyReq); @@ -1936,12 +1882,11 @@ } int -ProcPolyFillRectangle(client) - register ClientPtr client; +ProcPolyFillRectangle(ClientPtr client) { int things; - register GC *pGC; - register DrawablePtr pDraw; + GC *pGC; + DrawablePtr pDraw; REQUEST(xPolyFillRectangleReq); REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq); @@ -1958,12 +1903,11 @@ } int -ProcPolyFillArc(client) - register ClientPtr client; +ProcPolyFillArc(ClientPtr client) { int narcs; - register GC *pGC; - register DrawablePtr pDraw; + GC *pGC; + DrawablePtr pDraw; REQUEST(xPolyFillArcReq); REQUEST_AT_LEAST_SIZE(xPolyFillArcReq); @@ -1980,7 +1924,7 @@ #ifdef MATCH_CLIENT_ENDIAN int -ServerOrder (void) +ServerOrder(void) { int whichbyte = 1; @@ -1992,7 +1936,7 @@ #define ClientOrder(client) ((client)->swapped ? !ServerOrder() : ServerOrder()) void -ReformatImage (char *base, int nbytes, int bpp, int order) +ReformatImage(char *base, int nbytes, int bpp, int order) { switch (bpp) { case 1: /* yuck */ @@ -2032,11 +1976,10 @@ * boundary, even if the scanlines are padded to our satisfaction. */ int -ProcPutImage(client) - register ClientPtr client; +ProcPutImage(ClientPtr client) { - register GC *pGC; - register DrawablePtr pDraw; + GC *pGC; + DrawablePtr pDraw; long length; /* length of scanline server padded */ long lengthProto; /* length of scanline protocol padded */ char *tmpImage; @@ -2091,17 +2034,12 @@ int -DoGetImage(client, format, drawable, x, y, width, height, planemask, im_return) - register ClientPtr client; - Drawable drawable; - int format; - int x, y, width, height; - Mask planemask; - xGetImageReply **im_return; +DoGetImage(ClientPtr client, int format, Drawable drawable, int x, int y, + int width, int height, Mask planemask, xGetImageReply **im_return) { - register DrawablePtr pDraw; + DrawablePtr pDraw; int nlines, linesPerBuf; - register int linesDone; + int linesDone; long widthBytesLine, length; Mask plane = 0; char *pBuf; @@ -2321,8 +2259,7 @@ } int -ProcGetImage(client) - register ClientPtr client; +ProcGetImage(ClientPtr client) { REQUEST(xGetImageReq); @@ -2335,8 +2272,7 @@ } int -ProcPolyText(client) - register ClientPtr client; +ProcPolyText(ClientPtr client) { int err; REQUEST(xPolyTextReq); @@ -2365,12 +2301,11 @@ } int -ProcImageText8(client) - register ClientPtr client; +ProcImageText8(ClientPtr client) { int err; - register DrawablePtr pDraw; - register GC *pGC; + DrawablePtr pDraw; + GC *pGC; REQUEST(xImageTextReq); @@ -2396,12 +2331,11 @@ } int -ProcImageText16(client) - register ClientPtr client; +ProcImageText16(ClientPtr client) { int err; - register DrawablePtr pDraw; - register GC *pGC; + DrawablePtr pDraw; + GC *pGC; REQUEST(xImageTextReq); @@ -2428,13 +2362,12 @@ int -ProcCreateColormap(client) - register ClientPtr client; +ProcCreateColormap(ClientPtr client) { VisualPtr pVisual; ColormapPtr pmap; Colormap mid; - register WindowPtr pWin; + WindowPtr pWin; ScreenPtr pScreen; REQUEST(xCreateColormapReq); int i, result; @@ -2472,8 +2405,7 @@ } int -ProcFreeColormap(client) - register ClientPtr client; +ProcFreeColormap(ClientPtr client) { ColormapPtr pmap; REQUEST(xResourceReq); @@ -2497,8 +2429,7 @@ int -ProcCopyColormapAndFree(client) - register ClientPtr client; +ProcCopyColormapAndFree(ClientPtr client) { Colormap mid; ColormapPtr pSrcMap; @@ -2525,8 +2456,7 @@ } int -ProcInstallColormap(client) - register ClientPtr client; +ProcInstallColormap(ClientPtr client) { ColormapPtr pcmp; REQUEST(xResourceReq); @@ -2547,8 +2477,7 @@ } int -ProcUninstallColormap(client) - register ClientPtr client; +ProcUninstallColormap(ClientPtr client) { ColormapPtr pcmp; REQUEST(xResourceReq); @@ -2570,8 +2499,7 @@ } int -ProcListInstalledColormaps(client) - register ClientPtr client; +ProcListInstalledColormaps(ClientPtr client) { xListInstalledColormapsReply *preply; int nummaps; @@ -2606,8 +2534,7 @@ } int -ProcAllocColor(client) - register ClientPtr client; +ProcAllocColor(ClientPtr client) { ColormapPtr pmap; int retval; @@ -2658,8 +2585,7 @@ } int -ProcAllocNamedColor (client) - register ClientPtr client; +ProcAllocNamedColor(ClientPtr client) { ColormapPtr pcmp; REQUEST(xAllocNamedColorReq); @@ -2720,8 +2646,7 @@ } int -ProcAllocColorCells (client) - register ClientPtr client; +ProcAllocColorCells(ClientPtr client) { ColormapPtr pcmp; REQUEST(xAllocColorCellsReq); @@ -2796,8 +2721,7 @@ } int -ProcAllocColorPlanes(client) - register ClientPtr client; +ProcAllocColorPlanes(ClientPtr client) { ColormapPtr pcmp; REQUEST(xAllocColorPlanesReq); @@ -2870,8 +2794,7 @@ } int -ProcFreeColors (client) - register ClientPtr client; +ProcFreeColors(ClientPtr client) { ColormapPtr pcmp; REQUEST(xFreeColorsReq); @@ -2906,8 +2829,7 @@ } int -ProcStoreColors (client) - register ClientPtr client; +ProcStoreColors(ClientPtr client) { ColormapPtr pcmp; REQUEST(xStoreColorsReq); @@ -2941,8 +2863,7 @@ } int -ProcStoreNamedColor (client) - register ClientPtr client; +ProcStoreNamedColor(ClientPtr client) { ColormapPtr pcmp; REQUEST(xStoreNamedColorReq); @@ -2976,8 +2897,7 @@ } int -ProcQueryColors(client) - register ClientPtr client; +ProcQueryColors(ClientPtr client) { ColormapPtr pcmp; REQUEST(xQueryColorsReq); @@ -3028,8 +2948,7 @@ } int -ProcLookupColor(client) - register ClientPtr client; +ProcLookupColor(ClientPtr client) { ColormapPtr pcmp; REQUEST(xLookupColorReq); @@ -3067,13 +2986,12 @@ } int -ProcCreateCursor( client) - register ClientPtr client; +ProcCreateCursor(ClientPtr client) { CursorPtr pCursor; - register PixmapPtr src; - register PixmapPtr msk; + PixmapPtr src; + PixmapPtr msk; unsigned char * srcbits; unsigned char * mskbits; unsigned short width, height; @@ -3133,7 +3051,7 @@ XYPixmap, 1, (pointer)srcbits); if ( msk == (PixmapPtr)NULL) { - register unsigned char *bits = mskbits; + unsigned char *bits = mskbits; while (--n >= 0) *bits++ = ~0; } @@ -3158,8 +3076,7 @@ } int -ProcCreateGlyphCursor( client) - register ClientPtr client; +ProcCreateGlyphCursor(ClientPtr client) { CursorPtr pCursor; int res; @@ -3183,8 +3100,7 @@ int -ProcFreeCursor(client) - register ClientPtr client; +ProcFreeCursor(ClientPtr client) { CursorPtr pCursor; REQUEST(xResourceReq); @@ -3205,11 +3121,10 @@ } int -ProcQueryBestSize (client) - register ClientPtr client; +ProcQueryBestSize(ClientPtr client) { xQueryBestSizeReply reply; - register DrawablePtr pDraw; + DrawablePtr pDraw; ScreenPtr pScreen; REQUEST(xQueryBestSizeReq); @@ -3239,8 +3154,7 @@ int -ProcSetScreenSaver (client) - register ClientPtr client; +ProcSetScreenSaver(ClientPtr client) { int blankingOption, exposureOption; REQUEST(xSetScreenSaverReq); @@ -3296,8 +3210,7 @@ } int -ProcGetScreenSaver(client) - register ClientPtr client; +ProcGetScreenSaver(ClientPtr client) { xGetScreenSaverReply rep; @@ -3314,8 +3227,7 @@ } int -ProcChangeHosts(client) - register ClientPtr client; +ProcChangeHosts(ClientPtr client) { REQUEST(xChangeHostsReq); int result; @@ -3339,8 +3251,7 @@ } int -ProcListHosts(client) - register ClientPtr client; +ProcListHosts(ClientPtr client) { xListHostsReply reply; int len, nHosts, result; @@ -3374,8 +3285,7 @@ } int -ProcChangeAccessControl(client) - register ClientPtr client; +ProcChangeAccessControl(ClientPtr client) { int result; REQUEST(xSetAccessControlReq); @@ -3393,8 +3303,7 @@ } int -ProcKillClient(client) - register ClientPtr client; +ProcKillClient(ClientPtr client) { REQUEST(xResourceReq); ClientPtr killclient; @@ -3428,8 +3337,7 @@ } int -ProcSetFontPath(client) - register ClientPtr client; +ProcSetFontPath(ClientPtr client) { unsigned char *ptr; unsigned long nbytes, total; @@ -3464,8 +3372,7 @@ } int -ProcGetFontPath(client) - register ClientPtr client; +ProcGetFontPath(ClientPtr client) { xGetFontPathReply reply; int stringLens, numpaths; @@ -3487,8 +3394,7 @@ } int -ProcChangeCloseDownMode(client) - register ClientPtr client; +ProcChangeCloseDownMode(ClientPtr client) { REQUEST(xSetCloseDownModeReq); @@ -3507,8 +3413,7 @@ } } -int ProcForceScreenSaver(client) - register ClientPtr client; +int ProcForceScreenSaver(ClientPtr client) { REQUEST(xForceScreenSaverReq); @@ -3524,8 +3429,7 @@ return client->noClientException; } -int ProcNoOperation(client) - register ClientPtr client; +int ProcNoOperation(ClientPtr client) { REQUEST_AT_LEAST_SIZE(xReq); @@ -3568,8 +3472,7 @@ char dispatchExceptionAtReset = DE_RESET; void -CloseDownClient(client) - register ClientPtr client; +CloseDownClient(ClientPtr client) { Bool really_close_down = client->clientGone || client->closeDownMode == DestroyAll; @@ -3679,8 +3582,8 @@ void CloseDownRetainedResources() { - register int i; - register ClientPtr client; + int i; + ClientPtr client; for (i=1; iindex = i; client->sequence = 0; @@ -3759,14 +3660,13 @@ extern unsigned totalClientSize; int -InitClientPrivates(client) - ClientPtr client; +InitClientPrivates(ClientPtr client) { - register char *ptr; + char *ptr; DevUnion *ppriv; - register unsigned *sizes; - register unsigned size; - register int i; + unsigned *sizes; + unsigned size; + int i; if (totalClientSize == sizeof(ClientRec)) ppriv = (DevUnion *)NULL; @@ -3802,11 +3702,10 @@ *************************/ ClientPtr -NextAvailableClient(ospriv) - pointer ospriv; +NextAvailableClient(pointer ospriv) { - register int i; - register ClientPtr client; + int i; + ClientPtr client; xReq data; i = nextFreeClientID; @@ -3847,11 +3746,10 @@ } int -ProcInitialConnection(client) - register ClientPtr client; +ProcInitialConnection(ClientPtr client) { REQUEST(xReq); - register xConnClientPrefix *prefix; + xConnClientPrefix *prefix; int whichbyte = 1; prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq); @@ -3883,12 +3781,10 @@ #endif int -SendConnSetup(client, reason) - register ClientPtr client; - char *reason; +SendConnSetup(ClientPtr client, char *reason) { - register xWindowRoot *root; - register int i; + xWindowRoot *root; + int i; int numScreens; char* lConnectionInfo; xConnSetupPrefix* lconnSetupPrefix; @@ -3943,8 +3839,8 @@ for (i=0; icurrentInputMask = WindowTable[i]->eventMask | wOtherEventMasks (WindowTable[i]); @@ -3985,11 +3881,10 @@ } int -ProcEstablishConnection(client) - register ClientPtr client; +ProcEstablishConnection(ClientPtr client) { char *reason, *auth_proto, *auth_string; - register xConnClientPrefix *prefix; + xConnClientPrefix *prefix; REQUEST(xReq); prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq); @@ -4020,12 +3915,8 @@ } void -SendErrorToClient(client, majorCode, minorCode, resId, errorCode) - ClientPtr client; - unsigned int majorCode; - unsigned int minorCode; - XID resId; - int errorCode; +SendErrorToClient(ClientPtr client, unsigned int majorCode, + unsigned int minorCode, XID resId, int errorCode) { xError rep; @@ -4040,10 +3931,9 @@ } void -DeleteWindowFromAnySelections(pWin) - WindowPtr pWin; +DeleteWindowFromAnySelections(WindowPtr pWin) { - register int i; + int i; for (i = 0; i< NumCurrentSelections; i++) if (CurrentSelections[i].pWin == pWin) @@ -4055,10 +3945,9 @@ } static void -DeleteClientFromAnySelections(client) - ClientPtr client; +DeleteClientFromAnySelections(ClientPtr client) { - register int i; + int i; for (i = 0; i< NumCurrentSelections; i++) if (CurrentSelections[i].client == client) @@ -4070,8 +3959,7 @@ } void -MarkClientException(client) - ClientPtr client; +MarkClientException(ClientPtr client) { client->noClientException = -1; } Index: xc/programs/Xserver/dix/dixfonts.c diff -u xc/programs/Xserver/dix/dixfonts.c:3.31 xc/programs/Xserver/dix/dixfonts.c:3.33 --- xc/programs/Xserver/dix/dixfonts.c:3.31 Mon Feb 14 20:09:36 2005 +++ xc/programs/Xserver/dix/dixfonts.c Fri Oct 14 11:16:21 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.31 2005/02/15 01:09:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/dixfonts.c,v 3.33 2005/10/14 15:16:21 tsi Exp $ */ /************************************************************************ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. @@ -70,9 +70,9 @@ #define NEED_REPLIES -#include "X.h" -#include "Xmd.h" -#include "Xproto.h" +#include +#include +#include #include "scrnintstr.h" #include "resource.h" #include "dixstruct.h" @@ -96,7 +96,7 @@ #ifdef XF86BIGFONT #define _XF86BIGFONT_SERVER_ -#include "xf86bigfont.h" +#include #endif #define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics @@ -117,8 +117,7 @@ static FontPatternCachePtr patternCache; int -FontToXError(err) - int err; +FontToXError(int err) { switch (err) { case Successful: @@ -141,8 +140,7 @@ * adding RT_FONT prevents conflict with default cursor font */ Bool -SetDefaultFont(defaultfontname) - char *defaultfontname; +SetDefaultFont(char *defaultfontname) { int err; FontPtr pf; @@ -170,8 +168,7 @@ * freed data. */ void -QueueFontWakeup(fpe) - FontPathElementPtr fpe; +QueueFontWakeup(FontPathElementPtr fpe) { int i; FontPathElementPtr *new; @@ -200,8 +197,7 @@ } void -RemoveFontWakeup(fpe) - FontPathElementPtr fpe; +RemoveFontWakeup(FontPathElementPtr fpe) { int i, j; @@ -219,10 +215,7 @@ /* ARGSUSED */ void -FontWakeup(data, count, LastSelectMask) - pointer data; - int count; - pointer LastSelectMask; +FontWakeup(pointer data, int count, pointer LastSelectMask) { int i; FontPathElementPtr fpe; @@ -244,7 +237,7 @@ } static void -FreeFPE (FontPathElementPtr fpe) +FreeFPE(FontPathElementPtr fpe) { fpe->refcount--; if (fpe->refcount == 0) { @@ -399,12 +392,8 @@ } int -OpenFont(client, fid, flags, lenfname, pfontname) - ClientPtr client; - XID fid; - Mask flags; - unsigned lenfname; - char *pfontname; +OpenFont(ClientPtr client, XID fid, Mask flags, unsigned lenfname, + char *pfontname) { OFclosurePtr c; int i; @@ -493,9 +482,7 @@ */ /*ARGSUSED*/ int -CloseFont(value, fid) - pointer value; /* must conform to DeleteType */ - XID fid; +CloseFont(pointer value, XID fid) { int nscr; ScreenPtr pscr; @@ -537,13 +524,11 @@ /* * \ Sets up pReply as the correct QueryFontReply for pFont with the first * nProtoCCIStructs char infos. \ + * Caller must allocate *pReply storage. */ void -QueryFont(pFont, pReply, nProtoCCIStructs) - FontPtr pFont; - xQueryFontReply *pReply; /* caller must allocate this storage */ - int nProtoCCIStructs; +QueryFont(FontPtr pFont, xQueryFontReply *pReply, int nProtoCCIStructs) { FontPropPtr pFP; int r, @@ -861,11 +846,8 @@ } int -ListFonts(client, pattern, length, max_names) - ClientPtr client; - unsigned char *pattern; - unsigned int length; - unsigned int max_names; +ListFonts(ClientPtr client, unsigned char *pattern, unsigned int length, + unsigned int max_names) { int i; LFclosurePtr c; @@ -914,9 +896,7 @@ } int -doListFontsWithInfo(client, c) - ClientPtr client; - LFWIclosurePtr c; +doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) { FontPathElementPtr fpe; int err = Successful; @@ -1138,11 +1118,8 @@ } int -StartListFontsWithInfo(client, length, pattern, max_names) - ClientPtr client; - int length; - unsigned char *pattern; - int max_names; +StartListFontsWithInfo(ClientPtr client, int length, unsigned char *pattern, + int max_names) { int i; LFWIclosurePtr c; @@ -1196,11 +1173,9 @@ #define clearGCmask (GCClipMask) int -doPolyText(client, c) - ClientPtr client; - register PTclosurePtr c; +doPolyText(ClientPtr client, PTclosurePtr c) { - register FontPtr pFont = c->pGC->font, oldpFont; + FontPtr pFont = c->pGC->font, oldpFont; Font fid, oldfid; int err = Success, lgerr; /* err is in X error, not font error, space */ enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT; @@ -1465,16 +1440,8 @@ } int -PolyText(client, pDraw, pGC, pElt, endReq, xorg, yorg, reqType, did) - ClientPtr client; - DrawablePtr pDraw; - GC *pGC; - unsigned char *pElt; - unsigned char *endReq; - int xorg; - int yorg; - int reqType; - XID did; +PolyText(ClientPtr client, DrawablePtr pDraw, GCPtr pGC, unsigned char *pElt, + unsigned char *endReq, int xorg, int yorg, int reqType, XID did) { PTclosureRec local_closure; @@ -1508,9 +1475,7 @@ #undef FontShiftSize int -doImageText(client, c) - ClientPtr client; - register ITclosurePtr c; +doImageText(ClientPtr client, ITclosurePtr c) { int err = Success, lgerr; /* err is in X error, not font error, space */ FontPathElementPtr fpe; @@ -1631,16 +1596,8 @@ } int -ImageText(client, pDraw, pGC, nChars, data, xorg, yorg, reqType, did) - ClientPtr client; - DrawablePtr pDraw; - GC *pGC; - int nChars; - unsigned char *data; - int xorg; - int yorg; - int reqType; - XID did; +ImageText(ClientPtr client, DrawablePtr pDraw, GCPtr pGC, int nChars, + unsigned char *data, int xorg, int yorg, int reqType, XID did) { ITclosureRec local_closure; @@ -1711,7 +1668,8 @@ } static FontPathElementPtr -find_existing_fpe(FontPathElementPtr *list, int num, unsigned char *name, int len) +find_existing_fpe(FontPathElementPtr *list, int num, unsigned char *name, + int len) { FontPathElementPtr fpe; int i; @@ -1840,11 +1798,7 @@ /* XXX -- do we need to pass error down to each renderer? */ int -SetFontPath(client, npaths, paths, error) - ClientPtr client; - int npaths; - unsigned char *paths; - int *error; +SetFontPath(ClientPtr client, int npaths, unsigned char *paths, int *error) { int err = Success; @@ -1858,8 +1812,7 @@ } int -SetDefaultFontPath(path) - char *path; +SetDefaultFontPath(char *path) { unsigned char *cp, *pp, @@ -1900,9 +1853,7 @@ } unsigned char * -GetFontPath(count, length) - int *count; - int *length; +GetFontPath(int *count, int *length) { int i; unsigned char *c; @@ -1932,12 +1883,8 @@ } int -LoadGlyphs(client, pfont, nchars, item_size, data) - ClientPtr client; - FontPtr pfont; - unsigned nchars; - int item_size; - unsigned char *data; +LoadGlyphs(ClientPtr client, FontPtr pfont, unsigned nchars, int item_size, + unsigned char *data) { if (fpe_functions[pfont->fpe->type].load_glyphs) return (*fpe_functions[pfont->fpe->type].load_glyphs) @@ -1947,8 +1894,7 @@ } void -DeleteClientFontStuff(client) - ClientPtr client; +DeleteClientFontStuff(ClientPtr client) { int i; FontPathElementPtr fpe; @@ -1994,8 +1940,7 @@ FontResolutionPtr -GetClientResolutions (num) - int *num; +GetClientResolutions(int *num) { if (requestingClient && requestingClient->fontResFunc != NULL && !requestingClient->clientGone) @@ -2100,8 +2045,7 @@ /* convenience functions for FS interface */ FontPtr -find_old_font(id) - XID id; +find_old_font(XID id) { return (FontPtr) SecurityLookupIDByType(NullClient, id, RT_NONE, SecurityUnknownAccess); @@ -2114,23 +2058,19 @@ } int -StoreFontClientFont(pfont, id) - FontPtr pfont; - Font id; +StoreFontClientFont(FontPtr pfont, Font id) { return AddResource(id, RT_NONE, (pointer) pfont); } void -DeleteFontClientID(id) - Font id; +DeleteFontClientID(Font id) { FreeResource(id, RT_NONE); } int -client_auth_generation(client) - ClientPtr client; +client_auth_generation(ClientPtr client) { return 0; } @@ -2140,9 +2080,7 @@ static unsigned int last_server_gen; int -init_fs_handlers(fpe, block_handler) - FontPathElementPtr fpe; - BlockHandlerProcPtr block_handler; +init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) { /* if server has reset, make sure the b&w handlers are reinstalled */ if (last_server_gen < serverGeneration) { @@ -2165,10 +2103,8 @@ } void -remove_fs_handlers(fpe, block_handler, all) - FontPathElementPtr fpe; - BlockHandlerProcPtr block_handler; - Bool all; +remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler, + Bool all) { if (all) { /* remove the handlers if no one else is using them */ @@ -2197,8 +2133,8 @@ #define GLYPH_SIZE(ch, nbytes) \ GLWIDTHBYTESPADDED((ch)->metrics.rightSideBearing - \ (ch)->metrics.leftSideBearing, (nbytes)) -dump_char_ascii(cip) - CharInfoPtr cip; +void +dump_char_ascii(CharInfoPtr cip) { int r, l; Index: xc/programs/Xserver/dix/dixutils.c diff -u xc/programs/Xserver/dix/dixutils.c:3.14 xc/programs/Xserver/dix/dixutils.c:3.17 --- xc/programs/Xserver/dix/dixutils.c:3.14 Mon Nov 17 17:20:34 2003 +++ xc/programs/Xserver/dix/dixutils.c Sun Feb 19 10:51:19 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/dixutils.c,v 3.14 2003/11/17 22:20:34 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/dixutils.c,v 3.17 2006/02/19 15:51:19 tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -82,20 +82,18 @@ */ -/* $Xorg: dixutils.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#include "X.h" -#include "Xmd.h" +#include +#include #include "misc.h" #include "windowstr.h" #include "dixstruct.h" #include "pixmapstr.h" #include "scrnintstr.h" #define XK_LATIN1 -#include "keysymdef.h" +#include #ifdef XCSECURITY #define _SECURITY_SERVER -#include "security.h" +#include #endif /* @@ -104,8 +102,7 @@ */ int -CompareTimeStamps(a, b) - TimeStamp a, b; +CompareTimeStamps(TimeStamp a, TimeStamp b) { if (a.months < b.months) return EARLIER; @@ -124,8 +121,7 @@ #define HALFMONTH ((unsigned long) 1<<31) TimeStamp -ClientTimeToServerTime(c) - CARD32 c; +ClientTimeToServerTime(CARD32 c) { TimeStamp ts; if (c == CurrentTime) @@ -153,11 +149,9 @@ */ void -CopyISOLatin1Lowered(dest, source, length) - register unsigned char *dest, *source; - int length; +CopyISOLatin1Lowered(unsigned char *dest, unsigned char *source, int length) { - register int i; + int i; for (i = 0; i < length; i++, source++, dest++) { @@ -175,7 +169,8 @@ #ifdef XCSECURITY -/* SecurityLookupWindow and SecurityLookupDrawable: +/* + * SecurityLookupWindow and SecurityLookupDrawable: * Look up the window/drawable taking into account the client doing * the lookup and the type of access desired. Return the window/drawable * if it exists and the client is allowed access, else return NULL. @@ -184,10 +179,7 @@ */ WindowPtr -SecurityLookupWindow(rid, client, access_mode) - XID rid; - ClientPtr client; - Mask access_mode; +SecurityLookupWindow(XID rid, ClientPtr client, Mask access_mode) { WindowPtr pWin; @@ -214,12 +206,9 @@ pointer -SecurityLookupDrawable(rid, client, access_mode) - XID rid; - ClientPtr client; - Mask access_mode; +SecurityLookupDrawable(XID rid, ClientPtr client, Mask access_mode) { - register DrawablePtr pDraw; + DrawablePtr pDraw; if(rid == INVALID) return (pointer) NULL; @@ -235,22 +224,19 @@ return (pointer)NULL; } -/* We can't replace the LookupWindow and LookupDrawable functions with +/* + * We can't replace the LookupWindow and LookupDrawable functions with * macros because of compatibility with loadable servers. */ WindowPtr -LookupWindow(rid, client) - XID rid; - ClientPtr client; +LookupWindow(XID rid, ClientPtr client) { return SecurityLookupWindow(rid, client, SecurityUnknownAccess); } pointer -LookupDrawable(rid, client) - XID rid; - ClientPtr client; +LookupDrawable(XID rid, ClientPtr client) { return SecurityLookupDrawable(rid, client, SecurityUnknownAccess); } @@ -258,9 +244,7 @@ #else /* not XCSECURITY */ WindowPtr -LookupWindow(rid, client) - XID rid; - ClientPtr client; +LookupWindow(XID rid, ClientPtr client) { WindowPtr pWin; @@ -285,11 +269,9 @@ pointer -LookupDrawable(rid, client) - XID rid; - ClientPtr client; +LookupDrawable(XID rid, ClientPtr client) { - register DrawablePtr pDraw; + DrawablePtr pDraw; if(rid == INVALID) return (pointer) NULL; @@ -301,12 +283,22 @@ return (pointer)NULL; } +WindowPtr +SecurityLookupWindow(XID rid, ClientPtr client, Mask access_mode) +{ + return LookupWindow(rid, client); +} + +pointer +SecurityLookupDrawable(XID rid, ClientPtr client, Mask access_mode) +{ + return LookupDrawable(rid, client); +} + #endif /* XCSECURITY */ ClientPtr -LookupClient(rid, client) - XID rid; - ClientPtr client; +LookupClient(XID rid, ClientPtr client) { pointer pRes = (pointer)SecurityLookupIDByClass(client, rid, RC_ANY, SecurityReadAccess); @@ -320,11 +312,40 @@ } +/* Return the (possibly cached) Drawable that corresponds to an XID */ +DrawablePtr +SecurityVerifyDrawable(XID did, ClientPtr client, Mask access_mode) +{ +#ifdef XCSECURITY + if (client->lastDrawableID == did && + client->trustLevel == XSecurityClientTrusted) + return client->lastDrawable; +#else + if (client->lastDrawableID == did) + return client->lastDrawable; +#endif + return SecurityLookupIDByClass(client, did, RC_DRAWABLE, access_mode); +} + + +/* Return the (possibly cached) GC that corresponds to an XID */ +GCPtr +SecurityVerifyGC(XID rid, ClientPtr client, Mask access_mode) +{ +#ifdef XCSECURITY + if (client->lastGCID == rid && + client->trustLevel == XSecurityClientTrusted) + return client->lastGC; +#else + if (client->lastGCID == rid) + return client->lastGC; +#endif + return SecurityLookupIDByType(client, rid, RT_GC, access_mode); +} + + int -AlterSaveSetForClient(client, pWin, mode) - ClientPtr client; - WindowPtr pWin; - unsigned mode; +AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode) { int numnow; pointer *pTmp = NULL; @@ -378,11 +399,10 @@ } void -DeleteWindowFromAnySaveSet(pWin) - WindowPtr pWin; +DeleteWindowFromAnySaveSet(WindowPtr pWin) { - register int i; - register ClientPtr client; + int i; + ClientPtr client; for (i = 0; i< currentMaxClients; i++) { @@ -417,11 +437,9 @@ /* called from the OS layer */ void -BlockHandler(pTimeout, pReadmask) -pointer pTimeout; /* DIX doesn't want to know how OS represents time */ -pointer pReadmask; /* nor how it represents the set of descriptors */ +BlockHandler(pointer pTimeout, pointer pReadmask) { - register int i, j; + int i, j; ++inHandler; for (i = 0; i < screenInfo.numScreens; i++) @@ -448,11 +466,9 @@ } void -WakeupHandler(result, pReadmask) -int result; /* 32 bits of undefined result from the wait */ -pointer pReadmask; /* the resulting descriptor mask */ +WakeupHandler(int result, pointer pReadmask) { - register int i, j; + int i, j; ++inHandler; for (i = numHandlers - 1; i >= 0; i--) @@ -483,10 +499,9 @@ */ Bool -RegisterBlockAndWakeupHandlers (blockHandler, wakeupHandler, blockData) - BlockHandlerProcPtr blockHandler; - WakeupHandlerProcPtr wakeupHandler; - pointer blockData; +RegisterBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, + WakeupHandlerProcPtr wakeupHandler, + pointer blockData) { BlockHandlerPtr new; @@ -508,10 +523,9 @@ } void -RemoveBlockAndWakeupHandlers (blockHandler, wakeupHandler, blockData) - BlockHandlerProcPtr blockHandler; - WakeupHandlerProcPtr wakeupHandler; - pointer blockData; +RemoveBlockAndWakeupHandlers(BlockHandlerProcPtr blockHandler, + WakeupHandlerProcPtr wakeupHandler, + pointer blockData) { int i; @@ -604,13 +618,7 @@ } Bool -QueueWorkProc ( - Bool (*function)( - ClientPtr /* pClient */, - pointer /* closure */ - ), - ClientPtr client, - pointer closure) +QueueWorkProc(WorkQueueProcPtr function, ClientPtr client, pointer closure) { WorkQueuePtr q; @@ -644,10 +652,7 @@ static SleepQueuePtr sleepQueue = NULL; Bool -ClientSleep (client, function, closure) - ClientPtr client; - ClientSleepProcPtr function; - pointer closure; +ClientSleep(ClientPtr client, ClientSleepProcPtr function, pointer closure) { SleepQueuePtr q; @@ -665,8 +670,7 @@ } Bool -ClientSignal (client) - ClientPtr client; +ClientSignal(ClientPtr client) { SleepQueuePtr q; @@ -679,8 +683,7 @@ } void -ClientWakeup (client) - ClientPtr client; +ClientWakeup(ClientPtr client) { SleepQueuePtr q, *prev; @@ -706,8 +709,7 @@ } Bool -ClientIsAsleep (client) - ClientPtr client; +ClientIsAsleep(ClientPtr client) { SleepQueuePtr q; @@ -727,10 +729,7 @@ static CallbackListPtr **listsToCleanup = NULL; static Bool -_AddCallback( - CallbackListPtr *pcbl, - CallbackProcPtr callback, - pointer data) +_AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) { CallbackPtr cbr; @@ -746,10 +745,7 @@ } static Bool -_DeleteCallback( - CallbackListPtr *pcbl, - CallbackProcPtr callback, - pointer data) +_DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) { CallbackListPtr cbl = *pcbl; CallbackPtr cbr, pcbr; @@ -782,9 +778,7 @@ } static void -_CallCallbacks( - CallbackListPtr *pcbl, - pointer call_data) +_CallCallbacks(CallbackListPtr *pcbl, pointer call_data) { CallbackListPtr cbl = *pcbl; CallbackPtr cbr, pcbr; @@ -839,8 +833,7 @@ } static void -_DeleteCallbackList( - CallbackListPtr *pcbl) +_DeleteCallbackList(CallbackListPtr *pcbl) { CallbackListPtr cbl = *pcbl; CallbackPtr cbr, nextcbr; @@ -881,9 +874,7 @@ /* ===== Public Procedures ===== */ Bool -CreateCallbackList(pcbl, cbfuncs) - CallbackListPtr *pcbl; - CallbackFuncsPtr cbfuncs; +CreateCallbackList(CallbackListPtr *pcbl, CallbackFuncsPtr cbfuncs) { CallbackListPtr cbl; int i; @@ -915,10 +906,7 @@ } Bool -AddCallback(pcbl, callback, data) - CallbackListPtr *pcbl; - CallbackProcPtr callback; - pointer data; +AddCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) { if (!pcbl) return FALSE; if (!*pcbl) @@ -930,27 +918,21 @@ } Bool -DeleteCallback(pcbl, callback, data) - CallbackListPtr *pcbl; - CallbackProcPtr callback; - pointer data; +DeleteCallback(CallbackListPtr *pcbl, CallbackProcPtr callback, pointer data) { if (!pcbl || !*pcbl) return FALSE; return ((*(*pcbl)->funcs.DeleteCallback) (pcbl, callback, data)); } void -CallCallbacks(pcbl, call_data) - CallbackListPtr *pcbl; - pointer call_data; +CallCallbacks(CallbackListPtr *pcbl, pointer call_data) { if (!pcbl || !*pcbl) return; (*(*pcbl)->funcs.CallCallbacks) (pcbl, call_data); } void -DeleteCallbackList(pcbl) - CallbackListPtr *pcbl; +DeleteCallbackList(CallbackListPtr *pcbl) { if (!pcbl || !*pcbl) return; (*(*pcbl)->funcs.DeleteCallbackList) (pcbl); Index: xc/programs/Xserver/dix/events.c diff -u xc/programs/Xserver/dix/events.c:3.54 xc/programs/Xserver/dix/events.c:3.58 --- xc/programs/Xserver/dix/events.c:3.54 Wed Aug 4 12:33:34 2004 +++ xc/programs/Xserver/dix/events.c Sun Feb 19 10:51:19 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.54 2004/08/04 16:33:34 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/events.c,v 3.58 2006/02/19 15:51:19 tsi Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -68,14 +68,12 @@ * * *****************************************************************/ -/* $Xorg: events.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#include "X.h" +#include #include "misc.h" #include "resource.h" #define NEED_EVENTS #define NEED_REPLIES -#include "Xproto.h" +#include #include "windowstr.h" #include "inputstr.h" #include "scrnintstr.h" @@ -89,16 +87,16 @@ #include "globals.h" #ifdef XKB -#include "XKBsrv.h" +#include extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); #endif #ifdef XCSECURITY #define _SECURITY_SERVER -#include "security.h" +#include #endif -#include "XIproto.h" +#include #include "exevents.h" #include "extnsionst.h" @@ -586,9 +584,7 @@ #endif /* PANORAMIX */ void -SetMaskForEvent(mask, event) - Mask mask; - int event; +SetMaskForEvent(Mask mask, int event) { if ((event < LASTEvent) || (event >= 128)) FatalError("SetMaskForEvent: bogus event number"); @@ -596,8 +592,7 @@ } void -SetCriticalEvent(event) - int event; +SetCriticalEvent(int event) { if (event >= 128) FatalError("SetCriticalEvent: bogus event number"); @@ -667,11 +662,8 @@ #endif static void -CheckPhysLimits( - CursorPtr cursor, - Bool generateEvents, - Bool confineToScreen, - ScreenPtr pScreen) +CheckPhysLimits(CursorPtr cursor, Bool generateEvents, Bool confineToScreen, + ScreenPtr pScreen) { HotSpot new; @@ -712,9 +704,7 @@ } static void -CheckVirtualMotion( - register QdEventPtr qe, - register WindowPtr pWin) +CheckVirtualMotion(QdEventPtr qe, WindowPtr pWin) { #ifdef PANORAMIX if(!noPanoramiXExtension) { @@ -821,8 +811,7 @@ /* returns true if b is a descendent of a */ Bool -IsParent(a, b) - register WindowPtr a, b; +IsParent(WindowPtr a, WindowPtr b) { for (b = b->parent; b; b = b->parent) if (b == a) return TRUE; @@ -832,8 +821,8 @@ static void PostNewCursor(void) { - register WindowPtr win; - register GrabPtr grab = inputInfo.pointer->grab; + WindowPtr win; + GrabPtr grab = inputInfo.pointer->grab; if (syncEvents.playingEvents) return; @@ -878,8 +867,7 @@ } void -GetSpritePosition(px, py) - int *px, *py; +GetSpritePosition(int *px, int *py) { *px = sprite.hotPhys.x; *py = sprite.hotPhys.y; @@ -900,7 +888,7 @@ #define TIMESLOP (5 * 60 * 1000) /* 5 minutes */ static void -MonthChangedOrBadTime(register xEvent *xE) +MonthChangedOrBadTime(xEvent *xE) { /* If the ddx/OS is careless about not processing timestamped events from * different sources in sorted order, then it's possible for time to go @@ -919,8 +907,7 @@ lastDeviceEventTime = currentTime; } void -NoticeEventTime(xE) - register xEvent *xE; +NoticeEventTime(xEvent *xE) { if (!syncEvents.playingEvents) NoticeTime(xE); @@ -931,13 +918,10 @@ **************************************************************************/ void -EnqueueEvent(xE, device, count) - xEvent *xE; - DeviceIntPtr device; - int count; +EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count) { - register QdEventPtr tail = *syncEvents.pendtail; - register QdEventPtr qe; + QdEventPtr tail = *syncEvents.pendtail; + QdEventPtr qe; xEvent *qxE; NoticeTime(xE); @@ -1011,8 +995,8 @@ static void PlayReleasedEvents(void) { - register QdEventPtr *prev, qe; - register DeviceIntPtr dev; + QdEventPtr *prev, qe; + DeviceIntPtr dev; prev = &syncEvents.pending; while ( (qe = *prev) ) @@ -1056,7 +1040,7 @@ } static void -FreezeThaw(register DeviceIntPtr dev, Bool frozen) +FreezeThaw(DeviceIntPtr dev, Bool frozen) { dev->sync.frozen = frozen; if (frozen) @@ -1068,13 +1052,13 @@ void ComputeFreezes() { - register DeviceIntPtr replayDev = syncEvents.replayDev; - register int i; + DeviceIntPtr replayDev = syncEvents.replayDev; + int i; WindowPtr w; - register xEvent *xE; + xEvent *xE; int count; GrabPtr grab; - register DeviceIntPtr dev; + DeviceIntPtr dev; for (dev = inputInfo.devices; dev; dev = dev->next) FreezeThaw(dev, dev->sync.other || (dev->sync.state >= FROZEN)); @@ -1133,7 +1117,7 @@ #ifdef RANDR void -ScreenRestructured (ScreenPtr pScreen) +ScreenRestructured(ScreenPtr pScreen) { GrabPtr grab; @@ -1150,12 +1134,10 @@ #endif void -CheckGrabForSyncs(thisDev, thisMode, otherMode) - register DeviceIntPtr thisDev; - Bool thisMode, otherMode; +CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode) { - register GrabPtr grab = thisDev->grab; - register DeviceIntPtr dev; + GrabPtr grab = thisDev->grab; + DeviceIntPtr dev; if (thisMode == GrabModeSync) thisDev->sync.state = FROZEN_NO_EVENT; @@ -1186,11 +1168,8 @@ } void -ActivatePointerGrab(mouse, grab, time, autoGrab) - register GrabPtr grab; - register DeviceIntPtr mouse; - TimeStamp time; - Bool autoGrab; +ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab, TimeStamp time, + Bool autoGrab) { WindowPtr oldWin = (mouse->grab) ? mouse->grab->window : sprite.win; @@ -1217,11 +1196,10 @@ } void -DeactivatePointerGrab(mouse) - register DeviceIntPtr mouse; +DeactivatePointerGrab(DeviceIntPtr mouse) { - register GrabPtr grab = mouse->grab; - register DeviceIntPtr dev; + GrabPtr grab = mouse->grab; + DeviceIntPtr dev; mouse->valuator->motionHintWindow = NullWindow; mouse->grab = NullGrab; @@ -1242,11 +1220,8 @@ } void -ActivateKeyboardGrab(keybd, grab, time, passive) - register DeviceIntPtr keybd; - GrabPtr grab; - TimeStamp time; - Bool passive; +ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, + Bool passive) { WindowPtr oldWin; @@ -1272,12 +1247,11 @@ } void -DeactivateKeyboardGrab(keybd) - register DeviceIntPtr keybd; +DeactivateKeyboardGrab(DeviceIntPtr keybd) { - register GrabPtr grab = keybd->grab; - register DeviceIntPtr dev; - register WindowPtr focusWin = keybd->focus ? keybd->focus->win + GrabPtr grab = keybd->grab; + DeviceIntPtr dev; + WindowPtr focusWin = keybd->focus ? keybd->focus->win : sprite.win; if (focusWin == FollowKeyboardWin) @@ -1297,15 +1271,11 @@ } void -AllowSome(client, time, thisDev, newState) - ClientPtr client; - TimeStamp time; - register DeviceIntPtr thisDev; - int newState; +AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState) { Bool thisGrabbed, otherGrabbed, othersFrozen, thisSynced; TimeStamp grabTime; - register DeviceIntPtr dev; + DeviceIntPtr dev; thisGrabbed = thisDev->grab && SameClient(thisDev->grab, client); thisSynced = FALSE; @@ -1409,8 +1379,7 @@ } int -ProcAllowEvents(client) - register ClientPtr client; +ProcAllowEvents(ClientPtr client) { TimeStamp time; DeviceIntPtr mouse = inputInfo.pointer; @@ -1453,10 +1422,9 @@ } void -ReleaseActiveGrabs(client) - ClientPtr client; +ReleaseActiveGrabs(ClientPtr client) { - register DeviceIntPtr dev; + DeviceIntPtr dev; Bool done; /* XXX CloseDownClient should remove passive grabs before @@ -1480,12 +1448,8 @@ **************************************************************************/ int -TryClientEvents (client, pEvents, count, mask, filter, grab) - ClientPtr client; - GrabPtr grab; - xEvent *pEvents; - int count; - Mask mask, filter; +TryClientEvents(ClientPtr client, xEvent *pEvents, int count, Mask mask, + Mask filter, GrabPtr grab) { int i; int type; @@ -1563,17 +1527,12 @@ } int -DeliverEventsToWindow(pWin, pEvents, count, filter, grab, mskidx) - register WindowPtr pWin; - GrabPtr grab; - xEvent *pEvents; - int count; - Mask filter; - int mskidx; +DeliverEventsToWindow(WindowPtr pWin, xEvent *pEvents, int count, + Mask filter, GrabPtr grab, int mskidx) { int deliveries = 0, nondeliveries = 0; int attempt; - register InputClients *other; + InputClients *other; ClientPtr client = NullClient; Mask deliveryMask = 0; /* If a grab occurs due to a button press, then this mask is the mask of the grab. */ @@ -1687,14 +1646,10 @@ #endif int -MaybeDeliverEventsToClient(pWin, pEvents, count, filter, dontClient) - register WindowPtr pWin; - xEvent *pEvents; - int count; - Mask filter; - ClientPtr dontClient; +MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents, int count, + Mask filter, ClientPtr dontClient) { - register OtherClients *other; + OtherClients *other; if (pWin->eventMask & filter) @@ -1728,11 +1683,7 @@ } static void -FixUpEventFromWindow( - xEvent *xE, - WindowPtr pWin, - Window child, - Bool calcChild) +FixUpEventFromWindow(xEvent *xE, WindowPtr pWin, Window child, Bool calcChild) { if (calcChild) { @@ -1782,12 +1733,8 @@ } int -DeliverDeviceEvents(pWin, xE, grab, stopAt, dev, count) - register WindowPtr pWin, stopAt; - register xEvent *xE; - GrabPtr grab; - DeviceIntPtr dev; - int count; +DeliverDeviceEvents(WindowPtr pWin, xEvent *xE, GrabPtr grab, + WindowPtr stopAt, DeviceIntPtr dev, int count) { Window child = None; int type = xE->u.u.type; @@ -1796,7 +1743,7 @@ if (type & EXTENSION_EVENT_BASE) { - register OtherInputMasks *inputMasks; + OtherInputMasks *inputMasks; int mskidx = dev->id; inputMasks = wOtherInputMasks(pWin); @@ -1850,21 +1797,50 @@ /* not useful for events that propagate up the tree or extension events */ int -DeliverEvents(pWin, xE, count, otherParent) - register WindowPtr pWin, otherParent; - register xEvent *xE; - int count; +DeliverEvents(WindowPtr pWin, xEvent *xE, int count, WindowPtr otherParent) { Mask filter; int deliveries; + if (!count) + return 0; + #ifdef PANORAMIX - if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum) - return count; + if(!noPanoramiXExtension) { + int scrnum = pWin->drawable.pScreen->myNum; + + if (xE->u.u.type == Expose) { + int i, x = 0, y = 0; + XID realWin = 0; + + if (!pWin->parent) { + x = panoramiXdataPtr[scrnum].x; + y = panoramiXdataPtr[scrnum].y; + pWin = WindowTable[0]; + realWin = pWin->drawable.id; + } else if (scrnum) { + PanoramiXRes *win; + + win = PanoramiXFindIDByScrnum(XRT_WINDOW, + pWin->drawable.id, scrnum); + if (!win) + return count; + realWin = win->info[0].id; + pWin = LookupIDByType(realWin, RT_WINDOW); + } + if (x || y || scrnum) { + for (i = 0; i < count; i++) { + xE[i].u.expose.window = realWin; + xE[i].u.expose.x += x; + xE[i].u.expose.y += y; + } + } + } else + if (scrnum) + return count; + } #endif - if (!count) - return 0; filter = filters[xE->u.u.type]; if ((filter & SubstructureNotifyMask) && (xE->u.u.type != CreateNotify)) xE->u.destroyNotify.event = pWin->drawable.id; @@ -1918,7 +1894,7 @@ static WindowPtr XYToWindow(int x, int y) { - register WindowPtr pWin; + WindowPtr pWin; spriteTraceGood = 1; /* root window still there */ pWin = ROOT->firstChild; @@ -2034,7 +2010,8 @@ * other than 0,0, the information in the private sprite structure must * be updated accordingly, or XYToWindow (and other routines) will not * compute correctly. */ -void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) +void +ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) { GrabPtr grab; @@ -2068,10 +2045,9 @@ #endif void -DefineInitialRootWindow(win) - register WindowPtr win; +DefineInitialRootWindow(WindowPtr win) { - register ScreenPtr pScreen = win->drawable.pScreen; + ScreenPtr pScreen = win->drawable.pScreen; sprite.hotPhys.pScreen = pScreen; sprite.hotPhys.x = pScreen->width / 2; @@ -2118,16 +2094,13 @@ */ /*ARGSUSED*/ void -WindowHasNewCursor(pWin) - WindowPtr pWin; +WindowHasNewCursor(WindowPtr pWin) { PostNewCursor(); } void -NewCurrentScreen(newScreen, x, y) - ScreenPtr newScreen; - int x,y; +NewCurrentScreen(ScreenPtr newScreen, int x, int y) { sprite.hotPhys.x = x; sprite.hotPhys.y = y; @@ -2162,11 +2135,7 @@ #ifdef PANORAMIX static Bool -XineramaPointInWindowIsVisible( - WindowPtr pWin, - int x, - int y -) +XineramaPointInWindowIsVisible(WindowPtr pWin, int x, int y) { ScreenPtr pScreen = pWin->drawable.pScreen; BoxRec box; @@ -2270,8 +2239,7 @@ int -ProcWarpPointer(client) - ClientPtr client; +ProcWarpPointer(ClientPtr client) { WindowPtr dest = NULL; int x, y; @@ -2346,7 +2314,7 @@ y = sprite.physLimits.y1; else if (y >= sprite.physLimits.y2) y = sprite.physLimits.y2 - 1; -#if defined(SHAPE) +#ifdef SHAPE if (sprite.hotShape) ConfineToShape(sprite.hotShape, &x, &y); #endif @@ -2382,15 +2350,12 @@ passive grab set on the window to be activated. */ static Bool -CheckPassiveGrabsOnWindow( - WindowPtr pWin, - register DeviceIntPtr device, - register xEvent *xE, - int count) +CheckPassiveGrabsOnWindow(WindowPtr pWin, DeviceIntPtr device, xEvent *xE, + int count) { - register GrabPtr grab = wPassiveGrabs(pWin); + GrabPtr grab = wPassiveGrabs(pWin); GrabRec tempGrab; - register xEvent *dxE; + xEvent *dxE; if (!grab) return FALSE; @@ -2488,15 +2453,11 @@ */ Bool -CheckDeviceGrabs(device, xE, checkFirst, count) - register DeviceIntPtr device; - register xEvent *xE; - int checkFirst; - int count; +CheckDeviceGrabs(DeviceIntPtr device, xEvent *xE, int checkFirst, int count) { - register int i; - register WindowPtr pWin = NULL; - register FocusClassPtr focus = device->focus; + int i; + WindowPtr pWin = NULL; + FocusClassPtr focus = device->focus; if (((xE->u.u.type == ButtonPress) #if defined(XINPUT) && defined(XKB) @@ -2535,11 +2496,7 @@ } void -DeliverFocusedEvent(keybd, xE, window, count) - xEvent *xE; - DeviceIntPtr keybd; - WindowPtr window; - int count; +DeliverFocusedEvent(DeviceIntPtr keybd, xEvent *xE, WindowPtr window, int count) { WindowPtr focus = keybd->focus->win; int mskidx = 0; @@ -2567,16 +2524,13 @@ } void -DeliverGrabbedEvent(xE, thisDev, deactivateGrab, count) - register xEvent *xE; - register DeviceIntPtr thisDev; - Bool deactivateGrab; - int count; +DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev, Bool deactivateGrab, + int count) { - register GrabPtr grab = thisDev->grab; + GrabPtr grab = thisDev->grab; int deliveries = 0; - register DeviceIntPtr dev; - register xEvent *dxE; + DeviceIntPtr dev; + xEvent *dxE; if (grab->ownerEvents) { @@ -2653,22 +2607,19 @@ void #ifdef XKB -CoreProcessKeyboardEvent (xE, keybd, count) +CoreProcessKeyboardEvent(xEvent *xE, DeviceIntPtr keybd, int count) #else -ProcessKeyboardEvent (xE, keybd, count) +ProcessKeyboardEvent(xEvent *xE, DeviceIntPtr keybd, int count) #endif - register xEvent *xE; - register DeviceIntPtr keybd; - int count; { int key, bit; - register BYTE *kptr; - register int i; - register CARD8 modifiers; - register CARD16 mask; + BYTE *kptr; + int i; + CARD8 modifiers; + CARD16 mask; GrabPtr grab = keybd->grab; Bool deactivateGrab = FALSE; - register KeyClassPtr keyc = keybd->key; + KeyClassPtr keyc = keybd->key; if (!syncEvents.playingEvents) { @@ -2766,13 +2717,11 @@ CoreProcessKeyEvent to be called, as in for example Mouse Keys. */ void -FixKeyState (xE, keybd) - register xEvent *xE; - register DeviceIntPtr keybd; +FixKeyState(xEvent *xE, DeviceIntPtr keybd) { int key, bit; - register BYTE *kptr; - register KeyClassPtr keyc = keybd->key; + BYTE *kptr; + KeyClassPtr keyc = keybd->key; key = xE->u.u.detail; kptr = &keyc->down[key >> 3]; @@ -2800,17 +2749,14 @@ void #ifdef XKB -CoreProcessPointerEvent (xE, mouse, count) +CoreProcessPointerEvent(xEvent *xE, DeviceIntPtr mouse, int count) #else -ProcessPointerEvent (xE, mouse, count) +ProcessPointerEvent(xEvent *xE, DeviceIntPtr mouse, int count) #endif - register xEvent *xE; - register DeviceIntPtr mouse; - int count; { - register GrabPtr grab = mouse->grab; + GrabPtr grab = mouse->grab; Bool deactivateGrab = FALSE; - register ButtonClassPtr butc = mouse->button; + ButtonClassPtr butc = mouse->button; #ifdef XKB XkbSrvInfoPtr xkbi= inputInfo.keyboard->key->xkbInfo; #endif @@ -2842,8 +2788,8 @@ } if (xE->u.u.type != MotionNotify) { - register int key; - register BYTE *kptr; + int key; + BYTE *kptr; int bit; XE_KBPTR.rootX = sprite.hot.x; @@ -2909,11 +2855,10 @@ (SubstructureRedirectMask | ResizeRedirectMask | ButtonPressMask) void -RecalculateDeliverableEvents(pWin) - register WindowPtr pWin; +RecalculateDeliverableEvents(WindowPtr pWin) { - register OtherClients *others; - register WindowPtr pChild; + OtherClients *others; + WindowPtr pChild; pChild = pWin; while (1) @@ -2946,12 +2891,10 @@ } int -OtherClientGone(value, id) - pointer value; /* must conform to DeleteType */ - XID id; +OtherClientGone(pointer value, XID id) { - register OtherClientsPtr other, prev; - register WindowPtr pWin = (WindowPtr)value; + OtherClientsPtr other, prev; + WindowPtr pWin = (WindowPtr)value; prev = 0; for (other = wOtherClients(pWin); other; other = other->next) @@ -2977,10 +2920,7 @@ } int -EventSelectForWindow(pWin, client, mask) - register WindowPtr pWin; - register ClientPtr client; - Mask mask; +EventSelectForWindow(WindowPtr pWin, ClientPtr client, Mask mask) { Mask check; OtherClients * others; @@ -3061,13 +3001,10 @@ /*ARGSUSED*/ int -EventSuppressForWindow(pWin, client, mask, checkOptional) - register WindowPtr pWin; - register ClientPtr client; - Mask mask; - Bool *checkOptional; +EventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask, + Bool *checkOptional) { - register int i, free; + int i, free; if ((mask & ~PropagateMask) && !permitOldBugs) { @@ -3120,9 +3057,7 @@ } static WindowPtr -CommonAncestor( - register WindowPtr a, - register WindowPtr b) +CommonAncestor(WindowPtr a, WindowPtr b) { for (b = b->parent; b; b = b->parent) if (IsParent(b, a)) return b; @@ -3130,18 +3065,13 @@ } static void -EnterLeaveEvent( - int type, - int mode, - int detail, - register WindowPtr pWin, - Window child) +EnterLeaveEvent(int type, int mode, int detail, WindowPtr pWin, Window child) { xEvent event; - register DeviceIntPtr keybd = inputInfo.keyboard; + DeviceIntPtr keybd = inputInfo.keyboard; WindowPtr focus; - register DeviceIntPtr mouse = inputInfo.pointer; - register GrabPtr grab = mouse->grab; + DeviceIntPtr mouse = inputInfo.pointer; + GrabPtr grab = mouse->grab; Mask mask; if ((pWin == mouse->valuator->motionHintWindow) && @@ -3229,7 +3159,7 @@ static void LeaveNotifies(WindowPtr child, WindowPtr ancestor, int mode, int detail) { - register WindowPtr pWin; + WindowPtr pWin; if (ancestor == child) return; @@ -3269,7 +3199,7 @@ } static void -FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, register WindowPtr pWin) +FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, WindowPtr pWin) { xEvent event; @@ -3310,11 +3240,8 @@ * no-op if child not descended from ancestor */ static Bool -FocusInEvents( - DeviceIntPtr dev, - WindowPtr ancestor, WindowPtr child, WindowPtr skipChild, - int mode, int detail, - Bool doAncestor) +FocusInEvents(DeviceIntPtr dev, WindowPtr ancestor, WindowPtr child, + WindowPtr skipChild, int mode, int detail, Bool doAncestor) { if (child == NullWindow) return ancestor == NullWindow; @@ -3336,13 +3263,10 @@ /* dies horribly if ancestor is not an ancestor of child */ static void -FocusOutEvents( - DeviceIntPtr dev, - WindowPtr child, WindowPtr ancestor, - int mode, int detail, - Bool doAncestor) +FocusOutEvents(DeviceIntPtr dev, WindowPtr child, WindowPtr ancestor, + int mode, int detail, Bool doAncestor) { - register WindowPtr pWin; + WindowPtr pWin; for (pWin = child; pWin != ancestor; pWin = pWin->parent) FocusEvent(dev, FocusOut, mode, detail, pWin); @@ -3351,10 +3275,7 @@ } void -DoFocusEvents(dev, fromWin, toWin, mode) - DeviceIntPtr dev; - WindowPtr fromWin, toWin; - int mode; +DoFocusEvents(DeviceIntPtr dev, WindowPtr fromWin, WindowPtr toWin, int mode) { int out, in; /* for holding details for to/from PointerRoot/None */ @@ -3480,16 +3401,11 @@ } int -SetInputFocus( - ClientPtr client, - DeviceIntPtr dev, - Window focusID, - CARD8 revertTo, - Time ctime, - Bool followOK) +SetInputFocus(ClientPtr client, DeviceIntPtr dev, Window focusID, + CARD8 revertTo, Time ctime, Bool followOK) { - register FocusClassPtr focus; - register WindowPtr focusWin; + FocusClassPtr focus; + WindowPtr focusWin; int mode; TimeStamp time; @@ -3538,7 +3454,7 @@ else { int depth = 0; - register WindowPtr pWin; + WindowPtr pWin; for (pWin = focusWin; pWin; pWin = pWin->parent) depth++; if (depth > focus->traceSize) @@ -3558,8 +3474,7 @@ } int -ProcSetInputFocus(client) - ClientPtr client; +ProcSetInputFocus(ClientPtr client) { REQUEST(xSetInputFocusReq); @@ -3573,8 +3488,7 @@ } int -ProcGetInputFocus(client) - ClientPtr client; +ProcGetInputFocus(ClientPtr client) { xGetInputFocusReply rep; /* REQUEST(xReq); */ @@ -3595,8 +3509,7 @@ } int -ProcGrabPointer(client) - ClientPtr client; +ProcGrabPointer(ClientPtr client) { xGrabPointerReply rep; DeviceIntPtr device = inputInfo.pointer; @@ -3702,11 +3615,10 @@ } int -ProcChangeActivePointerGrab(client) - ClientPtr client; +ProcChangeActivePointerGrab(ClientPtr client) { DeviceIntPtr device = inputInfo.pointer; - register GrabPtr grab = device->grab; + GrabPtr grab = device->grab; CursorPtr newCursor, oldCursor; REQUEST(xChangeActivePointerGrabReq); TimeStamp time; @@ -3749,8 +3661,7 @@ } int -ProcUngrabPointer(client) - ClientPtr client; +ProcUngrabPointer(ClientPtr client) { DeviceIntPtr device = inputInfo.pointer; GrabPtr grab; @@ -3769,20 +3680,12 @@ } int -GrabDevice(client, dev, this_mode, other_mode, grabWindow, ownerEvents, ctime, - mask, status) - register ClientPtr client; - register DeviceIntPtr dev; - unsigned this_mode; - unsigned other_mode; - Window grabWindow; - unsigned ownerEvents; - Time ctime; - Mask mask; - CARD8 *status; +GrabDevice(ClientPtr client, DeviceIntPtr dev, unsigned this_mode, + unsigned other_mode, Window grabWindow, unsigned ownerEvents, + Time ctime, Mask mask, CARD8 *status) { - register WindowPtr pWin; - register GrabPtr grab; + WindowPtr pWin; + GrabPtr grab; TimeStamp time; UpdateCurrentTime(); @@ -3834,8 +3737,7 @@ } int -ProcGrabKeyboard(client) - ClientPtr client; +ProcGrabKeyboard(ClientPtr client) { xGrabKeyboardReply rep; REQUEST(xGrabKeyboardReq); @@ -3864,8 +3766,7 @@ } int -ProcUngrabKeyboard(client) - ClientPtr client; +ProcUngrabKeyboard(ClientPtr client) { DeviceIntPtr device = inputInfo.keyboard; GrabPtr grab; @@ -3884,8 +3785,7 @@ } int -ProcQueryPointer(client) - ClientPtr client; +ProcQueryPointer(ClientPtr client) { xQueryPointerReply rep; WindowPtr pWin, t; @@ -4000,8 +3900,7 @@ } int -ProcSendEvent(client) - ClientPtr client; +ProcSendEvent(ClientPtr client) { WindowPtr pWin; WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */ @@ -4089,8 +3988,7 @@ } int -ProcUngrabKey(client) - ClientPtr client; +ProcUngrabKey(ClientPtr client) { REQUEST(xUngrabKeyReq); WindowPtr pWin; @@ -4131,8 +4029,7 @@ } int -ProcGrabKey(client) - ClientPtr client; +ProcGrabKey(ClientPtr client) { WindowPtr pWin; REQUEST(xGrabKeyReq); @@ -4186,8 +4083,7 @@ int -ProcGrabButton(client) - ClientPtr client; +ProcGrabButton(ClientPtr client) { WindowPtr pWin, confineTo; REQUEST(xGrabButtonReq); @@ -4261,8 +4157,7 @@ } int -ProcUngrabButton(client) - ClientPtr client; +ProcUngrabButton(ClientPtr client) { REQUEST(xUngrabButtonReq); WindowPtr pWin; @@ -4294,9 +4189,7 @@ } void -DeleteWindowFromAnyEvents(pWin, freeResources) - WindowPtr pWin; - Bool freeResources; +DeleteWindowFromAnyEvents(WindowPtr pWin, Bool freeResources) { WindowPtr parent; DeviceIntPtr mouse = inputInfo.pointer; @@ -4387,8 +4280,7 @@ /*ARGSUSED*/ void -CheckCursorConfinement(pWin) - WindowPtr pWin; +CheckCursorConfinement(WindowPtr pWin) { GrabPtr grab = inputInfo.pointer->grab; WindowPtr confineTo; @@ -4407,11 +4299,9 @@ } Mask -EventMaskForClient(pWin, client) - WindowPtr pWin; - ClientPtr client; +EventMaskForClient(WindowPtr pWin, ClientPtr client) { - register OtherClientsPtr other; + OtherClientsPtr other; if (wClient (pWin) == client) return pWin->eventMask; @@ -4424,8 +4314,7 @@ } int -ProcRecolorCursor(client) - ClientPtr client; +ProcRecolorCursor(ClientPtr client) { CursorPtr pCursor; int nscr; @@ -4466,10 +4355,7 @@ } void -WriteEventsToClient(pClient, count, events) - ClientPtr pClient; - int count; - xEvent *events; +WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) { #ifdef PANORAMIX xEvent eventCopy; Index: xc/programs/Xserver/dix/extension.c diff -u xc/programs/Xserver/dix/extension.c:3.12 xc/programs/Xserver/dix/extension.c:3.14 --- xc/programs/Xserver/dix/extension.c:3.12 Tue Feb 19 06:09:22 2002 +++ xc/programs/Xserver/dix/extension.c Fri Oct 14 11:16:21 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/extension.c,v 3.12 2002/02/19 11:09:22 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/extension.c,v 3.14 2005/10/14 15:16:21 tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,12 +45,11 @@ SOFTWARE. ******************************************************************/ -/* $Xorg: extension.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ -#include "X.h" +#include #define NEED_EVENTS #define NEED_REPLIES -#include "Xproto.h" +#include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" @@ -59,7 +58,7 @@ #include "dispatch.h" #ifdef XCSECURITY #define _SECURITY_SERVER -#include "security.h" +#include #endif #ifdef LBX #include "lbxserve.h" @@ -86,7 +85,7 @@ unsigned short (*MinorOpcodeProc)(ClientPtr c3)) { int i; - register ExtensionEntry *ext, **newexts; + ExtensionEntry *ext, **newexts; if (!MainProc || !SwappedMainProc || !CloseDownProc || !MinorOpcodeProc) return((ExtensionEntry *) NULL); @@ -156,9 +155,8 @@ return(ext); } -Bool AddExtensionAlias(alias, ext) - char *alias; - ExtensionEntry *ext; +Bool +AddExtensionAlias(char *alias, ExtensionEntry *ext) { char *name; char **aliases; @@ -219,9 +217,7 @@ } void -DeclareExtensionSecurity(extname, secure) - char *extname; - Bool secure; +DeclareExtensionSecurity(char *extname, Bool secure) { #ifdef XCSECURITY int i = FindExtension(extname, strlen(extname)); @@ -247,15 +243,13 @@ } unsigned short -StandardMinorOpcode(client) - ClientPtr client; +StandardMinorOpcode(ClientPtr client) { return ((xReq *)client->requestBuffer)->data; } unsigned short -MinorOpcodeOfRequest(client) - ClientPtr client; +MinorOpcodeOfRequest(ClientPtr client) { unsigned char major; @@ -271,7 +265,7 @@ void CloseDownExtensions() { - register int i,j; + int i,j; #ifdef LBX LbxCloseDownExtensions(); @@ -293,7 +287,7 @@ lastError = FirstExtensionError; for (i=0; inum) { @@ -307,8 +301,7 @@ int -ProcQueryExtension(client) - ClientPtr client; +ProcQueryExtension(ClientPtr client) { xQueryExtensionReply reply; int i; @@ -347,8 +340,7 @@ } int -ProcListExtensions(client) - ClientPtr client; +ProcListExtensions(ClientPtr client) { xListExtensionsReply reply; char *bufptr, *buffer; @@ -364,7 +356,7 @@ if ( NumExtensions ) { - register int i, j; + int i, j; for (i=0; ipScreen->myNum]; if (spentry->num) { @@ -430,22 +420,16 @@ } Bool -RegisterProc(name, pGC, proc) - char *name; - GC *pGC; - ExtensionLookupProc proc; +RegisterProc(char *name, GCPtr pGC, ExtensionLookupProc proc) { return RegisterScreenProc(name, pGC->pScreen, proc); } Bool -RegisterScreenProc(name, pScreen, proc) - char *name; - ScreenPtr pScreen; - ExtensionLookupProc proc; +RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc) { - register ScreenProcEntry *spentry; - register ProcEntryPtr procEntry = (ProcEntryPtr)NULL; + ScreenProcEntry *spentry; + ProcEntryPtr procEntry = (ProcEntryPtr)NULL; char *newname; int i; Index: xc/programs/Xserver/dix/ffs.c diff -u xc/programs/Xserver/dix/ffs.c:1.2 xc/programs/Xserver/dix/ffs.c:1.3 --- xc/programs/Xserver/dix/ffs.c:1.2 Fri Dec 14 14:59:32 2001 +++ xc/programs/Xserver/dix/ffs.c Mon Jan 9 09:59:46 2006 @@ -1,4 +1,4 @@ -/* $Xorg: ffs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/ffs.c,v 1.3 2006/01/09 14:59:46 dawes Exp $ */ /* Copyright 1996, 1998 The Open Group Index: xc/programs/Xserver/dix/gc.c diff -u xc/programs/Xserver/dix/gc.c:3.10 xc/programs/Xserver/dix/gc.c:3.12 --- xc/programs/Xserver/dix/gc.c:3.10 Mon Nov 17 17:20:34 2003 +++ xc/programs/Xserver/dix/gc.c Fri Oct 14 11:16:21 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/gc.c,v 3.10 2003/11/17 22:20:34 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/gc.c,v 3.12 2005/10/14 15:16:21 tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -46,11 +46,9 @@ ******************************************************************/ -/* $Xorg: gc.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#include "X.h" -#include "Xmd.h" -#include "Xproto.h" +#include +#include +#include #include "misc.h" #include "resource.h" #include "gcstruct.h" @@ -72,9 +70,7 @@ unsigned char DefaultDash[2] = {4, 4}; void -ValidateGC(pDraw, pGC) - DrawablePtr pDraw; - GC *pGC; +ValidateGC(DrawablePtr pDraw, GCPtr pGC) { (*pGC->funcs->ValidateGC) (pGC, pGC->stateChanges, pDraw); pGC->stateChanges = 0; @@ -146,15 +142,11 @@ assert(pUnion); _var = (_type)pUnion->ptr; pUnion++; } int -dixChangeGC(client, pGC, mask, pC32, pUnion) - ClientPtr client; - register GC *pGC; - register BITS32 mask; - CARD32 *pC32; - ChangeGCValPtr pUnion; +dixChangeGC(ClientPtr client, GCPtr pGC, BITS32 mask, CARD32 *pC32, + ChangeGCValPtr pUnion) { - register BITS32 index2; - register int error = 0; + BITS32 index2; + int error = 0; PixmapPtr pPixmap; BITS32 maskQ; @@ -529,10 +521,7 @@ /* Publically defined entry to ChangeGC. Just calls dixChangeGC and tells * it that all of the entries are constants or IDs */ int -ChangeGC(pGC, mask, pval) - register GC *pGC; - register BITS32 mask; - XID *pval; +ChangeGC(GCPtr pGC, BITS32 mask, XID *pval) { return (dixChangeGC(NullClient, pGC, mask, pval, NULL)); } @@ -558,11 +547,7 @@ 32 bits long */ int -DoChangeGC(pGC, mask, pval, fPointer) - register GC *pGC; - register BITS32 mask; - XID *pval; - int fPointer; +DoChangeGC(GCPtr pGC, BITS32 mask, XID *pval, int fPointer) { if (fPointer) /* XXX might be a problem on 64 bit big-endian servers */ @@ -586,11 +571,11 @@ AllocateGC(ScreenPtr pScreen) { GCPtr pGC; - register char *ptr; - register DevUnion *ppriv; - register unsigned *sizes; - register unsigned size; - register int i; + char *ptr; + DevUnion *ppriv; + unsigned *sizes; + unsigned size; + int i; pGC = (GCPtr)xalloc(pScreen->totalGCSize); if (pGC) @@ -614,13 +599,9 @@ } GCPtr -CreateGC(pDrawable, mask, pval, pStatus) - DrawablePtr pDrawable; - BITS32 mask; - XID *pval; - int *pStatus; +CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus) { - register GCPtr pGC; + GCPtr pGC; pGC = AllocateGC(pDrawable->pScreen); if (!pGC) @@ -699,8 +680,7 @@ } static Bool -CreateDefaultTile (pGC) - GCPtr pGC; +CreateDefaultTile(GCPtr pGC) { XID tmpval[3]; PixmapPtr pTile; @@ -743,12 +723,9 @@ } int -CopyGC(pgcSrc, pgcDst, mask) - register GC *pgcSrc; - register GC *pgcDst; - register BITS32 mask; +CopyGC(GCPtr pgcSrc, GCPtr pgcDst, BITS32 mask) { - register BITS32 index2; + BITS32 index2; BITS32 maskQ; int error = 0; @@ -911,9 +888,7 @@ /*ARGSUSED*/ int -FreeGC(value, gid) - pointer value; /* must conform to DeleteType */ - XID gid; +FreeGC(pointer value, XID gid) { GCPtr pGC = (GCPtr)value; @@ -933,10 +908,7 @@ } void -SetGCMask(pGC, selectMask, newDataMask) - GCPtr pGC; - Mask selectMask; - Mask newDataMask; +SetGCMask(GCPtr pGC, Mask selectMask, Mask newDataMask) { pGC->stateChanges = (~selectMask & pGC->stateChanges) | (selectMask & newDataMask); @@ -960,11 +932,9 @@ */ GCPtr -CreateScratchGC(pScreen, depth) - ScreenPtr pScreen; - unsigned depth; +CreateScratchGC(ScreenPtr pScreen, unsigned depth) { - register GCPtr pGC; + GCPtr pGC; pGC = AllocateGC(pScreen); if (!pGC) @@ -1014,11 +984,10 @@ } void -FreeGCperDepth(screenNum) - int screenNum; +FreeGCperDepth(int screenNum) { - register int i; - register ScreenPtr pScreen; + int i; + ScreenPtr pScreen; GCPtr *ppGC; pScreen = screenInfo.screens[screenNum]; @@ -1031,11 +1000,10 @@ Bool -CreateGCperDepth(screenNum) - int screenNum; +CreateGCperDepth(int screenNum) { - register int i; - register ScreenPtr pScreen; + int i; + ScreenPtr pScreen; DepthPtr pDepth; GCPtr *ppGC; @@ -1062,10 +1030,9 @@ } Bool -CreateDefaultStipple(screenNum) - int screenNum; +CreateDefaultStipple(int screenNum) { - register ScreenPtr pScreen; + ScreenPtr pScreen; XID tmpval[3]; xRectangle rect; CARD16 w, h; @@ -1100,22 +1067,17 @@ } void -FreeDefaultStipple(screenNum) - int screenNum; +FreeDefaultStipple(int screenNum) { ScreenPtr pScreen = screenInfo.screens[screenNum]; (*pScreen->DestroyPixmap)(pScreen->PixmapPerDepth[0]); } int -SetDashes(pGC, offset, ndash, pdash) -register GCPtr pGC; -unsigned offset; -register unsigned ndash; -register unsigned char *pdash; +SetDashes(GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pdash) { - register long i; - register unsigned char *p, *indash; + long i; + unsigned char *p, *indash; BITS32 maskQ = 0; i = ndash; @@ -1168,13 +1130,10 @@ } int -VerifyRectOrder(nrects, prects, ordering) - int nrects; - xRectangle *prects; - int ordering; +VerifyRectOrder(int nrects, xRectangle *prects, int ordering) { - register xRectangle *prectP, *prectN; - register int i; + xRectangle *prectP, *prectN; + int i; switch(ordering) { @@ -1221,12 +1180,8 @@ } int -SetClipRects(pGC, xOrigin, yOrigin, nrects, prects, ordering) - GCPtr pGC; - int xOrigin, yOrigin; - int nrects; - xRectangle *prects; - int ordering; +SetClipRects(GCPtr pGC, int xOrigin, int yOrigin, int nrects, + xRectangle *prects, int ordering) { int newct, size; xRectangle *prectsNew; @@ -1262,12 +1217,10 @@ you use it often enough it will become real.) */ GCPtr -GetScratchGC(depth, pScreen) - register unsigned depth; - register ScreenPtr pScreen; +GetScratchGC(unsigned depth, ScreenPtr pScreen) { - register int i; - register GCPtr pGC; + int i; + GCPtr pGC; for (i=0; i<=pScreen->numDepths; i++) if ( pScreen->GCperDepth[i]->depth == depth && @@ -1313,11 +1266,10 @@ if not, free it for real */ void -FreeScratchGC(pGC) - register GCPtr pGC; +FreeScratchGC(GCPtr pGC) { - register ScreenPtr pScreen = pGC->pScreen; - register int i; + ScreenPtr pScreen = pGC->pScreen; + int i; for (i=0; i<=pScreen->numDepths; i++) { Index: xc/programs/Xserver/dix/globals.c diff -u xc/programs/Xserver/dix/globals.c:1.13 xc/programs/Xserver/dix/globals.c:1.14 --- xc/programs/Xserver/dix/globals.c:1.13 Wed Dec 3 12:11:29 2003 +++ xc/programs/Xserver/dix/globals.c Fri Oct 14 11:16:21 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/globals.c,v 1.13 2003/12/03 17:11:29 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/globals.c,v 1.14 2005/10/14 15:16:21 tsi Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -46,10 +46,8 @@ ********************************************************/ -/* $Xorg: globals.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - -#include "X.h" -#include "Xmd.h" +#include +#include #include "misc.h" #include "windowstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/dix/glyphcurs.c diff -u xc/programs/Xserver/dix/glyphcurs.c:1.2 xc/programs/Xserver/dix/glyphcurs.c:1.4 --- xc/programs/Xserver/dix/glyphcurs.c:1.2 Fri Dec 14 14:59:32 2001 +++ xc/programs/Xserver/dix/glyphcurs.c Fri Oct 14 11:16:21 2005 @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/dix/glyphcurs.c,v 1.4 2005/10/14 15:16:21 tsi Exp $ */ /************************************************************************ Copyright 1987, 1998 The Open Group @@ -45,10 +46,8 @@ ************************************************************************/ -/* $Xorg: glyphcurs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ - #include "misc.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" #include "scrnintstr.h" #include "gcstruct.h" @@ -71,14 +70,11 @@ */ int -ServerBitsFromGlyph(pfont, ch, cm, ppbits) - FontPtr pfont; - unsigned int ch; - register CursorMetricPtr cm; - unsigned char **ppbits; +ServerBitsFromGlyph(FontPtr pfont, unsigned int ch, CursorMetricPtr cm, + unsigned char **ppbits) { - register ScreenPtr pScreen; - register GCPtr pGC; + ScreenPtr pScreen; + GCPtr pGC; xRectangle rect; PixmapPtr ppix; long nby; @@ -141,10 +137,7 @@ Bool -CursorMetricsFromGlyph( pfont, ch, cm) - register FontPtr pfont; - unsigned ch; - register CursorMetricPtr cm; +CursorMetricsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm) { CharInfoPtr pci; unsigned long nglyphs; Index: xc/programs/Xserver/dix/grabs.c diff -u xc/programs/Xserver/dix/grabs.c:3.5 xc/programs/Xserver/dix/grabs.c:3.7 --- xc/programs/Xserver/dix/grabs.c:3.5 Mon Nov 17 17:20:34 2003 +++ xc/programs/Xserver/dix/grabs.c Fri Oct 14 11:16:22 2005 @@ -1,4 +1,3 @@ -/* $Xorg: grabs.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -46,12 +45,12 @@ SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/dix/grabs.c,v 3.5 2003/11/17 22:20:34 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/grabs.c,v 3.7 2005/10/14 15:16:22 tsi Exp $ */ -#include "X.h" +#include #include "misc.h" #define NEED_EVENTS -#include "Xproto.h" +#include #include "windowstr.h" #include "inputstr.h" #include "cursorstr.h" @@ -65,18 +64,11 @@ #define GETBIT(buf, i) (MASKWORD(buf, i) & BITMASK(i)) GrabPtr -CreateGrab( - int client, - DeviceIntPtr device, - WindowPtr window, - Mask eventMask, - Bool ownerEvents, Bool keyboardMode, Bool pointerMode, - DeviceIntPtr modDevice, - unsigned short modifiers, - int type, - KeyCode keybut, /* key or button */ - WindowPtr confineTo, - CursorPtr cursor) +CreateGrab(int client, DeviceIntPtr device, WindowPtr window, Mask eventMask, + Bool ownerEvents, Bool keyboardMode, Bool pointerMode, + DeviceIntPtr modDevice, unsigned short modifiers, int type, + KeyCode keybut, /* key or button */ + WindowPtr confineTo, CursorPtr cursor) { GrabPtr grab; @@ -125,11 +117,9 @@ /*ARGSUSED*/ int -DeletePassiveGrab(value, id) - pointer value; - XID id; +DeletePassiveGrab(pointer value, XID id) { - register GrabPtr g, prev; + GrabPtr g, prev; GrabPtr pGrab = (GrabPtr)value; /* it is OK if the grab isn't found */ @@ -154,8 +144,8 @@ static Mask * DeleteDetailFromMask(Mask *pDetailMask, unsigned short detail) { - register Mask *mask; - register int i; + Mask *mask; + int i; mask = (Mask *)xalloc(sizeof(Mask) * MasksPerDetailMask); if (mask) @@ -172,10 +162,8 @@ } static Bool -IsInGrabMask( - DetailRec firstDetail, - DetailRec secondDetail, - unsigned short exception) +IsInGrabMask(DetailRec firstDetail, DetailRec secondDetail, + unsigned short exception) { if (firstDetail.exact == exception) { @@ -194,10 +182,8 @@ } static Bool -IdenticalExactDetails( - unsigned short firstExact, - unsigned short secondExact, - unsigned short exception) +IdenticalExactDetails(unsigned short firstExact, unsigned short secondExact, + unsigned short exception) { if ((firstExact == exception) || (secondExact == exception)) return FALSE; @@ -209,10 +195,8 @@ } static Bool -DetailSupersedesSecond( - DetailRec firstDetail, - DetailRec secondDetail, - unsigned short exception) +DetailSupersedesSecond(DetailRec firstDetail, DetailRec secondDetail, + unsigned short exception) { if (IsInGrabMask(firstDetail, secondDetail, exception)) return TRUE; @@ -240,8 +224,7 @@ } Bool -GrabMatchesSecond(pFirstGrab, pSecondGrab) - GrabPtr pFirstGrab, pSecondGrab; +GrabMatchesSecond(GrabPtr pFirstGrab, GrabPtr pSecondGrab) { if ((pFirstGrab->device != pSecondGrab->device) || (pFirstGrab->modifierDevice != pSecondGrab->modifierDevice) || @@ -272,8 +255,7 @@ } int -AddPassiveGrabToList(pGrab) - GrabPtr pGrab; +AddPassiveGrabToList(GrabPtr pGrab) { GrabPtr grab; @@ -306,10 +288,9 @@ */ Bool -DeletePassiveGrabFromList(pMinuendGrab) - GrabPtr pMinuendGrab; +DeletePassiveGrabFromList(GrabPtr pMinuendGrab) { - register GrabPtr grab; + GrabPtr grab; GrabPtr *deletes, *adds; Mask ***updates, **details; int i, ndels, nadds, nups; Index: xc/programs/Xserver/dix/initatoms.c diff -u xc/programs/Xserver/dix/initatoms.c:3.0 xc/programs/Xserver/dix/initatoms.c:3.1 --- xc/programs/Xserver/dix/initatoms.c:3.0 Mon Apr 15 07:19:50 1996 +++ xc/programs/Xserver/dix/initatoms.c Fri Oct 14 11:16:22 2005 @@ -2,9 +2,10 @@ * * Do not change! Changing this file implies a protocol change! */ +/* $XFree86: xc/programs/Xserver/dix/initatoms.c,v 3.1 2005/10/14 15:16:22 tsi Exp $ */ -#include "X.h" -#include "Xatom.h" +#include +#include #include "misc.h" #include "dix.h" void MakePredeclaredAtoms() Index: xc/programs/Xserver/dix/main.c diff -u xc/programs/Xserver/dix/main.c:3.45 xc/programs/Xserver/dix/main.c:3.50 --- xc/programs/Xserver/dix/main.c:3.45 Wed Jun 30 16:21:38 2004 +++ xc/programs/Xserver/dix/main.c Thu Mar 16 16:43:59 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/main.c,v 3.45 2004/06/30 20:21:38 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/main.c,v 3.50 2006/03/16 21:43:59 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,7 +45,6 @@ SOFTWARE. ******************************************************************/ -/* $Xorg: main.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ /* The panoramix components contained the following notice */ /**************************************************************** @@ -69,12 +68,10 @@ * * *****************************************************************/ -/* $TOG: main.c /main/86 1998/02/09 14:20:03 kaleb $ */ - #define NEED_EVENTS -#include "X.h" -#include "Xos.h" /* for unistd.h */ -#include "Xproto.h" +#include +#include /* for unistd.h */ +#include #include "scrnintstr.h" #include "misc.h" #include "os.h" @@ -86,28 +83,28 @@ #include "colormap.h" #include "colormapst.h" #include "cursorstr.h" -#include "font.h" +#include #include "opaque.h" #include "servermd.h" #include "site.h" #include "dixfont.h" #include "extnsionst.h" -#ifdef PANORAMIX -#include "panoramiXsrv.h" -#else #include "dixevents.h" /* InitEvents() */ #include "dispatch.h" /* InitProcVectors() */ + +#ifdef PANORAMIX +#include "panoramiXsrv.h" #endif #ifdef DPMSExtension #define DPMS_SERVER -#include "dpms.h" +#include #include "dpmsproc.h" #endif -extern int InitClientPrivates( - ClientPtr /*client*/ -); +#ifdef XPRINT +#include "DiPrint.h" +#endif extern void Dispatch( void @@ -146,11 +143,7 @@ */ /*ARGSUSED*/ void -ReplyNotSwappd( - ClientPtr pClient , - int size , - void * pbuf - ) +ReplyNotSwappd(ClientPtr pClient, int size, void *pbuf) { FatalError("Not implemented"); } @@ -431,6 +424,8 @@ Dispatch(); + OsPrepareShutdown((dispatchException & DE_TERMINATE) != 0); + /* Now free up whatever must be freed */ if (screenIsSaved == SCREEN_SAVER_ON) SaveScreens(SCREEN_SAVER_OFF, ScreenSaverReset); @@ -486,12 +481,13 @@ xfree(ConnectionInfo); ConnectionInfo = NULL; + OsPrepareRestart(); } return(0); } static int VendorRelease = VENDOR_RELEASE; -static char *VendorString = VENDOR_STRING; +static const char *VendorString = VENDOR_STRING; void SetVendorRelease(int release) @@ -500,7 +496,7 @@ } void -SetVendorString(char *string) +SetVendorString(const char *string) { VendorString = string; } @@ -657,15 +653,7 @@ */ int -AddScreen( - Bool (* pfnInit)( - int /*index*/, - ScreenPtr /*pScreen*/, - int /*argc*/, - char ** /*argv*/ - ), - int argc, - char **argv) +AddScreen(ScrnInitProcPtr pfnInit, int argc, char **argv) { int i; @@ -770,8 +758,7 @@ } static void -FreeScreen(pScreen) - ScreenPtr pScreen; +FreeScreen(ScreenPtr pScreen) { xfree(pScreen->WindowPrivateSizes); xfree(pScreen->GCPrivateSizes); @@ -781,3 +768,14 @@ xfree(pScreen->devPrivates); xfree(pScreen); } + +Bool +IsXineramaActive(void) +{ +#ifdef PANORAMIX + if (!noPanoramiXExtension) + return TRUE; +#endif + + return FALSE; +} Index: xc/programs/Xserver/dix/pixmap.c diff -u xc/programs/Xserver/dix/pixmap.c:3.5 xc/programs/Xserver/dix/pixmap.c:3.8 --- xc/programs/Xserver/dix/pixmap.c:3.5 Fri Dec 14 14:59:32 2001 +++ xc/programs/Xserver/dix/pixmap.c Fri Oct 14 11:16:22 2005 @@ -1,4 +1,3 @@ -/* $Xorg: pixmap.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ /* Copyright 1993, 1998 The Open Group @@ -26,9 +25,9 @@ from The Open Group. */ -/* $XFree86: xc/programs/Xserver/dix/pixmap.c,v 3.5 2001/12/14 19:59:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/pixmap.c,v 3.8 2005/10/14 15:16:22 tsi Exp $ */ -#include "X.h" +#include #include "scrnintstr.h" #include "misc.h" #include "os.h" @@ -48,15 +47,8 @@ /* callable by ddx */ PixmapPtr -GetScratchPixmapHeader(pScreen, width, height, depth, bitsPerPixel, devKind, - pPixData) - ScreenPtr pScreen; - int width; - int height; - int depth; - int bitsPerPixel; - int devKind; - pointer pPixData; +GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth, + int bitsPerPixel, int devKind, pointer pPixData) { PixmapPtr pPixmap = pScreen->pScratchPixmap; @@ -78,8 +70,7 @@ /* callable by ddx */ void -FreeScratchPixmapHeader(pPixmap) - PixmapPtr pPixmap; +FreeScratchPixmapHeader(PixmapPtr pPixmap) { if (pPixmap) { @@ -95,8 +86,7 @@ Bool -CreateScratchPixmapsForScreen(scrnum) - int scrnum; +CreateScratchPixmapsForScreen(int scrnum) { /* let it be created on first use */ screenInfo.screens[scrnum]->pScratchPixmap = NULL; @@ -105,8 +95,7 @@ void -FreeScratchPixmapsForScreen(scrnum) - int scrnum; +FreeScratchPixmapsForScreen(int scrnum) { FreeScratchPixmapHeader(screenInfo.screens[scrnum]->pScratchPixmap); } @@ -114,9 +103,7 @@ /* callable by ddx */ PixmapPtr -AllocatePixmap(pScreen, pixDataSize) - ScreenPtr pScreen; - int pixDataSize; +AllocatePixmap(ScreenPtr pScreen, int pixDataSize) { PixmapPtr pPixmap; #ifdef PIXPRIV @@ -126,7 +113,9 @@ unsigned size; int i; - pPixmap = (PixmapPtr)xalloc(pScreen->totalPixmapSize + pixDataSize); + if (((unsigned)(-1) - pScreen->totalPixmapSize) < (unsigned)pixDataSize) + return NullPixmap; + pPixmap = xalloc(pScreen->totalPixmapSize + (unsigned)pixDataSize); if (!pPixmap) return NullPixmap; ppriv = (DevUnion *)(pPixmap + 1); @@ -144,7 +133,7 @@ ppriv->ptr = (pointer)NULL; } #else - pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec) + pixDataSize); + pPixmap = xalloc(sizeof(PixmapRec) + (unsigned)pixDataSize); #endif return pPixmap; } Index: xc/programs/Xserver/dix/privates.c diff -u xc/programs/Xserver/dix/privates.c:3.8 xc/programs/Xserver/dix/privates.c:3.10 --- xc/programs/Xserver/dix/privates.c:3.8 Fri Dec 14 14:59:32 2001 +++ xc/programs/Xserver/dix/privates.c Fri Oct 14 11:16:22 2005 @@ -1,4 +1,3 @@ -/* $Xorg: privates.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ /* Copyright 1993, 1998 The Open Group @@ -26,9 +25,9 @@ from The Open Group. */ -/* $XFree86: xc/programs/Xserver/dix/privates.c,v 3.8 2001/12/14 19:59:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/privates.c,v 3.10 2005/10/14 15:16:22 tsi Exp $ */ -#include "X.h" +#include #include "scrnintstr.h" #include "misc.h" #include "os.h" @@ -73,9 +72,7 @@ } Bool -AllocateClientPrivate(index2, amount) - int index2; - unsigned amount; +AllocateClientPrivate(int index2, unsigned amount) { unsigned oldamount; @@ -166,10 +163,7 @@ } Bool -AllocateWindowPrivate(pScreen, index2, amount) - register ScreenPtr pScreen; - int index2; - unsigned amount; +AllocateWindowPrivate(ScreenPtr pScreen, int index2, unsigned amount) { unsigned oldamount; @@ -219,10 +213,7 @@ } Bool -AllocateGCPrivate(pScreen, index2, amount) - register ScreenPtr pScreen; - int index2; - unsigned amount; +AllocateGCPrivate(ScreenPtr pScreen, int index2, unsigned amount) { unsigned oldamount; @@ -272,10 +263,7 @@ } Bool -AllocatePixmapPrivate(pScreen, index2, amount) - register ScreenPtr pScreen; - int index2; - unsigned amount; +AllocatePixmapPrivate(ScreenPtr pScreen, int index2, unsigned amount) { unsigned oldamount; @@ -322,10 +310,7 @@ int -AllocateColormapPrivateIndex (initPrivFunc) - -InitCmapPrivFunc initPrivFunc; - +AllocateColormapPrivateIndex(InitCmapPrivFunc initPrivFunc) { int index; int i; Index: xc/programs/Xserver/dix/property.c diff -u xc/programs/Xserver/dix/property.c:3.14 xc/programs/Xserver/dix/property.c:3.16 --- xc/programs/Xserver/dix/property.c:3.14 Sat Oct 23 11:29:27 2004 +++ xc/programs/Xserver/dix/property.c Fri Oct 14 11:16:22 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/property.c,v 3.14 2004/10/23 15:29:27 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/property.c,v 3.16 2005/10/14 15:16:22 tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,12 +45,11 @@ SOFTWARE. ******************************************************************/ -/* $Xorg: property.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */ -#include "X.h" +#include #define NEED_REPLIES #define NEED_EVENTS -#include "Xproto.h" +#include #include "windowstr.h" #include "propertyst.h" #include "dixstruct.h" @@ -58,7 +57,7 @@ #include "swaprep.h" #ifdef XCSECURITY #define _SECURITY_SERVER -#include "security.h" +#include #endif #ifdef LBX #include "lbxserve.h" @@ -67,7 +66,8 @@ #if defined(LBX) || defined(LBX_COMPAT) #if 0 /* no header in X11 environment, not used in X11 environment */ -int fWriteToClient(ClientPtr client, int len, char *buf) +int +fWriteToClient(ClientPtr client, int len, char *buf) { return WriteToClient(client, len, buf); } @@ -87,11 +87,10 @@ #ifdef notdef static void -PrintPropertys(pWin) - WindowPtr pWin; +PrintPropertys(WindowPtr pWin) { PropertyPtr pProp; - register int j; + int j; pProp = pWin->userProps; while (pProp) @@ -107,13 +106,12 @@ #endif int -ProcRotateProperties(client) - ClientPtr client; +ProcRotateProperties(ClientPtr client) { int i, j, delta; REQUEST(xRotatePropertiesReq); WindowPtr pWin; - register Atom * atoms; + Atom * atoms; PropertyPtr * props; /* array of pointer */ PropertyPtr pProp; xEvent event; @@ -200,8 +198,7 @@ } int -ProcChangeProperty(client) - ClientPtr client; +ProcChangeProperty(ClientPtr client) { WindowPtr pWin; char format, mode; @@ -274,13 +271,8 @@ } int -ChangeWindowProperty(pWin, property, type, format, mode, len, value, sendevent) - WindowPtr pWin; - Atom property, type; - int format, mode; - unsigned long len; - pointer value; - Bool sendevent; +ChangeWindowProperty(WindowPtr pWin, Atom property, Atom type, int format, + int mode, unsigned long len, pointer value, Bool sendevent) { #ifdef LBX return LbxChangeWindowProperty(NULL, pWin, property, type, @@ -397,9 +389,7 @@ } int -DeleteProperty(pWin, propName) - WindowPtr pWin; - Atom propName; +DeleteProperty(WindowPtr pWin, Atom propName) { PropertyPtr pProp, prevProp; xEvent event; @@ -442,8 +432,7 @@ } void -DeleteAllWindowProperties(pWin) - WindowPtr pWin; +DeleteAllWindowProperties(WindowPtr pWin) { PropertyPtr pProp, pNextProp; xEvent event; @@ -469,11 +458,8 @@ } static int -NullPropertyReply( - ClientPtr client, - ATOM propertyType, - int format, - xGetPropertyReply *reply) +NullPropertyReply(ClientPtr client, ATOM propertyType, int format, + xGetPropertyReply *reply) { reply->nItems = 0; reply->length = 0; @@ -495,8 +481,7 @@ *****************/ int -ProcGetProperty(client) - ClientPtr client; +ProcGetProperty(ClientPtr client) { PropertyPtr pProp, prevProp; unsigned long n, len, ind; @@ -651,8 +636,7 @@ } int -ProcListProperties(client) - ClientPtr client; +ProcListProperties(ClientPtr client) { Atom *pAtoms = NULL, *temppAtoms; xListPropertiesReply xlpr; @@ -699,8 +683,7 @@ } int -ProcDeleteProperty(client) - register ClientPtr client; +ProcDeleteProperty(ClientPtr client) { WindowPtr pWin; REQUEST(xDeletePropertyReq); Index: xc/programs/Xserver/dix/resource.c diff -u xc/programs/Xserver/dix/resource.c:3.14 xc/programs/Xserver/dix/resource.c:3.17 --- xc/programs/Xserver/dix/resource.c:3.14 Mon Nov 17 17:20:34 2003 +++ xc/programs/Xserver/dix/resource.c Sun Feb 19 10:51:19 2006 @@ -45,11 +45,6 @@ ********************************************************/ -/* $Xorg: resource.c,v 1.5 2001/02/09 02:04:40 xorgcvs Exp $ */ - - -/* $TOG: resource.c /main/41 1998/02/09 14:20:31 kaleb $ */ - /* Routines to manage various kinds of resources: * * CreateNewResourceType, CreateNewResourceClass, InitClientResources, @@ -72,10 +67,10 @@ * 1, and an otherwise arbitrary ID in the low 22 bits, we can create a * resource "owned" by the client. */ -/* $XFree86: xc/programs/Xserver/dix/resource.c,v 3.14 2003/11/17 22:20:34 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/resource.c,v 3.17 2006/02/19 15:51:19 tsi Exp $ */ #define NEED_EVENTS -#include "X.h" +#include #include "misc.h" #include "os.h" #include "resource.h" @@ -128,11 +123,12 @@ static DeleteType *DeleteFuncs = (DeleteType *)NULL; -#ifdef XResExtension +#ifdef RES Atom * ResourceNames = NULL; -void RegisterResourceName (RESTYPE type, char *name) +void +RegisterResourceName(RESTYPE type, char *name) { ResourceNames[type & TypeMask] = MakeAtom(name, strlen(name), TRUE); } @@ -140,8 +136,7 @@ #endif RESTYPE -CreateNewResourceType(deleteFunc) - DeleteType deleteFunc; +CreateNewResourceType(DeleteType deleteFunc) { RESTYPE next = lastResourceType + 1; DeleteType *funcs; @@ -153,7 +148,7 @@ if (!funcs) return 0; -#ifdef XResExtension +#ifdef RES { Atom *newnames; newnames = xrealloc(ResourceNames, (next + 1) * sizeof(Atom)); @@ -191,10 +186,9 @@ *****************/ Bool -InitClientResources(client) - ClientPtr client; +InitClientResources(ClientPtr client) { - register int i, j; + int i, j; if (client == serverClient) { @@ -218,7 +212,7 @@ DeleteFuncs[RT_OTHERCLIENT & TypeMask] = OtherClientGone; DeleteFuncs[RT_PASSIVEGRAB & TypeMask] = DeletePassiveGrab; -#ifdef XResExtension +#ifdef RES if(ResourceNames) xfree(ResourceNames); ResourceNames = xalloc((lastResourceType + 1) * sizeof(Atom)); @@ -251,7 +245,7 @@ static int -Hash(int client, register XID id) +Hash(int client, XID id) { id &= RESOURCE_ID_MASK; switch (clientTable[client].hashsize) @@ -273,13 +267,9 @@ } static XID -AvailableID( - register int client, - register XID id, - register XID maxid, - register XID goodid) +AvailableID(int client, XID id, XID maxid, XID goodid) { - register ResourcePtr res; + ResourcePtr res; if ((goodid >= id) && (goodid <= maxid)) return goodid; @@ -295,15 +285,12 @@ } void -GetXIDRange(client, server, minp, maxp) - int client; - Bool server; - XID *minp, *maxp; +GetXIDRange(int client, Bool server, XID *minp, XID *maxp) { - register XID id, maxid; - register ResourcePtr *resp; - register ResourcePtr res; - register int i; + XID id, maxid; + ResourcePtr *resp; + ResourcePtr res; + int i; XID goodid; id = (Mask)client << CLIENTOFFSET; @@ -348,10 +335,7 @@ */ unsigned int -GetXIDList(pClient, count, pids) - ClientPtr pClient; - unsigned int count; - XID *pids; +GetXIDList(ClientPtr pClient, unsigned int count, XID *pids) { unsigned int found = 0; XID id = pClient->clientAsMask; @@ -378,8 +362,7 @@ */ XID -FakeClientID(client) - register int client; +FakeClientID(int client) { XID id, maxid; @@ -400,14 +383,11 @@ } Bool -AddResource(id, type, value) - XID id; - RESTYPE type; - pointer value; +AddResource(XID id, RESTYPE type, pointer value) { int client; - register ClientResourceRec *rrec; - register ResourcePtr res, *head; + ClientResourceRec *rrec; + ResourcePtr res, *head; client = CLIENT_ID(id); rrec = &clientTable[client]; @@ -439,13 +419,12 @@ } static void -RebuildTable(client) - int client; +RebuildTable(int client) { - register int j; - register ResourcePtr res, next; + int j; + ResourcePtr res, next; ResourcePtr **tails, *resources; - register ResourcePtr **tptr, *rptr; + ResourcePtr **tptr, *rptr; /* * For now, preserve insertion order, since some ddx layers depend @@ -489,14 +468,12 @@ } void -FreeResource(id, skipDeleteFuncType) - XID id; - RESTYPE skipDeleteFuncType; +FreeResource(XID id, RESTYPE skipDeleteFuncType) { int cid; - register ResourcePtr res; - register ResourcePtr *prev, *head; - register int *eltptr; + ResourcePtr res; + ResourcePtr *prev, *head; + int *eltptr; int elements; Bool gotOne = FALSE; @@ -538,14 +515,11 @@ void -FreeResourceByType(id, type, skipFree) - XID id; - RESTYPE type; - Bool skipFree; +FreeResourceByType(XID id, RESTYPE type, Bool skipFree) { int cid; - register ResourcePtr res; - register ResourcePtr *prev, *head; + ResourcePtr res; + ResourcePtr *prev, *head; if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) { head = &clientTable[cid].resources[Hash(cid, id)]; @@ -581,13 +555,10 @@ */ Bool -ChangeResourceValue (id, rtype, value) - XID id; - RESTYPE rtype; - pointer value; +ChangeResourceValue(XID id, RESTYPE rtype, pointer value) { int cid; - register ResourcePtr res; + ResourcePtr res; if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) { @@ -618,10 +589,10 @@ FindResType func, pointer cdata ){ - register ResourcePtr *resources; - register ResourcePtr this, next; + ResourcePtr *resources; + ResourcePtr this, next; int i, elements; - register int *eltptr; + int *eltptr; if (!client) client = serverClient; @@ -649,10 +620,10 @@ FindAllRes func, pointer cdata ){ - register ResourcePtr *resources; - register ResourcePtr this, next; + ResourcePtr *resources; + ResourcePtr this, next; int i, elements; - register int *eltptr; + int *eltptr; if (!client) client = serverClient; @@ -733,11 +704,10 @@ } void -FreeClientResources(client) - ClientPtr client; +FreeClientResources(ClientPtr client) { - register ResourcePtr *resources; - register ResourcePtr this; + ResourcePtr *resources; + ResourcePtr this; int j; /* This routine shouldn't be called with a null client, but just in @@ -792,9 +762,7 @@ } Bool -LegalNewID(id, client) - XID id; - register ClientPtr client; +LegalNewID(XID id, ClientPtr client) { #ifdef PANORAMIX @@ -815,7 +783,8 @@ #ifdef XCSECURITY -/* SecurityLookupIDByType and SecurityLookupIDByClass: +/* + * SecurityLookupIDByType and SecurityLookupIDByClass: * These are the heart of the resource ID security system. They take * two additional arguments compared to the old LookupID functions: * the client doing the lookup, and the access mode (see resource.h). @@ -824,14 +793,10 @@ */ pointer -SecurityLookupIDByType(client, id, rtype, mode) - ClientPtr client; - XID id; - RESTYPE rtype; - Mask mode; +SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype, Mask mode) { int cid; - register ResourcePtr res; + ResourcePtr res; pointer retval = NULL; assert(client == NullClient || @@ -857,14 +822,10 @@ pointer -SecurityLookupIDByClass(client, id, classes, mode) - ClientPtr client; - XID id; - RESTYPE classes; - Mask mode; +SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes, Mask mode) { int cid; - register ResourcePtr res = NULL; + ResourcePtr res = NULL; pointer retval = NULL; assert(client == NullClient || @@ -888,23 +849,20 @@ return retval; } -/* We can't replace the LookupIDByType and LookupIDByClass functions with +/* + * We can't replace the LookupIDByType and LookupIDByClass functions with * macros because of compatibility with loadable servers. */ pointer -LookupIDByType(id, rtype) - XID id; - RESTYPE rtype; +LookupIDByType(XID id, RESTYPE rtype) { return SecurityLookupIDByType(NullClient, id, rtype, SecurityUnknownAccess); } pointer -LookupIDByClass(id, classes) - XID id; - RESTYPE classes; +LookupIDByClass(XID id, RESTYPE classes) { return SecurityLookupIDByClass(NullClient, id, classes, SecurityUnknownAccess); @@ -916,12 +874,10 @@ * LookupIDByType returns the object with the given id and type, else NULL. */ pointer -LookupIDByType(id, rtype) - XID id; - RESTYPE rtype; +LookupIDByType(XID id, RESTYPE rtype) { int cid; - register ResourcePtr res; + ResourcePtr res; if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) @@ -940,12 +896,10 @@ * given classes, else NULL. */ pointer -LookupIDByClass(id, classes) - XID id; - RESTYPE classes; +LookupIDByClass(XID id, RESTYPE classes) { int cid; - register ResourcePtr res; + ResourcePtr res; if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) @@ -959,4 +913,16 @@ return (pointer)NULL; } +pointer +SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype, Mask mode) +{ + return LookupIDByType(id, rtype); +} + +pointer +SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes, Mask mode) +{ + return LookupIDByClass(id, classes); +} + #endif /* XCSECURITY */ Index: xc/programs/Xserver/dix/swaprep.c diff -u xc/programs/Xserver/dix/swaprep.c:3.8 xc/programs/Xserver/dix/swaprep.c:3.10 --- xc/programs/Xserver/dix/swaprep.c:3.8 Mon Nov 17 17:20:35 2003 +++ xc/programs/Xserver/dix/swaprep.c Fri Oct 14 11:16:22 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/swaprep.c,v 3.8 2003/11/17 22:20:35 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/swaprep.c,v 3.10 2005/10/14 15:16:22 tsi Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -46,15 +46,13 @@ ********************************************************/ -/* $Xorg: swaprep.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ - -#include "X.h" +#include #define NEED_REPLIES #define NEED_EVENTS -#include "Xproto.h" +#include #include "misc.h" #include "dixstruct.h" -#include "fontstruct.h" +#include #include "scrnintstr.h" #include "swaprep.h" #include "globals.h" @@ -76,13 +74,10 @@ /* Thanks to Jack Palevich for testing and subsequently rewriting all this */ void -Swap32Write(pClient, size, pbuf) - ClientPtr pClient; - int size; /* in bytes */ - register CARD32 *pbuf; +Swap32Write(ClientPtr pClient, int size /* in bytes */, CARD32 *pbuf) { - register int i; - register char n; + int i; + char n; size >>= 2; for(i = 0; i < size; i++) @@ -95,14 +90,11 @@ } void -CopySwap32Write(pClient, size, pbuf) - ClientPtr pClient; - int size; /* in bytes */ - CARD32 *pbuf; +CopySwap32Write(ClientPtr pClient, int size /* in bytes */, CARD32 *pbuf) { int bufsize = size; CARD32 *pbufT; - register CARD32 *from, *to, *fromLast, *toLast; + CARD32 *from, *to, *fromLast, *toLast; CARD32 tmpbuf[1]; /* Allocate as big a buffer as we can... */ @@ -142,14 +134,11 @@ } void -CopySwap16Write(pClient, size, pbuf) - ClientPtr pClient; - int size; /* in bytes */ - short *pbuf; +CopySwap16Write(ClientPtr pClient, int size /*in bytes*/, short *pbuf) { int bufsize = size; short *pbufT; - register short *from, *to, *fromLast, *toLast; + short *from, *to, *fromLast, *toLast; short tmpbuf[2]; /* Allocate as big a buffer as we can... */ @@ -191,12 +180,9 @@ /* Extra-small reply */ void -SGenericReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGenericReply *pRep; +SGenericReply(ClientPtr pClient, int size, xGenericReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); (void)WriteToClient(pClient, size, (char *) pRep); @@ -204,12 +190,10 @@ /* Extra-large reply */ void -SGetWindowAttributesReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetWindowAttributesReply *pRep; +SGetWindowAttributesReply(ClientPtr pClient, int size, + xGetWindowAttributesReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -225,12 +209,9 @@ } void -SGetGeometryReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetGeometryReply *pRep; +SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->root, n); @@ -243,12 +224,9 @@ } void -SQueryTreeReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xQueryTreeReply *pRep; +SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -259,12 +237,9 @@ } void -SInternAtomReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xInternAtomReply *pRep; +SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->atom, n); @@ -272,12 +247,9 @@ } void -SGetAtomNameReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetAtomNameReply *pRep; +SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -287,12 +259,9 @@ void -SGetPropertyReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetPropertyReply *pRep; +SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -303,12 +272,9 @@ } void -SListPropertiesReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xListPropertiesReply *pRep; +SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -317,12 +283,10 @@ } void -SGetSelectionOwnerReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetSelectionOwnerReply *pRep; +SGetSelectionOwnerReply(ClientPtr pClient, int size, + xGetSelectionOwnerReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->owner, n); @@ -331,12 +295,9 @@ void -SQueryPointerReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xQueryPointerReply *pRep; +SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->root, n); @@ -350,10 +311,9 @@ } void -SwapTimecoord(pCoord) - xTimecoord *pCoord; +SwapTimecoord(xTimecoord *pCoord) { - register char n; + char n; swapl(&pCoord->time, n); swaps(&pCoord->x, n); @@ -361,10 +321,7 @@ } void -SwapTimeCoordWrite(pClient, size, pRep) - ClientPtr pClient; - int size; - xTimecoord *pRep; +SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord *pRep) { int i, n; xTimecoord *pRepT; @@ -380,12 +337,9 @@ } void -SGetMotionEventsReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetMotionEventsReply *pRep; +SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -394,12 +348,9 @@ } void -STranslateCoordsReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xTranslateCoordsReply *pRep; +STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->child, n); @@ -409,12 +360,9 @@ } void -SGetInputFocusReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetInputFocusReply *pRep; +SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->focus, n); @@ -423,12 +371,9 @@ /* extra long reply */ void -SQueryKeymapReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xQueryKeymapReply *pRep; +SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -439,10 +384,9 @@ static #endif void -SwapCharInfo(pInfo) - xCharInfo *pInfo; +SwapCharInfo(xCharInfo *pInfo) { - register char n; + char n; swaps(&pInfo->leftSideBearing, n); swaps(&pInfo->rightSideBearing, n); @@ -453,10 +397,9 @@ } static void -SwapFontInfo(pr) - xQueryFontReply *pr; +SwapFontInfo(xQueryFontReply *pr) { - register char n; + char n; swaps(&pr->minCharOrByte2, n); swaps(&pr->maxCharOrByte2, n); @@ -473,15 +416,13 @@ static #endif void -SwapFont( pr, hasGlyphs) - xQueryFontReply * pr; - Bool hasGlyphs; +SwapFont(xQueryFontReply *pr, Bool hasGlyphs) { unsigned i; xCharInfo * pxci; unsigned nchars, nprops; char *pby; - register char n; + char n; swaps(&pr->sequenceNumber, n); swapl(&pr->length, n); @@ -507,22 +448,17 @@ } void -SQueryFontReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xQueryFontReply *pRep; +SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply *pRep) { SwapFont(pRep, TRUE); (void)WriteToClient(pClient, size, (char *) pRep); } void -SQueryTextExtentsReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xQueryTextExtentsReply *pRep; +SQueryTextExtentsReply(ClientPtr pClient, int size, + xQueryTextExtentsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swaps(&pRep->fontAscent, n); @@ -536,12 +472,9 @@ } void -SListFontsReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xListFontsReply *pRep; +SListFontsReply(ClientPtr pClient, int size, xListFontsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -550,22 +483,17 @@ } void -SListFontsWithInfoReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xListFontsWithInfoReply *pRep; +SListFontsWithInfoReply(ClientPtr pClient, int size, + xListFontsWithInfoReply *pRep) { SwapFont((xQueryFontReply *)pRep, FALSE); (void)WriteToClient(pClient, size, (char *) pRep); } void -SGetFontPathReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetFontPathReply *pRep; +SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -574,12 +502,9 @@ } void -SGetImageReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetImageReply *pRep; +SGetImageReply(ClientPtr pClient, int size, xGetImageReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -589,12 +514,10 @@ } void -SListInstalledColormapsReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xListInstalledColormapsReply *pRep; +SListInstalledColormapsReply(ClientPtr pClient, int size, + xListInstalledColormapsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -603,12 +526,9 @@ } void -SAllocColorReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xAllocColorReply *pRep; +SAllocColorReply(ClientPtr pClient, int size, xAllocColorReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swaps(&pRep->red, n); @@ -619,12 +539,9 @@ } void -SAllocNamedColorReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xAllocNamedColorReply *pRep; +SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->pixel, n); @@ -638,12 +555,9 @@ } void -SAllocColorCellsReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xAllocColorCellsReply *pRep; +SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -654,12 +568,10 @@ void -SAllocColorPlanesReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xAllocColorPlanesReply *pRep; +SAllocColorPlanesReply(ClientPtr pClient, int size, + xAllocColorPlanesReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -671,10 +583,9 @@ } void -SwapRGB(prgb) - xrgb *prgb; +SwapRGB(xrgb *prgb) { - register char n; + char n; swaps(&prgb->red, n); swaps(&prgb->green, n); @@ -682,10 +593,7 @@ } void -SQColorsExtend(pClient, size, prgb) - ClientPtr pClient; - int size; - xrgb *prgb; +SQColorsExtend(ClientPtr pClient, int size, xrgb *prgb) { int i, n; xrgb *prgbT; @@ -701,12 +609,9 @@ } void -SQueryColorsReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xQueryColorsReply *pRep; +SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -715,12 +620,9 @@ } void -SLookupColorReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xLookupColorReply *pRep; +SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swaps(&pRep->exactRed, n); @@ -733,12 +635,9 @@ } void -SQueryBestSizeReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xQueryBestSizeReply *pRep; +SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swaps(&pRep->width, n); @@ -747,12 +646,9 @@ } void -SListExtensionsReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xListExtensionsReply *pRep; +SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -760,12 +656,10 @@ } void -SGetKeyboardMappingReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetKeyboardMappingReply *pRep; +SGetKeyboardMappingReply(ClientPtr pClient, int size, + xGetKeyboardMappingReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -773,12 +667,10 @@ } void -SGetPointerMappingReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetPointerMappingReply *pRep; +SGetPointerMappingReply(ClientPtr pClient, int size, + xGetPointerMappingReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -786,12 +678,10 @@ } void -SGetModifierMappingReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetModifierMappingReply *pRep; +SGetModifierMappingReply(ClientPtr pClient, int size, + xGetModifierMappingReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -799,12 +689,10 @@ } void -SGetKeyboardControlReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetKeyboardControlReply *pRep; +SGetKeyboardControlReply(ClientPtr pClient, int size, + xGetKeyboardControlReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -815,12 +703,10 @@ } void -SGetPointerControlReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetPointerControlReply *pRep; +SGetPointerControlReply(ClientPtr pClient, int size, + xGetPointerControlReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swaps(&pRep->accelNumerator, n); @@ -830,12 +716,9 @@ } void -SGetScreenSaverReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xGetScreenSaverReply *pRep; +SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swaps(&pRep->timeout, n); @@ -844,17 +727,14 @@ } void -SLHostsExtend(pClient, size, buf) - ClientPtr pClient; - int size; - char *buf; +SLHostsExtend(ClientPtr pClient, int size, char *buf) { char *bufT = buf; char *endbuf = buf + size; while (bufT < endbuf) { xHostEntry *host = (xHostEntry *) bufT; int len = host->length; - register char n; + char n; swaps (&host->length, n); bufT += sizeof (xHostEntry) + (((len + 3) >> 2) << 2); } @@ -862,12 +742,9 @@ } void -SListHostsReply(pClient, size, pRep) - ClientPtr pClient; - int size; - xListHostsReply *pRep; +SListHostsReply(ClientPtr pClient, int size, xListHostsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -878,8 +755,7 @@ void -SErrorEvent(from, to) - xError *from, *to; +SErrorEvent(xError *from, xError *to) { to->type = X_Error; to->errorCode = from->errorCode; @@ -890,8 +766,7 @@ } void -SKeyButtonPtrEvent(from, to) - xEvent *from, *to; +SKeyButtonPtrEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; to->u.u.detail = from->u.u.detail; @@ -919,8 +794,7 @@ } void -SEnterLeaveEvent(from, to) - xEvent *from, *to; +SEnterLeaveEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; to->u.u.detail = from->u.u.detail; @@ -939,8 +813,7 @@ } void -SFocusEvent(from, to) - xEvent *from, *to; +SFocusEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; to->u.u.detail = from->u.u.detail; @@ -950,8 +823,7 @@ } void -SExposeEvent(from, to) - xEvent *from, *to; +SExposeEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -964,8 +836,7 @@ } void -SGraphicsExposureEvent(from, to) - xEvent *from, *to; +SGraphicsExposureEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -988,8 +859,7 @@ } void -SNoExposureEvent(from, to) - xEvent *from, *to; +SNoExposureEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -999,8 +869,7 @@ } void -SVisibilityEvent(from, to) - xEvent *from, *to; +SVisibilityEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1009,8 +878,7 @@ } void -SCreateNotifyEvent(from, to) - xEvent *from, *to; +SCreateNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1026,8 +894,7 @@ } void -SDestroyNotifyEvent(from, to) - xEvent *from, *to; +SDestroyNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1036,8 +903,7 @@ } void -SUnmapNotifyEvent(from, to) - xEvent *from, *to; +SUnmapNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1047,8 +913,7 @@ } void -SMapNotifyEvent(from, to) - xEvent *from, *to; +SMapNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1058,8 +923,7 @@ } void -SMapRequestEvent(from, to) - xEvent *from, *to; +SMapRequestEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1068,8 +932,7 @@ } void -SReparentEvent(from, to) - xEvent *from, *to; +SReparentEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1082,8 +945,7 @@ } void -SConfigureNotifyEvent(from, to) - xEvent *from, *to; +SConfigureNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1104,8 +966,7 @@ } void -SConfigureRequestEvent(from, to) - xEvent *from, *to; +SConfigureRequestEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; to->u.u.detail = from->u.u.detail; /* actually stack-mode */ @@ -1130,8 +991,7 @@ void -SGravityEvent(from, to) - xEvent *from, *to; +SGravityEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1142,8 +1002,7 @@ } void -SResizeRequestEvent(from, to) - xEvent *from, *to; +SResizeRequestEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1153,8 +1012,7 @@ } void -SCirculateEvent(from, to) - xEvent *from, *to; +SCirculateEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; to->u.u.detail = from->u.u.detail; @@ -1166,8 +1024,7 @@ } void -SPropertyEvent(from, to) - xEvent *from, *to; +SPropertyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1178,8 +1035,7 @@ } void -SSelectionClearEvent(from, to) - xEvent *from, *to; +SSelectionClearEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1189,8 +1045,7 @@ } void -SSelectionRequestEvent(from, to) - xEvent *from, *to; +SSelectionRequestEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1208,8 +1063,7 @@ } void -SSelectionNotifyEvent(from, to) - xEvent *from, *to; +SSelectionNotifyEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1225,8 +1079,7 @@ } void -SColormapEvent(from, to) - xEvent *from, *to; +SColormapEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1237,8 +1090,7 @@ } void -SMappingEvent(from, to) - xEvent *from, *to; +SMappingEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber); @@ -1249,8 +1101,7 @@ } void -SClientMessageEvent(from, to) - xEvent *from, *to; +SClientMessageEvent(xEvent *from, xEvent *to) { to->u.u.type = from->u.u.type; to->u.u.detail = from->u.u.detail; /* actually format */ @@ -1301,8 +1152,7 @@ } void -SKeymapNotifyEvent(from, to) - xEvent *from, *to; +SKeymapNotifyEvent(xEvent *from, xEvent *to) { /* Keymap notify events are special; they have no sequence number field, and contain entirely 8-bit data */ @@ -1310,10 +1160,7 @@ } void -SwapConnSetupInfo( - char *pInfo, - char *pInfoT -) +SwapConnSetupInfo(char *pInfo, char *pInfoT) { int i, j, k; xConnSetup *pConnSetup = (xConnSetup *)pInfo; @@ -1362,10 +1209,7 @@ void -WriteSConnectionInfo(pClient, size, pInfo) - ClientPtr pClient; - unsigned long size; - char *pInfo; +WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo) { char *pInfoTBase; @@ -1381,8 +1225,7 @@ } void -SwapConnSetup(pConnSetup, pConnSetupT) - xConnSetup *pConnSetup, *pConnSetupT; +SwapConnSetup(xConnSetup *pConnSetup, xConnSetup *pConnSetupT) { cpswapl(pConnSetup->release, pConnSetupT->release); cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase); @@ -1401,8 +1244,7 @@ } void -SwapWinRoot(pRoot, pRootT) - xWindowRoot *pRoot, *pRootT; +SwapWinRoot(xWindowRoot *pRoot, xWindowRoot *pRootT) { cpswapl(pRoot->windowId, pRootT->windowId); cpswapl(pRoot->defaultColormap, pRootT->defaultColormap); @@ -1423,8 +1265,7 @@ } void -SwapVisual(pVis, pVisT) - xVisualType *pVis, *pVisT; +SwapVisual(xVisualType *pVis, xVisualType *pVisT) { cpswapl(pVis->visualID, pVisT->visualID); pVisT->class = pVis->class; @@ -1436,9 +1277,7 @@ } void -SwapConnSetupPrefix(pcspFrom, pcspTo) - xConnSetupPrefix *pcspFrom; - xConnSetupPrefix *pcspTo; +SwapConnSetupPrefix(xConnSetupPrefix *pcspFrom, xConnSetupPrefix *pcspTo) { pcspTo->success = pcspFrom->success; pcspTo->lengthReason = pcspFrom->lengthReason; @@ -1448,9 +1287,7 @@ } void -WriteSConnSetupPrefix(pClient, pcsp) - ClientPtr pClient; - xConnSetupPrefix *pcsp; +WriteSConnSetupPrefix(ClientPtr pClient, xConnSetupPrefix *pcsp) { xConnSetupPrefix cspT; Index: xc/programs/Xserver/dix/swapreq.c diff -u xc/programs/Xserver/dix/swapreq.c:3.5 xc/programs/Xserver/dix/swapreq.c:3.7 --- xc/programs/Xserver/dix/swapreq.c:3.5 Tue Feb 19 06:09:22 2002 +++ xc/programs/Xserver/dix/swapreq.c Fri Oct 14 11:16:22 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/swapreq.c,v 3.5 2002/02/19 11:09:22 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/swapreq.c,v 3.7 2005/10/14 15:16:22 tsi Exp $ */ /************************************************************ Copyright 1987, 1998 The Open Group @@ -46,12 +46,10 @@ ********************************************************/ -/* $Xorg: swapreq.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ - -#include "X.h" +#include #define NEED_EVENTS -#include "Xproto.h" -#include "Xprotostr.h" +#include +#include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" /* for SendEvent */ @@ -62,11 +60,9 @@ /* Byte swap a list of longs */ void -SwapLongs (list, count) - register CARD32 *list; - register unsigned long count; +SwapLongs(CARD32 *list, unsigned long count) { - register char n; + char n; while (count >= 8) { swapl(list+0, n); @@ -91,11 +87,9 @@ /* Byte swap a list of shorts */ void -SwapShorts (list, count) - register short *list; - register unsigned long count; +SwapShorts(short *list, unsigned long count) { - register char n; + char n; while (count >= 16) { swaps(list+0, n); @@ -128,10 +122,9 @@ /* The following is used for all requests that have no fields to be swapped (except "length") */ int -SProcSimpleReq(client) - register ClientPtr client; +SProcSimpleReq(ClientPtr client) { - register char n; + char n; REQUEST(xReq); swaps(&stuff->length, n); @@ -142,10 +135,9 @@ only a single 32-bit field to be swapped, coming right after the "length" field */ int -SProcResourceReq(client) - register ClientPtr client; +SProcResourceReq(ClientPtr client) { - register char n; + char n; REQUEST(xResourceReq); swaps(&stuff->length, n); @@ -155,10 +147,9 @@ } int -SProcCreateWindow(client) - register ClientPtr client; +SProcCreateWindow(ClientPtr client) { - register char n; + char n; REQUEST(xCreateWindowReq); swaps(&stuff->length, n); @@ -178,10 +169,9 @@ } int -SProcChangeWindowAttributes(client) - register ClientPtr client; +SProcChangeWindowAttributes(ClientPtr client) { - register char n; + char n; REQUEST(xChangeWindowAttributesReq); swaps(&stuff->length, n); @@ -193,10 +183,9 @@ } int -SProcReparentWindow(client) - register ClientPtr client; +SProcReparentWindow(ClientPtr client) { - register char n; + char n; REQUEST(xReparentWindowReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xReparentWindowReq); @@ -208,10 +197,9 @@ } int -SProcConfigureWindow(client) - register ClientPtr client; +SProcConfigureWindow(ClientPtr client) { - register char n; + char n; REQUEST(xConfigureWindowReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); @@ -224,10 +212,9 @@ int -SProcInternAtom(client) - register ClientPtr client; +SProcInternAtom(ClientPtr client) { - register char n; + char n; REQUEST(xInternAtomReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xInternAtomReq); @@ -236,10 +223,9 @@ } int -SProcChangeProperty(client) - register ClientPtr client; +SProcChangeProperty(ClientPtr client) { - register char n; + char n; REQUEST(xChangePropertyReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xChangePropertyReq); @@ -261,10 +247,9 @@ } int -SProcDeleteProperty(client) - register ClientPtr client; +SProcDeleteProperty(ClientPtr client) { - register char n; + char n; REQUEST(xDeletePropertyReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xDeletePropertyReq); @@ -275,10 +260,9 @@ } int -SProcGetProperty(client) - register ClientPtr client; +SProcGetProperty(ClientPtr client) { - register char n; + char n; REQUEST(xGetPropertyReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xGetPropertyReq); @@ -291,10 +275,9 @@ } int -SProcSetSelectionOwner(client) - register ClientPtr client; +SProcSetSelectionOwner(ClientPtr client) { - register char n; + char n; REQUEST(xSetSelectionOwnerReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xSetSelectionOwnerReq); @@ -305,10 +288,9 @@ } int -SProcConvertSelection(client) - register ClientPtr client; +SProcConvertSelection(ClientPtr client) { - register char n; + char n; REQUEST(xConvertSelectionReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xConvertSelectionReq); @@ -321,10 +303,9 @@ } int -SProcSendEvent(client) - register ClientPtr client; +SProcSendEvent(ClientPtr client) { - register char n; + char n; xEvent eventT; EventSwapPtr proc; REQUEST(xSendEventReq); @@ -344,10 +325,9 @@ } int -SProcGrabPointer(client) - register ClientPtr client; +SProcGrabPointer(ClientPtr client) { - register char n; + char n; REQUEST(xGrabPointerReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xGrabPointerReq); @@ -360,10 +340,9 @@ } int -SProcGrabButton(client) - register ClientPtr client; +SProcGrabButton(ClientPtr client) { - register char n; + char n; REQUEST(xGrabButtonReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xGrabButtonReq); @@ -376,10 +355,9 @@ } int -SProcUngrabButton(client) - register ClientPtr client; +SProcUngrabButton(ClientPtr client) { - register char n; + char n; REQUEST(xUngrabButtonReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xUngrabButtonReq); @@ -389,10 +367,9 @@ } int -SProcChangeActivePointerGrab(client) - register ClientPtr client; +SProcChangeActivePointerGrab(ClientPtr client) { - register char n; + char n; REQUEST(xChangeActivePointerGrabReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq); @@ -403,10 +380,9 @@ } int -SProcGrabKeyboard(client) - register ClientPtr client; +SProcGrabKeyboard(ClientPtr client) { - register char n; + char n; REQUEST(xGrabKeyboardReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xGrabKeyboardReq); @@ -416,10 +392,9 @@ } int -SProcGrabKey(client) - register ClientPtr client; +SProcGrabKey(ClientPtr client) { - register char n; + char n; REQUEST(xGrabKeyReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xGrabKeyReq); @@ -429,10 +404,9 @@ } int -SProcUngrabKey(client) - register ClientPtr client; +SProcUngrabKey(ClientPtr client) { - register char n; + char n; REQUEST(xUngrabKeyReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xUngrabKeyReq); @@ -442,10 +416,9 @@ } int -SProcGetMotionEvents(client) - register ClientPtr client; +SProcGetMotionEvents(ClientPtr client) { - register char n; + char n; REQUEST(xGetMotionEventsReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xGetMotionEventsReq); @@ -456,10 +429,9 @@ } int -SProcTranslateCoords(client) - register ClientPtr client; +SProcTranslateCoords(ClientPtr client) { - register char n; + char n; REQUEST(xTranslateCoordsReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xTranslateCoordsReq); @@ -471,10 +443,9 @@ } int -SProcWarpPointer(client) - register ClientPtr client; +SProcWarpPointer(ClientPtr client) { - register char n; + char n; REQUEST(xWarpPointerReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xWarpPointerReq); @@ -490,10 +461,9 @@ } int -SProcSetInputFocus(client) - register ClientPtr client; +SProcSetInputFocus(ClientPtr client) { - register char n; + char n; REQUEST(xSetInputFocusReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xSetInputFocusReq); @@ -503,10 +473,9 @@ } int -SProcOpenFont(client) - register ClientPtr client; +SProcOpenFont(ClientPtr client) { - register char n; + char n; REQUEST(xOpenFontReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xOpenFontReq); @@ -516,10 +485,9 @@ } int -SProcListFonts(client) - register ClientPtr client; +SProcListFonts(ClientPtr client) { - register char n; + char n; REQUEST(xListFontsReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xListFontsReq); @@ -529,10 +497,9 @@ } int -SProcListFontsWithInfo(client) - register ClientPtr client; +SProcListFontsWithInfo(ClientPtr client) { - register char n; + char n; REQUEST(xListFontsWithInfoReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq); @@ -542,10 +509,9 @@ } int -SProcSetFontPath(client) - register ClientPtr client; +SProcSetFontPath(ClientPtr client) { - register char n; + char n; REQUEST(xSetFontPathReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xSetFontPathReq); @@ -554,10 +520,9 @@ } int -SProcCreatePixmap(client) - register ClientPtr client; +SProcCreatePixmap(ClientPtr client) { - register char n; + char n; REQUEST(xCreatePixmapReq); swaps(&stuff->length, n); @@ -570,10 +535,9 @@ } int -SProcCreateGC(client) - register ClientPtr client; +SProcCreateGC(ClientPtr client) { - register char n; + char n; REQUEST(xCreateGCReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xCreateGCReq); @@ -585,10 +549,9 @@ } int -SProcChangeGC(client) - register ClientPtr client; +SProcChangeGC(ClientPtr client) { - register char n; + char n; REQUEST(xChangeGCReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xChangeGCReq); @@ -599,10 +562,9 @@ } int -SProcCopyGC(client) - register ClientPtr client; +SProcCopyGC(ClientPtr client) { - register char n; + char n; REQUEST(xCopyGCReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCopyGCReq); @@ -613,10 +575,9 @@ } int -SProcSetDashes(client) - register ClientPtr client; +SProcSetDashes(ClientPtr client) { - register char n; + char n; REQUEST(xSetDashesReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xSetDashesReq); @@ -628,10 +589,9 @@ } int -SProcSetClipRectangles(client) - register ClientPtr client; +SProcSetClipRectangles(ClientPtr client) { - register char n; + char n; REQUEST(xSetClipRectanglesReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); @@ -643,10 +603,9 @@ } int -SProcClearToBackground(client) - register ClientPtr client; +SProcClearToBackground(ClientPtr client) { - register char n; + char n; REQUEST(xClearAreaReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xClearAreaReq); @@ -659,10 +618,9 @@ } int -SProcCopyArea(client) - register ClientPtr client; +SProcCopyArea(ClientPtr client) { - register char n; + char n; REQUEST(xCopyAreaReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCopyAreaReq); @@ -679,10 +637,9 @@ } int -SProcCopyPlane(client) - register ClientPtr client; +SProcCopyPlane(ClientPtr client) { - register char n; + char n; REQUEST(xCopyPlaneReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCopyPlaneReq); @@ -702,10 +659,9 @@ /* The following routine is used for all Poly drawing requests (except FillPoly, which uses a different request format) */ int -SProcPoly(client) - register ClientPtr client; +SProcPoly(ClientPtr client) { - register char n; + char n; REQUEST(xPolyPointReq); swaps(&stuff->length, n); @@ -720,10 +676,9 @@ is longer than xPolyPointReq, and we don't want to swap the difference as shorts! */ int -SProcFillPoly(client) - register ClientPtr client; +SProcFillPoly(ClientPtr client) { - register char n; + char n; REQUEST(xFillPolyReq); swaps(&stuff->length, n); @@ -735,10 +690,9 @@ } int -SProcPutImage(client) - register ClientPtr client; +SProcPutImage(ClientPtr client) { - register char n; + char n; REQUEST(xPutImageReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xPutImageReq); @@ -754,10 +708,9 @@ } int -SProcGetImage(client) - register ClientPtr client; +SProcGetImage(ClientPtr client) { - register char n; + char n; REQUEST(xGetImageReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xGetImageReq); @@ -773,10 +726,9 @@ /* ProcPolyText used for both PolyText8 and PolyText16 */ int -SProcPolyText(client) - register ClientPtr client; +SProcPolyText(ClientPtr client) { - register char n; + char n; REQUEST(xPolyTextReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xPolyTextReq); @@ -790,10 +742,9 @@ /* ProcImageText used for both ImageText8 and ImageText16 */ int -SProcImageText(client) - register ClientPtr client; +SProcImageText(ClientPtr client) { - register char n; + char n; REQUEST(xImageTextReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xImageTextReq); @@ -805,10 +756,9 @@ } int -SProcCreateColormap(client) - register ClientPtr client; +SProcCreateColormap(ClientPtr client) { - register char n; + char n; REQUEST(xCreateColormapReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCreateColormapReq); @@ -820,10 +770,9 @@ int -SProcCopyColormapAndFree(client) - register ClientPtr client; +SProcCopyColormapAndFree(ClientPtr client) { - register char n; + char n; REQUEST(xCopyColormapAndFreeReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); @@ -834,10 +783,9 @@ } int -SProcAllocColor (client) - register ClientPtr client; +SProcAllocColor(ClientPtr client) { - register char n; + char n; REQUEST(xAllocColorReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xAllocColorReq); @@ -849,10 +797,9 @@ } int -SProcAllocNamedColor (client) - register ClientPtr client; +SProcAllocNamedColor(ClientPtr client) { - register char n; + char n; REQUEST(xAllocNamedColorReq); swaps(&stuff->length, n); @@ -863,10 +810,9 @@ } int -SProcAllocColorCells (client) - register ClientPtr client; +SProcAllocColorCells(ClientPtr client) { - register char n; + char n; REQUEST(xAllocColorCellsReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xAllocColorCellsReq); @@ -877,10 +823,9 @@ } int -SProcAllocColorPlanes(client) - register ClientPtr client; +SProcAllocColorPlanes(ClientPtr client) { - register char n; + char n; REQUEST(xAllocColorPlanesReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xAllocColorPlanesReq); @@ -893,10 +838,9 @@ } int -SProcFreeColors (client) - register ClientPtr client; +SProcFreeColors(ClientPtr client) { - register char n; + char n; REQUEST(xFreeColorsReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xFreeColorsReq); @@ -908,10 +852,9 @@ } void -SwapColorItem(pItem) - xColorItem *pItem; +SwapColorItem(xColorItem *pItem) { - register char n; + char n; swapl(&pItem->pixel, n); swaps(&pItem->red, n); @@ -920,10 +863,9 @@ } int -SProcStoreColors (client) - register ClientPtr client; +SProcStoreColors(ClientPtr client) { - register char n; + char n; long count; xColorItem *pItem; @@ -938,10 +880,9 @@ } int -SProcStoreNamedColor (client) - register ClientPtr client; +SProcStoreNamedColor(ClientPtr client) { - register char n; + char n; REQUEST(xStoreNamedColorReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq); @@ -952,10 +893,9 @@ } int -SProcQueryColors(client) - register ClientPtr client; +SProcQueryColors(ClientPtr client) { - register char n; + char n; REQUEST(xQueryColorsReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xQueryColorsReq); @@ -965,10 +905,9 @@ } int -SProcLookupColor(client) - register ClientPtr client; +SProcLookupColor(ClientPtr client) { - register char n; + char n; REQUEST(xLookupColorReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xLookupColorReq); @@ -978,10 +917,9 @@ } int -SProcCreateCursor( client) - register ClientPtr client; +SProcCreateCursor(ClientPtr client) { - register char n; + char n; REQUEST(xCreateCursorReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCreateCursorReq); @@ -1000,10 +938,9 @@ } int -SProcCreateGlyphCursor( client) - register ClientPtr client; +SProcCreateGlyphCursor(ClientPtr client) { - register char n; + char n; REQUEST(xCreateGlyphCursorReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); @@ -1023,10 +960,9 @@ int -SProcRecolorCursor(client) - register ClientPtr client; +SProcRecolorCursor(ClientPtr client) { - register char n; + char n; REQUEST(xRecolorCursorReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xRecolorCursorReq); @@ -1041,10 +977,9 @@ } int -SProcQueryBestSize (client) - register ClientPtr client; +SProcQueryBestSize(ClientPtr client) { - register char n; + char n; REQUEST(xQueryBestSizeReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xQueryBestSizeReq); @@ -1056,10 +991,9 @@ } int -SProcQueryExtension (client) - register ClientPtr client; +SProcQueryExtension(ClientPtr client) { - register char n; + char n; REQUEST(xQueryExtensionReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xQueryExtensionReq); @@ -1068,10 +1002,9 @@ } int -SProcChangeKeyboardMapping (client) - register ClientPtr client; +SProcChangeKeyboardMapping(ClientPtr client) { - register char n; + char n; REQUEST(xChangeKeyboardMappingReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq); @@ -1081,10 +1014,9 @@ int -SProcChangeKeyboardControl (client) - register ClientPtr client; +SProcChangeKeyboardControl(ClientPtr client) { - register char n; + char n; REQUEST(xChangeKeyboardControlReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq); @@ -1094,10 +1026,9 @@ } int -SProcChangePointerControl (client) - register ClientPtr client; +SProcChangePointerControl(ClientPtr client) { - register char n; + char n; REQUEST(xChangePointerControlReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xChangePointerControlReq); @@ -1109,10 +1040,9 @@ int -SProcSetScreenSaver (client) - register ClientPtr client; +SProcSetScreenSaver(ClientPtr client) { - register char n; + char n; REQUEST(xSetScreenSaverReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xSetScreenSaverReq); @@ -1122,10 +1052,9 @@ } int -SProcChangeHosts(client) - register ClientPtr client; +SProcChangeHosts(ClientPtr client) { - register char n; + char n; REQUEST(xChangeHostsReq); swaps(&stuff->length, n); @@ -1135,10 +1064,9 @@ } -int SProcRotateProperties(client) - register ClientPtr client; +int SProcRotateProperties(ClientPtr client) { - register char n; + char n; REQUEST(xRotatePropertiesReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq); @@ -1151,20 +1079,18 @@ /*ARGSUSED*/ int -SProcNoOperation(client) - ClientPtr client; +SProcNoOperation(ClientPtr client) { - register char n; + char n; REQUEST(xReq); swaps(&stuff->length, n); return ((* ProcVector[X_NoOperation])(client)); } void -SwapConnClientPrefix(pCCP) - xConnClientPrefix *pCCP; +SwapConnClientPrefix(xConnClientPrefix *pCCP) { - register char n; + char n; swaps(&pCCP->majorVersion, n); swaps(&pCCP->minorVersion, n); Index: xc/programs/Xserver/dix/tables.c diff -u xc/programs/Xserver/dix/tables.c:3.6 xc/programs/Xserver/dix/tables.c:3.7 --- xc/programs/Xserver/dix/tables.c:3.6 Mon Nov 17 17:20:35 2003 +++ xc/programs/Xserver/dix/tables.c Fri Oct 14 11:16:22 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/tables.c,v 3.6 2003/11/17 22:20:35 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/tables.c,v 3.7 2005/10/14 15:16:22 tsi Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,12 +45,11 @@ SOFTWARE. ******************************************************************/ -/* $Xorg: tables.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ -#include "X.h" +#include #define NEED_EVENTS #define NEED_REPLIES -#include "Xproto.h" +#include #include "windowstr.h" #include "extnsionst.h" #include "dixstruct.h" Index: xc/programs/Xserver/dix/window.c diff -u xc/programs/Xserver/dix/window.c:3.37 xc/programs/Xserver/dix/window.c:3.39 --- xc/programs/Xserver/dix/window.c:3.37 Mon Nov 17 17:20:35 2003 +++ xc/programs/Xserver/dix/window.c Fri Oct 14 11:16:22 2005 @@ -1,4 +1,3 @@ -/* $Xorg: window.c,v 1.4 2001/02/09 02:04:41 xorgcvs Exp $ */ /* Copyright 1987, 1998 The Open Group @@ -70,7 +69,7 @@ * * *****************************************************************/ -/* $XFree86: xc/programs/Xserver/dix/window.c,v 3.37 2003/11/17 22:20:35 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/window.c,v 3.39 2005/10/14 15:16:22 tsi Exp $ */ #include "misc.h" #include "scrnintstr.h" @@ -93,11 +92,11 @@ #include "globals.h" #ifdef XAPPGROUP -#include "Xagsrv.h" +#include #endif #ifdef XCSECURITY #define _SECURITY_SERVER -#include "security.h" +#include #endif /****** @@ -161,9 +160,7 @@ ******/ int -PrintChildren(p1, indent) - WindowPtr p1; - int indent; +PrintChildren(WindowPtr p1, int indent) { WindowPtr p2; int i; @@ -196,13 +193,10 @@ #endif int -TraverseTree(pWin, func, data) - register WindowPtr pWin; - VisitWindowProcPtr func; - pointer data; +TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, pointer data) { - register int result; - register WindowPtr pChild; + int result; + WindowPtr pChild; if (!(pChild = pWin)) return(WT_NOMATCH); @@ -234,10 +228,7 @@ *****/ int -WalkTree(pScreen, func, data) - ScreenPtr pScreen; - VisitWindowProcPtr func; - pointer data; +WalkTree(ScreenPtr pScreen, VisitWindowProcPtr func, pointer data) { return(TraverseTree(WindowTable[pScreen->myNum], func, data)); } @@ -251,7 +242,7 @@ Bool disableSaveUnders = FALSE; static void -SetWindowToDefaults(register WindowPtr pWin) +SetWindowToDefaults(WindowPtr pWin) { pWin->prevSib = NullWindow; pWin->firstChild = NullWindow; @@ -292,8 +283,8 @@ GCPtr pGC; unsigned char back[128]; int len = BitmapBytePad(sizeof(long)); - register unsigned char *from, *to; - register int i, j; + unsigned char *from, *to; + int i, j; pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4, pScreen->rootDepth); @@ -332,15 +323,14 @@ } WindowPtr -AllocateWindow(pScreen) - ScreenPtr pScreen; +AllocateWindow(ScreenPtr pScreen) { WindowPtr pWin; - register char *ptr; - register DevUnion *ppriv; - register unsigned *sizes; - register unsigned size; - register int i; + char *ptr; + DevUnion *ppriv; + unsigned *sizes; + unsigned size; + int i; pWin = (WindowPtr)xalloc(pScreen->totalWindowSize); if (pWin) @@ -369,8 +359,7 @@ *****/ Bool -CreateRootWindow(pScreen) - ScreenPtr pScreen; +CreateRootWindow(ScreenPtr pScreen) { WindowPtr pWin; BoxRec box; @@ -478,8 +467,7 @@ } void -InitRootWindow(pWin) - WindowPtr pWin; +InitRootWindow(WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; @@ -506,11 +494,7 @@ */ void -ClippedRegionFromBox(pWin, Rgn, x, y, w, h) - register WindowPtr pWin; - RegionPtr Rgn; - register int x, y; - int w, h; +ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn, int x, int y, int w, int h) { ScreenPtr pScreen = pWin->drawable.pScreen; BoxRec box; @@ -536,8 +520,7 @@ } WindowPtr -RealChildHead(pWin) - register WindowPtr pWin; +RealChildHead(WindowPtr pWin) { if (!pWin->parent && (screenIsSaved == SCREEN_SAVER_ON) && @@ -553,29 +536,20 @@ *****/ WindowPtr -CreateWindow(wid, pParent, x, y, w, h, bw, class, vmask, vlist, - depth, client, visual, error) - Window wid; - register WindowPtr pParent; - int x,y; - unsigned int w, h, bw; - unsigned int class; - register Mask vmask; - XID *vlist; - int depth; - ClientPtr client; - VisualID visual; - int *error; +CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned int w, + unsigned int h, unsigned int bw, unsigned int class, Mask vmask, + XID *vlist, int depth, ClientPtr client, VisualID visual, + int *error) { - register WindowPtr pWin; + WindowPtr pWin; WindowPtr pHead; - register ScreenPtr pScreen; + ScreenPtr pScreen; xEvent event; int idepth, ivisual; Bool fOK; DepthPtr pDepth; PixmapFormatRec *format; - register WindowOptPtr ancwopt; + WindowOptPtr ancwopt; if (class == CopyFromParent) class = pParent->drawable.class; @@ -800,9 +774,9 @@ } static void -FreeWindowResources(register WindowPtr pWin) +FreeWindowResources(WindowPtr pWin) { - register ScreenPtr pScreen = pWin->drawable.pScreen; + ScreenPtr pScreen = pWin->drawable.pScreen; DeleteWindowFromAnySaveSet(pWin); DeleteWindowFromAnySelections(pWin); @@ -831,7 +805,7 @@ static void CrushTree(WindowPtr pWin) { - register WindowPtr pChild, pSib, pParent; + WindowPtr pChild, pSib, pParent; UnrealizeWindowProcPtr UnrealizeWindow; xEvent event; @@ -891,8 +865,8 @@ pointer value; XID wid; { - register WindowPtr pParent; - register WindowPtr pWin = (WindowPtr)value; + WindowPtr pParent; + WindowPtr pWin = (WindowPtr)value; xEvent event; UnmapWindow(pWin, FALSE); @@ -925,9 +899,7 @@ /*ARGSUSED*/ void -DestroySubwindows(pWin, client) - register WindowPtr pWin; - ClientPtr client; +DestroySubwindows(WindowPtr pWin, ClientPtr client) { /* XXX * The protocol is quite clear that each window should be @@ -954,14 +926,10 @@ *****/ int -ChangeWindowAttributes(pWin, vmask, vlist, client) - register WindowPtr pWin; - Mask vmask; - XID *vlist; - ClientPtr client; +ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) { - register Mask index2; - register XID *pVlist; + Mask index2; + XID *pVlist; PixmapPtr pPixmap; Pixmap pixID; CursorPtr pCursor, pOldCursor; @@ -971,9 +939,9 @@ ColormapPtr pCmap; xEvent xE; int result; - register ScreenPtr pScreen; + ScreenPtr pScreen; Mask vmaskCopy = 0; - register Mask tmask; + Mask tmask; unsigned int val; int error; Bool checkOptional = FALSE; @@ -1498,10 +1466,8 @@ *****/ void -GetWindowAttributes(pWin, client, wa) - register WindowPtr pWin; - ClientPtr client; - xGetWindowAttributesReply *wa; +GetWindowAttributes(WindowPtr pWin, ClientPtr client, + xGetWindowAttributesReply *wa) { wa->type = X_Reply; wa->bitGravity = pWin->bitGravity; @@ -1537,10 +1503,9 @@ WindowPtr -MoveWindowInStack(pWin, pNextSib) - register WindowPtr pWin, pNextSib; +MoveWindowInStack(WindowPtr pWin, WindowPtr pNextSib) { - register WindowPtr pParent = pWin->parent; + WindowPtr pParent = pWin->parent; WindowPtr pFirstChange = pWin; /* highest window where list changes */ if (pWin->nextSib != pNextSib) @@ -1622,8 +1587,7 @@ } RegionPtr -CreateUnclippedWinSize (pWin) - register WindowPtr pWin; +CreateUnclippedWinSize(WindowPtr pWin) { RegionPtr pRgn; BoxRec box; @@ -1650,8 +1614,7 @@ } void -SetWinSize (pWin) - register WindowPtr pWin; +SetWinSize(WindowPtr pWin) { ClippedRegionFromBox(pWin->parent, &pWin->winSize, pWin->drawable.x, pWin->drawable.y, @@ -1676,8 +1639,7 @@ } void -SetBorderSize (pWin) - register WindowPtr pWin; +SetBorderSize(WindowPtr pWin) { int bw; @@ -1708,12 +1670,8 @@ } void -GravityTranslate (x, y, oldx, oldy, dw, dh, gravity, destx, desty) - register int x, y; /* new window position */ - int oldx, oldy; /* old window position */ - int dw, dh; - unsigned gravity; - register int *destx, *desty; /* position relative to gravity */ +GravityTranslate(int x, int y, int oldx, int oldy, int dw, int dh, + unsigned gravity, int *destx, int *desty) { switch (gravity) { case NorthGravity: @@ -1761,12 +1719,10 @@ /* XXX need to retile border on each window with ParentRelative origin */ void -ResizeChildrenWinSize(pWin, dx, dy, dw, dh) - register WindowPtr pWin; - int dx, dy, dw, dh; +ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh) { - register ScreenPtr pScreen; - register WindowPtr pSib, pChild; + ScreenPtr pScreen; + WindowPtr pSib, pChild; Bool resized = (dw || dh); pScreen = pWin->drawable.pScreen; @@ -1857,11 +1813,9 @@ */ static int -IsSiblingAboveMe( - register WindowPtr pMe, - register WindowPtr pSib) +IsSiblingAboveMe(WindowPtr pMe, WindowPtr pSib) { - register WindowPtr pWin; + WindowPtr pWin; pWin = pMe->parent->firstChild; while (pWin) @@ -1876,9 +1830,7 @@ } static BoxPtr -WindowExtents( - register WindowPtr pWin, - register BoxPtr pBox) +WindowExtents(WindowPtr pWin, BoxPtr pBox) { pBox->x1 = pWin->drawable.x - wBorderWidth (pWin); pBox->y1 = pWin->drawable.y - wBorderWidth (pWin); @@ -1893,9 +1845,7 @@ #define IS_SHAPED(pWin) (wBoundingShape (pWin) != (RegionPtr) NULL) static RegionPtr -MakeBoundingRegion ( - register WindowPtr pWin, - BoxPtr pBox) +MakeBoundingRegion(WindowPtr pWin, BoxPtr pBox) { RegionPtr pRgn; ScreenPtr pScreen = pWin->drawable.pScreen; @@ -1912,14 +1862,10 @@ } static Bool -ShapeOverlap ( - WindowPtr pWin, - BoxPtr pWinBox, - WindowPtr pSib, - BoxPtr pSibBox) +ShapeOverlap(WindowPtr pWin, BoxPtr pWinBox, WindowPtr pSib, BoxPtr pSibBox) { RegionPtr pWinRgn, pSibRgn; - register ScreenPtr pScreen; + ScreenPtr pScreen; Bool ret; if (!IS_SHAPED(pWin) && !IS_SHAPED(pSib)) @@ -1936,14 +1882,11 @@ #endif static Bool -AnyWindowOverlapsMe( - WindowPtr pWin, - WindowPtr pHead, - register BoxPtr box) +AnyWindowOverlapsMe(WindowPtr pWin, WindowPtr pHead, BoxPtr box) { - register WindowPtr pSib; + WindowPtr pSib; BoxRec sboxrec; - register BoxPtr sbox; + BoxPtr sbox; for (pSib = pWin->prevSib; pSib != pHead; pSib = pSib->prevSib) { @@ -1962,13 +1905,11 @@ } static Bool -IOverlapAnyWindow( - WindowPtr pWin, - register BoxPtr box) +IOverlapAnyWindow(WindowPtr pWin, BoxPtr box) { - register WindowPtr pSib; + WindowPtr pSib; BoxRec sboxrec; - register BoxPtr sbox; + BoxPtr sbox; for (pSib = pWin->nextSib; pSib; pSib = pSib->nextSib) { @@ -2015,17 +1956,11 @@ */ static WindowPtr -WhereDoIGoInTheStack( - register WindowPtr pWin, - register WindowPtr pSib, - short x, - short y, - unsigned short w, - unsigned short h, - int smode) +WhereDoIGoInTheStack(WindowPtr pWin, WindowPtr pSib, short x, short y, + unsigned short w, unsigned short h, int smode) { BoxRec box; - register ScreenPtr pScreen; + ScreenPtr pScreen; WindowPtr pHead, pFirst; if ((pWin == pWin->parent->firstChild) && @@ -2121,10 +2056,7 @@ } static void -ReflectStackChange( - register WindowPtr pWin, - register WindowPtr pSib, - VTKind kind) +ReflectStackChange(WindowPtr pWin, WindowPtr pSib, VTKind kind) { /* Note that pSib might be NULL */ @@ -2175,21 +2107,17 @@ *****/ int -ConfigureWindow(pWin, mask, vlist, client) - register WindowPtr pWin; - register Mask mask; - XID *vlist; - ClientPtr client; +ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) { #define RESTACK_WIN 0 #define MOVE_WIN 1 #define RESIZE_WIN 2 #define REBORDER_WIN 3 - register WindowPtr pSib = NullWindow; - register WindowPtr pParent = pWin->parent; + WindowPtr pSib = NullWindow; + WindowPtr pParent = pWin->parent; Window sibwid = 0; Mask index2, tmask; - register XID *pVlist; + XID *pVlist; short x, y, beforeX, beforeY; unsigned short w = pWin->drawable.width, h = pWin->drawable.height, @@ -2464,12 +2392,9 @@ ******/ int -CirculateWindow(pParent, direction, client) - WindowPtr pParent; - int direction; - ClientPtr client; +CirculateWindow(WindowPtr pParent, int direction, ClientPtr client) { - register WindowPtr pWin, pHead, pFirst; + WindowPtr pWin, pHead, pFirst; xEvent event; BoxRec box; @@ -2522,9 +2447,7 @@ } static int -CompareWIDs( - WindowPtr pWin, - pointer value) /* must conform to VisitWindowProcPtr */ +CompareWIDs(WindowPtr pWin, pointer value) { Window *wid = (Window *)value; @@ -2539,16 +2462,14 @@ *****/ int -ReparentWindow(pWin, pParent, x, y, client) - register WindowPtr pWin, pParent; - int x,y; - ClientPtr client; +ReparentWindow(WindowPtr pWin, WindowPtr pParent, int x, int y, + ClientPtr client) { WindowPtr pPrev, pPriorParent; Bool WasMapped = (Bool)(pWin->mapped); xEvent event; int bw = wBorderWidth (pWin); - register ScreenPtr pScreen; + ScreenPtr pScreen; pScreen = pWin->drawable.pScreen; if (TraverseTree(pWin, CompareWIDs, (pointer)&pParent->drawable.id) == WT_STOPWALKING) @@ -2635,7 +2556,7 @@ static void RealizeTree(WindowPtr pWin) { - register WindowPtr pChild; + WindowPtr pChild; RealizeWindowProcPtr Realize; Realize = pWin->drawable.pScreen->RealizeWindow; @@ -2674,13 +2595,11 @@ *****/ int -MapWindow(pWin, client) - register WindowPtr pWin; - ClientPtr client; +MapWindow(WindowPtr pWin, ClientPtr client) { - register ScreenPtr pScreen; + ScreenPtr pScreen; - register WindowPtr pParent; + WindowPtr pParent; #ifdef DO_SAVE_UNDERS Bool dosave = FALSE; #endif @@ -2802,18 +2721,16 @@ *****/ void -MapSubwindows(pParent, client) - register WindowPtr pParent; - ClientPtr client; +MapSubwindows(WindowPtr pParent, ClientPtr client) { - register WindowPtr pWin; + WindowPtr pWin; WindowPtr pFirstMapped = NullWindow; #ifdef DO_SAVE_UNDERS WindowPtr pFirstSaveUndered = NullWindow; #endif - register ScreenPtr pScreen; - register Mask parentRedirect; - register Mask parentNotify; + ScreenPtr pScreen; + Mask parentRedirect; + Mask parentNotify; xEvent event; Bool anyMarked; #ifdef DO_SAVE_UNDERS @@ -2920,11 +2837,9 @@ } static void -UnrealizeTree( - WindowPtr pWin, - Bool fromConfigure) +UnrealizeTree(WindowPtr pWin, Bool fromConfigure) { - register WindowPtr pChild; + WindowPtr pChild; UnrealizeWindowProcPtr Unrealize; MarkUnrealizedWindowProcPtr MarkUnrealizedWindow; @@ -2983,11 +2898,9 @@ *****/ int -UnmapWindow(pWin, fromConfigure) - register WindowPtr pWin; - Bool fromConfigure; +UnmapWindow(WindowPtr pWin, Bool fromConfigure) { - register WindowPtr pParent; + WindowPtr pParent; xEvent event; Bool wasRealized = (Bool)pWin->realized; Bool wasViewable = (Bool)pWin->viewable; @@ -3044,10 +2957,9 @@ *****/ void -UnmapSubwindows(pWin) - register WindowPtr pWin; +UnmapSubwindows(WindowPtr pWin) { - register WindowPtr pChild, pHead; + WindowPtr pChild, pHead; xEvent event; Bool wasRealized = (Bool)pWin->realized; Bool wasViewable = (Bool)pWin->viewable; @@ -3136,11 +3048,10 @@ void -HandleSaveSet(client) - register ClientPtr client; +HandleSaveSet(ClientPtr client) { - register WindowPtr pParent, pWin; - register int j; + WindowPtr pParent, pWin; + int j; for (j=0; jnumSaved; j++) { @@ -3168,10 +3079,7 @@ } Bool -VisibleBoundingBoxFromPoint(pWin, x, y, box) - register WindowPtr pWin; - int x, y; /* in root */ - BoxPtr box; /* "return" value */ +VisibleBoundingBoxFromPoint(WindowPtr pWin, int x, int y, BoxPtr box) { if (!pWin->realized) return (FALSE); @@ -3181,9 +3089,7 @@ } Bool -PointInWindowIsVisible(pWin, x, y) - register WindowPtr pWin; - int x, y; /* in root */ +PointInWindowIsVisible(WindowPtr pWin, int x, int y) { BoxRec box; @@ -3197,10 +3103,9 @@ RegionPtr -NotClippedByChildren(pWin) - register WindowPtr pWin; +NotClippedByChildren(WindowPtr pWin) { - register ScreenPtr pScreen; + ScreenPtr pScreen; RegionPtr pReg; pScreen = pWin->drawable.pScreen; @@ -3215,8 +3120,7 @@ } void -SendVisibilityNotify(pWin) - WindowPtr pWin; +SendVisibilityNotify(WindowPtr pWin) { xEvent event; unsigned int visibility = pWin->visibility; @@ -3292,9 +3196,7 @@ #endif void -SaveScreens(on, mode) - int on; - int mode; +SaveScreens(int on, int mode) { int i; int what; @@ -3525,8 +3427,7 @@ */ WindowPtr -FindWindowWithOptional (w) - register WindowPtr w; +FindWindowWithOptional(WindowPtr w) { do w = w->parent; @@ -3543,11 +3444,10 @@ */ void -CheckWindowOptionalNeed (w) - register WindowPtr w; +CheckWindowOptionalNeed(WindowPtr w) { - register WindowOptPtr optional; - register WindowOptPtr parentOptional; + WindowOptPtr optional; + WindowOptPtr parentOptional; if (!w->parent) return; @@ -3596,11 +3496,10 @@ */ Bool -MakeWindowOptional (pWin) - register WindowPtr pWin; +MakeWindowOptional(WindowPtr pWin) { - register WindowOptPtr optional; - register WindowOptPtr parentOptional; + WindowOptPtr optional; + WindowOptPtr parentOptional; if (pWin->optional) return TRUE; @@ -3638,8 +3537,7 @@ } void -DisposeWindowOptional (pWin) - register WindowPtr pWin; +DisposeWindowOptional(WindowPtr pWin) { if (!pWin->optional) return; Index: xc/programs/Xserver/dix/xpstubs.c diff -u xc/programs/Xserver/dix/xpstubs.c:1.4 xc/programs/Xserver/dix/xpstubs.c:removed --- xc/programs/Xserver/dix/xpstubs.c:1.4 Thu Dec 20 14:41:00 2001 +++ xc/programs/Xserver/dix/xpstubs.c Tue May 9 21:56:00 2006 @@ -1,54 +0,0 @@ -/* $XFree86: xc/programs/Xserver/dix/xpstubs.c,v 1.4 2001/12/20 19:41:00 tsi Exp $ */ -/* -Copyright 1996, 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. -*/ - -/* $Xorg: xpstubs.c,v 1.5 2001/03/08 17:52:08 pookie Exp $ */ - -#include "misc.h" -#include "font.h" - -Bool -XpClientIsBitmapClient(client) - ClientPtr client; -{ - return TRUE; -} - -Bool -XpClientIsPrintClient(client, fpe) - ClientPtr client; - FontPathElementPtr fpe; -{ - return FALSE; -} -int -XprintOptions(argc, argv, i) - int argc; - char **argv; - int i; -{ - return i; -} Index: xc/programs/Xserver/dix/tiny/Imakefile diff -u xc/programs/Xserver/dix/tiny/Imakefile:1.2 xc/programs/Xserver/dix/tiny/Imakefile:removed --- xc/programs/Xserver/dix/tiny/Imakefile:1.2 Thu Aug 5 16:37:42 2004 +++ xc/programs/Xserver/dix/tiny/Imakefile Tue May 9 21:56:00 2006 @@ -1,66 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/dix/tiny/Imakefile,v 1.2 2004/08/05 20:37:42 tsi Exp $ -/* - * Copyright (c) 1996-2004 by 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: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution, and in the same place and form as other copyright, - * license and disclaimer information. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: "This product - * includes software developed by The XFree86 Project, Inc - * (http://www.xfree86.org/) and its contributors", in the same - * place and form as other third-party acknowledgments. Alternately, - * this acknowledgment may appear in the software itself, in the - * same form and location as other such third-party acknowledgments. - * - * 4. Except as contained in this notice, the name of The XFree86 - * Project, Inc 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, Inc. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#undef XF86Server -#define XF86Server NO -#undef DoLoadableServer -#define DoLoadableServer NO -#undef BuildTinyDIX -#define BuildTinyDIX YES -#define LinkDirectory .. - -/* - * The above doesn't really work because rules that depend on the symbols being - * over-ridden above have already been #define'd. Catch this at the Makefiles - * stage. - */ -IMAKE_DEFINES=-DXF86Server=NO -DBuildTinyDIX=YES - -#include "../Imakefile" - -Makefiles:: Makefile Index: xc/programs/Xserver/fb/Imakefile diff -u xc/programs/Xserver/fb/Imakefile:1.20 xc/programs/Xserver/fb/Imakefile:1.21 --- xc/programs/Xserver/fb/Imakefile:1.20 Wed Jun 30 16:21:38 2004 +++ xc/programs/Xserver/fb/Imakefile Fri Oct 14 11:16:23 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/fb/Imakefile,v 1.20 2004/06/30 20:21:38 martin Exp $ +XCOMM $XFree86: xc/programs/Xserver/fb/Imakefile,v 1.21 2005/10/14 15:16:23 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -139,9 +139,8 @@ fbpict.o INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ - -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) -I$(XF86SRC)/common $(EXTRAINCLUDES) \ - -I$(SERVERSRC)/render -I$(EXTINCSRC) -I$(SERVERSRC)/Xext + -I$(XF86SRC)/common $(EXTRAINCLUDES) \ + -I$(SERVERSRC)/render -I$(SERVERSRC)/Xext LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/llib-los.ln \ $(SERVERSRC)/mi/llib-lmi.ln Index: xc/programs/Xserver/fb/fb.h diff -u xc/programs/Xserver/fb/fb.h:1.39 xc/programs/Xserver/fb/fb.h:1.41 --- xc/programs/Xserver/fb/fb.h:1.39 Thu Jun 10 13:28:10 2004 +++ xc/programs/Xserver/fb/fb.h Fri Oct 14 11:16:23 2005 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/fb/fb.h,v 1.39 2004/06/10 17:28:10 tsi Exp $ + * $XFree86: xc/programs/Xserver/fb/fb.h,v 1.41 2005/10/14 15:16:23 tsi Exp $ * * Copyright © 1998 Keith Packard * @@ -25,7 +25,7 @@ #ifndef _FB_H_ #define _FB_H_ -#include "X.h" +#include #include "scrnintstr.h" #include "pixmap.h" #include "pixmapstr.h" @@ -42,7 +42,7 @@ #include "picturestr.h" #else #include "picture.h" -#include "render.h" +#include #endif /* @@ -107,7 +107,7 @@ defined(ia64) || defined(__ia64__) || \ defined(__sparc64__) || \ defined(__s390x__) || \ - defined(AMD64) || defined (__AMD64__) || \ + defined (__amd64__) || defined(__x86_64__) || \ (defined(sgi) && (_MIPS_SZLONG == 64)) typedef unsigned long FbBits; # else Index: xc/programs/Xserver/fb/fballpriv.c diff -u xc/programs/Xserver/fb/fballpriv.c:1.4 xc/programs/Xserver/fb/fballpriv.c:1.5 --- xc/programs/Xserver/fb/fballpriv.c:1.4 Sat May 6 17:09:31 2000 +++ xc/programs/Xserver/fb/fballpriv.c Mon Jan 9 09:59:46 2006 @@ -1,6 +1,4 @@ /* - * Id: fballpriv.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fballpriv.c,v 1.4 2000/05/06 21:09:31 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fballpriv.c,v 1.5 2006/01/09 14:59:46 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbarc.c diff -u xc/programs/Xserver/fb/fbarc.c:1.8 xc/programs/Xserver/fb/fbarc.c:1.9 --- xc/programs/Xserver/fb/fbarc.c:1.8 Fri Nov 8 23:59:29 2002 +++ xc/programs/Xserver/fb/fbarc.c Mon Jan 9 09:59:46 2006 @@ -1,6 +1,4 @@ /* - * Id: fbarc.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbarc.c,v 1.8 2002/11/09 04:59:29 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbarc.c,v 1.9 2006/01/09 14:59:46 dawes Exp $ */ #include "fb.h" #include "mizerarc.h" Index: xc/programs/Xserver/fb/fbbits.c diff -u xc/programs/Xserver/fb/fbbits.c:1.6 xc/programs/Xserver/fb/fbbits.c:1.7 --- xc/programs/Xserver/fb/fbbits.c:1.6 Wed Feb 23 15:29:41 2000 +++ xc/programs/Xserver/fb/fbbits.c Mon Jan 9 09:59:46 2006 @@ -1,6 +1,4 @@ /* - * Id: fbbits.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbbits.c,v 1.6 2000/02/23 20:29:41 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbbits.c,v 1.7 2006/01/09 14:59:46 dawes Exp $ */ #include "fb.h" #include "miline.h" Index: xc/programs/Xserver/fb/fbblt.c diff -u xc/programs/Xserver/fb/fbblt.c:1.8 xc/programs/Xserver/fb/fbblt.c:1.9 --- xc/programs/Xserver/fb/fbblt.c:1.8 Wed Sep 27 20:47:22 2000 +++ xc/programs/Xserver/fb/fbblt.c Mon Jan 9 09:59:46 2006 @@ -1,6 +1,4 @@ /* - * Id: fbblt.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbblt.c,v 1.8 2000/09/28 00:47:22 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbblt.c,v 1.9 2006/01/09 14:59:46 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbbltone.c diff -u xc/programs/Xserver/fb/fbbltone.c:1.13 xc/programs/Xserver/fb/fbbltone.c:1.14 --- xc/programs/Xserver/fb/fbbltone.c:1.13 Fri Feb 22 19:42:07 2002 +++ xc/programs/Xserver/fb/fbbltone.c Mon Jan 9 09:59:46 2006 @@ -1,6 +1,4 @@ /* - * Id: fbbltone.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbbltone.c,v 1.13 2002/02/23 00:42:07 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbbltone.c,v 1.14 2006/01/09 14:59:46 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbbstore.c diff -u xc/programs/Xserver/fb/fbbstore.c:1.2 xc/programs/Xserver/fb/fbbstore.c:1.3 --- xc/programs/Xserver/fb/fbbstore.c:1.2 Wed Feb 23 15:29:42 2000 +++ xc/programs/Xserver/fb/fbbstore.c Mon Jan 9 09:59:46 2006 @@ -1,6 +1,4 @@ /* - * Id: fbbstore.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbbstore.c,v 1.2 2000/02/23 20:29:42 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbbstore.c,v 1.3 2006/01/09 14:59:46 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbcmap.c diff -u xc/programs/Xserver/fb/fbcmap.c:1.7 xc/programs/Xserver/fb/fbcmap.c:1.8 --- xc/programs/Xserver/fb/fbcmap.c:1.7 Wed Jun 2 18:42:56 2004 +++ xc/programs/Xserver/fb/fbcmap.c Fri Oct 14 11:16:23 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/fb/fbcmap.c,v 1.7 2004/06/02 22:42:56 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbcmap.c,v 1.8 2005/10/14 15:16:23 tsi Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -75,8 +75,8 @@ */ -#include "X.h" -#include "Xproto.h" +#include +#include #include "scrnintstr.h" #include "colormapst.h" #include "resource.h" Index: xc/programs/Xserver/fb/fbcopy.c diff -u xc/programs/Xserver/fb/fbcopy.c:1.14 xc/programs/Xserver/fb/fbcopy.c:1.15 --- xc/programs/Xserver/fb/fbcopy.c:1.14 Sun Dec 28 12:22:25 2003 +++ xc/programs/Xserver/fb/fbcopy.c Mon Jan 9 09:59:46 2006 @@ -1,6 +1,4 @@ /* - * Id: fbcopy.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbcopy.c,v 1.14 2003/12/28 17:22:25 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbcopy.c,v 1.15 2006/01/09 14:59:46 dawes Exp $ */ #include "fb.h" #ifdef IN_MODULE Index: xc/programs/Xserver/fb/fbfill.c diff -u xc/programs/Xserver/fb/fbfill.c:1.6 xc/programs/Xserver/fb/fbfill.c:1.7 --- xc/programs/Xserver/fb/fbfill.c:1.6 Thu Jan 30 19:01:45 2003 +++ xc/programs/Xserver/fb/fbfill.c Mon Jan 9 09:59:46 2006 @@ -1,6 +1,4 @@ /* - * Id: fbfill.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbfill.c,v 1.6 2003/01/31 00:01:45 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbfill.c,v 1.7 2006/01/09 14:59:46 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbfillrect.c diff -u xc/programs/Xserver/fb/fbfillrect.c:1.2 xc/programs/Xserver/fb/fbfillrect.c:1.3 --- xc/programs/Xserver/fb/fbfillrect.c:1.2 Wed Feb 23 15:29:43 2000 +++ xc/programs/Xserver/fb/fbfillrect.c Mon Jan 9 09:59:46 2006 @@ -1,6 +1,4 @@ /* - * Id: fbfillrect.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbfillrect.c,v 1.2 2000/02/23 20:29:43 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbfillrect.c,v 1.3 2006/01/09 14:59:46 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbfillsp.c diff -u xc/programs/Xserver/fb/fbfillsp.c:1.2 xc/programs/Xserver/fb/fbfillsp.c:1.3 --- xc/programs/Xserver/fb/fbfillsp.c:1.2 Wed Feb 23 15:29:43 2000 +++ xc/programs/Xserver/fb/fbfillsp.c Mon Jan 9 09:59:47 2006 @@ -1,6 +1,4 @@ /* - * Id: fbfillsp.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbfillsp.c,v 1.2 2000/02/23 20:29:43 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbfillsp.c,v 1.3 2006/01/09 14:59:47 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbgc.c diff -u xc/programs/Xserver/fb/fbgc.c:1.15 xc/programs/Xserver/fb/fbgc.c:1.16 --- xc/programs/Xserver/fb/fbgc.c:1.15 Thu Dec 18 10:25:41 2003 +++ xc/programs/Xserver/fb/fbgc.c Mon Jan 9 09:59:47 2006 @@ -1,6 +1,4 @@ /* - * Id: fbgc.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbgc.c,v 1.15 2003/12/18 15:25:41 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbgc.c,v 1.16 2006/01/09 14:59:47 dawes Exp $ */ #include "fb.h" #ifdef IN_MODULE Index: xc/programs/Xserver/fb/fbgetsp.c diff -u xc/programs/Xserver/fb/fbgetsp.c:1.6 xc/programs/Xserver/fb/fbgetsp.c:1.7 --- xc/programs/Xserver/fb/fbgetsp.c:1.6 Tue May 29 00:54:09 2001 +++ xc/programs/Xserver/fb/fbgetsp.c Mon Jan 9 09:59:47 2006 @@ -1,6 +1,4 @@ /* - * Id: fbgetsp.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbgetsp.c,v 1.6 2001/05/29 04:54:09 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbgetsp.c,v 1.7 2006/01/09 14:59:47 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbglyph.c diff -u xc/programs/Xserver/fb/fbglyph.c:1.13 xc/programs/Xserver/fb/fbglyph.c:1.14 --- xc/programs/Xserver/fb/fbglyph.c:1.13 Thu Dec 4 12:15:12 2003 +++ xc/programs/Xserver/fb/fbglyph.c Fri Oct 14 11:16:23 2005 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/fb/fbglyph.c,v 1.13 2003/12/04 17:15:12 tsi Exp $ + * $XFree86: xc/programs/Xserver/fb/fbglyph.c,v 1.14 2005/10/14 15:16:23 tsi Exp $ * * Copyright © 1998 Keith Packard * @@ -23,7 +23,7 @@ */ #include "fb.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" #define dummyScreen screenInfo.screens[0] Index: xc/programs/Xserver/fb/fbimage.c diff -u xc/programs/Xserver/fb/fbimage.c:1.8 xc/programs/Xserver/fb/fbimage.c:1.9 --- xc/programs/Xserver/fb/fbimage.c:1.8 Fri Sep 7 11:15:31 2001 +++ xc/programs/Xserver/fb/fbimage.c Mon Jan 9 09:59:47 2006 @@ -1,6 +1,4 @@ /* - * Id: fbimage.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbimage.c,v 1.8 2001/09/07 15:15:31 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbimage.c,v 1.9 2006/01/09 14:59:47 dawes Exp $ */ #include "fb.h" #ifdef XFree86LOADER Index: xc/programs/Xserver/fb/fboverlay.c diff -u xc/programs/Xserver/fb/fboverlay.c:1.7 xc/programs/Xserver/fb/fboverlay.c:1.8 --- xc/programs/Xserver/fb/fboverlay.c:1.7 Mon Nov 10 13:21:47 2003 +++ xc/programs/Xserver/fb/fboverlay.c Sun Feb 19 10:51:19 2006 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/fb/fboverlay.c,v 1.7 2003/11/10 18:21:47 tsi Exp $ + * $XFree86: xc/programs/Xserver/fb/fboverlay.c,v 1.8 2006/02/19 15:51:19 tsi Exp $ * * Copyright © 2000 SuSE, Inc. * @@ -407,10 +407,6 @@ #endif )) return FALSE; - /* MI thinks there's no frame buffer */ -#ifdef MITSHM - ShmRegisterFbFuncs(pScreen); -#endif pScreen->minInstalledCmaps = 1; pScreen->maxInstalledCmaps = 2; Index: xc/programs/Xserver/fb/fbpixmap.c diff -u xc/programs/Xserver/fb/fbpixmap.c:1.11 xc/programs/Xserver/fb/fbpixmap.c:1.13 --- xc/programs/Xserver/fb/fbpixmap.c:1.11 Mon Sep 16 14:05:34 2002 +++ xc/programs/Xserver/fb/fbpixmap.c Mon Jan 9 09:59:47 2006 @@ -1,6 +1,4 @@ /* - * Id: fbpixmap.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbpixmap.c,v 1.11 2002/09/16 18:05:34 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbpixmap.c,v 1.13 2006/01/09 14:59:47 dawes Exp $ */ #include "fb.h" #ifdef IN_MODULE @@ -37,6 +35,9 @@ int adjust; int base; + if ((width > MAXSHORT) || (height > MAXSHORT)) + return NullPixmap; + paddedWidth = ((width * bpp + FB_MASK) >> FB_SHIFT) * sizeof (FbBits); datasize = height * paddedWidth; #ifdef PIXPRIV Index: xc/programs/Xserver/fb/fbpoint.c diff -u xc/programs/Xserver/fb/fbpoint.c:1.8 xc/programs/Xserver/fb/fbpoint.c:1.9 --- xc/programs/Xserver/fb/fbpoint.c:1.8 Tue May 29 00:54:09 2001 +++ xc/programs/Xserver/fb/fbpoint.c Mon Jan 9 09:59:47 2006 @@ -1,6 +1,4 @@ /* - * Id: fbpoint.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbpoint.c,v 1.8 2001/05/29 04:54:09 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbpoint.c,v 1.9 2006/01/09 14:59:47 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbpush.c diff -u xc/programs/Xserver/fb/fbpush.c:1.5 xc/programs/Xserver/fb/fbpush.c:1.6 --- xc/programs/Xserver/fb/fbpush.c:1.5 Tue May 29 00:54:09 2001 +++ xc/programs/Xserver/fb/fbpush.c Mon Jan 9 09:59:47 2006 @@ -1,6 +1,4 @@ /* - * Id: fbpush.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbpush.c,v 1.5 2001/05/29 04:54:09 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbpush.c,v 1.6 2006/01/09 14:59:47 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbrop.h diff -u xc/programs/Xserver/fb/fbrop.h:1.4 xc/programs/Xserver/fb/fbrop.h:1.5 --- xc/programs/Xserver/fb/fbrop.h:1.4 Wed Feb 23 15:29:46 2000 +++ xc/programs/Xserver/fb/fbrop.h Mon Jan 9 09:59:47 2006 @@ -1,6 +1,4 @@ /* - * Id: fbrop.h,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbrop.h,v 1.4 2000/02/23 20:29:46 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbrop.h,v 1.5 2006/01/09 14:59:47 dawes Exp $ */ #ifndef _FBROP_H_ #define _FBROP_H_ Index: xc/programs/Xserver/fb/fbscreen.c diff -u xc/programs/Xserver/fb/fbscreen.c:1.13 xc/programs/Xserver/fb/fbscreen.c:1.14 --- xc/programs/Xserver/fb/fbscreen.c:1.13 Tue May 29 00:54:09 2001 +++ xc/programs/Xserver/fb/fbscreen.c Mon Jan 9 09:59:47 2006 @@ -1,6 +1,4 @@ /* - * Id: fbscreen.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbscreen.c,v 1.13 2001/05/29 04:54:09 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbscreen.c,v 1.14 2006/01/09 14:59:47 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbseg.c diff -u xc/programs/Xserver/fb/fbseg.c:1.8 xc/programs/Xserver/fb/fbseg.c:1.9 --- xc/programs/Xserver/fb/fbseg.c:1.8 Tue May 29 00:54:09 2001 +++ xc/programs/Xserver/fb/fbseg.c Mon Jan 9 09:59:47 2006 @@ -1,6 +1,4 @@ /* - * Id: fbseg.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbseg.c,v 1.8 2001/05/29 04:54:09 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbseg.c,v 1.9 2006/01/09 14:59:47 dawes Exp $ */ #include "fb.h" #include "miline.h" Index: xc/programs/Xserver/fb/fbsetsp.c diff -u xc/programs/Xserver/fb/fbsetsp.c:1.5 xc/programs/Xserver/fb/fbsetsp.c:1.6 --- xc/programs/Xserver/fb/fbsetsp.c:1.5 Tue May 29 00:54:09 2001 +++ xc/programs/Xserver/fb/fbsetsp.c Mon Jan 9 09:59:47 2006 @@ -1,6 +1,4 @@ /* - * Id: fbsetsp.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbsetsp.c,v 1.5 2001/05/29 04:54:09 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbsetsp.c,v 1.6 2006/01/09 14:59:47 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbstipple.c diff -u xc/programs/Xserver/fb/fbstipple.c:1.7 xc/programs/Xserver/fb/fbstipple.c:1.8 --- xc/programs/Xserver/fb/fbstipple.c:1.7 Sat Oct 27 23:33:08 2001 +++ xc/programs/Xserver/fb/fbstipple.c Mon Jan 9 09:59:47 2006 @@ -1,6 +1,4 @@ /* - * Id: fbstipple.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbstipple.c,v 1.7 2001/10/28 03:33:08 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbstipple.c,v 1.8 2006/01/09 14:59:47 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbtile.c diff -u xc/programs/Xserver/fb/fbtile.c:1.4 xc/programs/Xserver/fb/fbtile.c:1.5 --- xc/programs/Xserver/fb/fbtile.c:1.4 Wed Feb 23 15:29:48 2000 +++ xc/programs/Xserver/fb/fbtile.c Mon Jan 9 09:59:47 2006 @@ -1,6 +1,4 @@ /* - * Id: fbtile.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbtile.c,v 1.4 2000/02/23 20:29:48 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbtile.c,v 1.5 2006/01/09 14:59:47 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbutil.c diff -u xc/programs/Xserver/fb/fbutil.c:1.5 xc/programs/Xserver/fb/fbutil.c:1.6 --- xc/programs/Xserver/fb/fbutil.c:1.5 Wed Mar 28 09:37:03 2001 +++ xc/programs/Xserver/fb/fbutil.c Mon Jan 9 09:59:47 2006 @@ -1,6 +1,4 @@ /* - * Id: fbutil.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ - * * Copyright © 1998 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -21,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbutil.c,v 1.5 2001/03/28 14:37:03 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/fb/fbutil.c,v 1.6 2006/01/09 14:59:47 dawes Exp $ */ #include "fb.h" Index: xc/programs/Xserver/fb/fbwindow.c diff -u xc/programs/Xserver/fb/fbwindow.c:1.11 xc/programs/Xserver/fb/fbwindow.c:1.13 --- xc/programs/Xserver/fb/fbwindow.c:1.11 Mon Nov 10 13:21:47 2003 +++ xc/programs/Xserver/fb/fbwindow.c Sun Feb 19 10:51:19 2006 @@ -1,5 +1,5 @@ /* - * Id: fbwindow.c,v 1.1 1999/11/02 03:54:45 keithp Exp $ + * $XFree86: xc/programs/Xserver/fb/fbwindow.c,v 1.13 2006/02/19 15:51:19 tsi Exp $ * * Copyright © 1998 Keith Packard * @@ -21,7 +21,6 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/fb/fbwindow.c,v 1.11 2003/11/10 18:21:47 tsi Exp $ */ #include "fb.h" #ifdef IN_MODULE @@ -223,11 +222,6 @@ } } -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - void fbFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, @@ -247,17 +241,6 @@ int xRot = pDrawable->x; int yRot = pDrawable->y; -#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; Index: xc/programs/Xserver/hw/Imakefile diff -u xc/programs/Xserver/hw/Imakefile:1.2 xc/programs/Xserver/hw/Imakefile:1.5 --- xc/programs/Xserver/hw/Imakefile:1.2 Wed Jun 30 16:21:38 2004 +++ xc/programs/Xserver/hw/Imakefile Fri Feb 24 10:31:29 2006 @@ -1,26 +1,68 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:20 cpqbld Exp $ -XCOMM This is only used on NT where we do not know how to jump over this dir +XCOMM $XFree86: xc/programs/Xserver/hw/Imakefile,v 1.5 2006/02/24 15:31:29 tsi Exp $ -#ifdef Win32Architecture +#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" +#if defined(XF86Server) && XF86Server +#undef IHaveSubdirs #define IHaveSubdirs -#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" +XFREE86DIR = xfree86 +#endif + +#if (defined(XsunServer) && XsunServer) || \ + (defined(Xsun24Server) && Xsun24Server) || \ + (defined(XsunMonoServer) && XsunMonoServer) +#undef IHaveSubdirs +#define IHaveSubdirs +SUNDIR = sun +#endif + +#if (defined(XsunLynxServer) && XsunLynxServer) || \ + (defined(XsunLynxMonoServer) && XsunLynxMonoServer) +#undef IHaveSubdirs +#define IHaveSubdirs +LYNXDIR = sunLynx +#endif + +#if defined(TinyXServer) && TinyXServer +#undef IHaveSubdirs +#define IHaveSubdirs +TINYDIR = tinyx +#endif -#if XnestServer +#if defined(XnestServer) && XnestServer +#undef IHaveSubdirs +#define IHaveSubdirs XNESTDIR = xnest #endif -#if XVirtualFramebufferServer +#if defined(XVirtualFramebufferServer) && XVirtualFramebufferServer +#undef IHaveSubdirs +#define IHaveSubdirs XVFBDIR = vfb #endif -#if XdmxServer -XDMXDIR = xdmx +#if defined(XdmxServer) && XdmxServer +#undef IHaveSubdirs +#define IHaveSubdirs +XDMXDIR = dmx #endif -SUBDIRS= $(XNESTDIR) $(XVFBDIR) $(XDMXDIR) +#if defined(XWinServer) && XWinServer +#undef IHaveSubdirs +#define IHaveSubdirs +WINDIR = xwin +#endif + +#if defined(XDarwinServer) && XDarwinServer +#undef IHaveSubdirs +#define IHaveSubdirs +DARWINDIR = darwin +#endif + +#ifdef IHaveSubdirs +SUBDIRS= $(XFREE86DIR) $(SUNDIR) $(LYNXDIR) $(TINYDIR) $(XNESTDIR) $(XVFBDIR) \ + $(XDMXDIR) $(WINDIR) $(DARWINDIR) MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) - #endif Index: xc/programs/Xserver/hw/darwin/Imakefile diff -u xc/programs/Xserver/hw/darwin/Imakefile:1.21 xc/programs/Xserver/hw/darwin/Imakefile:1.22 --- xc/programs/Xserver/hw/darwin/Imakefile:1.21 Fri May 28 03:44:00 2004 +++ xc/programs/Xserver/hw/darwin/Imakefile Fri Oct 14 11:16:23 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/Imakefile,v 1.21 2004/05/28 07:44:00 torrey Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/Imakefile,v 1.22 2005/10/14 15:16:23 tsi Exp $ #include #define IHaveSubdirs @@ -26,9 +26,8 @@ miinitext.o \ $(XINPUTOBJS) -INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(EXTINCSRC) \ - -I$(SERVERSRC)/render -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(SERVERSRC)/os -I$(INCLUDESRC) -I$(FONTINCSRC) \ +INCLUDES = -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(SERVERSRC)/render \ + -I$(SERVERSRC)/include -I$(SERVERSRC)/os \ -I$(SERVERSRC)/miext/shadow -I$(SERVERSRC)/hw/xfree86 \ -I$(SERVERSRC)/Xi Index: xc/programs/Xserver/hw/darwin/darwin.c diff -u xc/programs/Xserver/hw/darwin/darwin.c:1.58 xc/programs/Xserver/hw/darwin/darwin.c:1.60 --- xc/programs/Xserver/hw/darwin/darwin.c:1.58 Wed Jun 2 18:42:56 2004 +++ xc/programs/Xserver/hw/darwin/darwin.c Sun Feb 19 10:51:19 2006 @@ -29,10 +29,10 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.58 2004/06/02 22:42:56 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.60 2006/02/19 15:51:19 tsi Exp $ */ -#include "X.h" -#include "Xproto.h" +#include +#include #include "os.h" #include "servermd.h" #include "inputstr.h" @@ -48,8 +48,8 @@ #include "dix.h" #ifdef XINPUT -# include "XI.h" -# include "XIproto.h" +# include +# include # include "exevents.h" # include "extinit.h" #endif @@ -270,10 +270,6 @@ } #endif -#ifdef MITSHM - ShmRegisterFbFuncs(pScreen); -#endif - // this must be initialized (why doesn't X have a default?) pScreen->SaveScreen = DarwinSaveScreen; Index: xc/programs/Xserver/hw/darwin/darwin.h diff -u xc/programs/Xserver/hw/darwin/darwin.h:1.20 xc/programs/Xserver/hw/darwin/darwin.h:1.21 --- xc/programs/Xserver/hw/darwin/darwin.h:1.20 Fri Nov 14 19:07:09 2003 +++ xc/programs/Xserver/hw/darwin/darwin.h Fri Oct 14 11:16:23 2005 @@ -23,7 +23,7 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.20 2003/11/15 00:07:09 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.21 2005/10/14 15:16:23 tsi Exp $ */ #ifndef _DARWIN_H #define _DARWIN_H @@ -31,7 +31,7 @@ #include #include "inputstr.h" #include "scrnintstr.h" -#include "extensions/XKB.h" +#include typedef struct { void *framebuffer; Index: xc/programs/Xserver/hw/darwin/darwinEvents.c diff -u xc/programs/Xserver/hw/darwin/darwinEvents.c:1.6 xc/programs/Xserver/hw/darwin/darwinEvents.c:1.7 --- xc/programs/Xserver/hw/darwin/darwinEvents.c:1.6 Wed Mar 31 17:29:09 2004 +++ xc/programs/Xserver/hw/darwin/darwinEvents.c Fri Oct 14 11:16:23 2005 @@ -29,12 +29,12 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/darwinEvents.c,v 1.6 2004/03/31 22:29:09 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwinEvents.c,v 1.7 2005/10/14 15:16:23 tsi Exp $ */ #define NEED_EVENTS -#include "X.h" -#include "Xmd.h" -#include "Xproto.h" +#include +#include +#include #include "misc.h" #include "windowstr.h" #include "pixmapstr.h" Index: xc/programs/Xserver/hw/darwin/darwinKeyboard.h diff -u xc/programs/Xserver/hw/darwin/darwinKeyboard.h:1.1 xc/programs/Xserver/hw/darwin/darwinKeyboard.h:1.2 --- xc/programs/Xserver/hw/darwin/darwinKeyboard.h:1.1 Sat Nov 1 03:13:08 2003 +++ xc/programs/Xserver/hw/darwin/darwinKeyboard.h Fri Oct 14 11:16:23 2005 @@ -23,14 +23,14 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.h,v 1.1 2003/11/01 08:13:08 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.h,v 1.2 2005/10/14 15:16:23 tsi Exp $ */ #ifndef DARWIN_KEYBOARD_H #define DARWIN_KEYBOARD_H 1 #define XK_TECHNICAL // needed to get XK_Escape #define XK_PUBLISHING -#include "keysym.h" +#include #include "inputstr.h" // Each key can generate 4 glyphs. They are, in order: Index: xc/programs/Xserver/hw/darwin/darwinXinput.c diff -u xc/programs/Xserver/hw/darwin/darwinXinput.c:1.1 xc/programs/Xserver/hw/darwin/darwinXinput.c:1.2 --- xc/programs/Xserver/hw/darwin/darwinXinput.c:1.1 Fri May 28 03:44:00 2004 +++ xc/programs/Xserver/hw/darwin/darwinXinput.c Fri Oct 14 11:16:23 2005 @@ -1,4 +1,4 @@ -/* $Xorg: stubs.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwinXinput.c,v 1.2 2005/10/14 15:16:23 tsi Exp $ */ /* * X server support of the XINPUT extension for Darwin @@ -52,14 +52,13 @@ SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/darwin/darwinXinput.c,v 1.1 2004/05/28 07:44:00 torrey Exp $ */ #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" +#include +#include #include "inputstr.h" -#include "XI.h" -#include "XIproto.h" +#include +#include #include "XIstubs.h" /*********************************************************************** Index: xc/programs/Xserver/hw/darwin/iokit/Imakefile diff -u xc/programs/Xserver/hw/darwin/iokit/Imakefile:1.1 xc/programs/Xserver/hw/darwin/iokit/Imakefile:1.2 --- xc/programs/Xserver/hw/darwin/iokit/Imakefile:1.1 Wed May 14 01:27:55 2003 +++ xc/programs/Xserver/hw/darwin/iokit/Imakefile Fri Oct 14 11:16:23 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/iokit/Imakefile,v 1.1 2003/05/14 05:27:55 torrey Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/iokit/Imakefile,v 1.2 2005/10/14 15:16:23 tsi Exp $ #include @@ -10,10 +10,9 @@ xfIOKitCursor.o \ xfIOKitStartup.o -INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(EXTINCSRC) \ - -I$(SERVERSRC)/render -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(SERVERSRC)/os -I$(INCLUDESRC) -I$(FONTINCSRC) \ - -I$(SERVERSRC)/miext/shadow -I.. +INCLUDES = -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(SERVERSRC)/render \ + -I$(SERVERSRC)/include -I$(SERVERSRC)/os \ + -I$(SERVERSRC)/miext/shadow -I.. #if DarwinQuartzSupport DEFINES = -DDARWIN_WITH_QUARTZ Index: xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c diff -u xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c:1.4 xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c:1.5 --- xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c:1.4 Thu Jun 17 19:27:41 2004 +++ xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c Fri Oct 14 11:16:23 2005 @@ -33,10 +33,10 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c,v 1.4 2004/06/17 23:27:41 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/iokit/xfIOKit.c,v 1.5 2005/10/14 15:16:23 tsi Exp $ */ -#include "X.h" -#include "Xproto.h" +#include +#include #include "os.h" #include "servermd.h" #include "inputstr.h" Index: xc/programs/Xserver/hw/darwin/quartz/Imakefile diff -u xc/programs/Xserver/hw/darwin/quartz/Imakefile:1.13 xc/programs/Xserver/hw/darwin/quartz/Imakefile:1.14 --- xc/programs/Xserver/hw/darwin/quartz/Imakefile:1.13 Tue Feb 10 17:51:23 2004 +++ xc/programs/Xserver/hw/darwin/quartz/Imakefile Fri Oct 14 11:16:24 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/Imakefile,v 1.13 2004/02/10 22:51:23 torrey Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/Imakefile,v 1.14 2005/10/14 15:16:24 tsi Exp $ #include #define IHaveSubdirs @@ -29,10 +29,9 @@ quartzStartup.o \ pseudoramiX.o -INCLUDES = -I. -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ - -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(SERVERSRC)/render \ - -I$(SERVERSRC)/miext/shadow -I$(EXTINCSRC) -I$(SERVERSRC)/Xext \ - -I.. -I$(APPLEWMLIBSRC) +INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ + -I$(SERVERSRC)/render -I$(SERVERSRC)/miext/shadow \ + -I$(SERVERSRC)/Xext -I.. -I$(APPLEWMLIBSRC) #if defined(XFree86CustomVersion) CUSTOMVERSION = XFree86CustomVersion Index: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.man diff -u xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.man:1.1 xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.man:1.2 --- xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.man:1.1 Wed Mar 27 21:21:18 2002 +++ xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.man Sun Feb 26 20:57:11 2006 @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.man,v 1.1 2002/03/28 02:21:18 torrey Exp $ +.\" $XFree86: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.man,v 1.2 2006/02/27 01:57:11 dawes Exp $ .TH XDarwinStartup 1 .SH NAME XDarwinStartup - Startup program for the XDarwin X window server @@ -36,7 +36,7 @@ .PP To start the IOKit X server, .I XDarwinStartup -will run the XDarwin execuatable, which should be present in the +will run the XDarwin executable, which should be present in the user's path. .SH OPTIONS .I XDarwinStartup Index: xc/programs/Xserver/hw/darwin/quartz/XServer.h diff -u xc/programs/Xserver/hw/darwin/quartz/XServer.h:1.19 xc/programs/Xserver/hw/darwin/quartz/XServer.h:1.20 --- xc/programs/Xserver/hw/darwin/quartz/XServer.h:1.19 Tue Jun 8 18:58:10 2004 +++ xc/programs/Xserver/hw/darwin/quartz/XServer.h Fri Oct 14 11:16:24 2005 @@ -29,10 +29,10 @@ * sale, use or other dealings in this Software without prior written * authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.19 2004/06/08 22:58:10 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.20 2005/10/14 15:16:24 tsi Exp $ */ #define BOOL xBOOL -#include "Xproto.h" +#include #undef BOOL #import Index: xc/programs/Xserver/hw/darwin/quartz/XServer.m diff -u xc/programs/Xserver/hw/darwin/quartz/XServer.m:1.24 xc/programs/Xserver/hw/darwin/quartz/XServer.m:1.25 --- xc/programs/Xserver/hw/darwin/quartz/XServer.m:1.24 Thu Jul 15 14:53:25 2004 +++ xc/programs/Xserver/hw/darwin/quartz/XServer.m Fri Oct 14 11:16:24 2005 @@ -34,19 +34,19 @@ * sale, use or other dealings in this Software without prior written * authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.24 2004/07/15 18:53:25 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.25 2005/10/14 15:16:24 tsi Exp $ */ #include "quartzCommon.h" #define BOOL xBOOL -#include "X.h" -#include "Xproto.h" +#include +#include #include "os.h" #include "opaque.h" #include "darwin.h" #include "quartz.h" #define _APPLEWM_SERVER_ -#include "applewm.h" +#include #include "applewmExt.h" #undef BOOL Index: xc/programs/Xserver/hw/darwin/quartz/applewm.c diff -u xc/programs/Xserver/hw/darwin/quartz/applewm.c:1.3 xc/programs/Xserver/hw/darwin/quartz/applewm.c:1.4 --- xc/programs/Xserver/hw/darwin/quartz/applewm.c:1.3 Tue Nov 11 18:48:41 2003 +++ xc/programs/Xserver/hw/darwin/quartz/applewm.c Fri Oct 14 11:16:24 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/applewm.c,v 1.3 2003/11/11 23:48:41 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/applewm.c,v 1.4 2005/10/14 15:16:24 tsi Exp $ */ /************************************************************************** Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved. @@ -40,10 +40,10 @@ #include "windowstr.h" #include "servermd.h" #include "swaprep.h" -#include "Xatom.h" +#include #include "darwin.h" #define _APPLEWM_SERVER_ -#include "applewmstr.h" +#include #include "applewmExt.h" #define DEFINE_ATOM_HELPER(func,atom_name) \ Index: xc/programs/Xserver/hw/darwin/quartz/applewmExt.h diff -u xc/programs/Xserver/hw/darwin/quartz/applewmExt.h:1.3 xc/programs/Xserver/hw/darwin/quartz/applewmExt.h:1.4 --- xc/programs/Xserver/hw/darwin/quartz/applewmExt.h:1.3 Mon Nov 17 17:20:35 2003 +++ xc/programs/Xserver/hw/darwin/quartz/applewmExt.h Tue Apr 12 19:20:01 2005 @@ -27,7 +27,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/applewmExt.h,v 1.3 2003/11/17 22:20:35 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/applewmExt.h,v 1.4 2005/04/12 23:20:01 dawes Exp $ */ #ifndef _APPLEWMEXT_H_ #define _APPLEWMEXT_H_ @@ -59,8 +59,6 @@ FrameDrawProc FrameDraw; } AppleWMProcsRec, *AppleWMProcsPtr; -extern AppleWMProcsPtr appleWMProcs; - void AppleWMExtensionInit( AppleWMProcsPtr procsPtr ); Index: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c diff -u xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c:1.4 xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c:1.5 --- xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c:1.4 Thu Jul 1 21:30:33 2004 +++ xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c Fri Oct 14 11:16:24 2005 @@ -32,14 +32,14 @@ dealings in this Software without prior written authorization from Digital Equipment Corporation. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c,v 1.4 2004/07/02 01:30:33 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c,v 1.5 2005/10/14 15:16:24 tsi Exp $ */ #include "pseudoramiX.h" #include "extnsionst.h" #include "dixstruct.h" #include "window.h" -#include "panoramiXproto.h" +#include #include "globals.h" extern int ProcPanoramiXQueryVersion (ClientPtr client); Index: xc/programs/Xserver/hw/darwin/quartz/quartz.c diff -u xc/programs/Xserver/hw/darwin/quartz/quartz.c:1.16 xc/programs/Xserver/hw/darwin/quartz/quartz.c:1.17 --- xc/programs/Xserver/hw/darwin/quartz/quartz.c:1.16 Thu Jul 1 21:30:33 2004 +++ xc/programs/Xserver/hw/darwin/quartz/quartz.c Fri Oct 14 11:16:24 2005 @@ -29,7 +29,7 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.16 2004/07/02 01:30:33 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.17 2005/10/14 15:16:24 tsi Exp $ */ #include "quartzCommon.h" #include "quartz.h" @@ -37,7 +37,7 @@ #include "quartzAudio.h" #include "pseudoramiX.h" #define _APPLEWM_SERVER_ -#include "applewm.h" +#include #include "applewmExt.h" // X headers Index: xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c diff -u xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c:1.2 xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c:1.3 --- xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c:1.2 Wed May 14 01:27:56 2003 +++ xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c Fri Oct 14 11:16:24 2005 @@ -35,7 +35,7 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c,v 1.2 2003/05/14 05:27:56 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c,v 1.3 2005/10/14 15:16:24 tsi Exp $ */ #include "quartzCommon.h" #include "quartzAudio.h" @@ -44,7 +44,7 @@ #include #include "inputstr.h" -#include "extensions/XI.h" +#include void NSBeep(); Index: xc/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c diff -u xc/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c:1.3 xc/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c:1.5 --- xc/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c:1.3 Wed Mar 31 17:29:10 2004 +++ xc/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c Mon Jan 9 09:59:48 2006 @@ -1,6 +1,5 @@ /* quartzKeyboard.c - $Id: darwin-new-keymap.c,v 1.7 2003/02/21 22:33:19 jharper Exp $ Code to build a keymap using the Carbon Keyboard Layout API, which is supported on Mac OS X 10.2 and newer. @@ -32,7 +31,7 @@ promote the sale, use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c,v 1.3 2004/03/31 22:29:10 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzKeyboard.c,v 1.5 2006/01/09 14:59:48 dawes Exp $ */ #include "quartzCommon.h" @@ -40,7 +39,7 @@ #include #include "darwinKeyboard.h" -#include "keysym.h" +#include #include "keysym2ucs.h" #ifdef HAS_KL_API Index: xc/programs/Xserver/hw/darwin/quartz/quartzPasteboard.c diff -u xc/programs/Xserver/hw/darwin/quartz/quartzPasteboard.c:1.1 xc/programs/Xserver/hw/darwin/quartz/quartzPasteboard.c:1.2 --- xc/programs/Xserver/hw/darwin/quartz/quartzPasteboard.c:1.1 Wed Mar 27 21:21:19 2002 +++ xc/programs/Xserver/hw/darwin/quartz/quartzPasteboard.c Fri Oct 14 11:16:24 2005 @@ -29,11 +29,11 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzPasteboard.c,v 1.1 2002/03/28 02:21:19 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzPasteboard.c,v 1.2 2005/10/14 15:16:24 tsi Exp $ */ #include "quartzPasteboard.h" -#include "Xatom.h" +#include #include "windowstr.h" #include "propertyst.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/darwin/quartz/cr/Imakefile diff -u xc/programs/Xserver/hw/darwin/quartz/cr/Imakefile:1.3 xc/programs/Xserver/hw/darwin/quartz/cr/Imakefile:1.4 --- xc/programs/Xserver/hw/darwin/quartz/cr/Imakefile:1.3 Thu Mar 18 21:05:29 2004 +++ xc/programs/Xserver/hw/darwin/quartz/cr/Imakefile Fri Oct 14 11:16:24 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/Imakefile,v 1.3 2004/03/19 02:05:29 torrey Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/Imakefile,v 1.4 2005/10/14 15:16:24 tsi Exp $ #include @@ -17,9 +17,8 @@ quartzCursor.o \ XView.o -INCLUDES = -I. -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ - -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(SERVERSRC)/render \ - -I$(SERVERSRC)/miext/rootless -I$(EXTINCSRC) -I.. -I../.. \ +INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ + -I$(SERVERSRC)/render -I$(SERVERSRC)/miext/rootless -I.. -I../.. \ -I$(SERVERSRC)/miext/rootless/safeAlpha -I$(SERVERSRC)/Xext \ -I$(APPLEWMLIBSRC) Index: xc/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m diff -u xc/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m:1.1 xc/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m:1.2 --- xc/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m:1.1 Mon Sep 15 20:36:14 2003 +++ xc/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m Fri Oct 14 11:16:24 2005 @@ -26,7 +26,7 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m,v 1.1 2003/09/16 00:36:14 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crAppleWM.m,v 1.2 2005/10/14 15:16:24 tsi Exp $ */ #include "quartzCommon.h" #include "cr.h" @@ -34,9 +34,9 @@ #undef BOOL #define BOOL xBOOL #include "rootless.h" -#include "X.h" +#include #define _APPLEWM_SERVER_ -#include "applewm.h" +#include #include "applewmExt.h" #undef BOOL Index: xc/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile diff -u xc/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile:1.1 xc/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile:1.2 --- xc/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile:1.1 Mon Sep 15 20:36:14 2003 +++ xc/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile Fri Oct 14 11:16:24 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile,v 1.1 2003/09/16 00:36:14 torrey Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/fullscreen/Imakefile,v 1.2 2005/10/14 15:16:24 tsi Exp $ #include @@ -8,9 +8,8 @@ OBJS = fullscreen.o \ quartzCursor.o -INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(FONTINCSRC) -I$(SERVERSRC)/render -I$(SERVERSRC)/miext/shadow \ - -I$(EXTINCSRC) -I.. -I../.. +INCLUDES = -I$(SERVERSRC)/mi -I$(SERVERSRC)/include -I$(SERVERSRC)/render \ + -I$(SERVERSRC)/miext/shadow -I.. -I../.. NormalLibraryObjectRule() NormalLibraryTarget(fullscreen,$(OBJS)) Index: xc/programs/Xserver/hw/darwin/quartz/xpr/Imakefile diff -u xc/programs/Xserver/hw/darwin/quartz/xpr/Imakefile:1.4 xc/programs/Xserver/hw/darwin/quartz/xpr/Imakefile:1.5 --- xc/programs/Xserver/hw/darwin/quartz/xpr/Imakefile:1.4 Mon Sep 15 20:36:15 2003 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/Imakefile Fri Oct 14 11:16:24 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/Imakefile,v 1.4 2003/09/16 00:36:15 torrey Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/Imakefile,v 1.5 2005/10/14 15:16:24 tsi Exp $ #include @@ -22,9 +22,8 @@ x-hook.o \ x-list.o -INCLUDES = -I. -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ - -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(SERVERSRC)/render \ - -I$(SERVERSRC)/miext/rootless -I$(EXTINCSRC) -I.. -I../.. \ +INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ + -I$(SERVERSRC)/render -I$(SERVERSRC)/miext/rootless -I.. -I../.. \ -I$(SERVERSRC)/miext/rootless/safeAlpha -I$(SERVERSRC)/Xext \ -I$(LIBSRC)/GL/apple -I$(APPLEWMLIBSRC) Index: xc/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h diff -u xc/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h:1.3 xc/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h:1.4 --- xc/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h:1.3 Fri Jun 27 16:21:42 2003 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h Mon Jan 9 09:59:48 2006 @@ -1,5 +1,4 @@ /* Xplugin.h -- windowing API for rootless X11 server - $Id: Xplugin.h,v 1.4 2003/03/03 23:30:53 jharper Exp $ Copyright (c) 2002 Apple Computer, Inc. All rights reserved. @@ -30,7 +29,7 @@ Note that these interfaces are provided solely for the use of the X11 server. Any other uses are unsupported and strongly discouraged. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h,v 1.3 2003/06/27 20:21:42 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/Xplugin.h,v 1.4 2006/01/09 14:59:48 dawes Exp $ */ #ifndef XPLUGIN_H #define XPLUGIN_H 1 Index: xc/programs/Xserver/hw/darwin/quartz/xpr/appledri.c diff -u xc/programs/Xserver/hw/darwin/quartz/xpr/appledri.c:1.1 xc/programs/Xserver/hw/darwin/quartz/xpr/appledri.c:1.2 --- xc/programs/Xserver/hw/darwin/quartz/xpr/appledri.c:1.1 Sun Jun 29 21:45:13 2003 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/appledri.c Fri Oct 14 11:16:24 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/appledri.c,v 1.1 2003/06/30 01:45:13 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/appledri.c,v 1.2 2005/10/14 15:16:24 tsi Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -38,8 +38,8 @@ #define NEED_REPLIES #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" +#include +#include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" Index: xc/programs/Xserver/hw/darwin/quartz/xpr/dri.c diff -u xc/programs/Xserver/hw/darwin/quartz/xpr/dri.c:1.1 xc/programs/Xserver/hw/darwin/quartz/xpr/dri.c:1.2 --- xc/programs/Xserver/hw/darwin/quartz/xpr/dri.c:1.1 Sun Jun 29 21:45:13 2003 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/dri.c Fri Oct 14 11:16:24 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/dri.c,v 1.1 2003/06/30 01:45:13 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/dri.c,v 1.2 2005/10/14 15:16:24 tsi Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -45,8 +45,8 @@ #define NEED_REPLIES #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" +#include +#include #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" Index: xc/programs/Xserver/hw/darwin/quartz/xpr/dri.h diff -u xc/programs/Xserver/hw/darwin/quartz/xpr/dri.h:1.1 xc/programs/Xserver/hw/darwin/quartz/xpr/dri.h:1.2 --- xc/programs/Xserver/hw/darwin/quartz/xpr/dri.h:1.1 Sun Jun 29 21:45:13 2003 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/dri.h Fri Oct 14 11:16:24 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/dri.h,v 1.1 2003/06/30 01:45:13 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/dri.h,v 1.2 2005/10/14 15:16:24 tsi Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -37,7 +37,7 @@ #ifndef _DRI_H_ -#include "Xdefs.h" +#include #include "scrnintstr.h" #define _APPLEDRI_SERVER_ #include "appledri.h" Index: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c diff -u xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c:1.2 xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c:1.3 --- xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c:1.2 Sun Jun 29 21:45:13 2003 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c Mon Jan 9 09:59:48 2006 @@ -1,5 +1,4 @@ /* x-hash.c - basic hash tables - $Id: x-hash.c,v 1.6 2003/04/16 00:42:14 jharper Exp $ Copyright (c) 2002 Apple Computer, Inc. All rights reserved. @@ -27,7 +26,7 @@ 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. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c,v 1.2 2003/06/30 01:45:13 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.c,v 1.3 2006/01/09 14:59:48 dawes Exp $ */ #include "x-hash.h" #include "x-list.h" Index: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h diff -u xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h:1.2 xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h:1.3 --- xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h:1.2 Sun Jun 29 21:45:13 2003 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h Mon Jan 9 09:59:48 2006 @@ -1,5 +1,4 @@ /* x-hash.h -- basic hash table class - $Id: x-hash.h,v 1.4 2003/04/16 00:42:14 jharper Exp $ Copyright (c) 2002 Apple Computer, Inc. All rights reserved. @@ -27,7 +26,7 @@ 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. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h,v 1.2 2003/06/30 01:45:13 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hash.h,v 1.3 2006/01/09 14:59:48 dawes Exp $ */ #ifndef X_HASH_H #define X_HASH_H 1 Index: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c diff -u xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c:1.1 xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c:1.2 --- xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c:1.1 Sun Jun 29 21:45:13 2003 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c Mon Jan 9 09:59:48 2006 @@ -1,5 +1,4 @@ /* x-hook.c - $Id: x-hook.c,v 1.2 2003/04/16 00:42:14 jharper Exp $ Copyright (c) 2003 Apple Computer, Inc. All rights reserved. @@ -27,7 +26,7 @@ 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. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c,v 1.1 2003/06/30 01:45:13 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.c,v 1.2 2006/01/09 14:59:48 dawes Exp $ */ #include "x-hook.h" #include Index: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h diff -u xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h:1.1 xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h:1.2 --- xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h:1.1 Sun Jun 29 21:45:13 2003 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h Mon Jan 9 09:59:48 2006 @@ -1,5 +1,4 @@ /* x-hook.h -- lists of function,data pairs to call. - $Id: x-hook.h,v 1.2 2003/04/16 00:42:14 jharper Exp $ Copyright (c) 2003 Apple Computer, Inc. All rights reserved. @@ -27,7 +26,7 @@ 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. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h,v 1.1 2003/06/30 01:45:13 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-hook.h,v 1.2 2006/01/09 14:59:48 dawes Exp $ */ #ifndef X_HOOK_H #define X_HOOK_H 1 Index: xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.c diff -u xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.c:1.2 xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.c:1.3 --- xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.c:1.2 Sun Jun 29 21:45:13 2003 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.c Mon Jan 9 09:59:48 2006 @@ -1,5 +1,4 @@ /* x-list.c - $Id: x-list.c,v 1.14 2003/04/18 17:24:09 jharper Exp $ Copyright (c) 2002 Apple Computer, Inc. All rights reserved. @@ -27,7 +26,7 @@ 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. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.c,v 1.2 2003/06/30 01:45:13 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.c,v 1.3 2006/01/09 14:59:48 dawes Exp $ */ #include "x-list.h" #include Index: xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.h diff -u xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.h:1.2 xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.h:1.3 --- xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.h:1.2 Sun Jun 29 21:45:13 2003 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.h Mon Jan 9 09:59:48 2006 @@ -1,5 +1,4 @@ /* x-list.h -- simple list type - $Id: x-list.h,v 1.8 2003/04/16 00:42:14 jharper Exp $ Copyright (c) 2002 Apple Computer, Inc. All rights reserved. @@ -27,7 +26,7 @@ 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. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.h,v 1.2 2003/06/30 01:45:13 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/x-list.h,v 1.3 2006/01/09 14:59:48 dawes Exp $ */ #ifndef X_LIST_H #define X_LIST_H 1 Index: xc/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c diff -u xc/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c:1.1 xc/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c:1.2 --- xc/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c:1.1 Mon Sep 15 20:36:15 2003 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c Fri Oct 14 11:16:24 2005 @@ -27,13 +27,13 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c,v 1.1 2003/09/16 00:36:15 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprAppleWM.c,v 1.2 2005/10/14 15:16:24 tsi Exp $ */ #include "xpr.h" #include "applewmExt.h" #include "rootless.h" #include "Xplugin.h" -#include "X.h" +#include static int xprSetWindowLevel( Index: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c diff -u xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c:1.5 xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c:1.6 --- xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c:1.5 Wed Nov 26 20:59:53 2003 +++ xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c Fri Oct 14 11:16:24 2005 @@ -27,7 +27,7 @@ * holders shall not be used in advertising or otherwise to promote the sale, * use or other dealings in this Software without prior written authorization. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.5 2003/11/27 01:59:53 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.6 2005/10/14 15:16:24 tsi Exp $ */ #include "xpr.h" #include "rootlessCommon.h" @@ -37,7 +37,7 @@ #include "propertyst.h" #include "dix.h" -#include "Xatom.h" +#include #include "windowstr.h" #include Index: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man diff -u xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man:1.2 xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man:1.3 --- xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man:1.2 Tue Dec 5 16:18:34 2000 +++ xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man Sun Feb 26 20:57:11 2006 @@ -30,7 +30,7 @@ // //============================================================================= // -// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man,v 1.2 2000/12/05 21:18:34 dawes Exp $ +// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man,v 1.3 2006/02/27 01:57:11 dawes Exp $ // .. .ig @@ -58,7 +58,7 @@ // used with fixed-point font. The third argument is the annotation // itself. The block should be terminated with the `AE' macro. For all // roff interpreters which properly implement diversions, indentation, and -// tab stops, all anotations within the block are automatically aligned at +// tab stops, all annotations within the block are automatically aligned at // the same horizontal position. This position is guaranteed to be just // to the right of the widest `AN' detail line. For broken roff // interpreters, such as `rman', the string of spaces from the second Index: xc/programs/Xserver/hw/dmx/Imakefile diff -u xc/programs/Xserver/hw/dmx/Imakefile:1.9 xc/programs/Xserver/hw/dmx/Imakefile:1.11 --- xc/programs/Xserver/hw/dmx/Imakefile:1.9 Sun Feb 6 20:38:24 2005 +++ xc/programs/Xserver/hw/dmx/Imakefile Sun Feb 19 10:51:19 2006 @@ -1,23 +1,16 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/dmx/Imakefile,v 1.9 2005/02/07 01:38:24 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/dmx/Imakefile,v 1.11 2006/02/19 15:51:19 tsi Exp $ #include #include +#define IHaveSubdirs + #if BuildGlxInDmx -#if BuildXinerama -PANORAMIX_SRCS = panoramiX.c -PANORAMIX_OBJS = panoramiX.o -#endif -GLX_SRCS = dmx_glxvisuals.c $(PANORAMIX_SRCS) -GLX_OBJS = dmx_glxvisuals.o $(PANORAMIX_OBJS) -DMX_GLX_DEFINES = $(GLX_DEFINES) -DGLXPROXY +GLX_SRCS = dmx_glxvisuals.c +GLX_OBJS = dmx_glxvisuals.o GLXPROXY_SUBDIR = glxProxy -#else -DMX_GLX_DEFINES = -UGLXEXT #endif -#define IHaveSubdirs - #if !BuildServersOnly || BuildDmxDevelTools EXAMPLEDIR = examples #if BuildSgmlDocs @@ -25,13 +18,13 @@ #endif #endif -SUBDIRS = input config $(DMXDOCDIR) $(EXAMPLEDIR) $(GLXPROXY_SUBDIR) - #if BuildRender RENDER_SRCS = dmxpict.c RENDER_OBJS = dmxpict.o #endif +SUBDIRS = dix os Xext input config $(DMXDOCDIR) $(EXAMPLEDIR) $(GLXPROXY_SUBDIR) + #ifdef OS2Architecture SRCS1 = os2_stubs.c OBJS1 = os2_stubs.o @@ -103,14 +96,12 @@ OSVENDOR = OSVendor OSNAME_DEFINES = -DOSNAME='"$(OSNAME)"' -DOSVENDOR='"$(OSVENDOR)"' -INCLUDES = -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ - -I../../mi -I../../include -I../../os \ - -I../../fb -I../../miext/shadow -I../../render \ - -I$(EXTINCSRC) -I$(XINCLUDESRC) -I$(SERVERSRC)/Xext - -DEFINES = $(OS_DEFINES) $(EXT_DEFINES) -DDMXEXT -DXTEST \ - $(DMX_GLX_DEFINES) $(DMX_DEFINES) $(VENDOR_DEFINES) \ - $(OSNAME_DEFINES) +INCLUDES = -I$(SERVERSRC)/include -I$(SERVERSRC)/os -I$(SERVERSRC)/mi \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/miext/shadow \ + -I$(SERVERSRC)/render -I$(SERVERSRC)/Xext + +DEFINES = $(OS_DEFINES) $(EXT_DEFINES) -DDMXEXT $(DMX_DEFINES) \ + $(VENDOR_DEFINES) $(OSNAME_DEFINES) all:: $(OBJS) @@ -120,11 +111,6 @@ LinkSourceFile(miinitext.c,$(SERVERSRC)/mi) SpecialCObjectRule(miinitext,$(ICONFIGFILES),-DDMXSERVER) -#if BuildGlxInDmx && BuildXinerama -LinkSourceFile(panoramiX.c,$(SERVERSRC)/Xext) -SpecialCObjectRule(panoramiX,$(ICONFIGFILES),$(_NOOP_)) -#endif - #ifdef OS2Architecture LinkSourceFile(os2_stubs.c,$(SERVERSRC)/hw/xfree86/os-support/os2) SpecialCObjectRule(os2_stubs,$(ICONFIGFILES),-DOS2NULLSELECT) Index: xc/programs/Xserver/hw/dmx/dmx_glxvisuals.c diff -u xc/programs/Xserver/hw/dmx/dmx_glxvisuals.c:1.2 xc/programs/Xserver/hw/dmx/dmx_glxvisuals.c:1.3 --- xc/programs/Xserver/hw/dmx/dmx_glxvisuals.c:1.2 Fri Jan 21 16:22:45 2005 +++ xc/programs/Xserver/hw/dmx/dmx_glxvisuals.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/dmx_glxvisuals.c,v 1.2 2005/01/21 21:22:45 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/dmx_glxvisuals.c,v 1.3 2005/10/14 15:16:25 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -37,8 +37,8 @@ #include "dmx.h" #include #include -#include "Xext.h" -#include "extutil.h" +#include +#include #include "dmx_glxvisuals.h" Index: xc/programs/Xserver/hw/dmx/dmxextension.c diff -u xc/programs/Xserver/hw/dmx/dmxextension.c:1.5 xc/programs/Xserver/hw/dmx/dmxextension.c:1.7 --- xc/programs/Xserver/hw/dmx/dmxextension.c:1.5 Sun Jan 30 12:48:43 2005 +++ xc/programs/Xserver/hw/dmx/dmxextension.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/dmxextension.c,v 1.5 2005/01/30 17:48:43 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/dmxextension.c,v 1.7 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. * @@ -58,7 +58,7 @@ #include "windowstr.h" #include "inputstr.h" /* For DeviceIntRec */ -#include "dmxproto.h" /* For DMX_BAD_* */ +#include /* For DMX_BAD_* */ #include "cursorstr.h" /* The default font is declared in dix/globals.c, but is not included in @@ -370,9 +370,6 @@ #ifdef PANORAMIX #include "panoramiXsrv.h" -/* Defined in dix/events.c */ -extern void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff); - /** Change the "screen" window attributes by resizing the actual window * on the back-end display (if necessary). */ static void dmxConfigureScreenWindow(int idx, Index: xc/programs/Xserver/hw/dmx/dmxfont.c diff -u xc/programs/Xserver/hw/dmx/dmxfont.c:1.2 xc/programs/Xserver/hw/dmx/dmxfont.c:1.3 --- xc/programs/Xserver/hw/dmx/dmxfont.c:1.2 Sun Jan 30 12:48:43 2005 +++ xc/programs/Xserver/hw/dmx/dmxfont.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/dmxfont.c,v 1.2 2005/01/30 17:48:43 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/dmxfont.c,v 1.3 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. * @@ -42,7 +42,7 @@ #include "dmxfont.h" #include "dmxlog.h" -#include "fontstruct.h" +#include #include "dixfont.h" #include "dixstruct.h" Index: xc/programs/Xserver/hw/dmx/dmxfont.h diff -u xc/programs/Xserver/hw/dmx/dmxfont.h:1.1 xc/programs/Xserver/hw/dmx/dmxfont.h:1.2 --- xc/programs/Xserver/hw/dmx/dmxfont.h:1.1 Wed Jun 30 16:21:39 2004 +++ xc/programs/Xserver/hw/dmx/dmxfont.h Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/dmxfont.h,v 1.1 2004/06/30 20:21:39 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/dmxfont.h,v 1.2 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. * @@ -38,7 +38,7 @@ #ifndef DMXFONT_H #define DMXFONT_H -#include "fontstruct.h" +#include /** Font private area. */ typedef struct _dmxFontPriv { Index: xc/programs/Xserver/hw/dmx/dmxgc.c diff -u xc/programs/Xserver/hw/dmx/dmxgc.c:1.1 xc/programs/Xserver/hw/dmx/dmxgc.c:1.2 --- xc/programs/Xserver/hw/dmx/dmxgc.c:1.1 Wed Jun 30 16:21:39 2004 +++ xc/programs/Xserver/hw/dmx/dmxgc.c Wed Sep 14 10:23:15 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/dmxgc.c,v 1.1 2004/06/30 20:21:39 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/dmxgc.c,v 1.2 2005/09/14 14:23:15 tsi Exp $ */ /* * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. * @@ -381,13 +381,19 @@ } break; +#if 0 /* Leave in for reference */ case CT_PIXMAP: case CT_UNSORTED: case CT_YSORTED: case CT_YXSORTED: case CT_YXBANDED: - /* These clip types are condensed down to either NONE or REGION - in the mi code */ + /* + * These clip types are condensed down to either NONE or REGION in + * the mi code, and therefore could not have been set as the GC's + * clientClipType. + */ +#endif + default: break; } Index: xc/programs/Xserver/hw/dmx/dmxinit.c diff -u xc/programs/Xserver/hw/dmx/dmxinit.c:1.7 xc/programs/Xserver/hw/dmx/dmxinit.c:1.9 --- xc/programs/Xserver/hw/dmx/dmxinit.c:1.7 Mon Mar 7 11:39:17 2005 +++ xc/programs/Xserver/hw/dmx/dmxinit.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/dmxinit.c,v 1.7 2005/03/07 16:39:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/dmxinit.c,v 1.9 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. * @@ -54,7 +54,7 @@ #include "dmxpict.h" #endif -#include "Xos.h" /* For gettimeofday */ +#include /* For gettimeofday */ #include "dixstruct.h" #include "panoramiXsrv.h" @@ -64,8 +64,8 @@ #include #include #include "dmx_glxvisuals.h" -#include "Xext.h" -#include "extutil.h" +#include +#include extern void GlxSetVisualConfigs( int nconfigs, @@ -74,9 +74,6 @@ ); #endif /* GLXPROXY */ -extern void SetVendorRelease(int release); /* in dix/main.c */ -extern void SetVendorString(char *string); /* in dix/main.c */ - /* Global variables available to all Xserver/hw/dmx routines. */ int dmxNumScreens; DMXScreenInfo *dmxScreens; Index: xc/programs/Xserver/hw/dmx/dmxlog.c diff -u xc/programs/Xserver/hw/dmx/dmxlog.c:1.1 xc/programs/Xserver/hw/dmx/dmxlog.c:1.3 --- xc/programs/Xserver/hw/dmx/dmxlog.c:1.1 Wed Jun 30 16:21:39 2004 +++ xc/programs/Xserver/hw/dmx/dmxlog.c Mon Mar 6 11:06:22 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/dmxlog.c,v 1.1 2004/06/30 20:21:39 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/dmxlog.c,v 1.3 2006/03/06 16:06:22 dawes Exp $ */ /* * Copyright 2001 Red Hat Inc., Durham, North Carolina. * @@ -40,8 +40,8 @@ #include "dmxlog.h" #include "dmxinput.h" #ifdef XINPUT -#include "XI.h" -#include "XIproto.h" +#include +#include #endif static dmxLogLevel dmxCurrentLogLevel = dmxDebug; @@ -96,7 +96,6 @@ } #else /** This function was removed between XFree86 4.3.0 and XFree86 4.4.0. */ -extern void AbortServer(void); static void VFatalError(const char *format, va_list args) { VErrorF(format, args); @@ -104,7 +103,7 @@ #ifdef DDXOSFATALERROR OsVendorFatalError(); #endif - AbortServer(); + AbortServer(0); /*NOTREACHED*/ } #endif Index: xc/programs/Xserver/hw/dmx/dmxpict.c diff -u xc/programs/Xserver/hw/dmx/dmxpict.c:1.1 xc/programs/Xserver/hw/dmx/dmxpict.c:1.2 --- xc/programs/Xserver/hw/dmx/dmxpict.c:1.1 Wed Jun 30 16:21:39 2004 +++ xc/programs/Xserver/hw/dmx/dmxpict.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/dmxpict.c,v 1.1 2004/06/30 20:21:39 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/dmxpict.c,v 1.2 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright 2001-2004 Red Hat Inc., Durham, North Carolina. * @@ -46,8 +46,8 @@ #include "pixmapstr.h" #include "dixstruct.h" -#include "render.h" -#include "renderproto.h" +#include +#include #include "picture.h" #include "picturestr.h" #include "mipict.h" Index: xc/programs/Xserver/hw/dmx/dmxstat.c diff -u xc/programs/Xserver/hw/dmx/dmxstat.c:1.2 xc/programs/Xserver/hw/dmx/dmxstat.c:1.3 --- xc/programs/Xserver/hw/dmx/dmxstat.c:1.2 Sun Jan 30 12:48:44 2005 +++ xc/programs/Xserver/hw/dmx/dmxstat.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/dmxstat.c,v 1.2 2005/01/30 17:48:44 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/dmxstat.c,v 1.3 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright 2002, 2003 Red Hat Inc., Durham, North Carolina. * @@ -46,7 +46,7 @@ #include "dmx.h" #include "dmxstat.h" #include "dmxlog.h" -#include "Xos.h" /* For sys/time.h */ +#include /* For sys/time.h */ /** Used to compute a running average of value. */ typedef struct _DMXStatAvg { Index: xc/programs/Xserver/hw/dmx/Xext/Imakefile diff -u /dev/null xc/programs/Xserver/hw/dmx/Xext/Imakefile:1.1 --- /dev/null Tue May 9 21:56:09 2006 +++ xc/programs/Xserver/hw/dmx/Xext/Imakefile Sun Feb 19 10:51:19 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/dmx/Xext/Imakefile,v 1.1 2006/02/19 15:51:19 tsi Exp $ +/* + * Copyright (c) 2004-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XdmxExcludedExtensions +#define LinkDirectory ../../../Xext + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../Xext/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/dmx/config/Imakefile diff -u xc/programs/Xserver/hw/dmx/config/Imakefile:1.3 xc/programs/Xserver/hw/dmx/config/Imakefile:1.4 --- xc/programs/Xserver/hw/dmx/config/Imakefile:1.3 Sun Feb 6 20:38:24 2005 +++ xc/programs/Xserver/hw/dmx/config/Imakefile Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/dmx/config/Imakefile,v 1.3 2005/02/07 01:38:24 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/dmx/config/Imakefile,v 1.4 2005/10/14 15:16:25 tsi Exp $ #include @@ -25,8 +25,7 @@ #include -INCLUDES = -I. -I.. -I$(XBUILDINCDIR) -I$(FONTINCSRC) -I../../../mi \ - -I../../../include -I../../../render -I$(EXTINCSRC) +INCLUDES = -I.. -I../../../mi -I../../../include -I../../../render DEFINES = $(OS_DEFINES) $(EXT_DEFINES) -DDMX_LOG_STANDALONE $(DMX_DEFINES) Index: xc/programs/Xserver/hw/dmx/config/dmxconfig.c diff -u xc/programs/Xserver/hw/dmx/config/dmxconfig.c:1.2 xc/programs/Xserver/hw/dmx/config/dmxconfig.c:1.3 --- xc/programs/Xserver/hw/dmx/config/dmxconfig.c:1.2 Sun Jan 30 12:48:44 2005 +++ xc/programs/Xserver/hw/dmx/config/dmxconfig.c Thu Mar 24 21:22:56 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/config/dmxconfig.c,v 1.2 2005/01/30 17:48:44 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/config/dmxconfig.c,v 1.3 2005/03/25 02:22:56 dawes Exp $ */ /* * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina. * @@ -46,7 +46,6 @@ #include "dmxstat.h" #include "parser.h" -extern int yyparse(void); extern FILE *yyin; static char *dmxXkbRules; @@ -70,7 +69,6 @@ DMXConfigList *xinputs; } DMXConfigCmd, *DMXConfigCmdPtr; -extern DMXConfigEntryPtr dmxConfigEntry; static DMXConfigCmd dmxConfigCmd; static int dmxDisplaysFromCommandLine; Index: xc/programs/Xserver/hw/dmx/config/dmxparse.h diff -u xc/programs/Xserver/hw/dmx/config/dmxparse.h:1.1 xc/programs/Xserver/hw/dmx/config/dmxparse.h:1.4 --- xc/programs/Xserver/hw/dmx/config/dmxparse.h:1.1 Wed Jun 30 16:21:39 2004 +++ xc/programs/Xserver/hw/dmx/config/dmxparse.h Sat Feb 25 21:40:58 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/config/dmxparse.h,v 1.1 2004/06/30 20:21:39 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/config/dmxparse.h,v 1.4 2006/02/26 02:40:58 dawes Exp $ */ /* * Copyright 2002 Red Hat Inc., Durham, North Carolina. * @@ -295,4 +295,8 @@ extern DMXConfigEntryPtr dmxConfigEntryComment(DMXConfigCommentPtr comment); extern DMXConfigEntryPtr dmxConfigEntryVirtual(DMXConfigVirtualPtr virtual); +#if !defined(YYBISON) && !(defined(YYBYACC) && defined(__NetBSD__)) +extern int yyparse(void); +#endif + #endif Index: xc/programs/Xserver/hw/dmx/config/dmxtodmx.c diff -u xc/programs/Xserver/hw/dmx/config/dmxtodmx.c:1.1 xc/programs/Xserver/hw/dmx/config/dmxtodmx.c:1.2 --- xc/programs/Xserver/hw/dmx/config/dmxtodmx.c:1.1 Wed Jun 30 16:21:39 2004 +++ xc/programs/Xserver/hw/dmx/config/dmxtodmx.c Thu Mar 24 21:22:56 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/config/dmxtodmx.c,v 1.1 2004/06/30 20:21:39 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/config/dmxtodmx.c,v 1.2 2005/03/25 02:22:56 dawes Exp $ */ /* * Copyright 2002 Red Hat Inc., Durham, North Carolina. * @@ -38,7 +38,6 @@ #include "dmxprint.h" #include "dmxcompat.h" -extern int yyparse(void); extern FILE *yyin; int main(int argc, char **argv) Index: xc/programs/Xserver/hw/dmx/config/xdmxconfig.c diff -u xc/programs/Xserver/hw/dmx/config/xdmxconfig.c:1.2 xc/programs/Xserver/hw/dmx/config/xdmxconfig.c:1.4 --- xc/programs/Xserver/hw/dmx/config/xdmxconfig.c:1.2 Sun Jan 30 12:48:44 2005 +++ xc/programs/Xserver/hw/dmx/config/xdmxconfig.c Mon Jan 9 09:59:48 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/config/xdmxconfig.c,v 1.2 2005/01/30 17:48:44 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/config/xdmxconfig.c,v 1.4 2006/01/09 14:59:48 dawes Exp $ */ /* * Copyright 2002 Red Hat Inc., Durham, North Carolina. * @@ -53,10 +53,9 @@ #include "dmxprint.h" #include "dmxlog.h" -extern int yyparse(void); extern FILE *yyin; -#define DMX_INFO "xdmxconfig v0.9\nCopyright 2002 Red Hat Inc.\n$Id: xdmxconfig.c,v 1.4 2003/12/09 00:31:01 faith Exp $" +#define DMX_INFO "xdmxconfig v0.9\nCopyright 2002 Red Hat Inc.\n$XFree86: xc/programs/Xserver/hw/dmx/config/xdmxconfig.c,v 1.4 2006/01/09 14:59:48 dawes Exp $" #define DMX_MAIN_WIDTH 800 #define DMX_MAIN_HEIGHT 600 @@ -65,7 +64,6 @@ #define DMX_CANVAS_WIDTH 400 #define DMX_CANVAS_HEIGHT 500 -extern DMXConfigEntryPtr dmxConfigEntry; static DMXConfigVirtualPtr dmxConfigCurrent, dmxConfigNewVirtual; static DMXConfigDisplayPtr dmxConfigCurrentDisplay, dmxConfigNewDisplay; static int dmxConfigGrabbed, dmxConfigGrabbedFine; Index: xc/programs/Xserver/hw/dmx/dix/Imakefile diff -u /dev/null xc/programs/Xserver/hw/dmx/dix/Imakefile:1.1 --- /dev/null Tue May 9 21:56:09 2006 +++ xc/programs/Xserver/hw/dmx/dix/Imakefile Sun Feb 19 10:51:20 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/dmx/dix/Imakefile,v 1.1 2006/02/19 15:51:20 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XdmxExcludedExtensions +#define LinkDirectory ../../../dix + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../dix/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/dmx/doc/DMXSpec-v1.txt diff -u xc/programs/Xserver/hw/dmx/doc/DMXSpec-v1.txt:1.1 xc/programs/Xserver/hw/dmx/doc/DMXSpec-v1.txt:1.2 --- xc/programs/Xserver/hw/dmx/doc/DMXSpec-v1.txt:1.1 Wed Jun 30 16:21:40 2004 +++ xc/programs/Xserver/hw/dmx/doc/DMXSpec-v1.txt Mon Jan 9 09:59:48 2006 @@ -2,7 +2,7 @@ Client-to-Server DMX Extension to the X Protocol - $Date: 2003/10/24 20:15:18 $, $Revision: 1.1 $ + Date: 2003/10/24 Rickard E. (Rik) Faith (faith@redhat.com) Kevin E. Martin (kem@redhat.com) Index: xc/programs/Xserver/hw/dmx/doc/DMXSpec.txt diff -u xc/programs/Xserver/hw/dmx/doc/DMXSpec.txt:1.1 xc/programs/Xserver/hw/dmx/doc/DMXSpec.txt:1.2 --- xc/programs/Xserver/hw/dmx/doc/DMXSpec.txt:1.1 Wed Jun 30 16:21:40 2004 +++ xc/programs/Xserver/hw/dmx/doc/DMXSpec.txt Mon Jan 9 09:59:49 2006 @@ -2,7 +2,7 @@ Client-to-Server DMX Extension to the X Protocol - $Date: 2004/06/27 15:42:04 $, $Revision: 1.18 $ + Date: 2004/06/27 Rickard E. (Rik) Faith (faith@redhat.com) Kevin E. Martin (kem@redhat.com) Index: xc/programs/Xserver/hw/dmx/examples/Imakefile diff -u xc/programs/Xserver/hw/dmx/examples/Imakefile:1.3 xc/programs/Xserver/hw/dmx/examples/Imakefile:1.4 --- xc/programs/Xserver/hw/dmx/examples/Imakefile:1.3 Sun Feb 6 20:38:24 2005 +++ xc/programs/Xserver/hw/dmx/examples/Imakefile Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/dmx/examples/Imakefile,v 1.3 2005/02/07 01:38:24 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/dmx/examples/Imakefile,v 1.4 2005/10/14 15:16:25 tsi Exp $ #include @@ -6,7 +6,6 @@ xbell.c dmxresize.c OBJS = xdmx.o xinput.o dmxwininfo.o xtest.o evi.o res.o dmxreconfig.o xled.o \ xbell.o dmxresize.o -INCLUDES = -I$(EXTINCSRC) #ifndef OS2Architecture XDMXPROG = xdmx Index: xc/programs/Xserver/hw/dmx/examples/dmxaddinput.c diff -u xc/programs/Xserver/hw/dmx/examples/dmxaddinput.c:1.1 xc/programs/Xserver/hw/dmx/examples/dmxaddinput.c:1.2 --- xc/programs/Xserver/hw/dmx/examples/dmxaddinput.c:1.1 Wed Jun 30 16:21:43 2004 +++ xc/programs/Xserver/hw/dmx/examples/dmxaddinput.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/examples/dmxaddinput.c,v 1.1 2004/06/30 20:21:43 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/examples/dmxaddinput.c,v 1.2 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright 2003,2004 Red Hat Inc., Durham, North Carolina. * @@ -35,7 +35,7 @@ #include #include #include -#include "dmxext.h" +#include int main(int argc, char **argv) { Index: xc/programs/Xserver/hw/dmx/examples/dmxaddscreen.c diff -u xc/programs/Xserver/hw/dmx/examples/dmxaddscreen.c:1.1 xc/programs/Xserver/hw/dmx/examples/dmxaddscreen.c:1.2 --- xc/programs/Xserver/hw/dmx/examples/dmxaddscreen.c:1.1 Wed Jun 30 16:21:43 2004 +++ xc/programs/Xserver/hw/dmx/examples/dmxaddscreen.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/examples/dmxaddscreen.c,v 1.1 2004/06/30 20:21:43 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/examples/dmxaddscreen.c,v 1.2 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. * @@ -36,7 +36,7 @@ #include #include #include -#include "dmxext.h" +#include int main(int argc, char **argv) { Index: xc/programs/Xserver/hw/dmx/examples/dmxreconfig.c diff -u xc/programs/Xserver/hw/dmx/examples/dmxreconfig.c:1.1 xc/programs/Xserver/hw/dmx/examples/dmxreconfig.c:1.2 --- xc/programs/Xserver/hw/dmx/examples/dmxreconfig.c:1.1 Wed Jun 30 16:21:43 2004 +++ xc/programs/Xserver/hw/dmx/examples/dmxreconfig.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/examples/dmxreconfig.c,v 1.1 2004/06/30 20:21:43 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/examples/dmxreconfig.c,v 1.2 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright 2003 Red Hat Inc., Durham, North Carolina. * @@ -35,7 +35,7 @@ #include #include #include -#include "dmxext.h" +#include int main(int argc, char **argv) { Index: xc/programs/Xserver/hw/dmx/examples/dmxresize.c diff -u xc/programs/Xserver/hw/dmx/examples/dmxresize.c:1.1 xc/programs/Xserver/hw/dmx/examples/dmxresize.c:1.2 --- xc/programs/Xserver/hw/dmx/examples/dmxresize.c:1.1 Wed Jun 30 16:21:43 2004 +++ xc/programs/Xserver/hw/dmx/examples/dmxresize.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/examples/dmxresize.c,v 1.1 2004/06/30 20:21:43 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/examples/dmxresize.c,v 1.2 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright 2003 Red Hat Inc., Durham, North Carolina. * @@ -35,7 +35,7 @@ #include #include #include -#include "dmxext.h" +#include int main(int argc, char **argv) { Index: xc/programs/Xserver/hw/dmx/examples/dmxrminput.c diff -u xc/programs/Xserver/hw/dmx/examples/dmxrminput.c:1.1 xc/programs/Xserver/hw/dmx/examples/dmxrminput.c:1.2 --- xc/programs/Xserver/hw/dmx/examples/dmxrminput.c:1.1 Wed Jun 30 16:21:43 2004 +++ xc/programs/Xserver/hw/dmx/examples/dmxrminput.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/examples/dmxrminput.c,v 1.1 2004/06/30 20:21:43 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/examples/dmxrminput.c,v 1.2 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright 2003,2004 Red Hat Inc., Durham, North Carolina. * @@ -35,7 +35,7 @@ #include #include #include -#include "dmxext.h" +#include int main(int argc, char **argv) { Index: xc/programs/Xserver/hw/dmx/examples/dmxrmscreen.c diff -u xc/programs/Xserver/hw/dmx/examples/dmxrmscreen.c:1.1 xc/programs/Xserver/hw/dmx/examples/dmxrmscreen.c:1.2 --- xc/programs/Xserver/hw/dmx/examples/dmxrmscreen.c:1.1 Wed Jun 30 16:21:43 2004 +++ xc/programs/Xserver/hw/dmx/examples/dmxrmscreen.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/examples/dmxrmscreen.c,v 1.1 2004/06/30 20:21:43 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/examples/dmxrmscreen.c,v 1.2 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. * @@ -36,7 +36,7 @@ #include #include #include -#include "dmxext.h" +#include int main(int argc, char **argv) { Index: xc/programs/Xserver/hw/dmx/examples/dmxwininfo.c diff -u xc/programs/Xserver/hw/dmx/examples/dmxwininfo.c:1.1 xc/programs/Xserver/hw/dmx/examples/dmxwininfo.c:1.2 --- xc/programs/Xserver/hw/dmx/examples/dmxwininfo.c:1.1 Wed Jun 30 16:21:43 2004 +++ xc/programs/Xserver/hw/dmx/examples/dmxwininfo.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/examples/dmxwininfo.c,v 1.1 2004/06/30 20:21:43 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/examples/dmxwininfo.c,v 1.2 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright (c) 2003 by the XFree86 Project, Inc. * @@ -41,7 +41,7 @@ #include #include #include -#include "dmxext.h" +#include static const char *FontName = "fixed"; Index: xc/programs/Xserver/hw/dmx/examples/xdmx.c diff -u xc/programs/Xserver/hw/dmx/examples/xdmx.c:1.1 xc/programs/Xserver/hw/dmx/examples/xdmx.c:1.2 --- xc/programs/Xserver/hw/dmx/examples/xdmx.c:1.1 Wed Jun 30 16:21:43 2004 +++ xc/programs/Xserver/hw/dmx/examples/xdmx.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/examples/xdmx.c,v 1.1 2004/06/30 20:21:43 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/examples/xdmx.c,v 1.2 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright 2001,2002 Red Hat Inc., Durham, North Carolina. * @@ -35,7 +35,7 @@ #include #include #include -#include "dmxext.h" +#include static void indent(int level) { Index: xc/programs/Xserver/hw/dmx/examples/xinput.c diff -u xc/programs/Xserver/hw/dmx/examples/xinput.c:1.1 xc/programs/Xserver/hw/dmx/examples/xinput.c:1.2 --- xc/programs/Xserver/hw/dmx/examples/xinput.c:1.1 Wed Jun 30 16:21:43 2004 +++ xc/programs/Xserver/hw/dmx/examples/xinput.c Fri Oct 14 11:16:25 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/examples/xinput.c,v 1.1 2004/06/30 20:21:43 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/examples/xinput.c,v 1.2 2005/10/14 15:16:25 tsi Exp $ */ /* * Copyright 2001,2002 Red Hat Inc., Durham, North Carolina. * @@ -40,7 +40,7 @@ #include #include #include -#include "dmxext.h" +#include #include static const char *core(DMXInputAttributes *iinf) Index: xc/programs/Xserver/hw/dmx/glxProxy/Imakefile diff -u xc/programs/Xserver/hw/dmx/glxProxy/Imakefile:1.4 xc/programs/Xserver/hw/dmx/glxProxy/Imakefile:1.7 --- xc/programs/Xserver/hw/dmx/glxProxy/Imakefile:1.4 Sun Feb 6 20:38:24 2005 +++ xc/programs/Xserver/hw/dmx/glxProxy/Imakefile Sun Feb 19 10:51:20 2006 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/Imakefile,v 1.4 2005/02/07 01:38:24 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/Imakefile,v 1.7 2006/02/19 15:51:20 tsi Exp $ #include @@ -14,16 +14,15 @@ compsize.o glxscreens.o glxvisuals.o \ glxsingle.o glxvendor.o glxfbconfig.o glxswap.o $(MOBJS) - INCLUDES = -I. -I$(SERVERSRC)/include -I$(INCLUDESRC) \ - -I$(XINCLUDESRC) -I$(SERVERSRC)/mi \ - -I$(EXTINCSRC) -I$(FONTINCSRC) -I$(MESASRCDIR)/include \ - -I$(XF86SRC) -I$(XF86OSSRC) -I$(SERVERSRC)/GL/include \ + INCLUDES = -I$(SERVERSRC)/include -I$(SERVERSRC)/mi \ + -I$(MESASRCDIR)/include \ + -I$(SERVERSRC)/GL/include \ -I$(SERVERSRC)/hw/dmx -I$(SERVERSRC)/Xext \ -I$(SERVERSRC)/render -I$(SERVERSRC)/GL/glx XCOMM If you add "-DDEBUG" in DEFINES, then make sure you also XCOMM add DEBUG to the define in ../mesa/src/X/xf86glx.c - DEFINES = $(GLX_DEFINES) $(DMX_DEFINES) -DGLXPROXY + DEFINES = $(EXT_DEFINES) $(DMX_DEFINES) #if DoLoadableServer ModuleObjectRule() Index: xc/programs/Xserver/hw/dmx/glxProxy/compsize.c diff -u xc/programs/Xserver/hw/dmx/glxProxy/compsize.c:1.1 xc/programs/Xserver/hw/dmx/glxProxy/compsize.c:1.2 --- xc/programs/Xserver/hw/dmx/glxProxy/compsize.c:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/glxProxy/compsize.c Tue Feb 7 21:34:10 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/compsize.c,v 1.1 2004/06/30 20:21:44 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/compsize.c,v 1.2 2006/02/08 02:34:10 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -35,6 +35,7 @@ */ #include +#include "impsize.h" GLint __glFogiv_size(GLenum pname) { @@ -154,10 +155,12 @@ return (elements * esize * w * h); } +#if 0 GLint __glBitmap_size(GLsizei w, GLsizei h) { return __glDrawPixels_size(GL_COLOR_INDEX, GL_BITMAP, w, h); } +#endif GLint __glTexGendv_size(GLenum e) { @@ -227,6 +230,7 @@ return __glTexEnvfv_size(e); } +#if 0 GLint __glTexImage1D_size(GLenum format, GLenum type, GLsizei w) { GLint elements, esize; @@ -458,6 +462,7 @@ } return (elements * esize * w * h * d); } +#endif GLint __glLightfv_size(GLenum pname) { Index: xc/programs/Xserver/hw/dmx/glxProxy/g_disptab.h diff -u xc/programs/Xserver/hw/dmx/glxProxy/g_disptab.h:1.1 xc/programs/Xserver/hw/dmx/glxProxy/g_disptab.h:1.2 --- xc/programs/Xserver/hw/dmx/glxProxy/g_disptab.h:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/glxProxy/g_disptab.h Tue Feb 7 21:34:10 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/g_disptab.h,v 1.1 2004/06/30 20:21:44 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/g_disptab.h,v 1.2 2006/02/08 02:34:10 dawes Exp $ */ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */ #ifndef _GLX_g_disptab_h_ #define _GLX_g_disptab_h_ @@ -73,7 +73,6 @@ extern int __glXDisp_Finish(__GLXclientState*, GLbyte*); extern int __glXDisp_PixelStoref(__GLXclientState*, GLbyte*); extern int __glXDisp_PixelStorei(__GLXclientState*, GLbyte*); -extern int __glXDisp_ReadPixels(__GLXclientState*, GLbyte*); extern int __glXDisp_GetBooleanv(__GLXclientState*, GLbyte*); extern int __glXDisp_GetClipPlane(__GLXclientState*, GLbyte*); extern int __glXDisp_GetDoublev(__GLXclientState*, GLbyte*); @@ -97,7 +96,6 @@ extern int __glXDisp_GetTexGendv(__GLXclientState*, GLbyte*); extern int __glXDisp_GetTexGenfv(__GLXclientState*, GLbyte*); extern int __glXDisp_GetTexGeniv(__GLXclientState*, GLbyte*); -extern int __glXDisp_GetTexImage(__GLXclientState*, GLbyte*); extern int __glXDisp_GetTexParameterfv(__GLXclientState*, GLbyte*); extern int __glXDisp_GetTexParameteriv(__GLXclientState*, GLbyte*); extern int __glXDisp_GetTexLevelParameterfv(__GLXclientState*, GLbyte*); @@ -109,7 +107,6 @@ extern int __glXDisp_DeleteTextures(__GLXclientState*, GLbyte*); extern int __glXDisp_GenTextures(__GLXclientState*, GLbyte*); extern int __glXDisp_IsTexture(__GLXclientState*, GLbyte*); -extern int __glXDisp_GetColorTable(__GLXclientState*, GLbyte*); extern int __glXDisp_GetColorTableParameterfv(__GLXclientState*, GLbyte*); extern int __glXDisp_GetColorTableParameteriv(__GLXclientState*, GLbyte*); extern int __glXDisp_GetConvolutionFilter(__GLXclientState*, GLbyte*); @@ -401,7 +398,6 @@ extern int __glXDispSwap_GetTexGendv(__GLXclientState*, GLbyte*); extern int __glXDispSwap_GetTexGenfv(__GLXclientState*, GLbyte*); extern int __glXDispSwap_GetTexGeniv(__GLXclientState*, GLbyte*); -extern int __glXDispSwap_GetTexImage(__GLXclientState*, GLbyte*); extern int __glXDispSwap_GetTexParameterfv(__GLXclientState*, GLbyte*); extern int __glXDispSwap_GetTexParameteriv(__GLXclientState*, GLbyte*); extern int __glXDispSwap_GetTexLevelParameterfv(__GLXclientState*, GLbyte*); @@ -413,7 +409,6 @@ extern int __glXDispSwap_DeleteTextures(__GLXclientState*, GLbyte*); extern int __glXDispSwap_GenTextures(__GLXclientState*, GLbyte*); extern int __glXDispSwap_IsTexture(__GLXclientState*, GLbyte*); -extern int __glXDispSwap_GetColorTable(__GLXclientState*, GLbyte*); extern int __glXDispSwap_GetColorTableParameterfv(__GLXclientState*, GLbyte*); extern int __glXDispSwap_GetColorTableParameteriv(__GLXclientState*, GLbyte*); extern int __glXDispSwap_GetConvolutionFilter(__GLXclientState*, GLbyte*); @@ -651,7 +646,6 @@ extern void __glXDispSwap_SeparableFilter2D(GLbyte*); extern void __glXDispSwap_TexImage3D(GLbyte*); extern void __glXDispSwap_TexSubImage3D(GLbyte*); -extern void __glXDispSwap_DrawArrays(GLbyte*); extern void __glXDispSwap_PrioritizeTextures(GLbyte*); extern void __glXDispSwap_CopyTexImage1D(GLbyte*); extern void __glXDispSwap_CopyTexImage2D(GLbyte*); @@ -659,6 +653,22 @@ extern void __glXDispSwap_CopyTexSubImage2D(GLbyte*); extern void __glXDispSwap_CopyTexSubImage3D(GLbyte*); +extern void __glXDispSwap_BindTexture(GLbyte *); +extern void __glXDispSwap_BlendColor(GLbyte *); +extern void __glXDispSwap_BlendEquation(GLbyte *); +extern void __glXDispSwap_ColorTable(GLbyte *); +extern void __glXDispSwap_ColorTableParameterfv(GLbyte *); +extern void __glXDispSwap_ColorTableParameteriv(GLbyte *); +extern void __glXDispSwap_CopyColorTable(GLbyte *); +extern void __glXDispSwap_ConvolutionParameterf(GLbyte *); +extern void __glXDispSwap_ConvolutionParameteri(GLbyte *); +extern void __glXDispSwap_Histogram(GLbyte *); +extern void __glXDispSwap_Minmax(GLbyte *); +extern void __glXDispSwap_ResetHistogram(GLbyte *); +extern void __glXDispSwap_ResetMinmax(GLbyte *); +extern void __glXDispSwap_(GLbyte *); +extern void __glXDispSwap_DrawArraysEXT(GLbyte*); + #define __GLX_MIN_GLXCMD_OPCODE 1 #define __GLX_MAX_GLXCMD_OPCODE 20 #define __GLX_MIN_RENDER_OPCODE 1 @@ -671,6 +681,4 @@ #define __GLX_MIN_RENDER_OPCODE_EXT 4096 #define __GLX_MAX_RENDER_OPCODE_EXT 4123 -extern __GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE]; -extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE]; #endif /* _GLX_g_disptab_h_ */ Index: xc/programs/Xserver/hw/dmx/glxProxy/glxcmds.c diff -u xc/programs/Xserver/hw/dmx/glxProxy/glxcmds.c:1.4 xc/programs/Xserver/hw/dmx/glxProxy/glxcmds.c:1.5 --- xc/programs/Xserver/hw/dmx/glxProxy/glxcmds.c:1.4 Fri Jan 21 16:22:45 2005 +++ xc/programs/Xserver/hw/dmx/glxProxy/glxcmds.c Tue Feb 7 21:34:10 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxcmds.c,v 1.4 2005/01/21 21:22:45 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxcmds.c,v 1.5 2006/02/08 02:34:10 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -64,18 +64,11 @@ #ifdef PANORAMIX #include "panoramiXsrv.h" -extern XID *PanoramiXVisualTable; #endif extern __GLXFBConfig **__glXFBConfigs; extern int __glXNumFBConfigs; -extern __GLXFBConfig *glxLookupFBConfig( GLXFBConfigID id ); -extern __GLXFBConfig *glxLookupFBConfigByVID( VisualID vid ); -extern __GLXFBConfig *glxLookupBackEndFBConfig( GLXFBConfigID id, int screen ); -extern int glxIsExtensionSupported( char *ext ); -extern int __glXGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc); - #define BE_TO_CLIENT_ERROR(x) \ ( (x) >= __glXerrorBase ? \ (x) - dmxScreen->glxErrorBase + __glXerrorBase \ Index: xc/programs/Xserver/hw/dmx/glxProxy/glxcmdsswap.c diff -u xc/programs/Xserver/hw/dmx/glxProxy/glxcmdsswap.c:1.3 xc/programs/Xserver/hw/dmx/glxProxy/glxcmdsswap.c:1.4 --- xc/programs/Xserver/hw/dmx/glxProxy/glxcmdsswap.c:1.3 Fri Jan 21 16:22:45 2005 +++ xc/programs/Xserver/hw/dmx/glxProxy/glxcmdsswap.c Tue Feb 7 21:34:10 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxcmdsswap.c,v 1.3 2005/01/21 21:22:45 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxcmdsswap.c,v 1.4 2006/02/08 02:34:10 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -47,8 +47,6 @@ #include "GL/glx_ansic.h" #include "glxvendor.h" -extern int glxIsExtensionSupported( char *ext ); - /************************************************************************/ /* Index: xc/programs/Xserver/hw/dmx/glxProxy/glxext.c diff -u xc/programs/Xserver/hw/dmx/glxProxy/glxext.c:1.1 xc/programs/Xserver/hw/dmx/glxProxy/glxext.c:1.2 --- xc/programs/Xserver/hw/dmx/glxProxy/glxext.c:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/glxProxy/glxext.c Tue Feb 7 21:34:10 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxext.c,v 1.1 2004/06/30 20:21:44 martin Exp $ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxext.c,v 1.2 2006/02/08 02:34:10 dawes Exp $ ** The contents of this file are subject to the GLX Public License Version 1.0 ** (the "License"). You may not use this file except in compliance with the ** License. You may obtain a copy of the License at Silicon Graphics, Inc., @@ -32,6 +32,10 @@ #include "micmap.h" #include "glxswap.h" +extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs, + void **privates); +extern void GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc); + /* ** Forward declarations. */ Index: xc/programs/Xserver/hw/dmx/glxProxy/glxext.h diff -u xc/programs/Xserver/hw/dmx/glxProxy/glxext.h:1.2 xc/programs/Xserver/hw/dmx/glxProxy/glxext.h:1.3 --- xc/programs/Xserver/hw/dmx/glxProxy/glxext.h:1.2 Wed Aug 4 12:33:34 2004 +++ xc/programs/Xserver/hw/dmx/glxProxy/glxext.h Tue Feb 7 21:34:10 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxext.h,v 1.2 2004/08/04 16:33:34 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxext.h,v 1.3 2006/02/08 02:34:10 dawes Exp $ */ #ifndef _glxext_h_ #define _glxext_h_ @@ -83,6 +83,12 @@ extern int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc); extern int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc); +extern int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc); +extern int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc); +extern int __glXSwapQueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc); +extern int __glXSwapBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc); +extern int __glXSwapJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc); + extern void GlxExtensionInit(void); extern Bool __glXCoreType(void); Index: xc/programs/Xserver/hw/dmx/glxProxy/glxfbconfig.c diff -u xc/programs/Xserver/hw/dmx/glxProxy/glxfbconfig.c:1.1 xc/programs/Xserver/hw/dmx/glxProxy/glxfbconfig.c:1.2 --- xc/programs/Xserver/hw/dmx/glxProxy/glxfbconfig.c:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/glxProxy/glxfbconfig.c Mon Mar 28 23:00:31 2005 @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxfbconfig.c,v 1.2 2005/03/29 04:00:31 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free Index: xc/programs/Xserver/hw/dmx/glxProxy/glxfbconfig.h diff -u xc/programs/Xserver/hw/dmx/glxProxy/glxfbconfig.h:1.1 xc/programs/Xserver/hw/dmx/glxProxy/glxfbconfig.h:1.2 --- xc/programs/Xserver/hw/dmx/glxProxy/glxfbconfig.h:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/glxProxy/glxfbconfig.h Mon Mar 28 23:00:31 2005 @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxfbconfig.h,v 1.2 2005/03/29 04:00:31 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free Index: xc/programs/Xserver/hw/dmx/glxProxy/glxserver.h diff -u xc/programs/Xserver/hw/dmx/glxProxy/glxserver.h:1.1 xc/programs/Xserver/hw/dmx/glxProxy/glxserver.h:1.2 --- xc/programs/Xserver/hw/dmx/glxProxy/glxserver.h:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/glxProxy/glxserver.h Tue Feb 7 21:34:10 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxserver.h,v 1.1 2004/06/30 20:21:44 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxserver.h,v 1.2 2006/02/08 02:34:10 dawes Exp $ */ #ifndef _GLX_server_h_ #define _GLX_server_h_ @@ -221,8 +221,10 @@ extern char *__glXcombine_strings(const char *, const char *); +#if 0 extern void __glXDisp_DrawArrays(GLbyte*); extern void __glXDispSwap_DrawArrays(GLbyte*); +#endif /* @@ -314,7 +316,9 @@ extern int __glXColorTableParameterfvSize(GLenum pname); extern int __glXColorTableParameterivSize(GLenum pname); +#if 0 extern void __glXFreeGLXWindow(__glXWindow *pGlxWindow); +#endif extern void __glXFreeGLXPbuffer(__glXPbuffer *pGlxPbuffer); extern int __glXVersionMajor; @@ -324,4 +328,15 @@ ( (__glXVersionMajor > (major)) || \ ((__glXVersionMajor == (major)) && (__glXVersionMinor >= (minor))) ) +extern Display *GetBackEndDisplay(__GLXclientState *cl, int s); +extern int GetCurrentBackEndTag(__GLXclientState *cl, GLXContextTag tag, int s); +extern int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, + GLXContextTag tag); + +extern __GLXFBConfig *glxLookupFBConfig(GLXFBConfigID id); +extern __GLXFBConfig *glxLookupFBConfigByVID( VisualID vid ); +extern __GLXFBConfig *glxLookupBackEndFBConfig( GLXFBConfigID id, int screen ); +extern int glxIsExtensionSupported( char *ext ); +extern int __glXGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc); + #endif /* !__GLX_server_h__ */ Index: xc/programs/Xserver/hw/dmx/glxProxy/glxsingle.c diff -u xc/programs/Xserver/hw/dmx/glxProxy/glxsingle.c:1.3 xc/programs/Xserver/hw/dmx/glxProxy/glxsingle.c:1.4 --- xc/programs/Xserver/hw/dmx/glxProxy/glxsingle.c:1.3 Fri Jan 21 16:22:45 2005 +++ xc/programs/Xserver/hw/dmx/glxProxy/glxsingle.c Tue Feb 7 21:34:10 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxsingle.c,v 1.3 2005/01/21 21:22:45 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxsingle.c,v 1.4 2006/02/08 02:34:10 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -41,6 +41,7 @@ #define NEED_REPLIES #include "glxserver.h" +#include "glxsingle.h" #include "glxext.h" #include "g_disptab.h" /* #include "g_disptab_EXT.h" */ @@ -82,9 +83,6 @@ #define X_GLXSingle 0 /* needed by GetReqExtra */ -extern Display *GetBackEndDisplay( __GLXclientState *cl, int s ); -extern int GetCurrentBackEndTag(__GLXclientState *cl, GLXContextTag tag, int s); - static int swap_vec_element_size = 0; static void SendSwappedReply( ClientPtr client, Index: xc/programs/Xserver/hw/dmx/glxProxy/glxsingle.h diff -u xc/programs/Xserver/hw/dmx/glxProxy/glxsingle.h:1.1 xc/programs/Xserver/hw/dmx/glxProxy/glxsingle.h:1.2 --- xc/programs/Xserver/hw/dmx/glxProxy/glxsingle.h:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/glxProxy/glxsingle.h Mon Mar 28 23:00:31 2005 @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxsingle.h,v 1.2 2005/03/29 04:00:31 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free Index: xc/programs/Xserver/hw/dmx/glxProxy/glxswap.c diff -u xc/programs/Xserver/hw/dmx/glxProxy/glxswap.c:1.1 xc/programs/Xserver/hw/dmx/glxProxy/glxswap.c:1.2 --- xc/programs/Xserver/hw/dmx/glxProxy/glxswap.c:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/glxProxy/glxswap.c Tue Feb 7 21:34:10 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxswap.c,v 1.1 2004/06/30 20:21:44 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxswap.c,v 1.2 2006/02/08 02:34:10 dawes Exp $ */ /* * Copyright 2003 Red Hat Inc., Raleigh, North Carolina. * @@ -37,9 +37,6 @@ #include "glxserver.h" #include "glxswap.h" -extern int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, - GLXContextTag tag); - typedef struct _SwapGroup *SwapGroupPtr; static Bool SwapBarrierIsReadyToSwap(GLuint barrier); Index: xc/programs/Xserver/hw/dmx/glxProxy/glxvendor.c diff -u xc/programs/Xserver/hw/dmx/glxProxy/glxvendor.c:1.3 xc/programs/Xserver/hw/dmx/glxProxy/glxvendor.c:1.4 --- xc/programs/Xserver/hw/dmx/glxProxy/glxvendor.c:1.3 Fri Jan 21 16:22:45 2005 +++ xc/programs/Xserver/hw/dmx/glxProxy/glxvendor.c Tue Feb 7 21:34:10 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxvendor.c,v 1.3 2005/01/21 21:22:45 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxvendor.c,v 1.4 2006/02/08 02:34:10 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -42,6 +42,7 @@ #include "glxserver.h" #include "glxext.h" #include "g_disptab.h" +#include "glxvendor.h" /* #include "g_disptab_EXT.h" */ #include "unpack.h" #include "glxutil.h" @@ -79,9 +80,6 @@ dpy->request++ #endif -extern Display *GetBackEndDisplay( __GLXclientState *cl, int s ); -extern int GetCurrentBackEndTag(__GLXclientState *cl, GLXContextTag tag, int s); - static int swap_vec_element_size = 0; static void SendSwappedReply( ClientPtr client, Index: xc/programs/Xserver/hw/dmx/glxProxy/glxvendor.h diff -u xc/programs/Xserver/hw/dmx/glxProxy/glxvendor.h:1.1 xc/programs/Xserver/hw/dmx/glxProxy/glxvendor.h:1.2 --- xc/programs/Xserver/hw/dmx/glxProxy/glxvendor.h:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/glxProxy/glxvendor.h Mon Mar 28 23:00:31 2005 @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxvendor.h,v 1.2 2005/03/29 04:00:31 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free Index: xc/programs/Xserver/hw/dmx/glxProxy/glxvisuals.c diff -u xc/programs/Xserver/hw/dmx/glxProxy/glxvisuals.c:1.2 xc/programs/Xserver/hw/dmx/glxProxy/glxvisuals.c:1.3 --- xc/programs/Xserver/hw/dmx/glxProxy/glxvisuals.c:1.2 Fri Jan 21 16:22:45 2005 +++ xc/programs/Xserver/hw/dmx/glxProxy/glxvisuals.c Tue Feb 7 21:34:10 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxvisuals.c,v 1.2 2005/01/21 21:22:45 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxvisuals.c,v 1.3 2006/02/08 02:34:10 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -37,6 +37,7 @@ #include "dmx.h" #include "glxserver.h" #include "glxutil.h" +#include "glxvisuals.h" #include "dmx_glxvisuals.h" static int numConfigs = 0; Index: xc/programs/Xserver/hw/dmx/glxProxy/glxvisuals.h diff -u xc/programs/Xserver/hw/dmx/glxProxy/glxvisuals.h:1.1 xc/programs/Xserver/hw/dmx/glxProxy/glxvisuals.h:1.2 --- xc/programs/Xserver/hw/dmx/glxProxy/glxvisuals.h:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/glxProxy/glxvisuals.h Mon Mar 28 23:00:31 2005 @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/glxvisuals.h,v 1.2 2005/03/29 04:00:31 tsi Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free Index: xc/programs/Xserver/hw/dmx/glxProxy/render2swap.c diff -u xc/programs/Xserver/hw/dmx/glxProxy/render2swap.c:1.4 xc/programs/Xserver/hw/dmx/glxProxy/render2swap.c:1.5 --- xc/programs/Xserver/hw/dmx/glxProxy/render2swap.c:1.4 Sun Jan 30 12:48:44 2005 +++ xc/programs/Xserver/hw/dmx/glxProxy/render2swap.c Tue Feb 7 21:34:10 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/render2swap.c,v 1.4 2005/01/30 17:48:44 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/glxProxy/render2swap.c,v 1.5 2006/02/08 02:34:10 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -39,7 +39,7 @@ #include "unpack.h" #include "g_disptab.h" -GLint __glEvalComputeK(GLenum target) +static GLint __glEvalComputeK(GLenum target) { switch (target) { case GL_MAP1_VERTEX_4: Index: xc/programs/Xserver/hw/dmx/input/ChkNotMaskEv.c diff -u xc/programs/Xserver/hw/dmx/input/ChkNotMaskEv.c:1.1 xc/programs/Xserver/hw/dmx/input/ChkNotMaskEv.c:1.2 --- xc/programs/Xserver/hw/dmx/input/ChkNotMaskEv.c:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/input/ChkNotMaskEv.c Mon Mar 28 23:00:31 2005 @@ -1,4 +1,4 @@ -/* Derived from Xorg: ChkMaskEv.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp */ +/* $XFree86: xc/programs/Xserver/hw/dmx/input/ChkNotMaskEv.c,v 1.2 2005/03/29 04:00:31 tsi Exp $ */ /* * Copyright 1985, 1987, 1998 The Open Group * Index: xc/programs/Xserver/hw/dmx/input/Imakefile diff -u xc/programs/Xserver/hw/dmx/input/Imakefile:1.3 xc/programs/Xserver/hw/dmx/input/Imakefile:1.5 --- xc/programs/Xserver/hw/dmx/input/Imakefile:1.3 Mon Jan 24 12:03:34 2005 +++ xc/programs/Xserver/hw/dmx/input/Imakefile Fri Oct 14 11:16:26 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/dmx/input/Imakefile,v 1.3 2005/01/24 17:03:34 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/dmx/input/Imakefile,v 1.5 2005/10/14 15:16:26 tsi Exp $ #include #include @@ -6,13 +6,13 @@ #ifdef LinuxArchitecture RAWSRCS = lnx-keyboard.c lnx-ms.c lnx-ps2.c RAWOBJS = lnx-keyboard.o lnx-ms.o lnx-ps2.o -#endif #if HasLinuxInput USB_DEFINES = -DHAS_LINUX_INPUT USBSRCS = usb-keyboard.c usb-mouse.c usb-other.c usb-common.c USBOBJS = usb-keyboard.o usb-mouse.o usb-other.o usb-common.o #endif +#endif DRVSRCS = dmxdummy.c dmxbackend.c dmxconsole.c dmxcommon.c DRVOBJS = dmxdummy.o dmxbackend.o dmxconsole.o dmxcommon.o @@ -30,8 +30,7 @@ #include -INCLUDES = -I. -I.. -I$(XBUILDINCDIR) -I$(FONTINCSRC) -I../../../mi \ - -I../../../include -I../../../render -I$(EXTINCSRC) \ +INCLUDES = -I.. -I../../../mi -I../../../include -I../../../render \ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/Xi DEFINES = $(OS_DEFINES) $(EXT_DEFINES) $(DMX_DEFINES) $(USB_DEFINES) Index: xc/programs/Xserver/hw/dmx/input/dmxbackend.c diff -u xc/programs/Xserver/hw/dmx/input/dmxbackend.c:1.1 xc/programs/Xserver/hw/dmx/input/dmxbackend.c:1.2 --- xc/programs/Xserver/hw/dmx/input/dmxbackend.c:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/input/dmxbackend.c Fri Oct 14 11:16:26 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/input/dmxbackend.c,v 1.1 2004/06/30 20:21:44 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/input/dmxbackend.c,v 1.2 2005/10/14 15:16:26 tsi Exp $ */ /* * Copyright 2001-2003 Red Hat Inc., Durham, North Carolina. * @@ -52,7 +52,7 @@ #include "inputstr.h" #include "input.h" -#include "keysym.h" +#include #include "mipointer.h" #include "scrnintstr.h" #include "windowstr.h" Index: xc/programs/Xserver/hw/dmx/input/dmxcommon.c diff -u xc/programs/Xserver/hw/dmx/input/dmxcommon.c:1.2 xc/programs/Xserver/hw/dmx/input/dmxcommon.c:1.3 --- xc/programs/Xserver/hw/dmx/input/dmxcommon.c:1.2 Wed Jan 26 22:03:57 2005 +++ xc/programs/Xserver/hw/dmx/input/dmxcommon.c Fri Oct 14 11:16:26 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/input/dmxcommon.c,v 1.2 2005/01/27 03:03:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/input/dmxcommon.c,v 1.3 2005/10/14 15:16:26 tsi Exp $ */ /* * Copyright 2001-2003 Red Hat Inc., Durham, North Carolina. * @@ -50,7 +50,7 @@ #include "inputstr.h" #include "input.h" -#include "keysym.h" +#include #include "mipointer.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/dmx/input/dmxeq.c diff -u xc/programs/Xserver/hw/dmx/input/dmxeq.c:1.1 xc/programs/Xserver/hw/dmx/input/dmxeq.c:1.2 --- xc/programs/Xserver/hw/dmx/input/dmxeq.c:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/input/dmxeq.c Fri Oct 14 11:16:26 2005 @@ -1,7 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/input/dmxeq.c,v 1.1 2004/06/30 20:21:44 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/input/dmxeq.c,v 1.2 2005/10/14 15:16:26 tsi Exp $ */ /* - * $Xorg: mieq.c,v 1.4 2001/02/09 02:05:20 xorgcvs Exp $ - * * Copyright 1990, 1998 The Open Group * * Permission to use, copy, modify, distribute, and sell this software and its @@ -78,7 +76,7 @@ #include "scrnintstr.h" /* For screenInfo */ #ifdef XINPUT -#include "XIproto.h" +#include #define EXTENSION_PROC_ARGS void * #include "extinit.h" /* For LookupDeviceIntRec */ #endif Index: xc/programs/Xserver/hw/dmx/input/dmxevents.c diff -u xc/programs/Xserver/hw/dmx/input/dmxevents.c:1.1 xc/programs/Xserver/hw/dmx/input/dmxevents.c:1.2 --- xc/programs/Xserver/hw/dmx/input/dmxevents.c:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/input/dmxevents.c Fri Oct 14 11:16:26 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/input/dmxevents.c,v 1.1 2004/06/30 20:21:44 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/input/dmxevents.c,v 1.2 2005/10/14 15:16:26 tsi Exp $ */ /* * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina. * @@ -48,7 +48,7 @@ #include "dmxsigio.h" #include "dmxmap.h" -#include "keysym.h" +#include #include "opaque.h" #include "inputstr.h" #include "mipointer.h" Index: xc/programs/Xserver/hw/dmx/input/dmxinputinit.c diff -u xc/programs/Xserver/hw/dmx/input/dmxinputinit.c:1.4 xc/programs/Xserver/hw/dmx/input/dmxinputinit.c:1.5 --- xc/programs/Xserver/hw/dmx/input/dmxinputinit.c:1.4 Wed Jan 26 22:03:57 2005 +++ xc/programs/Xserver/hw/dmx/input/dmxinputinit.c Fri Oct 14 11:16:26 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/input/dmxinputinit.c,v 1.4 2005/01/27 03:03:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/input/dmxinputinit.c,v 1.5 2005/10/14 15:16:26 tsi Exp $ */ /* * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina. * @@ -70,8 +70,8 @@ #include "windowstr.h" #ifdef XINPUT -#include "XI.h" -#include "XIproto.h" +#include +#include #include "exevents.h" #define EXTENSION_PROC_ARGS void * #include "extinit.h" Index: xc/programs/Xserver/hw/dmx/input/dmxxinput.c diff -u xc/programs/Xserver/hw/dmx/input/dmxxinput.c:1.1 xc/programs/Xserver/hw/dmx/input/dmxxinput.c:1.2 --- xc/programs/Xserver/hw/dmx/input/dmxxinput.c:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/input/dmxxinput.c Fri Oct 14 11:16:26 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/input/dmxxinput.c,v 1.1 2004/06/30 20:21:44 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/input/dmxxinput.c,v 1.2 2005/10/14 15:16:26 tsi Exp $ */ /* * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina. * @@ -38,11 +38,11 @@ */ #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" +#include +#include #include "inputstr.h" -#include "XI.h" -#include "XIproto.h" +#include +#include #include "XIstubs.h" #include "mipointer.h" Index: xc/programs/Xserver/hw/dmx/input/lnx-keyboard.c diff -u xc/programs/Xserver/hw/dmx/input/lnx-keyboard.c:1.1 xc/programs/Xserver/hw/dmx/input/lnx-keyboard.c:1.3 --- xc/programs/Xserver/hw/dmx/input/lnx-keyboard.c:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/input/lnx-keyboard.c Fri Feb 17 22:31:36 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/input/lnx-keyboard.c,v 1.1 2004/06/30 20:21:44 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/input/lnx-keyboard.c,v 1.3 2006/02/18 03:31:36 dawes Exp $ */ /* Portions of this file were derived from the following files: * ********************************************************************** @@ -152,16 +152,23 @@ /*****************************************************************************/ #include "inputstr.h" -#include "Xos.h" +#include #include #include #include #include #include #include +#include +#undef KEY_F13 +#undef KEY_F14 +#undef KEY_F15 +#undef KEY_F16 +#undef KEY_F17 +#undef KEY_XFER +#undef KEY_UNKNOWN #include "atKeynames.h" #include "xf86Keymap.h" -#include #define NUM_AT2LNX (sizeof(at2lnx) / sizeof(at2lnx[0])) #define NUM_STATE_ENTRIES (256/32) Index: xc/programs/Xserver/hw/dmx/input/lnx-ms.c diff -u xc/programs/Xserver/hw/dmx/input/lnx-ms.c:1.2 xc/programs/Xserver/hw/dmx/input/lnx-ms.c:1.3 --- xc/programs/Xserver/hw/dmx/input/lnx-ms.c:1.2 Mon Feb 14 20:09:36 2005 +++ xc/programs/Xserver/hw/dmx/input/lnx-ms.c Fri Oct 14 11:16:26 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/input/lnx-ms.c,v 1.2 2005/02/15 01:09:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/input/lnx-ms.c,v 1.3 2005/10/14 15:16:26 tsi Exp $ */ /* Portions of this file were derived from the following files: * ********************************************************************** @@ -70,7 +70,7 @@ * (see the source code for complete references). */ #include "inputstr.h" -#include "Xos.h" +#include #include #include Index: xc/programs/Xserver/hw/dmx/input/lnx-ps2.c diff -u xc/programs/Xserver/hw/dmx/input/lnx-ps2.c:1.2 xc/programs/Xserver/hw/dmx/input/lnx-ps2.c:1.3 --- xc/programs/Xserver/hw/dmx/input/lnx-ps2.c:1.2 Mon Feb 14 20:09:36 2005 +++ xc/programs/Xserver/hw/dmx/input/lnx-ps2.c Fri Oct 14 11:16:26 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/input/lnx-ps2.c,v 1.2 2005/02/15 01:09:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/input/lnx-ps2.c,v 1.3 2005/10/14 15:16:26 tsi Exp $ */ /* Portions of this file were derived from the following files: * ********************************************************************** @@ -67,7 +67,7 @@ * for complete references). */ #include "inputstr.h" -#include "Xos.h" +#include #include #include Index: xc/programs/Xserver/hw/dmx/input/usb-private.h diff -u xc/programs/Xserver/hw/dmx/input/usb-private.h:1.1 xc/programs/Xserver/hw/dmx/input/usb-private.h:1.2 --- xc/programs/Xserver/hw/dmx/input/usb-private.h:1.1 Wed Jun 30 16:21:44 2004 +++ xc/programs/Xserver/hw/dmx/input/usb-private.h Fri Oct 14 11:16:26 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/dmx/input/usb-private.h,v 1.1 2004/06/30 20:21:44 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/dmx/input/usb-private.h,v 1.2 2005/10/14 15:16:26 tsi Exp $ */ /* * Copyright 2002 Red Hat Inc., Durham, North Carolina. * @@ -43,7 +43,7 @@ #include "dmxinputinit.h" #include "inputstr.h" -#include "Xos.h" +#include #include #include #include "usb-common.h" Index: xc/programs/Xserver/hw/dmx/os/Imakefile diff -u /dev/null xc/programs/Xserver/hw/dmx/os/Imakefile:1.1 --- /dev/null Tue May 9 21:56:12 2006 +++ xc/programs/Xserver/hw/dmx/os/Imakefile Sun Feb 19 10:51:20 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/dmx/os/Imakefile,v 1.1 2006/02/19 15:51:20 tsi Exp $ +/* + * Copyright (c) 2004-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XdmxExcludedExtensions +#define LinkDirectory ../../../os + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../os/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sun/Imakefile diff -u xc/programs/Xserver/hw/sun/Imakefile:1.7 xc/programs/Xserver/hw/sun/Imakefile:1.12 --- xc/programs/Xserver/hw/sun/Imakefile:1.7 Sun May 27 22:42:26 2001 +++ xc/programs/Xserver/hw/sun/Imakefile Sun Feb 19 10:51:20 2006 @@ -1,81 +1,88 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:29 cpqbld Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/sun/Imakefile,v 1.12 2006/02/19 15:51:20 tsi Exp $ +#include + +#define IHaveSubdirs +#if BuildXKB +XKBDIRS = xkb +#endif +#if BuildRender +RENDERDIRS = render +#endif -XCOMM $XFree86: xc/programs/Xserver/hw/sun/Imakefile,v 1.7 2001/05/28 02:42:26 tsi Exp $ +#if BuildRandR +RANDRDIRS = randr +#endif -#include +#if BuildRECORD +RECORDDIRS = record +#endif + +#if BuildDBE +DBEDIRS = dbe +#endif + +#if BuildXTrap +XTRAPDIRS = XTrap +#endif -SRCS1 = sunInit.c \ - sunCfb.c \ - sunCfb24.c \ - sunCursor.c \ - sunFbs.c \ - sunIo.c \ - sunKbd.c \ - sunMfb.c \ - sunMouse.c\ - sunKeyMap.c - -OBJS1 = sunCfb.o \ - sunCfb24.o \ - sunCursor.o \ - sunFbs.o \ - sunIo.o \ - sunKbd.o \ - sunMfb.o \ - sunMouse.o \ - sunKeyMap.o - -#if BuildLowMem -SRCS2 = -OBJS2 = -#else +SUBDIRS = dix os Xext $(XKBDIRS) $(RENDERDIRS) $(RANDRDIRS) $(RECORDDIRS) \ + $(DBEDIRS) $(XTRAPDIRS) + +SRCS1 = sunCfb.c sunCfb24.c sunCursor.c sunFbs.c sunIo.c sunKbd.c sunMfb.c \ + sunMouse.c sunKeyMap.c + +OBJS1 = sunCfb.o sunCfb24.o sunCursor.o sunFbs.o sunIo.o sunKbd.o sunMfb.o \ + sunMouse.o sunKeyMap.o + +#if !BuildLowMem SRCS2 = sunGX.c OBJS2 = sunGX.o #endif -#ifdef i386Architecture -SRCS3 = sunInit.c -OBJS3 = sunInit.o -#else -SRCS3 = sunInit.c sunInitExt.c \ - sunInitMono.c sunInExMono.c \ - sunInitMulti.c stubs.c -OBJS3 = sunInit.o sunInitExt.o \ - sunInitMono.o sunInExMono.o \ - sunInitMulti.o stubs.o - -DEFINES = $(OS_DEFINES) $(EXT_DEFINES) \ - -UXFree86LOADER -UXF86VIDMODE -UXFreeXDGA \ - -UXF86MISC -UXF86DRI -UXF86BIGFONT +SRCS3 = sunInit.c sunInitExt.c +OBJS3 = sunInit.o sunInitExt.o + +#ifndef i386Architecture +SRCS4 = sunInitMono.c sunInExMono.c sunInitMulti.c +OBJS4 = sunInitMono.o sunInExMono.o sunInitMulti.o +#endif + +#ifdef XsunExcludedExtensions +SUN_DEFINES = XsunExcludedExtensions #endif -SRCS = $(SRCS1) $(SRCS2) $(SRCS3) kbd_mode.c constype.c +DEFINES = $(OS_DEFINES) $(EXT_DEFINES) $(SUN_DEFINES) + +SRCS = $(SRCS1) $(SRCS2) $(SRCS3) $(SRCS4) kbd_mode.c constype.c OBJS = $(OBJS1) $(OBJS2) - INCLUDES = -I. -I../.. -I../../mi -I../../mfb -I../../cfb -I../../cfb32 \ - -I../../include -I$(XINCLUDESRC) -I$(FONTINCSRC) -I$(EXTINCSRC) - LINTLIBS = ../../dix/llib-ldix.ln ../../os/llib-los.ln \ - ../mfb/llib-lmfb.ln ../mi/llib-lmi.ln ../cfb/llib-lcfb.ln + INCLUDES = -I$(SERVERSRC)/mi -I$(SERVERSRC)/mfb \ + -I$(SERVERSRC)/cfb -I$(SERVERSRC)/cfb32 \ + -I$(SERVERSRC)/dbe -I$(SERVERSRC)/record \ + -I$(SERVERSRC)/include -I$(SERVERSRC) + LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/llib-los.ln \ + $(SERVERSRC)/mfb/llib-lmfb.ln $(SERVERSRC)/mi/llib-lmi.ln \ + $(SERVERSRC)/cfb/llib-lcfb.ln NormalLibraryObjectRule() -all:: $(OBJS3) kbd_mode constype +all:: $(OBJS3) $(OBJS4) kbd_mode constype lintlib: NormalLibraryTarget(sun,$(OBJS)) NormalLintTarget($(SRCS1)) +LinkFile(sunInitExt.c,$(SERVERSRC)/mi/miinitext.c) +sunInitExt.o: $(ICONFIGFILES) + #ifndef i386Architecture sunInExMono.o: $(ICONFIGFILES) -ObjectFromSpecialSource(sunInExMono,../../mi/miinitext, \ - -UPEXEXT -UGLXEXT -UXV -URENDER) -LinkFile(sunInitExt.c,../../mi/miinitext.c) -LinkSourceFile(stubs.c,../../Xi) +ObjectFromSpecialSource(sunInExMono,$(SERVERSRC)/mi/miinitext,-UGLXEXT -URENDER) ObjectFromSpecialSource(sunInitMono,sunInit,-DSUNMAXDEPTH=1) ObjectFromSpecialSource(sunInitMulti,sunInit,-DSUNMAXDEPTH=32) #endif @@ -93,3 +100,6 @@ #endif DependTarget() + +MakeSubdirs($(SUBDIRS)) +DependSubdirs($(SUBDIRS)) Index: xc/programs/Xserver/hw/sun/Xsun.man diff -u xc/programs/Xserver/hw/sun/Xsun.man:1.9 xc/programs/Xserver/hw/sun/Xsun.man:1.10 --- xc/programs/Xserver/hw/sun/Xsun.man:1.9 Thu Feb 10 22:03:10 2005 +++ xc/programs/Xserver/hw/sun/Xsun.man Mon Jan 9 09:59:49 2006 @@ -1,4 +1,3 @@ -.\" $Xorg: Xsun.man,v 1.4 2001/02/09 02:04:43 xorgcvs Exp $ .\" Copyright 1988 Sun Microsystems, Inc. .\" Copyright 1993, 1994, 1998 The Open Group .\" @@ -24,7 +23,7 @@ .\" other dealings in this Software without prior written authorization .\" from The Open Group. .\" -.\" $XFree86: xc/programs/Xserver/hw/sun/Xsun.man,v 1.9 2005/02/11 03:03:10 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/sun/Xsun.man,v 1.10 2006/01/09 14:59:49 dawes Exp $ .\" .TH XSUN 1 __vendorversion__ .SH NAME Index: xc/programs/Xserver/hw/sun/constype.c diff -u xc/programs/Xserver/hw/sun/constype.c:3.10 xc/programs/Xserver/hw/sun/constype.c:3.11 --- xc/programs/Xserver/hw/sun/constype.c:3.10 Mon Mar 8 10:37:04 2004 +++ xc/programs/Xserver/hw/sun/constype.c Mon Jan 9 09:59:49 2006 @@ -1,6 +1,4 @@ /* - * $Xorg: constype.c,v 1.3 2000/08/17 19:48:29 cpqbld Exp $ - * * consoletype - utility to print out string identifying Sun console type * * Copyright 1988 SRI @@ -17,7 +15,7 @@ * * Author: Doug Moran, SRI */ -/* $XFree86: xc/programs/Xserver/hw/sun/constype.c,v 3.10 2004/03/08 15:37:04 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/constype.c,v 3.11 2006/01/09 14:59:49 dawes Exp $ */ /* SUN-SPOTS DIGEST Thursday, 17 March 1988 Volume 6 : Issue 31 Index: xc/programs/Xserver/hw/sun/constype.man diff -u xc/programs/Xserver/hw/sun/constype.man:1.7 xc/programs/Xserver/hw/sun/constype.man:1.8 --- xc/programs/Xserver/hw/sun/constype.man:1.7 Thu Feb 10 22:03:10 2005 +++ xc/programs/Xserver/hw/sun/constype.man Mon Jan 9 09:59:49 2006 @@ -1,6 +1,4 @@ -.\" $Xorg: constype.man,v 1.3 2000/08/17 19:48:29 cpqbld Exp $ -.\" -.\" $XFree86: xc/programs/Xserver/hw/sun/constype.man,v 1.7 2005/02/11 03:03:10 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/sun/constype.man,v 1.8 2006/01/09 14:59:49 dawes Exp $ .\" .TH CONSTYPE 1 __vendorversion__ .SH NAME Index: xc/programs/Xserver/hw/sun/kbd_mode.c diff -u xc/programs/Xserver/hw/sun/kbd_mode.c:3.12 xc/programs/Xserver/hw/sun/kbd_mode.c:3.13 --- xc/programs/Xserver/hw/sun/kbd_mode.c:3.12 Tue Oct 7 17:39:43 2003 +++ xc/programs/Xserver/hw/sun/kbd_mode.c Mon Jan 9 09:59:49 2006 @@ -1,4 +1,3 @@ -/* $Xorg: kbd_mode.c,v 1.3 2000/08/17 19:48:29 cpqbld Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -27,11 +26,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/sun/kbd_mode.c,v 3.12 2003/10/07 21:39:43 herrb Exp $ */ - -/* -static char sccsid[] = "@(#)kbd_mode.c 7.1 87/04/13"; - */ +/* $XFree86: xc/programs/Xserver/hw/sun/kbd_mode.c,v 3.13 2006/01/09 14:59:49 dawes Exp $ */ /* * Copyright 1986 by Sun Microsystems, Inc. Index: xc/programs/Xserver/hw/sun/kbd_mode.man diff -u xc/programs/Xserver/hw/sun/kbd_mode.man:1.8 xc/programs/Xserver/hw/sun/kbd_mode.man:1.9 --- xc/programs/Xserver/hw/sun/kbd_mode.man:1.8 Thu Feb 10 22:03:10 2005 +++ xc/programs/Xserver/hw/sun/kbd_mode.man Mon Jan 9 09:59:49 2006 @@ -1,4 +1,3 @@ -.\" $Xorg: kbd_mode.man,v 1.4 2001/02/09 02:04:43 xorgcvs Exp $ .\" Copyright 1987 Sun Microsystems, Inc. .\" Copyright 1993, 1998 The Open Group .\" @@ -24,7 +23,7 @@ .\" other dealings in this Software without prior written authorization .\" from The Open Group. .\" -.\" $XFree86: xc/programs/Xserver/hw/sun/kbd_mode.man,v 1.8 2005/02/11 03:03:10 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/sun/kbd_mode.man,v 1.9 2006/01/09 14:59:49 dawes Exp $ .\" .TH KBD_MODE 1 __vendorversion__ .SH NAME Index: xc/programs/Xserver/hw/sun/sun.h diff -u xc/programs/Xserver/hw/sun/sun.h:3.13 xc/programs/Xserver/hw/sun/sun.h:3.14 --- xc/programs/Xserver/hw/sun/sun.h:3.13 Mon Nov 17 17:20:36 2003 +++ xc/programs/Xserver/hw/sun/sun.h Fri Oct 14 11:16:26 2005 @@ -1,7 +1,5 @@ - -/* $Xorg: sun.h,v 1.3 2000/08/17 19:48:29 cpqbld Exp $ */ - -/*- +/* $XFree86: xc/programs/Xserver/hw/sun/sun.h,v 3.14 2005/10/14 15:16:26 tsi Exp $ */ +/* * Copyright (c) 1987 by the Regents of the University of California * * Permission to use, copy, modify, and distribute this @@ -13,16 +11,15 @@ * express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/sun/sun.h,v 3.13 2003/11/17 22:20:36 dawes Exp $ */ #ifndef _SUN_H_ #define _SUN_H_ /* X headers */ -#include "Xos.h" +#include #undef index /* don't mangle silly Sun structure member names */ -#include "X.h" -#include "Xproto.h" +#include +#include /* general system headers */ #ifndef NOSTDHDRS @@ -391,7 +388,7 @@ void ); -/*- +/* * TVTOMILLI(tv) * Given a struct timeval, convert its time into milliseconds... */ Index: xc/programs/Xserver/hw/sun/sunCfb.c diff -u xc/programs/Xserver/hw/sun/sunCfb.c:3.15 xc/programs/Xserver/hw/sun/sunCfb.c:3.16 --- xc/programs/Xserver/hw/sun/sunCfb.c:3.15 Tue Oct 7 17:43:09 2003 +++ xc/programs/Xserver/hw/sun/sunCfb.c Mon Jan 9 09:59:49 2006 @@ -1,6 +1,3 @@ - -/* $Xorg: sunCfb.c,v 1.5 2001/02/09 02:04:43 xorgcvs Exp $ */ - /* Copyright 1990, 1998 The Open Group @@ -54,7 +51,7 @@ ********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/sun/sunCfb.c,v 3.15 2003/10/07 21:43:09 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunCfb.c,v 3.16 2006/01/09 14:59:49 dawes Exp $ */ /* * Copyright 1987 by the Regents of the University of California Index: xc/programs/Xserver/hw/sun/sunCfb24.c diff -u xc/programs/Xserver/hw/sun/sunCfb24.c:1.3 xc/programs/Xserver/hw/sun/sunCfb24.c:1.4 --- xc/programs/Xserver/hw/sun/sunCfb24.c:1.3 Fri Dec 14 14:59:42 2001 +++ xc/programs/Xserver/hw/sun/sunCfb24.c Mon Jan 9 09:59:49 2006 @@ -1,5 +1,3 @@ -/* $Xorg: sunCfb24.c,v 1.4 2001/02/09 02:04:43 xorgcvs Exp $ */ - /* Copyright 1994, 1998 The Open Group @@ -25,7 +23,7 @@ this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunCfb24.c,v 1.3 2001/12/14 19:59:42 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunCfb24.c,v 1.4 2006/01/09 14:59:49 dawes Exp $ */ /* * The CG8 is similar to the CG4 in that it has a mono plane, an enable Index: xc/programs/Xserver/hw/sun/sunCursor.c diff -u xc/programs/Xserver/hw/sun/sunCursor.c:3.6 xc/programs/Xserver/hw/sun/sunCursor.c:3.7 --- xc/programs/Xserver/hw/sun/sunCursor.c:3.6 Mon Nov 17 17:20:36 2003 +++ xc/programs/Xserver/hw/sun/sunCursor.c Mon Jan 9 09:59:49 2006 @@ -1,4 +1,3 @@ -/* $Xorg: sunCursor.c,v 1.4 2001/02/09 02:04:43 xorgcvs Exp $ */ /* Copyright 1988 Sun Microsystems, Inc. @@ -27,7 +26,7 @@ from The Open Group. */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunCursor.c,v 3.6 2003/11/17 22:20:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunCursor.c,v 3.7 2006/01/09 14:59:49 dawes Exp $ */ /*- * sunCursor.c -- Index: xc/programs/Xserver/hw/sun/sunFbs.c diff -u xc/programs/Xserver/hw/sun/sunFbs.c:1.8 xc/programs/Xserver/hw/sun/sunFbs.c:1.9 --- xc/programs/Xserver/hw/sun/sunFbs.c:1.8 Mon Nov 17 17:20:36 2003 +++ xc/programs/Xserver/hw/sun/sunFbs.c Mon Jan 9 09:59:49 2006 @@ -1,6 +1,3 @@ - -/* $Xorg: sunFbs.c,v 1.4 2001/02/09 02:04:43 xorgcvs Exp $ */ - /* Copyright 1990, 1993, 1998 The Open Group @@ -67,7 +64,7 @@ * express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunFbs.c,v 1.8 2003/11/17 22:20:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunFbs.c,v 1.9 2006/01/09 14:59:49 dawes Exp $ */ /****************************************************************/ /* Modified from sunCG4C.c for X11R3 by Tom Jarmolowski */ Index: xc/programs/Xserver/hw/sun/sunGX.c diff -u xc/programs/Xserver/hw/sun/sunGX.c:1.9 xc/programs/Xserver/hw/sun/sunGX.c:1.10 --- xc/programs/Xserver/hw/sun/sunGX.c:1.9 Mon Nov 17 17:20:36 2003 +++ xc/programs/Xserver/hw/sun/sunGX.c Fri Oct 14 11:16:26 2005 @@ -1,6 +1,4 @@ -/* -static char *rid="$Xorg: sunGX.c,v 1.5 2001/02/09 02:04:44 xorgcvs Exp $"; - */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunGX.c,v 1.10 2005/10/14 15:16:26 tsi Exp $ */ /* Copyright 1991, 1998 The Open Group @@ -27,17 +25,16 @@ * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunGX.c,v 1.9 2003/11/17 22:20:36 dawes Exp $ */ #include "sun.h" -#include "Xmd.h" +#include #include "gcstruct.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "regionstr.h" #include "mistruct.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" #include "cfb/cfb.h" #include "cfb/cfbmskbits.h" Index: xc/programs/Xserver/hw/sun/sunGX.h diff -u xc/programs/Xserver/hw/sun/sunGX.h:1.4 xc/programs/Xserver/hw/sun/sunGX.h:1.5 --- xc/programs/Xserver/hw/sun/sunGX.h:1.4 Fri Dec 14 14:59:43 2001 +++ xc/programs/Xserver/hw/sun/sunGX.h Mon Jan 9 09:59:49 2006 @@ -1,5 +1,4 @@ /* - * $Xorg: sunGX.h,v 1.4 2001/02/09 02:04:44 xorgcvs Exp $ * Copyright 1991, 1998 The Open Group @@ -25,7 +24,7 @@ * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunGX.h,v 1.4 2001/12/14 19:59:43 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunGX.h,v 1.5 2006/01/09 14:59:49 dawes Exp $ */ typedef unsigned int Uint; typedef volatile Uint VUint; Index: xc/programs/Xserver/hw/sun/sunInit.c diff -u xc/programs/Xserver/hw/sun/sunInit.c:3.14 xc/programs/Xserver/hw/sun/sunInit.c:3.17 --- xc/programs/Xserver/hw/sun/sunInit.c:3.14 Wed Jun 2 18:43:00 2004 +++ xc/programs/Xserver/hw/sun/sunInit.c Mon Feb 20 12:02:02 2006 @@ -1,4 +1,3 @@ -/* $Xorg: sunInit.c,v 1.4 2000/08/17 19:48:29 cpqbld Exp $ */ /* * sunInit.c -- * Initialization functions for screen/keyboard/mouse, etc. @@ -15,7 +14,7 @@ * * */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunInit.c,v 3.14 2004/06/02 22:43:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunInit.c,v 3.17 2006/02/20 17:02:02 tsi Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -278,7 +277,7 @@ #if SUNMAXDEPTH > 1 ,{ 8, 8, BITMAP_SCANLINE_PAD} /* 8-bit deep */ #if SUNMAXDEPTH > 8 - ,{ 12, 24, BITMAP_SCANLINE_PAD } /* 12-bit deep */ + ,{ 12, 16, BITMAP_SCANLINE_PAD } /* 12-bit deep */ ,{ 24, 32, BITMAP_SCANLINE_PAD } /* 24-bit deep */ #endif #endif @@ -942,28 +941,3 @@ #endif /* SUNMAXDEPTH == 32 */ #endif /* SUNMAXDEPTH */ - -#ifdef DPMSExtension -/************************************************************** - * DPMSSet(), DPMSGet(), DPMSSupported() - * - * stubs - * - ***************************************************************/ - -void DPMSSet (level) - int level; -{ -} - -int DPMSGet (level) - int* level; -{ - return -1; -} - -Bool DPMSSupported () -{ - return FALSE; -} -#endif Index: xc/programs/Xserver/hw/sun/sunIo.c diff -u xc/programs/Xserver/hw/sun/sunIo.c:3.10 xc/programs/Xserver/hw/sun/sunIo.c:3.12 --- xc/programs/Xserver/hw/sun/sunIo.c:3.10 Mon Nov 17 17:20:36 2003 +++ xc/programs/Xserver/hw/sun/sunIo.c Sun Feb 19 10:51:20 2006 @@ -1,4 +1,3 @@ -/* $Xorg: sunIo.c,v 1.4 2001/03/07 17:34:19 pookie Exp $ */ /*- * sunIo.c -- * Functions to handle input from the keyboard and mouse. @@ -15,7 +14,7 @@ * * */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunIo.c,v 3.10 2003/11/17 22:20:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunIo.c,v 3.12 2006/02/19 15:51:20 tsi Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -200,7 +199,6 @@ int i; { extern void UseMsg(); - extern int XprintOptions(int, char **, int); #ifdef XKB int noxkb = 0, n; @@ -273,9 +271,6 @@ sunNoGX = TRUE; return 1; } - if (strcmp(argv[i], "-XpFile") == 0) { - return XprintOptions(argc, argv, i) - i; - } return 0; } @@ -296,5 +291,4 @@ ErrorF("-cg4frob don't use the mono plane of the cgfour\n"); ErrorF("-noGX treat the GX as a dumb frame buffer\n"); #endif - ErrorF("-XpFile specifies an alternate `Xprinters' file (Xprt only)\n"); } Index: xc/programs/Xserver/hw/sun/sunKbd.c diff -u xc/programs/Xserver/hw/sun/sunKbd.c:1.9 xc/programs/Xserver/hw/sun/sunKbd.c:1.11 --- xc/programs/Xserver/hw/sun/sunKbd.c:1.9 Mon Nov 17 17:20:36 2003 +++ xc/programs/Xserver/hw/sun/sunKbd.c Fri Oct 14 11:16:26 2005 @@ -1,5 +1,5 @@ -/* $Xorg: sunKbd.c,v 1.3 2000/08/17 19:48:30 cpqbld Exp $ */ -/*- +/* $XFree86: xc/programs/Xserver/hw/sun/sunKbd.c,v 1.11 2005/10/14 15:16:26 tsi Exp $ */ +/* * Copyright 1987 by the Regents of the University of California * * Permission to use, copy, modify, and distribute this @@ -39,12 +39,11 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/sun/sunKbd.c,v 1.9 2003/11/17 22:20:36 dawes Exp $ */ #define NEED_EVENTS #include "sun.h" -#include "keysym.h" -#include "Sunkeysym.h" +#include +#include #include "mi.h" #ifdef XKB @@ -55,7 +54,6 @@ #define SUN_LED_MASK 0x0f #define MIN_KEYCODE 7 /* necessary to avoid the mouse buttons */ -#define MAX_KEYCODE 255 /* limited by the protocol */ #ifndef KB_SUN4 #define KB_SUN4 4 #endif @@ -187,7 +185,7 @@ SetLights (ctrl, pPriv->fd); } -/*- +/* *----------------------------------------------------------------------- * sunBell -- * Ring the terminal/keyboard bell @@ -364,7 +362,7 @@ SetLights (ctrl, pPriv->fd); } -/*- +/* *----------------------------------------------------------------------- * sunKbdCtrl -- * Alter some of the keyboard control parameters @@ -398,7 +396,7 @@ DoLEDs(device, ctrl, pPriv); } -/*- +/* *----------------------------------------------------------------------- * sunInitKbdNames -- * Handle the XKB initialization @@ -591,7 +589,7 @@ } #endif /* XKB */ -/*- +/* *----------------------------------------------------------------------- * sunKbdProc -- * Handle the initialization, etc. of a keyboard. @@ -632,8 +630,6 @@ workingKeySyms->minKeyCode += MIN_KEYCODE; workingKeySyms->maxKeyCode += MIN_KEYCODE; } - if (workingKeySyms->maxKeyCode > MAX_KEYCODE) - workingKeySyms->maxKeyCode = MAX_KEYCODE; } if (!workingModMap) { @@ -711,7 +707,7 @@ return Success; } -/*- +/* *----------------------------------------------------------------------- * sunKbdGetEvents -- * Return the events waiting in the wings for the given keyboard. @@ -755,7 +751,7 @@ return evBuf; } -/*- +/* *----------------------------------------------------------------------- * sunKbdEnqueueEvent -- * @@ -923,7 +919,7 @@ autoRepeatDeltaTv); } -/*- +/* *----------------------------------------------------------------------- * sunChangeKbdTranslation * Makes operating system calls to set keyboard translation Index: xc/programs/Xserver/hw/sun/sunKeyMap.c diff -u xc/programs/Xserver/hw/sun/sunKeyMap.c:1.4 xc/programs/Xserver/hw/sun/sunKeyMap.c:1.5 --- xc/programs/Xserver/hw/sun/sunKeyMap.c:1.4 Sat Oct 27 23:33:12 2001 +++ xc/programs/Xserver/hw/sun/sunKeyMap.c Fri Oct 14 11:16:26 2005 @@ -1,4 +1,4 @@ -/* $Xorg: sunKeyMap.c,v 1.3 2000/08/17 19:48:30 cpqbld Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunKeyMap.c,v 1.5 2005/10/14 15:16:26 tsi Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -27,12 +27,11 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/sun/sunKeyMap.c,v 1.4 2001/10/28 03:33:12 tsi Exp $ */ #include "sun.h" #define XK_KATAKANA -#include "keysym.h" -#include "Sunkeysym.h" +#include +#include /* By default all keyboards are hardcoded on the theory that people Index: xc/programs/Xserver/hw/sun/sunMfb.c diff -u xc/programs/Xserver/hw/sun/sunMfb.c:3.4 xc/programs/Xserver/hw/sun/sunMfb.c:3.5 --- xc/programs/Xserver/hw/sun/sunMfb.c:3.4 Fri Dec 14 14:59:43 2001 +++ xc/programs/Xserver/hw/sun/sunMfb.c Mon Jan 9 09:59:49 2006 @@ -1,6 +1,3 @@ - -/* $Xorg: sunMfb.c,v 1.4 2001/02/09 02:04:44 xorgcvs Exp $ */ - /* Copyright 1990, 1993, 1998 The Open Group @@ -24,7 +21,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunMfb.c,v 3.4 2001/12/14 19:59:43 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunMfb.c,v 3.5 2006/01/09 14:59:49 dawes Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. Index: xc/programs/Xserver/hw/sun/sunMouse.c diff -u xc/programs/Xserver/hw/sun/sunMouse.c:1.4 xc/programs/Xserver/hw/sun/sunMouse.c:1.5 --- xc/programs/Xserver/hw/sun/sunMouse.c:1.4 Mon Nov 17 17:20:36 2003 +++ xc/programs/Xserver/hw/sun/sunMouse.c Mon Jan 9 09:59:49 2006 @@ -1,4 +1,3 @@ -/* $Xorg: sunMouse.c,v 1.3 2000/08/17 19:48:32 cpqbld Exp $ */ /*- * Copyright 1987 by the Regents of the University of California * @@ -50,7 +49,7 @@ * any purpose. It is provided "as is" without express or * implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunMouse.c,v 1.4 2003/11/17 22:20:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunMouse.c,v 1.5 2006/01/09 14:59:49 dawes Exp $ */ #define NEED_EVENTS #include "sun.h" Index: xc/programs/Xserver/hw/sun/sunMultiDepth.c diff -u xc/programs/Xserver/hw/sun/sunMultiDepth.c:1.6 xc/programs/Xserver/hw/sun/sunMultiDepth.c:removed --- xc/programs/Xserver/hw/sun/sunMultiDepth.c:1.6 Fri Dec 14 14:59:43 2001 +++ xc/programs/Xserver/hw/sun/sunMultiDepth.c Tue May 9 21:56:17 2006 @@ -1,277 +0,0 @@ -/* $Xorg: sunMultiDepth.c,v 1.4 2001/02/09 02:04:44 xorgcvs Exp $ */ -/* - -Copyright 1992, 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. - -*/ - -/* $XFree86: xc/programs/Xserver/hw/sun/sunMultiDepth.c,v 1.6 2001/12/14 19:59:43 dawes Exp $ */ - -#include "X.h" -#include "Xmd.h" -#include "servermd.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "resource.h" -#include "colormap.h" -#include "colormapst.h" -#include "mi.h" -#include "mistruct.h" -#include "dix.h" -#include "gcstruct.h" -#include "mibstore.h" - -#ifndef SINGLEDEPTH - -static Bool -sunCfbCreateGC(pGC) - GCPtr pGC; -{ - if (pGC->depth == 1) - { - return mfbCreateGC (pGC); - } - else if (pGC->depth <= 8) - { - return cfbCreateGC (pGC); - } - else if (pGC->depth <= 16) - { - return cfb16CreateGC (pGC); - } - else if (pGC->depth <= 32) - { - return cfb32CreateGC (pGC); - } - return FALSE; -} - -static void -sunCfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart) - DrawablePtr pDrawable; /* drawable from which to get bits */ - int wMax; /* largest value of all *pwidths */ - register DDXPointPtr ppt; /* points to start copying from */ - int *pwidth; /* list of number of bits to copy */ - int nspans; /* number of scanlines to copy */ - char *pdstStart; /* where to put the bits */ -{ - switch (pDrawable->bitsPerPixel) { - case 1: - mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart); - break; - case 8: - cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart); - break; - case 16: - cfb16GetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart); - break; - case 32: - cfb32GetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart); - break; - } - return; -} - -static void -sunCfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine) - DrawablePtr pDrawable; - int sx, sy, w, h; - unsigned int format; - unsigned long planeMask; - char *pdstLine; -{ - switch (pDrawable->bitsPerPixel) - { - case 1: - mfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); - break; - case 8: - cfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); - break; - case 16: - cfb16GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); - break; - case 32: - cfb32GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); - break; - } -} - -Bool -sunCfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp) - register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bitmap */ - int xsize, ysize; /* in pixels */ - int dpix, dpiy; /* dots per inch */ - int width; /* pixel width of frame buffer */ - int bpp; /* bits per pixel of root */ -{ - extern int cfbWindowPrivateIndex; - extern int cfbGCPrivateIndex; - int ret; - - sunRegisterPixmapFormat( /* depth */ 1, /* bits per pixel */ 1); - sunRegisterPixmapFormat( /* depth */ 8, /* bits per pixel */ 8); - sunRegisterPixmapFormat( /* depth */ 12, /* bits per pixel */ 16); - sunRegisterPixmapFormat( /* depth */ 24, /* bits per pixel */ 32); - - switch (bpp) { - case 8: - ret = cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width); - break; - case 16: - ret = cfb16SetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width); - break; - case 32: - ret = cfb32SetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width); - break; - default: - return FALSE; - } - pScreen->CreateGC = sunCfbCreateGC; - pScreen->GetImage = sunCfbGetImage; - pScreen->GetSpans = sunCfbGetSpans; - return ret; -} - -extern BSFuncRec cfbBSFuncRec, cfb16BSFuncRec, cfb32BSFuncRec; -extern int cfb16ScreenPrivateIndex, cfb32ScreenPrivateIndex; -extern Bool cfbCloseScreen(), cfb16CloseScreen(), cfb32CloseScreen(); - -Bool -sunCfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp) - register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bitmap */ - int xsize, ysize; /* in pixels */ - int dpix, dpiy; /* dots per inch */ - int width; /* pixel width of frame buffer */ - int bpp; -{ - int i; - pointer oldDevPrivate; - VisualPtr visuals; - int nvisuals; - DepthPtr depths; - int ndepths; - VisualID defaultVisual; - int rootdepth; - - if (!cfbInitVisuals(&visuals, &depths, &nvisuals, &ndepths, - &rootdepth, &defaultVisual, 1 << (bpp - 1), 8)) - return FALSE; - oldDevPrivate = pScreen->devPrivate; - if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, - rootdepth, ndepths, depths, - defaultVisual, nvisuals, visuals)) - return FALSE; - switch (bpp) - { - case 8: - pScreen->CloseScreen = cfbCloseScreen; - pScreen->BackingStoreFuncs = cfbBSFuncRec; - break; - case 16: - pScreen->CloseScreen = cfb16CloseScreen; - pScreen->devPrivates[cfb16ScreenPrivateIndex].ptr = - pScreen->devPrivate; - pScreen->devPrivate = oldDevPrivate; - pScreen->BackingStoreFuncs = cfb16BSFuncRec; - break; - case 32: - pScreen->CloseScreen = cfb32CloseScreen; - pScreen->devPrivates[cfb32ScreenPrivateIndex].ptr = - pScreen->devPrivate; - pScreen->devPrivate = oldDevPrivate; - pScreen->BackingStoreFuncs = cfb32BSFuncRec; - break; - } - return TRUE; -} - - -Bool -sunCfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp) - register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bitmap */ - int xsize, ysize; /* in pixels */ - int dpix, dpiy; /* dots per inch */ - int width; /* pixel width of frame buffer */ - int bpp; -{ - if (!sunCfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, - width, bpp)) - return FALSE; - return sunCfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, - dpiy, width, bpp); -} - - -#else /* SINGLEDEPTH */ - -/* stuff for 8-bit only server */ - -Bool -sunCfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp) - register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bitmap */ - int xsize, ysize; /* in pixels */ - int dpix, dpiy; /* dots per inch */ - int width; /* pixel width of frame buffer */ - int bpp; /* bits per pixel of root */ -{ - sunRegisterPixmapFormat( /* depth */ 1, /* bits per pixel */ 1); - sunRegisterPixmapFormat( /* depth */ 8, /* bits per pixel */ 8); - return cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, - width); -} - -Bool -sunCfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp) - register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bitmap */ - int xsize, ysize; /* in pixels */ - int dpix, dpiy; /* dots per inch */ - int width; /* pixel width of frame buffer */ - int bpp; -{ - return cfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, - width); -} - -Bool -sunCfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp) - register ScreenPtr pScreen; - pointer pbits; /* pointer to screen bitmap */ - int xsize, ysize; /* in pixels */ - int dpix, dpiy; /* dots per inch */ - int width; /* pixel width of frame buffer */ - int bpp; -{ - sunRegisterPixmapFormat( /* depth */ 1, /* bits per pixel */ 1); - sunRegisterPixmapFormat( /* depth */ 8, /* bits per pixel */ 8); - return cfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width); -} - -#endif /* SINGLEDEPTH */ Index: xc/programs/Xserver/hw/sun/XTrap/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sun/XTrap/Imakefile:1.1 --- /dev/null Tue May 9 21:56:17 2006 +++ xc/programs/Xserver/hw/sun/XTrap/Imakefile Sun Feb 19 10:51:20 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sun/XTrap/Imakefile,v 1.1 2006/02/19 15:51:20 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunExcludedExtensions +#define LinkDirectory ../../../XTrap + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../XTrap/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sun/Xext/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sun/Xext/Imakefile:1.1 --- /dev/null Tue May 9 21:56:17 2006 +++ xc/programs/Xserver/hw/sun/Xext/Imakefile Sun Feb 19 10:51:20 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sun/Xext/Imakefile,v 1.1 2006/02/19 15:51:20 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunExcludedExtensions +#define LinkDirectory ../../../Xext + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../Xext/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sun/dbe/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sun/dbe/Imakefile:1.1 --- /dev/null Tue May 9 21:56:17 2006 +++ xc/programs/Xserver/hw/sun/dbe/Imakefile Sun Feb 19 10:51:20 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sun/dbe/Imakefile,v 1.1 2006/02/19 15:51:20 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunExcludedExtensions +#define LinkDirectory ../../../dbe + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../dbe/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sun/dix/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sun/dix/Imakefile:1.1 --- /dev/null Tue May 9 21:56:17 2006 +++ xc/programs/Xserver/hw/sun/dix/Imakefile Sun Feb 19 10:51:20 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sun/dix/Imakefile,v 1.1 2006/02/19 15:51:20 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunExcludedExtensions +#define LinkDirectory ../../../dix + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../dix/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sun/os/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sun/os/Imakefile:1.1 --- /dev/null Tue May 9 21:56:17 2006 +++ xc/programs/Xserver/hw/sun/os/Imakefile Sun Feb 19 10:51:20 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sun/os/Imakefile,v 1.1 2006/02/19 15:51:20 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunExcludedExtensions +#define LinkDirectory ../../../os + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../os/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sun/randr/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sun/randr/Imakefile:1.1 --- /dev/null Tue May 9 21:56:17 2006 +++ xc/programs/Xserver/hw/sun/randr/Imakefile Sun Feb 19 10:51:20 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sun/randr/Imakefile,v 1.1 2006/02/19 15:51:20 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunExcludedExtensions +#define LinkDirectory ../../../randr + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../randr/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sun/record/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sun/record/Imakefile:1.1 --- /dev/null Tue May 9 21:56:17 2006 +++ xc/programs/Xserver/hw/sun/record/Imakefile Sun Feb 19 10:51:20 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sun/record/Imakefile,v 1.1 2006/02/19 15:51:20 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunExcludedExtensions +#define LinkDirectory ../../../record + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../record/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sun/render/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sun/render/Imakefile:1.1 --- /dev/null Tue May 9 21:56:17 2006 +++ xc/programs/Xserver/hw/sun/render/Imakefile Sun Feb 19 10:51:20 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sun/render/Imakefile,v 1.1 2006/02/19 15:51:20 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunExcludedExtensions +#define LinkDirectory ../../../render + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../render/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sun/xkb/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sun/xkb/Imakefile:1.1 --- /dev/null Tue May 9 21:56:17 2006 +++ xc/programs/Xserver/hw/sun/xkb/Imakefile Sun Feb 19 10:51:20 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sun/xkb/Imakefile,v 1.1 2006/02/19 15:51:20 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunExcludedExtensions +#define LinkDirectory ../../../xkb + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../xkb/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sunLynx/Imakefile diff -u xc/programs/Xserver/hw/sunLynx/Imakefile:3.2 xc/programs/Xserver/hw/sunLynx/Imakefile:3.6 --- xc/programs/Xserver/hw/sunLynx/Imakefile:3.2 Wed Jan 17 17:36:52 2001 +++ xc/programs/Xserver/hw/sunLynx/Imakefile Sun Feb 19 10:51:21 2006 @@ -1,78 +1,90 @@ -XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:48:36 cpqbld Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/sunLynx/Imakefile,v 3.6 2006/02/19 15:51:21 tsi Exp $ +#include +#define IHaveSubdirs -XCOMM $XFree86: xc/programs/Xserver/hw/sunLynx/Imakefile,v 3.2 2001/01/17 22:36:52 dawes Exp $ +#if BuildXKB +XKBDIRS = xkb +#endif -#include +#if BuildRender +RENDERDIRS = render +#endif + +#if BuildRandR +RANDRDIRS = randr +#endif + +#if BuildRECORD +RECORDDIRS = record +#endif + +#if BuildDBE +DBEDIRS = dbe +#endif -SRCS1 = sunLyInit.c \ - sunLyIo.c \ - sunLyUtil.c \ - sunLyMouse.c\ - sunLyCfb.c \ - sunLyFbs.c \ - sunLyKbd.c \ - sunCursor.c \ - sunMfb.c \ - sunGX.c \ - sunKeyMap.c +#if BuildXTrap +XTRAPDIRS = XTrap +#endif + +SUBDIRS = dix os Xext $(XKBDIRS) $(RENDERDIRS) $(RANDRDIRS) $(RECORDDIRS) \ + $(DBEDIRS) $(XTRAPDIRS) + +SRCS1 = sunLyInit.c sunInitExt.c sunLyIo.c sunLyUtil.c sunLyMouse.c sunLyCfb.c \ + sunLyFbs.c sunLyKbd.c sunCursor.c sunMfb.c sunGX.c sunKeyMap.c -XCOMM SRCS = $(SRCS1) kbd_mode.c constype.c -SRCS = $(SRCS1) +OBJS1 = sunLyIo.o sunLyUtil.o sunLyMouse.o sunLyCfb.o sunLyFbs.o \ + sunLyKbd.o sunCursor.o sunMfb.o sunGX.o sunKeyMap.o + +SRCS2 = sunLyInit.c sunInitExt.c +OBJS2 = sunLyInit.o sunInitExt.o #if XsunLynxMonoServer -OFILES = sunInitMono.o sunInExMono.o +SRCS3 = sunInitMono.c sunInExMono.c +OBJS3 = sunInitMono.o sunInExMono.o #endif -OBJS = sunLyInit.o \ - sunLyIo.o \ - sunLyUtil.o \ - sunLyMouse.o\ - sunLyCfb.o \ - sunLyFbs.o \ - sunLyKbd.o \ - sunCursor.o \ - sunMfb.o \ - sunGX.o \ - sunKeyMap.o - - INCLUDES = -I. -I../.. -I../../mi -I../../mfb -I../../cfb -I../../cfb32 \ - -I../../include -I../../os -I$(XINCLUDESRC) -I$(FONTINCSRC) - LINTLIBS = ../../dix/llib-ldix.ln ../../os/llib-los.ln \ - ../mfb/llib-lmfb.ln ../mi/llib-lmi.ln ../cfb/llib-lcfb.ln +SRCS = $(SRCS1) $(SRCS2) $(SRCS3) +OBJS = $(OBJS1) -NormalLibraryObjectRule() +#ifdef XsunLynxExcludedExtensions +LYNX_DEFINES = XsunLynxExcludedExtensions +#endif + + INCLUDES = -I$(SERVERSRC)/mi -I$(SERVERSRC)/mfb \ + -I$(SERVERSRC)/cfb -I$(SERVERSRC)/cfb32 \ + -I$(SERVERSRC)/dbe -I$(SERVERSRC)/record \ + -I$(SERVERSRC)/include -I$(SERVERSRC)/os \ + -I$(SERVERSRC)/hw/sun -I$(SERVERSRC) + LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/llib-los.ln \ + $(SERVERSRC)/mfb/llib-lmfb.ln $(SERVERSRC)/mi/llib-lmi.ln \ + $(SERVERSRC)/cfb/llib-lcfb.ln + + DEFINES = $(EXT_DEFINES) $(LYNX_DEFINES) -XCOMM all:: $(OFILES) kbd_mode constype -all:: $(OFILES) +Makefiles:: + RemoveFiles(sunGX.h circleset.h) + +NormalLibraryObjectRule() -lintlib: +all:: $(OBJS2) $(OBJS3) NormalLibraryTarget(sun,$(OBJS)) -NormalLintTarget($(SRCS1)) +NormalLintTarget($(SRCS)) +sunInitExt.o: $(ICONFIGFILES) +ObjectFromSpecialSource(sunInitExt,$(SERVERSRC)/mi/miinitext,NullParameter) sunInExMono.o: $(ICONFIGFILES) -ObjectFromSpecialSource(sunInExMono,../../mi/miinitext,$(EXT_DEFINES) -UXIEEXT -UPEXEXT -UXF86VIDMODE) +ObjectFromSpecialSource(sunInExMono,$(SERVERSRC)/mi/miinitext,-UGLXEXT -URENDER) ObjectFromSpecialSource(sunInitMono,sunLyInit,-DSUNMAXDEPTH=1) -#if 0 -SingleProgramTarget(kbd_mode, kbd_mode.o,,) -SingleProgramTarget(constype, constype.o,,) -InstallProgram(kbd_mode,$(BINDIR)) -InstallProgram(constype,$(BINDIR)) -InstallManPage(kbd_mode,$(MANDIR)) -InstallManPage(constype,$(MANDIR)) -InstallManPage(Xsun,$(MANDIR)) -InstallManPageAliases(Xsun,$(MANDIR),XsunMono) -#endif - -LinkSourceFile(sunGX.h,../sun) -LinkSourceFile(circleset.h,../sun) -ObjectFromSpecialSource(sunKeyMap,../sun/sunKeyMap,/**/) -ObjectFromSpecialSource(sunMfb,../sun/sunMfb,/**/) -ObjectFromSpecialSource(sunGX,../sun/sunGX,/**/) -ObjectFromSpecialSource(sunCursor,../sun/sunCursor,/**/) +ObjectFromSpecialSource(sunKeyMap,$(SERVERSRC)/hw/sun/sunKeyMap,/**/) +ObjectFromSpecialSource(sunMfb,$(SERVERSRC)/hw/sun/sunMfb,/**/) +ObjectFromSpecialSource(sunGX,$(SERVERSRC)/hw/sun/sunGX,/**/) +ObjectFromSpecialSource(sunCursor,$(SERVERSRC)/hw/sun/sunCursor,/**/) DependTarget() +MakeSubdirs($(SUBDIRS)) +DependSubdirs($(SUBDIRS)) Index: xc/programs/Xserver/hw/sunLynx/btreg.h diff -u xc/programs/Xserver/hw/sunLynx/btreg.h:3.2 xc/programs/Xserver/hw/sunLynx/btreg.h:3.3 --- xc/programs/Xserver/hw/sunLynx/btreg.h:3.2 Wed Jan 17 17:36:52 2001 +++ xc/programs/Xserver/hw/sunLynx/btreg.h Mon Jan 9 09:59:50 2006 @@ -1,4 +1,3 @@ -/* $Xorg: btreg.h,v 1.3 2000/08/17 19:48:36 cpqbld Exp $ */ /* * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. @@ -42,8 +41,7 @@ * * @(#)btreg.h 8.2 (Berkeley) 1/21/94 */ -/* $NetBSD: btreg.h,v 1.2 1994/11/20 20:51:55 deraadt Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/btreg.h,v 3.2 2001/01/17 22:36:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/btreg.h,v 3.3 2006/01/09 14:59:50 dawes Exp $ */ /* * Several Sun color frame buffers use some kind of Brooktree video Index: xc/programs/Xserver/hw/sunLynx/btvar.h diff -u xc/programs/Xserver/hw/sunLynx/btvar.h:3.2 xc/programs/Xserver/hw/sunLynx/btvar.h:3.3 --- xc/programs/Xserver/hw/sunLynx/btvar.h:3.2 Wed Jan 17 17:36:52 2001 +++ xc/programs/Xserver/hw/sunLynx/btvar.h Mon Jan 9 09:59:50 2006 @@ -1,4 +1,3 @@ -/* $Xorg: btvar.h,v 1.3 2000/08/17 19:48:36 cpqbld Exp $ */ /* * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. @@ -42,8 +41,7 @@ * * @(#)btvar.h 8.2 (Berkeley) 1/21/94 */ -/* $NetBSD: btvar.h,v 1.2 1994/11/20 20:51:56 deraadt Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/btvar.h,v 3.2 2001/01/17 22:36:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/btvar.h,v 3.3 2006/01/09 14:59:50 dawes Exp $ */ /* * Brooktree color frame buffer state variables (see btreg.h). Index: xc/programs/Xserver/hw/sunLynx/cgsixreg.h diff -u xc/programs/Xserver/hw/sunLynx/cgsixreg.h:3.2 xc/programs/Xserver/hw/sunLynx/cgsixreg.h:3.3 --- xc/programs/Xserver/hw/sunLynx/cgsixreg.h:3.2 Wed Jan 17 17:36:52 2001 +++ xc/programs/Xserver/hw/sunLynx/cgsixreg.h Mon Jan 9 09:59:50 2006 @@ -1,4 +1,3 @@ -/* $Xorg: cgsixreg.h,v 1.3 2000/08/17 19:48:36 cpqbld Exp $ */ /* * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. @@ -42,8 +41,7 @@ * * @(#)cgsixreg.h 8.4 (Berkeley) 1/21/94 */ -/* $NetBSD: cgsixreg.h,v 1.3 1994/11/20 20:52:00 deraadt Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/cgsixreg.h,v 3.2 2001/01/17 22:36:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/cgsixreg.h,v 3.3 2006/01/09 14:59:50 dawes Exp $ */ /* * CG6 display registers. (Note, I got tired of writing `cgsix' about Index: xc/programs/Xserver/hw/sunLynx/fbio.h diff -u xc/programs/Xserver/hw/sunLynx/fbio.h:3.2 xc/programs/Xserver/hw/sunLynx/fbio.h:3.3 --- xc/programs/Xserver/hw/sunLynx/fbio.h:3.2 Wed Jan 17 17:36:52 2001 +++ xc/programs/Xserver/hw/sunLynx/fbio.h Mon Jan 9 09:59:50 2006 @@ -1,4 +1,3 @@ -/* $Xorg: fbio.h,v 1.3 2000/08/17 19:48:36 cpqbld Exp $ */ /* * Copyright (c) 1992 Regents of the University of California. * All rights reserved. @@ -41,8 +40,7 @@ /* * Frame buffer ioctls (from Sprite, trimmed to essentials for X11). */ -/* $NetBSD: fbio.h,v 1.3 1994/11/20 20:53:03 deraadt Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/fbio.h,v 3.2 2001/01/17 22:36:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/fbio.h,v 3.3 2006/01/09 14:59:50 dawes Exp $ */ /* * Frame buffer type codes. Index: xc/programs/Xserver/hw/sunLynx/sun.h diff -u xc/programs/Xserver/hw/sunLynx/sun.h:3.8 xc/programs/Xserver/hw/sunLynx/sun.h:3.9 --- xc/programs/Xserver/hw/sunLynx/sun.h:3.8 Mon Nov 17 17:20:37 2003 +++ xc/programs/Xserver/hw/sunLynx/sun.h Fri Oct 14 11:16:27 2005 @@ -1,8 +1,8 @@ -/* $Xorg: sun.h,v 1.3 2000/08/17 19:48:36 cpqbld Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sun.h,v 3.9 2005/10/14 15:16:27 tsi Exp $ */ /* This is sun.h modified for LynxOS */ -/*- +/* * Copyright (c) 1987 by the Regents of the University of California * * Permission to use, copy, modify, and distribute this @@ -13,16 +13,15 @@ * software for any purpose. It is provided "as is" without * express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sun.h,v 3.8 2003/11/17 22:20:37 dawes Exp $ */ #ifndef _SUN_H_ #define _SUN_H_ /* X headers */ -#include "Xos.h" +#include #undef index /* don't mangle silly Sun structure member names */ -#include "X.h" -#include "Xproto.h" +#include +#include /* general system headers */ #ifndef NOSTDHDRS @@ -431,7 +430,7 @@ void ); -/*- +/* * TVTOMILLI(tv) * Given a struct timeval, convert its time into milliseconds... */ Index: xc/programs/Xserver/hw/sunLynx/sunLyCfb.c diff -u xc/programs/Xserver/hw/sunLynx/sunLyCfb.c:3.5 xc/programs/Xserver/hw/sunLynx/sunLyCfb.c:3.6 --- xc/programs/Xserver/hw/sunLynx/sunLyCfb.c:3.5 Fri Dec 14 14:59:44 2001 +++ xc/programs/Xserver/hw/sunLynx/sunLyCfb.c Mon Jan 9 09:59:50 2006 @@ -1,4 +1,3 @@ -/* $Xorg: sunLyCfb.c,v 1.4 2001/02/09 02:04:44 xorgcvs Exp $ */ /* * This is sunCfb.c modified for LynxOS * Copyright 1996 by Thomas Mueller @@ -22,7 +21,7 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyCfb.c,v 3.5 2001/12/14 19:59:44 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyCfb.c,v 3.6 2006/01/09 14:59:50 dawes Exp $ */ /* Copyright 1990, 1998 The Open Group Index: xc/programs/Xserver/hw/sunLynx/sunLyFbs.c diff -u xc/programs/Xserver/hw/sunLynx/sunLyFbs.c:3.7 xc/programs/Xserver/hw/sunLynx/sunLyFbs.c:3.8 --- xc/programs/Xserver/hw/sunLynx/sunLyFbs.c:3.7 Mon Nov 17 17:20:37 2003 +++ xc/programs/Xserver/hw/sunLynx/sunLyFbs.c Mon Jan 9 09:59:50 2006 @@ -1,4 +1,3 @@ -/* $Xorg: sunLyFbs.c,v 1.4 2001/02/09 02:04:44 xorgcvs Exp $ */ /* * This is sunFbs.c modified for LynxOS * Copyright 1996 by Thomas Mueller @@ -22,7 +21,7 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyFbs.c,v 3.7 2003/11/17 22:20:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyFbs.c,v 3.8 2006/01/09 14:59:50 dawes Exp $ */ /* Copyright 1990, 1993, 1998 The Open Group Index: xc/programs/Xserver/hw/sunLynx/sunLyInit.c diff -u xc/programs/Xserver/hw/sunLynx/sunLyInit.c:3.10 xc/programs/Xserver/hw/sunLynx/sunLyInit.c:3.12 --- xc/programs/Xserver/hw/sunLynx/sunLyInit.c:3.10 Wed Jun 2 18:43:00 2004 +++ xc/programs/Xserver/hw/sunLynx/sunLyInit.c Sun Feb 19 10:51:21 2006 @@ -1,4 +1,3 @@ -/* $Xorg: sunLyInit.c,v 1.3 2000/08/17 19:48:36 cpqbld Exp $ */ /* * This is sunInit.c modified for LynxOS * Copyright 1996 by Thomas Mueller @@ -22,7 +21,7 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyInit.c,v 3.10 2004/06/02 22:43:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyInit.c,v 3.12 2006/02/19 15:51:21 tsi Exp $ */ /* * Copyright 1987 by the Regents of the University of California @@ -627,28 +626,3 @@ return cfbScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width); } #endif /* SUNMAXDEPTH */ - -#ifdef DPMSExtension -/************************************************************** - * DPMSSet(), DPMSGet(), DPMSSupported() - * - * stubs - * - ***************************************************************/ - -void DPMSSet (level) - int level; -{ -} - -int DPMSGet (level) - int* level; -{ - return -1; -} - -Bool DPMSSupported () -{ - return FALSE; -} -#endif Index: xc/programs/Xserver/hw/sunLynx/sunLyIo.c diff -u xc/programs/Xserver/hw/sunLynx/sunLyIo.c:3.6 xc/programs/Xserver/hw/sunLynx/sunLyIo.c:3.7 --- xc/programs/Xserver/hw/sunLynx/sunLyIo.c:3.6 Mon Nov 17 17:20:37 2003 +++ xc/programs/Xserver/hw/sunLynx/sunLyIo.c Mon Jan 9 09:59:50 2006 @@ -1,4 +1,3 @@ -/* $Xorg: sunLyIo.c,v 1.3 2000/08/17 19:48:37 cpqbld Exp $ */ /*- * This is sunIo.c modified for LynxOS * Copyright 1996 by Thomas Mueller @@ -22,7 +21,7 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyIo.c,v 3.6 2003/11/17 22:20:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyIo.c,v 3.7 2006/01/09 14:59:50 dawes Exp $ */ /* * Index: xc/programs/Xserver/hw/sunLynx/sunLyKbd.c diff -u xc/programs/Xserver/hw/sunLynx/sunLyKbd.c:3.7 xc/programs/Xserver/hw/sunLynx/sunLyKbd.c:3.8 --- xc/programs/Xserver/hw/sunLynx/sunLyKbd.c:3.7 Mon Nov 17 17:20:37 2003 +++ xc/programs/Xserver/hw/sunLynx/sunLyKbd.c Fri Oct 14 11:16:27 2005 @@ -1,4 +1,4 @@ -/* $Xorg: sunLyKbd.c,v 1.3 2000/08/17 19:48:37 cpqbld Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyKbd.c,v 3.8 2005/10/14 15:16:27 tsi Exp $ */ /* * This is sunKbd.c modified for LynxOS * Copyright 1996 by Thomas Mueller @@ -22,9 +22,8 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyKbd.c,v 3.7 2003/11/17 22:20:37 dawes Exp $ */ -/*- +/* * Copyright 1987 by the Regents of the University of California * * Permission to use, copy, modify, and distribute this @@ -67,11 +66,11 @@ #define NEED_EVENTS #include "sun.h" -#include "keysym.h" -#include "Sunkeysym.h" +#include +#include #include "osdep.h" -#include "Xpoll.h" +#include #ifdef XKB #include @@ -217,7 +216,7 @@ SetLights (ctrl, pPriv->fd); } -/*- +/* *----------------------------------------------------------------------- * sunBell -- * Ring the terminal/keyboard bell @@ -384,7 +383,7 @@ SetLights (ctrl, pPriv->fd); } -/*- +/* *----------------------------------------------------------------------- * sunKbdCtrl -- * Alter some of the keyboard control parameters @@ -420,7 +419,7 @@ DoLEDs(device, ctrl, pPriv); } -/*- +/* *----------------------------------------------------------------------- * sunInitKbdNames -- * Handle the XKB initialization @@ -561,7 +560,7 @@ } #endif /* XKB */ -/*- +/* *----------------------------------------------------------------------- * sunKbdProc -- * Handle the initialization, etc. of a keyboard. @@ -705,7 +704,7 @@ return Success; } -/*- +/* *----------------------------------------------------------------------- * sunKbdGetEvents -- * Return the events waiting in the wings for the given keyboard. @@ -765,7 +764,7 @@ return evBuf; } -/*- +/* *----------------------------------------------------------------------- * sunKbdEnqueueEvent -- * @@ -933,7 +932,7 @@ autoRepeatDeltaTv); } -/*- +/* *----------------------------------------------------------------------- * sunChangeKbdTranslation * Makes operating system calls to set keyboard translation Index: xc/programs/Xserver/hw/sunLynx/sunLyMouse.c diff -u xc/programs/Xserver/hw/sunLynx/sunLyMouse.c:3.4 xc/programs/Xserver/hw/sunLynx/sunLyMouse.c:3.5 --- xc/programs/Xserver/hw/sunLynx/sunLyMouse.c:3.4 Mon Nov 17 17:20:37 2003 +++ xc/programs/Xserver/hw/sunLynx/sunLyMouse.c Mon Jan 9 09:59:50 2006 @@ -1,4 +1,3 @@ -/* $Xorg: sunLyMouse.c,v 1.3 2000/08/17 19:48:37 cpqbld Exp $ */ /* * This is sunMouse.c modified for LynxOS * Copyright 1996 by Thomas Mueller @@ -22,7 +21,7 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyMouse.c,v 3.4 2003/11/17 22:20:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyMouse.c,v 3.5 2006/01/09 14:59:50 dawes Exp $ */ /*- * Copyright 1987 by the Regents of the University of California Index: xc/programs/Xserver/hw/sunLynx/sunLyUtil.c diff -u xc/programs/Xserver/hw/sunLynx/sunLyUtil.c:3.2 xc/programs/Xserver/hw/sunLynx/sunLyUtil.c:3.3 --- xc/programs/Xserver/hw/sunLynx/sunLyUtil.c:3.2 Wed Jan 17 17:36:53 2001 +++ xc/programs/Xserver/hw/sunLynx/sunLyUtil.c Mon Jan 9 09:59:50 2006 @@ -1,4 +1,3 @@ -/* $Xorg: sunLyUtil.c,v 1.3 2000/08/17 19:48:37 cpqbld Exp $ */ /* * CG3 and CG6 utility functions for LynxOS, derived from NetBSD * Copyright 1996 by Thomas Mueller @@ -22,9 +21,7 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyUtil.c,v 3.2 2001/01/17 22:36:53 dawes Exp $ */ - -/* $NetBSD: bt_subr.c,v 1.4 1994/11/20 20:51:54 deraadt Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyUtil.c,v 3.3 2006/01/09 14:59:50 dawes Exp $ */ /* * Copyright (c) 1993 Index: xc/programs/Xserver/hw/sunLynx/vuid_event.h diff -u xc/programs/Xserver/hw/sunLynx/vuid_event.h:3.2 xc/programs/Xserver/hw/sunLynx/vuid_event.h:3.3 --- xc/programs/Xserver/hw/sunLynx/vuid_event.h:3.2 Wed Jan 17 17:36:53 2001 +++ xc/programs/Xserver/hw/sunLynx/vuid_event.h Mon Jan 9 09:59:50 2006 @@ -1,4 +1,3 @@ -/* $Xorg: vuid_event.h,v 1.3 2000/08/17 19:48:38 cpqbld Exp $ */ /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -42,8 +41,7 @@ * * @(#)vuid_event.h 8.1 (Berkeley) 6/11/93 */ -/* $NetBSD: vuid_event.h,v 1.2 1994/11/20 20:53:39 deraadt Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/vuid_event.h,v 3.2 2001/01/17 22:36:53 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/vuid_event.h,v 3.3 2006/01/09 14:59:50 dawes Exp $ */ /* * The following is a minimal emulation of Sun's `Firm_event' structures Index: xc/programs/Xserver/hw/sunLynx/XTrap/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sunLynx/XTrap/Imakefile:1.1 --- /dev/null Tue May 9 21:56:18 2006 +++ xc/programs/Xserver/hw/sunLynx/XTrap/Imakefile Sun Feb 19 10:51:21 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sunLynx/XTrap/Imakefile,v 1.1 2006/02/19 15:51:21 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunLynxExcludedExtensions +#define LinkDirectory ../../../XTrap + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../XTrap/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sunLynx/Xext/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sunLynx/Xext/Imakefile:1.1 --- /dev/null Tue May 9 21:56:18 2006 +++ xc/programs/Xserver/hw/sunLynx/Xext/Imakefile Sun Feb 19 10:51:21 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sunLynx/Xext/Imakefile,v 1.1 2006/02/19 15:51:21 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunLynxExcludedExtensions +#define LinkDirectory ../../../Xext + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../Xext/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sunLynx/dbe/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sunLynx/dbe/Imakefile:1.1 --- /dev/null Tue May 9 21:56:18 2006 +++ xc/programs/Xserver/hw/sunLynx/dbe/Imakefile Sun Feb 19 10:51:21 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sunLynx/dbe/Imakefile,v 1.1 2006/02/19 15:51:21 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunLynxExcludedExtensions +#define LinkDirectory ../../../dbe + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../dbe/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sunLynx/dix/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sunLynx/dix/Imakefile:1.1 --- /dev/null Tue May 9 21:56:18 2006 +++ xc/programs/Xserver/hw/sunLynx/dix/Imakefile Sun Feb 19 10:51:21 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sunLynx/dix/Imakefile,v 1.1 2006/02/19 15:51:21 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunLynxExcludedExtensions +#define LinkDirectory ../../../dix + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../dix/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sunLynx/os/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sunLynx/os/Imakefile:1.1 --- /dev/null Tue May 9 21:56:18 2006 +++ xc/programs/Xserver/hw/sunLynx/os/Imakefile Sun Feb 19 10:51:21 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sunLynx/os/Imakefile,v 1.1 2006/02/19 15:51:21 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunLynxExcludedExtensions +#define LinkDirectory ../../../os + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../os/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sunLynx/randr/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sunLynx/randr/Imakefile:1.1 --- /dev/null Tue May 9 21:56:18 2006 +++ xc/programs/Xserver/hw/sunLynx/randr/Imakefile Sun Feb 19 10:51:21 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sunLynx/randr/Imakefile,v 1.1 2006/02/19 15:51:21 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunLynxExcludedExtensions +#define LinkDirectory ../../../randr + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../randr/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sunLynx/record/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sunLynx/record/Imakefile:1.1 --- /dev/null Tue May 9 21:56:18 2006 +++ xc/programs/Xserver/hw/sunLynx/record/Imakefile Sun Feb 19 10:51:21 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sunLynx/record/Imakefile,v 1.1 2006/02/19 15:51:21 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunLynxExcludedExtensions +#define LinkDirectory ../../../record + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../record/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sunLynx/render/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sunLynx/render/Imakefile:1.1 --- /dev/null Tue May 9 21:56:18 2006 +++ xc/programs/Xserver/hw/sunLynx/render/Imakefile Sun Feb 19 10:51:21 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sunLynx/render/Imakefile,v 1.1 2006/02/19 15:51:21 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunLynxExcludedExtensions +#define LinkDirectory ../../../render + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../render/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/sunLynx/xkb/Imakefile diff -u /dev/null xc/programs/Xserver/hw/sunLynx/xkb/Imakefile:1.1 --- /dev/null Tue May 9 21:56:18 2006 +++ xc/programs/Xserver/hw/sunLynx/xkb/Imakefile Sun Feb 19 10:51:21 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/sunLynx/xkb/Imakefile,v 1.1 2006/02/19 15:51:21 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XsunLynxExcludedExtensions +#define LinkDirectory ../../../xkb + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../xkb/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/tinyx/Imakefile diff -u xc/programs/Xserver/hw/tinyx/Imakefile:1.4 xc/programs/Xserver/hw/tinyx/Imakefile:1.9 --- xc/programs/Xserver/hw/tinyx/Imakefile:1.4 Sat Mar 12 18:36:27 2005 +++ xc/programs/Xserver/hw/tinyx/Imakefile Fri Mar 3 11:43:14 2006 @@ -1,6 +1,6 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/Imakefile,v 1.4 2005/03/12 23:36:27 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/Imakefile,v 1.9 2006/03/03 16:43:14 tsi Exp $ /* - * Copyright (c) 2004, 2005 by The XFree86 Project, Inc. + * Copyright (c) 2004-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -48,9 +48,16 @@ #include "TinyX.tmpl" +#define IHaveSubdirs + #if BuildRender RENDERSRCS=txpict.c RENDEROBJS=txpict.o +RENDERSUBDIRS = render +#endif + +#if BuildRandR +RANDRSUBDIRS = randr #endif #if BuildXvExt @@ -58,6 +65,12 @@ XVOBJS=txxv.o #endif +#if (defined(XSavageServer) && XSavageServer) || \ + (defined(XIgsServer) && XIgsServer) +VGASRC = vga.c +VGAOBJ = vga.o +#endif + #ifdef TinyDIXDefines TINY_DEFINES = TinyDIXDefines #endif @@ -70,14 +83,16 @@ MTRR_DEFINES = -DHAS_MTRR #endif -DEFINES = $(IPAQ_DEFINES) $(TINY_DEFINES) $(MTRR_DEFINES) -UXFree86LOADER +SUBDIRS = sys dix os Xext $(RENDERSUBDIRS) $(RANDRSUBDIRS) + +DEFINES = $(EXT_DEFINES) $(IPAQ_DEFINES) $(TINY_DEFINES) $(MTRR_DEFINES) -SRCS = txaa.c txcmap.c txcolor.c tinyx.c txinfo.c txinput.c txmap.c txnoop.c \ - txtest.c vga.c txasync.c txmode.c txcurscol.c txshadow.c \ - $(RENDERSRCS) $(XVSRCS) miinitext.c stubs.c +SRCS = txaa.c txcmap.c tinyx.c txinfo.c txinput.c txmap.c txnoop.c \ + txtest.c $(VGASRC) txasync.c txmode.c txcurscol.c txshadow.c \ + $(RENDERSRCS) $(XVSRCS) miinitext.c -OBJS = txaa.o txcmap.o txcolor.o tinyx.o txinfo.o txinput.o txmap.o txnoop.o \ - txtest.o vga.o txasync.o txmode.o txcurscol.o txshadow.o \ +OBJS = txaa.o txcmap.o tinyx.o txinfo.o txinput.o txmap.o txnoop.o \ + txtest.o $(VGAOBJ) txasync.o txmode.o txcurscol.o txshadow.o \ $(RENDEROBJS) $(XVOBJS) INCLUDES = $(TINYXINCLUDES) @@ -85,13 +100,27 @@ NormalLibraryObjectRule() NormalLibraryTarget(tinyx,$(OBJS)) -SpecialCObjectRule(tinyx,,$(EXT_DEFINES) $(TINY_DEFINES)) - AllTarget(miinitext.o) LinkSourceFile(miinitext.c,$(SERVERSRC)/mi) -SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES) $(PAN_DEFINES) -DNO_MODULE_EXTS $(EXT_MODULE_DEFINES) $(TINY_DEFINES)) +SpecialCObjectRule(miinitext,$(ICONFIGFILES),NullParameter) + +TINYX_FONT_DEFS = TinyXFontDefines +#if TinyXSpeedo +TINYX_SPEEDO_DEFINES = -DBUILD_SPEEDO +#endif +#if TinyXType1 +TINYX_TYPE1_DEFINES = -DBUILD_TYPE1 +#endif +#if TinyXCID +TINYX_CID_DEFINES = -DBUILD_CID +#endif +#if TinyXFreeType +TINYX_FREETYPE_DEFINES = -DBUILD_FREETYPE +#endif + +TINY_FONT_DEFINES = $(TINYX_FONT_DEFS) $(TINYX_SPEEDO_DEFINES) \ + $(TINYX_TYPE1_DEFINES) $(TINYX_CID_DEFINES) $(TINYX_FREETYPE_DEFINES) -TINY_FONT_DEFINES = AllTarget(register.o) LinkSourceFile(register.c,$(FONTLIBSRC)/fontfile) @@ -100,10 +129,9 @@ LinkSourceFile(ffcheck.c,$(FONTLIBSRC)/fontfile) SpecialCObjectRule(ffcheck,$(ICONFIGFILES),-I$(FONTLIBSRC)/include $(TINY_FONT_DEFINES)) -AllTarget(stubs.o) -LinkSourceFile(stubs.c,$(SERVERSRC)/Xi) -SpecialCObjectRule(stubs,$(ICONFIGFILES),-UXINPUT) - InstallManPage(TinyX,$(MANDIR)) InstallManPageAliases(TinyX,$(MANDIR),Xchips Xi810 Xigs Xipaq Xmach64 Xsavage Xsis530 Xtrident Xtrio Xts300 Xkdrive kdrive) DependTarget() + +MakeSubdirs($(SUBDIRS)) +DependSubdirs($(SUBDIRS)) Index: xc/programs/Xserver/hw/tinyx/TinyX.tmpl diff -u xc/programs/Xserver/hw/tinyx/TinyX.tmpl:1.1 xc/programs/Xserver/hw/tinyx/TinyX.tmpl:1.2 --- xc/programs/Xserver/hw/tinyx/TinyX.tmpl:1.1 Wed Jun 2 18:43:00 2004 +++ xc/programs/Xserver/hw/tinyx/TinyX.tmpl Fri Oct 14 11:16:27 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/TinyX.tmpl,v 1.1 2004/06/02 22:43:00 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/TinyX.tmpl,v 1.2 2005/10/14 15:16:27 tsi Exp $ #include @@ -17,9 +17,9 @@ #endif TINYXINCLUDES = \ - -I$(TINYXSRC) $(OS_INCS) -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ + -I$(TINYXSRC) $(OS_INCS) \ -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/Xext \ -I$(SERVERSRC)/miext/shadow -I$(SERVERSRC)/miext/layer \ -I$(SERVERSRC)/include -I$(SERVERSRC)/os \ - -I$(EXTINCSRC) -I$(XINCLUDESRC) $(RENDERINCS) $(RANDRINCS) + $(RENDERINCS) $(RANDRINCS) Index: xc/programs/Xserver/hw/tinyx/asmio.h diff -u /dev/null xc/programs/Xserver/hw/tinyx/asmio.h:1.1 --- /dev/null Tue May 9 21:56:18 2006 +++ xc/programs/Xserver/hw/tinyx/asmio.h Fri Feb 24 10:31:29 2006 @@ -0,0 +1,65 @@ +/* $XFree86: xc/programs/Xserver/hw/tinyx/asmio.h,v 1.1 2006/02/24 15:31:29 tsi Exp $ */ +/* + * Copyright (c) 2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This file provides a default . It is assumed exists. + */ + +#ifndef _SYS_IO_H +#define _SYS_IO_H 1 + +#ifdef __GNUC__ +#undef inline +#define inline __inline__ +#endif + +#define extern static +#include +#undef extern + +#endif /* _SYS_IO_H */ Index: xc/programs/Xserver/hw/tinyx/tinyx.c diff -u xc/programs/Xserver/hw/tinyx/tinyx.c:1.1 xc/programs/Xserver/hw/tinyx/tinyx.c:1.2 --- xc/programs/Xserver/hw/tinyx/tinyx.c:1.1 Wed Jun 2 18:43:00 2004 +++ xc/programs/Xserver/hw/tinyx/tinyx.c Sun Feb 19 10:51:21 2006 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/tinyx/tinyx.c,v 1.1 2004/06/02 22:43:00 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/tinyx/tinyx.c,v 1.2 2006/02/19 15:51:21 tsi Exp $ * * Copyright © 1999 Keith Packard * @@ -22,7 +22,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ /* - * Copyright (c) 2004 by The XFree86 Project, Inc. + * Copyright (c) 2004-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -82,10 +82,6 @@ #include "txxv.h" #endif -#ifdef DPMSExtension -#include "dpmsproc.h" -#endif - CARD8 kdBpp[] = { 1, 4, 8, 16, 24, 32 }; #define NUM_KD_BPP (sizeof (kdBpp) / sizeof (kdBpp[0])) @@ -1018,9 +1014,6 @@ for (fb = 0; fb < KD_MAX_FB && screen->fb[fb].depth; fb++) pScreenPriv->bytesPerPixel[fb] = screen->fb[fb].bitsPerPixel >> 3; pScreenPriv->dpmsState = KD_DPMS_NORMAL; -#ifdef PANORAMIX - dixScreenOrigins[pScreen->myNum] = screen->origin; -#endif if (!monitorResolution) monitorResolution = 75; @@ -1379,48 +1372,3 @@ OsVendorFatalError() { } - -#ifdef XTESTEXT1 -void -XTestGenerateEvent(dev_type, keycode, keystate, mousex, mousey) - int dev_type; - int keycode; - int keystate; - int mousex; - int mousey; -{ -} - -void -XTestGetPointerPos(fmousex, fmousey) - short *fmousex, *fmousey; -{ -} - -void -XTestJumpPointer(jx, jy, dev_type) - int jx; - int jy; - int dev_type; -{ -} -#endif - -#ifdef DPMSExtension -void -DPMSSet(int level) -{ -} - -int -DPMSGet (int *level) -{ - return -1; -} - -Bool -DPMSSupported (void) -{ - return FALSE; -} -#endif Index: xc/programs/Xserver/hw/tinyx/tinyx.h diff -u xc/programs/Xserver/hw/tinyx/tinyx.h:1.1 xc/programs/Xserver/hw/tinyx/tinyx.h:1.2 --- xc/programs/Xserver/hw/tinyx/tinyx.h:1.1 Wed Jun 2 18:43:00 2004 +++ xc/programs/Xserver/hw/tinyx/tinyx.h Fri Oct 14 11:16:27 2005 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/tinyx.h,v 1.1 2004/06/02 22:43:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/tinyx.h,v 1.2 2005/10/14 15:16:27 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -68,10 +68,10 @@ */ #include -#include "X.h" +#include #define NEED_EVENTS -#include "Xproto.h" -#include "Xos.h" +#include +#include #include "scrnintstr.h" #include "pixmapstr.h" #include "windowstr.h" Index: xc/programs/Xserver/hw/tinyx/txaa.c diff -u xc/programs/Xserver/hw/tinyx/txaa.c:1.2 xc/programs/Xserver/hw/tinyx/txaa.c:1.3 --- xc/programs/Xserver/hw/tinyx/txaa.c:1.2 Wed Jun 23 15:40:15 2004 +++ xc/programs/Xserver/hw/tinyx/txaa.c Fri Oct 14 11:16:27 2005 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/tinyx/txaa.c,v 1.2 2004/06/23 19:40:15 tsi Exp $ + * $XFree86: xc/programs/Xserver/hw/tinyx/txaa.c,v 1.3 2005/10/14 15:16:27 tsi Exp $ * * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc. * @@ -69,7 +69,7 @@ */ #include "tinyx.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" int kaaGeneration; Index: xc/programs/Xserver/hw/tinyx/txcolor.c diff -u xc/programs/Xserver/hw/tinyx/txcolor.c:1.1 xc/programs/Xserver/hw/tinyx/txcolor.c:removed --- xc/programs/Xserver/hw/tinyx/txcolor.c:1.1 Wed Jun 2 18:43:00 2004 +++ xc/programs/Xserver/hw/tinyx/txcolor.c Tue May 9 21:56:19 2006 @@ -1,925 +0,0 @@ -/* - * Copyright © 1999 Keith Packard - * - * 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 Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/txcolor.c,v 1.1 2004/06/02 22:43:00 dawes Exp $ */ -/* - * Copyright (c) 2004 by 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: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution, and in the same place and form as other copyright, - * license and disclaimer information. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: "This product - * includes software developed by The XFree86 Project, Inc - * (http://www.xfree86.org/) and its contributors", in the same - * place and form as other third-party acknowledgments. Alternately, - * this acknowledgment may appear in the software itself, in the - * same form and location as other such third-party acknowledgments. - * - * 4. Except as contained in this notice, the name of The XFree86 - * Project, Inc 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, Inc. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "tinyx.h" -#include -#include "os.h" -#include "opaque.h" -#include - -static unsigned char -KdToLower (unsigned char a) -{ - if ((a >= XK_A) && (a <= XK_Z)) - return a + (XK_a - XK_A); - else if ((a >= XK_Agrave) && (a <= XK_Odiaeresis)) - return a + (XK_agrave - XK_Agrave); - else if ((a >= XK_Ooblique) && (a <= XK_Thorn)) - return a + (XK_oslash - XK_Ooblique); - else - return a; -} - -static int -KdStrCaseCmp (const char *s1, const char *s2, int l2) -{ - unsigned char c1, c2; - - for (;;) - { - c1 = KdToLower (*s1++); - if (l2 == 0) - c2 = '\0'; - else - c2 = KdToLower (*s2++); - if (!c1 || !c2) - break; - if (c1 != c2) - break; - l2--; - } - return (int)c2 - (int)c1; -} - -typedef struct _kdNamedColor { - unsigned short red; - unsigned short green; - unsigned short blue; - const char *name; -} KdNamedColor; - -#define C 0x101 - -const KdNamedColor KdColors[] = { - { 240*C, 248*C, 255*C, "alice blue" }, - { 240*C, 248*C, 255*C, "AliceBlue" }, - { 250*C, 235*C, 215*C, "antique white" }, - { 250*C, 235*C, 215*C, "AntiqueWhite" }, - { 255*C, 239*C, 219*C, "AntiqueWhite1" }, - { 238*C, 223*C, 204*C, "AntiqueWhite2" }, - { 205*C, 192*C, 176*C, "AntiqueWhite3" }, - { 139*C, 131*C, 120*C, "AntiqueWhite4" }, - { 127*C, 255*C, 212*C, "aquamarine" }, - { 127*C, 255*C, 212*C, "aquamarine1" }, - { 118*C, 238*C, 198*C, "aquamarine2" }, - { 102*C, 205*C, 170*C, "aquamarine3" }, - { 69*C, 139*C, 116*C, "aquamarine4" }, - { 240*C, 255*C, 255*C, "azure" }, - { 240*C, 255*C, 255*C, "azure1" }, - { 224*C, 238*C, 238*C, "azure2" }, - { 193*C, 205*C, 205*C, "azure3" }, - { 131*C, 139*C, 139*C, "azure4" }, - { 245*C, 245*C, 220*C, "beige" }, - { 255*C, 228*C, 196*C, "bisque" }, - { 255*C, 228*C, 196*C, "bisque1" }, - { 238*C, 213*C, 183*C, "bisque2" }, - { 205*C, 183*C, 158*C, "bisque3" }, - { 139*C, 125*C, 107*C, "bisque4" }, - { 0*C, 0*C, 0*C, "black" }, - { 255*C, 235*C, 205*C, "blanched almond" }, - { 255*C, 235*C, 205*C, "BlanchedAlmond" }, - { 0*C, 0*C, 255*C, "blue" }, - { 138*C, 43*C, 226*C, "blue violet" }, - { 0*C, 0*C, 255*C, "blue1" }, - { 0*C, 0*C, 238*C, "blue2" }, - { 0*C, 0*C, 205*C, "blue3" }, - { 0*C, 0*C, 139*C, "blue4" }, - { 138*C, 43*C, 226*C, "BlueViolet" }, - { 165*C, 42*C, 42*C, "brown" }, - { 255*C, 64*C, 64*C, "brown1" }, - { 238*C, 59*C, 59*C, "brown2" }, - { 205*C, 51*C, 51*C, "brown3" }, - { 139*C, 35*C, 35*C, "brown4" }, - { 222*C, 184*C, 135*C, "burlywood" }, - { 255*C, 211*C, 155*C, "burlywood1" }, - { 238*C, 197*C, 145*C, "burlywood2" }, - { 205*C, 170*C, 125*C, "burlywood3" }, - { 139*C, 115*C, 85*C, "burlywood4" }, - { 95*C, 158*C, 160*C, "cadet blue" }, - { 95*C, 158*C, 160*C, "CadetBlue" }, - { 152*C, 245*C, 255*C, "CadetBlue1" }, - { 142*C, 229*C, 238*C, "CadetBlue2" }, - { 122*C, 197*C, 205*C, "CadetBlue3" }, - { 83*C, 134*C, 139*C, "CadetBlue4" }, - { 127*C, 255*C, 0*C, "chartreuse" }, - { 127*C, 255*C, 0*C, "chartreuse1" }, - { 118*C, 238*C, 0*C, "chartreuse2" }, - { 102*C, 205*C, 0*C, "chartreuse3" }, - { 69*C, 139*C, 0*C, "chartreuse4" }, - { 210*C, 105*C, 30*C, "chocolate" }, - { 255*C, 127*C, 36*C, "chocolate1" }, - { 238*C, 118*C, 33*C, "chocolate2" }, - { 205*C, 102*C, 29*C, "chocolate3" }, - { 139*C, 69*C, 19*C, "chocolate4" }, - { 255*C, 127*C, 80*C, "coral" }, - { 255*C, 114*C, 86*C, "coral1" }, - { 238*C, 106*C, 80*C, "coral2" }, - { 205*C, 91*C, 69*C, "coral3" }, - { 139*C, 62*C, 47*C, "coral4" }, - { 100*C, 149*C, 237*C, "cornflower blue" }, - { 100*C, 149*C, 237*C, "CornflowerBlue" }, - { 255*C, 248*C, 220*C, "cornsilk" }, - { 255*C, 248*C, 220*C, "cornsilk1" }, - { 238*C, 232*C, 205*C, "cornsilk2" }, - { 205*C, 200*C, 177*C, "cornsilk3" }, - { 139*C, 136*C, 120*C, "cornsilk4" }, - { 0*C, 255*C, 255*C, "cyan" }, - { 0*C, 255*C, 255*C, "cyan1" }, - { 0*C, 238*C, 238*C, "cyan2" }, - { 0*C, 205*C, 205*C, "cyan3" }, - { 0*C, 139*C, 139*C, "cyan4" }, - { 0*C, 0*C, 139*C, "dark blue" }, - { 0*C, 139*C, 139*C, "dark cyan" }, - { 184*C, 134*C, 11*C, "dark goldenrod" }, - { 169*C, 169*C, 169*C, "dark gray" }, - { 0*C, 100*C, 0*C, "dark green" }, - { 169*C, 169*C, 169*C, "dark grey" }, - { 189*C, 183*C, 107*C, "dark khaki" }, - { 139*C, 0*C, 139*C, "dark magenta" }, - { 85*C, 107*C, 47*C, "dark olive green" }, - { 255*C, 140*C, 0*C, "dark orange" }, - { 153*C, 50*C, 204*C, "dark orchid" }, - { 139*C, 0*C, 0*C, "dark red" }, - { 233*C, 150*C, 122*C, "dark salmon" }, - { 143*C, 188*C, 143*C, "dark sea green" }, - { 72*C, 61*C, 139*C, "dark slate blue" }, - { 47*C, 79*C, 79*C, "dark slate gray" }, - { 47*C, 79*C, 79*C, "dark slate grey" }, - { 0*C, 206*C, 209*C, "dark turquoise" }, - { 148*C, 0*C, 211*C, "dark violet" }, - { 0*C, 0*C, 139*C, "DarkBlue" }, - { 0*C, 139*C, 139*C, "DarkCyan" }, - { 184*C, 134*C, 11*C, "DarkGoldenrod" }, - { 255*C, 185*C, 15*C, "DarkGoldenrod1" }, - { 238*C, 173*C, 14*C, "DarkGoldenrod2" }, - { 205*C, 149*C, 12*C, "DarkGoldenrod3" }, - { 139*C, 101*C, 8*C, "DarkGoldenrod4" }, - { 169*C, 169*C, 169*C, "DarkGray" }, - { 0*C, 100*C, 0*C, "DarkGreen" }, - { 169*C, 169*C, 169*C, "DarkGrey" }, - { 189*C, 183*C, 107*C, "DarkKhaki" }, - { 139*C, 0*C, 139*C, "DarkMagenta" }, - { 85*C, 107*C, 47*C, "DarkOliveGreen" }, - { 202*C, 255*C, 112*C, "DarkOliveGreen1" }, - { 188*C, 238*C, 104*C, "DarkOliveGreen2" }, - { 162*C, 205*C, 90*C, "DarkOliveGreen3" }, - { 110*C, 139*C, 61*C, "DarkOliveGreen4" }, - { 255*C, 140*C, 0*C, "DarkOrange" }, - { 255*C, 127*C, 0*C, "DarkOrange1" }, - { 238*C, 118*C, 0*C, "DarkOrange2" }, - { 205*C, 102*C, 0*C, "DarkOrange3" }, - { 139*C, 69*C, 0*C, "DarkOrange4" }, - { 153*C, 50*C, 204*C, "DarkOrchid" }, - { 191*C, 62*C, 255*C, "DarkOrchid1" }, - { 178*C, 58*C, 238*C, "DarkOrchid2" }, - { 154*C, 50*C, 205*C, "DarkOrchid3" }, - { 104*C, 34*C, 139*C, "DarkOrchid4" }, - { 139*C, 0*C, 0*C, "DarkRed" }, - { 233*C, 150*C, 122*C, "DarkSalmon" }, - { 143*C, 188*C, 143*C, "DarkSeaGreen" }, - { 193*C, 255*C, 193*C, "DarkSeaGreen1" }, - { 180*C, 238*C, 180*C, "DarkSeaGreen2" }, - { 155*C, 205*C, 155*C, "DarkSeaGreen3" }, - { 105*C, 139*C, 105*C, "DarkSeaGreen4" }, - { 72*C, 61*C, 139*C, "DarkSlateBlue" }, - { 47*C, 79*C, 79*C, "DarkSlateGray" }, - { 151*C, 255*C, 255*C, "DarkSlateGray1" }, - { 141*C, 238*C, 238*C, "DarkSlateGray2" }, - { 121*C, 205*C, 205*C, "DarkSlateGray3" }, - { 82*C, 139*C, 139*C, "DarkSlateGray4" }, - { 47*C, 79*C, 79*C, "DarkSlateGrey" }, - { 0*C, 206*C, 209*C, "DarkTurquoise" }, - { 148*C, 0*C, 211*C, "DarkViolet" }, - { 255*C, 20*C, 147*C, "deep pink" }, - { 0*C, 191*C, 255*C, "deep sky blue" }, - { 255*C, 20*C, 147*C, "DeepPink" }, - { 255*C, 20*C, 147*C, "DeepPink1" }, - { 238*C, 18*C, 137*C, "DeepPink2" }, - { 205*C, 16*C, 118*C, "DeepPink3" }, - { 139*C, 10*C, 80*C, "DeepPink4" }, - { 0*C, 191*C, 255*C, "DeepSkyBlue" }, - { 0*C, 191*C, 255*C, "DeepSkyBlue1" }, - { 0*C, 178*C, 238*C, "DeepSkyBlue2" }, - { 0*C, 154*C, 205*C, "DeepSkyBlue3" }, - { 0*C, 104*C, 139*C, "DeepSkyBlue4" }, - { 105*C, 105*C, 105*C, "dim gray" }, - { 105*C, 105*C, 105*C, "dim grey" }, - { 105*C, 105*C, 105*C, "DimGray" }, - { 105*C, 105*C, 105*C, "DimGrey" }, - { 30*C, 144*C, 255*C, "dodger blue" }, - { 30*C, 144*C, 255*C, "DodgerBlue" }, - { 30*C, 144*C, 255*C, "DodgerBlue1" }, - { 28*C, 134*C, 238*C, "DodgerBlue2" }, - { 24*C, 116*C, 205*C, "DodgerBlue3" }, - { 16*C, 78*C, 139*C, "DodgerBlue4" }, - { 178*C, 34*C, 34*C, "firebrick" }, - { 255*C, 48*C, 48*C, "firebrick1" }, - { 238*C, 44*C, 44*C, "firebrick2" }, - { 205*C, 38*C, 38*C, "firebrick3" }, - { 139*C, 26*C, 26*C, "firebrick4" }, - { 255*C, 250*C, 240*C, "floral white" }, - { 255*C, 250*C, 240*C, "FloralWhite" }, - { 34*C, 139*C, 34*C, "forest green" }, - { 34*C, 139*C, 34*C, "ForestGreen" }, - { 220*C, 220*C, 220*C, "gainsboro" }, - { 248*C, 248*C, 255*C, "ghost white" }, - { 248*C, 248*C, 255*C, "GhostWhite" }, - { 255*C, 215*C, 0*C, "gold" }, - { 255*C, 215*C, 0*C, "gold1" }, - { 238*C, 201*C, 0*C, "gold2" }, - { 205*C, 173*C, 0*C, "gold3" }, - { 139*C, 117*C, 0*C, "gold4" }, - { 218*C, 165*C, 32*C, "goldenrod" }, - { 255*C, 193*C, 37*C, "goldenrod1" }, - { 238*C, 180*C, 34*C, "goldenrod2" }, - { 205*C, 155*C, 29*C, "goldenrod3" }, - { 139*C, 105*C, 20*C, "goldenrod4" }, - { 190*C, 190*C, 190*C, "gray" }, - { 0*C, 0*C, 0*C, "gray0" }, - { 3*C, 3*C, 3*C, "gray1" }, - { 26*C, 26*C, 26*C, "gray10" }, - { 255*C, 255*C, 255*C, "gray100" }, - { 28*C, 28*C, 28*C, "gray11" }, - { 31*C, 31*C, 31*C, "gray12" }, - { 33*C, 33*C, 33*C, "gray13" }, - { 36*C, 36*C, 36*C, "gray14" }, - { 38*C, 38*C, 38*C, "gray15" }, - { 41*C, 41*C, 41*C, "gray16" }, - { 43*C, 43*C, 43*C, "gray17" }, - { 46*C, 46*C, 46*C, "gray18" }, - { 48*C, 48*C, 48*C, "gray19" }, - { 5*C, 5*C, 5*C, "gray2" }, - { 51*C, 51*C, 51*C, "gray20" }, - { 54*C, 54*C, 54*C, "gray21" }, - { 56*C, 56*C, 56*C, "gray22" }, - { 59*C, 59*C, 59*C, "gray23" }, - { 61*C, 61*C, 61*C, "gray24" }, - { 64*C, 64*C, 64*C, "gray25" }, - { 66*C, 66*C, 66*C, "gray26" }, - { 69*C, 69*C, 69*C, "gray27" }, - { 71*C, 71*C, 71*C, "gray28" }, - { 74*C, 74*C, 74*C, "gray29" }, - { 8*C, 8*C, 8*C, "gray3" }, - { 77*C, 77*C, 77*C, "gray30" }, - { 79*C, 79*C, 79*C, "gray31" }, - { 82*C, 82*C, 82*C, "gray32" }, - { 84*C, 84*C, 84*C, "gray33" }, - { 87*C, 87*C, 87*C, "gray34" }, - { 89*C, 89*C, 89*C, "gray35" }, - { 92*C, 92*C, 92*C, "gray36" }, - { 94*C, 94*C, 94*C, "gray37" }, - { 97*C, 97*C, 97*C, "gray38" }, - { 99*C, 99*C, 99*C, "gray39" }, - { 10*C, 10*C, 10*C, "gray4" }, - { 102*C, 102*C, 102*C, "gray40" }, - { 105*C, 105*C, 105*C, "gray41" }, - { 107*C, 107*C, 107*C, "gray42" }, - { 110*C, 110*C, 110*C, "gray43" }, - { 112*C, 112*C, 112*C, "gray44" }, - { 115*C, 115*C, 115*C, "gray45" }, - { 117*C, 117*C, 117*C, "gray46" }, - { 120*C, 120*C, 120*C, "gray47" }, - { 122*C, 122*C, 122*C, "gray48" }, - { 125*C, 125*C, 125*C, "gray49" }, - { 13*C, 13*C, 13*C, "gray5" }, - { 127*C, 127*C, 127*C, "gray50" }, - { 130*C, 130*C, 130*C, "gray51" }, - { 133*C, 133*C, 133*C, "gray52" }, - { 135*C, 135*C, 135*C, "gray53" }, - { 138*C, 138*C, 138*C, "gray54" }, - { 140*C, 140*C, 140*C, "gray55" }, - { 143*C, 143*C, 143*C, "gray56" }, - { 145*C, 145*C, 145*C, "gray57" }, - { 148*C, 148*C, 148*C, "gray58" }, - { 150*C, 150*C, 150*C, "gray59" }, - { 15*C, 15*C, 15*C, "gray6" }, - { 153*C, 153*C, 153*C, "gray60" }, - { 156*C, 156*C, 156*C, "gray61" }, - { 158*C, 158*C, 158*C, "gray62" }, - { 161*C, 161*C, 161*C, "gray63" }, - { 163*C, 163*C, 163*C, "gray64" }, - { 166*C, 166*C, 166*C, "gray65" }, - { 168*C, 168*C, 168*C, "gray66" }, - { 171*C, 171*C, 171*C, "gray67" }, - { 173*C, 173*C, 173*C, "gray68" }, - { 176*C, 176*C, 176*C, "gray69" }, - { 18*C, 18*C, 18*C, "gray7" }, - { 179*C, 179*C, 179*C, "gray70" }, - { 181*C, 181*C, 181*C, "gray71" }, - { 184*C, 184*C, 184*C, "gray72" }, - { 186*C, 186*C, 186*C, "gray73" }, - { 189*C, 189*C, 189*C, "gray74" }, - { 191*C, 191*C, 191*C, "gray75" }, - { 194*C, 194*C, 194*C, "gray76" }, - { 196*C, 196*C, 196*C, "gray77" }, - { 199*C, 199*C, 199*C, "gray78" }, - { 201*C, 201*C, 201*C, "gray79" }, - { 20*C, 20*C, 20*C, "gray8" }, - { 204*C, 204*C, 204*C, "gray80" }, - { 207*C, 207*C, 207*C, "gray81" }, - { 209*C, 209*C, 209*C, "gray82" }, - { 212*C, 212*C, 212*C, "gray83" }, - { 214*C, 214*C, 214*C, "gray84" }, - { 217*C, 217*C, 217*C, "gray85" }, - { 219*C, 219*C, 219*C, "gray86" }, - { 222*C, 222*C, 222*C, "gray87" }, - { 224*C, 224*C, 224*C, "gray88" }, - { 227*C, 227*C, 227*C, "gray89" }, - { 23*C, 23*C, 23*C, "gray9" }, - { 229*C, 229*C, 229*C, "gray90" }, - { 232*C, 232*C, 232*C, "gray91" }, - { 235*C, 235*C, 235*C, "gray92" }, - { 237*C, 237*C, 237*C, "gray93" }, - { 240*C, 240*C, 240*C, "gray94" }, - { 242*C, 242*C, 242*C, "gray95" }, - { 245*C, 245*C, 245*C, "gray96" }, - { 247*C, 247*C, 247*C, "gray97" }, - { 250*C, 250*C, 250*C, "gray98" }, - { 252*C, 252*C, 252*C, "gray99" }, - { 0*C, 255*C, 0*C, "green" }, - { 173*C, 255*C, 47*C, "green yellow" }, - { 0*C, 255*C, 0*C, "green1" }, - { 0*C, 238*C, 0*C, "green2" }, - { 0*C, 205*C, 0*C, "green3" }, - { 0*C, 139*C, 0*C, "green4" }, - { 173*C, 255*C, 47*C, "GreenYellow" }, - { 190*C, 190*C, 190*C, "grey" }, - { 0*C, 0*C, 0*C, "grey0" }, - { 3*C, 3*C, 3*C, "grey1" }, - { 26*C, 26*C, 26*C, "grey10" }, - { 255*C, 255*C, 255*C, "grey100" }, - { 28*C, 28*C, 28*C, "grey11" }, - { 31*C, 31*C, 31*C, "grey12" }, - { 33*C, 33*C, 33*C, "grey13" }, - { 36*C, 36*C, 36*C, "grey14" }, - { 38*C, 38*C, 38*C, "grey15" }, - { 41*C, 41*C, 41*C, "grey16" }, - { 43*C, 43*C, 43*C, "grey17" }, - { 46*C, 46*C, 46*C, "grey18" }, - { 48*C, 48*C, 48*C, "grey19" }, - { 5*C, 5*C, 5*C, "grey2" }, - { 51*C, 51*C, 51*C, "grey20" }, - { 54*C, 54*C, 54*C, "grey21" }, - { 56*C, 56*C, 56*C, "grey22" }, - { 59*C, 59*C, 59*C, "grey23" }, - { 61*C, 61*C, 61*C, "grey24" }, - { 64*C, 64*C, 64*C, "grey25" }, - { 66*C, 66*C, 66*C, "grey26" }, - { 69*C, 69*C, 69*C, "grey27" }, - { 71*C, 71*C, 71*C, "grey28" }, - { 74*C, 74*C, 74*C, "grey29" }, - { 8*C, 8*C, 8*C, "grey3" }, - { 77*C, 77*C, 77*C, "grey30" }, - { 79*C, 79*C, 79*C, "grey31" }, - { 82*C, 82*C, 82*C, "grey32" }, - { 84*C, 84*C, 84*C, "grey33" }, - { 87*C, 87*C, 87*C, "grey34" }, - { 89*C, 89*C, 89*C, "grey35" }, - { 92*C, 92*C, 92*C, "grey36" }, - { 94*C, 94*C, 94*C, "grey37" }, - { 97*C, 97*C, 97*C, "grey38" }, - { 99*C, 99*C, 99*C, "grey39" }, - { 10*C, 10*C, 10*C, "grey4" }, - { 102*C, 102*C, 102*C, "grey40" }, - { 105*C, 105*C, 105*C, "grey41" }, - { 107*C, 107*C, 107*C, "grey42" }, - { 110*C, 110*C, 110*C, "grey43" }, - { 112*C, 112*C, 112*C, "grey44" }, - { 115*C, 115*C, 115*C, "grey45" }, - { 117*C, 117*C, 117*C, "grey46" }, - { 120*C, 120*C, 120*C, "grey47" }, - { 122*C, 122*C, 122*C, "grey48" }, - { 125*C, 125*C, 125*C, "grey49" }, - { 13*C, 13*C, 13*C, "grey5" }, - { 127*C, 127*C, 127*C, "grey50" }, - { 130*C, 130*C, 130*C, "grey51" }, - { 133*C, 133*C, 133*C, "grey52" }, - { 135*C, 135*C, 135*C, "grey53" }, - { 138*C, 138*C, 138*C, "grey54" }, - { 140*C, 140*C, 140*C, "grey55" }, - { 143*C, 143*C, 143*C, "grey56" }, - { 145*C, 145*C, 145*C, "grey57" }, - { 148*C, 148*C, 148*C, "grey58" }, - { 150*C, 150*C, 150*C, "grey59" }, - { 15*C, 15*C, 15*C, "grey6" }, - { 153*C, 153*C, 153*C, "grey60" }, - { 156*C, 156*C, 156*C, "grey61" }, - { 158*C, 158*C, 158*C, "grey62" }, - { 161*C, 161*C, 161*C, "grey63" }, - { 163*C, 163*C, 163*C, "grey64" }, - { 166*C, 166*C, 166*C, "grey65" }, - { 168*C, 168*C, 168*C, "grey66" }, - { 171*C, 171*C, 171*C, "grey67" }, - { 173*C, 173*C, 173*C, "grey68" }, - { 176*C, 176*C, 176*C, "grey69" }, - { 18*C, 18*C, 18*C, "grey7" }, - { 179*C, 179*C, 179*C, "grey70" }, - { 181*C, 181*C, 181*C, "grey71" }, - { 184*C, 184*C, 184*C, "grey72" }, - { 186*C, 186*C, 186*C, "grey73" }, - { 189*C, 189*C, 189*C, "grey74" }, - { 191*C, 191*C, 191*C, "grey75" }, - { 194*C, 194*C, 194*C, "grey76" }, - { 196*C, 196*C, 196*C, "grey77" }, - { 199*C, 199*C, 199*C, "grey78" }, - { 201*C, 201*C, 201*C, "grey79" }, - { 20*C, 20*C, 20*C, "grey8" }, - { 204*C, 204*C, 204*C, "grey80" }, - { 207*C, 207*C, 207*C, "grey81" }, - { 209*C, 209*C, 209*C, "grey82" }, - { 212*C, 212*C, 212*C, "grey83" }, - { 214*C, 214*C, 214*C, "grey84" }, - { 217*C, 217*C, 217*C, "grey85" }, - { 219*C, 219*C, 219*C, "grey86" }, - { 222*C, 222*C, 222*C, "grey87" }, - { 224*C, 224*C, 224*C, "grey88" }, - { 227*C, 227*C, 227*C, "grey89" }, - { 23*C, 23*C, 23*C, "grey9" }, - { 229*C, 229*C, 229*C, "grey90" }, - { 232*C, 232*C, 232*C, "grey91" }, - { 235*C, 235*C, 235*C, "grey92" }, - { 237*C, 237*C, 237*C, "grey93" }, - { 240*C, 240*C, 240*C, "grey94" }, - { 242*C, 242*C, 242*C, "grey95" }, - { 245*C, 245*C, 245*C, "grey96" }, - { 247*C, 247*C, 247*C, "grey97" }, - { 250*C, 250*C, 250*C, "grey98" }, - { 252*C, 252*C, 252*C, "grey99" }, - { 240*C, 255*C, 240*C, "honeydew" }, - { 240*C, 255*C, 240*C, "honeydew1" }, - { 224*C, 238*C, 224*C, "honeydew2" }, - { 193*C, 205*C, 193*C, "honeydew3" }, - { 131*C, 139*C, 131*C, "honeydew4" }, - { 255*C, 105*C, 180*C, "hot pink" }, - { 255*C, 105*C, 180*C, "HotPink" }, - { 255*C, 110*C, 180*C, "HotPink1" }, - { 238*C, 106*C, 167*C, "HotPink2" }, - { 205*C, 96*C, 144*C, "HotPink3" }, - { 139*C, 58*C, 98*C, "HotPink4" }, - { 205*C, 92*C, 92*C, "indian red" }, - { 205*C, 92*C, 92*C, "IndianRed" }, - { 255*C, 106*C, 106*C, "IndianRed1" }, - { 238*C, 99*C, 99*C, "IndianRed2" }, - { 205*C, 85*C, 85*C, "IndianRed3" }, - { 139*C, 58*C, 58*C, "IndianRed4" }, - { 255*C, 255*C, 240*C, "ivory" }, - { 255*C, 255*C, 240*C, "ivory1" }, - { 238*C, 238*C, 224*C, "ivory2" }, - { 205*C, 205*C, 193*C, "ivory3" }, - { 139*C, 139*C, 131*C, "ivory4" }, - { 240*C, 230*C, 140*C, "khaki" }, - { 255*C, 246*C, 143*C, "khaki1" }, - { 238*C, 230*C, 133*C, "khaki2" }, - { 205*C, 198*C, 115*C, "khaki3" }, - { 139*C, 134*C, 78*C, "khaki4" }, - { 230*C, 230*C, 250*C, "lavender" }, - { 255*C, 240*C, 245*C, "lavender blush" }, - { 255*C, 240*C, 245*C, "LavenderBlush" }, - { 255*C, 240*C, 245*C, "LavenderBlush1" }, - { 238*C, 224*C, 229*C, "LavenderBlush2" }, - { 205*C, 193*C, 197*C, "LavenderBlush3" }, - { 139*C, 131*C, 134*C, "LavenderBlush4" }, - { 124*C, 252*C, 0*C, "lawn green" }, - { 124*C, 252*C, 0*C, "LawnGreen" }, - { 255*C, 250*C, 205*C, "lemon chiffon" }, - { 255*C, 250*C, 205*C, "LemonChiffon" }, - { 255*C, 250*C, 205*C, "LemonChiffon1" }, - { 238*C, 233*C, 191*C, "LemonChiffon2" }, - { 205*C, 201*C, 165*C, "LemonChiffon3" }, - { 139*C, 137*C, 112*C, "LemonChiffon4" }, - { 173*C, 216*C, 230*C, "light blue" }, - { 240*C, 128*C, 128*C, "light coral" }, - { 224*C, 255*C, 255*C, "light cyan" }, - { 238*C, 221*C, 130*C, "light goldenrod" }, - { 250*C, 250*C, 210*C, "light goldenrod yellow" }, - { 211*C, 211*C, 211*C, "light gray" }, - { 144*C, 238*C, 144*C, "light green" }, - { 211*C, 211*C, 211*C, "light grey" }, - { 255*C, 182*C, 193*C, "light pink" }, - { 255*C, 160*C, 122*C, "light salmon" }, - { 32*C, 178*C, 170*C, "light sea green" }, - { 135*C, 206*C, 250*C, "light sky blue" }, - { 132*C, 112*C, 255*C, "light slate blue" }, - { 119*C, 136*C, 153*C, "light slate gray" }, - { 119*C, 136*C, 153*C, "light slate grey" }, - { 176*C, 196*C, 222*C, "light steel blue" }, - { 255*C, 255*C, 224*C, "light yellow" }, - { 173*C, 216*C, 230*C, "LightBlue" }, - { 191*C, 239*C, 255*C, "LightBlue1" }, - { 178*C, 223*C, 238*C, "LightBlue2" }, - { 154*C, 192*C, 205*C, "LightBlue3" }, - { 104*C, 131*C, 139*C, "LightBlue4" }, - { 240*C, 128*C, 128*C, "LightCoral" }, - { 224*C, 255*C, 255*C, "LightCyan" }, - { 224*C, 255*C, 255*C, "LightCyan1" }, - { 209*C, 238*C, 238*C, "LightCyan2" }, - { 180*C, 205*C, 205*C, "LightCyan3" }, - { 122*C, 139*C, 139*C, "LightCyan4" }, - { 238*C, 221*C, 130*C, "LightGoldenrod" }, - { 255*C, 236*C, 139*C, "LightGoldenrod1" }, - { 238*C, 220*C, 130*C, "LightGoldenrod2" }, - { 205*C, 190*C, 112*C, "LightGoldenrod3" }, - { 139*C, 129*C, 76*C, "LightGoldenrod4" }, - { 250*C, 250*C, 210*C, "LightGoldenrodYellow" }, - { 211*C, 211*C, 211*C, "LightGray" }, - { 144*C, 238*C, 144*C, "LightGreen" }, - { 211*C, 211*C, 211*C, "LightGrey" }, - { 255*C, 182*C, 193*C, "LightPink" }, - { 255*C, 174*C, 185*C, "LightPink1" }, - { 238*C, 162*C, 173*C, "LightPink2" }, - { 205*C, 140*C, 149*C, "LightPink3" }, - { 139*C, 95*C, 101*C, "LightPink4" }, - { 255*C, 160*C, 122*C, "LightSalmon" }, - { 255*C, 160*C, 122*C, "LightSalmon1" }, - { 238*C, 149*C, 114*C, "LightSalmon2" }, - { 205*C, 129*C, 98*C, "LightSalmon3" }, - { 139*C, 87*C, 66*C, "LightSalmon4" }, - { 32*C, 178*C, 170*C, "LightSeaGreen" }, - { 135*C, 206*C, 250*C, "LightSkyBlue" }, - { 176*C, 226*C, 255*C, "LightSkyBlue1" }, - { 164*C, 211*C, 238*C, "LightSkyBlue2" }, - { 141*C, 182*C, 205*C, "LightSkyBlue3" }, - { 96*C, 123*C, 139*C, "LightSkyBlue4" }, - { 132*C, 112*C, 255*C, "LightSlateBlue" }, - { 119*C, 136*C, 153*C, "LightSlateGray" }, - { 119*C, 136*C, 153*C, "LightSlateGrey" }, - { 176*C, 196*C, 222*C, "LightSteelBlue" }, - { 202*C, 225*C, 255*C, "LightSteelBlue1" }, - { 188*C, 210*C, 238*C, "LightSteelBlue2" }, - { 162*C, 181*C, 205*C, "LightSteelBlue3" }, - { 110*C, 123*C, 139*C, "LightSteelBlue4" }, - { 255*C, 255*C, 224*C, "LightYellow" }, - { 255*C, 255*C, 224*C, "LightYellow1" }, - { 238*C, 238*C, 209*C, "LightYellow2" }, - { 205*C, 205*C, 180*C, "LightYellow3" }, - { 139*C, 139*C, 122*C, "LightYellow4" }, - { 50*C, 205*C, 50*C, "lime green" }, - { 50*C, 205*C, 50*C, "LimeGreen" }, - { 250*C, 240*C, 230*C, "linen" }, - { 255*C, 0*C, 255*C, "magenta" }, - { 255*C, 0*C, 255*C, "magenta1" }, - { 238*C, 0*C, 238*C, "magenta2" }, - { 205*C, 0*C, 205*C, "magenta3" }, - { 139*C, 0*C, 139*C, "magenta4" }, - { 176*C, 48*C, 96*C, "maroon" }, - { 255*C, 52*C, 179*C, "maroon1" }, - { 238*C, 48*C, 167*C, "maroon2" }, - { 205*C, 41*C, 144*C, "maroon3" }, - { 139*C, 28*C, 98*C, "maroon4" }, - { 102*C, 205*C, 170*C, "medium aquamarine" }, - { 0*C, 0*C, 205*C, "medium blue" }, - { 186*C, 85*C, 211*C, "medium orchid" }, - { 147*C, 112*C, 219*C, "medium purple" }, - { 60*C, 179*C, 113*C, "medium sea green" }, - { 123*C, 104*C, 238*C, "medium slate blue" }, - { 0*C, 250*C, 154*C, "medium spring green" }, - { 72*C, 209*C, 204*C, "medium turquoise" }, - { 199*C, 21*C, 133*C, "medium violet red" }, - { 102*C, 205*C, 170*C, "MediumAquamarine" }, - { 0*C, 0*C, 205*C, "MediumBlue" }, - { 186*C, 85*C, 211*C, "MediumOrchid" }, - { 224*C, 102*C, 255*C, "MediumOrchid1" }, - { 209*C, 95*C, 238*C, "MediumOrchid2" }, - { 180*C, 82*C, 205*C, "MediumOrchid3" }, - { 122*C, 55*C, 139*C, "MediumOrchid4" }, - { 147*C, 112*C, 219*C, "MediumPurple" }, - { 171*C, 130*C, 255*C, "MediumPurple1" }, - { 159*C, 121*C, 238*C, "MediumPurple2" }, - { 137*C, 104*C, 205*C, "MediumPurple3" }, - { 93*C, 71*C, 139*C, "MediumPurple4" }, - { 60*C, 179*C, 113*C, "MediumSeaGreen" }, - { 123*C, 104*C, 238*C, "MediumSlateBlue" }, - { 0*C, 250*C, 154*C, "MediumSpringGreen" }, - { 72*C, 209*C, 204*C, "MediumTurquoise" }, - { 199*C, 21*C, 133*C, "MediumVioletRed" }, - { 25*C, 25*C, 112*C, "midnight blue" }, - { 25*C, 25*C, 112*C, "MidnightBlue" }, - { 245*C, 255*C, 250*C, "mint cream" }, - { 245*C, 255*C, 250*C, "MintCream" }, - { 255*C, 228*C, 225*C, "misty rose" }, - { 255*C, 228*C, 225*C, "MistyRose" }, - { 255*C, 228*C, 225*C, "MistyRose1" }, - { 238*C, 213*C, 210*C, "MistyRose2" }, - { 205*C, 183*C, 181*C, "MistyRose3" }, - { 139*C, 125*C, 123*C, "MistyRose4" }, - { 255*C, 228*C, 181*C, "moccasin" }, - { 255*C, 222*C, 173*C, "navajo white" }, - { 255*C, 222*C, 173*C, "NavajoWhite" }, - { 255*C, 222*C, 173*C, "NavajoWhite1" }, - { 238*C, 207*C, 161*C, "NavajoWhite2" }, - { 205*C, 179*C, 139*C, "NavajoWhite3" }, - { 139*C, 121*C, 94*C, "NavajoWhite4" }, - { 0*C, 0*C, 128*C, "navy" }, - { 0*C, 0*C, 128*C, "navy blue" }, - { 0*C, 0*C, 128*C, "NavyBlue" }, - { 253*C, 245*C, 230*C, "old lace" }, - { 253*C, 245*C, 230*C, "OldLace" }, - { 107*C, 142*C, 35*C, "olive drab" }, - { 107*C, 142*C, 35*C, "OliveDrab" }, - { 192*C, 255*C, 62*C, "OliveDrab1" }, - { 179*C, 238*C, 58*C, "OliveDrab2" }, - { 154*C, 205*C, 50*C, "OliveDrab3" }, - { 105*C, 139*C, 34*C, "OliveDrab4" }, - { 255*C, 165*C, 0*C, "orange" }, - { 255*C, 69*C, 0*C, "orange red" }, - { 255*C, 165*C, 0*C, "orange1" }, - { 238*C, 154*C, 0*C, "orange2" }, - { 205*C, 133*C, 0*C, "orange3" }, - { 139*C, 90*C, 0*C, "orange4" }, - { 255*C, 69*C, 0*C, "OrangeRed" }, - { 255*C, 69*C, 0*C, "OrangeRed1" }, - { 238*C, 64*C, 0*C, "OrangeRed2" }, - { 205*C, 55*C, 0*C, "OrangeRed3" }, - { 139*C, 37*C, 0*C, "OrangeRed4" }, - { 218*C, 112*C, 214*C, "orchid" }, - { 255*C, 131*C, 250*C, "orchid1" }, - { 238*C, 122*C, 233*C, "orchid2" }, - { 205*C, 105*C, 201*C, "orchid3" }, - { 139*C, 71*C, 137*C, "orchid4" }, - { 238*C, 232*C, 170*C, "pale goldenrod" }, - { 152*C, 251*C, 152*C, "pale green" }, - { 175*C, 238*C, 238*C, "pale turquoise" }, - { 219*C, 112*C, 147*C, "pale violet red" }, - { 238*C, 232*C, 170*C, "PaleGoldenrod" }, - { 152*C, 251*C, 152*C, "PaleGreen" }, - { 154*C, 255*C, 154*C, "PaleGreen1" }, - { 144*C, 238*C, 144*C, "PaleGreen2" }, - { 124*C, 205*C, 124*C, "PaleGreen3" }, - { 84*C, 139*C, 84*C, "PaleGreen4" }, - { 175*C, 238*C, 238*C, "PaleTurquoise" }, - { 187*C, 255*C, 255*C, "PaleTurquoise1" }, - { 174*C, 238*C, 238*C, "PaleTurquoise2" }, - { 150*C, 205*C, 205*C, "PaleTurquoise3" }, - { 102*C, 139*C, 139*C, "PaleTurquoise4" }, - { 219*C, 112*C, 147*C, "PaleVioletRed" }, - { 255*C, 130*C, 171*C, "PaleVioletRed1" }, - { 238*C, 121*C, 159*C, "PaleVioletRed2" }, - { 205*C, 104*C, 137*C, "PaleVioletRed3" }, - { 139*C, 71*C, 93*C, "PaleVioletRed4" }, - { 255*C, 239*C, 213*C, "papaya whip" }, - { 255*C, 239*C, 213*C, "PapayaWhip" }, - { 255*C, 218*C, 185*C, "peach puff" }, - { 255*C, 218*C, 185*C, "PeachPuff" }, - { 255*C, 218*C, 185*C, "PeachPuff1" }, - { 238*C, 203*C, 173*C, "PeachPuff2" }, - { 205*C, 175*C, 149*C, "PeachPuff3" }, - { 139*C, 119*C, 101*C, "PeachPuff4" }, - { 205*C, 133*C, 63*C, "peru" }, - { 255*C, 192*C, 203*C, "pink" }, - { 255*C, 181*C, 197*C, "pink1" }, - { 238*C, 169*C, 184*C, "pink2" }, - { 205*C, 145*C, 158*C, "pink3" }, - { 139*C, 99*C, 108*C, "pink4" }, - { 221*C, 160*C, 221*C, "plum" }, - { 255*C, 187*C, 255*C, "plum1" }, - { 238*C, 174*C, 238*C, "plum2" }, - { 205*C, 150*C, 205*C, "plum3" }, - { 139*C, 102*C, 139*C, "plum4" }, - { 176*C, 224*C, 230*C, "powder blue" }, - { 176*C, 224*C, 230*C, "PowderBlue" }, - { 160*C, 32*C, 240*C, "purple" }, - { 155*C, 48*C, 255*C, "purple1" }, - { 145*C, 44*C, 238*C, "purple2" }, - { 125*C, 38*C, 205*C, "purple3" }, - { 85*C, 26*C, 139*C, "purple4" }, - { 255*C, 0*C, 0*C, "red" }, - { 255*C, 0*C, 0*C, "red1" }, - { 238*C, 0*C, 0*C, "red2" }, - { 205*C, 0*C, 0*C, "red3" }, - { 139*C, 0*C, 0*C, "red4" }, - { 188*C, 143*C, 143*C, "rosy brown" }, - { 188*C, 143*C, 143*C, "RosyBrown" }, - { 255*C, 193*C, 193*C, "RosyBrown1" }, - { 238*C, 180*C, 180*C, "RosyBrown2" }, - { 205*C, 155*C, 155*C, "RosyBrown3" }, - { 139*C, 105*C, 105*C, "RosyBrown4" }, - { 65*C, 105*C, 225*C, "royal blue" }, - { 65*C, 105*C, 225*C, "RoyalBlue" }, - { 72*C, 118*C, 255*C, "RoyalBlue1" }, - { 67*C, 110*C, 238*C, "RoyalBlue2" }, - { 58*C, 95*C, 205*C, "RoyalBlue3" }, - { 39*C, 64*C, 139*C, "RoyalBlue4" }, - { 139*C, 69*C, 19*C, "saddle brown" }, - { 139*C, 69*C, 19*C, "SaddleBrown" }, - { 250*C, 128*C, 114*C, "salmon" }, - { 255*C, 140*C, 105*C, "salmon1" }, - { 238*C, 130*C, 98*C, "salmon2" }, - { 205*C, 112*C, 84*C, "salmon3" }, - { 139*C, 76*C, 57*C, "salmon4" }, - { 244*C, 164*C, 96*C, "sandy brown" }, - { 244*C, 164*C, 96*C, "SandyBrown" }, - { 46*C, 139*C, 87*C, "sea green" }, - { 46*C, 139*C, 87*C, "SeaGreen" }, - { 84*C, 255*C, 159*C, "SeaGreen1" }, - { 78*C, 238*C, 148*C, "SeaGreen2" }, - { 67*C, 205*C, 128*C, "SeaGreen3" }, - { 46*C, 139*C, 87*C, "SeaGreen4" }, - { 255*C, 245*C, 238*C, "seashell" }, - { 255*C, 245*C, 238*C, "seashell1" }, - { 238*C, 229*C, 222*C, "seashell2" }, - { 205*C, 197*C, 191*C, "seashell3" }, - { 139*C, 134*C, 130*C, "seashell4" }, - { 160*C, 82*C, 45*C, "sienna" }, - { 255*C, 130*C, 71*C, "sienna1" }, - { 238*C, 121*C, 66*C, "sienna2" }, - { 205*C, 104*C, 57*C, "sienna3" }, - { 139*C, 71*C, 38*C, "sienna4" }, - { 135*C, 206*C, 235*C, "sky blue" }, - { 135*C, 206*C, 235*C, "SkyBlue" }, - { 135*C, 206*C, 255*C, "SkyBlue1" }, - { 126*C, 192*C, 238*C, "SkyBlue2" }, - { 108*C, 166*C, 205*C, "SkyBlue3" }, - { 74*C, 112*C, 139*C, "SkyBlue4" }, - { 106*C, 90*C, 205*C, "slate blue" }, - { 112*C, 128*C, 144*C, "slate gray" }, - { 112*C, 128*C, 144*C, "slate grey" }, - { 106*C, 90*C, 205*C, "SlateBlue" }, - { 131*C, 111*C, 255*C, "SlateBlue1" }, - { 122*C, 103*C, 238*C, "SlateBlue2" }, - { 105*C, 89*C, 205*C, "SlateBlue3" }, - { 71*C, 60*C, 139*C, "SlateBlue4" }, - { 112*C, 128*C, 144*C, "SlateGray" }, - { 198*C, 226*C, 255*C, "SlateGray1" }, - { 185*C, 211*C, 238*C, "SlateGray2" }, - { 159*C, 182*C, 205*C, "SlateGray3" }, - { 108*C, 123*C, 139*C, "SlateGray4" }, - { 112*C, 128*C, 144*C, "SlateGrey" }, - { 255*C, 250*C, 250*C, "snow" }, - { 255*C, 250*C, 250*C, "snow1" }, - { 238*C, 233*C, 233*C, "snow2" }, - { 205*C, 201*C, 201*C, "snow3" }, - { 139*C, 137*C, 137*C, "snow4" }, - { 0*C, 255*C, 127*C, "spring green" }, - { 0*C, 255*C, 127*C, "SpringGreen" }, - { 0*C, 255*C, 127*C, "SpringGreen1" }, - { 0*C, 238*C, 118*C, "SpringGreen2" }, - { 0*C, 205*C, 102*C, "SpringGreen3" }, - { 0*C, 139*C, 69*C, "SpringGreen4" }, - { 70*C, 130*C, 180*C, "steel blue" }, - { 70*C, 130*C, 180*C, "SteelBlue" }, - { 99*C, 184*C, 255*C, "SteelBlue1" }, - { 92*C, 172*C, 238*C, "SteelBlue2" }, - { 79*C, 148*C, 205*C, "SteelBlue3" }, - { 54*C, 100*C, 139*C, "SteelBlue4" }, - { 210*C, 180*C, 140*C, "tan" }, - { 255*C, 165*C, 79*C, "tan1" }, - { 238*C, 154*C, 73*C, "tan2" }, - { 205*C, 133*C, 63*C, "tan3" }, - { 139*C, 90*C, 43*C, "tan4" }, - { 216*C, 191*C, 216*C, "thistle" }, - { 255*C, 225*C, 255*C, "thistle1" }, - { 238*C, 210*C, 238*C, "thistle2" }, - { 205*C, 181*C, 205*C, "thistle3" }, - { 139*C, 123*C, 139*C, "thistle4" }, - { 255*C, 99*C, 71*C, "tomato" }, - { 255*C, 99*C, 71*C, "tomato1" }, - { 238*C, 92*C, 66*C, "tomato2" }, - { 205*C, 79*C, 57*C, "tomato3" }, - { 139*C, 54*C, 38*C, "tomato4" }, - { 64*C, 224*C, 208*C, "turquoise" }, - { 0*C, 245*C, 255*C, "turquoise1" }, - { 0*C, 229*C, 238*C, "turquoise2" }, - { 0*C, 197*C, 205*C, "turquoise3" }, - { 0*C, 134*C, 139*C, "turquoise4" }, - { 238*C, 130*C, 238*C, "violet" }, - { 208*C, 32*C, 144*C, "violet red" }, - { 208*C, 32*C, 144*C, "VioletRed" }, - { 255*C, 62*C, 150*C, "VioletRed1" }, - { 238*C, 58*C, 140*C, "VioletRed2" }, - { 205*C, 50*C, 120*C, "VioletRed3" }, - { 139*C, 34*C, 82*C, "VioletRed4" }, - { 245*C, 222*C, 179*C, "wheat" }, - { 255*C, 231*C, 186*C, "wheat1" }, - { 238*C, 216*C, 174*C, "wheat2" }, - { 205*C, 186*C, 150*C, "wheat3" }, - { 139*C, 126*C, 102*C, "wheat4" }, - { 255*C, 255*C, 255*C, "white" }, - { 245*C, 245*C, 245*C, "white smoke" }, - { 245*C, 245*C, 245*C, "WhiteSmoke" }, - { 255*C, 255*C, 0*C, "yellow" }, - { 154*C, 205*C, 50*C, "yellow green" }, - { 255*C, 255*C, 0*C, "yellow1" }, - { 238*C, 238*C, 0*C, "yellow2" }, - { 205*C, 205*C, 0*C, "yellow3" }, - { 139*C, 139*C, 0*C, "yellow4" }, - { 154*C, 205*C, 50*C, "YellowGreen" } -}; - -#undef C - -#define NUM_KD_COLORS (sizeof (KdColors) / sizeof (KdColors[0])) - -Bool -OsInitColors() -{ - return TRUE; -} - -Bool -OsLookupColor(int screen, - char *s_name, - unsigned int len, - unsigned short *pred, - unsigned short *pgreen, - unsigned short *pblue) -{ - const KdNamedColor *c; - char *name = s_name; - int low, mid, high; - int r; - - low = 0; - high = NUM_KD_COLORS; - while (high - low > 0) - { - mid = (low + high) / 2; - c = &KdColors[mid]; - r = KdStrCaseCmp (c->name, name, len); - if (r == 0) - { - *pred = c->red; - *pgreen = c->green; - *pblue = c->blue; - return TRUE; - } - if (r < 0) - { - if (high == mid) - break; - high = mid; - } - else - { - if (low == mid) - break; - low = mid; - } - } - return FALSE; -} Index: xc/programs/Xserver/hw/tinyx/txxv.c diff -u xc/programs/Xserver/hw/tinyx/txxv.c:1.1 xc/programs/Xserver/hw/tinyx/txxv.c:1.2 --- xc/programs/Xserver/hw/tinyx/txxv.c:1.1 Wed Jun 2 18:43:00 2004 +++ xc/programs/Xserver/hw/tinyx/txxv.c Fri Oct 14 11:16:27 2005 @@ -35,7 +35,7 @@ */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/txxv.c,v 1.1 2004/06/02 22:43:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/txxv.c,v 1.2 2005/10/14 15:16:27 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -95,8 +95,8 @@ #include "gcstruct.h" #include "dixstruct.h" -#include "Xv.h" -#include "Xvproto.h" +#include +#include #include "txxv.h" Index: xc/programs/Xserver/hw/tinyx/vga.c diff -u xc/programs/Xserver/hw/tinyx/vga.c:1.3 xc/programs/Xserver/hw/tinyx/vga.c:1.4 --- xc/programs/Xserver/hw/tinyx/vga.c:1.3 Tue Oct 26 18:14:57 2004 +++ xc/programs/Xserver/hw/tinyx/vga.c Fri Feb 24 10:31:29 2006 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/vga.c,v 1.3 2004/10/26 22:14:57 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/vga.c,v 1.4 2006/02/24 15:31:29 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -67,24 +67,14 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef __GNUC__ -#define inline __inline__ -#endif #include "vga.h" #include #ifdef linux -#ifdef __i386__ -#define extern static -#include -#undef extern +#include #define _VgaInb(r) inb(r) #define _VgaOutb(v,r) outb(v,r) -#else -#define _VgaInb(r) 0 -#define _VgaOutb(v,r) -#endif #define _VgaByteAddr(a) ((VGAVOL8 *) (a)) #define _VgaBytePort(a) (a) Index: xc/programs/Xserver/hw/tinyx/vga.h diff -u xc/programs/Xserver/hw/tinyx/vga.h:1.1 xc/programs/Xserver/hw/tinyx/vga.h:1.2 --- xc/programs/Xserver/hw/tinyx/vga.h:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/vga.h Sun Mar 27 21:51:06 2005 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/vga.h,v 1.1 2004/06/02 22:43:01 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/vga.h,v 1.2 2005/03/28 02:51:06 dawes Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -150,8 +150,14 @@ VgaGetImm (VgaCard *card, VgaReg *reg); void +_VgaSync (VgaCard *card, VGA16 id); + +void VgaSet (VgaCard *card, VgaReg *reg, VGA32 value); +void +VgaFlushReg (VgaCard *card, VgaReg *reg); + VGA32 VgaGet (VgaCard *card, VgaReg *reg); Index: xc/programs/Xserver/hw/tinyx/Xext/Imakefile diff -u /dev/null xc/programs/Xserver/hw/tinyx/Xext/Imakefile:1.1 --- /dev/null Tue May 9 21:56:19 2006 +++ xc/programs/Xserver/hw/tinyx/Xext/Imakefile Sun Feb 19 10:51:21 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/Xext/Imakefile,v 1.1 2006/02/19 15:51:21 tsi Exp $ +/* + * Copyright (c) 2004-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines TinyDIXDefines +#define LinkDirectory ../../../Xext + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../Xext/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/tinyx/chips/Imakefile diff -u xc/programs/Xserver/hw/tinyx/chips/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/chips/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/chips/Imakefile:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/chips/Imakefile Fri Oct 14 11:16:27 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/chips/Imakefile,v 1.1 2004/06/02 22:43:01 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/chips/Imakefile,v 1.2 2005/10/14 15:16:27 tsi Exp $ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -52,7 +52,7 @@ OBJS = chips.o chipsdraw.o chipsstub.o -INCLUDES = -I. $(TINYXINCLUDES) -I$(TINYXSRC)/vesa +INCLUDES = $(TINYXINCLUDES) -I$(TINYXSRC)/vesa NormalLibraryObjectRule() NormalLibraryTarget(chips,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/chips/chips.c diff -u xc/programs/Xserver/hw/tinyx/chips/chips.c:1.4 xc/programs/Xserver/hw/tinyx/chips/chips.c:1.5 --- xc/programs/Xserver/hw/tinyx/chips/chips.c:1.4 Tue Oct 26 18:14:57 2004 +++ xc/programs/Xserver/hw/tinyx/chips/chips.c Fri Feb 24 10:31:29 2006 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/chips/chips.c,v 1.4 2004/10/26 22:14:57 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/chips/chips.c,v 1.5 2006/02/24 15:31:29 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -67,15 +67,8 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef __GNUC__ -#define inline __inline__ -#endif #include "chips.h" -#ifdef __GLIBC__ #include -#else -#include -#endif #undef CHIPS_DEBUG Index: xc/programs/Xserver/hw/tinyx/chips/chipsdraw.c diff -u xc/programs/Xserver/hw/tinyx/chips/chipsdraw.c:1.1 xc/programs/Xserver/hw/tinyx/chips/chipsdraw.c:1.2 --- xc/programs/Xserver/hw/tinyx/chips/chipsdraw.c:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/chips/chipsdraw.c Fri Oct 14 11:16:27 2005 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/chips/chipsdraw.c,v 1.1 2004/06/02 22:43:01 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/chips/chipsdraw.c,v 1.2 2005/10/14 15:16:27 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -69,13 +69,13 @@ #include "chips.h" -#include "Xmd.h" +#include #include "gcstruct.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "regionstr.h" #include "mistruct.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" #include "fb.h" #include "migc.h" Index: xc/programs/Xserver/hw/tinyx/dix/Imakefile diff -u /dev/null xc/programs/Xserver/hw/tinyx/dix/Imakefile:1.1 --- /dev/null Tue May 9 21:56:19 2006 +++ xc/programs/Xserver/hw/tinyx/dix/Imakefile Sun Feb 19 10:51:21 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/dix/Imakefile,v 1.1 2006/02/19 15:51:21 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines TinyDIXDefines +#define LinkDirectory ../../../dix + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../dix/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/tinyx/fbdev/Imakefile diff -u xc/programs/Xserver/hw/tinyx/fbdev/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/fbdev/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/fbdev/Imakefile:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/fbdev/Imakefile Fri Oct 14 11:16:27 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/fbdev/Imakefile,v 1.1 2004/06/02 22:43:01 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/fbdev/Imakefile,v 1.2 2005/10/14 15:16:27 tsi Exp $ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -56,7 +56,7 @@ OBJS = fbdev.o fbinit.o -INCLUDES = $(TINYXINCLUDES) -I. +INCLUDES = $(TINYXINCLUDES) NormalLibraryObjectRule() NormalLibraryTarget(fbdev,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/i810/Imakefile diff -u xc/programs/Xserver/hw/tinyx/i810/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/i810/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/i810/Imakefile:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/i810/Imakefile Fri Oct 14 11:16:27 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/i810/Imakefile,v 1.1 2004/06/02 22:43:01 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/i810/Imakefile,v 1.2 2005/10/14 15:16:27 tsi Exp $ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -59,7 +59,7 @@ DEFINES = XvExtensionDefines /* -DI810CFG_SHOW_OVERSCAN */ -INCLUDES = -I. $(TINYXINCLUDES) +INCLUDES = $(TINYXINCLUDES) NormalLibraryObjectRule() NormalLibraryTarget(i810,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/i810/i810_video.c diff -u xc/programs/Xserver/hw/tinyx/i810/i810_video.c:1.1 xc/programs/Xserver/hw/tinyx/i810/i810_video.c:1.2 --- xc/programs/Xserver/hw/tinyx/i810/i810_video.c:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/i810/i810_video.c Fri Oct 14 11:16:28 2005 @@ -58,7 +58,7 @@ **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/tinyx/i810/i810_video.c,v 1.1 2004/06/02 22:43:01 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/i810/i810_video.c,v 1.2 2005/10/14 15:16:28 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -120,7 +120,7 @@ #include "txxv.h" #include "i810.h" -#include "Xv.h" +#include #include "../../xfree86/common/fourcc.h" Index: xc/programs/Xserver/hw/tinyx/i810/i810draw.c diff -u xc/programs/Xserver/hw/tinyx/i810/i810draw.c:1.1 xc/programs/Xserver/hw/tinyx/i810/i810draw.c:1.3 --- xc/programs/Xserver/hw/tinyx/i810/i810draw.c:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/i810/i810draw.c Fri Oct 14 11:16:28 2005 @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/hw/tinyx/i810/i810draw.c,v 1.3 2005/10/14 15:16:28 tsi Exp $ */ /* COPYRIGHT AND PERMISSION NOTICE Copyright (c) 2000, 2001 Nokia Home Communications @@ -88,13 +89,13 @@ #include "i810.h" #include "i810_reg.h" -#include "Xmd.h" +#include #include "gcstruct.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "regionstr.h" #include "mistruct.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" #include "fb.h" #include "migc.h" Index: xc/programs/Xserver/hw/tinyx/i810/i810draw.h diff -u xc/programs/Xserver/hw/tinyx/i810/i810draw.h:1.1 xc/programs/Xserver/hw/tinyx/i810/i810draw.h:1.2 --- xc/programs/Xserver/hw/tinyx/i810/i810draw.h:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/i810/i810draw.h Mon Mar 28 23:00:31 2005 @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/hw/tinyx/i810/i810draw.h,v 1.2 2005/03/29 04:00:31 tsi Exp $ */ /* COPYRIGHT AND PERMISSION NOTICE Copyright (c) 2000, 2001 Nokia Home Communications Index: xc/programs/Xserver/hw/tinyx/igs/Imakefile diff -u xc/programs/Xserver/hw/tinyx/igs/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/igs/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/igs/Imakefile:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/igs/Imakefile Fri Oct 14 11:16:28 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/igs/Imakefile,v 1.1 2004/06/02 22:43:01 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/igs/Imakefile,v 1.2 2005/10/14 15:16:28 tsi Exp $ #include "../TinyX.tmpl" @@ -6,7 +6,7 @@ OBJS = igs.o igscmap.o igscurs.o igsdraw.o igsreg.o igsstub.o -INCLUDES = -I. $(TINYXINCLUDES) +INCLUDES = $(TINYXINCLUDES) NormalLibraryObjectRule() NormalLibraryTarget(igs,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/igs/igs.c diff -u xc/programs/Xserver/hw/tinyx/igs/igs.c:1.1 xc/programs/Xserver/hw/tinyx/igs/igs.c:1.2 --- xc/programs/Xserver/hw/tinyx/igs/igs.c:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/igs/igs.c Sat Jan 28 20:28:40 2006 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/tinyx/igs/igs.c,v 1.1 2004/06/02 22:43:01 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/tinyx/igs/igs.c,v 1.2 2006/01/29 01:28:40 tsi Exp $ * * Copyright © 1999 SuSE, Inc. * @@ -23,7 +23,7 @@ * Author: Keith Packard, SuSE, Inc. */ /* - * Copyright (c) 2004 by The XFree86 Project, Inc. + * Copyright (c) 2004-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -209,9 +209,10 @@ { igss->cursor_offset = memory - 1024; #if BITMAP_BIT_ORDER == MSBFirst - igss->cursor_base = (CARD8 *) KdMapDevice (card->attr.address[0] + - igss->cursor_offset, - 1024); + igss->cursor_base = + (CARD8 *) KdMapDevice (screen->card->attr.address[0] + + igss->cursor_offset, + 1024); #else igss->cursor_base = igsc->frameBuffer + igss->cursor_offset; #endif Index: xc/programs/Xserver/hw/tinyx/igs/igsdraw.c diff -u xc/programs/Xserver/hw/tinyx/igs/igsdraw.c:1.1 xc/programs/Xserver/hw/tinyx/igs/igsdraw.c:1.3 --- xc/programs/Xserver/hw/tinyx/igs/igsdraw.c:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/igs/igsdraw.c Fri Feb 17 22:31:36 2006 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/tinyx/igs/igsdraw.c,v 1.1 2004/06/02 22:43:01 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/tinyx/igs/igsdraw.c,v 1.3 2006/02/18 03:31:36 dawes Exp $ * * Copyright © 2000 Keith Packard * @@ -71,13 +71,13 @@ #include "igs.h" #include "igsdraw.h" -#include "Xmd.h" +#include #include "gcstruct.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "regionstr.h" #include "mistruct.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" #include "fb.h" #include "migc.h" @@ -1348,7 +1348,7 @@ }; static void -igsValidateGC (GCPtr pGC, Mask changes, DrawablePtr pDrawable) +igsValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { fbValidateGC (pGC, changes, pDrawable); Index: xc/programs/Xserver/hw/tinyx/ipaq/Imakefile diff -u xc/programs/Xserver/hw/tinyx/ipaq/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/ipaq/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/ipaq/Imakefile:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/ipaq/Imakefile Fri Oct 14 11:16:28 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/ipaq/Imakefile,v 1.1 2004/06/02 22:43:01 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/ipaq/Imakefile,v 1.2 2005/10/14 15:16:28 tsi Exp $ #include "../TinyX.tmpl" @@ -6,7 +6,7 @@ OBJS = ipaq.o -INCLUDES = -I. $(TINYXINCLUDES) -I$(TINYXSRC)/fbdev -I$(TINYXSRC)/pcmcia +INCLUDES = $(TINYXINCLUDES) -I$(TINYXSRC)/fbdev -I$(TINYXSRC)/pcmcia NormalLibraryObjectRule() NormalLibraryTarget(ipaq,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/itsy/Imakefile diff -u xc/programs/Xserver/hw/tinyx/itsy/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/itsy/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/itsy/Imakefile:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/itsy/Imakefile Fri Oct 14 11:16:28 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/itsy/Imakefile,v 1.1 2004/06/02 22:43:01 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/itsy/Imakefile,v 1.2 2005/10/14 15:16:28 tsi Exp $ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -52,7 +52,7 @@ OBJS = itsy.o ts.o kbd.o -INCLUDES = -I. $(TINYXINCLUDES) +INCLUDES = $(TINYXINCLUDES) NormalLibraryObjectRule() NormalLibraryTarget(itsy,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/itsy/ts.c diff -u xc/programs/Xserver/hw/tinyx/itsy/ts.c:1.1 xc/programs/Xserver/hw/tinyx/itsy/ts.c:1.2 --- xc/programs/Xserver/hw/tinyx/itsy/ts.c:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/itsy/ts.c Fri Oct 14 11:16:28 2005 @@ -19,13 +19,13 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/itsy/ts.c,v 1.1 2004/06/02 22:43:01 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/itsy/ts.c,v 1.2 2005/10/14 15:16:28 tsi Exp $ */ #define NEED_EVENTS #include "itsy.h" -#include "Xproto.h" +#include #include "inputstr.h" -#include "Xpoll.h" +#include int itsyTsReadBytes (int fd, char *buf, int len, int min) Index: xc/programs/Xserver/hw/tinyx/linux/Imakefile diff -u xc/programs/Xserver/hw/tinyx/linux/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/linux/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/linux/Imakefile:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/linux/Imakefile Fri Oct 14 11:16:28 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/linux/Imakefile,v 1.1 2004/06/02 22:43:01 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/linux/Imakefile,v 1.2 2005/10/14 15:16:28 tsi Exp $ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -62,7 +62,7 @@ OBJS = keyboard.o linux.o mouse.o ps2.o bus.o ms.o agp.o $(TSOBJS) -INCLUDES = -I. $(TINYXINCLUDES) +INCLUDES = $(TINYXINCLUDES) NormalLibraryObjectRule() NormalLibraryTarget(linux,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/linux/agp.c diff -u xc/programs/Xserver/hw/tinyx/linux/agp.c:1.2 xc/programs/Xserver/hw/tinyx/linux/agp.c:1.5 --- xc/programs/Xserver/hw/tinyx/linux/agp.c:1.2 Wed Jun 23 15:40:16 2004 +++ xc/programs/Xserver/hw/tinyx/linux/agp.c Sun May 7 23:13:59 2006 @@ -35,7 +35,7 @@ */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/linux/agp.c,v 1.2 2004/06/23 19:40:16 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/linux/agp.c,v 1.5 2006/05/08 03:13:59 dawes Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -87,10 +87,10 @@ * Author: Pontus Lidman (adaption to TinyX) and others */ -#include "X.h" +#include -#include "Xdefs.h" -#include "Xmd.h" +#include +#include #include #include @@ -107,14 +107,27 @@ #if defined(linux) #include +#include -#include "../../xfree86/os-support/linux/agpgart.h" +#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION) +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,31) +# include +# endif +#endif #elif defined(__FreeBSD__) + #include #include + #endif +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif #ifndef AGP_DEVICE #define AGP_DEVICE "/dev/agpgart" #endif @@ -125,8 +138,10 @@ #define AGPGART_MAJOR_VERSION 0 #define AGPGART_MINOR_VERSION 99 +#ifdef AGPIOC_BASE static int gartFd = -1; static int acquiredScreen = -1; +#endif /* * Open /dev/agpgart. Keep it open until server exit. @@ -135,6 +150,7 @@ static Bool GARTInit(void) { +#ifdef AGPIOC_INFO static Bool initDone = FALSE; struct _agp_info agpinf; @@ -186,8 +202,10 @@ return FALSE; } #endif - return TRUE; +#else + return FALSE; +#endif } Bool @@ -199,6 +217,7 @@ AgpInfoPtr KdGetAGPInfo(int screenNum) { +#ifdef AGPIOC_INFO struct _agp_info agpinf; AgpInfoPtr info; @@ -227,6 +246,9 @@ info->usedPages = agpinf.pg_used; return info; +#else + return NULL; +#endif } /* @@ -237,6 +259,7 @@ Bool KdAcquireGART(int screenNum) { +#ifdef AGPIOC_ACQUIRE if (screenNum != -1 && !GARTInit()) return FALSE; @@ -251,11 +274,15 @@ } return TRUE; +#else + return FALSE; +#endif } Bool KdReleaseGART(int screenNum) { +#ifdef AGPIOC_RELEASE if (screenNum != -1 && !GARTInit()) return FALSE; @@ -269,6 +296,7 @@ acquiredScreen = -1; return TRUE; } +#endif return FALSE; } @@ -276,6 +304,7 @@ KdAllocateGARTMemory(int screenNum, unsigned long size, int type, unsigned long *physical) { +#ifdef AGPIOC_ALLOCATE struct _agp_allocate alloc; int pages; @@ -308,6 +337,9 @@ *physical = alloc.physical; return alloc.key; +#else + return -1; +#endif } @@ -315,6 +347,7 @@ Bool KdBindGARTMemory(int screenNum, int key, unsigned long offset) { +#ifdef AGPIOC_BIND struct _agp_bind bind; int pageOffset; @@ -347,6 +380,9 @@ } return TRUE; +#else + return FALSE; +#endif } @@ -354,6 +390,7 @@ Bool KdUnbindGARTMemory(int screenNum, int key) { +#ifdef AGPIOC_UNBIND struct _agp_unbind unbind; if (!GARTInit() || acquiredScreen != screenNum) @@ -376,6 +413,9 @@ } return TRUE; +#else + return FALSE; +#endif } @@ -383,6 +423,7 @@ Bool KdEnableAGP(int screenNum, CARD32 mode) { +#ifdef AGPIOC_SETUP agp_setup setup; if (!GARTInit() || acquiredScreen != screenNum) @@ -397,5 +438,8 @@ } return TRUE; +#else + return FALSE; +#endif } Index: xc/programs/Xserver/hw/tinyx/linux/agp.h diff -u xc/programs/Xserver/hw/tinyx/linux/agp.h:1.1 xc/programs/Xserver/hw/tinyx/linux/agp.h:1.3 --- xc/programs/Xserver/hw/tinyx/linux/agp.h:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/linux/agp.h Fri Oct 14 11:16:28 2005 @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/hw/tinyx/linux/agp.h,v 1.3 2005/10/14 15:16:28 tsi Exp $ */ /* COPYRIGHT AND PERMISSION NOTICE Copyright (c) 2000, 2001 Nokia Home Communications @@ -40,7 +41,7 @@ #ifndef _AGP_H_ #define _AGP_H_ -#include "Xdefs.h" +#include /* These two definitions must be consistent with the kernel's, but using 1 or 2 in driver code is even uglier */ Index: xc/programs/Xserver/hw/tinyx/linux/bus.c diff -u xc/programs/Xserver/hw/tinyx/linux/bus.c:1.1 xc/programs/Xserver/hw/tinyx/linux/bus.c:1.2 --- xc/programs/Xserver/hw/tinyx/linux/bus.c:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/linux/bus.c Fri Oct 14 11:16:28 2005 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/tinyx/linux/bus.c,v 1.1 2004/06/02 22:43:01 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/tinyx/linux/bus.c,v 1.2 2005/10/14 15:16:28 tsi Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -69,12 +69,12 @@ */ #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "tinyx.h" -#include "Xpoll.h" +#include /* /dev/adbmouse is a busmouse */ Index: xc/programs/Xserver/hw/tinyx/linux/keyboard.c diff -u xc/programs/Xserver/hw/tinyx/linux/keyboard.c:1.1 xc/programs/Xserver/hw/tinyx/linux/keyboard.c:1.2 --- xc/programs/Xserver/hw/tinyx/linux/keyboard.c:1.1 Wed Jun 2 18:43:01 2004 +++ xc/programs/Xserver/hw/tinyx/linux/keyboard.c Mon Jun 20 13:12:52 2005 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/tinyx/linux/keyboard.c,v 1.1 2004/06/02 22:43:01 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/tinyx/linux/keyboard.c,v 1.2 2005/06/20 17:12:52 dawes Exp $ * * Copyright © 1999 Keith Packard * @@ -77,6 +77,12 @@ #include #include +#ifdef FNONBLOCK +#define NOBLOCK FNONBLOCK +#else +#define NOBLOCK FNDELAY +#endif + extern int LinuxConsoleFd; static const KeySym linux_to_x[256] = { @@ -449,6 +455,7 @@ struct termios nTty; unsigned char buf[256]; int n; + int flags; ioctl (fd, KDGKBMODE, &LinuxKbdTrans); tcgetattr (fd, &LinuxTermios); @@ -467,6 +474,9 @@ /* * Flush any pending keystrokes */ + flags = fcntl (fd, F_GETFL); + flags |= NOBLOCK; + fcntl (fd, F_SETFL, flags); while ((n = read (fd, buf, sizeof (buf))) > 0) ; return fd; Index: xc/programs/Xserver/hw/tinyx/linux/linux.c diff -u xc/programs/Xserver/hw/tinyx/linux/linux.c:1.2 xc/programs/Xserver/hw/tinyx/linux/linux.c:1.3 --- xc/programs/Xserver/hw/tinyx/linux/linux.c:1.2 Wed Jun 23 15:40:16 2004 +++ xc/programs/Xserver/hw/tinyx/linux/linux.c Fri Oct 14 11:16:28 2005 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/tinyx/linux/linux.c,v 1.2 2004/06/23 19:40:16 tsi Exp $ + * $XFree86: xc/programs/Xserver/hw/tinyx/linux/linux.c,v 1.3 2005/10/14 15:16:28 tsi Exp $ * * Copyright © 1999 Keith Packard * @@ -76,7 +76,7 @@ #include #include #include -#include +#include #include static int vtno; Index: xc/programs/Xserver/hw/tinyx/linux/mouse.c diff -u xc/programs/Xserver/hw/tinyx/linux/mouse.c:1.1 xc/programs/Xserver/hw/tinyx/linux/mouse.c:1.2 --- xc/programs/Xserver/hw/tinyx/linux/mouse.c:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/linux/mouse.c Fri Oct 14 11:16:28 2005 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/tinyx/linux/mouse.c,v 1.1 2004/06/02 22:43:02 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/tinyx/linux/mouse.c,v 1.2 2005/10/14 15:16:28 tsi Exp $ * * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc. * @@ -69,12 +69,12 @@ */ #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "tinyx.h" -#include "Xpoll.h" +#include #include #include Index: xc/programs/Xserver/hw/tinyx/linux/ms.c diff -u xc/programs/Xserver/hw/tinyx/linux/ms.c:1.1 xc/programs/Xserver/hw/tinyx/linux/ms.c:1.2 --- xc/programs/Xserver/hw/tinyx/linux/ms.c:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/linux/ms.c Fri Oct 14 11:16:28 2005 @@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/linux/ms.c,v 1.1 2004/06/02 22:43:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/linux/ms.c,v 1.2 2005/10/14 15:16:28 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -69,12 +69,12 @@ */ #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "tinyx.h" -#include "Xpoll.h" +#include #include #include Index: xc/programs/Xserver/hw/tinyx/linux/ps2.c diff -u xc/programs/Xserver/hw/tinyx/linux/ps2.c:1.2 xc/programs/Xserver/hw/tinyx/linux/ps2.c:1.3 --- xc/programs/Xserver/hw/tinyx/linux/ps2.c:1.2 Wed Jun 23 15:40:16 2004 +++ xc/programs/Xserver/hw/tinyx/linux/ps2.c Fri Oct 14 11:16:28 2005 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/tinyx/linux/ps2.c,v 1.2 2004/06/23 19:40:16 tsi Exp $ + * $XFree86: xc/programs/Xserver/hw/tinyx/linux/ps2.c,v 1.3 2005/10/14 15:16:28 tsi Exp $ * * Copyright © 1999 Keith Packard * @@ -69,12 +69,12 @@ */ #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "tinyx.h" -#include "Xpoll.h" +#include static int Ps2ReadBytes (int fd, unsigned char *buf, int len, int min) Index: xc/programs/Xserver/hw/tinyx/linux/ts.c diff -u xc/programs/Xserver/hw/tinyx/linux/ts.c:1.1 xc/programs/Xserver/hw/tinyx/linux/ts.c:1.2 --- xc/programs/Xserver/hw/tinyx/linux/ts.c:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/linux/ts.c Fri Oct 14 11:16:28 2005 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/tinyx/linux/ts.c,v 1.1 2004/06/02 22:43:02 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/tinyx/linux/ts.c,v 1.2 2005/10/14 15:16:28 tsi Exp $ * * Derived from ps2.c by Jim Gettys * @@ -26,12 +26,12 @@ */ #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "tinyx.h" -#include "Xpoll.h" +#include #include #if 1 #include /* touch screen events */ Index: xc/programs/Xserver/hw/tinyx/linux/tslib.c diff -u xc/programs/Xserver/hw/tinyx/linux/tslib.c:1.1 xc/programs/Xserver/hw/tinyx/linux/tslib.c:1.2 --- xc/programs/Xserver/hw/tinyx/linux/tslib.c:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/linux/tslib.c Fri Oct 14 11:16:28 2005 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/tinyx/linux/tslib.c,v 1.1 2004/06/02 22:43:02 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/tinyx/linux/tslib.c,v 1.2 2005/10/14 15:16:28 tsi Exp $ * TSLIB based touchscreen driver for TinyX * Derived from ts.c by Keith Packard * Derived from ps2.c by Jim Gettys @@ -47,12 +47,12 @@ #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "tinyx.h" -#include "Xpoll.h" +#include #include #include Index: xc/programs/Xserver/hw/tinyx/mach64/Imakefile diff -u xc/programs/Xserver/hw/tinyx/mach64/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/mach64/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/mach64/Imakefile:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/mach64/Imakefile Fri Oct 14 11:16:29 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/mach64/Imakefile,v 1.1 2004/06/02 22:43:02 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/mach64/Imakefile,v 1.2 2005/10/14 15:16:29 tsi Exp $ #include "../TinyX.tmpl" @@ -13,7 +13,7 @@ DEFINES = XvExtensionDefines -DVESA /* -DUSE_PCI*/ -INCLUDES = -I. $(TINYXINCLUDES) -I$(TINYXSRC)/vesa +INCLUDES = $(TINYXINCLUDES) -I$(TINYXSRC)/vesa NormalLibraryObjectRule() NormalLibraryTarget(mach64,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/mach64/mach64.c diff -u xc/programs/Xserver/hw/tinyx/mach64/mach64.c:1.4 xc/programs/Xserver/hw/tinyx/mach64/mach64.c:1.5 --- xc/programs/Xserver/hw/tinyx/mach64/mach64.c:1.4 Tue Oct 26 18:14:57 2004 +++ xc/programs/Xserver/hw/tinyx/mach64/mach64.c Fri Feb 24 10:31:29 2006 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/mach64/mach64.c,v 1.4 2004/10/26 22:14:57 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/mach64/mach64.c,v 1.5 2006/02/24 15:31:29 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -67,15 +67,8 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef __GNUC__ -#define inline __inline__ -#endif #include "mach64.h" -#ifdef __GLIBC__ #include -#else -#include -#endif static Bool mach64CardInit (KdCardInfo *card) Index: xc/programs/Xserver/hw/tinyx/mach64/mach64draw.c diff -u xc/programs/Xserver/hw/tinyx/mach64/mach64draw.c:1.1 xc/programs/Xserver/hw/tinyx/mach64/mach64draw.c:1.2 --- xc/programs/Xserver/hw/tinyx/mach64/mach64draw.c:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/mach64/mach64draw.c Fri Oct 14 11:16:29 2005 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/mach64/mach64draw.c,v 1.1 2004/06/02 22:43:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/mach64/mach64draw.c,v 1.2 2005/10/14 15:16:29 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -70,13 +70,13 @@ #include "mach64.h" #include "mach64draw.h" -#include "Xmd.h" +#include #include "gcstruct.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "regionstr.h" #include "mistruct.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" #include "fb.h" #include "migc.h" Index: xc/programs/Xserver/hw/tinyx/mach64/mach64video.c diff -u xc/programs/Xserver/hw/tinyx/mach64/mach64video.c:1.1 xc/programs/Xserver/hw/tinyx/mach64/mach64video.c:1.2 --- xc/programs/Xserver/hw/tinyx/mach64/mach64video.c:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/mach64/mach64video.c Fri Oct 14 11:16:29 2005 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/mach64/mach64video.c,v 1.1 2004/06/02 22:43:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/mach64/mach64video.c,v 1.2 2005/10/14 15:16:29 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -69,7 +69,7 @@ #include "mach64.h" -#include "Xv.h" +#include #include "../../xfree86/common/fourcc.h" #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) Index: xc/programs/Xserver/hw/tinyx/os/Imakefile diff -u /dev/null xc/programs/Xserver/hw/tinyx/os/Imakefile:1.1 --- /dev/null Tue May 9 21:56:20 2006 +++ xc/programs/Xserver/hw/tinyx/os/Imakefile Sun Feb 19 10:51:21 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/os/Imakefile,v 1.1 2006/02/19 15:51:21 tsi Exp $ +/* + * Copyright (c) 2004-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines TinyDIXDefines +#define LinkDirectory ../../../os + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../os/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/tinyx/pcmcia/Imakefile diff -u xc/programs/Xserver/hw/tinyx/pcmcia/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/pcmcia/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/pcmcia/Imakefile:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/pcmcia/Imakefile Fri Oct 14 11:16:29 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/pcmcia/Imakefile,v 1.1 2004/06/02 22:43:02 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/pcmcia/Imakefile,v 1.2 2005/10/14 15:16:29 tsi Exp $ #include "../TinyX.tmpl" @@ -6,7 +6,7 @@ OBJS = pcmcia.o pcmciacurs.o pcmciastub.o pcmciashadow.o pcmciarotate.o -INCLUDES = -I. $(TINYXINCLUDES) -I$(TINYXSRC)/fbdev +INCLUDES = $(TINYXINCLUDES) -I$(TINYXSRC)/fbdev NormalLibraryObjectRule() NormalLibraryTarget(pcmcia,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/pcmcia/pcmcia.c diff -u xc/programs/Xserver/hw/tinyx/pcmcia/pcmcia.c:1.2 xc/programs/Xserver/hw/tinyx/pcmcia/pcmcia.c:1.3 --- xc/programs/Xserver/hw/tinyx/pcmcia/pcmcia.c:1.2 Tue Oct 26 18:14:57 2004 +++ xc/programs/Xserver/hw/tinyx/pcmcia/pcmcia.c Sat Jan 28 20:29:39 2006 @@ -27,9 +27,9 @@ * * Tested running under a Compaq IPAQ Pocket PC running Linux */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/pcmcia/pcmcia.c,v 1.2 2004/10/26 22:14:57 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/pcmcia/pcmcia.c,v 1.3 2006/01/29 01:29:39 tsi Exp $ */ /* - * Copyright (c) 2004 by The XFree86 Project, Inc. + * Copyright (c) 2004-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -79,9 +79,6 @@ #define inline __inline__ #endif #include "pcmcia.h" -#define extern static -#include -#undef extern #define CLOCK 14318 /* KHz */ #define CLK_N(a,b) (a & 0xff) Index: xc/programs/Xserver/hw/tinyx/pcmcia/pcmciarotate.c diff -u xc/programs/Xserver/hw/tinyx/pcmcia/pcmciarotate.c:1.1 xc/programs/Xserver/hw/tinyx/pcmcia/pcmciarotate.c:1.2 --- xc/programs/Xserver/hw/tinyx/pcmcia/pcmciarotate.c:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/pcmcia/pcmciarotate.c Fri Oct 14 11:16:29 2005 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/tinyx/pcmcia/pcmciarotate.c,v 1.1 2004/06/02 22:43:02 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/tinyx/pcmcia/pcmciarotate.c,v 1.2 2005/10/14 15:16:29 tsi Exp $ * * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc. * @@ -68,12 +68,12 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "X.h" +#include #include "scrnintstr.h" #include "windowstr.h" -#include "font.h" +#include #include "dixfontstr.h" -#include "fontstruct.h" +#include #include "mi.h" #include "regionstr.h" #include "globals.h" Index: xc/programs/Xserver/hw/tinyx/pcmcia/pcmciashadow.c diff -u xc/programs/Xserver/hw/tinyx/pcmcia/pcmciashadow.c:1.1 xc/programs/Xserver/hw/tinyx/pcmcia/pcmciashadow.c:1.2 --- xc/programs/Xserver/hw/tinyx/pcmcia/pcmciashadow.c:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/pcmcia/pcmciashadow.c Fri Oct 14 11:16:29 2005 @@ -21,7 +21,7 @@ * * Authors: Alan Hourihane, */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/pcmcia/pcmciashadow.c,v 1.1 2004/06/02 22:43:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/pcmcia/pcmciashadow.c,v 1.2 2005/10/14 15:16:29 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -69,12 +69,12 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "X.h" +#include #include "scrnintstr.h" #include "windowstr.h" -#include "font.h" +#include #include "dixfontstr.h" -#include "fontstruct.h" +#include #include "mi.h" #include "regionstr.h" #include "globals.h" Index: xc/programs/Xserver/hw/tinyx/randr/Imakefile diff -u /dev/null xc/programs/Xserver/hw/tinyx/randr/Imakefile:1.1 --- /dev/null Tue May 9 21:56:20 2006 +++ xc/programs/Xserver/hw/tinyx/randr/Imakefile Sun Feb 19 10:51:21 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/randr/Imakefile,v 1.1 2006/02/19 15:51:21 tsi Exp $ +/* + * Copyright (c) 2004-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines TinyDIXDefines +#define LinkDirectory ../../../randr + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../randr/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/tinyx/render/Imakefile diff -u /dev/null xc/programs/Xserver/hw/tinyx/render/Imakefile:1.1 --- /dev/null Tue May 9 21:56:20 2006 +++ xc/programs/Xserver/hw/tinyx/render/Imakefile Sun Feb 19 10:51:22 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/render/Imakefile,v 1.1 2006/02/19 15:51:22 tsi Exp $ +/* + * Copyright (c) 2004-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines TinyDIXDefines +#define LinkDirectory ../../../render + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../render/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/tinyx/savage/Imakefile diff -u xc/programs/Xserver/hw/tinyx/savage/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/savage/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/savage/Imakefile:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/savage/Imakefile Fri Oct 14 11:16:29 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/savage/Imakefile,v 1.1 2004/06/02 22:43:02 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/savage/Imakefile,v 1.2 2005/10/14 15:16:29 tsi Exp $ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -52,7 +52,7 @@ OBJS = s3.o s3clock.o s3cmap.o s3curs.o s3draw.o s3gc.o s3reg.o s3stub.o -INCLUDES = -I. $(TINYXINCLUDES) +INCLUDES = $(TINYXINCLUDES) NormalLibraryObjectRule() NormalLibraryTarget(savage,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/savage/s3.c diff -u xc/programs/Xserver/hw/tinyx/savage/s3.c:1.1 xc/programs/Xserver/hw/tinyx/savage/s3.c:1.2 --- xc/programs/Xserver/hw/tinyx/savage/s3.c:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/savage/s3.c Fri Feb 17 22:31:36 2006 @@ -20,7 +20,7 @@ * * Author: Keith Packard, SuSE, Inc. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/savage/s3.c,v 1.1 2004/06/02 22:43:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/savage/s3.c,v 1.2 2006/02/18 03:31:36 dawes Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -150,10 +150,10 @@ wakeup = (volatile CARD32 *) (registers + 0x8510); ErrorF ("Wakeup S3 chip at %p\n", (void *)wakeup); - ErrorF ("Wakeup was 0x%lx\n", *wakeup); + ErrorF ("Wakeup was 0x%lx\n", (unsigned long)*wakeup); /* wakeup the chip */ *(volatile CARD32 *) (registers + 0x8510) = 1; - ErrorF ("Wakeup is 0x%lx\n", *wakeup); + ErrorF ("Wakeup is 0x%lx\n", (unsigned long)*wakeup); } s3Set (s3vga, s3_io_addr_select, 1); s3Set (s3vga, s3_enable_ram, 1); @@ -187,7 +187,8 @@ if (!s3c->memory) { - ErrorF ("Can't detect s3 frame buffer at 0x%lx\n", s3FrameBuffer); + ErrorF ("Can't detect s3 frame buffer at 0x%lx\n", + (unsigned long)s3FrameBuffer); goto bail3; } Index: xc/programs/Xserver/hw/tinyx/savage/s3.h diff -u xc/programs/Xserver/hw/tinyx/savage/s3.h:1.1 xc/programs/Xserver/hw/tinyx/savage/s3.h:1.2 --- xc/programs/Xserver/hw/tinyx/savage/s3.h:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/savage/s3.h Fri Feb 17 22:31:36 2006 @@ -20,7 +20,7 @@ * * Author: Keith Packard, SuSE, Inc. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/savage/s3.h,v 1.1 2004/06/02 22:43:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/savage/s3.h,v 1.2 2006/02/18 03:31:36 dawes Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -363,7 +363,8 @@ int __loop = 1000000; \ while (((s3)->alt_status_0 & (mask)) != (value)) \ if (--__loop == 0) { \ - ErrorF ("savage wait loop failed 0x%lx\n", s3->alt_status_0); \ + ErrorF ("savage wait loop failed 0x%lx\n", \ + (unsigned long)s3->alt_status_0); \ break; \ } \ } @@ -374,7 +375,8 @@ int __loop = 1000000; \ while (((s3)->alt_status_0 & S3_SAVAGE4_SLOTS) >= S3_SAVAGE4_ROOM-(n)) \ if (--__loop == 0) { \ - ErrorF ("savage wait loop failed 0x%lx\n", s3->alt_status_0); \ + ErrorF ("savage wait loop failed 0x%lx\n", \ + (unsigned long)s3->alt_status_0); \ break; \ } \ } Index: xc/programs/Xserver/hw/tinyx/savage/s3draw.c diff -u xc/programs/Xserver/hw/tinyx/savage/s3draw.c:1.1 xc/programs/Xserver/hw/tinyx/savage/s3draw.c:1.3 --- xc/programs/Xserver/hw/tinyx/savage/s3draw.c:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/savage/s3draw.c Fri Feb 17 22:31:36 2006 @@ -20,7 +20,7 @@ * * Author: Keith Packard, SuSE, Inc. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/savage/s3draw.c,v 1.1 2004/06/02 22:43:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/savage/s3draw.c,v 1.3 2006/02/18 03:31:36 dawes Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -71,13 +71,13 @@ #include "s3.h" #include "s3draw.h" -#include "Xmd.h" +#include #include "gcstruct.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "regionstr.h" #include "mistruct.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" #include "fb.h" #include "migc.h" @@ -2222,7 +2222,7 @@ } static Bool -s3ChangeWindowAttributes (WindowPtr pWin, Mask mask) +s3ChangeWindowAttributes (WindowPtr pWin, unsigned long mask) { #ifndef S3_TRIO KdScreenPriv(pWin->drawable.pScreen); @@ -2377,7 +2377,7 @@ int x1, x2; int w, h; int flags; - int fb = (int) closure; + int fb = (int)(unsigned long) closure; int ma; BoxPtr pbox; int nbox; @@ -2997,7 +2997,7 @@ }; static void -s3_24ValidateGC (GCPtr pGC, Mask changes, DrawablePtr pDrawable) +s3_24ValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { if (pDrawable->type != DRAWABLE_WINDOW) pGC->ops = (GCOps *) &kdAsyncPixmapGCOps; Index: xc/programs/Xserver/hw/tinyx/savage/s3draw.h diff -u xc/programs/Xserver/hw/tinyx/savage/s3draw.h:1.1 xc/programs/Xserver/hw/tinyx/savage/s3draw.h:1.2 --- xc/programs/Xserver/hw/tinyx/savage/s3draw.h:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/savage/s3draw.h Fri Feb 17 22:31:36 2006 @@ -20,7 +20,7 @@ * * Author: Keith Packard, SuSE, Inc. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/savage/s3draw.h,v 1.1 2004/06/02 22:43:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/savage/s3draw.h,v 1.2 2006/02/18 03:31:36 dawes Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -498,7 +498,7 @@ s3FillBoxSolid (DrawablePtr pDrawable, int nBox, BoxPtr pBox, unsigned long pixel, int alu, unsigned long planemask); -void s3ValidateGC (GCPtr pGC, Mask changes, DrawablePtr pDrawable); +void s3ValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable); void s3CheckGCFill (GCPtr pGC); Index: xc/programs/Xserver/hw/tinyx/savage/s3gc.c diff -u xc/programs/Xserver/hw/tinyx/savage/s3gc.c:1.1 xc/programs/Xserver/hw/tinyx/savage/s3gc.c:1.3 --- xc/programs/Xserver/hw/tinyx/savage/s3gc.c:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/savage/s3gc.c Fri Feb 17 22:31:36 2006 @@ -20,7 +20,7 @@ * * Author: Keith Packard, SuSE, Inc. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/savage/s3gc.c,v 1.1 2004/06/02 22:43:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/savage/s3gc.c,v 1.3 2006/02/18 03:31:36 dawes Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -71,13 +71,13 @@ #include "s3.h" #include "s3draw.h" -#include "Xmd.h" +#include #include "gcstruct.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "regionstr.h" #include "mistruct.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" #include "migc.h" @@ -176,7 +176,7 @@ } void -s3ValidateGC (GCPtr pGC, Mask changes, DrawablePtr pDrawable) +s3ValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { int new_type; /* drawable type has changed */ int new_origin; Index: xc/programs/Xserver/hw/tinyx/sis530/Imakefile diff -u xc/programs/Xserver/hw/tinyx/sis530/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/sis530/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/sis530/Imakefile:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/sis530/Imakefile Fri Oct 14 11:16:29 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/sis530/Imakefile,v 1.1 2004/06/02 22:43:02 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/sis530/Imakefile,v 1.2 2005/10/14 15:16:29 tsi Exp $ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -52,7 +52,7 @@ OBJS = sis.o sisclock.o siscmap.o siscurs.o sisdraw.o sisstub.o -INCLUDES = -I. $(TINYXINCLUDES) +INCLUDES = $(TINYXINCLUDES) NormalLibraryObjectRule() NormalLibraryTarget(sis530,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/sis530/sis.c diff -u xc/programs/Xserver/hw/tinyx/sis530/sis.c:1.2 xc/programs/Xserver/hw/tinyx/sis530/sis.c:1.3 --- xc/programs/Xserver/hw/tinyx/sis530/sis.c:1.2 Wed Aug 4 12:33:35 2004 +++ xc/programs/Xserver/hw/tinyx/sis530/sis.c Sun Feb 19 19:23:09 2006 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/sis530/sis.c,v 1.2 2004/08/04 16:33:35 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/sis530/sis.c,v 1.3 2006/02/20 00:23:09 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -68,9 +68,6 @@ */ #include "sis.h" -#ifdef __GLIBC__ -#include -#endif #define MAX_FB_SIZE (4096 * 1024) Index: xc/programs/Xserver/hw/tinyx/sis530/sis.h diff -u xc/programs/Xserver/hw/tinyx/sis530/sis.h:1.2 xc/programs/Xserver/hw/tinyx/sis530/sis.h:1.3 --- xc/programs/Xserver/hw/tinyx/sis530/sis.h:1.2 Tue Oct 26 18:14:58 2004 +++ xc/programs/Xserver/hw/tinyx/sis530/sis.h Sun Feb 19 19:23:09 2006 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/sis530/sis.h,v 1.2 2004/10/26 22:14:58 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/sis530/sis.h,v 1.3 2006/02/20 00:23:09 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -69,16 +69,11 @@ #ifndef _SIS_H_ #define _SIS_H_ -#ifdef __GNUC__ -#define inline __inline__ -#endif #include "tinyx.h" #include #include #include -#define extern static -#include -#undef extern +#include #include /* Index: xc/programs/Xserver/hw/tinyx/sis530/sisdraw.c diff -u xc/programs/Xserver/hw/tinyx/sis530/sisdraw.c:1.1 xc/programs/Xserver/hw/tinyx/sis530/sisdraw.c:1.3 --- xc/programs/Xserver/hw/tinyx/sis530/sisdraw.c:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/sis530/sisdraw.c Fri Feb 17 22:31:37 2006 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/sis530/sisdraw.c,v 1.1 2004/06/02 22:43:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/sis530/sisdraw.c,v 1.3 2006/02/18 03:31:37 dawes Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -70,13 +70,13 @@ #include "sis.h" #include "sisdraw.h" -#include "Xmd.h" +#include #include "gcstruct.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "regionstr.h" #include "mistruct.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" #include "fb.h" #include "migc.h" @@ -348,7 +348,7 @@ int widthBlt; int glyphsPer; FontPtr pfont = pGC->font; - unsigned long *char1, *char2, *char3, *char4, *char5; + CARD32 *char1, *char2, *char3, *char4, *char5; CARD32 *dst, tmp; int nb; int bwidth; @@ -458,11 +458,11 @@ switch (glyphsPer) { case 5: LoopIt(5, - char1 = (unsigned long *) (*ppci++)->bits; - char2 = (unsigned long *) (*ppci++)->bits; - char3 = (unsigned long *) (*ppci++)->bits; - char4 = (unsigned long *) (*ppci++)->bits; - char5 = (unsigned long *) (*ppci++)->bits;, + char1 = (CARD32 *) (*ppci++)->bits; + char2 = (CARD32 *) (*ppci++)->bits; + char3 = (CARD32 *) (*ppci++)->bits; + char4 = (CARD32 *) (*ppci++)->bits; + char5 = (CARD32 *) (*ppci++)->bits;, (*char1++ | ((*char2++ | ((*char3++ | ((*char4++ | (*char5++ << widthGlyph)) << widthGlyph)) @@ -471,10 +471,10 @@ break; case 4: LoopIt(4, - char1 = (unsigned long *) (*ppci++)->bits; - char2 = (unsigned long *) (*ppci++)->bits; - char3 = (unsigned long *) (*ppci++)->bits; - char4 = (unsigned long *) (*ppci++)->bits;, + char1 = (CARD32 *) (*ppci++)->bits; + char2 = (CARD32 *) (*ppci++)->bits; + char3 = (CARD32 *) (*ppci++)->bits; + char4 = (CARD32 *) (*ppci++)->bits;, (*char1++ | ((*char2++ | ((*char3++ | (*char4++ << widthGlyph)) << widthGlyph)) @@ -482,15 +482,15 @@ break; case 3: LoopIt(3, - char1 = (unsigned long *) (*ppci++)->bits; - char2 = (unsigned long *) (*ppci++)->bits; - char3 = (unsigned long *) (*ppci++)->bits;, + char1 = (CARD32 *) (*ppci++)->bits; + char2 = (CARD32 *) (*ppci++)->bits; + char3 = (CARD32 *) (*ppci++)->bits;, (*char1++ | ((*char2++ | (*char3++ << widthGlyph)) << widthGlyph))); break; case 2: LoopIt(2, - char1 = (unsigned long *) (*ppci++)->bits; - char2 = (unsigned long *) (*ppci++)->bits;, + char1 = (CARD32 *) (*ppci++)->bits; + char2 = (CARD32 *) (*ppci++)->bits;, (*char1++ | (*char2++ << widthGlyph))); break; } @@ -1505,7 +1505,7 @@ }; static void -sisValidateGC (GCPtr pGC, Mask changes, DrawablePtr pDrawable) +sisValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { fbValidateGC (pGC, changes, pDrawable); @@ -1673,10 +1673,10 @@ pScreenPriv->screen->width, pScreenPriv->screen->height, cmd); #endif - base = (CARD32) (pScreenPriv->screen->fb[0].frameBuffer); - fprintf (stderr, "src 0x%lx\n", sis->u.accel.src_addr); + base = (CARD32)(unsigned long) (pScreenPriv->screen->fb[0].frameBuffer); + fprintf (stderr, "src 0x%lx\n", (unsigned long)sis->u.accel.src_addr); sis->u.accel.src_addr = (base & 0x3fffff); - fprintf (stderr, "src 0x%lx\n", sis->u.accel.src_addr); + fprintf (stderr, "src 0x%lx\n", (unsigned long)sis->u.accel.src_addr); sis->u.accel.dst_addr = (base & 0x3fffff); sis->u.accel.pitch = (stride << 16) | stride; sis->u.accel.dimension = ((pScreenPriv->screen->height-1) << 16 | Index: xc/programs/Xserver/hw/tinyx/sis530/sisio.c diff -u xc/programs/Xserver/hw/tinyx/sis530/sisio.c:1.1 xc/programs/Xserver/hw/tinyx/sis530/sisio.c:removed --- xc/programs/Xserver/hw/tinyx/sis530/sisio.c:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/sis530/sisio.c Tue May 9 21:56:20 2006 @@ -1,28 +0,0 @@ -/* - * Copyright © 1999 Keith Packard - * - * 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 Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/sis530/sisio.c,v 1.1 2004/06/02 22:43:02 dawes Exp $ */ - -#ifdef linux -#define extern -#include -#undef extern -#endif Index: xc/programs/Xserver/hw/tinyx/sis530/sisstub.c diff -u xc/programs/Xserver/hw/tinyx/sis530/sisstub.c:1.1 xc/programs/Xserver/hw/tinyx/sis530/sisstub.c:1.2 --- xc/programs/Xserver/hw/tinyx/sis530/sisstub.c:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/sis530/sisstub.c Fri Feb 17 22:31:37 2006 @@ -20,7 +20,7 @@ * * Author: Keith Packard, SuSE, Inc. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/sis530/sisstub.c,v 1.1 2004/06/02 22:43:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/sis530/sisstub.c,v 1.2 2006/02/18 03:31:37 dawes Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -83,7 +83,8 @@ for (i = 0; i < numSisCards; i++) if (LinuxFindPci (0x1039, sisCards[i], 0, &attr)) - KdCardInfoAdd (&sisFuncs, &attr, (void *) sisCards[i]); + KdCardInfoAdd (&sisFuncs, &attr, + (void *)(unsigned long) sisCards[i]); } void Index: xc/programs/Xserver/hw/tinyx/sys/Imakefile diff -u /dev/null xc/programs/Xserver/hw/tinyx/sys/Imakefile:1.1 --- /dev/null Tue May 9 21:56:20 2006 +++ xc/programs/Xserver/hw/tinyx/sys/Imakefile Fri Feb 24 10:31:29 2006 @@ -0,0 +1,69 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/sys/Imakefile,v 1.1 2006/02/24 15:31:29 tsi Exp $ +/* + * Copyright (c) 2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Some [g]libc's don't provide a , so make one up... + * + * This doesn't deal with cross-compiles yet. + */ + +includes depend all:: DONE + +DONE: + RemoveFiles(DONE io.h) + if [ ! -r /usr/include/sys/io.h ]; \ @@\ + then \ @@\ + if [ -r /usr/include/asm/io.h ]; \ @@\ + then \ @@\ + $(LN) ../asmio.h io.h; \ @@\ + fi; \ @@\ + fi + touch DONE + +clean:: + RemoveFiles(DONE io.h) Index: xc/programs/Xserver/hw/tinyx/trident/Imakefile diff -u xc/programs/Xserver/hw/tinyx/trident/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/trident/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/trident/Imakefile:1.1 Wed Jun 2 18:43:02 2004 +++ xc/programs/Xserver/hw/tinyx/trident/Imakefile Fri Oct 14 11:16:29 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/trident/Imakefile,v 1.1 2004/06/02 22:43:02 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/trident/Imakefile,v 1.2 2005/10/14 15:16:29 tsi Exp $ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -54,7 +54,7 @@ DEFINES = -DVESA /* -DUSE_PCI*/ -INCLUDES = -I. $(TINYXINCLUDES) -I$(TINYXSRC)/fbdev -I$(TINYXSRC)/vesa +INCLUDES = $(TINYXINCLUDES) -I$(TINYXSRC)/fbdev -I$(TINYXSRC)/vesa NormalLibraryObjectRule() NormalLibraryTarget(trident,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/trident/trident.c diff -u xc/programs/Xserver/hw/tinyx/trident/trident.c:1.4 xc/programs/Xserver/hw/tinyx/trident/trident.c:1.5 --- xc/programs/Xserver/hw/tinyx/trident/trident.c:1.4 Tue Oct 26 18:14:58 2004 +++ xc/programs/Xserver/hw/tinyx/trident/trident.c Fri Feb 24 10:31:29 2006 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/trident/trident.c,v 1.4 2004/10/26 22:14:58 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/trident/trident.c,v 1.5 2006/02/24 15:31:29 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -67,15 +67,8 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef __GNUC__ -#define inline __inline__ -#endif #include "trident.h" -#ifdef __GLIBC__ #include -#else -#include -#endif #undef TRI_DEBUG Index: xc/programs/Xserver/hw/tinyx/trident/tridentdraw.c diff -u xc/programs/Xserver/hw/tinyx/trident/tridentdraw.c:1.2 xc/programs/Xserver/hw/tinyx/trident/tridentdraw.c:1.4 --- xc/programs/Xserver/hw/tinyx/trident/tridentdraw.c:1.2 Wed Aug 4 12:33:35 2004 +++ xc/programs/Xserver/hw/tinyx/trident/tridentdraw.c Fri Oct 14 11:16:29 2005 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/trident/tridentdraw.c,v 1.2 2004/08/04 16:33:35 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/trident/tridentdraw.c,v 1.4 2005/10/14 15:16:29 tsi Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -70,13 +70,13 @@ #include "trident.h" #include "tridentdraw.h" -#include "Xmd.h" +#include #include "gcstruct.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "regionstr.h" #include "mistruct.h" -#include "fontstruct.h" +#include #include "dixfontstr.h" #include "fb.h" #include "migc.h" @@ -141,18 +141,18 @@ } } -void +static void tridentSolid (int x1, int y1, int x2, int y2) { _tridentRect (cop, x1, y1, x2 - 1, y2 - 1, cmd); } -void +static void tridentDoneSolid (void) { } -Bool +static Bool tridentPrepareCopy (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, int dx, @@ -178,7 +178,7 @@ return FALSE; } -void +static void tridentCopy (int srcX, int srcY, int dstX, @@ -204,12 +204,12 @@ cop->command = cmd; } -void +static void tridentDoneCopy (void) { } -void +static void tridentComposite (CARD8 op, PicturePtr pSrc, PicturePtr pMask, Index: xc/programs/Xserver/hw/tinyx/trio/Imakefile diff -u xc/programs/Xserver/hw/tinyx/trio/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/trio/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/trio/Imakefile:1.1 Wed Jun 2 18:43:03 2004 +++ xc/programs/Xserver/hw/tinyx/trio/Imakefile Fri Oct 14 11:16:29 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/trio/Imakefile,v 1.1 2004/06/02 22:43:03 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/trio/Imakefile,v 1.2 2005/10/14 15:16:29 tsi Exp $ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -52,7 +52,7 @@ OBJS = s3.o s3clock.o s3cmap.o s3curs.o s3draw.o s3gc.o s3stub.o -INCLUDES = -I. $(TINYXINCLUDES) +INCLUDES = $(TINYXINCLUDES) DEFINES = -DS3_TRIO Index: xc/programs/Xserver/hw/tinyx/trio/s3.c diff -u xc/programs/Xserver/hw/tinyx/trio/s3.c:1.1 xc/programs/Xserver/hw/tinyx/trio/s3.c:1.2 --- xc/programs/Xserver/hw/tinyx/trio/s3.c:1.1 Wed Jun 2 18:43:03 2004 +++ xc/programs/Xserver/hw/tinyx/trio/s3.c Fri Feb 17 22:31:37 2006 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/tinyx/trio/s3.c,v 1.1 2004/06/02 22:43:03 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/tinyx/trio/s3.c,v 1.2 2006/02/18 03:31:37 dawes Exp $ */ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -408,7 +408,7 @@ card->driver = s3c; - ErrorF ("S3 at 0x%lx\n", s3Address); + ErrorF ("S3 at 0x%lx\n", (unsigned long)s3Address); registers = KdMapDevice (s3Address + REGISTERS_OFFSET, sizeof (S3) + PACKED_OFFSET); if (!registers) Index: xc/programs/Xserver/hw/tinyx/ts300/Imakefile diff -u xc/programs/Xserver/hw/tinyx/ts300/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/ts300/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/ts300/Imakefile:1.1 Wed Jun 2 18:43:03 2004 +++ xc/programs/Xserver/hw/tinyx/ts300/Imakefile Fri Oct 14 11:16:30 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/ts300/Imakefile,v 1.1 2004/06/02 22:43:03 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/ts300/Imakefile,v 1.2 2005/10/14 15:16:30 tsi Exp $ /* * Copyright (c) 2004 by The XFree86 Project, Inc. * All rights reserved. @@ -52,7 +52,7 @@ OBJS = ts300.o -INCLUDES = -I. $(TINYXINCLUDES) -I$(TINYXSRC)/trio -I$(TINYXSRC)/sis530 +INCLUDES = $(TINYXINCLUDES) -I$(TINYXSRC)/trio -I$(TINYXSRC)/sis530 NormalLibraryObjectRule() NormalLibraryTarget(ts300,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/vesa/Imakefile diff -u xc/programs/Xserver/hw/tinyx/vesa/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/vesa/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/vesa/Imakefile:1.1 Wed Jun 2 18:43:03 2004 +++ xc/programs/Xserver/hw/tinyx/vesa/Imakefile Fri Oct 14 11:16:30 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/vesa/Imakefile,v 1.1 2004/06/02 22:43:03 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/vesa/Imakefile,v 1.2 2005/10/14 15:16:30 tsi Exp $ #include "../TinyX.tmpl" @@ -6,7 +6,7 @@ OBJS = vesa.o vesainit.o vbe.o vga.o vm86.o -INCLUDES = -I. $(TINYXINCLUDES) +INCLUDES = $(TINYXINCLUDES) NormalLibraryObjectRule() NormalLibraryTarget(vesa,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/vesa/vm86.h diff -u xc/programs/Xserver/hw/tinyx/vesa/vm86.h:1.4 xc/programs/Xserver/hw/tinyx/vesa/vm86.h:1.5 --- xc/programs/Xserver/hw/tinyx/vesa/vm86.h:1.4 Sun Jan 30 23:32:48 2005 +++ xc/programs/Xserver/hw/tinyx/vesa/vm86.h Fri Oct 14 11:16:30 2005 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/tinyx/vesa/vm86.h,v 1.4 2005/01/31 04:32:48 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/tinyx/vesa/vm86.h,v 1.5 2005/10/14 15:16:30 tsi Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -65,9 +65,9 @@ #define xcalloc(a,b) calloc(a,b) #define xfree(a) free(a) #else -#include "X.h" -#include "Xproto.h" -#include "Xos.h" +#include +#include +#include #include "os.h" #endif Index: xc/programs/Xserver/hw/tinyx/vxworks/Imakefile diff -u xc/programs/Xserver/hw/tinyx/vxworks/Imakefile:1.1 xc/programs/Xserver/hw/tinyx/vxworks/Imakefile:1.2 --- xc/programs/Xserver/hw/tinyx/vxworks/Imakefile:1.1 Wed Jun 2 18:43:03 2004 +++ xc/programs/Xserver/hw/tinyx/vxworks/Imakefile Fri Oct 14 11:16:30 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/vxworks/Imakefile,v 1.1 2004/06/02 22:43:03 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/tinyx/vxworks/Imakefile,v 1.2 2005/10/14 15:16:30 tsi Exp $ #include @@ -6,9 +6,8 @@ OBJS = vxworks.o vxkbd.o vxkmouse.o -INCLUDES = -I. -I.. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ - -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ - -I$(SERVERSRC)/os -I$(EXTINCSRC) -I$(XINCLUDESRC) +INCLUDES = -I.. -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ + -I$(SERVERSRC)/os NormalLibraryObjectRule() NormalLibraryTarget(vxworks,$(OBJS)) Index: xc/programs/Xserver/hw/tinyx/vxworks/vxkbd.c diff -u xc/programs/Xserver/hw/tinyx/vxworks/vxkbd.c:1.1 xc/programs/Xserver/hw/tinyx/vxworks/vxkbd.c:1.2 --- xc/programs/Xserver/hw/tinyx/vxworks/vxkbd.c:1.1 Wed Jun 2 18:43:03 2004 +++ xc/programs/Xserver/hw/tinyx/vxworks/vxkbd.c Mon Mar 28 23:00:31 2005 @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/hw/tinyx/vxworks/vxkbd.c,v 1.2 2005/03/29 04:00:31 tsi Exp $ */ /* * Copyright © 1999 Network Computing Devices, Inc. All rights reserved. * Index: xc/programs/Xserver/hw/tinyx/vxworks/vxmouse.c diff -u xc/programs/Xserver/hw/tinyx/vxworks/vxmouse.c:1.1 xc/programs/Xserver/hw/tinyx/vxworks/vxmouse.c:1.3 --- xc/programs/Xserver/hw/tinyx/vxworks/vxmouse.c:1.1 Wed Jun 2 18:43:03 2004 +++ xc/programs/Xserver/hw/tinyx/vxworks/vxmouse.c Fri Oct 14 11:16:30 2005 @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/hw/tinyx/vxworks/vxmouse.c,v 1.3 2005/10/14 15:16:30 tsi Exp $ */ /* * Copyright © 1999 Network Computing Devices, Inc. All rights reserved. * @@ -5,12 +6,12 @@ */ #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" +#include +#include #include "inputstr.h" #include "scrnintstr.h" #include "tinyx.h" -#include "Xpoll.h" +#include #include #include Index: xc/programs/Xserver/hw/tinyx/vxworks/vxworks.c diff -u xc/programs/Xserver/hw/tinyx/vxworks/vxworks.c:1.1 xc/programs/Xserver/hw/tinyx/vxworks/vxworks.c:1.2 --- xc/programs/Xserver/hw/tinyx/vxworks/vxworks.c:1.1 Wed Jun 2 18:43:03 2004 +++ xc/programs/Xserver/hw/tinyx/vxworks/vxworks.c Mon Mar 28 23:00:31 2005 @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/hw/tinyx/vxworks/vxworks.c,v 1.2 2005/03/29 04:00:31 tsi Exp $ */ /* * Copyright © 1999 Network Computing Devices, Inc. All rights reserved. * Index: xc/programs/Xserver/hw/vfb/Imakefile diff -u xc/programs/Xserver/hw/vfb/Imakefile:3.31 xc/programs/Xserver/hw/vfb/Imakefile:3.33 --- xc/programs/Xserver/hw/vfb/Imakefile:3.31 Tue Jul 15 23:24:36 2003 +++ xc/programs/Xserver/hw/vfb/Imakefile Sun Feb 19 10:51:22 2006 @@ -1,11 +1,31 @@ -XCOMM $Xorg: Imakefile,v 1.5 2000/08/17 19:48:38 cpqbld Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/vfb/Imakefile,v 3.33 2006/02/19 15:51:22 tsi Exp $ +#include +#define IHaveSubdirs +#if BuildRender +RENDERDIRS = render +#endif -XCOMM $XFree86: xc/programs/Xserver/hw/vfb/Imakefile,v 3.31 2003/07/16 03:24:36 dawes Exp $ +#if BuildRandR +RANDRDIRS = randr +#endif -#include +#if BuildRECORD +RECORDDIRS = record +#endif + +#if BuildDBE +DBEDIR = dbe +#endif + +#if BuildXTrap +XTRAPDIR = XTrap +#endif + +SUBDIRS = dix os Xext $(RENDERDIRS) $(RANDRDIRS) $(RECORDDIRS) $(DBEDIR) \ + $(XTRAPDIR) #if HasShm SHMDEF = -DHAS_SHM @@ -27,25 +47,19 @@ OBJS1 = os2_stubs.o #endif -SRCSA = InitInput.c InitOutput.c stubs.c $(SRCS1) miinitext.c $(SRCS2) - -OBJSA = InitInput.o InitOutput.o stubs.o $(OBJS1) miinitext.o $(OBJS2) - -INCLUDES = -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ - -I$(SERVERSRC)/fb -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include -I../../os \ - -I$(SERVERSRC)/Xext -I$(EXTINCSRC) -I$(XINCLUDESRC) \ - -I$(SERVERSRC)/render +#ifdef XvfbExcludedExtensions +VFB_DEFINES = XvfbExcludedExtensions +#endif -DEFINES = $(OS_DEFINES) $(SHMDEF) $(MMAPDEF) -UXFree86LOADER +SRCS = InitInput.c InitOutput.c miinitext.c $(SRCS1) +OBJS = InitInput.o InitOutput.o miinitext.o $(OBJS1) -#if BuildDPMS -SRCSC = dpmsstubs.c -OBJSC = dpmsstubs.o -#endif +INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ + -I$(SERVERSRC)/include -I../../os -I$(SERVERSRC)/Xext \ + -I$(SERVERSRC)/render -SRCS = $(SRCSA) $(SRCSB) $(SRCSC) -OBJS = $(OBJSA) $(OBJSB) $(OBJSC) +DEFINES = $(OS_DEFINES) $(SHMDEF) $(MMAPDEF) $(EXT_DEFINES) $(VFB_DEFINES) NormalLibraryObjectRule() NormalLibraryTarget(vfb,$(OBJS)) @@ -55,16 +69,11 @@ SpecialCObjectRule(os2_stubs,$(ICONFIGFILES),-DOS2NULLSELECT) #endif -LinkSourceFile(stubs.c,../../Xi) -SpecialCObjectRule(InitInput,$(ICONFIGFILES),$(EXT_DEFINES)) - LinkSourceFile(miinitext.c,$(SERVERSRC)/mi) -SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES) $(PAN_DEFINES) -DNO_HW_ONLY_EXTS -DNO_MODULE_EXTS $(EXT_MODULE_DEFINES) -UXFree86LOADER) - -#if BuildDPMS -LinkSourceFile(dpmsstubs.c,$(SERVERSRC)/Xext) -SpecialCObjectRule(dpmsstubs,$(ICONFIGFILES),$(EXT_DEFINES)) -#endif +SpecialCObjectRule(miinitext,$(ICONFIGFILES),NullParameter) InstallManPage(Xvfb,$(MANDIR)) DependTarget() + +MakeSubdirs($(SUBDIRS)) +DependSubdirs($(SUBDIRS)) Index: xc/programs/Xserver/hw/vfb/InitInput.c diff -u xc/programs/Xserver/hw/vfb/InitInput.c:3.10 xc/programs/Xserver/hw/vfb/InitInput.c:3.12 --- xc/programs/Xserver/hw/vfb/InitInput.c:3.10 Sat Nov 15 22:16:59 2003 +++ xc/programs/Xserver/hw/vfb/InitInput.c Sun Feb 19 10:51:22 2006 @@ -1,4 +1,4 @@ -/* $Xorg: InitInput.c,v 1.4 2001/02/09 02:04:44 xorgcvs Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.12 2006/02/19 15:51:22 tsi Exp $ */ /* Copyright 1993, 1998 The Open Group @@ -26,7 +26,6 @@ from The Open Group. */ -/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.10 2003/11/16 03:16:59 dawes Exp $ */ #include "X11/X.h" #define NEED_EVENTS @@ -38,7 +37,7 @@ #include "mibstore.h" #include "mipointer.h" #include "lk201kbd.h" -#include "keysym.h" +#include Bool LegalModifier(unsigned int key, DevicePtr pDev) @@ -319,22 +318,3 @@ miRegisterPointerDevice(screenInfo.screens[0], p); (void)mieqInit ((DevicePtr) k, (DevicePtr) p); } - -#ifdef XTESTEXT1 -void -XTestGenerateEvent(int dev_type, int keycode, int keystate, int mousex, - int mousey) -{ -} - -void -XTestGetPointerPos(short *fmousex, short *fmousey) -{ -} - -void -XTestJumpPointer(int jx, int jy, int dev_type) -{ -} -#endif - Index: xc/programs/Xserver/hw/vfb/InitOutput.c diff -u xc/programs/Xserver/hw/vfb/InitOutput.c:3.31 xc/programs/Xserver/hw/vfb/InitOutput.c:3.32 --- xc/programs/Xserver/hw/vfb/InitOutput.c:3.31 Sun Jan 30 12:48:44 2005 +++ xc/programs/Xserver/hw/vfb/InitOutput.c Sat Jan 28 20:32:43 2006 @@ -26,7 +26,7 @@ */ /* - * Copyright (c) 1994-2004 by The XFree86 Project, Inc. + * Copyright (c) 1994-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -81,7 +81,7 @@ * */ -/* $XFree86: xc/programs/Xserver/hw/vfb/InitOutput.c,v 3.31 2005/01/30 17:48:44 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/vfb/InitOutput.c,v 3.32 2006/01/29 01:32:43 tsi Exp $ */ #if defined(WIN32) #include @@ -319,10 +319,8 @@ { ErrorF("-screen n WxHxD[@x,y] set screen's width, height, depth, origin\n"); ErrorF("-pixdepths list-of-int support given pixmap depths\n"); -#ifdef RENDER ErrorF("+/-render turn on/of RENDER extension support" "(default on)\n"); -#endif ErrorF("-linebias n adjust thin line pixelization\n"); ErrorF("-blackpixel n pixel value for black\n"); ErrorF("-whitepixel n pixel value for white\n"); @@ -1006,10 +1004,8 @@ case 32: ret = fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height, dpix, dpiy, pvfb->paddedWidth,pvfb->bitsPerPixel); -#ifdef RENDER if (ret && Render) fbPictureInit (pScreen, 0, 0); -#endif break; default: return FALSE; Index: xc/programs/Xserver/hw/vfb/Xvfb.man diff -u xc/programs/Xserver/hw/vfb/Xvfb.man:1.12 xc/programs/Xserver/hw/vfb/Xvfb.man:1.13 --- xc/programs/Xserver/hw/vfb/Xvfb.man:1.12 Thu Feb 10 22:03:11 2005 +++ xc/programs/Xserver/hw/vfb/Xvfb.man Mon Jan 9 09:59:51 2006 @@ -1,4 +1,3 @@ -.\" $Xorg: Xvfb.man,v 1.4 2001/02/09 02:04:45 xorgcvs Exp $ .\" Copyright 1993, 1998 The Open Group .\" .\" Permission to use, copy, modify, distribute, and sell this software and its @@ -23,7 +22,7 @@ .\" other dealings in this Software without prior written authorization .\" from The Open Group. .\" -.\" $XFree86: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.12 2005/02/11 03:03:11 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/vfb/Xvfb.man,v 1.13 2006/01/09 14:59:51 dawes Exp $ .\" .TH XVFB 1 __vendorversion__ .SH NAME Index: xc/programs/Xserver/hw/vfb/lk201kbd.h diff -u xc/programs/Xserver/hw/vfb/lk201kbd.h:1.2 xc/programs/Xserver/hw/vfb/lk201kbd.h:1.3 --- xc/programs/Xserver/hw/vfb/lk201kbd.h:1.2 Fri Dec 14 14:59:45 2001 +++ xc/programs/Xserver/hw/vfb/lk201kbd.h Mon Jan 9 09:59:51 2006 @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/hw/vfb/lk201kbd.h,v 1.3 2006/01/09 14:59:51 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -45,8 +46,6 @@ ******************************************************************/ -/* $Xorg: lk201kbd.h,v 1.4 2001/02/09 02:04:45 xorgcvs Exp $ */ - #define MIN_LK201_KEY 86 #define MAX_LK201_KEY 251 #define LK201_GLYPHS_PER_KEY 2 Index: xc/programs/Xserver/hw/vfb/XTrap/Imakefile diff -u /dev/null xc/programs/Xserver/hw/vfb/XTrap/Imakefile:1.1 --- /dev/null Tue May 9 21:56:21 2006 +++ xc/programs/Xserver/hw/vfb/XTrap/Imakefile Sun Feb 19 10:51:22 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/vfb/XTrap/Imakefile,v 1.1 2006/02/19 15:51:22 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XvfbExcludedExtensions +#define LinkDirectory ../../../XTrap + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../XTrap/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/vfb/Xext/Imakefile diff -u /dev/null xc/programs/Xserver/hw/vfb/Xext/Imakefile:1.1 --- /dev/null Tue May 9 21:56:21 2006 +++ xc/programs/Xserver/hw/vfb/Xext/Imakefile Sun Feb 19 10:51:22 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/vfb/Xext/Imakefile,v 1.1 2006/02/19 15:51:22 tsi Exp $ +/* + * Copyright (c) 2004-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XvfbExcludedExtensions +#define LinkDirectory ../../../Xext + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../Xext/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/vfb/dbe/Imakefile diff -u /dev/null xc/programs/Xserver/hw/vfb/dbe/Imakefile:1.1 --- /dev/null Tue May 9 21:56:21 2006 +++ xc/programs/Xserver/hw/vfb/dbe/Imakefile Sun Feb 19 10:51:22 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/vfb/dbe/Imakefile,v 1.1 2006/02/19 15:51:22 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XvfbExcludedExtensions +#define LinkDirectory ../../../dbe + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../dbe/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/vfb/dix/Imakefile diff -u /dev/null xc/programs/Xserver/hw/vfb/dix/Imakefile:1.1 --- /dev/null Tue May 9 21:56:21 2006 +++ xc/programs/Xserver/hw/vfb/dix/Imakefile Sun Feb 19 10:51:22 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/vfb/dix/Imakefile,v 1.1 2006/02/19 15:51:22 tsi Exp $ +/* + * Copyright (c) 1996-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XvfbExcludedExtensions +#define LinkDirectory ../../../dix + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../dix/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/vfb/os/Imakefile diff -u /dev/null xc/programs/Xserver/hw/vfb/os/Imakefile:1.1 --- /dev/null Tue May 9 21:56:21 2006 +++ xc/programs/Xserver/hw/vfb/os/Imakefile Sun Feb 19 10:51:22 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/vfb/os/Imakefile,v 1.1 2006/02/19 15:51:22 tsi Exp $ +/* + * Copyright (c) 2004-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XvfbExcludedExtensions +#define LinkDirectory ../../../os + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../os/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/vfb/randr/Imakefile diff -u /dev/null xc/programs/Xserver/hw/vfb/randr/Imakefile:1.1 --- /dev/null Tue May 9 21:56:21 2006 +++ xc/programs/Xserver/hw/vfb/randr/Imakefile Sun Feb 19 10:51:22 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/vfb/randr/Imakefile,v 1.1 2006/02/19 15:51:22 tsi Exp $ +/* + * Copyright (c) 2004-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XvfbExcludedExtensions +#define LinkDirectory ../../../randr + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../randr/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/vfb/record/Imakefile diff -u /dev/null xc/programs/Xserver/hw/vfb/record/Imakefile:1.1 --- /dev/null Tue May 9 21:56:21 2006 +++ xc/programs/Xserver/hw/vfb/record/Imakefile Sun Feb 19 10:51:24 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/vfb/record/Imakefile,v 1.1 2006/02/19 15:51:24 tsi Exp $ +/* + * Copyright (c) 2004-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XvfbExcludedExtensions +#define LinkDirectory ../../../record + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../record/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/vfb/render/Imakefile diff -u /dev/null xc/programs/Xserver/hw/vfb/render/Imakefile:1.1 --- /dev/null Tue May 9 21:56:21 2006 +++ xc/programs/Xserver/hw/vfb/render/Imakefile Sun Feb 19 10:51:24 2006 @@ -0,0 +1,65 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/vfb/render/Imakefile,v 1.1 2006/02/19 15:51:24 tsi Exp $ +/* + * Copyright (c) 2004-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#undef XF86Server +#define XF86Server NO +#undef DoLoadableServer +#define DoLoadableServer NO +#define LinkDefines XvfbExcludedExtensions +#define LinkDirectory ../../../render + +/* + * The above doesn't really work because rules that depend on the symbols being + * over-ridden above have already been #define'd. Catch this at the Makefiles + * stage. + */ +IMAKE_DEFINES=-DXF86Server=NO + +#include "../../../render/Imakefile" + +Makefiles:: Makefile Index: xc/programs/Xserver/hw/xfree86/Domain.note diff -u xc/programs/Xserver/hw/xfree86/Domain.note:1.4 xc/programs/Xserver/hw/xfree86/Domain.note:1.5 --- xc/programs/Xserver/hw/xfree86/Domain.note:1.4 Thu Dec 30 22:30:40 2004 +++ xc/programs/Xserver/hw/xfree86/Domain.note Thu Jun 2 23:18:30 2005 @@ -107,8 +107,8 @@ -------------- Most drivers currently used on ix86 need(ed) source code changes. - Calls to xf86ReadBIOS() and xf86MapVidMem() were replaced with calls to - xf86ReadDomainMemory() and xf86MapDomainMemory() respectively. Except - for the "ati" and "atimisc" modules, this has already been done. + xf86ReadDomainMemory() and xf86MapDomainMemory() respectively. This has + already been done. - All ix86-style I/O port numbers need to be declared as an IOADDRESS, a type defined in xf86Pci.h as "unsigned long". Such port numbers also need to be offset by a displacement which is also defined as an @@ -121,9 +121,8 @@ actually a pointer that has been recasted to an unsigned long, but the common layer "hides" this fact from the driver ABI, which means that I/O port numbers, as seen by drivers, remain as integers rather than - addresses. Aside from the ati and atimisc modules, s3 and tseng are the - only modules left whose I/O still needs to be converted (I've temporarily - run out of steam). + addresses. s3 and tseng are the only modules left whose I/O still needs + to be converted (I've temporarily run out of steam). - Note that these conversions are not necessarily sufficient to produce drivers that will work on any given multi-domain architecture. A driver that, for example, had endianness problems, still does. But, at least, @@ -139,10 +138,5 @@ xf86MatchIsaInstances(), while still valid, will always return detection failure on SPARC's and PowerPC's. This will be dealt with when a more general master abort handling scheme is implemented. -- I need to make a decision about the master abort issues mentionned above - before I can convert the "ati" and "atimisc" modules. Consequently, - these modules still need to be compiled with -DAVOID_CPIO on - multi-domain architectures, and support for Mach64 variants as - non-primary heads is not yet available. -$XFree86: xc/programs/Xserver/hw/xfree86/Domain.note,v 1.4 2004/12/31 03:30:40 tsi Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/Domain.note,v 1.5 2005/06/03 03:18:30 tsi Exp $ Index: xc/programs/Xserver/hw/xfree86/Imakefile diff -u xc/programs/Xserver/hw/xfree86/Imakefile:3.89 xc/programs/Xserver/hw/xfree86/Imakefile:3.92 --- xc/programs/Xserver/hw/xfree86/Imakefile:3.89 Tue Nov 30 17:31:45 2004 +++ xc/programs/Xserver/hw/xfree86/Imakefile Wed Mar 1 22:00:35 2006 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/Imakefile,v 3.89 2004/11/30 22:31:45 dickey Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/Imakefile,v 3.92 2006/03/02 03:00:35 dawes Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -61,6 +61,10 @@ XAADIR = xaa #endif +#if defined(BuildTestmod) && BuildTestmod +TESTMODDIR = testmod +#endif + #if XF1Bpp || XF4Bpp XF1BPPDIR = xf1bpp # if XF4Bpp @@ -68,7 +72,8 @@ # endif #endif -#if XF8_32Wid +/* xf8_32wid is only used by sunffb driver */ +#if XF8_32Wid && (DoLoadableServer || defined(SparcArchitecture)) XF8_32WIDDIR = xf8_32wid #endif @@ -80,7 +85,8 @@ XF8_16BPPDIR = xf8_16bpp #endif -#if XF24_32Bpp +/* xf24_32bpp is no longer used by any included drivers */ +#if XF24_32Bpp && DoLoadableServer XF24_32BPPDIR = xf24_32bpp #endif @@ -124,7 +130,7 @@ DRIVERSDK = sdk #endif -#if !BuildServersOnly || BuildXFree86ConfigTools +#if BuildXFree86ConfigTools XF86CFGDIRS = xf86cfg xf86config #endif @@ -133,7 +139,7 @@ dummylib drivers $(LOADERDIR) $(VGAHWDIR) $(FBDEVHWDIR) \ $(RAMDACDIR) $(RACDIR) $(DDCDIR) $(INPUTDIR) $(INT10DIR) $(VBEDIR) \ parser scanpci doc $(XF86CFGDIRS) etc $(DRIVERSDK) \ - $(XF8_32WIDDIR) getconfig + $(XF8_32WIDDIR) $(TESTMODDIR) getconfig #if !defined(OS2Architecture) && !defined(cygwinArchitecture) XF86CONFIG = XF86Config Index: xc/programs/Xserver/hw/xfree86/XF86Conf.cpp diff -u xc/programs/Xserver/hw/xfree86/XF86Conf.cpp:3.47 xc/programs/Xserver/hw/xfree86/XF86Conf.cpp:3.48 --- xc/programs/Xserver/hw/xfree86/XF86Conf.cpp:3.47 Fri Feb 13 18:58:33 2004 +++ xc/programs/Xserver/hw/xfree86/XF86Conf.cpp Mon Jan 9 09:59:51 2006 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/XF86Conf.cpp,v 3.47 2004/02/13 23:58:33 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/XF86Conf.cpp,v 3.48 2006/01/09 14:59:51 dawes Exp $ XCOMM XCOMM Copyright (c) 1994-1998 by The XFree86 Project, Inc. XCOMM All rights reserved. @@ -45,7 +45,6 @@ XCOMM OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, XCOMM EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. XCOMM -XCOMM $XConsortium: XF86Conf.cpp /main/22 1996/10/23 11:43:51 kaleb $ XCOMM ********************************************************************** XCOMM This is a sample configuration file only, intended to illustrate Index: xc/programs/Xserver/hw/xfree86/XF86Config.man diff -u xc/programs/Xserver/hw/xfree86/XF86Config.man:1.30 xc/programs/Xserver/hw/xfree86/XF86Config.man:1.31 --- xc/programs/Xserver/hw/xfree86/XF86Config.man:1.30 Wed Mar 2 22:30:41 2005 +++ xc/programs/Xserver/hw/xfree86/XF86Config.man Mon Mar 28 11:22:54 2005 @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/XF86Config.man,v 1.30 2005/03/03 03:30:41 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/XF86Config.man,v 1.31 2005/03/28 16:22:54 dawes Exp $ .\" .\" Copyright (c) 1994-2005 by The XFree86 Project, Inc. .\" All rights reserved. @@ -1426,7 +1426,7 @@ the preferred mode resolution is taken from the DDC/EDID data if it is available and if it is provides a default mode preference. This is typically true for flat panel displays, which have a native/preferred resolution. -This option is not used of the +This option is not used if the .B UsePreferredMode option is false. .TP 7 Index: xc/programs/Xserver/hw/xfree86/XF98Conf.cpp diff -u xc/programs/Xserver/hw/xfree86/XF98Conf.cpp:1.5 xc/programs/Xserver/hw/xfree86/XF98Conf.cpp:1.6 --- xc/programs/Xserver/hw/xfree86/XF98Conf.cpp:1.5 Mon Jun 7 21:28:55 2004 +++ xc/programs/Xserver/hw/xfree86/XF98Conf.cpp Mon Jan 9 09:59:51 2006 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/XF98Conf.cpp,v 1.5 2004/06/08 01:28:55 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/XF98Conf.cpp,v 1.6 2006/01/09 14:59:51 dawes Exp $ XCOMM XCOMM Copyright (c) 1994-1998 by The XFree86 Project, Inc. XCOMM All rights reserved. @@ -45,7 +45,6 @@ XCOMM OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, XCOMM EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. XCOMM -XCOMM $XConsortium: XF86Conf.cpp /main/22 1996/10/23 11:43:51 kaleb $ XCOMM ********************************************************************** XCOMM This is a sample configuration file only, intended to illustrate Index: xc/programs/Xserver/hw/xfree86/XFree86.man diff -u xc/programs/Xserver/hw/xfree86/XFree86.man:3.73 xc/programs/Xserver/hw/xfree86/XFree86.man:3.75 --- xc/programs/Xserver/hw/xfree86/XFree86.man:3.73 Wed Mar 16 10:31:32 2005 +++ xc/programs/Xserver/hw/xfree86/XFree86.man Mon Apr 24 22:50:42 2006 @@ -1,6 +1,6 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/XFree86.man,v 3.73 2005/03/16 15:31:32 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/XFree86.man,v 3.75 2006/04/25 02:50:42 dawes Exp $ .\" -.\" Copyright (c) 1994-2005 by The XFree86 Project, Inc. +.\" Copyright (c) 1994-2006 by The XFree86 Project, Inc. .\" All rights reserved. .\" .\" Permission is hereby granted, free of charge, to any person obtaining @@ -1179,7 +1179,75 @@ Su Yong, Hui Yu, Sagi Zeevi, -Christian Zietz +Christian Zietz. +.RE +.PP +Contributors to XFree86 4.6.0 include: +.PP +.RS 4 +ASPEED Technologies, +Andrew Aitchison, +James Ascroft-Leigh, +\('Etienne Bersac, +Peter Breitenlohner, +Terry Chang, +Y. C. Chen, +Jeff Chua, +James Cloos, +Alan Coopersmith, +Miguel Gonz\('alez Cuadrado, +David Dawes, +Thomas Dickey, +Stefan Dirsch, +Bernd Ernesti, +Jordan Frank, +Will L G, +Frank Giessler, +Thorsten Glaser, +Damian Janusz Gruszka, +Lukas Hejtmanek, +Evil Mr Henry, +Jens Herden, +Alan Hourihane, +Nicolas Joly, +Bang Jun-Young, +Alexander Kabaev, +Satoshi Kimura, +Milos Komarcevic, +Marc La France, +Dejan Lesjak, +Khong Jye Liew, +Jong Lin, +Michael Lorenz, +Michael Macallan, +Michal Maruska, +Luke Mewburn, +Timothy Musson, +Newsh, +Takaaki Nomura, +Ivan Pascal, +Bob Peterson, +Pierre, +Aaron Plattner, +Alexander Pohoyda, +Jeremy C. Reed, +Conrad Schuler, +Bruno Schwander, +Olaf Seibert, +Aaron Solochek, +Helmar Spangenberg, +Ken Stailey, +Tobias Stoeckmann, +Tungsten Graphics, +James Richard Tyrer, +Staffan Ulfberg, +Denis Vlasenko, +Mark Vojkovich, +Tom Williams, +Dave Williss, +X-Oz Technologies, +XGI, +Christos Zoulas. .RE .PP XFree86 source is available from the FTP server Index: xc/programs/Xserver/hw/xfree86/xf86Date.h diff -u xc/programs/Xserver/hw/xfree86/xf86Date.h:1.86 xc/programs/Xserver/hw/xfree86/xf86Date.h:1.114 --- xc/programs/Xserver/hw/xfree86/xf86Date.h:1.86 Wed Mar 16 20:11:53 2005 +++ xc/programs/Xserver/hw/xfree86/xf86Date.h Tue May 9 20:25:37 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.86 2005/03/17 01:11:53 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.114 2006/05/10 00:25:37 dawes Exp $ */ /* - * Copyright (c) 2004, 2005 by The XFree86 Project, Inc. + * Copyright (c) 2004-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -48,6 +48,6 @@ #ifndef XF86_DATE -#define XF86_DATE "16 March 2005" +#define XF86_DATE "10 May 2006" #endif Index: xc/programs/Xserver/hw/xfree86/xf86Version.h diff -u xc/programs/Xserver/hw/xfree86/xf86Version.h:3.599 xc/programs/Xserver/hw/xfree86/xf86Version.h:3.628 --- xc/programs/Xserver/hw/xfree86/xf86Version.h:3.599 Wed Mar 16 20:11:53 2005 +++ xc/programs/Xserver/hw/xfree86/xf86Version.h Tue May 9 20:25:38 2006 @@ -1,7 +1,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.599 2005/03/17 01:11:53 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.628 2006/05/10 00:25:38 dawes Exp $ */ /* - * Copyright (c) 1994-2005 by The XFree86 Project, Inc. + * Copyright (c) 1994-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -50,7 +50,7 @@ #ifndef XF86_VERSION_NUMERIC #define XF86_VERSION_MAJOR 4 -#define XF86_VERSION_MINOR 5 +#define XF86_VERSION_MINOR 6 #define XF86_VERSION_PATCH 0 #define XF86_VERSION_SNAP 0 Index: xc/programs/Xserver/hw/xfree86/common/Imakefile diff -u xc/programs/Xserver/hw/xfree86/common/Imakefile:3.156 xc/programs/Xserver/hw/xfree86/common/Imakefile:3.166 --- xc/programs/Xserver/hw/xfree86/common/Imakefile:3.156 Wed Jun 23 13:04:14 2004 +++ xc/programs/Xserver/hw/xfree86/common/Imakefile Tue Apr 18 11:57:25 2006 @@ -1,12 +1,4 @@ -XCOMM $XConsortium: Imakefile /main/34 1996/10/27 11:05:08 kaleb $ - - - - - -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/common/Imakefile,v 3.156 2004/06/23 17:04:14 dawes Exp $ - - +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/common/Imakefile,v 3.166 2006/04/18 15:57:25 tsi Exp $ #include @@ -31,15 +23,24 @@ #endif #if defined(SparcArchitecture) || defined(Sparc64Architecture) +#if !defined(OpenBSDArchitecture) SBUSSRC = xf86sbusBus.c SBUSOBJ = xf86sbusBus.o #endif +#endif #if BuildXKB XKBDDXSRC = xf86XKB.c XKBDDXOBJ = xf86XKB.o #endif +#if BuildDBE && DoLoadableServer +#if NeedDBEValidateBuffer || NeedDBERevalidateBuffer + DBEDDXSRC = xf86dbe.c + DBEDDXOBJ = xf86dbe.o +#endif +#endif + #if BuildDebug DEBUGSRC = xf86Debug.c DEBUGOBJ = xf86Debug.o @@ -56,7 +57,17 @@ RANDROBJ = xf86RandR.o #endif +#if defined(BuildTestmod) && BuildTestmod && DoLoadableServer +LOADERTESTSRC = loadertest.c +LOADERTESTOBJ = loadertest.o +LOADERTESTDEFS = -DLOADERTEST=1 +#endif + +#if UseBuildTree && DoLoadableServer +MODPATHDEFINES = -DDEFAULT_MODULE_PATH=\"`cd $(BUILDMODULEDIR); pwd`\" +#else MODPATHDEFINES = -DDEFAULT_MODULE_PATH=\"$(MODULEDIR)\" +#endif LOGDEFINES = -DDEFAULT_LOGPREFIX=\"$(LOGDIRECTORY)/XLogFile.\" #if DoLoadableServer @@ -67,28 +78,12 @@ MDEBUGDEFS = -DMEMDEBUG #endif -#ifndef XF86ExpireServer -#define XF86ExpireServer NO -#endif - -#if XF86ExpireServer - BETASRC = xf86Beta.c - BETAOBJ = xf86Beta.o - BETADEFS = -DDO_CHECK_BETA -#ifndef NeedXF86Beta -#define NeedXF86Beta YES -#endif -#endif - -#ifndef NeedXF86Beta -#define NeedXF86Beta NO -#endif - -#if XF86ExpireServer -EXP_FORCE_DEFINES = -DSHOW_BETA_MESSAGE -DEXPIRE_SERVER +#if UseStackTrace +STRACEDEFS = -DSTACKTRACE +STRACEINCS = -I$(TOP)/util/memleak #endif -SRCS = \ +SRCS = \ xf86Configure.c \ xf86Bus.c \ xf86isaBus.c \ @@ -125,9 +120,10 @@ $(XF86_XINPUT_SRC) \ $(XINPUT_DEV_SRCS) \ $(XKBDDXSRC) \ - $(BETASRC) \ + $(DBEDDXSRC) \ $(SERVERSRCS) \ - $(RANDRSRC) + $(RANDRSRC) \ + $(LOADERTESTSRC) OBJS = \ xf86Configure.o \ @@ -162,24 +158,25 @@ $(SBUSOBJ) \ $(XF86_XINPUT_OBJ) \ $(XKBDDXOBJ) \ - $(BETAOBJ) \ + $(DBEDDXOBJ) \ $(KBD).o \ - $(RANDROBJ) + $(RANDROBJ) \ + $(LOADERTESTOBJ) OFILES = \ xf86Init.o \ xf86IniExt.o VGAINCLUDES = -I$(XF86SRC)/vgahw - INCLUDES = -I. -I$(XF86OSSRC) -I$(XF86OSSRC)/bus -I$(SERVERSRC)/mfb \ + INCLUDES = -I$(XF86OSSRC) -I$(XF86OSSRC)/bus -I$(SERVERSRC)/mfb \ -I$(SERVERSRC)/mi -I$(SERVERSRC)/include -I$(SERVERSRC)/os \ - -I$(XINCLUDESRC) -I$(SERVERSRC)/Xext -I$(EXTINCSRC) \ - -I$(SERVERSRC)/Xi -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(FONTLIBSRC)/include -I$(FONTINCSRC) \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/Xi -I$(XF86SRC)/ddc \ + -I$(XF86SRC)/i2c -I$(FONTLIBSRC)/include \ -I$(XF86SRC) -I$(XF86PARSERSRC) \ -I$(XF86SRC)/loader $(VGAINCLUDES) -I$(XF86SRC)/rac \ -I$(XF86SRC)/scanpci -I$(XF86SRC)/vbe -I$(XF86SRC)/int10 \ - -I$(XF86SRC)/ddc -I$(SERVERSRC)/render $(RANDRINCS) + -I$(XF86SRC)/ddc -I$(SERVERSRC)/render $(RANDRINCS) \ + $(STRACEINCS) OSNAME = OSName OSVENDOR = OSVendor @@ -194,7 +191,6 @@ #endif CONSDEFINES = XFree86ConsoleDefines -EXP_DEFINES = -DEXPIRY_TIME=XF86ServerExpiry $(EXP_FORCE_DEFINES) DRIVERS = XF86CardDrivers IDRIVERS = XInputDrivers XCONFIGDEFINES = -DPROJECTROOT='"$(PROJECTROOT)"' \ @@ -204,23 +200,19 @@ XF86CONFIGFILE = XConfigFile XCONFIGUREDEFINES = -DXF86CONFIGFILE='"$(XF86CONFIGFILE)"' - DEFINES = $(CONSDEFINES) $(KBDDEFINES) $(EXT_DEFINES) $(OS_DEFINES) + DEFINES = $(CONSDEFINES) $(KBDDEFINES) $(EXT_DEFINES) $(OS_DEFINES) \ + $(STRACEDEFS) AllTarget($(OFILES)) SpecialCObjectRule(xf86Bus,NullParameter,$(BUGMSG) $(VGAINCLUDES)) -SpecialCObjectRule(xf86Init,$(ICONFIGFILES),$(OSNAMEDEF) $(BUILDERMSG) $(BUGMSG) $(CUSTOMVERDEF) $(EXT_DEFINES) $(BETADEFS) $(MDEBUGDEFS)) -SpecialCObjectRule(xf86Events,$(ICONFIGFILES),$(EXT_DEFINES) $(MDEBUGDEFS)) -SpecialCObjectRule(xf86Globals,$(ICONFIGFILES),$(EXT_DEFINES) $(MODPATHDEFINES) $(LOGDEFINES)) +SpecialCObjectRule(xf86Init,$(ICONFIGFILES),$(OSNAMEDEF) $(BUILDERMSG) $(BUGMSG) $(CUSTOMVERDEF) $(MDEBUGDEFS) $(LOADERTESTDEFS)) +SpecialCObjectRule(xf86Events,$(ICONFIGFILES),$(MDEBUGDEFS)) +SpecialCObjectRule(xf86Globals,$(ICONFIGFILES),$(MODPATHDEFINES) $(LOGDEFINES)) SpecialCObjectRule(xf86AutoConfig,$(ICONFIGFILES),$(XCONFIGDEFINES)) SpecialCObjectRule(xf86Config,$(ICONFIGFILES),$(XCONFIGDEFINES)) SpecialCObjectRule(xf86Configure,$(ICONFIGFILES),$(XCONFIGUREDEFINES)) - -#if NeedXF86Beta -SpecialCObjectRule($(BETAOBJ),NullParameter,$(EXP_DEFINES)) -#endif - -SpecialCObjectRule(xf86IniExt,$(ICONFIGFILES),$(EXT_DEFINES) $(EXT_MODULES_DEFINES)) +SpecialCObjectRule(xf86IniExt,$(ICONFIGFILES),$(EXT_MODULES_DEFINES)) NormalLibraryObjectRule() NormalLibraryTarget(xf86,$(OBJS)) Index: xc/programs/Xserver/hw/xfree86/common/atKeynames.h diff -u xc/programs/Xserver/hw/xfree86/common/atKeynames.h:3.22 xc/programs/Xserver/hw/xfree86/common/atKeynames.h:3.25 --- xc/programs/Xserver/hw/xfree86/common/atKeynames.h:3.22 Fri Feb 13 18:58:35 2004 +++ xc/programs/Xserver/hw/xfree86/common/atKeynames.h Mon Jan 9 09:59:51 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/atKeynames.h,v 3.22 2004/02/13 23:58:35 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/atKeynames.h,v 3.25 2006/01/09 14:59:51 dawes Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -68,15 +68,13 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $XConsortium: atKeynames.h /main/11 1996/03/09 11:17:41 kaleb $ */ - #ifndef _ATKEYNAMES_H #define _ATKEYNAMES_H #define XK_TECHNICAL #define XK_KATAKANA -#include "keysym.h" -#include "XF86keysym.h" +#include +#include #define GLYPHS_PER_KEY 4 #define NUM_KEYCODES 248 @@ -261,6 +259,7 @@ #define KEY_L8 /* Paste 0x90 */ 144 #define KEY_L9 /* Find 0x91 */ 145 #define KEY_L10 /* Cut 0x92 */ 146 +#define KEY_Compose /* Compose 0x93 */ 147 /* * Fake 'scancodes' in the following ranges are generated for 2-byte Index: xc/programs/Xserver/hw/xfree86/common/compiler.h diff -u xc/programs/Xserver/hw/xfree86/common/compiler.h:3.108 xc/programs/Xserver/hw/xfree86/common/compiler.h:3.115 --- xc/programs/Xserver/hw/xfree86/common/compiler.h:3.108 Sat Apr 3 17:26:23 2004 +++ xc/programs/Xserver/hw/xfree86/common/compiler.h Sun Feb 19 19:14:37 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.108 2004/04/03 22:26:23 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.115 2006/02/20 00:14:37 dawes Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -22,7 +22,7 @@ * */ /* - * Copyright (c) 1994-2003 by The XFree86 Project, Inc. + * Copyright (c) 1994-2005 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -68,8 +68,6 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $XConsortium: compiler.h /main/16 1996/10/25 15:38:34 kaleb $ */ - #ifndef _COMPILER_H # if !defined(_XF86_ANSIC_H) && defined(XFree86Module) @@ -172,6 +170,38 @@ extern unsigned long ldl_brx(volatile unsigned char *, int); extern unsigned short ldw_brx(volatile unsigned char *, int); +# if (defined(linux) || defined(Lynx) || defined(sun) || defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc__) +unsigned char xf86ReadMmio8(__volatile__ void *base, + const unsigned long offset); +unsigned short xf86ReadMmio16Be(__volatile__ void *base, + const unsigned long offset); +unsigned short xf86ReadMmio16Le(__volatile__ void *base, + const unsigned long offset); +unsigned int xf86ReadMmio32Be(__volatile__ void *base, + const unsigned long offset); +unsigned int xf86ReadMmio32Le(__volatile__ void *base, + const unsigned long offset); +void xf86WriteMmio8(__volatile__ void *base, const unsigned long offset, + const unsigned int val); +void xf86WriteMmio16Be(__volatile__ void *base, const unsigned long offset, + const unsigned int val); +void xf86WriteMmio16Le(__volatile__ void *base, const unsigned long offset, + const unsigned int val); +void xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset, + const unsigned int val); +void xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset, + const unsigned int val); +void xf86WriteMmio8NB(__volatile__ void *base, const unsigned long offset, + const unsigned int val); +void xf86WriteMmio16BeNB(__volatile__ void *base, const unsigned long offset, + const unsigned int val); +void xf86WriteMmio16LeNB(__volatile__ void *base, const unsigned long offset, + const unsigned int val); +void xf86WriteMmio32BeNB(__volatile__ void *base, const unsigned long offset, + const unsigned int val); +void xf86WriteMmio32LeNB(__volatile__ void *base, const unsigned long offset, + const unsigned int val); +# endif /* sparc */ # endif # ifndef NO_INLINE @@ -513,7 +543,7 @@ # define outw(a,b) _outw(b,a) # define outl(a,b) _outl(b,a) -# elif defined(linux) && defined(__AMD64__) +# elif defined(linux) && (defined(__amd64__) || defined(__x86_64__)) # include @@ -586,11 +616,18 @@ # define ASI_PL 0x88 # endif -# define barrier() __asm__ __volatile__(".word 0x8143e00a": : :"memory") +/* + * MEMBAR instruction coded to be acceptable even to an assembler not + * expecting it in its input stream. This has been changed to "membar" + * everything and is now used to bracket most accesses for fault-isolation + * purposes. + */ +# define barrier() __asm__ __volatile__(".word 0x8143e07f": : :"memory") static __inline__ void outb(unsigned long port, unsigned char val) { + barrier(); __asm__ __volatile__("stba %0, [%1] %2" : /* No outputs */ : "r" (val), "r" (port), "i" (ASI_PL)); @@ -600,6 +637,7 @@ static __inline__ void outw(unsigned long port, unsigned short val) { + barrier(); __asm__ __volatile__("stha %0, [%1] %2" : /* No outputs */ : "r" (val), "r" (port), "i" (ASI_PL)); @@ -609,6 +647,7 @@ static __inline__ void outl(unsigned long port, unsigned int val) { + barrier(); __asm__ __volatile__("sta %0, [%1] %2" : /* No outputs */ : "r" (val), "r" (port), "i" (ASI_PL)); @@ -619,9 +658,12 @@ inb(unsigned long port) { unsigned int ret; + + barrier(); __asm__ __volatile__("lduba [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL)); + barrier(); return ret; } @@ -629,9 +671,12 @@ inw(unsigned long port) { unsigned int ret; + + barrier(); __asm__ __volatile__("lduha [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL)); + barrier(); return ret; } @@ -639,9 +684,12 @@ inl(unsigned long port) { unsigned int ret; + + barrier(); __asm__ __volatile__("lda [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL)); + barrier(); return ret; } @@ -651,9 +699,11 @@ unsigned long addr = ((unsigned long)base) + offset; unsigned char ret; + barrier(); __asm__ __volatile__("lduba [%1] %2, %0" : "=r" (ret) : "r" (addr), "i" (ASI_PL)); + barrier(); return ret; } @@ -663,9 +713,11 @@ unsigned long addr = ((unsigned long)base) + offset; unsigned short ret; + barrier(); __asm__ __volatile__("lduh [%1], %0" : "=r" (ret) : "r" (addr)); + barrier(); return ret; } @@ -675,9 +727,11 @@ unsigned long addr = ((unsigned long)base) + offset; unsigned short ret; + barrier(); __asm__ __volatile__("lduha [%1] %2, %0" : "=r" (ret) : "r" (addr), "i" (ASI_PL)); + barrier(); return ret; } @@ -687,9 +741,11 @@ unsigned long addr = ((unsigned long)base) + offset; unsigned int ret; + barrier(); __asm__ __volatile__("ld [%1], %0" : "=r" (ret) : "r" (addr)); + barrier(); return ret; } @@ -699,9 +755,11 @@ unsigned long addr = ((unsigned long)base) + offset; unsigned int ret; + barrier(); __asm__ __volatile__("lda [%1] %2, %0" : "=r" (ret) : "r" (addr), "i" (ASI_PL)); + barrier(); return ret; } @@ -711,6 +769,7 @@ { unsigned long addr = ((unsigned long)base) + offset; + barrier(); __asm__ __volatile__("stba %0, [%1] %2" : /* No outputs */ : "r" (val), "r" (addr), "i" (ASI_PL)); @@ -723,6 +782,7 @@ { unsigned long addr = ((unsigned long)base) + offset; + barrier(); __asm__ __volatile__("sth %0, [%1]" : /* No outputs */ : "r" (val), "r" (addr)); @@ -735,6 +795,7 @@ { unsigned long addr = ((unsigned long)base) + offset; + barrier(); __asm__ __volatile__("stha %0, [%1] %2" : /* No outputs */ : "r" (val), "r" (addr), "i" (ASI_PL)); @@ -747,6 +808,7 @@ { unsigned long addr = ((unsigned long)base) + offset; + barrier(); __asm__ __volatile__("st %0, [%1]" : /* No outputs */ : "r" (val), "r" (addr)); @@ -759,6 +821,7 @@ { unsigned long addr = ((unsigned long)base) + offset; + barrier(); __asm__ __volatile__("sta %0, [%1] %2" : /* No outputs */ : "r" (val), "r" (addr), "i" (ASI_PL)); @@ -1638,25 +1701,25 @@ # ifdef __alpha__ /* entry points for Mmio memory access routines */ -extern int (*xf86ReadMmio8)(void *, unsigned long); -extern int (*xf86ReadMmio16)(void *, unsigned long); +extern int (*xf86ReadMmio8)(volatile void *, unsigned long); +extern int (*xf86ReadMmio16)(volatile void *, unsigned long); # ifndef STANDALONE_MMIO -extern int (*xf86ReadMmio32)(void *, unsigned long); +extern int (*xf86ReadMmio32)(volatile void *, unsigned long); # else /* Some DRI 3D drivers need MMIO_IN32. */ static __inline__ int -xf86ReadMmio32(void *Base, unsigned long Offset) +xf86ReadMmio32(volatile void *Base, unsigned long Offset) { __asm__ __volatile__("mb" : : : "memory"); return *(volatile CARD32*)((unsigned long)Base+(Offset)); } # endif -extern void (*xf86WriteMmio8)(int, void *, unsigned long); -extern void (*xf86WriteMmio16)(int, void *, unsigned long); -extern void (*xf86WriteMmio32)(int, void *, unsigned long); -extern void (*xf86WriteMmioNB8)(int, void *, unsigned long); -extern void (*xf86WriteMmioNB16)(int, void *, unsigned long); -extern void (*xf86WriteMmioNB32)(int, void *, unsigned long); +extern void (*xf86WriteMmio8)(int, volatile void *, unsigned long); +extern void (*xf86WriteMmio16)(int, volatile void *, unsigned long); +extern void (*xf86WriteMmio32)(int, volatile void *, unsigned long); +extern void (*xf86WriteMmioNB8)(int, volatile void *, unsigned long); +extern void (*xf86WriteMmioNB16)(int, volatile void *, unsigned long); +extern void (*xf86WriteMmioNB32)(int, volatile void *, unsigned long); extern void xf86JensenMemToBus(char *, long, long, int); extern void xf86JensenBusToMem(char *, char *, unsigned long, int); extern void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int); @@ -1737,7 +1800,7 @@ # define MMIO_MOVE32(base, offset, val) \ xf86WriteMmio32Be(base, offset, (CARD32)(val)) -static __inline__ void ppc_flush_icache(char *addr) +static __inline__ void ppc_flush_icache(void *addr) { __asm__ volatile ( "dcbf 0,%0;" Index: xc/programs/Xserver/hw/xfree86/common/loadertest.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/common/loadertest.c:1.1 --- /dev/null Tue May 9 21:56:34 2006 +++ xc/programs/Xserver/hw/xfree86/common/loadertest.c Wed Mar 1 22:00:36 2006 @@ -0,0 +1,179 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/loadertest.c,v 1.1 2006/03/02 03:00:36 dawes Exp $ */ + +/* + * Copyright © 2003-2006 David H. Dawes. + * Copyright © 2003-2006 X-Oz Technologies. + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by X-Oz Technologies + * (http://www.x-oz.com/)." Alternately, this acknowledgment may + * appear in the software itself, if and wherever such third-party + * acknowledgments normally appear. + * + * 4. Except as contained in this notice, the name of X-Oz + * Technologies shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from X-Oz Technologies. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL X-OZ TECHNOLOGIES OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "loaderProcs.h" +#define XF86_OS_PRIVS +#include "xf86.h" +#include "xf86Priv.h" +#include "loadertest.h" + +typedef void (*msgProcPtr)(char *, ...); +typedef int (*testProcPtr)(int); + +#ifndef CATCH_SEGV +#define CATCH_SEGV 0 +#endif + +#if CATCH_SEGV +#include + +jmp_buf ltEnv; + +static void +ltSignal(int sig) +{ + ErrorF("ltSignal: caught signal %d\n", sig); + longjmp(ltEnv, sig); + signal(SIGSEGV, ltSignal); +} +#else +#define setjmp(x) 0 +#endif + +void +LoaderTest(void) +{ + void *mod1, *mod2, *sym1 = NULL, *sym2 = NULL, *sym3 = NULL; + msgProcPtr fptr; + testProcPtr tptr; + int status = 0; + +#if CATCH_SEGV + ErrorF("LoaderTest: Installing signal handlers.\n"); + signal(SIGSEGV, ltSignal); +#endif + + ErrorF("LoaderTest: Loading module \"testmod\".\n"); + mod2 = xf86LoadOneModule("testmod", NULL); + if (!mod2) { + ErrorF("LoaderTest: Cannot load \"testmod\". Exiting.\n"); + exit(1); + } + tptr = (testProcPtr)LoaderSymbol("testmodFunction3"); + if (!tptr) { + ErrorF("LoaderTest: Cannot find symbol \"testmodFunction3\"." + " Exiting.\n"); + exit(1); + } + + status = setjmp(ltEnv); + if (!status) { + tptr(0); + } else { + ErrorF("LoaderTest: caught signal %d in tptr(0) call.\n", status); + } + + ErrorF("LoaderTest: Loading module \"bitmap\".\n"); + mod1 = xf86LoadOneModule("bitmap", NULL); + if (!mod1) + ErrorF("LoaderTest: Loading module \"bitmap\" failed.\n"); + + if (mod1) { + sym1 = LoaderSymbol("bdfError"); + ErrorF("LoaderTest: bdfError is %p.\n", sym1); + ErrorF("LoaderTest: CheckUnresolved.\n"); + LoaderCheckUnresolved(0); + fptr = (msgProcPtr)sym1; + fptr("Hello from bdfError\n"); + status = setjmp(ltEnv); + if (!status) { + tptr(1); + } else { + ErrorF("LoaderTest: caught signal %d in tptr(1) call.\n", status); + } + ErrorF("LoaderTest: Unloading module \"bitmap\".\n"); + UnloadModule(mod1); + ErrorF("LoaderTest: CheckUnresolved.\n"); + LoaderCheckUnresolved(0); + sym2 = LoaderSymbol("bdfError"); + ErrorF("LoaderTest: bdfError is %p.\n", sym2); + status = setjmp(ltEnv); + if (!status) { + tptr(2); + } else { + ErrorF("LoaderTest: caught signal %d in tptr(2) call.\n", status); + } + } + + ErrorF("LoaderTest: Loading module \"bitmap\" again.\n"); + mod1 = xf86LoadOneModule("bitmap", NULL); + if (!mod1) + ErrorF("LoaderTest: Loading module \"bitmap\" failed.\n"); + + if (mod1) { + sym3 = LoaderSymbol("bdfError"); + ErrorF("LoaderTest: bdfError is %p (was %p, %p).\n", + sym3, sym1, sym2); + ErrorF("LoaderTest: CheckUnresolved.\n"); + LoaderCheckUnresolved(0); + fptr = (msgProcPtr)sym3; + fptr("Hello from bdfError\n"); + status = setjmp(ltEnv); + if (!status) { + tptr(3); + } else { + ErrorF("LoaderTest: caught signal %d in tptr(3) call.\n", status); + } + ErrorF("LoaderTest: Unloading module \"bitmap\" again.\n"); + UnloadModule(mod1); + ErrorF("LoaderTest: CheckUnresolved.\n"); + LoaderCheckUnresolved(0); + sym2 = LoaderSymbol("bdfError"); + ErrorF("LoaderTest: bdfError is %p.\n", sym2); + status = setjmp(ltEnv); + if (!status) { + tptr(4); + } else { + ErrorF("LoaderTest: caught signal %d in tptr(4) call.\n", status); + } + } + + ErrorF("LoaderTest: exiting normally.\n"); + exit(0); +} + Index: xc/programs/Xserver/hw/xfree86/common/loadertest.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/common/loadertest.h:1.1 --- /dev/null Tue May 9 21:56:34 2006 +++ xc/programs/Xserver/hw/xfree86/common/loadertest.h Wed Mar 1 22:00:36 2006 @@ -0,0 +1,50 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/loadertest.h,v 1.1 2006/03/02 03:00:36 dawes Exp $ */ + +/* + * Copyright © 2003-2006 David H. Dawes. + * Copyright © 2003-2006 X-Oz Technologies. + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by X-Oz Technologies + * (http://www.x-oz.com/)." Alternately, this acknowledgment may + * appear in the software itself, if and wherever such third-party + * acknowledgments normally appear. + * + * 4. Except as contained in this notice, the name of X-Oz + * Technologies shall not be used in advertising or otherwise to + * promote the sale, use or other dealings in this Software without + * prior written authorization from X-Oz Technologies. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL X-OZ TECHNOLOGIES OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +void LoaderTest(void); + Index: xc/programs/Xserver/hw/xfree86/common/xf86.h diff -u xc/programs/Xserver/hw/xfree86/common/xf86.h:3.185 xc/programs/Xserver/hw/xfree86/common/xf86.h:3.193 --- xc/programs/Xserver/hw/xfree86/common/xf86.h:3.185 Sat Feb 26 13:31:48 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86.h Mon Mar 20 22:56:26 2006 @@ -1,7 +1,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.185 2005/02/26 18:31:48 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.193 2006/03/21 03:56:26 dawes Exp $ */ /* - * Copyright (c) 1997-2005 by The XFree86 Project, Inc. + * Copyright (c) 1997-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -109,6 +109,9 @@ #else #include "xf86_ansic.h" #endif +#ifdef RANDR +#include +#endif #include "propertyst.h" @@ -172,7 +175,11 @@ void xf86FormatPciBusNumber(int busnum, char *buffer); pciVideoPtr *xf86GetPciVideoInfo(void); pciConfigPtr *xf86GetPciConfigInfo(void); -void xf86SetPciVideo(pciVideoPtr, resType); +void xf86SetPciVideo(pciVideoPtr pvp, resType rt); +Bool xf86CheckPciVideo(pciVideoPtr pvp, Bool *pActivate); +Bool xf86CheckPciSparseIO(int domain, IOADDRESS Base, int count, + memType mask, Bool *pUnRouted); +Bool xf86DomainHasBIOSSegments(int domain); void xf86PrintResList(int verb, resPtr list); resPtr xf86AddRangesToList(resPtr list, resRange *pRange, int entityIndex); int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active); @@ -416,7 +423,8 @@ int xf86RemoveInputHandler(pointer handler); void xf86DisableInputHandler(pointer handler); void xf86EnableInputHandler(pointer handler); -void xf86InterceptSignals(int *signo); +void xf86InterceptSignals(volatile int *signo); +void xf86ShowStackTrace(void); Bool xf86EnableVTSwitch(Bool new); Bool xf86CommonSpecialKey(int key, Bool down, int modifiers); void xf86ProcessActionEvent(ActionEvent action, void *arg); @@ -433,8 +441,8 @@ # define _printf_attribute(a,b) /**/ #endif -void xf86AddDriver(DriverPtr driver, pointer module, int flags); -void xf86DeleteDriver(int drvIndex, Bool deferUnload); +void xf86AddDriver(DriverPtr driver, ModuleDescPtr module, int flags); +void xf86DeleteDriver(int drvIndex); ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags); void xf86DeleteScreen(int scrnIndex, int flags); int xf86AllocateScrnInfoPrivateIndex(void); @@ -502,16 +510,28 @@ Bool xf86IsPc98(void); void xf86DisableRandR(void); CARD32 xf86GetVersion(void); -CARD32 xf86GetModuleVersion(pointer module); -pointer xf86LoadDrvSubModule(DriverPtr drv, const char *name); -pointer xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name); -pointer xf86LoadOneModule(char *name, pointer optlist); -void xf86UnloadSubModule(pointer mod); +CARD32 xf86GetModuleVersion(ModuleDescPtr module); +ModuleDescPtr xf86GetSubModuleByName(ModuleDescPtr mod, const char *name); +void xf86SetParentModuleRequirements(ModuleDescPtr module, XF86ModReqInfo *req); +ModuleDescPtr xf86LoadDrvSubModule(DriverPtr drv, const char *name); +ModuleDescPtr xf86LoadDrvSubModuleWithRequirements(DriverPtr drv, + const char *name, + XF86ModReqInfo *req); +ModuleDescPtr xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name); +ModuleDescPtr xf86LoadSubModuleWithRequirements(ScrnInfoPtr pScrn, + const char *name, + XF86ModReqInfo *req); +ModuleDescPtr xf86LoadOneModule(char *name, pointer optlist); +void xf86UnloadSubModule(ModuleDescPtr mod); Bool xf86LoaderCheckSymbol(const char *name); void xf86LoaderReqSymLists(const char **, ...); void xf86LoaderReqSymbols(const char *, ...); void xf86LoaderRefSymLists(const char **, ...); void xf86LoaderRefSymbols(const char *, ...); +int xf86LoaderModReqSymLists(ModuleDescPtr module, const char **, ...); +int xf86LoaderModReqSymbols(ModuleDescPtr module, const char *, ...); +void xf86LoaderModRefSymLists(ModuleDescPtr module, const char **, ...); +void xf86LoaderModRefSymbols(ModuleDescPtr module, const char *, ...); void xf86SetBackingStore(ScreenPtr pScreen); void xf86SetSilkenMouse(ScreenPtr pScreen); int xf86NewSerialNumber(WindowPtr p, pointer unused); @@ -566,7 +586,7 @@ DispPtr *pDisplay); #ifdef XFree86LOADER -void xf86AddModuleInfo(ModuleInfoPtr info, pointer module); +void xf86AddModuleInfo(ModuleInfoPtr info, ModuleDescPtr module); void xf86DeleteModuleInfo(int idx); #endif @@ -647,6 +667,7 @@ #ifdef RANDR Bool xf86RandRInit (ScreenPtr pScreen); void xf86RandRSetInitialMode (ScreenPtr pScreen); +Rotation xf86GetRotation(ScreenPtr pScreen); #endif /* xf86VidModeExtentionInit.c */ Index: xc/programs/Xserver/hw/xfree86/common/xf86AutoConfig.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86AutoConfig.c:1.8 xc/programs/Xserver/hw/xfree86/common/xf86AutoConfig.c:1.11 --- xc/programs/Xserver/hw/xfree86/common/xf86AutoConfig.c:1.8 Fri Feb 18 20:02:34 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86AutoConfig.c Thu Mar 16 11:49:55 2006 @@ -1,4 +1,3 @@ - /* * Copyright © 2003, 2004, 2005 David H. Dawes. * Copyright © 2003, 2004, 2005 X-Oz Technologies. @@ -10,7 +9,7 @@ * 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: - * + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer. * @@ -18,7 +17,7 @@ * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: "This product * includes software developed by X-Oz Technologies @@ -42,11 +41,11 @@ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * Author: David Dawes . */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86AutoConfig.c,v 1.8 2005/02/19 01:02:34 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86AutoConfig.c,v 1.11 2006/03/16 16:49:55 dawes Exp $ */ #include "xf86.h" #include "xf86Parser.h" @@ -79,7 +78,10 @@ #define BUILTIN_DEVICE_SECTION_PRE \ "Section \"Device\"\n" \ "\tIdentifier\t" BUILTIN_DEVICE_NAME "\n" \ - "\tDriver\t\"%s\"\n" + "\tDriver\t\"%s\"\n%s" + +#define BUILTIN_DEVICE_SECTION_BUSID \ + "\tBusID\t\"%s\"\n" #define BUILTIN_DEVICE_SECTION_POST \ "EndSection\n\n" @@ -196,16 +198,20 @@ char *driver = NULL; FILE *gp = NULL; XF86ConfigPtr pConfig; - Bool foundDev = FALSE; + char *busId = NULL, *busIdSpec; #ifdef SBUS_SUPPORT - char *promPath; + char *promPath = NULL; #endif /* Find the primary device, and get some information about it. */ if (xf86PciVideoInfo) { for (pciptr = xf86PciVideoInfo; (info = *pciptr); pciptr++) { if (xf86IsPrimaryPci(info)) { - foundDev = TRUE; + char busnum[8]; + + xf86FormatPciBusNumber(info->bus, busnum); + xasprintf(&busId, "PCI:%s:%d:%d", + busnum, info->device, info->func); break; } } @@ -216,7 +222,7 @@ xf86MsgVerb(X_INFO, 3, "AutoConfig: xf86PciVideoInfo is not set.\n"); } #ifdef SBUS_SUPPORT - if (!foundDev) { + if (!busId) { sbusDevicePtr psdp, *psdpp; Bool useProm = FALSE; @@ -226,11 +232,12 @@ for (psdpp = xf86SbusInfo; (psdp = *psdpp); psdpp++) { if (psdp->fd == -2) continue; - foundDev = TRUE; if (useProm && psdp->node.node) promPath = sparcPromNode2Pathname(&psdp->node); else xasprintf(&promPath, "fb%d", psdp->fbNum); + + xasprintf(&busId, "SBUS:%s", promPath); break; } if (useProm) @@ -241,11 +248,11 @@ } #endif - if (!foundDev) + if (!busId) { xf86Msg(X_WARNING, "AutoConfig: Cannot detect the primary video device.\n"); - - if (foundDev) { + busIdSpec = ""; + } else { char *tmp; char *path = NULL, *a, *b; char *searchPath = NULL; @@ -312,16 +319,7 @@ } strcat(searchPath, GETCONFIG_DIR); - if (info) { - xf86MsgVerb(X_INFO, 3, "AutoConfig: Primary PCI is %d:%d:%d\n", - info->bus, info->device, info->func); - } -#ifdef SBUS_SUPPORT - else if (promPath) { - xf86MsgVerb(X_INFO, 3, "AutoConfig: Primary SBUS is %s\n", - promPath); - } -#endif + xf86MsgVerb(X_INFO, 3, "AutoConfig: Primary is %s\n", busId); if (info) { snprintf(buf, sizeof(buf), "%s" @@ -367,6 +365,8 @@ } xfree(path); xfree(searchPath); + + xasprintf(&busIdSpec, BUILTIN_DEVICE_SECTION_BUSID, busId); } AppendToConfig(BUILTIN_MODULE_SECTION); @@ -374,7 +374,7 @@ if (driver) { snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION_PRE, - driver, 0, driver); + driver, 0, driver, busIdSpec); AppendToConfig(buf); xf86MsgVerb(X_INFO, 3, "AutoConfig: New driver is \"%s\".\n", driver); buf[0] = '\t'; @@ -393,12 +393,18 @@ Pclose(gp); for (p = deviceList; *p; p++) { - snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION, *p, 0, *p); + snprintf(buf, sizeof(buf), BUILTIN_DEVICE_SECTION, + *p, 0, *p, busIdSpec); AppendToConfig(buf); snprintf(buf, sizeof(buf), BUILTIN_SCREEN_SECTION, *p, 0, *p, 0); AppendToConfig(buf); } + if (busId) { + xfree(busId); + xfree(busIdSpec); + } + AppendToConfig(BUILTIN_LAYOUT_SECTION_PRE); if (driver) { snprintf(buf, sizeof(buf), BUILTIN_LAYOUT_SCREEN_LINE, driver, 0); @@ -425,7 +431,7 @@ for (p = builtinConfig; *p; p++) xf86ErrorFVerb(3, "\t%s", *p); xf86MsgVerb(X_DEFAULT, 3, "--- End of built-in configuration ---\n"); - + xf86setBuiltinConfig(builtinConfig); pConfig = (XF86ConfigPtr)(xf86Info.config); xf86Info.config = xf86parseConfigFile(pConfig); Index: xc/programs/Xserver/hw/xfree86/common/xf86Beta.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Beta.c:3.11 xc/programs/Xserver/hw/xfree86/common/xf86Beta.c:removed --- xc/programs/Xserver/hw/xfree86/common/xf86Beta.c:3.11 Fri Feb 13 18:58:36 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86Beta.c Tue May 9 21:56:34 2006 @@ -1,310 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Beta.c,v 3.11 2004/02/13 23:58:36 dawes Exp $ */ -/* - * Copyright (c) 1996-2002 by 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: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution, and in the same place and form as other copyright, - * license and disclaimer information. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: "This product - * includes software developed by The XFree86 Project, Inc - * (http://www.xfree86.org/) and its contributors", in the same - * place and form as other third-party acknowledgments. Alternately, - * this acknowledgment may appear in the software itself, in the - * same form and location as other such third-party acknowledgments. - * - * 4. Except as contained in this notice, the name of The XFree86 - * Project, Inc 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, Inc. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * This is for publicly released beta server binaries. - * - * The current version is written to $HOME/.xf86ServerName - * If $HOME isn't set (as may be the case when starting xdm at boot time) - * try '/'. - * - * Defining EXPIRE_SERVER enables the server expiry date. If EXPIRY_TIME - * is 0, this is disabled. - * - * Defining SHOW_BETA_MESSAGE enables displaying the beta message when first - * running a new beta version (the current version is checked against the - * contents of $HOME/.xf86ServerName) - * - * If EXPIRE_SERVER is defined, the message will be displayed both with - * WARNING_DAYS days of expiry and after expiry regardless of - * SHOW_BETA_MESSAGE. - * - * MESSAGE_SLEEP sets the sleep time (in seconds) after displaying the - * message. - */ - -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86_OSlib.h" -#include "xf86Version.h" - -#ifndef EXPIRY_TIME -#define EXPIRY_TIME 0 -#endif -#ifndef SHOW_BETA_MESSAGE -#if (XF86_VERSION_BETA > 0) && (XF86_VERSION_ALPHA == 0) -#define SHOW_BETA_MESSAGE -#endif -#endif -#ifndef EXPIRE_SERVER -#if (XF86_VERSION_BETA > 0) && (XF86_VERSION_ALPHA == 0) -#define EXPIRE_SERVER -#endif -#endif -#ifndef MESSAGE_SLEEP -#define MESSAGE_SLEEP 10 -#endif -#ifndef WARNING_DAYS -#define WARNING_DAYS 7 -#endif -#define DAY_IN_SECONDS (24 * 60 * 60) - -#define XOR_VALUE_1 0x39479da4L -#define XOR_VALUE_2 0x7df6324bL -#define KEY_LENGTH 16 - -void -xf86CheckBeta(int extraDays, char *key) -{ - FILE *m = NULL; - Bool showmessage = FALSE; - Bool expired = FALSE; - Bool expiresoon = FALSE; - Bool requireconfirm = FALSE; - int expiryextended = 0; -#ifdef SHOW_BETA_MESSAGE - FILE *f = NULL; - char *home = NULL; - char *filename = NULL; - Bool writefile = FALSE; - char oldvers[16] = {0, }; -#endif - time_t expirytime = EXPIRY_TIME; - - /* - * Check if the beta message should be displayed. It is displayed when - * the version doesn't match that in $HOME/.XFree86, and when within - * one week of the expiry date. - */ - -#ifdef SHOW_BETA_MESSAGE - if (!(home = getenv("HOME"))) - home = "/"; - { - char homebuf[PATH_MAX]; - /* getenv might return R/O memory, as with OS/2 */ - strncpy(homebuf,home,PATH_MAX-1); - homebuf[PATH_MAX-1] = '\0'; - home = homebuf; - - if (!(filename = - (char *)ALLOCATE_LOCAL(strlen(home) + - strlen(xf86ServerName) + 3))) - showmessage = TRUE; - else { - if (home[0] == '/' && home[1] == '\0') - home[0] = '\0'; - sprintf(filename, "%s/.%s", home, xf86ServerName); - writefile = TRUE; - if (!(f = fopen(filename, "r+"))) - showmessage = TRUE; - else { - fgets(oldvers, 16, f); - if (strncmp(oldvers, XF86_VERSION, 15)) { - showmessage = TRUE; - } - fclose(f); - } - } - } -#endif -#ifdef EXPIRE_SERVER - if (expirytime != 0) { - if (extraDays > 0 && key != NULL && strlen(key) == KEY_LENGTH) { - time_t newExpiry; - unsigned long key1, key2; - char tmp[9]; - - strncpy(tmp, key, 8); - tmp[8] = '\0'; - key1 = strtoul(tmp, NULL, 16); - key2 = strtoul(key + 8, NULL, 16); - newExpiry = expirytime + extraDays * DAY_IN_SECONDS; - if ((newExpiry ^ key1) == XOR_VALUE_1 && - (newExpiry ^ key2) == XOR_VALUE_2) { - expirytime = newExpiry; - expiryextended = extraDays; - } - } - if (time(NULL) > expirytime) { - showmessage = TRUE; - expired = TRUE; - } else if (expirytime - time(NULL) < WARNING_DAYS * (DAY_IN_SECONDS)) { - showmessage = TRUE; - expiresoon = TRUE; - } - } -#endif - - if (showmessage) { - -#if 0 - /* - * This doesn't work very well. stdin is usually closed, and even if - * the server doesn't close it, xinit prevents this from being useful. - */ - /* Check if stderr is a tty */ - if (isatty(fileno(stderr))) { - requireconfirm = TRUE; - } -#endif - -#if 0 - /* This doesn't work when the server is started by xinit */ - /* See if /dev/tty can be opened */ - m = fopen("/dev/tty", "r+"); -#endif - - if (m) - requireconfirm = TRUE; - else - m = stderr; - if (m) { - putc('\007', m); - fprintf(m, "\n"); - fprintf(m, " This is a beta version of XFree86.\n\n"); - fprintf(m, " This binary may be redistributed providing it is not" - " modified in any way.\n\n"); - fprintf(m, " Please send success and problem reports to" - " .\n\n"); - if (expired) { - fprintf(m, " This version (%s) has expired.\n", XF86_VERSION); - fprintf(m, " Please get the release version or a newer beta" - " version.\n"); - } else if (expiresoon) { - fprintf(m, " WARNING! This version (%s) will expire in less than" - " %ld day(s)\n at %s\n", XF86_VERSION, - (long)(expirytime - time(NULL)) / DAY_IN_SECONDS + 1, - ctime(&expirytime)); - fprintf(m, " Please get the release version or a newer beta" - " version.\n"); - } else if (expirytime != 0) { - fprintf(m, " This version (%s) will expire at %s\n", XF86_VERSION, - ctime(&expirytime)); - } - if (!expired && expiryextended) { - fprintf(m, " Note: the expiry date has been extended by %d days\n", - expiryextended); - } - - if (!expired) { - if (requireconfirm) { - char c[2]; - fflush(m); - fprintf(m, "\nHit to continue: "); - fflush(m); - fgets(c, 2, m); - } else { - fflush(m); - fprintf(m, "\nWaiting for %d seconds...", MESSAGE_SLEEP); - fflush(m); - sleep(MESSAGE_SLEEP); - fprintf(m, "\n"); - } - } - fprintf(m, "\n"); - if (m != stderr) - fclose(m); - } - } -#ifdef SHOW_BETA_MESSAGE - -#define WRITE_BETA_FILE { \ - unlink(filename); \ - if (f = fopen(filename, "w")) { \ - fprintf(f, XF86_VERSION); \ - fclose(f); \ - } \ - } - - if (writefile) { -#if !defined(__UNIXOS2__) -#if defined(SYSV) || defined(linux) - /* Need to fork to change to ruid without loosing euid */ - if (getuid() != 0) { - switch (fork()) { - case -1: - FatalError("xf86CheckBeta(): fork failed (%s)\n", strerror(errno)); - break; - case 0: /* child */ - setuid(getuid()); - WRITE_BETA_FILE - exit(0); - break; - default: /* parent */ - wait(NULL); - } - } else { - WRITE_BETA_FILE - } -#else /* ! (SYSV || linux) */ - { - int realuid = getuid(); -#if !defined(SVR4) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__GNU__) - setruid(0); -#endif - seteuid(realuid); - WRITE_BETA_FILE - seteuid(0); -#if !defined(SVR4) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__GNU__) - setruid(realuid); -#endif - } -#endif /* SYSV || linux */ -#else /* __UNIXOS2__ */ - WRITE_BETA_FILE -#endif /* __UNIXOS2__ */ - } - if (filename) { - DEALLOCATE_LOCAL(filename); - filename = NULL; - } -#endif - if (expired) - exit(1); -} Index: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Bus.c:1.88 xc/programs/Xserver/hw/xfree86/common/xf86Bus.c:1.93 --- xc/programs/Xserver/hw/xfree86/common/xf86Bus.c:1.88 Thu Feb 17 20:52:59 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86Bus.c Fri Oct 14 11:16:32 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.88 2005/02/18 01:52:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.93 2005/10/14 15:16:32 tsi Exp $ */ /* * Copyright (c) 1997-2005 by The XFree86 Project, Inc. * All rights reserved. @@ -54,7 +54,7 @@ #include #include #include -#include "X.h" +#include #include "os.h" #include "xf86.h" #include "xf86Priv.h" @@ -160,7 +160,7 @@ return BUS_NONE; } if (!xf86NameCmp(p, "pci") || !xf86NameCmp(p, "agp")) - ret = BUS_PCI; + ret = BUS_PCI; if (!xf86NameCmp(p, "isa")) ret = BUS_ISA; if (!xf86NameCmp(p, "sbus")) @@ -183,7 +183,7 @@ resPtr *pprev_next; resPtr res; xf86AccessPtr pacc; - + for (i = 0; i < xf86NumEntities; i++) if (xf86Entities[i]->entityInit) { if (xf86Entities[i]->access->busAcc) @@ -198,11 +198,11 @@ /* remove init resources after init is processed */ pprev_next = &Acc; res = Acc; - while (res) { + while (res) { if (res->res_type & ResInit && (res->entityIndex == i)) { (*pprev_next) = res->next; xfree(res); - } else + } else pprev_next = &(res->next); res = (*pprev_next); } @@ -217,7 +217,7 @@ sizeof(EntityPtr) * xf86NumEntities); xf86Entities[xf86NumEntities - 1] = xnfcalloc(1,sizeof(EntityRec)); xf86Entities[xf86NumEntities - 1]->entityPrivates = - xnfcalloc(sizeof(DevUnion) * xf86EntityPrivateCount, 1); + xnfcalloc(sizeof(DevUnion) * xf86EntityPrivateCount, 1); return (xf86NumEntities - 1); } @@ -226,7 +226,7 @@ { int i; xf86AccessPtr pacc; - + for (i = 0; i < xf86NumEntities; i++) if (xf86Entities[i]->entityEnter) { if (xf86Entities[i]->access->busAcc) @@ -264,8 +264,13 @@ Bool xf86IsEntityPrimary(int entityIndex) { - EntityPtr pEnt = xf86Entities[entityIndex]; - + EntityPtr pEnt; + + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) + return FALSE; + + pEnt = xf86Entities[entityIndex]; + if (primaryBus.type != pEnt->busType) return FALSE; switch (pEnt->busType) { @@ -281,13 +286,14 @@ return FALSE; } } - + Bool xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter, EntityProc leave, pointer private) { - if (entityIndex >= xf86NumEntities) + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) return FALSE; + xf86Entities[entityIndex]->entityInit = init; xf86Entities[entityIndex]->entityEnter = enter; xf86Entities[entityIndex]->entityLeave = leave; @@ -300,7 +306,7 @@ { int i; for (i = 0; i < xf86NumEntities; i++) { - if (xf86Entities[i]->driver == drvp && xf86Entities[i]->inUse) + if (xf86Entities[i]->driver == drvp && xf86Entities[i]->inUse) return TRUE; } return FALSE; @@ -319,8 +325,9 @@ void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex) { - if (entityIndex == -1) + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) return; + if (xf86Entities[entityIndex]->inUse && !(xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL)) FatalError("Requested Entity already in use!\n"); @@ -343,7 +350,7 @@ { int i; - if (entityIndex == -1 || entityIndex >= xf86NumEntities) + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) return; for (i = 0; i < pScrn->numEntities; i++) { @@ -363,8 +370,9 @@ { int i,j; - if (entityIndex == -1) return NULL; - + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) + return NULL; + if (xf86Screens) { for (i = 0; i < xf86NumScreens; i++) { for (j = 0; j < xf86Screens[i]->numEntities; j++) { @@ -382,7 +390,10 @@ int i; EntityAccessPtr *ptr = (EntityAccessPtr *)&pScrn->access; EntityAccessPtr peacc; - + + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) + return; + for (i = 0; i < pScrn->numEntities; i++) { if (pScrn->entityList[i] == entityIndex) { peacc = xf86Entities[pScrn->entityList[i]]->access; @@ -413,9 +424,9 @@ ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; EntityAccessPtr peacc; int i, entityIndex; - + if (pScrn->entityList == NULL || pScrn->numEntities == 0) return; - + for (i = 0; i < pScrn->numEntities; i++) { entityIndex = pScrn->entityList[i]; xf86Entities[entityIndex]->inUse = FALSE; @@ -447,12 +458,12 @@ resPtr res = Acc; while (res) { - if (res->entityIndex == entityIndex && + if ((res->entityIndex == entityIndex) && (type & ResAccMask & res->res_type)) { (*pprev_next) = res->next; xfree(res); - } else + } else pprev_next = &(res->next); res = (*pprev_next); } @@ -466,10 +477,10 @@ xf86AddDevToEntity(int entityIndex, GDevPtr dev) { EntityPtr pEnt; - - if (entityIndex >= xf86NumEntities) + + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) return; - + pEnt = xf86Entities[entityIndex]; pEnt->numInstances++; pEnt->devices = xnfrealloc(pEnt->devices, @@ -488,10 +499,10 @@ { EntityInfoPtr pEnt; int i; - - if (entityIndex >= xf86NumEntities) + + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) return NULL; - + pEnt = xnfcalloc(1,sizeof(EntityInfoRec)); pEnt->index = entityIndex; pEnt->location = xf86Entities[entityIndex]->bus; @@ -500,23 +511,23 @@ pEnt->resources = xf86Entities[entityIndex]->resources; pEnt->driver = xf86Entities[entityIndex]->driver; if ( (xf86Entities[entityIndex]->devices) && - (xf86Entities[entityIndex]->devices[0]) ) { + (xf86Entities[entityIndex]->devices[0]) ) { for (i = 0; i < xf86Entities[entityIndex]->numInstances; i++) if (xf86Entities[entityIndex]->devices[i]->screen == 0) - break; + break; pEnt->device = xf86Entities[entityIndex]->devices[i]; } else pEnt->device = NULL; - + return pEnt; } int xf86GetNumEntityInstances(int entityIndex) { - if (entityIndex >= xf86NumEntities) + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) return -1; - + return xf86Entities[entityIndex]->numInstances; } @@ -524,16 +535,19 @@ xf86GetDevFromEntity(int entityIndex, int instance) { int i; - + + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) + return NULL; + /* We might not use AddDevtoEntity */ if ( (!xf86Entities[entityIndex]->devices) || - (!xf86Entities[entityIndex]->devices[0]) ) + (!xf86Entities[entityIndex]->devices[0]) ) return NULL; - if (entityIndex >= xf86NumEntities || - instance >= xf86Entities[entityIndex]->numInstances) + if ((instance < 0) || + (instance >= xf86Entities[entityIndex]->numInstances)) return NULL; - + for (i = 0; i < xf86Entities[entityIndex]->numInstances; i++) if (xf86Entities[entityIndex]->devices[i]->screen == instance) break; @@ -549,7 +563,7 @@ int i; xf86AccessPtr pacc; EntityAccessPtr peacc; - + /* call disable funcs and reset current access pointer */ /* the entity specific access funcs are in an enabled */ /* state - driver must restore their state explicitely */ @@ -571,7 +585,7 @@ } /* then call the generic entity disable funcs */ for (i = 0; i < xf86NumEntities; i++) { - pacc = xf86Entities[i]->access->fallback; + pacc = xf86Entities[i]->access->fallback; if (pacc->AccessDisable) pacc->AccessDisable(pacc->arg); } @@ -581,7 +595,7 @@ clearAccess(void) { int i; - + /* call disable funcs and reset current access pointer */ /* the entity specific access funcs are in an enabled */ /* state - driver must restore their state explicitely */ @@ -607,18 +621,18 @@ initPciBusState(); DisablePciBusAccess(); DisablePciAccess(); - + xf86ResAccessEnter = TRUE; } /* - * xf86AccessEnter() -- gets called to save the text mode VGA IO + * xf86AccessEnter() -- gets called to save the text mode VGA IO * resources when reentering the server after a VT switch. */ void xf86AccessEnter(void) { - if (xf86ResAccessEnter) + if (xf86ResAccessEnter) return; /* @@ -669,7 +683,7 @@ * xf86AccessRestoreState() - Restore the access registers to the * state before X was started. This is handy for framebuffers. */ -static void +static void xf86AccessRestoreState(void) { if (!xf86ResAccessEnter) @@ -698,22 +712,22 @@ ScrnInfoPtr xf86CurrentScreen = NULL; #define SETUP_Q org = AsyncQ; \ - AsyncQ = &new; + AsyncQ = &new; #define PROCESS_Q xf86CurrentScreen = pScrn; - if (!new) AsyncQ = org; \ - else { \ - AsyncQPtr tmp_Q; \ - while (1) {\ - new->func(new->arg);\ - if (!(new->next)) {\ + if (!new) AsyncQ = org; \ + else { \ + AsyncQPtr tmp_Q; \ + while (1) {\ + new->func(new->arg);\ + if (!(new->next)) {\ AsyncQ = org; xfree(new); break; \ } \ tmp_Q = new->next; \ - xfree(new); \ - new = tmp_Q; \ + xfree(new); \ + new = tmp_Q; \ } \ - } + } #else #define SETUP_Q #define PROCESS_Q @@ -743,7 +757,7 @@ } return; } - + switch (pScrn->resourceType) { case IO: pceAcc = pScrn->CurrentAccess->pIoAccess; @@ -755,7 +769,7 @@ pScrn->CurrentAccess->pMemAccess = NULL; while (pceAcc) { pAcc = pceAcc->pAccess; - if ( pAcc && pAcc->AccessDisable) + if ( pAcc && pAcc->AccessDisable) (*pAcc->AccessDisable)(pAcc->arg); pceAcc = pceAcc->next; } @@ -763,14 +777,14 @@ ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess); while (peAcc) { pAcc = peAcc->pAccess; - if (pAcc && pAcc->AccessEnable) + if (pAcc && pAcc->AccessEnable) (*pAcc->AccessEnable)(pAcc->arg); peAcc = peAcc->next; } pScrn->CurrentAccess->pIoAccess = (EntityAccessPtr) pScrn->access; PROCESS_Q; return; - + case MEM_IO: pceAcc = pScrn->CurrentAccess->pIoAccess; if (peAcc != pceAcc) { /* current Io != pAccess */ @@ -800,7 +814,7 @@ SETUP_Q; while (pceAcc) { /* current Mem != pAccess */ pAcc = pceAcc->pAccess; - if (pAcc && pAcc->AccessDisable) + if (pAcc && pAcc->AccessDisable) (*pAcc->AccessDisable)(pAcc->arg); pceAcc = pceAcc->next; } @@ -809,7 +823,7 @@ ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess); while (peAcc) { pAcc = peAcc->pAccess; - if (pAcc && pAcc->AccessEnable) + if (pAcc && pAcc->AccessEnable) (*pAcc->AccessEnable)(pAcc->arg); peAcc = peAcc->next; } @@ -817,7 +831,7 @@ pScrn->CurrentAccess->pIoAccess = (EntityAccessPtr) pScrn->access; PROCESS_Q; return; - + case MEM: pceAcc = pScrn->CurrentAccess->pMemAccess; if (peAcc == pceAcc) { @@ -828,7 +842,7 @@ pScrn->CurrentAccess->pIoAccess = NULL; while (pceAcc) { pAcc = pceAcc->pAccess; - if ( pAcc && pAcc->AccessDisable) + if ( pAcc && pAcc->AccessDisable) (*pAcc->AccessDisable)(pAcc->arg); pceAcc = pceAcc->next; } @@ -836,7 +850,7 @@ ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess); while (peAcc) { pAcc = peAcc->pAccess; - if (pAcc && pAcc->AccessEnable) + if (pAcc && pAcc->AccessEnable) (*pAcc->AccessEnable)(pAcc->arg); peAcc = peAcc->next; } @@ -861,7 +875,7 @@ register EntityAccessPtr pceAcc = NULL; register xf86AccessPtr pAcc; - + switch(pScrn->resourceType) { case IO: pceAcc = pScrn->CurrentAccess->pIoAccess; @@ -881,10 +895,10 @@ pAcc = pceAcc->pAccess; if ( pAcc) { if (!Enable) { - if (pAcc->AccessDisable) + if (pAcc->AccessDisable) (*pAcc->AccessDisable)(pAcc->arg); } else { - if (pAcc->AccessEnable) + if (pAcc->AccessEnable) (*pAcc->AccessEnable)(pAcc->arg); } } @@ -911,11 +925,11 @@ xf86Entities[pEnt->index]->entityProp |= NO_SEPARATE_MEM_FROM_IO; if (funcs->io == funcs->io_mem && funcs->mem && funcs->io) xf86Entities[pEnt->index]->entityProp |= NO_SEPARATE_IO_FROM_MEM; - + rac->mem_new = funcs->mem; rac->io_new = funcs->io; rac->io_mem_new = funcs->io_mem; - + rac->old = oldFuncs; } @@ -928,10 +942,10 @@ { memType mask = 0; memType tmp = 0; - + mask=~mask; tmp = ~((~tmp) >> 1); - + while (!(val & tmp)) { mask = mask >> 1; val = val << 1; @@ -948,7 +962,7 @@ { memType val,tmp,prev; int i; - + switch (pRes->res_type & ResExtMask) { case ResBlock: if (range->rBegin < pRes->block_end && @@ -963,7 +977,7 @@ return 0; case ResSparse: if (pRes->sparse_base > range->rEnd) return 0; - + val = (~pRes->sparse_mask | pRes->sparse_base) & getMask(range->rEnd); #ifdef DEBUG ErrorF("base = 0x%lx, mask = 0x%lx, begin = 0x%lx, end = 0x%lx ," @@ -973,7 +987,7 @@ #endif i = sizeof(memType) * 8; tmp = prev = pRes->sparse_base; - + while (i) { tmp |= 1<< (--i) & val; if (tmp > range->rEnd) @@ -1006,7 +1020,7 @@ { memType val, tmp, prev; int i; - + switch (pRes->res_type & ResExtMask) { case ResSparse: tmp = pRes->sparse_mask & range->rMask; @@ -1021,11 +1035,11 @@ case ResBlock: if (pRes->block_end < range->rBase) return 0; - + val = (~range->rMask | range->rBase) & getMask(pRes->block_end); i = length; tmp = prev = range->rBase; - + while (i) { #ifdef DEBUG ErrorF("tmp = 0x%lx\n",tmp); @@ -1036,7 +1050,7 @@ else prev = tmp; } - if (tmp < pRes->block_begin) + if (tmp < pRes->block_begin) return 0; else { /* @@ -1045,14 +1059,14 @@ * This might be done in a simpler way.... */ memType mask, m_mask = 0, base = pRes->block_begin; - int i; + int i; while (base < pRes->block_end) { for (i = 1; i < length; i++) if ( base != (base & (mt_max << i))) break; mask = mt_max >> (length - i); do mask >>= 1; while ((mask + base + 1) > pRes->block_end); - /* m_mask and are _inverted_ sparse masks */ + /* m_mask and are _inverted_ sparse masks */ m_mask = mask > m_mask ? mask : m_mask; base = base + mask + 1; } @@ -1061,7 +1075,7 @@ ErrorF("b-b conflict w: %lx %lx\n", pRes->block_begin,pRes->block_end); #endif - return ~m_mask; + return ~m_mask; } } return 0; @@ -1085,9 +1099,9 @@ /* Ignore overlapped ranges that have been nullified */ if ((pRes->res_type & ResOverlap) && (pRes->block_begin > pRes->block_end)) return FALSE; - + if ((pRes->res_type & ResTypeMask) != (type & ResTypeMask)) - return FALSE; + return FALSE; /* * Resources set by BIOS (ResBios) are allowed to conflict @@ -1095,13 +1109,13 @@ */ if (pRes->res_type & type & ResBios) return FALSE; - + /*If requested, skip over estimated resources */ if (pRes->res_type & type & ResEstimated) - return FALSE; - + return FALSE; + if (type & pRes->res_type & ResUnused) - return FALSE; + return FALSE; if (state == OPERATING) { if (type & ResDisableOpr || pRes->res_type & ResDisableOpr) @@ -1115,10 +1129,10 @@ (type & ResUnused && pRes->res_type & ResUnusedOpr)) return FALSE; } - - if (entityIndex > -1) + + if ((entityIndex >= 0) && (entityIndex < xf86NumEntities)) loc = xf86Entities[entityIndex]->busType; - if (pRes->entityIndex > -1) + if ((pRes->entityIndex >= 0) && (pRes->entityIndex < xf86NumEntities)) r_loc = xf86Entities[pRes->entityIndex]->busType; switch (type & ResAccMask) { @@ -1137,7 +1151,7 @@ switch (pRes->res_type & ResAccMask) { case ResExclusive: /* ISA buses are only locally exclusive on a PCI system */ - if (loc == BUS_PCI && r_loc == BUS_ISA) + if (loc == BUS_PCI && r_loc == BUS_ISA) return FALSE; break; case ResShared: @@ -1147,11 +1161,10 @@ case ResAny: break; } - + if (pRes->entityIndex == entityIndex) return FALSE; - if (pRes->entityIndex > -1 && - (pScrn = xf86FindScreenForEntity(entityIndex))) { + if ((pScrn = xf86FindScreenForEntity(entityIndex))) { for (i = 0; i < pScrn->numEntities; i++) if (pScrn->entityList[i] == pRes->entityIndex) return FALSE; } @@ -1167,11 +1180,11 @@ xf86State state, Bool ignoreIdentical) { memType ret; - + while(pRes) { - if (!needCheck(pRes,rgp->type, entityIndex ,state)) { - pRes = pRes->next; - continue; + if (!needCheck(pRes,rgp->type, entityIndex ,state)) { + pRes = pRes->next; + continue; } switch (rgp->type & ResExtMask) { case ResBlock: @@ -1268,15 +1281,15 @@ } break; } - + new = xnfalloc(sizeof(resRec)); - /* - * Only background resources may be registered with ResBios + /* + * Only background resources may be registered with ResBios * and ResEstimated set. Other resources only set it for * testing. */ - if (entityIndex != (-1)) - range->type &= ~(ResBios | ResEstimated); + if (entityIndex != (-1)) + range->type &= ~(ResBios | ResEstimated); new->val = *range; new->entityIndex = entityIndex; new->next = rlist; @@ -1323,7 +1336,7 @@ const char *s, *r; resPtr tmp = list; unsigned long type; - + if (!list) return; @@ -1342,7 +1355,7 @@ list->block_end - list->block_begin + 1); break; case ResSparse: - xf86ErrorFVerb(verb, "\t[%d] %d\t%ld\t0x%08lx - 0x%08lx ", + xf86ErrorFVerb(verb, "\t[%d] %d\t%ld\t0x%08lx - 0x%08lx", i, list->entityIndex, (list->res_type & ResDomain) >> 24, list->sparse_base,list->sparse_mask); @@ -1446,7 +1459,7 @@ /* Bus dep initialization */ resPci = ResourceBrokerInitPci(&osRes); Acc = xf86JoinResLists(xf86DupResList(osRes), resPci); - + xf86MsgVerb(X_INFO, 3, "All system resource ranges:\n"); xf86PrintResList(3, Acc); @@ -1531,7 +1544,7 @@ #define ALIGN(x,a) ((x) + a) &~(a) -resRange +resRange xf86GetBlock(unsigned long type, memType size, memType window_start, memType window_end, memType align_mask, resPtr avoid) @@ -1539,7 +1552,7 @@ 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!:" @@ -1548,7 +1561,7 @@ 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) @@ -1568,7 +1581,7 @@ tmp = ChkConflict(&r,avoid,SETUP); if (!tmp) { return r; - } + } } min = ALIGN(tmp,align_mask); } @@ -1583,7 +1596,7 @@ #define length sizeof(memType) * 8 /* * make_base() -- assign the lowest bits to the bits set in mask. - * example: mask 011010 val 0000110 -> 011000 + * example: mask 011010 val 0000110 -> 011000 */ static memType make_base(memType val, memType mask) @@ -1609,7 +1622,7 @@ { int i,j = 0; memType ret = 0; - + for (i = 0;i> i) & 1) << j); @@ -1623,7 +1636,7 @@ fix_counter(memType val, memType old_mask, memType mask) { mask = old_mask & mask; - + val = make_base(val,old_mask); return unmake_base(val,mask); } @@ -1641,7 +1654,7 @@ memType max_counter = ~(memType)0; memType max_counter1; memType conflict = 0; - + /* for sanity */ type = (type & ~(ResExtMask | ResBios | ResEstimated)) | ResSparse; @@ -1705,7 +1718,7 @@ mask1 = decode_mask & ~new_mask; max_counter1 = fix_counter(mt_max,mt_max,mask1); counter = 0; - + while (1) { counter1 = 0; while (1) { @@ -1739,8 +1752,9 @@ static resList xf86GetResourcesImplicitly(int entityIndex) { - if (entityIndex >= xf86NumEntities) return NULL; - + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) + return NULL; + switch (xf86Entities[entityIndex]->bus.type) { case BUS_ISA: case BUS_NONE: @@ -1757,6 +1771,9 @@ static void convertRange2Host(int entityIndex, resRange *pRange) { + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) + return; + if (pRange->type & ResBus) { switch (xf86Entities[entityIndex]->busType) { case BUS_PCI: @@ -1792,7 +1809,7 @@ if (!list) return NULL; list_f = list; } - + while(list->type != ResEnd) { range = *list; @@ -1801,10 +1818,10 @@ if ((access != ResNone) && (access & ResAccMask)) { range.type = (range.type & ~ResAccMask) | (access & ResAccMask); } - range.type &= ~ResEstimated; /* Not allowed for drivers */ + range.type &= ~ResEstimated; /* Not allowed for drivers */ #if !(defined(__alpha__) && defined(linux)) /* On Alpha Linux, do not check for conflicts, trust the kernel. */ - if (checkConflict(&range, Acc, entityIndex, SETUP,TRUE)) + if (checkConflict(&range, Acc, entityIndex, SETUP,TRUE)) res = xf86AddResToList(res,&range,entityIndex); else #endif @@ -1825,7 +1842,7 @@ xf86PrintResList(3, res); #endif return res; - + } static void @@ -1833,7 +1850,7 @@ xf86AccessPtr *acc_io, xf86AccessPtr *acc_mem_io) { pciAccPtr *ppaccp; - + switch (pEnt->bus.type) { case BUS_ISA: case BUS_SBUS: @@ -1867,7 +1884,7 @@ xf86AccessPtr acc_mem, acc_io, acc_mem_io; xf86AccessPtr org_mem = NULL, org_io = NULL, org_mem_io = NULL; int prop; - + busTypeSpecific(pEnt,state,&acc_mem,&acc_io,&acc_mem_io); /* The replacement function needs to handle _all_ shared resources */ @@ -1880,11 +1897,11 @@ if (pEnt->rac->mem_new) { org_mem = acc_mem; acc_mem = pEnt->rac->mem_new; - } + } if (pEnt->rac->io_mem_new) { org_mem_io = acc_mem_io; acc_mem_io = pEnt->rac->io_mem_new; - } + } } prop = pEnt->entityProp; @@ -1906,7 +1923,7 @@ pEnt->access->pAccess = NULL; /* remove from RAC */ break; } - + if (org_io) { /* does the driver want the old access func? */ if (pEnt->rac->old) { @@ -1961,7 +1978,7 @@ } /* disable shared resources */ - if (pEnt->access->pAccess + if (pEnt->access->pAccess && pEnt->access->pAccess->AccessDisable) pEnt->access->pAccess->AccessDisable(pEnt->access->pAccess->arg); @@ -1977,7 +1994,7 @@ ((BusAccPtr)pEnt->busAcc)->set_f(pEnt->busAcc); } - + /* * xf86EnterServerState() -- set state the server is in. */ @@ -1991,11 +2008,11 @@ static TriState sigio_blocked = TRI_UNSET; if ((state == SETUP) && (sigio_blocked != TRI_TRUE)) { - sigio_state = xf86BlockSIGIO(); + sigio_state = xf86BlockSIGIO(); sigio_blocked = TRI_TRUE; } else if ((state == OPERATING) && (sigio_blocked != TRI_UNSET)) { - xf86UnblockSIGIO(sigio_state); - sigio_blocked = TRI_FALSE; + xf86UnblockSIGIO(sigio_state); + sigio_blocked = TRI_FALSE; } } @@ -2007,11 +2024,11 @@ int i,j; int needVGA = 0; resType rt; - /* + /* * This is a good place to block SIGIO during SETUP state. * SIGIO should be blocked in SETUP state otherwise (u)sleep() - * might get interrupted early. - * We take care not to call xf86BlockSIGIO() twice. + * might get interrupted early. + * We take care not to call xf86BlockSIGIO() twice. */ SetSIGIOForState(state); #ifdef DEBUG @@ -2028,17 +2045,17 @@ pScrn = xf86Screens[i]; j = pScrn->entityList[pScrn->numEntities - 1]; pScrn->access = xf86Entities[j]->access; - - for (j = 0; jnumEntities; j++) { - pEnt = xf86Entities[xf86Screens[i]->entityList[j]]; - if (pEnt->entityProp & (state == SETUP ? NEED_VGA_ROUTED_SETUP - : NEED_VGA_ROUTED)) + + for (j = 0; jnumEntities; j++) { + pEnt = xf86Entities[xf86Screens[i]->entityList[j]]; + if (pEnt->entityProp & (state == SETUP ? NEED_VGA_ROUTED_SETUP + : NEED_VGA_ROUTED)) xf86Screens[i]->busAccess = pEnt->busAcc; - } + } if (xf86Screens[i]->busAccess) needVGA ++; } - + /* * if we just have one screen we don't have RAC. * Therefore just enable the screen and return. @@ -2048,17 +2065,17 @@ notifyStateChange(NOTIFY_ENABLE); return; } - + if (state == SETUP) notifyStateChange(NOTIFY_SETUP_TRANSITION); else notifyStateChange(NOTIFY_OPERATING_TRANSITION); - + clearAccess(); for (i=0; inumEntities; j++) { pEnt = xf86Entities[xf86Screens[i]->entityList[j]]; setAccess(pEnt,state); @@ -2076,7 +2093,7 @@ if (needVGA < 2) xf86Screens[i]->busAccess = NULL; } - + #ifdef DEBUG if (xf86Screens[i]->busAccess) ErrorF("Screen %i setting vga route\n",i); @@ -2111,7 +2128,7 @@ resPtr acc; resPtr r_fail = NULL; resRange range; - + while (list->type != ResEnd) { range = *list; convertRange2Host(entityIndex,&range); @@ -2119,7 +2136,7 @@ acc = Acc; while (acc) { #define MASK (ResTypeMask | ResExtMask) - if ((acc->entityIndex == entityIndex) + if ((acc->entityIndex == entityIndex) && (acc->val.a == range.a) && (acc->val.b == range.b) && ((acc->val.type & MASK) == (range.type & MASK))) break; @@ -2134,7 +2151,7 @@ } list ++; } - + return r_fail; } @@ -2188,29 +2205,30 @@ xf86ClaimFixedResources(resList list, int entityIndex) { resPtr ptr = NULL; - resRange range; + resRange range; + + if (!list || (entityIndex < 0) || (entityIndex >= xf86NumEntities)) + return; - if (!list) return; - - while (list->type !=ResEnd) { - range = *list; + while (list->type != ResEnd) { + range = *list; convertRange2Host(entityIndex,&range); - range.type &= ~ResEstimated; /* Not allowed for drivers */ - switch (range.type & ResAccMask) { - case ResExclusive: - if (!xf86ChkConflict(&range, entityIndex)) { - Acc = xf86AddResToList(Acc, &range, entityIndex); + range.type &= ~ResEstimated; /* Not allowed for drivers */ + switch (range.type & ResAccMask) { + case ResExclusive: + if (!xf86ChkConflict(&range, entityIndex)) { + Acc = xf86AddResToList(Acc, &range, entityIndex); #ifdef REDUCER } else { - range.type |= ResEstimated; - if (!xf86ChkConflict(&range, entityIndex) && - !checkConflict(&range, AccReducers, entityIndex, + range.type |= ResEstimated; + if (!xf86ChkConflict(&range, entityIndex) && + !checkConflict(&range, AccReducers, entityIndex, SETUP, FALSE)) { - range.type &= ~(ResEstimated | ResBios); - AccReducers = - xf86AddResToList(AccReducers, &range, entityIndex); + range.type &= ~(ResEstimated | ResBios); + AccReducers = + xf86AddResToList(AccReducers, &range, entityIndex); #endif } else resError(&range); /* no return */ #ifdef REDUCER @@ -2232,6 +2250,7 @@ } list++; } + xf86Entities[entityIndex]->resources = xf86JoinResLists(xf86Entities[entityIndex]->resources,ptr); xf86MsgVerb(X_INFO, 3, @@ -2338,11 +2357,11 @@ resPtr resp, acc, tmp, resp_x, *pprev_next; if (fbSlotClaimed) { - if (pciSlotClaimed || isaSlotClaimed + if (pciSlotClaimed || isaSlotClaimed #if defined(__sparc__) && !defined(__OpenBSD__) || sbusSlotClaimed #endif - ) { + ) { FatalError("Cannot run in framebuffer mode. Please specify busIDs " " for all framebuffer devices\n"); return; @@ -2362,7 +2381,7 @@ if (tmp->res_type & ResInit) { (*pprev_next) = tmp->next; xfree(tmp); - } else + } else pprev_next = &(tmp->next); tmp = (*pprev_next); } @@ -2373,7 +2392,7 @@ resp_x = NULL; while (resp) { if (! (val = checkConflict(&resp->val,acc,i,SETUP,FALSE))) { - resp->res_type &= ~(ResBios); /* just used for chkConflict() */ + resp->res_type &= ~(ResBios); /* just used for chkConflict() */ tmp = resp_x; resp_x = resp; resp = resp->next; @@ -2381,16 +2400,16 @@ #ifdef REDUCER } else { resp->res_type |= ResEstimated; - if (!checkConflict(&resp->val, acc, i, SETUP, FALSE)) { - resp->res_type &= ~(ResEstimated | ResBios); - tmp = AccReducers; - AccReducers = resp; - resp = resp->next; - AccReducers->next = tmp; + if (!checkConflict(&resp->val, acc, i, SETUP, FALSE)) { + resp->res_type &= ~(ResEstimated | ResBios); + tmp = AccReducers; + AccReducers = resp; + resp = resp->next; + AccReducers->next = tmp; #endif } else { xf86MsgVerb(X_INFO, 3, "Found conflict at: 0x%lx\n",val); - resp->res_type &= ~ResEstimated; + resp->res_type &= ~ResEstimated; tmp = xf86Entities[i]->resources; xf86Entities[i]->resources = resp; resp = resp->next; @@ -2409,13 +2428,13 @@ #if !(defined(__alpha__) && defined(linux)) && \ !(defined(__sparc64__) && defined(__OpenBSD__)) - /* - * No need to validate on Alpha Linux or OpenBSD/sparc64, + /* + * No need to validate on Alpha Linux or OpenBSD/sparc64, * trust the kernel. */ ValidatePci(); #endif - + xf86MsgVerb(X_INFO, 3, "resource ranges after probing:\n"); xf86PrintResList(3, Acc); checkRoutingForScreens(SETUP); @@ -2423,8 +2442,8 @@ for (i = 0; i < xf86NumScreens; i++) { for (j = 0; jnumEntities; j++) { EntityPtr pEnt = xf86Entities[xf86Screens[i]->entityList[j]]; - if ((pEnt->entityProp & NEED_VGA_ROUTED_SETUP) && - ((xf86Screens[i]->busAccess = pEnt->busAcc))) + if ((pEnt->entityProp & NEED_VGA_ROUTED_SETUP) && + ((xf86Screens[i]->busAccess = pEnt->busAcc))) break; } } @@ -2435,7 +2454,12 @@ { resRange range; resPtr pAcc = Acc; - const EntityPtr pEnt = xf86Entities[entityIndex]; + EntityPtr pEnt; + + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) + return; + + pEnt = xf86Entities[entityIndex]; while (pAcc) { if (pAcc->entityIndex == entityIndex) { range = pAcc->val; @@ -2463,7 +2487,7 @@ } pAcc = pAcc->next; } - + /* check if we can separately enable mem/io resources */ /* XXX we still need to find out how to set this yet */ if ( ((pEnt->entityProp & NO_SEPARATE_MEM_FROM_IO) @@ -2475,7 +2499,7 @@ * After we have checked all resources of an entity agains any * other resource we know if the entity need this resource type * (ie. mem/io) at all. if not we can disable this type completely, - * so no need to share it either. + * so no need to share it either. */ if ((pEnt->entityProp & NEED_MEM_SHARED) && (!(pEnt->entityProp & NEED_MEM)) @@ -2498,16 +2522,16 @@ #ifdef XFree86LOADER xf86MsgVerb(X_INFO, 3, "do I need RAC?"); - + if (needRAC) { xf86ErrorFVerb(3, " Yes, I do.\n"); - + if (!xf86LoadOneModule("rac",NULL)) FatalError("Cannot load RAC module\n"); } else xf86ErrorFVerb(3, " No, I don't.\n"); -#endif - +#endif + xf86MsgVerb(X_INFO, 3, "resource ranges after preInit:\n"); xf86PrintResList(3, Acc); } @@ -2540,10 +2564,10 @@ #endif if (serverGeneration == 1) { checkRoutingForScreens(OPERATING); - for (i=0; ientityProp &= ~NEED_IO_SHARED; } } - + if (xf86Screens && needRAC) { int needRACforVga = 0; @@ -2576,10 +2600,10 @@ } } } - + for (i = 0; i < xf86NumScreens; i++) { Bool needRACforMem = FALSE, needRACforIo = FALSE; - + for (j = 0; j < xf86Screens[i]->numEntities; j++) { if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp & NEED_MEM_SHARED) @@ -2598,10 +2622,10 @@ needRACforMem = TRUE; if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp & NEED_VGA_IO) - needRACforIo = TRUE; + needRACforIo = TRUE; } } - + pScreen = xf86Screens[i]->pScreen; flags = 0; if (needRACforMem) { @@ -2612,7 +2636,7 @@ flags |= xf86Screens[i]->racIoFlags; xf86ErrorFVerb(3, "Screen %d is using RAC for io\n", i); } - + #ifdef XFree86LOADER ((Bool(*)(ScreenPtr,unsigned int))xf86RACInit) (pScreen,flags); @@ -2621,9 +2645,9 @@ #endif } } - + xf86EnterServerState(OPERATING); - + } /* @@ -2638,7 +2662,7 @@ resPtr ret = NULL; memType val = range.rBegin; int i = 0; - + new.type = (range.type & ~ResExtMask) | ResSparse; while (1) { @@ -2655,7 +2679,7 @@ } i--; val <<= 1; - + while (1) { if((((val + 1) << i) - 1)> range.rEnd) { if (--i < 0) break; @@ -2669,7 +2693,7 @@ } return ret; } - + static Bool x_isSubsetOf(resRange range, resPtr list1, resPtr list2) { @@ -2677,7 +2701,7 @@ memType m1_A_m2; Bool ret; resPtr list; - + if (list1) { list = list1; if ((range.type & ResTypeMask) == (list->res_type & ResTypeMask)) { @@ -2706,14 +2730,14 @@ RANGE(range1,range.rBegin, list->block_begin - 1, range.type); return (x_isSubsetOf(range1,list->next,list2)); - } + } } break; case ResSparse: if ((list->res_type & ResExtMask) == ResSparse) { memType test; int i; - + m1_A_m2 = range.rMask & list->sparse_mask; if ((range.rBase ^ list->sparse_base) & m1_A_m2) break; @@ -2789,7 +2813,7 @@ resPtr dup = xf86DupResList(list); resPtr r_sp = NULL, r = NULL, tmp = NULL; Bool ret = FALSE; - + while (dup) { tmp = dup; dup = dup->next; @@ -2804,7 +2828,7 @@ break; } } - + switch (range.type & ResExtMask) { case ResBlock: ret = x_isSubsetOf(range,r,r_sp); @@ -2815,7 +2839,7 @@ } xf86FreeResList(r); xf86FreeResList(r_sp); - + return ret; } @@ -2835,7 +2859,7 @@ { resRange range; resPtr new = NULL; - + while (list) { if ((Range.type & ResTypeMask) == (list->res_type & ResTypeMask)) { switch (Range.type & ResExtMask) { @@ -2848,7 +2872,7 @@ range.rBegin = list->block_begin; if (Range.rEnd <= list->block_end) range.rEnd = Range.rEnd; - else + else range.rEnd = list->block_end; if (range.rEnd > range.rBegin) { range.type = Range.type; @@ -2884,7 +2908,7 @@ } return new; } - + resPtr xf86FindIntersectOfLists(resPtr l1, resPtr l2) { @@ -2905,7 +2929,7 @@ memType tmp; resPtr new = NULL; int i; - + switch (Range.type & ResExtMask) { case ResBlock: if (Range.rBegin > 0) { @@ -2937,7 +2961,7 @@ xf86ExtractTypeFromList(resPtr list, unsigned long type) { resPtr ret = NULL; - + while (list) { if ((list->res_type & ResTypeMask) == type) ret = xf86AddResToList(ret,&(list->val),list->entityIndex); @@ -2958,7 +2982,7 @@ { /* if no VGA device is found check for primary PCI device */ if (primaryBus.type == BUS_NONE) - CheckGenericGA(); + CheckGenericGA(); if (primaryBus.type != BUS_NONE) { char *bus; char *loc = NULL; @@ -2979,13 +3003,13 @@ default: bus = ""; } - + xf86MsgVerb(X_INFO, 2, "Primary Device is: %s%s\n", bus, loc ? loc : ""); if (loc) xfree(loc); } - + } #if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) @@ -3025,7 +3049,7 @@ xf86NoSharedResources(int screenIndex,resType res) { int j; - + if (screenIndex > xf86NumScreens) return TRUE; @@ -3079,7 +3103,7 @@ { StateChangeNotificationPtr *ptr = &StateChangeNotificationList; StateChangeNotificationPtr tmp; - + while (*ptr) { if ((*ptr)->func == func) { tmp = (*ptr); @@ -3107,7 +3131,7 @@ xf86QueueAsyncEvent(void (*func)(pointer),pointer arg) { AsyncQPtr new; - + if (!AsyncQ) return FALSE; new = (AsyncQPtr)xfnalloc(sizeof(AsyncQRec)); @@ -3124,83 +3148,85 @@ int xf86GetLastScrnFlag(int entityIndex) { - if(entityIndex < xf86NumEntities) { - return(xf86Entities[entityIndex]->lastScrnFlag); - } else { - return -1; - } + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) + return -1; + + return(xf86Entities[entityIndex]->lastScrnFlag); } void xf86SetLastScrnFlag(int entityIndex, int scrnIndex) { - if(entityIndex < xf86NumEntities) { - xf86Entities[entityIndex]->lastScrnFlag = scrnIndex; + if ((entityIndex >= 0) && (entityIndex < xf86NumEntities)) { + xf86Entities[entityIndex]->lastScrnFlag = scrnIndex; } } Bool xf86IsEntityShared(int entityIndex) { - if(entityIndex < xf86NumEntities) { - if(xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL) { + if ((entityIndex >= 0) && (entityIndex < xf86NumEntities)) { + if (xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL) { return TRUE; } } + return FALSE; } void xf86SetEntityShared(int entityIndex) { - if(entityIndex < xf86NumEntities) { - xf86Entities[entityIndex]->entityProp |= IS_SHARED_ACCEL; + if ((entityIndex >= 0) && (entityIndex < xf86NumEntities)) { + xf86Entities[entityIndex]->entityProp |= IS_SHARED_ACCEL; } } Bool xf86IsEntitySharable(int entityIndex) { - if(entityIndex < xf86NumEntities) { - if(xf86Entities[entityIndex]->entityProp & ACCEL_IS_SHARABLE) { + if ((entityIndex >= 0) && (entityIndex < xf86NumEntities)) { + if (xf86Entities[entityIndex]->entityProp & ACCEL_IS_SHARABLE) { return TRUE; } } + return FALSE; } void xf86SetEntitySharable(int entityIndex) { - if(entityIndex < xf86NumEntities) { - xf86Entities[entityIndex]->entityProp |= ACCEL_IS_SHARABLE; + if ((entityIndex >= 0) && (entityIndex < xf86NumEntities)) { + xf86Entities[entityIndex]->entityProp |= ACCEL_IS_SHARABLE; } } Bool xf86IsPrimInitDone(int entityIndex) { - if(entityIndex < xf86NumEntities) { - if(xf86Entities[entityIndex]->entityProp & SA_PRIM_INIT_DONE) { + if ((entityIndex >= 0) && (entityIndex < xf86NumEntities)) { + if (xf86Entities[entityIndex]->entityProp & SA_PRIM_INIT_DONE) { return TRUE; } } + return FALSE; } void xf86SetPrimInitDone(int entityIndex) { - if(entityIndex < xf86NumEntities) { - xf86Entities[entityIndex]->entityProp |= SA_PRIM_INIT_DONE; + if ((entityIndex >= 0) && (entityIndex < xf86NumEntities)) { + xf86Entities[entityIndex]->entityProp |= SA_PRIM_INIT_DONE; } } void xf86ClearPrimInitDone(int entityIndex) { - if(entityIndex < xf86NumEntities) { - xf86Entities[entityIndex]->entityProp &= ~SA_PRIM_INIT_DONE; + if ((entityIndex >= 0) && (entityIndex < xf86NumEntities)) { + xf86Entities[entityIndex]->entityProp &= ~SA_PRIM_INIT_DONE; } } @@ -3231,7 +3257,8 @@ DevUnion * xf86GetEntityPrivate(int entityIndex, int privIndex) { - if (entityIndex >= xf86NumEntities || privIndex >= xf86EntityPrivateCount) + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities) || + (privIndex < 0) || (privIndex >= xf86EntityPrivateCount)) return NULL; return &(xf86Entities[entityIndex]->entityPrivates[privIndex]); @@ -3244,7 +3271,12 @@ unsigned int *devOffset, unsigned int *fbSize, unsigned int *fbOffset, unsigned int *flags) { - EntityPtr pEntity = xf86Entities[entityIndex]; + EntityPtr pEntity; + + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities)) + return FALSE; + + pEntity = xf86Entities[entityIndex]; switch (pEntity->busType) { case BUS_PCI: @@ -3254,7 +3286,7 @@ pEntity->pciBusId.func), devName, devOffset, fbSize, fbOffset, flags); -#if defined(__sparc__) && !defined(__OpenBSD__) && defined(___NOT_YET___) +#if defined(__sparc__) && !defined(__OpenBSD__) case BUS_SBUS: return xf86LocateSbusMemoryArea(xf86GetSbusInfoForEntity(entityIndex), devName, devOffset, Index: xc/programs/Xserver/hw/xfree86/common/xf86Config.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Config.c:3.289 xc/programs/Xserver/hw/xfree86/common/xf86Config.c:3.292 --- xc/programs/Xserver/hw/xfree86/common/xf86Config.c:3.289 Wed Mar 2 14:17:43 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86Config.c Thu Mar 16 11:49:55 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.289 2005/03/02 19:17:43 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.292 2006/03/16 16:49:55 dawes Exp $ */ /* @@ -8,7 +8,7 @@ */ /* - * Copyright (c) 1992-2005 by The XFree86 Project, Inc. + * Copyright (c) 1992-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -153,7 +153,7 @@ #ifdef XKB #define XKB_IN_SERVER -#include "XKBsrv.h" +#include #endif #ifdef RENDER @@ -6853,7 +6853,7 @@ xf86Info.config = pConfig = NULL; } - if (getuid() == 0) + if (!PRIVS_ELEVATED) searchpath = ROOT_CONFIGPATH; else searchpath = USER_CONFIGPATH; Index: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Configure.c:3.85 xc/programs/Xserver/hw/xfree86/common/xf86Configure.c:3.89 --- xc/programs/Xserver/hw/xfree86/common/xf86Configure.c:3.85 Wed Jan 26 00:31:48 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86Configure.c Fri Oct 14 11:16:32 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.85 2005/01/26 05:31:48 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.89 2005/10/14 15:16:32 tsi Exp $ */ /* * Copyright 2000-2002 by Alan Hourihane, Flint Mountain, North Wales. * @@ -76,8 +76,8 @@ #include #include #include -#include "X.h" -#include "Xmd.h" +#include +#include #include "os.h" #ifdef XFree86LOADER #include "loaderProcs.h" @@ -89,7 +89,6 @@ #define IN_XSERVER #include "xf86Parser.h" #include "xf86tokens.h" -#include "vbe.h" #include "xf86DDC.h" #if defined(__sparc__) && !defined(__OpenBSD__) #include "xf86Bus.h" @@ -111,7 +110,7 @@ xf86MonPtr ConfiguredMonitor; Bool xf86DoConfigurePass1 = TRUE; -Bool foundMouse = FALSE; +static Bool foundMouse = FALSE; #if defined(__UNIXOS2__) #define DFLT_MOUSE_DEV "mouse$" @@ -307,7 +306,25 @@ configPrologue(XF86ConfInputPtr) ptr->inp_identifier = "Keyboard0"; +#if defined(WSCONS_SUPPORT) && defined(__NetBSD__) + /* check for /dev/wskbd */ + { + int fd = open("/dev/wskbd", 0); + if (fd > 0) { + close(fd); + ptr->inp_driver = "kbd"; + ptr->inp_option_lst = + xf86addNewOption(ptr->inp_option_lst, "Protocol", "wskbd"); + ptr->inp_option_lst = + xf86addNewOption(ptr->inp_option_lst, "Device", "/dev/wskbd"); + } else { + /* no /dev/wskbd - fall back to legacy driver */ + ptr->inp_driver = "keyboard"; + } + } +#else ptr->inp_driver = "keyboard"; +#endif ptr->list.next = NULL; /* Crude mechanism to auto-detect mouse (os dependent) */ @@ -410,7 +427,7 @@ } static const char* -optionTypeToSting(OptionValueType type) +optionTypeToString(OptionValueType type) { switch (type) { case OPTV_NONE: @@ -485,7 +502,7 @@ const char *prefix = " #Option "; const char *middle = " \t# "; const char *suffix = "\n"; - const char *opttype = optionTypeToSting(p->type); + const char *opttype = optionTypeToString(p->type); char *optname; int len = strlen(ptr->dev_comment) + strlen(prefix) + strlen(middle) + strlen(suffix) + 1; @@ -691,10 +708,8 @@ { configPrologue(XF86ConfFilesPtr) -#ifdef XFree86LOADER if (xf86FilePaths->modulePath) ptr->file_modulepath = strdup(xf86FilePaths->modulePath); -#endif if (defaultFontPath) ptr->file_fontpath = strdup(defaultFontPath); if (rgbPath) Index: xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c:3.41 xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c:3.43 --- xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c:3.41 Wed Jan 26 00:31:48 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c Fri Oct 14 11:16:32 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c,v 3.41 2005/01/26 05:31:48 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c,v 3.43 2005/10/14 15:16:32 tsi Exp $ */ /* * Copyright (c) 1994-2005 by The XFree86 Project, Inc. * All rights reserved. @@ -48,8 +48,8 @@ #define NEED_EVENTS -#include "X.h" -#include "Xmd.h" +#include +#include #include "input.h" #include "cursor.h" #include "mipointer.h" @@ -63,7 +63,7 @@ #include "xf86_OSproc.h" #ifdef XINPUT -#include "XIproto.h" +#include #include "xf86Xinput.h" #endif @@ -163,6 +163,11 @@ { ScrnInfoPtr pScr = XF86SCRNINFO(pScreen); +#ifdef XFreeXDGA + if (DGAActive(pScr->scrnIndex)) + return; +#endif + (*pScr->PointerMoved)(pScreen->myNum, x, y); } Index: xc/programs/Xserver/hw/xfree86/common/xf86DGA.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86DGA.c:1.50 xc/programs/Xserver/hw/xfree86/common/xf86DGA.c:1.52 --- xc/programs/Xserver/hw/xfree86/common/xf86DGA.c:1.50 Fri Feb 18 17:38:31 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86DGA.c Mon Mar 20 22:56:26 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DGA.c,v 1.50 2005/02/18 22:38:31 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DGA.c,v 1.52 2006/03/21 03:56:26 dawes Exp $ */ /* * Copyright (c) 1998-2002 by The XFree86 Project, Inc. * @@ -32,7 +32,7 @@ #include "xf86str.h" #include "xf86Priv.h" #include "dgaproc.h" -#include "xf86dgastr.h" +#include #include "colormapst.h" #include "pixmapstr.h" #include "inputstr.h" @@ -40,7 +40,7 @@ #include "servermd.h" #include "micmap.h" #ifdef XKB -#include "XKBsrv.h" +#include #endif #include "xf86Xinput.h" @@ -502,7 +502,11 @@ -/* Called by the event code in case the server is abruptly terminated */ +/* + * Called whenever the server is shutdown, before the CloseScreen phase. + * It ensures that all screens are not in DGA mode before proceeding with + * the shutdown/reset. + */ void DGAShutdown() Index: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c:1.13 xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c:1.14 --- xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c:1.13 Mon May 31 21:23:49 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c Fri Oct 14 11:16:32 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.13 2004/06/01 01:23:49 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.14 2005/10/14 15:16:32 tsi Exp $ */ /* * Copyright (c) 1997-2004 by The XFree86 Project, Inc. @@ -96,14 +96,14 @@ * This file contains the DPMS functions required by the extension. */ -#include "X.h" +#include #include "os.h" #include "globals.h" #include "xf86.h" #include "xf86Priv.h" #ifdef DPMSExtension #define DPMS_SERVER -#include "extensions/dpms.h" +#include #include "dpmsproc.h" #endif #include "edid.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86Debug.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Debug.c:1.8 xc/programs/Xserver/hw/xfree86/common/xf86Debug.c:1.9 --- xc/programs/Xserver/hw/xfree86/common/xf86Debug.c:1.8 Fri Feb 13 18:58:36 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86Debug.c Fri Oct 14 11:16:32 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Debug.c,v 1.8 2004/02/13 23:58:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Debug.c,v 1.9 2005/10/14 15:16:32 tsi Exp $ */ /* * Copyright (c) 2000-2003 by The XFree86 Project, Inc. @@ -53,7 +53,7 @@ #include #include -#include "X.h" +#include #include "os.h" #include "xf86.h" #include "xf86Priv.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c:1.18 xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c:1.19 --- xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c:1.18 Wed Jan 26 00:31:48 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c Fri Oct 14 11:16:32 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c,v 1.18 2005/01/26 05:31:48 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c,v 1.19 2005/10/14 15:16:32 tsi Exp $ */ /* * Copyright (c) 1999-2005 by The XFree86 Project, Inc. * All rights reserved. @@ -53,8 +53,8 @@ #include #include -#include "X.h" -#include "Xmd.h" +#include +#include #include "os.h" #ifdef XFree86LOADER #include "loaderProcs.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c:1.17 xc/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c:1.19 --- xc/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c:1.17 Wed Jan 26 00:31:48 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c Wed Mar 1 22:00:36 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c,v 1.17 2005/01/26 05:31:48 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c,v 1.19 2006/03/02 03:00:36 dawes Exp $ */ /* * Copyright (c) 1999-2005 by The XFree86 Project, Inc. * All rights reserved. @@ -53,8 +53,8 @@ #include #include -#include "X.h" -#include "Xmd.h" +#include +#include #include "os.h" #ifdef XFree86LOADER #include "loaderProcs.h" @@ -122,7 +122,7 @@ LoaderErrorMsg(NULL, "scanpci", errmaj, errmin); exit(1); } - if (LoaderCheckUnresolved(LD_RESOLV_IFDONE)) { + if (LoaderCheckUnresolved(0)) { /* For now, just a warning */ xf86Msg(X_WARNING, "Some symbols could not be resolved!\n"); } Index: xc/programs/Xserver/hw/xfree86/common/xf86Events.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Events.c:3.166 xc/programs/Xserver/hw/xfree86/common/xf86Events.c:3.174 --- xc/programs/Xserver/hw/xfree86/common/xf86Events.c:3.166 Fri Feb 18 17:38:31 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86Events.c Sat Apr 8 13:53:39 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.166 2005/02/18 22:38:31 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.174 2006/04/08 17:53:39 dawes Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -22,7 +22,7 @@ * */ /* - * Copyright (c) 1994-2003 by The XFree86 Project, Inc. + * Copyright (c) 1994-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -68,19 +68,21 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $XConsortium: xf86Events.c /main/46 1996/10/25 11:36:30 kaleb $ */ - /* [JCH-96/01/21] Extended std reverse map to four buttons. */ #ifdef __UNIXOS2__ #define I_NEED_OS2_H #endif -#include "X.h" -#include "Xpoll.h" -#include "Xproto.h" +#include +#include +#include #include "misc.h" +#ifdef XFree86LOADER +#include "loaderProcs.h" +#endif + #include "compiler.h" #include "xf86.h" @@ -95,8 +97,8 @@ #endif #ifdef XINPUT -#include "XI.h" -#include "XIproto.h" +#include +#include #else #include "inputstr.h" #endif @@ -107,11 +109,15 @@ #ifdef XF86BIGFONT #define _XF86BIGFONT_SERVER_ -#include "xf86bigfont.h" +#include +#endif + +#ifdef STACKTRACE +#include "getstack.h" #endif #ifdef XKB -#include "XKBsrv.h" +#include #endif #define XE_POINTER 1 @@ -132,7 +138,7 @@ #ifdef XTESTEXT1 #define XTestSERVER_SIDE -#include "xtestext1.h" +#include extern short xtest_mousex; extern short xtest_mousey; extern int on_steal_input; @@ -317,9 +323,6 @@ switch (action) { case ACTION_TERMINATE: if (!xf86Info.dontZap) { -#ifdef XFreeXDGA - DGAShutdown(); -#endif GiveUp(0); } break; @@ -1270,10 +1273,44 @@ } } -static int *xf86SignalIntercept = NULL; +#ifdef STACKTRACE +#ifndef STACK_LEVELS +#define STACK_LEVELS 16 +#endif void -xf86InterceptSignals(int *signo) +xf86ShowStackTrace() +{ + unsigned long returnStack[STACK_LEVELS]; + int i; + + getStackTrace(returnStack, STACK_LEVELS); + ErrorF("Stack trace:\n"); + for (i = 0; i < STACK_LEVELS && returnStack[i]; i++) { + ErrorF("%2d: 0x%lx", i, returnStack[i]); +#ifdef XFree86LOADER + ErrorF(": "); + if (!LoaderPrintSymbol(returnStack[i])) + break; +#else + ErrorF("\n"); +#endif + } +} + +#else + +void +xf86ShowStackTrace() +{ + ErrorF("Stack trace not supported on this platform.\n"); +} +#endif + +static volatile int *xf86SignalIntercept = NULL; + +void +xf86InterceptSignals(volatile int *signo) { if ((xf86SignalIntercept = signo)) *signo = -1; @@ -1300,12 +1337,16 @@ #endif #if defined(XFree86LOADER) if (xf86Initialising) - LoaderCheckUnresolved(LD_RESOLV_IFDONE); + LoaderCheckUnresolved(0); ErrorF("\n" " *** If unresolved symbols were reported above, they might not\n" - " *** be the reason for the server aborting.\n"); + " *** be the reason for the server aborting.\n\n"); #endif - FatalError("Caught signal %d. Server aborting\n", signo); + ErrorF("Caught signal %d.\n", signo); + + xf86ShowStackTrace(); + + FatalError("Server aborting\n"); } #ifdef MEMDEBUG @@ -1623,8 +1664,6 @@ /* XXX Currently XKB is mandatory. */ -extern int WSKbdToKeycode(int); - void xf86PostWSKbdEvent(struct wscons_event *event) { @@ -1638,11 +1677,13 @@ /* map the scancodes to standard XFree86 scancode */ keycode = WSKbdToKeycode(value); - if (!down) keycode |= 0x80; - /* It seems better to block SIGIO there */ - blocked = xf86BlockSIGIO(); - xf86PostKbdEvent(keycode); - xf86UnblockSIGIO(blocked); + if ((keycode != KEY_NOTUSED) && ((keycode & 0x80) == 0)) { + if (!down) keycode |= 0x80; + /* It seems better to block SIGIO there */ + blocked = xf86BlockSIGIO(); + xf86PostKbdEvent(keycode); + xf86UnblockSIGIO(blocked); + } } } #endif /* WSCONS_SUPPORT */ Index: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Globals.c:1.45 xc/programs/Xserver/hw/xfree86/common/xf86Globals.c:1.47 --- xc/programs/Xserver/hw/xfree86/common/xf86Globals.c:1.45 Fri Mar 4 16:59:13 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86Globals.c Wed Mar 1 22:00:36 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c,v 1.45 2005/03/04 21:59:13 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c,v 1.47 2006/03/02 03:00:36 dawes Exp $ */ /* * Copyright (c) 1997-2005 by The XFree86 Project, Inc. @@ -96,7 +96,7 @@ * This file contains all the XFree86 global variables. */ -#include "X.h" +#include #include "os.h" #include "windowstr.h" #include "propertyst.h" @@ -319,9 +319,3 @@ RootWinPropPtr *xf86RegisteredPropertiesTable = NULL; Bool xf86inSuspend = FALSE; -#ifdef DLOPEN_HACK -/* - * This stuff is a hack to allow dlopen() modules to work. It is intended - * only to be used when using dlopen() modules for debugging purposes. - */ -#endif Index: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Helper.c:1.147 xc/programs/Xserver/hw/xfree86/common/xf86Helper.c:1.156 --- xc/programs/Xserver/hw/xfree86/common/xf86Helper.c:1.147 Thu Feb 17 20:52:59 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86Helper.c Thu Mar 16 21:25:02 2006 @@ -1,7 +1,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.147 2005/02/18 01:52:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.156 2006/03/17 02:25:02 dawes Exp $ */ /* - * Copyright (c) 1997-2005 by The XFree86 Project, Inc. + * Copyright (c) 1997-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -57,7 +57,7 @@ * 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: - * + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer. * @@ -65,7 +65,7 @@ * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: "This product * includes software developed by X-Oz Technologies @@ -89,7 +89,7 @@ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * */ /* @@ -101,7 +101,7 @@ * different drivers. */ -#include "X.h" +#include #include "os.h" #include "servermd.h" #include "pixmapstr.h" @@ -131,33 +131,11 @@ static int xf86ScrnInfoPrivateCount = 0; #ifdef XFree86LOADER -pointer *deferredUnloadList = NULL; -int numDeferredUnloads; - -void -xf86DoDeferredUnloads() -{ - int i; - - for (i = 0; i < numDeferredUnloads; i++) - UnloadModule(deferredUnloadList[i]); - xfree(deferredUnloadList); - numDeferredUnloads = 0; -} - -static void -DeferredUnloadModule(pointer module) -{ - numDeferredUnloads++; - deferredUnloadList = - xnfrealloc(deferredUnloadList, numDeferredUnloads * sizeof(pointer)); - deferredUnloadList[numDeferredUnloads - 1] = module; -} /* Add a pointer to a new DriverRec to xf86DriverList */ void -xf86AddDriver(DriverPtr driver, pointer module, int flags) +xf86AddDriver(DriverPtr driver, ModuleDescPtr module, int flags) { /* Don't add null entries */ if (!driver) @@ -177,17 +155,14 @@ #endif void -xf86DeleteDriver(int drvIndex, Bool deferUnload) +xf86DeleteDriver(int drvIndex) { if (xf86DriverList[drvIndex] && !xf86DriverHasEntities(xf86DriverList[drvIndex])) { xf86ClearDriverEntities(xf86DriverList[drvIndex]); #ifdef XFree86LOADER if (xf86DriverList[drvIndex]->module) { - if (deferUnload) - DeferredUnloadModule(xf86DriverList[drvIndex]->module); - else - UnloadModule(xf86DriverList[drvIndex]->module); + UnloadModule(xf86DriverList[drvIndex]->module); xfree(xf86DriverList[drvIndex]); } #endif @@ -199,7 +174,7 @@ /* Add a pointer to a new InputDriverRec to xf86InputDriverList */ void -xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags) +xf86AddInputDriver(InputDriverPtr driver, ModuleDescPtr module, int flags) { /* Don't add null entries */ if (!driver) @@ -228,7 +203,7 @@ } void -xf86AddModuleInfo(ModuleInfoPtr info, pointer module) +xf86AddModuleInfo(ModuleInfoPtr info, ModuleDescPtr module) { /* Don't add null entries */ if (!module) @@ -343,7 +318,7 @@ #ifdef XFree86LOADER if (pScrn->module) - DeferredUnloadModule(pScrn->module); + UnloadModule(pScrn->module); #endif if (pScrn->drv) @@ -357,7 +332,7 @@ xfree(pScrn); /* Move the other entries down, updating their scrnIndex fields */ - + xf86NumScreens--; for (i = scrnIndex; i < xf86NumScreens; i++) { @@ -602,7 +577,7 @@ /* If none of these is set, pick a default */ if (scrp->bitsPerPixel < 0 && scrp->depth < 0) { - if (fbbpp > 0 || depth > 0) { + if (fbbpp > 0 || depth > 0) { if (fbbpp > 0) scrp->bitsPerPixel = fbbpp; if (depth > 0) @@ -892,9 +867,9 @@ scrp->mask.red = mask.red; scrp->mask.green = mask.green; scrp->mask.blue = mask.blue; - scrp->offset.red = ffs(mask.red); - scrp->offset.green = ffs(mask.green); - scrp->offset.blue = ffs(mask.blue); + scrp->offset.red = ffs(mask.red) - 1; + scrp->offset.green = ffs(mask.green) - 1; + scrp->offset.blue = ffs(mask.blue) - 1; } return TRUE; } @@ -936,12 +911,12 @@ if (scrp->depth == 1 && scrp->defaultVisual != StaticGray) bad = TRUE; #if 0 - else if (scrp->depth == 4 && - (scrp->defaultVisual == TrueColor || - scrp->defaultVisual == DirectColor)) - bad = TRUE; + else if (scrp->depth == 4 && + (scrp->defaultVisual == TrueColor || + scrp->defaultVisual == DirectColor)) + bad = TRUE; #endif - else if (scrp->depth > MAX_PSEUDO_DEPTH && + else if (scrp->depth > MAX_PSEUDO_DEPTH && scrp->defaultVisual != TrueColor && scrp->defaultVisual != DirectColor) bad = TRUE; @@ -971,7 +946,7 @@ { MessageType from = X_DEFAULT; #if 0 - xf86MonPtr DDC = (xf86MonPtr)(scrp->monitor->DDC); + xf86MonPtr DDC = (xf86MonPtr)(scrp->monitor->DDC); #endif if (TEST_GAMMA(xf86Gamma)) { from = X_CMDLINE; @@ -985,7 +960,7 @@ scrp->gamma.blue = SET_GAMMA(scrp->monitor->gamma.blue); #if 0 } else if ( DDC && DDC->features.gamma > GAMMA_ZERO ) { - from = X_PROBED; + from = X_PROBED; scrp->gamma.red = SET_GAMMA(DDC->features.gamma); scrp->gamma.green = SET_GAMMA(DDC->features.gamma); scrp->gamma.blue = SET_GAMMA(DDC->features.gamma); @@ -1024,7 +999,7 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int y) { MessageType from = X_DEFAULT; - xf86MonPtr DDC = (xf86MonPtr)(pScrn->monitor->DDC); + xf86MonPtr DDC = (xf86MonPtr)(pScrn->monitor->DDC); int ddcWidthmm, ddcHeightmm; int widthErr, heightErr; @@ -1034,7 +1009,7 @@ if (DDC && (DDC->features.hsize > 0 && DDC->features.vsize > 0) ) { /* DDC gives display size in mm for individual modes, - * but cm for monitor + * but cm for monitor */ ddcWidthmm = DDC->features.hsize * 10; /* 10mm in 1cm */ ddcHeightmm = DDC->features.vsize * 10; /* 10mm in 1cm */ @@ -1078,7 +1053,7 @@ if (widthErr>10 || heightErr>10) { /* Should include config file name for monitor here */ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Probed monitor is %dx%d mm, using Displaysize %dx%d mm\n", + "Probed monitor is %dx%d mm, using Displaysize %dx%d mm\n", ddcWidthmm,ddcHeightmm, pScrn->widthmm,pScrn->heightmm); } } @@ -1174,7 +1149,7 @@ pWin->valdata->before.resized = TRUE; } } - + /* * Use REGION_BREAK to avoid optimizations in ValidateTree * that assume the root borderClip can't change well, normally @@ -1192,16 +1167,16 @@ REGION_RESET(pScreen, &pWin->borderClip, &box); pWin->drawable.width = pScreen->width; pWin->drawable.height = pScreen->height; - REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); + REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); } else { REGION_EMPTY(pScreen, &pWin->borderClip); REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); } - + ResizeChildrenWinSize (pWin, 0, 0, 0, 0); - + if (WasViewable) { if (pWin->backStorage) @@ -1246,7 +1221,7 @@ if (bsExposed) { RegionPtr valExposed = NullRegion; - + if (pWin->valdata) valExposed = &pWin->valdata->after.exposed; (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); @@ -1305,7 +1280,7 @@ */ pspix->devPrivate = pScrnInfo->pixmapPrivate; /* - * Restore all of the clip lists on the screen + * Restore all of the clip lists on the screen */ if (!xf86Resetting) xf86SetRootClip (pScreen, TRUE); @@ -1314,7 +1289,7 @@ else { /* - * Empty all of the clip lists on the screen + * Empty all of the clip lists on the screen */ xf86SetRootClip (pScreen, FALSE); /* @@ -1348,7 +1323,6 @@ } else LogVMessageVerb(type, verb, format, args); } -#undef PREFIX_SIZE /* Print driver messages, with verbose level specified directly */ void @@ -1430,7 +1404,7 @@ #define LOGSUFFIX ".log" #define LOGOLDSUFFIX ".old" - + /* Get the log file name */ if (xf86FileCmdline.logFile) { lf = xf86FileCmdline.logFile; @@ -1560,7 +1534,7 @@ *sectlist = NULL; if (xf86DoProbe) return 1; - + if (xf86DoConfigure && xf86DoConfigurePass1) return 1; /* @@ -1568,18 +1542,18 @@ * as they show up in the config file with the drivers that the server * loads at run time. * - * ChipProbe can call - * int xf86MatchDevice(char * drivername, GDevPtr ** sectlist) + * ChipProbe can call + * int xf86MatchDevice(char * drivername, GDevPtr ** sectlist) * with its driver name. The function allocates an array of GDevPtr and * returns this via sectlist and returns the number of elements in * this list as return value. 0 means none found, -1 means fatal error. - * + * * It can figure out which of the Device sections to use for which card * (using things like the Card statement, etc). For single headed servers * there will of course be just one such Device section. */ i = 0; - + /* * first we need to loop over all the Screens sections to get to all * 'active' device sections @@ -1587,17 +1561,17 @@ for (j = 0; j < xf86Info.serverLayout->numScreens; j++) { if (!xf86Info.serverLayout->screenLayouts[j]) continue; - screensecptr = xf86Info.serverLayout->screenLayouts[j]->screen; - if (screensecptr && screensecptr->device && + screensecptr = xf86Info.serverLayout->screenLayouts[j]->screen; + if (screensecptr && screensecptr->device && screensecptr->device->driver && - xf86NameCmp(screensecptr->device->driver,drivername) == 0 && - !screensecptr->device->claimed) { - /* - * we have a matching driver that wasn't claimed, yet - */ - pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr)); - pgdp[i++] = screensecptr->device; - } + xf86NameCmp(screensecptr->device->driver,drivername) == 0 && + !screensecptr->device->claimed) { + /* + * we have a matching driver that wasn't claimed, yet + */ + pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr)); + pgdp[i++] = screensecptr->device; + } } /* Then handle the inactive devices */ @@ -1614,12 +1588,12 @@ j++; } } - + /* * make the array NULL terminated and return its address */ if (i) - pgdp[i] = NULL; + pgdp[i] = NULL; if (sectlist) *sectlist = pgdp; @@ -1638,7 +1612,7 @@ }; int -xf86MatchPciInstances(const char *driverName, int vendorID, +xf86MatchPciInstances(const char *driverName, int vendorID, SymTabPtr chipsets, PciChipsets *PCIchipsets, GDevPtr *devList, int numDevs, DriverPtr drvp, int **foundEntities) @@ -1651,8 +1625,8 @@ GDevPtr dev; Bool foundHW; /* PCIid in list of supported chipsets */ Bool claimed; /* BusID matches with a device section */ - int chip; - int screen; + int chip; + int screen; } *instances = NULL; int numClaimedInstances = 0; int allocatedInstances = 0; @@ -1664,39 +1638,43 @@ int *retEntities = NULL; *foundEntities = NULL; + if (xf86PciVideoInfo == NULL) + return 0; + + for (ppPci = xf86PciVideoInfo; (pPci = *ppPci); ppPci++) { + /* Two or more different drivers may not share entities */ + if (!xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func)) + continue; - if (vendorID == 0) { - for (ppPci = xf86PciVideoInfo; *ppPci != NULL; ppPci++) { + if (vendorID == 0) { Bool foundVendor = FALSE; for (id = PCIchipsets; id->PCIid != -1; id++) { - if ( (((id->PCIid & 0xFFFF0000) >> 16) == (*ppPci)->vendor)) { + if ( (((id->PCIid & 0xFFFF0000) >> 16) == pPci->vendor)) { if (!foundVendor) { - ++allocatedInstances; + ++allocatedInstances; instances = xnfrealloc(instances, allocatedInstances * sizeof(struct Inst)); - instances[allocatedInstances - 1].pci = *ppPci; + instances[allocatedInstances - 1].pci = pPci; instances[allocatedInstances - 1].dev = NULL; instances[allocatedInstances - 1].claimed = FALSE; instances[allocatedInstances - 1].foundHW = FALSE; instances[allocatedInstances - 1].screen = 0; foundVendor = TRUE; - } - if ((id->PCIid & 0x0000FFFF) == (*ppPci)->chipType) { - instances[allocatedInstances - 1].foundHW = TRUE; + } + if ((id->PCIid & 0x0000FFFF) == pPci->chipType) { + instances[allocatedInstances - 1].foundHW = TRUE; instances[allocatedInstances - 1].chip = id->numChipset; numFound++; } } } - } - } else if (vendorID == PCI_VENDOR_GENERIC) { - for (ppPci = xf86PciVideoInfo; *ppPci != NULL; ppPci++) { + } else if (vendorID == PCI_VENDOR_GENERIC) { for (id = PCIchipsets; id->PCIid != -1; id++) { - if (id->PCIid == xf86CheckPciGAType(*ppPci)) { + if (id->PCIid == xf86CheckPciGAType(pPci)) { ++allocatedInstances; instances = xnfrealloc(instances, allocatedInstances * sizeof(struct Inst)); - instances[allocatedInstances - 1].pci = *ppPci; + instances[allocatedInstances - 1].pci = pPci; instances[allocatedInstances - 1].dev = NULL; instances[allocatedInstances - 1].claimed = FALSE; instances[allocatedInstances - 1].foundHW = TRUE; @@ -1705,24 +1683,21 @@ numFound++; } } - } - } else { - /* Find PCI devices that match the given vendor ID */ - for (ppPci = xf86PciVideoInfo; (ppPci != NULL) - && (*ppPci != NULL); ppPci++) { - if ((*ppPci)->vendor == vendorID) { + } else { + /* Find PCI devices that match the given vendor ID */ + if (pPci->vendor == vendorID) { ++allocatedInstances; instances = xnfrealloc(instances, allocatedInstances * sizeof(struct Inst)); - instances[allocatedInstances - 1].pci = *ppPci; + instances[allocatedInstances - 1].pci = pPci; instances[allocatedInstances - 1].dev = NULL; instances[allocatedInstances - 1].claimed = FALSE; instances[allocatedInstances - 1].foundHW = FALSE; - instances[allocatedInstances - 1].screen = 0; + instances[allocatedInstances - 1].screen = 0; /* Check if the chip type is listed in the chipsets table */ for (id = PCIchipsets; id->PCIid != -1; id++) { - if (id->PCIid == (*ppPci)->chipType) { + if (id->PCIid == pPci->chipType) { instances[allocatedInstances - 1].chip = id->numChipset; instances[allocatedInstances - 1].foundHW = TRUE; @@ -1758,7 +1733,7 @@ if (!xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func)) continue; actualcards++; - pGDev = xf86AddDeviceToConfigure(drvp->driverName, + pGDev = xf86AddDeviceToConfigure(drvp->driverName, instances[i].pci, -1); if (pGDev) { /* @@ -1786,20 +1761,20 @@ */ for (j = 0; j < numDevs; j++) { - if (devList[j]->screen > 0 && devList[j]->busID + if (devList[j]->screen > 0 && devList[j]->busID && *devList[j]->busID) { for (i = 0; i < allocatedInstances; i++) { - pPci = instances[i].pci; - if (xf86ComparePciBusString(devList[j]->busID, pPci->bus, + pPci = instances[i].pci; + if (xf86ComparePciBusString(devList[j]->busID, pPci->bus, pPci->device, pPci->func)) { allocatedInstances++; instances = xnfrealloc(instances, - allocatedInstances * + allocatedInstances * sizeof(struct Inst)); instances[allocatedInstances - 1] = instances[i]; instances[allocatedInstances - 1].screen = - devList[j]->screen; + devList[j]->screen; numFound++; break; } @@ -1817,19 +1792,19 @@ pPci->device, pPci->func) && devList[j]->screen == instances[i].screen) { - + if (devBus) - xf86MsgVerb(X_WARNING,0, + xf86MsgVerb(X_WARNING,0, "%s: More than one matching Device section for " "instances\n\t(BusID: %s) found: %s\n", driverName, devList[j]->busID, devList[j]->identifier); else devBus = devList[j]; - } + } } else { - /* - * if device section without BusID is found + /* + * if device section without BusID is found * only assign to it to the primary device. */ if (xf86IsPrimaryPci(pPci)) { @@ -1844,7 +1819,7 @@ } } } - if (devBus) dev = devBus; /* busID preferred */ + if (devBus) dev = devBus; /* busID preferred */ if (!dev) { if (xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func)) { xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section " @@ -1945,13 +1920,13 @@ */ numFound = 0; for (i = 0; i < allocatedInstances && numClaimedInstances > 0; i++) { - + if (!instances[i].claimed) continue; pPci = instances[i].pci; - /* + /* * Allow the same entity to be used more than once for devices with * multiple screens per entity. This assumes implicitly that there * will be a screen == 0 instance. @@ -1959,7 +1934,7 @@ * XXX Need to make sure that two different drivers don't claim * the same screen > 0 instance. */ - if (instances[i].screen == 0 && + if (instances[i].screen == 0 && !xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func)) continue; @@ -1967,7 +1942,7 @@ ErrorF("%s: card at %d:%d:%d is claimed by a Device section\n", driverName, pPci->bus, pPci->device, pPci->func); #endif - + /* Allocate an entry in the lists to be returned */ numFound++; retEntities = xnfrealloc(retEntities, numFound * sizeof(int)); @@ -1976,12 +1951,12 @@ pPci->func,drvp, instances[i].chip, instances[i].dev,instances[i].dev->active ? TRUE : FALSE); - if (retEntities[numFound - 1] == -1 && instances[i].screen > 0) { + if (retEntities[numFound - 1] == -1 && instances[i].screen > 0) { for (j = 0; j < xf86NumEntities; j++) { - EntityPtr pEnt = xf86Entities[j]; - if (pEnt->busType != BUS_PCI) + EntityPtr pEnt = xf86Entities[j]; + if (pEnt->busType != BUS_PCI) continue; - if (pEnt->pciBusId.bus == pPci->bus && + if (pEnt->pciBusId.bus == pPci->bus && pEnt->pciBusId.device == pPci->device && pEnt->pciBusId.func == pPci->func) { retEntities[numFound - 1] = j; @@ -1995,7 +1970,7 @@ if (numFound > 0) { *foundEntities = retEntities; } - + return numFound; } @@ -2063,18 +2038,18 @@ dev->identifier); } else foundChip = c->token; - } else { + } else { if (FindIsaDevice) foundChip = (*FindIsaDevice)(dev); - /* Probe it */ + /* Probe it */ from = X_PROBED; } } - + /* Check if the chip type is listed in the chipset table - for sanity*/ if (foundChip >= 0){ for (Chips = ISAchipsets; Chips->numChipset >= 0; Chips++) { - if (Chips->numChipset == foundChip) + if (Chips->numChipset == foundChip) break; } if (Chips->numChipset == -1){ @@ -2097,7 +2072,7 @@ } } *foundEntities = retEntities; - + return numFound; } @@ -2121,7 +2096,7 @@ if (num > MAXCLOCKS) num = MAXCLOCKS; - for (i = 0; i < num; i++) + for (i = 0; i < num; i++) { if (ProtectRegs) (*ProtectRegs)(pScrn, TRUE); @@ -2134,50 +2109,50 @@ (*ProtectRegs)(pScrn, FALSE); if (BlankScreen) (*BlankScreen)(pScrn, FALSE); - - usleep(50000); /* let VCO stabilise */ - cnt = 0; - sync = 200000; + usleep(50000); /* let VCO stabilise */ + + cnt = 0; + sync = 200000; /* XXX How critical is this? */ - if (!xf86DisableInterrupts()) - { + if (!xf86DisableInterrupts()) + { (*ClockFunc)(pScrn, CLK_REG_RESTORE); ErrorF("Failed to disable interrupts during clock probe. If\n"); ErrorF("your OS does not support disabling interrupts, then you\n"); FatalError("must specify a Clocks line in the XF86Config file.\n"); } - while ((inb(status) & maskval) == 0x00) + while ((inb(status) & maskval) == 0x00) if (sync-- == 0) goto finish; /* Something appears to be happening, so reset sync count */ sync = 200000; - while ((inb(status) & maskval) == maskval) + while ((inb(status) & maskval) == maskval) if (sync-- == 0) goto finish; /* Something appears to be happening, so reset sync count */ sync = 200000; - while ((inb(status) & maskval) == 0x00) + while ((inb(status) & maskval) == 0x00) if (sync-- == 0) goto finish; - - for (rcnt = 0; rcnt < 5; rcnt++) + + for (rcnt = 0; rcnt < 5; rcnt++) { - while (!(inb(status) & maskval)) + while (!(inb(status) & maskval)) cnt++; - while ((inb(status) & maskval)) + while ((inb(status) & maskval)) cnt++; } - + finish: xf86EnableInterrupts(); pScrn->clock[i] = cnt ? cnt : -1; if (BlankScreen) - (*BlankScreen)(pScrn, TRUE); + (*BlankScreen)(pScrn, TRUE); } xf86SetPriority(FALSE); - for (i = 0; i < num; i++) + for (i = 0; i < num; i++) { if (i != knownclkindex) { @@ -2185,11 +2160,11 @@ { pScrn->clock[i] = 0; } - else + else { pScrn->clock[i] = (int)(0.5 + - (((float)knownclkvalue) * pScrn->clock[knownclkindex]) / - (pScrn->clock[i])); + (((float)knownclkvalue) * pScrn->clock[knownclkindex]) / + (pScrn->clock[i])); /* Round to nearest 10KHz */ pScrn->clock[i] += 5; pScrn->clock[i] /= 10; @@ -2199,7 +2174,7 @@ } pScrn->clock[knownclkindex] = knownclkvalue; - pScrn->numClocks = num; + pScrn->numClocks = num; /* Restore registers that were written on */ (*ClockFunc)(pScrn, CLK_REG_RESTORE); @@ -2387,7 +2362,7 @@ } CARD32 -xf86GetModuleVersion(pointer module) +xf86GetModuleVersion(ModuleDescPtr module) { #ifdef XFree86LOADER return (CARD32)LoaderGetModuleVersion(module); @@ -2396,11 +2371,29 @@ #endif } -pointer +ModuleDescPtr +xf86GetSubModuleByName(ModuleDescPtr mod, const char *name) +{ +#ifdef XFree86LOADER + return LoaderGetSubModuleByName(mod, name); +#else + return NULL; +#endif +} + +void +xf86SetParentModuleRequirements(ModuleDescPtr module, XF86ModReqInfo *req) +{ +#ifdef XFree86LOADER + LoaderSetParentModuleRequirements(module, req); +#endif +} + +ModuleDescPtr xf86LoadDrvSubModule(DriverPtr drv, const char *name) { #ifdef XFree86LOADER - pointer ret; + ModuleDescPtr ret; int errmaj = 0, errmin = 0; ret = LoadSubModule(drv->module, name, NULL, NULL, NULL, NULL, @@ -2413,11 +2406,29 @@ #endif } -pointer +ModuleDescPtr +xf86LoadDrvSubModuleWithRequirements(DriverPtr drv, const char *name, + XF86ModReqInfo *req) +{ +#ifdef XFree86LOADER + ModuleDescPtr ret; + int errmaj = 0, errmin = 0; + + ret = LoadSubModule(drv->module, name, NULL, NULL, NULL, req, + &errmaj, &errmin); + if (!ret) + LoaderErrorMsg(NULL, name, errmaj, errmin); + return ret; +#else + return (pointer)1; +#endif +} + +ModuleDescPtr xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name) { #ifdef XFree86LOADER - pointer ret; + ModuleDescPtr ret; int errmaj = 0, errmin = 0; ret = LoadSubModule(pScrn->module, name, NULL, NULL, NULL, NULL, @@ -2430,21 +2441,39 @@ #endif } +ModuleDescPtr +xf86LoadSubModuleWithRequirements(ScrnInfoPtr pScrn, const char *name, + XF86ModReqInfo *req) +{ +#ifdef XFree86LOADER + ModuleDescPtr ret; + int errmaj = 0, errmin = 0; + + ret = LoadSubModule(pScrn->module, name, NULL, NULL, NULL, req, + &errmaj, &errmin); + if (!ret) + LoaderErrorMsg(pScrn->name, name, errmaj, errmin); + return ret; +#else + return (pointer)1; +#endif +} + /* * xf86LoadOneModule loads a single module. - */ -pointer + */ +ModuleDescPtr xf86LoadOneModule(char *name, pointer opt) { #ifdef XFree86LOADER int errmaj, errmin; #endif char *Name; - pointer mod; - + ModuleDescPtr mod; + if (!name) return NULL; - + #ifndef NORMALISE_MODULE_NAME Name = xstrdup(name); #else @@ -2472,13 +2501,9 @@ } void -xf86UnloadSubModule(pointer mod) +xf86UnloadSubModule(ModuleDescPtr mod) { - /* - * This is disabled for now. The loader isn't smart enough yet to undo - * relocations. - */ -#if defined(XFree86LOADER) && 0 +#if defined(XFree86LOADER) UnloadSubModule(mod); #endif } @@ -2500,7 +2525,7 @@ va_list ap; va_start(ap, list0); - LoaderVReqSymLists(list0, ap); + LoaderVReqSymLists(NULL, list0, ap); va_end(ap); #endif } @@ -2512,7 +2537,7 @@ va_list ap; va_start(ap, sym0); - LoaderVReqSymbols(sym0, ap); + LoaderVReqSymbols(NULL, sym0, ap); va_end(ap); #endif } @@ -2524,7 +2549,7 @@ va_list ap; va_start(ap, list0); - LoaderVRefSymLists(list0, ap); + LoaderVRefSymLists(NULL, list0, ap); va_end(ap); #endif } @@ -2536,7 +2561,59 @@ va_list ap; va_start(ap, sym0); - LoaderVRefSymbols(sym0, ap); + LoaderVRefSymbols(NULL, sym0, ap); + va_end(ap); +#endif +} + +int +xf86LoaderModReqSymLists(ModuleDescPtr module, const char **list0, ...) +{ + int ret = 0; +#ifdef XFree86LOADER + va_list ap; + + va_start(ap, list0); + ret = LoaderVReqSymLists(module, list0, ap); + va_end(ap); +#endif + return ret; +} + +int +xf86LoaderModReqSymbols(ModuleDescPtr module, const char *sym0, ...) +{ + int ret = 0; +#ifdef XFree86LOADER + va_list ap; + + va_start(ap, sym0); + ret = LoaderVReqSymbols(module, sym0, ap); + va_end(ap); +#endif + return ret; +} + +void +xf86LoaderModRefSymLists(ModuleDescPtr module, const char **list0, ...) +{ +#ifdef XFree86LOADER + va_list ap; + + va_start(ap, list0); + LoaderVRefSymLists(module, list0, ap); + va_end(ap); +#endif +} + +void +xf86LoaderModRefSymbols(ModuleDescPtr module, const char *sym0, ...) +{ +#ifdef XFree86LOADER + va_list ap; + + va_start(ap, sym0); + LoaderVRefSymbols(module, sym0, ap); va_end(ap); #endif } @@ -2551,7 +2628,7 @@ { -1, NULL, OPTV_NONE, {0}, FALSE } }; -void +void xf86SetBackingStore(ScreenPtr pScreen) { Bool useBS = FALSE; @@ -2591,7 +2668,7 @@ { -1, NULL, OPTV_NONE, {0}, FALSE } }; -void +void xf86SetSilkenMouse (ScreenPtr pScreen) { Bool useSM = TRUE; @@ -2602,17 +2679,17 @@ options = xnfalloc(sizeof(SMOptions)); (void)memcpy(options, SMOptions, sizeof(SMOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); - + /* check for commandline option here */ /* disable if screen shares resources */ - if (((pScrn->racMemFlags & RAC_CURSOR) && + if (((pScrn->racMemFlags & RAC_CURSOR) && !xf86NoSharedResources(pScrn->scrnIndex,MEM)) || - ((pScrn->racIoFlags & RAC_CURSOR) && + ((pScrn->racIoFlags & RAC_CURSOR) && !xf86NoSharedResources(pScrn->scrnIndex,IO))) { useSM = FALSE; from = X_PROBED; } else if (xf86silkenMouseDisableFlag) { - from = X_CMDLINE; + from = X_CMDLINE; useSM = FALSE; } else { if (xf86GetOptValBool(options, OPTION_SILKEN_MOUSE, &useSM)) @@ -2682,7 +2759,7 @@ IsaChipsets *i_id; EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); if (!pEnt) return pScrn; - + if (!(pEnt->location.type == BUS_ISA)) { xfree(pEnt); return pScrn; @@ -2695,7 +2772,7 @@ } if (!pScrn) - pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag); + pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag); xf86AddEntityToScreen(pScrn,entityIndex); if (i_chip) { @@ -2720,7 +2797,7 @@ EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); if (!pEnt) return pScrn; - if (!(pEnt->location.type == BUS_PCI) + if (!(pEnt->location.type == BUS_PCI) || !xf86GetPciInfoForEntity(entityIndex)) { xfree(pEnt); return pScrn; @@ -2734,11 +2811,11 @@ if (!pScrn) pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag); if (xf86IsEntitySharable(entityIndex)) { - xf86SetEntityShared(entityIndex); + xf86SetEntityShared(entityIndex); } xf86AddEntityToScreen(pScrn,entityIndex); if (xf86IsEntityShared(entityIndex)) { - return pScrn; + return pScrn; } if (p_chip) { for (p_id = p_chip; p_id->numChipset != -1; p_id++) { @@ -2756,12 +2833,12 @@ ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, - EntityProc init, EntityProc enter, EntityProc leave, + EntityProc init, EntityProc enter, EntityProc leave, pointer private) { EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); if (!pEnt) return pScrn; - + if (!(pEnt->location.type == BUS_NONE)) { xfree(pEnt); return pScrn; @@ -2773,7 +2850,7 @@ } if (!pScrn) - pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag); + pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag); xf86AddEntityToScreen(pScrn,entityIndex); xf86SetEntityFuncs(entityIndex,init,enter,leave,private); @@ -2789,61 +2866,61 @@ */ Bool xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn, int entityIndex, - IsaChipsets *i_chip, resList res, EntityProc init, - EntityProc enter, EntityProc leave, pointer private) + IsaChipsets *i_chip, resList res, EntityProc init, + EntityProc enter, EntityProc leave, pointer private) { IsaChipsets *i_id; EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); if (!pEnt) return FALSE; - + if (!pEnt->active || !(pEnt->location.type == BUS_ISA)) { - xfree(pEnt); - return FALSE; + xfree(pEnt); + return FALSE; } - + xf86AddEntityToScreen(pScrn,entityIndex); - + if (i_chip) { - for (i_id = i_chip; i_id->numChipset != -1; i_id++) { - if (pEnt->chipset == i_id->numChipset) break; - } - xf86ClaimFixedResources(i_id->resList,entityIndex); + for (i_id = i_chip; i_id->numChipset != -1; i_id++) { + if (pEnt->chipset == i_id->numChipset) break; + } + xf86ClaimFixedResources(i_id->resList,entityIndex); } xfree(pEnt); xf86ClaimFixedResources(res,entityIndex); if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private)) - return FALSE; - + return FALSE; + return TRUE; } - + Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex, - PciChipsets *p_chip, resList res, EntityProc init, - EntityProc enter, EntityProc leave, pointer private) + PciChipsets *p_chip, resList res, EntityProc init, + EntityProc enter, EntityProc leave, pointer private) { PciChipsets *p_id; EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); if (!pEnt) return FALSE; - + if (!pEnt->active || !(pEnt->location.type == BUS_PCI)) { - xfree(pEnt); - return FALSE; + xfree(pEnt); + return FALSE; } xf86AddEntityToScreen(pScrn,entityIndex); - + if (p_chip) { - for (p_id = p_chip; p_id->numChipset != -1; p_id++) { - if (pEnt->chipset == p_id->numChipset) break; - } - xf86ClaimFixedResources(p_id->resList,entityIndex); + for (p_id = p_chip; p_id->numChipset != -1; p_id++) { + if (pEnt->chipset == p_id->numChipset) break; + } + xf86ClaimFixedResources(p_id->resList,entityIndex); } xfree(pEnt); - + xf86ClaimFixedResources(res,entityIndex); if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private)) - return FALSE; - + return FALSE; + return TRUE; } @@ -2899,7 +2976,7 @@ } void -xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, +xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, EntityProc enter, EntityProc leave, pointer private) { ScrnInfoPtr pScrn; @@ -2968,7 +3045,7 @@ pNewProp->format = format; pNewProp->size = len; pNewProp->data = value; - + #ifdef DEBUG ErrorF("new property filled\n"); #endif @@ -3003,14 +3080,14 @@ ErrorF("- next %p\n", (void *)pRegProp); #endif pRegProp = pRegProp->next; - } + } pRegProp->next = pNewProp; } } #ifdef DEBUG ErrorF("xf86RegisterRootWindowProperty succeeded\n"); #endif - return(Success); + return(Success); } Bool Index: xc/programs/Xserver/hw/xfree86/common/xf86Init.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Init.c:3.228 xc/programs/Xserver/hw/xfree86/common/xf86Init.c:3.240 --- xc/programs/Xserver/hw/xfree86/common/xf86Init.c:3.228 Mon Mar 7 12:32:40 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86Init.c Sat Apr 8 14:30:26 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.228 2005/03/07 17:32:40 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.240 2006/04/08 18:30:26 dawes Exp $ */ /* * Loosely based on code bearing the following copyright: @@ -6,7 +6,7 @@ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. */ /* - * Copyright (c) 1992-2005 by The XFree86 Project, Inc. + * Copyright (c) 1992-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -102,7 +102,7 @@ #include #undef HAS_UTSNAME -#if !defined(WIN32) && !defined(__UNIXOS2__) +#if !defined(WIN32) #define HAS_UTSNAME 1 #include #endif @@ -111,10 +111,10 @@ #ifdef __UNIXOS2__ #define I_NEED_OS2_H #endif -#include "X.h" -#include "Xmd.h" -#include "Xproto.h" -#include "Xatom.h" +#include +#include +#include +#include #include "input.h" #include "servermd.h" #include "windowstr.h" @@ -141,8 +141,8 @@ #include "xf86Build.h" #include "mipointer.h" #ifdef XINPUT -#include "XI.h" -#include "XIproto.h" +#include +#include #else #include "inputstr.h" #endif @@ -160,6 +160,15 @@ extern int xtest_command_key; #endif /* XTESTEXT1 */ +#if !defined(LOADERTEST) || !defined(XFree86LOADER) +#undef LOADERTEST +#define LOADERTEST 0 +#endif + +#if LOADERTEST +#include "loadertest.h" +static Bool doLoaderTest = FALSE; +#endif /* forward declarations */ @@ -175,11 +184,6 @@ static char *cmdline = NULL; -#ifdef DO_CHECK_BETA -static int extraDays = 0; -static char *expKey = NULL; -#endif - #ifdef __UNIXOS2__ extern void os2ServerVideoAccess(); #endif @@ -307,34 +311,6 @@ done = TRUE; - /* - * Install signal handler for unexpected signals - */ - xf86Info.caughtSignal=FALSE; - if (!xf86Info.notrapSignals) { - signal(SIGSEGV,xf86SigHandler); - signal(SIGILL,xf86SigHandler); -#ifdef SIGEMT - signal(SIGEMT,xf86SigHandler); -#endif - signal(SIGFPE,xf86SigHandler); -#ifdef SIGBUS - signal(SIGBUS,xf86SigHandler); -#endif -#ifdef SIGSYS - signal(SIGSYS,xf86SigHandler); -#endif -#ifdef SIGXCPU - signal(SIGXCPU,xf86SigHandler); -#endif -#ifdef SIGXFSZ - signal(SIGXFSZ,xf86SigHandler); -#endif -#ifdef MEMDEBUG - signal(SIGUSR2,xf86SigMemDebug); -#endif - } - xf86OSPMClose = xf86OSPMOpen(); if (!noVT) { @@ -354,6 +330,7 @@ #ifdef XFree86LOADER const char **modulelist; pointer *optionlist; + Bool haveScreens = FALSE; #endif const char **driverlist; screenLayoutPtr layout; @@ -386,10 +363,6 @@ else xf86ServerName = argv[0]; -#ifdef DO_CHECK_BETA - xf86CheckBeta(extraDays, expKey); -#endif - /* Set default paths. */ xf86FileCmdline.handle = &xf86FileCmdline; xf86FileDefaults.handle = &xf86FileDefaults; @@ -444,6 +417,35 @@ appendauto = FALSE; } + /* + * Install signal handlers earlier to catch hardware problems. Perhaps + * there should be a command line flag to control xf86Info.notrapSignals. + */ + xf86Info.caughtSignal=FALSE; + if (!xf86Info.notrapSignals) { + signal(SIGSEGV,xf86SigHandler); + signal(SIGILL,xf86SigHandler); +#ifdef SIGEMT + signal(SIGEMT,xf86SigHandler); +#endif + signal(SIGFPE,xf86SigHandler); +#ifdef SIGBUS + signal(SIGBUS,xf86SigHandler); +#endif +#ifdef SIGSYS + signal(SIGSYS,xf86SigHandler); +#endif +#ifdef SIGXCPU + signal(SIGXCPU,xf86SigHandler); +#endif +#ifdef SIGXFSZ + signal(SIGXFSZ,xf86SigHandler); +#endif +#ifdef MEMDEBUG + signal(SIGUSR2,xf86SigMemDebug); +#endif + } + #ifdef XFree86LOADER /* Initialise the loader */ LoaderInit(); @@ -538,7 +540,12 @@ LoaderFreeDirList(list); } #endif - + +#if LOADERTEST + if (doLoaderTest) + LoaderTest(); +#endif + /* Load mandatory probe and base modules. */ if (probeModules) { if (!xf86LoadModules(probeModules, NULL)) @@ -702,7 +709,9 @@ * For autoconfiguration, where several drivers will be tried in * sequence, we need to make sure that those with a failing Probe() up * until the first successful Probe() are deleted here. This is - * important for the autoconfiguration retry mechanism. + * important for the autoconfiguration retry mechanism. Also, stop + * probing at the first successful probe. The remaining fallback + * drivers will be retried on preinit failure. */ found = 0; @@ -712,7 +721,7 @@ if (xf86DriverList[i]->Probe(xf86DriverList[i], PROBE_DEFAULT)) found++; if (!found) { - xf86DeleteDriver(i, TRUE); + xf86DeleteDriver(i); } } else { xf86MsgVerb(X_WARNING, 0, @@ -721,6 +730,8 @@ xf86DriverList[i]->driverName : "noname"); } xf86SetPciVideo(NULL,NONE); + if (found && autoconfig) + break; } } @@ -821,10 +832,19 @@ for (i = 0; i < xf86NumScreens; i++) { xf86EnableAccess(xf86Screens[i]); if (xf86Screens[i]->PreInit && - xf86Screens[i]->PreInit(xf86Screens[i], 0)) + xf86Screens[i]->PreInit(xf86Screens[i], 0)) { xf86Screens[i]->configured = TRUE; +#ifdef XFree86LOADER + haveScreens = TRUE; +#endif + } } +#ifdef XFree86LOADER + if (!haveScreens) + LoaderCheckUnresolved(0); +#endif + for (i = 0; i < xf86NumScreens; i++) if (!xf86Screens[i]->configured) xf86DeleteScreen(i--, 0); @@ -837,7 +857,7 @@ if (xf86NumScreens == 0 && autoconfig) { for (i = 0; i < xf86NumDrivers; i++) { if (xf86DriverList[i]) { - xf86DeleteDriver(i, TRUE); + xf86DeleteDriver(i); autoretry = TRUE; /* Clear claimed config sections. */ for (j = 0; j < xf86Info.serverLayout->numScreens; j++) { @@ -911,11 +931,10 @@ } #ifdef XFree86LOADER - xf86DoDeferredUnloads(); /* Remove (unload) drivers that are not required. */ for (i = 0; i < xf86NumDrivers; i++) if (xf86DriverList[i] && xf86DriverList[i]->refCount <= 0) { - xf86DeleteDriver(i, FALSE); + xf86DeleteDriver(i); } #endif @@ -1063,34 +1082,6 @@ xf86EnableIO(); } -#if 0 - /* - * Install signal handler for unexpected signals - */ - xf86Info.caughtSignal=FALSE; - if (!xf86Info.notrapSignals) - { - signal(SIGSEGV,xf86SigHandler); - signal(SIGILL,xf86SigHandler); -#ifdef SIGEMT - signal(SIGEMT,xf86SigHandler); -#endif - signal(SIGFPE,xf86SigHandler); -#ifdef SIGBUS - signal(SIGBUS,xf86SigHandler); -#endif -#ifdef SIGSYS - signal(SIGSYS,xf86SigHandler); -#endif -#ifdef SIGXCPU - signal(SIGXCPU,xf86SigHandler); -#endif -#ifdef SIGXFSZ - signal(SIGXFSZ,xf86SigHandler); -#endif - } -#endif - /* * Use the previously collected parts to setup pScreenInfo */ @@ -1197,7 +1188,7 @@ } #ifdef XFree86LOADER - if ((serverGeneration == 1) && LoaderCheckUnresolved(LD_RESOLV_IFDONE)) { + if ((serverGeneration == 1) && LoaderCheckUnresolved(0)) { /* For now, just a warning */ xf86Msg(X_WARNING, "Some symbols could not be resolved!\n"); } @@ -1412,7 +1403,7 @@ #ifdef O_NONBLOCK if (!beenHere) { #if !defined(__EMX__) - if (geteuid() == 0 && getuid() != geteuid()) + if (PRIVS_ELEVATED) #endif { int status; @@ -1460,9 +1451,6 @@ #ifdef USE_XF86_SERVERLOCK xf86UnlockServer(); #endif -#ifdef XFreeXDGA - DGAShutdown(); -#endif if (!noVT) xf86CloseConsole(); @@ -1470,8 +1458,9 @@ xf86CloseLog(); /* If an unexpected signal was caught, dump a core for debugging */ - if (xf86Info.caughtSignal) + if (xf86Info.caughtSignal) { abort(); + } } @@ -1503,9 +1492,12 @@ sleep(1); #endif if (xf86Screens && !noVT) { +#ifdef XFreeXDGA + DGAShutdown(); +#endif if (xf86Screens[0]->vtSema) xf86EnterServerState(SETUP); - for (i = 0; i < xf86NumScreens; i++) + for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->vtSema) { /* * If we are aborting before ScreenInit() has finished @@ -1515,6 +1507,7 @@ xf86EnableAccess(xf86Screens[i]); (xf86Screens[i]->LeaveVT)(i, 0); } + } } xf86AccessLeave(); @@ -1598,7 +1591,7 @@ } /* First the options that are only allowed for root */ - if (getuid() == 0) + if (!PRIVS_ELEVATED) { if (!strcmp(argv[i], "-modulepath")) { if (!argv[++i]) @@ -1624,7 +1617,7 @@ { if (!argv[++i]) return 0; - if (getuid() != 0 && !xf86PathIsSafe(argv[i])) { + if (PRIVS_ELEVATED && !xf86PathIsSafe(argv[i])) { FatalError("\nInvalid argument for -xf86config\n" "\tFor non-root users, the file specified with -xf86config must be\n" "\ta relative path and must not contain any \"..\" elements.\n" @@ -1704,12 +1697,20 @@ #endif return 1; } -#ifdef DO_CHECK_BETA - if (!strcmp(argv[i],"-extendExpiry")) +#ifdef XFree86LOADER +#if LOADERTEST + if (!strcmp(argv[i],"-loadertest")) { - extraDays = atoi(argv[i + 1]); - expKey = argv[i + 2]; - return 3; + doLoaderTest = TRUE; + return 1; + } +#endif + if (!strcmp(argv[i],"-loaderdebug")) + { + if (++i >= argc) + return 0; + LoaderSetDebug(atoi(argv[i])); + return 2; } #endif if (!strcmp(argv[i],"-verbose")) @@ -1940,7 +1941,7 @@ } if (!strcmp(argv[i], "-configure")) { - if (getuid() != 0) { + if (PRIVS_ELEVATED) { ErrorF("The '-configure' option can only be used by root.\n"); exit(1); } @@ -1964,7 +1965,7 @@ ErrorF("\n"); ErrorF("\n"); ErrorF("Device Dependent Usage\n"); - if (getuid() == 0) + if (!PRIVS_ELEVATED) { ErrorF("-xf86config file specify a configuration file\n"); ErrorF("-modulepath paths specify the module search path\n"); Index: xc/programs/Xserver/hw/xfree86/common/xf86Io.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Io.c:3.58 xc/programs/Xserver/hw/xfree86/common/xf86Io.c:3.59 --- xc/programs/Xserver/hw/xfree86/common/xf86Io.c:3.58 Wed Jun 2 18:43:04 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86Io.c Fri Oct 14 11:16:33 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Io.c,v 3.58 2004/06/02 22:43:04 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Io.c,v 3.59 2005/10/14 15:16:33 tsi Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -70,8 +70,8 @@ #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" +#include +#include #include "inputstr.h" #include "scrnintstr.h" @@ -85,7 +85,7 @@ #ifdef XINPUT #include "xf86Xinput.h" -#include "XIproto.h" +#include #include "exevents.h" #endif Index: xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c:3.27 xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c:3.29 --- xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c:3.27 Fri Feb 13 18:58:37 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c Mon Jan 9 09:59:52 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c,v 3.27 2004/02/13 23:58:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c,v 3.29 2006/01/09 14:59:52 dawes Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -68,14 +68,12 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $XConsortium: xf86Kbd.c /main/10 1996/02/21 17:38:32 kaleb $ */ - #ifdef __UNIXOS2__ #define I_NEED_OS2_H #endif -#include "X.h" -#include "Xmd.h" +#include +#include #include "input.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c:3.23 xc/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c:3.25 --- xc/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c:3.23 Fri Feb 13 18:58:37 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c Mon Jan 9 09:59:52 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c,v 3.23 2004/02/13 23:58:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c,v 3.25 2006/01/09 14:59:52 dawes Exp $ */ /* * Derived from xf86Kbd.c by S_ren Schmidt (sos@login.dkuug.dk) * which is Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. @@ -69,10 +69,8 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $XConsortium: xf86KbdBSD.c /main/6 1996/10/23 13:12:27 kaleb $ */ - -#include "X.h" -#include "Xmd.h" +#include +#include #include "input.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c:3.18 xc/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c:3.22 --- xc/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c:3.18 Fri Feb 13 18:58:37 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c Wed Apr 19 09:02:38 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c,v 3.18 2004/02/13 23:58:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c,v 3.22 2006/04/19 13:02:38 dawes Exp $ */ /* * Linux version of keymapping setup. The kernel (since 0.99.14) has support * for fully remapping the keyboard, but there are some differences between @@ -29,7 +29,7 @@ * */ /* - * Copyright (c) 1994-2001 by The XFree86 Project, Inc. + * Copyright (c) 1994-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -75,10 +75,8 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $XConsortium: xf86KbdLnx.c /main/7 1996/10/19 17:59:00 kaleb $ */ - -#include "X.h" -#include "Xmd.h" +#include +#include #include "input.h" #include "scrnintstr.h" @@ -87,10 +85,18 @@ #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" +#include +#undef KEY_F13 +#undef KEY_F14 +#undef KEY_F15 +#undef KEY_F16 +#undef KEY_F17 +#undef KEY_XFER +#undef KEY_UNKNOWN #include "atKeynames.h" #include "xf86Keymap.h" -#include "DECkeysym.h" +#include /* * LegalModifier -- @@ -183,8 +189,6 @@ pKeySyms->maxKeyCode = MAX_KEYCODE; } -#include - static KeySym linux_to_x[256] = { NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, @@ -360,7 +364,7 @@ } else { k = map+GLYPHS_PER_KEY; - maxkey = NUM_AT2LNX; + maxkey = NUM_AT2LNX - 1; } for (i = 0; i < maxkey; ++i) Index: xc/programs/Xserver/hw/xfree86/common/xf86KbdMach.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86KbdMach.c:3.8 xc/programs/Xserver/hw/xfree86/common/xf86KbdMach.c:3.10 --- xc/programs/Xserver/hw/xfree86/common/xf86KbdMach.c:3.8 Sat Jul 25 12:55:09 1998 +++ xc/programs/Xserver/hw/xfree86/common/xf86KbdMach.c Mon Jan 9 09:59:52 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdMach.c,v 3.8 1998/07/25 16:55:09 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdMach.c,v 3.10 2006/01/09 14:59:52 dawes Exp $ */ /* ***************************************************************************** * HISTORY @@ -35,10 +35,9 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XConsortium: xf86KbdMach.c /main/9 1996/02/21 17:38:43 kaleb $ */ -#include "X.h" -#include "Xmd.h" +#include +#include #include "input.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h diff -u xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h:3.21 xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h:3.22 --- xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h:3.21 Fri Feb 13 18:58:37 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h Mon Jan 9 09:59:52 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h,v 3.21 2004/02/13 23:58:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h,v 3.22 2006/01/09 14:59:52 dawes Exp $ */ /* * Copyright (c) 1994-2002 by The XFree86 Project, Inc. @@ -52,7 +52,6 @@ * For Scancodes see notes in atKeynames.h !!!! * */ -/* $XConsortium: xf86Keymap.h /main/14 1996/02/21 17:38:47 kaleb $ */ static KeySym map[NUM_KEYCODES * GLYPHS_PER_KEY] = { Index: xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c:1.18 xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c:1.19 --- xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c:1.18 Wed Jan 26 00:31:49 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c Fri Oct 14 11:16:33 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c,v 1.18 2005/01/26 05:31:49 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c,v 1.19 2005/10/14 15:16:33 tsi Exp $ */ /* * Copyright (c) 1999-2005 by The XFree86 Project, Inc. * All rights reserved. @@ -55,14 +55,14 @@ #define I_NEED_OS2_H #endif -#include "X.h" +#include #include "os.h" #include "xf86.h" #include "xf86Priv.h" #ifdef XF86MISC #define _XF86MISC_SERVER_ -#include "xf86misc.h" +#include #include "xf86miscproc.h" #endif @@ -70,8 +70,8 @@ #include "xf86_OSlib.h" #ifdef XINPUT -#include "XI.h" -#include "XIproto.h" +#include +#include #include "xf86Xinput.h" #else #include "inputstr.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Mode.c:1.80 xc/programs/Xserver/hw/xfree86/common/xf86Mode.c:1.83 --- xc/programs/Xserver/hw/xfree86/common/xf86Mode.c:1.80 Sat Feb 26 13:31:48 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86Mode.c Fri Oct 14 11:16:33 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.80 2005/02/26 18:31:48 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.83 2005/10/14 15:16:33 tsi Exp $ */ /* * Copyright (c) 1997-2005 by The XFree86 Project, Inc. * All rights reserved. @@ -99,7 +99,7 @@ * This file includes helper functions for mode related things. */ -#include "X.h" +#include #include "os.h" #include "servermd.h" #include "mibank.h" @@ -1487,6 +1487,7 @@ monitor->hsync[i].lo = hsync[i].lo; monitor->hsync[i].hi = hsync[i].hi; } + type = "DDC-derived "; } else { monitor->hsync[0].lo = 28; monitor->nHsync = 1; @@ -1524,6 +1525,7 @@ monitor->vrefresh[i].lo = vrefresh[i].lo; monitor->vrefresh[i].hi = vrefresh[i].hi; } + type = "DDC-derived "; } else { monitor->nVrefresh = 1; if (hSize > 0 && vSize > 0) { @@ -2101,7 +2103,9 @@ /* * Check the mode pool against a preferred refresh rate and preferred - * mode size. + * mode size. Mark those modes that do not match as "low preference" + * modes. Low preference modes may be used, but will not be selected + * by default. */ for (q = scrp->modePool; q != NULL; q = q->next) { if (q->status != MODE_OK) @@ -2110,22 +2114,22 @@ if (ModeVRefresh(q) < (1.0 - SYNC_TOLERANCE) * targetRefresh) { if (preferredH <= 0 || preferredV <= 0) { xf86DrvMsg(scrp->scrnIndex, X_INFO, - "Not using %s \"%s\" because its refresh (%.1f) " - "is below the target (%.1f).\n", + "Low preference %s \"%s\" because its " + "refresh (%.1f) is below the target (%.1f).\n", xf86ModeTypeToString(q->type), q->name, ModeVRefresh(q), targetRefresh); - q->status = MODE_REFRESH_LOW; + q->type |= M_T_LOWPREF; } } if (preferredH > 0 && preferredV > 0 && (q->HDisplay > preferredH || q->VDisplay > preferredV)) { xf86DrvMsg(scrp->scrnIndex, X_INFO, - "Not using %s \"%s\" because it is " + "Low preference %s \"%s\" because it is " "larger than the preferred mode (%dx%d).\n", xf86ModeTypeToString(q->type), q->name, preferredH, preferredV); - q->status = MODE_TOO_BIG; + q->type |= M_T_LOWPREF; } } @@ -2201,9 +2205,15 @@ ((double)q->HTotal / (double)q->HDisplay) < 1.15) continue; - if (modeSize < (q->HDisplay * q->VDisplay)) { - r = q; - modeSize = q->HDisplay * q->VDisplay; + /* + * Do not allow low preference modes to influence the + * the default mode choice. + */ + if (!(q->type & M_T_LOWPREF)) { + if (modeSize < (q->HDisplay * q->VDisplay)) { + r = q; + modeSize = q->HDisplay * q->VDisplay; + } } } } Index: xc/programs/Xserver/hw/xfree86/common/xf86Module.h diff -u xc/programs/Xserver/hw/xfree86/common/xf86Module.h:1.41 xc/programs/Xserver/hw/xfree86/common/xf86Module.h:1.46 --- xc/programs/Xserver/hw/xfree86/common/xf86Module.h:1.41 Thu Jan 20 21:03:12 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86Module.h Thu Mar 16 11:49:56 2006 @@ -1,7 +1,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Module.h,v 1.41 2005/01/21 02:03:12 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Module.h,v 1.46 2006/03/16 16:49:56 dawes Exp $ */ /* - * Copyright (c) 1997-2005 by The XFree86 Project, Inc. + * Copyright (c) 1997-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -65,10 +65,13 @@ #include "misc.h" #include "xf86Version.h" +#include "extnsionst.h" + #ifndef NULL #define NULL ((void *)0) #endif +/* These are redundant, and kept for compatibility purposes only. */ typedef enum { LD_RESOLV_IFDONE = 0, /* only check if no more delays pending */ @@ -104,11 +107,11 @@ * changed. The minor revision mask is 0x0000FFFF and the major revision * mask is 0xFFFF0000. */ -#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 3) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(0, 8) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(0, 5) -#define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 3) -#define ABI_FONT_VERSION SET_ABI_VERSION(0, 5) +#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 3) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(0, 10) +#define ABI_XINPUT_VERSION SET_ABI_VERSION(0, 5) +#define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 4) +#define ABI_FONT_VERSION SET_ABI_VERSION(0, 5) #define MODINFOSTRING1 0xef23fdc5 #define MODINFOSTRING2 0x10dc023a @@ -196,10 +199,6 @@ #define GET_MODULE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF) #define GET_MODULE_PATCHLEVEL(vers) ((vers) & 0xFFFF) -#define INITARGS void - -typedef void (*InitExtension)(INITARGS); - typedef struct { InitExtension initFunc; const char * name; @@ -208,18 +207,18 @@ const char ** initDependencies; } ExtensionModule; +typedef struct module_desc *ModuleDescPtr; +typedef struct font_module *FontModulePtr; + extern ExtensionModule *ExtensionModuleList; /* Prototypes for Loader functions that are exported to modules */ -#ifndef IN_LOADER -/* Prototypes with opaque pointers for use by modules */ -pointer LoadSubModule(pointer, const char *, const char **, - const char **, pointer, const XF86ModReqInfo *, - int *, int *); -void UnloadSubModule(pointer); -void LoadFont(pointer); -void UnloadModule (pointer); -#endif +ModuleDescPtr LoadSubModule(ModuleDescPtr, const char *, const char **, + const char **, pointer, const XF86ModReqInfo *, + int *, int *); +void UnloadSubModule(ModuleDescPtr); +void UnloadModule (ModuleDescPtr); +void LoadFont(FontModulePtr); pointer LoaderSymbol(const char *); char **LoaderListDirs(const char **, const char **); void LoaderFreeDirList(char **); @@ -229,12 +228,16 @@ void LoaderRefSymbols(const char *, ...); void LoaderReqSymLists(const char **, ...); void LoaderReqSymbols(const char *, ...); +void LoaderModRefSymLists(ModuleDescPtr, const char **, ...); +void LoaderModRefSymbols(ModuleDescPtr, const char *, ...); +int LoaderModReqSymLists(ModuleDescPtr, const char **, ...); +int LoaderModReqSymbols(ModuleDescPtr, const char *, ...); int LoaderCheckUnresolved(int); void LoaderGetOS(const char **name, int *major, int *minor, int *teeny); -typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *); +typedef pointer (*ModuleSetupProc)(ModuleDescPtr, pointer, int *, int *); typedef void (*ModuleTearDownProc)(pointer); -#define MODULESETUPPROTO(func) pointer func(pointer, pointer, int*, int*) +#define MODULESETUPPROTO(func) pointer func(ModuleDescPtr, pointer, int*, int*) #define MODULETEARDOWNPROTO(func) void func(pointer) typedef struct { @@ -243,4 +246,4 @@ ModuleTearDownProc teardown; } XF86ModuleData; -#endif /* _XF86STR_H */ +#endif /* _XF86MODULE_H */ Index: xc/programs/Xserver/hw/xfree86/common/xf86Option.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Option.c:1.36 xc/programs/Xserver/hw/xfree86/common/xf86Option.c:1.37 --- xc/programs/Xserver/hw/xfree86/common/xf86Option.c:1.36 Thu Feb 17 20:52:59 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86Option.c Fri Oct 14 11:16:33 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Option.c,v 1.36 2005/02/18 01:52:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Option.c,v 1.37 2005/10/14 15:16:33 tsi Exp $ */ /* * Copyright (c) 1998-2005 by The XFree86 Project, Inc. * All rights reserved. @@ -98,7 +98,7 @@ #include #include -#include "X.h" +#include #include "os.h" #include "xf86.h" #include "xf86Xinput.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86PM.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86PM.c:3.10 xc/programs/Xserver/hw/xfree86/common/xf86PM.c:3.11 --- xc/programs/Xserver/hw/xfree86/common/xf86PM.c:3.10 Fri Feb 13 18:58:38 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86PM.c Fri Oct 14 11:16:33 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PM.c,v 3.10 2004/02/13 23:58:38 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PM.c,v 3.11 2005/10/14 15:16:33 tsi Exp $ */ /* * Copyright (c) 2000-2002 by The XFree86 Project, Inc. * All rights reserved. @@ -46,7 +46,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "X.h" +#include #include "xf86.h" #include "xf86Priv.h" #include "xf86Xinput.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h diff -u xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h:1.163 xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h:1.165 --- xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h:1.163 Tue Feb 15 16:31:09 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h Tue Apr 11 21:07:31 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.163 2005/02/15 21:31:09 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.165 2006/04/12 01:07:31 dawes Exp $ */ /* * Copyright (c) 1995-2003 by The XFree86 Project, Inc. @@ -116,6 +116,8 @@ #define PCI_VENDOR_TRITECH 0x1292 #define PCI_VENDOR_NVIDIA_SGS 0x12D2 #define PCI_VENDOR_VMWARE 0x15AD +#define PCI_VENDOR_XGI 0x18CA +#define PCI_VENDOR_AST 0x1A03 #define PCI_VENDOR_3DLABS 0x3D3D #define PCI_VENDOR_AVANCE_2 0x4005 #define PCI_VENDOR_HERCULES 0x4843 @@ -635,13 +637,14 @@ #define PCI_CHIP_460GX_GXB_1 0x84EA /* PCI function 1 */ /* Silicon Motion Inc. */ -#define PCI_CHIP_SMI910 0x0910 -#define PCI_CHIP_SMI810 0x0810 -#define PCI_CHIP_SMI820 0x0820 +#define PCI_CHIP_SMI501 0x0501 #define PCI_CHIP_SMI710 0x0710 #define PCI_CHIP_SMI712 0x0712 #define PCI_CHIP_SMI720 0x0720 #define PCI_CHIP_SMI731 0x0730 +#define PCI_CHIP_SMI810 0x0810 +#define PCI_CHIP_SMI820 0x0820 +#define PCI_CHIP_SMI910 0x0910 /* VMware */ #define PCI_CHIP_VMWARE0405 0x0405 Index: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h diff -u xc/programs/Xserver/hw/xfree86/common/xf86Priv.h:3.89 xc/programs/Xserver/hw/xfree86/common/xf86Priv.h:3.93 --- xc/programs/Xserver/hw/xfree86/common/xf86Priv.h:3.89 Thu Jan 27 21:11:19 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86Priv.h Mon Mar 6 20:03:40 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.89 2005/01/28 02:11:19 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.93 2006/03/07 01:03:40 dawes Exp $ */ /* * Copyright (c) 1997-2005 by The XFree86 Project, Inc. @@ -105,6 +105,8 @@ #include "xf86Privstr.h" #include "propertyst.h" +#define PRIVS_ELEVATED (getuid() != geteuid() || getgid() != getegid()) + /* * Parameters set ONLY from the command line options * The global state of these things is held in xf86InfoRec (when appropriate). @@ -191,9 +193,6 @@ /* Function Prototypes */ #ifndef _NO_XF86_PROTOTYPES -/* xf86Beta.c */ -extern void xf86CheckBeta(int extraDays, char *key); - /* xf86Bus.c */ void xf86BusProbe(void); @@ -255,6 +254,10 @@ extern int (*xf86PMGetEventFromOs)(int fd,pmEvent *events,int num); extern pmWait (*xf86PMConfirmEventToOs)(int fd,pmEvent event); void xf86GrabServerCallback(CallbackListPtr *, pointer, pointer); +#ifdef WSCONS_SUPPORT +struct wscons_event; +void xf86PostWSKbdEvent(struct wscons_event *event); +#endif /* xf86Helper.c */ void xf86LogInit(void); @@ -280,6 +283,11 @@ void xf86KbdGetMapping(KeySymsPtr pKeySyms, CARD8 *pModMap); +#ifdef WSCONS_SUPPORT +/* xf86KbdBSD.c */ +int WSKbdToKeycode(int keycode); +#endif + /* xf86Lock.c */ #ifdef USE_XF86_SERVERLOCK Index: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86RandR.c:1.8 xc/programs/Xserver/hw/xfree86/common/xf86RandR.c:1.17 --- xc/programs/Xserver/hw/xfree86/common/xf86RandR.c:1.8 Mon Nov 10 11:42:13 2003 +++ xc/programs/Xserver/hw/xfree86/common/xf86RandR.c Fri Oct 14 11:16:33 2005 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.8 2003/11/10 16:42:13 tsi Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.17 2005/10/14 15:16:33 tsi Exp $ * * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * @@ -22,7 +22,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -#include "X.h" +#include #include "os.h" #include "mibank.h" #include "globals.h" @@ -37,9 +37,10 @@ CloseScreenProcPtr CloseScreen; int virtualX; int virtualY; + Rotation rotation; } XF86RandRInfoRec, *XF86RandRInfoPtr; -static int xf86RandRIndex; +static int xf86RandRIndex = -1; static int xf86RandRGeneration; #define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[xf86RandRIndex].ptr) @@ -130,6 +131,8 @@ { scrp->virtualX = pScreen->width = oldWidth; scrp->virtualY = pScreen->height = oldHeight; + if (pRoot) + xf86EnableDisableFBAccess (pScreen->myNum, TRUE); return FALSE; } /* @@ -158,6 +161,7 @@ DisplayModePtr mode; int px, py; Bool useVirtual = FALSE; + Rotation oldRotation = randrp->rotation; miPointerPosition (&px, &py); for (mode = scrp->modes; ; mode = mode->next) @@ -178,15 +182,25 @@ return FALSE; } } - if (!xf86RandRSetMode (pScreen, mode, useVirtual)) + + randrp->rotation = rotation; + + if (!xf86RandRSetMode (pScreen, mode, useVirtual)) { + randrp->rotation = oldRotation; return FALSE; + } + /* * Move the cursor back where it belongs; SwitchMode repositions it */ if (pScreen == miPointerCurrentScreen ()) { - if (px < pSize->width && py < pSize->height) - (*pScreen->SetCursorPosition) (pScreen, px, py, FALSE); + px = (px >= pScreen->width ? (pScreen->width - 1) : px); + py = (py >= pScreen->height ? (pScreen->height - 1) : py); + + xf86SetViewport(pScreen, px, py); + + (*pScreen->SetCursorPosition) (pScreen, px, py, FALSE); } return TRUE; } @@ -236,6 +250,15 @@ return (*pScreen->CloseScreen) (index, pScreen); } +Rotation +xf86GetRotation(ScreenPtr pScreen) +{ + if (xf86RandRIndex == -1) + return RR_Rotate_0; + + return XF86RANDRINFO(pScreen)->rotation; +} + Bool xf86RandRInit (ScreenPtr pScreen) { @@ -276,6 +299,8 @@ randrp->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xf86RandRCloseScreen; + randrp->rotation = RR_Rotate_0; + pScreen->devPrivates[xf86RandRIndex].ptr = randrp; return TRUE; } Index: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h diff -u xc/programs/Xserver/hw/xfree86/common/xf86Resources.h:1.16 xc/programs/Xserver/hw/xfree86/common/xf86Resources.h:1.17 --- xc/programs/Xserver/hw/xfree86/common/xf86Resources.h:1.16 Fri Feb 13 18:58:38 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86Resources.h Thu Jun 2 23:18:31 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h,v 1.16 2004/02/13 23:58:38 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h,v 1.17 2005/06/03 03:18:31 tsi Exp $ */ /* * Copyright (c) 1999-2002 by The XFree86 Project, Inc. @@ -49,44 +49,44 @@ #ifndef _XF86_RESOURCES_H -#define _XF86_RESOURCES_H +#define _XF86_RESOURCES_H 1 #include "xf86str.h" -#define _END {ResEnd,0,0} +#define _END {ResEnd, 0, 0} #define _VGA_EXCLUSIVE \ - {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\ - {ResExcMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\ - {ResExcMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\ - {ResExcIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\ - {ResExcIoBlock | ResBios | ResBus, 0x03C0, 0x03DF} + {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF}, \ + {ResExcMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF}, \ + {ResExcMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF}, \ + {ResExcIoBlock | ResBios | ResBus, 0x03B0, 0x03BB}, \ + {ResExcIoBlock | ResBios | ResBus, 0x03C0, 0x03DF} #define _VGA_SHARED \ - {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\ - {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\ - {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\ - {ResShrIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\ - {ResShrIoBlock | ResBios | ResBus, 0x03C0, 0x03DF} + {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF}, \ + {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF}, \ + {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF}, \ + {ResShrIoBlock | ResBios | ResBus, 0x03B0, 0x03BB}, \ + {ResShrIoBlock | ResBios | ResBus, 0x03C0, 0x03DF} #define _VGA_SHARED_MEM \ - {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\ - {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\ - {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF} + {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF}, \ + {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF}, \ + {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF} #define _VGA_SHARED_IO \ - {ResShrIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\ - {ResShrIoBlock | ResBios | ResBus, 0x03C0, 0x03DF} + {ResShrIoBlock | ResBios | ResBus, 0x03B0, 0x03BB}, \ + {ResShrIoBlock | ResBios | ResBus, 0x03C0, 0x03DF} /* * Exclusive unused VGA: resources unneeded but cannot be disabled. * Like old Millennium. */ #define _VGA_EXCLUSIVE_UNUSED \ - {ResExcUusdMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\ - {ResExcUusdMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\ - {ResExcUusdMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\ - {ResExcUusdIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\ + {ResExcUusdMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF}, \ + {ResExcUusdMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF}, \ + {ResExcUusdMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF}, \ + {ResExcUusdIoBlock | ResBios | ResBus, 0x03B0, 0x03BB}, \ {ResExcUusdIoBlock | ResBios | ResBus, 0x03C0, 0x03DF} /* @@ -94,37 +94,41 @@ * independently. This is used to determine if a device needs RAC. */ #define _VGA_SHARED_UNUSED \ - {ResShrUusdMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\ - {ResShrUusdMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\ - {ResShrUusdMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\ - {ResShrUusdIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\ + {ResShrUusdMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF}, \ + {ResShrUusdMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF}, \ + {ResShrUusdMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF}, \ + {ResShrUusdIoBlock | ResBios | ResBus, 0x03B0, 0x03BB}, \ {ResShrUusdIoBlock | ResBios | ResBus, 0x03C0, 0x03DF} /* * Sparse versions of the above for those adapters that respond to all ISA * aliases of VGA ports. + * + * A note on how sparse masks are to be specified here, indeed throughout the + * server. To augment their applicability to all host architectures, sparse + * masks need to be 1-extended. */ #define _VGA_EXCLUSIVE_SPARSE \ - {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\ - {ResExcMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\ - {ResExcMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\ - {ResExcIoSparse | ResBios | ResBus, 0x03B0, 0x03F8},\ - {ResExcIoSparse | ResBios | ResBus, 0x03B8, 0x03FC},\ - {ResExcIoSparse | ResBios | ResBus, 0x03C0, 0x03E0} + {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF}, \ + {ResExcMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF}, \ + {ResExcMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF}, \ + {ResExcIoSparse | ResBios | ResBus, 0x03B0, (int)0xFFFF03F8}, \ + {ResExcIoSparse | ResBios | ResBus, 0x03B8, (int)0xFFFF03FC}, \ + {ResExcIoSparse | ResBios | ResBus, 0x03C0, (int)0xFFFF03E0} #define _VGA_SHARED_SPARSE \ - {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\ - {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\ - {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\ - {ResShrIoSparse | ResBios | ResBus, 0x03B0, 0x03F8},\ - {ResShrIoSparse | ResBios | ResBus, 0x03B8, 0x03FC},\ - {ResShrIoSparse | ResBios | ResBus, 0x03C0, 0x03E0} + {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF}, \ + {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF}, \ + {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF}, \ + {ResShrIoSparse | ResBios | ResBus, 0x03B0, (int)0xFFFF03F8}, \ + {ResShrIoSparse | ResBios | ResBus, 0x03B8, (int)0xFFFF03FC}, \ + {ResShrIoSparse | ResBios | ResBus, 0x03C0, (int)0xFFFF03E0} #define _8514_EXCLUSIVE \ - {ResExcIoSparse | ResBios | ResBus, 0x02E8, 0x03F8} + {ResExcIoSparse | ResBios | ResBus, 0x02E8, (int)0xFFFF03F8} #define _8514_SHARED \ - {ResShrIoSparse | ResBios | ResBus, 0x02E8, 0x03F8} + {ResShrIoSparse | ResBios | ResBus, 0x02E8, (int)0xFFFF03F8} /* Predefined resources */ extern resRange resVgaExclusive[]; @@ -150,11 +154,12 @@ #define RES_SHARED_8514 res8514Shared #define _PCI_AVOID_PC_STYLE \ - {ResExcIoSparse | ResBus, 0x0100, 0x0300},\ - {ResExcIoSparse | ResBus, 0x0200, 0x0200},\ - {ResExcMemBlock | ResBus, 0xA0000,0xFFFFF} + {ResExcIoSparse | ResBus, 0x0100, 0xFFFF0300}, \ + {ResExcIoSparse | ResBus, 0x0200, 0xFFFF0200}, \ + {ResExcMemBlock | ResBus, 0xA0000, 0x000FFFFF} extern resRange PciAvoid[]; #define RES_UNDEFINED NULL -#endif + +#endif /* _XF86_RESOURCES_H */ Index: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c:1.18 xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c:1.19 --- xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c:1.18 Fri Feb 13 18:58:38 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c Fri Oct 14 11:16:33 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v 1.18 2004/02/13 23:58:38 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v 1.19 2005/10/14 15:16:33 tsi Exp $ */ /* * Copyright (c) 1999-2003 by The XFree86 Project, Inc. * All rights reserved. @@ -55,7 +55,7 @@ * maintained. */ -#include "X.h" +#include #include "os.h" #include "xf86.h" #include "xf86Priv.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86XKB.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86XKB.c:3.13 xc/programs/Xserver/hw/xfree86/common/xf86XKB.c:3.15 --- xc/programs/Xserver/hw/xfree86/common/xf86XKB.c:3.13 Fri Feb 13 18:58:38 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86XKB.c Mon Jan 9 09:59:52 2006 @@ -1,4 +1,5 @@ -/* $XConsortium: xf86XKB.c /main/4 1996/02/04 09:28:04 kaleb $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86XKB.c,v 3.15 2006/01/09 14:59:52 dawes Exp $ */ + /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. @@ -71,8 +72,6 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86XKB.c,v 3.13 2004/02/13 23:58:38 dawes Exp $ */ - #include #define NEED_EVENTS 1 #include @@ -81,7 +80,7 @@ #include "inputstr.h" #include "scrnintstr.h" #include "windowstr.h" -#include "XI.h" +#include #include "compiler.h" @@ -90,7 +89,7 @@ #define XF86_OS_PRIVS #include "xf86_OSlib.h" -#include "XKBsrv.h" +#include void xf86InitXkb(void) Index: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c:3.71 xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c:3.73 --- xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c:3.71 Fri Feb 13 18:58:39 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c Mon Jan 9 09:59:52 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c,v 3.71 2004/02/13 23:58:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c,v 3.73 2006/01/09 14:59:52 dawes Exp $ */ /* * Copyright 1995-1999 by Frederic Lepied, France. * @@ -67,13 +67,12 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $XConsortium: xf86Xinput.c /main/14 1996/10/27 11:05:25 kaleb $ */ -#include "Xfuncproto.h" -#include "Xmd.h" +#include +#include #ifdef XINPUT -#include "XI.h" -#include "XIproto.h" +#include +#include #endif #include "xf86.h" #include "xf86Priv.h" @@ -86,7 +85,7 @@ #ifdef DPMSExtension #define DPMS_SERVER -#include "extensions/dpms.h" +#include #include "dpmsproc.h" #endif @@ -106,7 +105,7 @@ #include #include "osdep.h" /* EnabledDevices */ -#include "Xpoll.h" +#include #include "xf86_OSproc.h" /* sigio stuff */ /****************************************************************************** Index: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h diff -u xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h:3.37 xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h:3.40 --- xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h:3.37 Fri Feb 13 18:58:39 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h Thu Mar 16 11:49:56 2006 @@ -1,4 +1,5 @@ -/* $XConsortium: xf86Xinput.h /main/11 1996/10/27 11:05:29 kaleb $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h,v 3.40 2006/03/16 16:49:56 dawes Exp $ */ + /* * Copyright 1995-1999 by Frederic Lepied, France. * @@ -23,7 +24,7 @@ */ /* - * Copyright (c) 2000-2002 by The XFree86 Project, Inc. + * Copyright (c) 2000-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -69,8 +70,6 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h,v 3.37 2004/02/13 23:58:39 dawes Exp $ */ - #ifndef _xf86Xinput_h #define _xf86Xinput_h @@ -80,8 +79,8 @@ #include "xf86str.h" #include "inputstr.h" #ifdef XINPUT -#include "extensions/XI.h" -#include "extensions/XIproto.h" +#include +#include #include "XIstubs.h" #endif @@ -128,7 +127,7 @@ void (*UnInit)(struct _InputDriverRec *drv, struct _LocalDeviceRec *pInfo, int flags); - pointer module; + ModuleDescPtr module; int refCount; } InputDriverRec, *InputDriverPtr; #endif @@ -173,7 +172,7 @@ IntegerFeedbackPtr always_core_feedback; IDevPtr conf_idev; InputDriverPtr drv; - pointer module; + ModuleDescPtr module; pointer options; } LocalDeviceRec, *LocalDevicePtr, InputInfoRec, *InputInfoPtr; @@ -228,7 +227,7 @@ void xf86RemoveEnabledDevice(InputInfoPtr pInfo); /* xf86Helper.c */ -void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags); +void xf86AddInputDriver(InputDriverPtr driver, ModuleDescPtr module, int flags); void xf86DeleteInputDriver(int drvIndex); InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags); void xf86DeleteInput(InputInfoPtr pInp, int flags); Index: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86cmap.c:1.26 xc/programs/Xserver/hw/xfree86/common/xf86cmap.c:1.27 --- xc/programs/Xserver/hw/xfree86/common/xf86cmap.c:1.26 Fri Feb 13 18:58:39 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86cmap.c Fri Oct 14 11:16:34 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.26 2004/02/13 23:58:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.27 2005/10/14 15:16:34 tsi Exp $ */ /* * Copyright (c) 1998-2001 by The XFree86 Project, Inc. * All rights reserved. @@ -54,9 +54,9 @@ #undef _XOPEN_SOURCE #endif -#include "X.h" +#include #include "misc.h" -#include "Xproto.h" +#include #include "colormapst.h" #include "scrnintstr.h" @@ -69,7 +69,7 @@ #ifdef XFreeXDGA #define _XF86DGA_SERVER_ -#include "extensions/xf86dgastr.h" +#include #include "dgaproc.h" #endif Index: xc/programs/Xserver/hw/xfree86/common/xf86dbe.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/common/xf86dbe.c:1.1 --- /dev/null Tue May 9 21:56:37 2006 +++ xc/programs/Xserver/hw/xfree86/common/xf86dbe.c Sun Feb 19 10:54:07 2006 @@ -0,0 +1,77 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86dbe.c,v 1.1 2006/02/19 15:54:07 tsi Exp $ */ + +/* + * Copyright (c) 2005-2006 by 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution, and in the same place and form as other copyright, + * license and disclaimer information. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: "This product + * includes software developed by The XFree86 Project, Inc + * (http://www.xfree86.org/) and its contributors", in the same + * place and form as other third-party acknowledgments. Alternately, + * this acknowledgment may appear in the software itself, in the + * same form and location as other such third-party acknowledgments. + * + * 4. Except as contained in this notice, the name of The XFree86 + * Project, Inc 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, Inc. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "dbeproc.h" + +#ifdef DbeValidateBuffer +#include "xf86Module.h" + +static DbeValidateBufferProcPtr DbeValidateBufferProc = + (DbeValidateBufferProcPtr)NoopDDA; + +/* + * A wrapper for DbeValidateBuffer(). See "dix.h". + */ + +void +xf86DbeValidateBuffer(WindowPtr pWin, XID drawID, Bool dstbuf) +{ + (*DbeValidateBufferProc)(pWin, drawID, dstbuf); +} + +void +xf86DbeRegisterValidateBuffer(void) +{ + DbeValidateBufferProc = + (DbeValidateBufferProcPtr)LoaderSymbol("DbeValidateBuffer"); + if (DbeValidateBufferProc == NULL) + DbeValidateBufferProc = (DbeValidateBufferProcPtr)NoopDDA; +} + +#endif Index: xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c:1.4 xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c:1.5 --- xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c:1.4 Fri Feb 13 18:58:39 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c Fri Oct 14 11:16:34 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c,v 1.4 2004/02/13 23:58:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c,v 1.5 2005/10/14 15:16:34 tsi Exp $ */ /* * Copyright (c) 2000-2001 by The XFree86 Project, Inc. @@ -54,7 +54,7 @@ #include #include #include -#include "X.h" +#include #include "os.h" #include "xf86.h" #include "xf86Priv.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86fbman.c:1.31 xc/programs/Xserver/hw/xfree86/common/xf86fbman.c:1.32 --- xc/programs/Xserver/hw/xfree86/common/xf86fbman.c:1.31 Tue Jan 25 20:31:47 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86fbman.c Fri Oct 14 11:16:34 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c,v 1.31 2005/01/26 01:31:47 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c,v 1.32 2005/10/14 15:16:34 tsi Exp $ */ /* * Copyright (c) 1998-2001 by The XFree86 Project, Inc. @@ -50,7 +50,7 @@ #include "misc.h" #include "xf86.h" -#include "X.h" +#include #include "scrnintstr.h" #include "regionstr.h" #include "xf86fbman.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c:3.7 xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c:3.8 --- xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c:3.7 Fri Feb 13 18:58:39 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c Fri Oct 14 11:16:34 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c,v 3.7 2004/02/13 23:58:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c,v 3.8 2005/10/14 15:16:34 tsi Exp $ */ /* * Copyright (c) 1997-2000 by The XFree86 Project, Inc. * All rights reserved. @@ -54,7 +54,7 @@ #include #include #include -#include "X.h" +#include #include "os.h" #include "xf86.h" #include "xf86Priv.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86noBus.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86noBus.c:1.4 xc/programs/Xserver/hw/xfree86/common/xf86noBus.c:1.5 --- xc/programs/Xserver/hw/xfree86/common/xf86noBus.c:1.4 Mon Jun 7 18:23:02 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86noBus.c Fri Oct 14 11:16:34 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86noBus.c,v 1.4 2004/06/07 22:23:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86noBus.c,v 1.5 2005/10/14 15:16:34 tsi Exp $ */ /* * Copyright (c) 2000-2002 by The XFree86 Project, Inc. @@ -54,7 +54,7 @@ #include #include #include -#include "X.h" +#include #include "os.h" #include "xf86.h" #include "xf86Priv.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c:3.83 xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c:3.88 --- xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c:3.83 Thu Jan 20 12:28:10 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c Fri Oct 14 11:16:34 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.83 2005/01/20 17:28:10 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.88 2005/10/14 15:16:34 tsi Exp $ */ /* * Copyright (c) 1997-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -54,7 +54,7 @@ #include #include #include -#include "X.h" +#include #include "os.h" #include "Pci.h" #include "xf86.h" @@ -107,7 +107,7 @@ (((b) == PCI_CLASS_PREHISTORIC && (s) == PCI_SUBCLASS_PREHISTORIC_VGA) || \ ((b) == PCI_CLASS_DISPLAY) || \ ((b) == PCI_CLASS_MULTIMEDIA && (s) == PCI_SUBCLASS_MULTIMEDIA_VIDEO)) - + /* * PCI classes for which potentially destructive checking of the map sizes * may be done. Any classes where this may be unsafe should be omitted @@ -115,8 +115,8 @@ */ #define PCINONSYSTEMCLASSES(b,s) PCIALWAYSPRINTCLASSES(b,s) -/* - * PCI classes that use RAC +/* + * PCI classes that use RAC */ #define PCISHAREDIOCLASSES(b,s) \ (((b) == PCI_CLASS_PREHISTORIC && (s) == PCI_SUBCLASS_PREHISTORIC_VGA) || \ @@ -135,11 +135,15 @@ #define I2B(tag,base) pciHostAddrToBusAddr(tag,PCI_IO,base) #define H2B(tag,base,type) (((type & ResPhysMask) == ResMem) ? \ M2B(tag, base) : I2B(tag, base)) + +#define B2ISB(tag, base) pciBusAddrToHostAddr(tag, PCI_IO_SPARSE_BASE, base) +#define B2ISM(tag, mask) pciBusAddrToHostAddr(tag, PCI_IO_SPARSE_MASK, mask) + #define TAG(pvp) (pciTag(pvp->bus,pvp->device,pvp->func)) #define SIZE(size) ((1 << size) - 1) #define PCI_SIZE(type,tag,size) (((type & ResPhysMask) == ResMem) \ - ? pciBusAddrToHostAddr(tag,PCI_MEM_SIZE,size) \ - : pciBusAddrToHostAddr(tag,PCI_IO_SIZE,size)) + ? pciBusAddrToHostAddr(tag,PCI_MEM_SIZE,size) \ + : pciBusAddrToHostAddr(tag,PCI_IO_SIZE,size)) #define PCI_M_RANGE(range,tag,begin,end,type) \ { \ RANGE(range, B2M(tag, begin), B2M(tag, end), \ @@ -152,20 +156,20 @@ } #define PCI_X_RANGE(range,tag,begin,end,type) \ { if ((type & ResPhysMask) == ResMem) PCI_M_RANGE(range,tag,begin,end,type); \ - else PCI_I_RANGE(range,tag,begin,end,type); } + else PCI_I_RANGE(range,tag,begin,end,type); } #define P_M_RANGE(range,tag,begin,size,type) \ - PCI_M_RANGE(range,tag,begin,(begin + SIZE(size)),type) + PCI_M_RANGE(range,tag,begin,(begin + SIZE(size)),type) #define P_I_RANGE(range,tag,begin,size,type) \ - PCI_I_RANGE(range,tag,begin,(begin + SIZE(size)),type) + PCI_I_RANGE(range,tag,begin,(begin + SIZE(size)),type) #define P_X_RANGE(range,tag,begin,size,type) \ { if ((type & ResPhysMask) == ResMem) P_M_RANGE(range,tag,begin,size,type); \ - else P_I_RANGE(range,tag,begin,size,type); } + else P_I_RANGE(range,tag,begin,size,type); } #define PV_M_RANGE(range,pvp,i,type) \ - P_M_RANGE(range,TAG(pvp),pvp->memBase[i],pvp->size[i],type) + P_M_RANGE(range,TAG(pvp),pvp->memBase[i],pvp->size[i],type) #define PV_B_RANGE(range,pvp,type) \ - P_M_RANGE(range,TAG(pvp),pvp->biosBase,pvp->biosSize,type) + P_M_RANGE(range,TAG(pvp),pvp->biosBase,pvp->biosSize,type) #define PV_I_RANGE(range,pvp,i,type) \ - P_I_RANGE(range,TAG(pvp),pvp->ioBase[i],pvp->size[i],type) + P_I_RANGE(range,TAG(pvp),pvp->ioBase[i],pvp->size[i],type) static void getPciClassFlags(pciConfigPtr *pcrpp); static void pciConvertListToHost(int bus, int dev, int func, resPtr list); @@ -206,13 +210,13 @@ pcrpp = xf86PciInfo = xf86scanpci(0); getPciClassFlags(pcrpp); - + if (pcrpp == NULL) { xf86PciVideoInfo = NULL; return; } xf86PciBus = xf86GetPciBridgeInfo(); - + while ((pcrp = pcrpp[i])) { int baseclass; int subclass; @@ -224,7 +228,7 @@ baseclass = pcrp->pci_base_class; subclass = pcrp->pci_sub_class; } - + if (PCIINFOCLASSES(baseclass, subclass)) { num++; xf86PciVideoInfo = xnfrealloc(xf86PciVideoInfo, @@ -282,7 +286,7 @@ } } #endif - + for (j = 0; j < 6; j++) { info->memBase[j] = 0; info->ioBase[j] = 0; @@ -311,7 +315,7 @@ if (info->size[5] && IsBaseUnassigned(pcrp->pci_base5)) pcrp->pci_base5 = pciCheckForBrokenBase(pcrp->tag, 5); } - + /* * 64-bit base addresses are checked for and avoided on 32-bit * platforms. @@ -360,7 +364,7 @@ for (i = 0; i < num; i++) { info = xf86PciVideoInfo[i]; pcrp = info->thisCard; - + if ((pcrp->pci_command & PCI_CMD_MEM_ENABLE) && (num == 1 || ((info->class == PCI_CLASS_DISPLAY) && @@ -378,7 +382,7 @@ } } } - + /* Print a summary of the video devices found */ for (k = 0; k < num; k++) { const char *vendorname = NULL, *chipname = NULL; @@ -386,7 +390,7 @@ char busnum[8]; Bool memdone = FALSE, iodone = FALSE; - i = 0; + i = 0; info = xf86PciVideoInfo[k]; xf86FormatPciBusNumber(info->bus, busnum); xf86FindPciNamesByDevice(info->vendor, info->chipType, @@ -463,19 +467,19 @@ resPtr pAcc; PCITAG tag; int j; - + if (! (pvp = xf86GetPciInfoForEntity(entityIndex))) return; if (pvp->validSize) return; tag = pciTag(pvp->bus,pvp->device,pvp->func); - + for (j = 0; j < 6; j++) { pAcc = Acc; - if (pvp->memBase[j]) + if (pvp->memBase[j]) while (pAcc) { if (((pAcc->res_type & (ResPhysMask | ResBlock)) == (ResMem | ResBlock)) - && (pAcc->block_begin == B2M(TAG(pvp),pvp->memBase[j])) + && (pAcc->block_begin == B2M(TAG(pvp),pvp->memBase[j])) && (pAcc->block_end == B2M(TAG(pvp),pvp->memBase[j] + SIZE(pvp->size[j])))) break; pAcc = pAcc->next; @@ -664,11 +668,11 @@ if (!ptr->primary && !ptr->current) return; - + if (ptr->current && ptr->current->disable_f) (*ptr->current->disable_f)(ptr->current); ptr->current = NULL; - + /* walk down */ while (ptr->primary) { /* No enable for root bus */ if (ptr != ptr->primary->current) { @@ -687,10 +691,10 @@ savePciState(PCITAG tag, pciSavePtr ptr) { int i; - + ptr->command = pciReadLong(tag, PCI_CMD_STAT_REG); - for (i=0; i < 6; i++) - ptr->base[i] = pciReadLong(tag, PCI_MAP_REG_START + (i * 4)); + for (i=0; i < 6; i++) + ptr->base[i] = pciReadLong(tag, PCI_MAP_REG_START + (i * 4)); ptr->biosBase = pciReadLong(tag, PCI_MAP_ROM_REG); } @@ -699,13 +703,13 @@ restorePciState(PCITAG tag, pciSavePtr ptr) { int i; - + /* disable card before setting anything */ pciSetBitsLong(tag, PCI_CMD_STAT_REG, PCI_CMD_MEM_ENABLE | PCI_CMD_IO_ENABLE , 0); pciWriteLong(tag, PCI_MAP_ROM_REG, ptr->biosBase); for (i=0; i<6; i++) - pciWriteLong(tag, PCI_MAP_REG_START + (i * 4), ptr->base[i]); + pciWriteLong(tag, PCI_MAP_REG_START + (i * 4), ptr->base[i]); pciWriteLong(tag, PCI_CMD_STAT_REG, ptr->command); } @@ -763,7 +767,7 @@ int bus = ptr->busdep.pci.bus; (*pciBusInfo[bus]->funcs->pciControlBridge)(bus, (CARD16)(-1), - ptr->busdep.pci.save.control); + ptr->busdep.pci.save.control); } @@ -792,9 +796,9 @@ new_bits ++; newsize >>= 1; } - + for (pcrpp = xf86PciInfo, pcrp = *pcrpp; pcrp; pcrp = *++(pcrpp)) { - + /* Only process devices with type 0 headers */ if ((pcrp->pci_header_type & 0x7f) != 0) continue; @@ -816,7 +820,7 @@ || (!basep[i+1] && (B2M(pcrp->tag,PCIGETMEMORY(basep[i])) == base)) -#endif +#endif ))) { pcrp->basesize[i] = new_bits; break; /* to next device */ @@ -832,8 +836,8 @@ for (i = 0; i < 6; i++) { if (pvp->size[i] == old_bits) { if ((((type & ResPhysMask) == ResIo) && pvp->ioBase[i] - && (B2I(TAG(pvp),pvp->ioBase[i]) == base)) || - (((type & ResPhysMask) == ResMem) && pvp->memBase[i] + && (B2I(TAG(pvp),pvp->ioBase[i]) == base)) || + (((type & ResPhysMask) == ResMem) && pvp->memBase[i] && (B2M(TAG(pvp),pvp->memBase[i]) == base))) { pvp->size[i] = new_bits; break; /* to next device */ @@ -854,12 +858,12 @@ if (!target) return; - + if (!ResCanOverlap(&target->val)) return; range = target->val; - + for (pbp=xf86PciBus; pbp; pbp = pbp->next) { if (pbp->primary == busIndex) { tmp = xf86DupResList(pbp->preferred_io); @@ -870,7 +874,7 @@ bridgeRes = xf86JoinResLists(tmp,bridgeRes); } } - + RemoveOverlaps(target, bridgeRes, TRUE, TRUE); if (range.rEnd > target->block_end) { correctPciSize(range.rBegin, range.rEnd - range.rBegin, @@ -883,7 +887,7 @@ } xf86FreeResList(bridgeRes); } - + /* ????? */ static void xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes) @@ -908,20 +912,20 @@ for (pvpp = xf86PciVideoInfo, pvp = *pvpp; pvp; pvp = *(++pvpp)) { resPtr *res; - if (PCINONSYSTEMCLASSES(pvp->class, pvp->subclass)) + if (PCINONSYSTEMCLASSES(pvp->class, pvp->subclass)) resMisc = ResBios; - else + else resMisc = 0; - + if (((pciConfigPtr)pvp->thisCard)->pci_command & (PCI_CMD_IO_ENABLE | PCI_CMD_MEM_ENABLE)) res = activeRes; else res = inactiveRes; - + if (!pvp->validSize) resMisc |= ResEstimated; - + for (i = 0; i < 6; i++) { if (pvp->ioBase[i] && (pvp->ioBase[i] < (memType)(-1 << pvp->size[i]))) { @@ -960,10 +964,10 @@ baseclass = pcrp->pci_base_class; subclass = pcrp->pci_sub_class; } - + if (PCIINFOCLASSES(baseclass, subclass)) continue; - + /* Only process devices with type 0 headers */ if ((pcrp->pci_header_type & 0x7f) != 0) continue; @@ -981,11 +985,11 @@ if ((baseclass == PCI_CLASS_BRIDGE) && (subclass == PCI_SUBCLASS_BRIDGE_HOST)) resMisc |= ResOverlap; - + basep = &pcrp->pci_base0; for (i = 0; i < 6; i++) { if (basep[i]) { - if (PCI_MAP_IS_IO(basep[i])) { + if (PCI_MAP_IS_IO(basep[i])) { if (pcrp->pci_command & PCI_CMD_IO_ENABLE) res = activeRes; else @@ -1023,7 +1027,7 @@ } } - /* Ignore disabled non-video ROMs */ + /* Ignore disabled non-video ROMs */ if ((pcrp->pci_command & PCI_CMD_MEM_ENABLE) && (pcrp->pci_baserom & PCI_MAP_ROM_DECODE_ENABLE)) { P_M_RANGE(range,pcrp->tag,PCIGETROM(pcrp->pci_baserom), @@ -1060,9 +1064,9 @@ range = pRes->val; RemoveOverlaps(pRes, *activeRes, TRUE, TRUE); - RemoveOverlaps(pRes, *inactiveRes, TRUE, + RemoveOverlaps(pRes, *inactiveRes, TRUE, (xf86Info.estimateSizesAggressively > 0)); - + if (range.rEnd > pRes->block_end) { correctPciSize(range.rBegin, range.rEnd - range.rBegin, pRes->block_end - pRes->block_begin, @@ -1091,7 +1095,7 @@ (xf86Info.estimateSizesAggressively > 1)); RemoveOverlaps(pRes, *inactiveRes, TRUE, (xf86Info.estimateSizesAggressively > 1)); - + if (range.rEnd > pRes->block_end) { correctPciSize(range.rBegin, range.rEnd - range.rBegin, pRes->block_end - pRes->block_begin, @@ -1103,7 +1107,7 @@ "Memory" : "I/O", range.rBegin, range.rEnd, pRes->block_end); } - + } } xf86MsgVerb(X_INFO, 3, @@ -1117,7 +1121,7 @@ { resPtr activeRes, inactiveRes; resPtr tmp; - + /* Get bus-specific system resources (PCI) */ xf86GetPciRes(&activeRes, &inactiveRes); @@ -1128,7 +1132,7 @@ * to host memory. */ - for (tmp = *osRes; tmp; tmp = tmp->next) + for (tmp = *osRes; tmp; tmp = tmp->next) RemoveOverlaps(tmp, activeRes, FALSE, TRUE); xf86MsgVerb(X_INFO, 3, "OS-reported resource ranges after removing" @@ -1136,11 +1140,11 @@ xf86PrintResList(3, *osRes); pciAvoidRes = xf86AddRangesToList(pciAvoidRes,PciAvoid,-1); - for (tmp = pciAvoidRes; tmp; tmp = tmp->next) + for (tmp = pciAvoidRes; tmp; tmp = tmp->next) RemoveOverlaps(tmp, activeRes, FALSE, TRUE); tmp = xf86DupResList(*osRes); pciAvoidRes = xf86JoinResLists(pciAvoidRes,tmp); - + return (xf86JoinResLists(activeRes,inactiveRes)); } @@ -1166,7 +1170,7 @@ PciBusPtr pbp = xf86PciBus; pciConfigPtr pcp; resPtr tmp; - + if (!pvp) return FALSE; tag = pciTag(pvp->bus,pvp->device,pvp->func); pcp = pvp->thisCard; @@ -1205,9 +1209,9 @@ } else return FALSE; if (! *p_base) return FALSE; - + type |= (range.type & ResDomain) | ResBlock; - + /* setup avoid: PciAvoid is bus range: convert later */ avoid = xf86DupResList(pciAvoidRes); @@ -1224,11 +1228,11 @@ ResRange); else if (pbp->pmem) w = xf86FindIntersectOfLists(pbp->pmem,ResRange); - - if (pbp->preferred_mem) + + if (pbp->preferred_mem) w_2nd = xf86FindIntersectOfLists(pbp->preferred_mem, ResRange); - else if (pbp->mem) + else if (pbp->mem) w_2nd = xf86FindIntersectOfLists(pbp->mem, ResRange); } else { @@ -1239,9 +1243,9 @@ w = xf86FindIntersectOfLists(pbp->mem,ResRange); } } else { - if (pbp->preferred_io) + if (pbp->preferred_io) w = xf86FindIntersectOfLists(pbp->preferred_io,ResRange); - if (pbp->io) + if (pbp->io) w = xf86FindIntersectOfLists(pbp->io,ResRange); } } else if (pbp->primary == pvp->bus) { @@ -1254,20 +1258,20 @@ tmp = xf86DupResList(pbp->preferred_io); avoid = xf86JoinResLists(avoid, tmp); } - } + } pbp = pbp->next; } - + /* convert bus based entries in avoid list to host base */ pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid); - + if (!w) w = xf86DupResList(ResRange); xf86MsgVerb(X_INFO, 3, "window:\n"); xf86PrintResList(3, w); xf86MsgVerb(X_INFO, 3, "resSize:\n"); xf86PrintResList(3, resSize); - + if (resSize) { w_tmp = w; w = xf86FindIntersectOfLists(w,resSize); @@ -1284,7 +1288,7 @@ if (!alignment) alignment = (1 << (*p_size)) - 1; - + /* Access list holds bios resources -- remove this one */ #ifdef NOTYET AccTmp = xf86DupResList(Acc); @@ -1344,7 +1348,7 @@ pAcc = &((*pAcc)->next); } #endif - + #ifdef DEBUG ErrorF("base: 0x%lx alignment: 0x%lx host alignment: 0x%lx size[bit]: 0x%x\n", (*p_base),alignment,PCI_SIZE(type,tag,alignment),(*p_size)); @@ -1403,7 +1407,7 @@ #ifdef DEBUG ErrorF("begin: 0x%lx, end: 0x%lx\n",range.a,range.b); #endif - + (*p_size) = 0; while (alignment >> (*p_size)) (*p_size)++; @@ -1427,7 +1431,7 @@ ((CARD32 *)(&(pcp->pci_base0)))[res_n + 1] = (CARD32)(*p_base >> 32); pciWriteLong(tag, PCI_MAP_REG_START + ((res_n + 1) * sizeof(CARD32)), - ((CARD32 *)(&(pcp->pci_base0)))[res_n + 1]); + ((CARD32 *)(&(pcp->pci_base0)))[res_n + 1]); #else ((CARD32 *)(&(pcp->pci_base0)))[res_n + 1] = 0; pciWriteLong(tag, PCI_MAP_REG_START + ((res_n + 1) * sizeof(CARD32)), @@ -1444,9 +1448,9 @@ /* @@@ fake BIOS allocated resource */ range.type |= ResBios; Acc = xf86AddResToList(Acc, &range,-1); - + return TRUE; - + } Bool @@ -1464,7 +1468,7 @@ resPtr pBad = NULL,pResTmp; unsigned int prt = 0; int i; - + if (!pvp) return pRes; while (pRes) { @@ -1474,7 +1478,7 @@ pRes->block_end == B2M(TAG(pvp),pvp->biosBase + SIZE(pvp->biosSize))) prt = 6; - else for (i = 0 ; i < 6; i++) + else for (i = 0 ; i < 6; i++) if ((pRes->block_begin == B2M(TAG(pvp),pvp->memBase[i])) && (pRes->block_end == B2M(TAG(pvp),pvp->memBase[i] + SIZE(pvp->size[i])))) { @@ -1483,7 +1487,7 @@ } break; case ResIo: - for (i = 0 ; i < 6; i++) + for (i = 0 ; i < 6; i++) if (pRes->block_begin == B2I(TAG(pvp),pvp->ioBase[i]) && pRes->block_end == B2I(TAG(pvp),pvp->ioBase[i] + SIZE(pvp->size[i]))) { @@ -1501,7 +1505,7 @@ pBad = pRes; } else xfree(pRes); - + pRes = pResTmp; } return pBad; @@ -1524,7 +1528,7 @@ CARD32 biosSize, alignment; if (!xf86PciVideoInfo) return 0; - + while ((pvp = xf86PciVideoInfo[n++])) { if (pciTag(pvp->bus,pvp->device,pvp->func) == tag) break; @@ -1606,7 +1610,7 @@ avoid = xf86JoinResLists(avoid, tmp); } pbp = pbp->next; - } + } pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid); if (mem) pciConvertListToHost(pvp->bus,pvp->device,pvp->func, mem); @@ -1617,7 +1621,7 @@ range = xf86GetBlock(RANGE_TYPE(ResExcMemBlock, xf86GetPciDomain(tag)), PCI_SIZE(ResMem, TAG(pvp), 1 << biosSize), m->block_begin, m->block_end, - PCI_SIZE(ResMem, TAG(pvp), alignment), + PCI_SIZE(ResMem, TAG(pvp), alignment), avoid); if (range.type != ResEnd) { ret = M2B(TAG(pvp), range.rBase); @@ -1626,9 +1630,9 @@ m = m->next; } } else { - if (!xf86IsSubsetOf(range, m) || - ChkConflict(&range, avoid, SETUP) - || (mem && ChkConflict(&range, mem, SETUP))) + if (!xf86IsSubsetOf(range, m) || + ChkConflict(&range, avoid, SETUP) + || (mem && ChkConflict(&range, mem, SETUP))) ret = 0; } @@ -1676,7 +1680,7 @@ static void alignBridgeRanges(PciBusPtr PciBusBase, PciBusPtr primary); static void -printBridgeInfo(PciBusPtr PciBus) +printBridgeInfo(PciBusPtr PciBus) { char primary[8], secondary[8], subordinate[8], brbus[8]; @@ -1749,10 +1753,10 @@ break; } - domain = pcrp->busnum & 0x0000FF00; + i = pcrp->busnum & (PCI_DOM_MASK << 8); primary = pcrp->busnum; - secondary = domain | pcrp->pci_secondary_bus_number; - subordinate = domain | pcrp->pci_subordinate_bus_number; + secondary = i | pcrp->pci_secondary_bus_number; + subordinate = i | pcrp->pci_subordinate_bus_number; /* Is this the correct bridge? If not, ignore it */ pBusInfo = pcrp->businfo; @@ -1783,6 +1787,7 @@ *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec)); pnPciBus = &PciBus->next; + PciBus->domain = domain; PciBus->primary = primary; PciBus->secondary = secondary; PciBus->subordinate = subordinate; @@ -1845,8 +1850,8 @@ * bottom megabyte. */ if (pcrp->pci_mem_base || pcrp->pci_mem_limit) { - base = pcrp->pci_mem_base & 0xfff0u; - limit = pcrp->pci_mem_limit & 0xfff0u; + base = pcrp->pci_mem_base & 0xfff0u; + limit = pcrp->pci_mem_limit & 0xfff0u; if (base <= limit) { PCI_M_RANGE(range, pcrp->tag, base << 16, (limit << 16) | 0x0fffff, @@ -1860,11 +1865,17 @@ pcrp->pci_prefetch_mem_limit || pcrp->pci_prefetch_upper_mem_base || pcrp->pci_prefetch_upper_mem_limit) { - base = pcrp->pci_prefetch_mem_base & 0xfff0u; - limit = pcrp->pci_prefetch_mem_limit & 0xfff0u; + base = pcrp->pci_prefetch_mem_base & 0xfff0u; + limit = pcrp->pci_prefetch_mem_limit & 0xfff0u; #if defined(LONG64) || defined(WORD64) base |= (memType)pcrp->pci_prefetch_upper_mem_base << 16; limit |= (memType)pcrp->pci_prefetch_upper_mem_limit << 16; +#else + if (pcrp->pci_prefetch_upper_mem_base) + break; + + if (pcrp->pci_prefetch_upper_mem_limit) + limit = 0xfff0u; #endif if (base <= limit) { PCI_M_RANGE(range, pcrp->tag, @@ -1888,10 +1899,10 @@ break; } - domain = pcrp->busnum & 0x0000FF00; + i = pcrp->busnum & (PCI_DOM_MASK << 8); primary = pcrp->busnum; - secondary = domain | pcrp->pci_cb_cardbus_bus_number; - subordinate = domain | pcrp->pci_subordinate_bus_number; + secondary = i | pcrp->pci_cb_cardbus_bus_number; + subordinate = i | pcrp->pci_subordinate_bus_number; /* Is this the correct bridge? If not, ignore it */ pBusInfo = pcrp->businfo; @@ -1913,7 +1924,7 @@ if (primary >= secondary) { if (pcrp->pci_cb_cardbus_bus_number != 0) - xf86MsgVerb(X_WARNING, 3, "Misconfigured CardBus" + xf86MsgVerb(X_WARNING, 3, "Misconfigured CardBus" " bridge %x:%x:%x (%x,%x)\n", pcrp->busnum, pcrp->devnum, pcrp->funcnum, primary, secondary); @@ -1923,6 +1934,7 @@ *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec)); pnPciBus = &PciBus->next; + PciBus->domain = domain; PciBus->primary = primary; PciBus->secondary = secondary; PciBus->subordinate = subordinate; @@ -1960,13 +1972,25 @@ if (pcrp->pci_bridge_control & PCI_PCI_BRIDGE_ISA_EN) { while ((base <= (CARD16)(-1)) && (base <= limit)) { - PCI_I_RANGE(range, pcrp->tag, - base, base + (CARD8)(-1), - ResIo | ResBlock | ResExclusive); - PciBus->preferred_io = - xf86AddResToList(PciBus->preferred_io, - &range, -1); - base += 0x0400; + if ((base + (CARD8)(-1)) <= limit) { + PCI_I_RANGE(range, pcrp->tag, + base, base + (CARD8)(-1), + ResIo | ResBlock | + ResExclusive); + PciBus->preferred_io = + xf86AddResToList(PciBus->preferred_io, + &range, -1); + base += 0x0400; + } else { + PCI_I_RANGE(range, pcrp->tag, + base, limit, + ResIo | ResBlock | + ResExclusive); + PciBus->preferred_io = + xf86AddResToList(PciBus->preferred_io, + &range, -1); + base = limit + 1; + } } } @@ -1990,13 +2014,25 @@ if (pcrp->pci_bridge_control & PCI_PCI_BRIDGE_ISA_EN) { while ((base <= (CARD16)(-1)) && (base <= limit)) { - PCI_I_RANGE(range, pcrp->tag, - base, base + (CARD8)(-1), - ResIo | ResBlock | ResExclusive); - PciBus->preferred_io = - xf86AddResToList(PciBus->preferred_io, - &range, -1); - base += 0x0400; + if ((base + (CARD8)(-1)) <= limit) { + PCI_I_RANGE(range, pcrp->tag, + base, base + (CARD8)(-1), + ResIo | ResBlock | + ResExclusive); + PciBus->preferred_io = + xf86AddResToList(PciBus->preferred_io, + &range, -1); + base += 0x0400; + } else { + PCI_I_RANGE(range, pcrp->tag, + base, limit, + ResIo | ResBlock | + ResExclusive); + PciBus->preferred_io = + xf86AddResToList(PciBus->preferred_io, + &range, -1); + base = limit + 1; + } } } @@ -2052,6 +2088,7 @@ case PCI_SUBCLASS_BRIDGE_MC: *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec)); pnPciBus = &PciBus->next; + PciBus->domain = domain; PciBus->primary = pcrp->busnum; PciBus->secondary = PciBus->subordinate = -1; PciBus->brbus = pcrp->busnum; @@ -2087,6 +2124,7 @@ *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec)); pnPciBus = &PciBus->next; + PciBus->domain = domain; PciBus->primary = -1; PciBus->secondary = -1; /* to be set below */ PciBus->subordinate = pciNumBuses - 1; @@ -2148,11 +2186,12 @@ * Find the 'smallest' free HOST-PCI bridge, where 'small' is in * the order of pciTag(). */ - PCITAG minTag = 0xFFFFFFFF, tag; + PCITAG minTag = (PCITAG)(-1L), tag; PciBusPtr PciBusFound = NULL; for (PciBus = PciBusBase; PciBus; PciBus = PciBus->next) if ((PciBus->subclass == PCI_SUBCLASS_BRIDGE_HOST) && (PciBus->secondary == -1) && + (PciBus->brbus == i) && ((tag = pciTag(PciBus->brbus,PciBus->brdev,PciBus->brfunc)) < minTag) ) { minTag = tag; @@ -2171,6 +2210,7 @@ } *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec)); pnPciBus = &PciBus->next; + PciBus->domain = domain; PciBus->primary = PciBus->secondary = i; PciBus->subclass = PCI_SUBCLASS_BRIDGE_HOST; PciBus->brcontrol = PCI_PCI_BRIDGE_VGA_EN; @@ -2297,7 +2337,7 @@ if ((pvp = xf86GetPciInfoForEntity(xf86Screens[i]->entityList[m]))) pvp->validate = TRUE; } - + /* * Collect all background PCI resources we need to validate against. * These are all resources which don't belong to PCINONSYSTEMCLASSES @@ -2310,7 +2350,7 @@ if (PCINONSYSTEMCLASSES(pvp->class, pvp->subclass)) continue; /* has it an Entity assigned to it? */ - for (i=0; ibusType != BUS_PCI) continue; @@ -2321,7 +2361,7 @@ } if (i != xf86NumEntities) /* found an Entity for this one */ continue; - + for (i = 0; i<6; i++) { if (pvp->ioBase[i]) { PV_I_RANGE(range,pvp,i,ResExcIoBlock); @@ -2337,7 +2377,7 @@ /* These were handled above */ if (PCIINFOCLASSES(pcrp->pci_base_class, pcrp->pci_sub_class)) continue; - + if ((pcrp->pci_header_type & 0x7f) || !(pcrp->pci_command & (PCI_CMD_IO_ENABLE | PCI_CMD_MEM_ENABLE))) continue; @@ -2364,11 +2404,11 @@ pcrp->basesize[i-1], ResExcMemBlock) #else if (basep[i]) - continue; + continue; P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i-1]), pcrp->basesize[i-1], ResExcMemBlock) #endif - } + } Sys = xf86AddResToList(Sys, &range, -1); } } @@ -2507,7 +2547,7 @@ && ! ChkConflict(&range,own,SETUP) && ! ChkConflict(&range,avoid,SETUP) && ! ChkConflict(&range,NonSys,SETUP)) { - xf86FreeResList(own); + xf86FreeResList(own); continue; } } @@ -2548,7 +2588,7 @@ } xf86FreeResList(Sys); } - + resList GetImplicitPciResources(int entityIndex) { @@ -2556,13 +2596,13 @@ int i; resList list = NULL; int num = 0; - + if (! (pvp = xf86GetPciInfoForEntity(entityIndex))) return NULL; for (i = 0; i < 6; i++) { if (pvp->ioBase[i]) { list = xnfrealloc(list,sizeof(resRange) * (++num)); - PV_I_RANGE(list[num - 1],pvp,i,ResShrIoBlock | ResBios); + PV_I_RANGE(list[num - 1],pvp,i,ResShrIoBlock | ResBios); } else if (pvp->memBase[i]) { list = xnfrealloc(list,sizeof(resRange) * (++num)); PV_M_RANGE(list[num - 1],pvp,i,ResShrMemBlock | ResBios); @@ -2576,7 +2616,7 @@ #endif list = xnfrealloc(list,sizeof(resRange) * (++num)); list[num - 1].type = ResEnd; - + return list; } @@ -2585,40 +2625,40 @@ { int i = 0; int j = 0; - pciVideoPtr pvp; + pciVideoPtr pvp; pciAccPtr pcaccp; if (xf86PciAccInfo != NULL) return; - + if (xf86PciVideoInfo == NULL) return; while ((pvp = xf86PciVideoInfo[i]) != NULL) { - i++; - j++; - xf86PciAccInfo = xnfrealloc(xf86PciAccInfo, - sizeof(pciAccPtr) * (j + 1)); - xf86PciAccInfo[j] = NULL; - pcaccp = xf86PciAccInfo[j - 1] = xnfalloc(sizeof(pciAccRec)); - pcaccp->busnum = pvp->bus; - pcaccp->devnum = pvp->device; - pcaccp->funcnum = pvp->func; - pcaccp->arg.tag = pciTag(pvp->bus, pvp->device, pvp->func); - pcaccp->ioAccess.AccessDisable = pciIoAccessDisable; - pcaccp->ioAccess.AccessEnable = pciIoAccessEnable; - pcaccp->ioAccess.arg = &pcaccp->arg; + i++; + j++; + xf86PciAccInfo = xnfrealloc(xf86PciAccInfo, + sizeof(pciAccPtr) * (j + 1)); + xf86PciAccInfo[j] = NULL; + pcaccp = xf86PciAccInfo[j - 1] = xnfalloc(sizeof(pciAccRec)); + pcaccp->busnum = pvp->bus; + pcaccp->devnum = pvp->device; + pcaccp->funcnum = pvp->func; + pcaccp->arg.tag = pciTag(pvp->bus, pvp->device, pvp->func); + pcaccp->ioAccess.AccessDisable = pciIoAccessDisable; + pcaccp->ioAccess.AccessEnable = pciIoAccessEnable; + pcaccp->ioAccess.arg = &pcaccp->arg; pcaccp->io_memAccess.AccessDisable = pciIo_MemAccessDisable; pcaccp->io_memAccess.AccessEnable = pciIo_MemAccessEnable; pcaccp->io_memAccess.arg = &pcaccp->arg; pcaccp->memAccess.AccessDisable = pciMemAccessDisable; pcaccp->memAccess.AccessEnable = pciMemAccessEnable; pcaccp->memAccess.arg = &pcaccp->arg; - if (PCISHAREDIOCLASSES(pvp->class, pvp->subclass)) - pcaccp->ctrl = TRUE; - else - pcaccp->ctrl = FALSE; - savePciState(pcaccp->arg.tag, &pcaccp->save); + if (PCISHAREDIOCLASSES(pvp->class, pvp->subclass)) + pcaccp->ctrl = TRUE; + else + pcaccp->ctrl = FALSE; + savePciState(pcaccp->arg.tag, &pcaccp->save); pcaccp->arg.ctrl = pcaccp->save.command; } } @@ -2642,7 +2682,7 @@ * 2. Climb down the ladder and enable any bridge on buses * on the path from the CPU to this bus. */ - + void initPciBusState(void) { @@ -2718,19 +2758,19 @@ } } -void +void PciStateEnter(void) { pciAccPtr paccp; int i = 0; - - if (xf86PciAccInfo == NULL) + + if (xf86PciAccInfo == NULL) return; while ((paccp = xf86PciAccInfo[i]) != NULL) { i++; - if (!paccp->ctrl) - continue; + if (!paccp->ctrl) + continue; savePciState(paccp->arg.tag, &paccp->save); restorePciState(paccp->arg.tag, &paccp->restore); paccp->arg.ctrl = paccp->restore.command; @@ -2749,13 +2789,13 @@ } } -void +void PciStateLeave(void) { pciAccPtr paccp; int i = 0; - if (xf86PciAccInfo == NULL) + if (xf86PciAccInfo == NULL) return; while ((paccp = xf86PciAccInfo[i]) != NULL) { @@ -2779,7 +2819,7 @@ } } -void +void DisablePciAccess(void) { int i = 0; @@ -2818,7 +2858,7 @@ { int i = 0; pciConfigPtr pcp; - + while ((pcp = xf86PciInfo[i]) != NULL) { if ((pcp->busnum == bus) && (pcp->devnum == dev) @@ -2841,9 +2881,9 @@ EntityPtr p = NULL; pciAccPtr *ppaccp = xf86PciAccInfo; BusAccPtr pbap = xf86BusAccInfo; - + int num; - + if (xf86CheckPciSlot(bus, device, func)) { if ((num = FindDiscardedPciSlot(bus, device, func)) < 0) num = xf86AllocateEntity(); @@ -2857,7 +2897,7 @@ p->active = active; p->inUse = FALSE; if (dev) - xf86AddDevToEntity(num, dev); + xf86AddDevToEntity(num, dev); /* Here we initialize the access structure */ p->access = xnfcalloc(1,sizeof(EntityAccessRec)); while (ppaccp && *ppaccp) { @@ -2866,7 +2906,7 @@ && (*ppaccp)->funcnum == func) { p->access->fallback = &(*ppaccp)->io_memAccess; p->access->pAccess = &(*ppaccp)->io_memAccess; - (*ppaccp)->ctrl = TRUE; /* mark control if not already */ + (*ppaccp)->ctrl = TRUE; /* mark control if not already */ break; } ppaccp++; @@ -2875,7 +2915,7 @@ p->access->fallback = &AccessNULL; p->access->pAccess = &AccessNULL; } - + p->busAcc = NULL; while (pbap) { if (pbap->type == BUS_PCI && pbap->busdep.pci.bus == bus) @@ -2893,10 +2933,10 @@ p->domainIO = xf86MapDomainIO(-1, VIDMEM_MMIO, pciTag(bus, device, func), 0, 1); } - - return num; + + return num; } else - return -1; + return -1; } /* @@ -3032,10 +3072,336 @@ } /* + * This function is called to determine whether or not a hard-failed master + * abort can occur when testing if an adapter can actually be disabled through + * PCI. The function returns whether the adapter can be probed at all, and (in + * *pActivate) whether enabling the adapter through PCI is a likely requisite + * to prevent such hard-fails. The function assumes that all resources the + * adapter registers are actually routed to it through the bus tree. + */ +Bool +xf86CheckPciVideo(pciVideoPtr pvp, Bool *pActivate) +{ + PciBusPtr pBus; + + /* Start by assuming the adapter doesn't need to be enabled */ + if (pActivate) + *pActivate = FALSE; + + /* + * If no PCI bus segments are present, assume all master aborts complete + * normally. Note that no bus segments will be known when PCI scans are + * disabled entirely, but that option should only be used when the presence + * of PCI in a system is incorrectly detected. + */ + if (!xf86PciBus) + return TRUE; + + if (!pvp) /* This one is actually a programming error */ + return FALSE; + + /* Find the adapter's bus segment structure */ + for (pBus = xf86PciBus; ; pBus = pBus->next) { + if (!pBus) + return FALSE; + + if (pBus->secondary == pvp->bus) + break; + } + + /* After this point, we will always return TRUE */ + if (!pActivate) + return TRUE; + + /* Given we disable hard-fails on non-root bus segments... */ + if ((pBus->primary != -1) && (pBus->primary != pvp->bus)) + return TRUE; + + /* + * Look for a subtractive decoder on the same segment as the adapter, on + * the assumption that such bridges never generate master aborts on the + * root segment. + */ + for (pBus = xf86PciBus; pBus; pBus = pBus->next) { + if (pBus->primary != pvp->bus) + continue; + + switch (pBus->subclass) { +#if 0 /* ??? */ + case PCI_SUBCLASS_BRIDGE_PCI: + if (pBus->interface != PCI_IF_BRIDGE_PCI_SUBTRACTIVE) + continue; + /* XXX Should check if bridge routes adapter's resources */ + /* Fall through */ +#endif + case PCI_SUBCLASS_BRIDGE_ISA: + case PCI_SUBCLASS_BRIDGE_EISA: + case PCI_SUBCLASS_BRIDGE_MC: + return TRUE; + + default: + continue; + } + } + + /* + * At this point the adapter's compliance with PCI enablement/disablement + * cannot be safely determined. + */ + *pActivate = TRUE; + + return TRUE; +} + +/* + * A recursive helper for xf86CheckPciSparseIO() below. This scans the PCI bus + * sub-tree rooted at pBus1 for its sub-sub-tree to which a sparse resource + * range is routed. The function returns FALSE if more than one such + * subordinate tree is found, or TRUE otherwise. This sets *ppUnRouted to NULL + * if exactly one subordinate is found. + */ +static Bool +xf86CheckPciSubTreeIO(PciBusPtr pBus1, + IOADDRESS Base, IOADDRESS Last, IOADDRESS End, + memType mask, Bool **ppUnrouted) +{ + PciBusPtr pBus2; + resPtr pRes; + IOADDRESS bot, top; + PCITAG tag; + resRange range; + + /* + * Loop through all of of pBus1's secondary bus segments. Note that these + * include those behind a subtractive-decoding P2P bridge. + */ + for (pBus2 = xf86PciBus; pBus2; pBus2 = pBus2->next) { + if ((pBus1 == pBus2) || (pBus2->secondary == -1) || + (pBus1->secondary != pBus2->primary)) + continue; + + tag = pciTag(pBus2->secondary, 0, 0); + + /* Loop through all I/O resources routed to pBus2 */ + for (pRes = pBus2->preferred_io; pRes; pRes = pRes->next) { + /* + * Look for overlaps in the device (or bus) view, rather than in + * the host view, because the former is not as subject to OS + * mangling. Assume that, for all "R" ... + * + * (B2I(tag, I2B(tag, R)) == R) && + * (I2B(tag, B2I(tag, R)) == R) + * + * ... holds true. + */ + bot = I2B(tag, pRes->block_begin); + top = I2B(tag, pRes->block_end); + + if ((bot > End) || (top < Base)) + continue; /* No potential overlap */ + + if ((bot > Base) || (top < End)) { + /* A potential partial overlap */ + if (Base > bot) + bot = Base; + + if (End < top) + top = End; + + if ((bot & ~mask) == (top & ~mask)) { + if (((bot & mask) > Last) || + ((top & mask) < Base)) + continue; /* No overlap */ + } + + /* + * A partial overlap, but the bridge might route enough + * overlapping ranges to entirely cover the requested + * resources. Use xf86IsSubsetOf() to determine this. + */ + bot = Base; + while (bot <= Last) { + top = ((bot - 1) ^ bot) >> 1; + while ((bot + top) > Last) + top >>= 1; + + RANGE(range, B2ISB(tag, bot), B2ISM(tag, mask & ~top), + RANGE_TYPE(ResIo | ResSparse | ResExclusive, + pBus2->domain)); + + if (!xf86IsSubsetOf(range, pBus2->preferred_io)) + return FALSE; + + bot += top + 1; + } + } + + /* + * pBus2 completely routes the requested resources. Check its + * sub-trees. + */ + if (!xf86CheckPciSubTreeIO(pBus2, Base, Last, End, mask, + ppUnrouted)) + return FALSE; + + *ppUnrouted = NULL; + return TRUE; + } + } + + /* No bridge on pBus1 routes the resources */ + return TRUE; +} + +/* + * This function determines which secondary bridges, if any, would decode an + * access to a range of sparse I/O addresses in a particular domain. The + * function returns FALSE if there is more than one such bridge in the system + * (or some other error), and returns TRUE otherwise. In the latter case, this + * function also returns (in *pUnRouted) whether or not any such bridge exists. + * This function is intended to be used by a driver before probing sparse I/O + * addresses while all PCI display functions are disabled, to determine if such + * a probe might cause a hard-failed master abort and crash the system. + * + * This function intentionally ignores VGA routing overrides, and, therefore, + * should only be called while VGA routing is disabled throughout the system. + * + * The mask specified here, like all sparse masks throughout the server, must + * be 1-extended to be portable to all host architectures. But, at odds with + * the rest of the server, the mask passed here applies to each _individual_ + * port in [Base, Base + count[, not to the range as a whole. In particular, + * should it ever be needed to run this function for a non-sparse range, simply + * call it with an all-ones mask. + */ +Bool +xf86CheckPciSparseIO(int domain, IOADDRESS Base, int count, memType mask, + Bool *pUnRouted) +{ + IOADDRESS Last, End; + PciBusPtr pBusRoot, pBus; + int nRoot; + + /* + * Begin with the assumption that the requested resources are routed away + * from the root bus segment. + */ + if (pUnRouted) + *pUnRouted = FALSE; + + /* + * If there are no PCI bus segments, assume all master aborts complete + * normally. PCI scans should only be disabled when the presence of PCI + * is incorrectly detected. + */ + if (!xf86PciBus) + return TRUE; + + /* Sanity check */ + if (count < 1) + return FALSE; + + /* + * Find a root bus segment in the domain. If none is found, the domain + * isn't populated. If more than one are present (a case dealt with below), + * then we don't understand enough about the domain chipset to determine + * how I/O routing is partitionned amongst these pseudo-root bus segments, + * but we still look for a secondary that completely routes the requested + * resources. + */ + for (pBusRoot = xf86PciBus; ; pBusRoot = pBusRoot->next) { + if (!pBusRoot) + return FALSE; + + if ((domain == pBusRoot->domain) && (pBusRoot->primary != -1) && + (pBusRoot->primary == pBusRoot->secondary)) + break; + } + + /* Requested resources must be contiguous (within mask) */ + Last = Base; + while (TRUE) { + if ((Last & mask) != Last) + return FALSE; + + if (!--count) + break; + + Last++; + } + + End = Last | ~mask; /* Maximum I/O port of interest */ + nRoot = 0; /* Number of "root" bus segments in domain */ + + /* Loop through (and count) all root bus segments in the domain */ + for (pBus = pBusRoot; pBus; pBus = pBus->next) { + if ((domain != pBus->domain) || (pBus->primary == -1) || + (pBus->primary != pBus->secondary)) + continue; + + nRoot++; + + if (!xf86CheckPciSubTreeIO(pBus, Base, Last, End, mask, &pUnRouted)) + return FALSE; + } + + /* + * If the resources are routed to any secondary bus segment, or if the + * caller doesn't care about the potential for hard-failed master aborts, + * return now. + */ + if (!pUnRouted) + return TRUE; + + /* + * If we know of only one root bus segment in the domain, look for a + * pre-PCI subtractive decoder on it. Otherwise, err on the side of + * caution because we don't know enough about the domain chipset to + * determine which pseudo-root bus segment would claim an access to the + * requested resources. + */ + if (nRoot == 1) { + for (pBus = xf86PciBus; pBus; pBus = pBus->next) { + if ((pBus->primary == pBusRoot->secondary) && + (pBus->secondary == -1)) + return TRUE; + } + } + + /* + * Notify caller that probing the requested resources might generate + * hard-failed master aborts. + */ + *pUnRouted = TRUE; + + return TRUE; +} + +/* + * This function determines whether a domain provides actual memory (ROM or + * RAM) in the traditional x86 BIOS range (0x0C0000 to 0x0FFFF). It currently + * does so by looking for a pre-PCI bridge in the domain. + */ +Bool +xf86DomainHasBIOSSegments(int domain) +{ + PciBusPtr pBus; + + if (!xf86PciBus) + return TRUE; + + for (pBus = xf86PciBus; pBus; pBus = pBus->next) { + if ((domain == pBus->domain) && (pBus->primary != -1) && + (pBus->secondary == -1)) + return TRUE; + } + + return FALSE; +} + +/* * Parse a BUS ID string, and return the PCI bus parameters if it was * in the correct format for a PCI bus id. */ - Bool xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func) { @@ -3126,7 +3492,7 @@ * xf86IsPrimaryPci() -- return TRUE if primary device * is PCI and bus, dev and func numbers match. */ - + Bool xf86IsPrimaryPci(pciVideoPtr pPci) { @@ -3144,8 +3510,8 @@ { int i = 0; pciConfigPtr pcp; - - while ((pcp = xf86PciInfo[i]) != NULL) { + + while ((pcp = xf86PciInfo[i]) != NULL) { if (pPci->bus == pcp->busnum && pPci->device == pcp->devnum && pPci->func == pcp->funcnum) { if (pcp->pci_base_class == PCI_CLASS_PREHISTORIC && @@ -3154,7 +3520,7 @@ if (pcp->pci_base_class == PCI_CLASS_DISPLAY && pcp->pci_sub_class == PCI_SUBCLASS_DISPLAY_VGA) { if (pcp->pci_prog_if == 0) - return PCI_CHIP_VGA ; + return PCI_CHIP_VGA ; if (pcp->pci_prog_if == 1) return PCI_CHIP_8514; } @@ -3172,15 +3538,20 @@ xf86GetPciInfoForEntity(int entityIndex) { pciVideoPtr *ppPci; - EntityPtr p = xf86Entities[entityIndex]; - - if (entityIndex >= xf86NumEntities - || p->busType != BUS_PCI) return NULL; - + EntityPtr p; + + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities) || + (xf86PciVideoInfo == NULL)) + return NULL; + + p = xf86Entities[entityIndex]; + if (p->busType != BUS_PCI) + return NULL; + for (ppPci = xf86PciVideoInfo; *ppPci != NULL; ppPci++) { if (p->pciBusId.bus == (*ppPci)->bus && p->pciBusId.device == (*ppPci)->device && - p->pciBusId.func == (*ppPci)->func) + p->pciBusId.func == (*ppPci)->func) return (*ppPci); } return NULL; @@ -3190,14 +3561,14 @@ xf86GetPciEntity(int bus, int dev, int func) { int i; - + for (i = 0; i < xf86NumEntities; i++) { EntityPtr p = xf86Entities[i]; if (p->busType != BUS_PCI) continue; - + if (p->pciBusId.bus == bus && p->pciBusId.device == dev && - p->pciBusId.func == func) + p->pciBusId.func == func) return i; } return -1; @@ -3237,7 +3608,7 @@ p->pciBusId.device == device && p->pciBusId.func == func) return FALSE; } - + return TRUE; } @@ -3249,7 +3620,7 @@ for (i = 0; i < xf86NumEntities; i++) { p = xf86Entities[i]; - if (!p->driver && + if (!p->driver && p->busType == BUS_PCI && p->pciBusId.bus == bus && p->pciBusId.device == device && p->pciBusId.func == func) { return i; @@ -3317,7 +3688,7 @@ { pciVideoPtr pvp, *ppvp; n++; - + for (ppvp = xf86PciVideoInfo, pvp =*ppvp; pvp ; pvp = *(++ppvp)) { if (pvp == pvp_exclude) continue; if ((pvp->interface == intf) && (pvp->subclass == subClass) @@ -3350,13 +3721,13 @@ Bool multifunc = FALSE; char str[256]; char *str1; - + str1 = str; - if (!pTag) + if (!pTag) return 0; *pTag = NULL; - + for (i=0; i < 8; i++) { j = 0; @@ -3370,23 +3741,23 @@ if (!pcrp) return 0; - /* + /* * we check all functions here: since multifunc devices need * to implement func 0 we catch all devices on the bus when * i = 0 */ - if (pcrp->pci_header_type &0x80) + if (pcrp->pci_header_type &0x80) multifunc = TRUE; - + j = 0; - + while (ppcrp[j]) { if (ppcrp[j]->busnum == bus && ppcrp[j]->funcnum == i && ppcrp[j]->devnum != pcrp->devnum) { - /* don't test subsys ID here. It might be set by POST + /* don't test subsys ID here. It might be set by POST - however some cards might not have been POSTed */ - if (ppcrp[j]->pci_device_vendor != pcrp->pci_device_vendor - || ppcrp[j]->pci_header_type != pcrp->pci_header_type ) + if (ppcrp[j]->pci_device_vendor != pcrp->pci_device_vendor + || ppcrp[j]->pci_header_type != pcrp->pci_header_type ) return 0; else multicard = TRUE; @@ -3397,7 +3768,7 @@ break; } - if (!multicard) + if (!multicard) return 0; j = 0; @@ -3475,7 +3846,7 @@ if (!xf86PciAccInfo) return; - + for (i = 0; xf86PciAccInfo[i] != NULL; i++) { if (xf86PciAccInfo[i]->arg.tag == tag) xf86PciAccInfo[i]->arg.ctrl = ctrl; Index: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h diff -u xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h:3.11 xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h:3.12 --- xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h:3.11 Fri Feb 13 18:58:39 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h Thu Jun 2 23:18:31 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h,v 3.11 2004/02/13 23:58:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h,v 3.12 2005/06/03 03:18:31 tsi Exp $ */ /* * Copyright (c) 1999-2003 by The XFree86 Project, Inc. @@ -81,17 +81,24 @@ } pciBridgesSave, *pciBridgesSavePtr; typedef struct pciBusRec { + int domain; /* bridge & bus domain number */ int brbus, brdev, brfunc; /* ID of the bridge to this bus */ + /* + * If primary == -1, then redundant host bridge, else + * if secondary == -1, then pre-PCI bus, else + * if primary == secondary, then PCI root bus segment, else + * PCI non-root bus segment. + */ int primary, secondary, subordinate; int subclass; /* bridge type */ int interface; + int brcontrol; /* bridge_control word */ resPtr preferred_io; /* I/O range */ resPtr preferred_mem; /* non-prefetchable memory range */ resPtr preferred_pmem; /* prefetchable memory range */ resPtr io; /* for subtractive PCI-PCI bridges */ resPtr mem; resPtr pmem; - int brcontrol; /* bridge_control byte */ struct pciBusRec *next; } PciBusRec, *PciBusPtr; Index: xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c:3.8 xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c:3.10 --- xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c:3.8 Tue May 4 12:21:42 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c Fri Oct 14 11:16:34 2005 @@ -20,12 +20,12 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c,v 3.8 2004/05/04 16:21:42 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c,v 3.10 2005/10/14 15:16:34 tsi Exp $ */ #include #include #include -#include "X.h" +#include #include "os.h" #include "xf86.h" #include "xf86Priv.h" @@ -656,9 +656,14 @@ xf86GetSbusInfoForEntity(int entityIndex) { sbusDevicePtr *psdpp; - EntityPtr p = xf86Entities[entityIndex]; + EntityPtr p; + + if ((entityIndex < 0) || (entityIndex >= xf86NumEntities) || + (xf86SbusInfo == NULL)) + return NULL; - if ((entityIndex >= xf86NumEntities) || (p->busType != BUS_SBUS)) + p = xf86Entities[entityIndex]; + if (p->busType != BUS_SBUS) return NULL; for (psdpp = xf86SbusInfo; *psdpp; psdpp++) { Index: xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.h diff -u xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.h:3.6 xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.h:3.8 --- xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.h:3.6 Tue Dec 7 16:53:46 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.h Fri Feb 17 22:31:38 2006 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.h,v 3.6 2004/12/07 21:53:46 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.h,v 3.8 2006/02/18 03:31:38 dawes Exp $ */ #ifndef _XF86_SBUSBUS_H #define _XF86_SBUSBUS_H @@ -74,12 +74,21 @@ void xf86SbusProbe(void); extern sbusDevicePtr *xf86SbusInfo; +Bool xf86ParseSbusBusString(const char *busID, int *fbNum); +Bool xf86CompareSbusBusString(const char *busID, int fbNum); +Bool xf86CheckSbusSlot(int fbNum); +int xf86ClaimSbusSlot(sbusDevicePtr psdp, DriverPtr drvp, GDevPtr dev, + Bool active); int xf86MatchSbusInstances(const char *driverName, int sbusDevId, GDevPtr *devList, int numDevs, DriverPtr drvp, int **foundEntities); sbusDevicePtr xf86GetSbusInfoForEntity(int entityIndex); int xf86GetEntityForSbusInfo(sbusDevicePtr psdp); void xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp); +Bool xf86LocateSbusMemoryArea(sbusDevicePtr psdp, + char **devName, unsigned int *devOffset, + unsigned int *fbSize, unsigned int *fbOffset, + unsigned int *flags); pointer xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size); void xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size); Index: xc/programs/Xserver/hw/xfree86/common/xf86str.h diff -u xc/programs/Xserver/hw/xfree86/common/xf86str.h:1.106 xc/programs/Xserver/hw/xfree86/common/xf86str.h:1.109 --- xc/programs/Xserver/hw/xfree86/common/xf86str.h:1.106 Fri Feb 25 20:07:12 2005 +++ xc/programs/Xserver/hw/xfree86/common/xf86str.h Thu Mar 16 11:49:56 2006 @@ -1,7 +1,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.106 2005/02/26 01:07:12 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.109 2006/03/16 16:49:56 dawes Exp $ */ /* - * Copyright (c) 1997-2005 by The XFree86 Project, Inc. + * Copyright (c) 1997-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -207,15 +207,16 @@ MODE_ERROR = -1 /* error condition */ } ModeStatus; -# define M_T_BUILTIN 0x01 /* built-in mode */ -# define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */ -# define M_T_CRTC_C (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC */ +# define M_T_BUILTIN 0x001 /* built-in mode */ +# define M_T_CLOCK_C (0x002 | M_T_BUILTIN) /* built-in mode - configure clock */ +# define M_T_CRTC_C (0x004 | M_T_BUILTIN) /* built-in mode - configure CRTC */ # define M_T_CLOCK_CRTC_C (M_T_CLOCK_C | M_T_CRTC_C) /* built-in mode - configure CRTC and clock */ -# define M_T_DEFAULT 0x10 /* (VESA) default modes */ -# define M_T_USERDEF 0x20 /* One of the modes from the config file */ -# define M_T_EDID 0x40 /* Mode from EDID detailed timings data. */ -# define M_T_PREFER 0x80 /* Preferred mode from EDID data. */ +# define M_T_DEFAULT 0x010 /* (VESA) default modes */ +# define M_T_USERDEF 0x020 /* One of the modes from the config file */ +# define M_T_EDID 0x040 /* Mode from EDID detailed timings data. */ +# define M_T_PREFER 0x080 /* Preferred mode from EDID data. */ +# define M_T_LOWPREF 0x100 /* A low preference mode. */ /* Video mode */ typedef struct _DisplayModeRec { @@ -345,7 +346,7 @@ void (*Identify)(int flags); Bool (*Probe)(struct _DriverRec *drv, int flags); const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype); - pointer module; + ModuleDescPtr module; int refCount; } DriverRec, *DriverPtr; @@ -358,7 +359,7 @@ typedef struct _ModuleInfoRec { int moduleVersion; char * moduleName; - pointer module; + ModuleDescPtr module; int refCount; const OptionInfoRec * (*AvailableOptions)(void *unused); pointer unused[8]; /* leave some space for more fields */ @@ -1033,7 +1034,7 @@ DevUnion * privates; /* Other privates can hook in * here */ DriverPtr drv; /* xf86DriverList[] entry */ - pointer module; /* Pointer to module head */ + ModuleDescPtr module; /* Pointer to module head */ int colorKey; int overlayFlags; @@ -1208,13 +1209,6 @@ #define OVERLAY_8_16_DUALFB 0x00000004 #define OVERLAY_8_32_PLANAR 0x00000008 -#if 0 -#define LD_RESOLV_IFDONE 0 /* only check if no more - delays pending */ -#define LD_RESOLV_NOW 1 /* finish one delay step */ -#define LD_RESOLV_FORCE 2 /* force checking... */ -#endif - /* Values of xf86Info.mouseFlags */ #define MF_CLEAR_DTR 1 #define MF_CLEAR_RTS 2 Index: xc/programs/Xserver/hw/xfree86/common/xf86xv.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86xv.c:1.38 xc/programs/Xserver/hw/xfree86/common/xf86xv.c:1.39 --- xc/programs/Xserver/hw/xfree86/common/xf86xv.c:1.38 Thu Feb 19 17:38:12 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86xv.c Fri Oct 14 11:16:34 2005 @@ -28,14 +28,14 @@ * authorization from the copyright holder(s) and author(s). */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.c,v 1.38 2004/02/19 22:38:12 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.c,v 1.39 2005/10/14 15:16:34 tsi Exp $ */ #include "misc.h" #include "xf86.h" #include "xf86_OSproc.h" -#include "X.h" -#include "Xproto.h" +#include +#include #include "scrnintstr.h" #include "regionstr.h" #include "windowstr.h" @@ -46,8 +46,8 @@ #include "gcstruct.h" #include "dixstruct.h" -#include "Xv.h" -#include "Xvproto.h" +#include +#include #include "xvdix.h" #ifdef XFree86LOADER #include "xvmodproc.h" Index: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c diff -u xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c:1.7 xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c:1.8 --- xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c:1.7 Fri Feb 13 18:58:40 2004 +++ xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c Fri Oct 14 11:16:34 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c,v 1.7 2004/02/13 23:58:40 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c,v 1.8 2005/10/14 15:16:34 tsi Exp $ */ /* * Copyright (c) 2001-2003 by The XFree86 Project, Inc. @@ -51,8 +51,8 @@ #include "xf86.h" #include "xf86_OSproc.h" -#include "X.h" -#include "Xproto.h" +#include +#include #include "scrnintstr.h" #include "resource.h" #include "dixstruct.h" Index: xc/programs/Xserver/hw/xfree86/ddc/Imakefile diff -u xc/programs/Xserver/hw/xfree86/ddc/Imakefile:1.8 xc/programs/Xserver/hw/xfree86/ddc/Imakefile:1.9 --- xc/programs/Xserver/hw/xfree86/ddc/Imakefile:1.8 Mon May 31 20:16:59 2004 +++ xc/programs/Xserver/hw/xfree86/ddc/Imakefile Fri Oct 14 11:16:35 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/ddc/Imakefile,v 1.8 2004/06/01 00:16:59 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/ddc/Imakefile,v 1.9 2005/10/14 15:16:35 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -54,8 +54,7 @@ OBJS = xf86DDC.o edid.o interpret_edid.o print_edid.o \ interpret_vdif.o print_vdif.o ddcProperty.o -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/include \ -I$(XF86SRC)/i2c ModuleObjectRule() Index: xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c diff -u xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c:1.11 xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c:1.12 --- xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c:1.11 Sat Dec 11 15:38:46 2004 +++ xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c Fri Oct 14 11:16:35 2005 @@ -3,13 +3,11 @@ * * Copyright 1999 by Andrew C Aitchison */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c,v 1.11 2004/12/11 20:38:46 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c,v 1.12 2005/10/14 15:16:35 tsi Exp $ */ #include "misc.h" #include "xf86.h" -/* #include "xf86_ansic.h" */ -/* #include "xf86_OSproc.h" */ -#include "Xatom.h" +#include #include "property.h" #include "propertyst.h" #include "xf86DDC.h" Index: xc/programs/Xserver/hw/xfree86/ddc/interpret_vdif.c diff -u xc/programs/Xserver/hw/xfree86/ddc/interpret_vdif.c:1.6 xc/programs/Xserver/hw/xfree86/ddc/interpret_vdif.c:1.7 --- xc/programs/Xserver/hw/xfree86/ddc/interpret_vdif.c:1.6 Thu Jan 20 21:30:00 2000 +++ xc/programs/Xserver/hw/xfree86/ddc/interpret_vdif.c Fri Oct 14 11:16:35 2005 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/interpret_vdif.c,v 1.6 2000/01/21 02:30:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/interpret_vdif.c,v 1.7 2005/10/14 15:16:35 tsi Exp $ */ -#include "Xarch.h" +#include #include "xf86DDC.h" #include "vdif.h" Index: xc/programs/Xserver/hw/xfree86/ddc/vdif.h diff -u xc/programs/Xserver/hw/xfree86/ddc/vdif.h:1.5 xc/programs/Xserver/hw/xfree86/ddc/vdif.h:1.6 --- xc/programs/Xserver/hw/xfree86/ddc/vdif.h:1.5 Thu Nov 6 13:37:58 2003 +++ xc/programs/Xserver/hw/xfree86/ddc/vdif.h Fri Oct 14 11:16:35 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/vdif.h,v 1.5 2003/11/06 18:37:58 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/vdif.h,v 1.6 2005/10/14 15:16:35 tsi Exp $ */ #ifndef _VDIF_H #define _VDIF_H @@ -22,7 +22,7 @@ #define VDIF_POLARITY_NEGATIVE 0 #define VDIF_POLARITY_POSITIVE 1 -#include "Xmd.h" +#include #undef CARD32 #define CARD32 unsigned int /* ... on all supported platforms */ Index: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c diff -u xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c:1.28 xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c:1.29 --- xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c:1.28 Sat Dec 11 15:38:46 2004 +++ xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c Thu Mar 16 11:49:57 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.28 2004/12/11 20:38:46 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.29 2006/03/16 16:49:57 dawes Exp $ */ /* xf86DDC.c * @@ -6,7 +6,7 @@ */ /* - * Copyright (c) 1999-2004 by The XFree86 Project, Inc. + * Copyright (c) 1999-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -101,7 +101,7 @@ }; static pointer -ddcSetup(pointer module, pointer opts, int *errmaj, int *errmin) +ddcSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -115,7 +115,7 @@ * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(i2cSymbols, NULL); + LoaderModRefSymLists(module, i2cSymbols, NULL); } /* @@ -440,8 +440,10 @@ int w_bytes; unsigned char *R_Buffer; int i; - - xf86LoaderReqSymLists(i2cSymbols, NULL); + ModuleDescPtr pMod; + + pMod = xf86GetSubModuleByName(xf86Screens[scrnIndex]->module, "i2c"); + xf86LoaderModReqSymLists(pMod, i2cSymbols, NULL); if (!(dev = xf86I2CFindDev(pBus, 0x00A0))) { dev = xf86CreateI2CDevRec(); Index: xc/programs/Xserver/hw/xfree86/doc/BUILD diff -u xc/programs/Xserver/hw/xfree86/doc/BUILD:3.34 xc/programs/Xserver/hw/xfree86/doc/BUILD:3.35 --- xc/programs/Xserver/hw/xfree86/doc/BUILD:3.34 Wed Mar 16 20:11:54 2005 +++ xc/programs/Xserver/hw/xfree86/doc/BUILD Tue Apr 11 21:50:31 2006 @@ -17,70 +17,69 @@ We recommend using gcc to build XFree86, but XFree86 generally builds with the native compiler for each OS platform. -1. How to get the XFree86 4.5.0 source +1. How to get the XFree86 4.6.0 source -The recommended way of getting the XFree86 4.5.0 source is to obtain it +The recommended way of getting the XFree86 4.6.0 source is to obtain it directly from the XFree86 CVS repository. There are several ways of doing that, and they are described at our CVS web page . -The CVS tag for this release is "xf-4_5_0". The tag for the maintenance -branch for this release is "xf-4_5-branch". +The CVS tag for this release is "xf-4_6_0". The tag for the maintenance +branch for this release is "xf-4_6-branch". -Another method of getting the XFree86 4.5.0 source is to either download the -4.5.0 source tarballs from the XFree86 ftp site. The procedure for this is +Another method of getting the XFree86 4.6.0 source is to either download the +4.6.0 source tarballs from the XFree86 ftp site. The procedure for this is as follows: - o The XFree86 4.5.0 source is contained in the files: + o The XFree86 4.6.0 source is contained in the files: - XFree86-4.5.0-src-1.tgz + XFree86-4.6.0-src-1.tgz - XFree86-4.5.0-src-2.tgz + XFree86-4.6.0-src-2.tgz - XFree86-4.5.0-src-3.tgz + XFree86-4.6.0-src-3.tgz - XFree86-4.5.0-src-4.tgz + XFree86-4.6.0-src-4.tgz - XFree86-4.5.0-src-5.tgz + XFree86-4.6.0-src-5.tgz - XFree86-4.5.0-src-6.tgz + XFree86-4.6.0-src-6.tgz - XFree86-4.5.0-src-7.tgz + XFree86-4.6.0-src-7.tgz - These can be found at ftp://ftp.xfree86.org/pub/XFree86/4.5.0/source/ - and similar locations on XFree86 mirror sites. XFree86-4.5.0-src-4.tgz - and XFree86-4.5.0-src-5.tgz contains the fonts. XFree86-4.5.0-src-6.tgz - contains the documentation source. XFree86-4.5.0-src-7.tgz contains the - hardcopy documentation. XFree86-4.5.0-src-1.tgz, - XFree86-4.5.0-src-2.tgz and XFree86-4.5.0-src-3.tgz contains everything - else. + These can be found at ftp://ftp.xfree86.org/pub/XFree86/4.6.0/source/. + XFree86-4.6.0-src-4.tgz and XFree86-4.6.0-src-5.tgz contains the fonts. + XFree86-4.6.0-src-6.tgz contains the documentation source. + XFree86-4.6.0-src-7.tgz contains the hardcopy documentation. + XFree86-4.6.0-src-1.tgz, XFree86-4.6.0-src-2.tgz and + XFree86-4.6.0-src-3.tgz contains everything else. If you do not need either the documentation or the fonts, then you need - only XFree86-4.5.0-src-1.tgz, XFree86-4.5.0-src-2.tgz and - XFree86-4.5.0-src-3.tgz. + only XFree86-4.6.0-src-1.tgz, XFree86-4.6.0-src-2.tgz and + XFree86-4.6.0-src-3.tgz. o Extract each of these files by running the following from a directory on a filesystem containing enough space (the full source requires around 270MB, with a similar amount being required for the compiled binaries): - gzip -d < XFree86-4.5.0-src-1.tgz | tar vxf - + gzip -d < XFree86-4.6.0-src-1.tgz | tar vxf - - gzip -d < XFree86-4.5.0-src-2.tgz | tar vxf - + gzip -d < XFree86-4.6.0-src-2.tgz | tar vxf - - gzip -d < XFree86-4.5.0-src-3.tgz | tar vxf - + gzip -d < XFree86-4.6.0-src-3.tgz | tar vxf - - gzip -d < XFree86-4.5.0-src-4.tgz | tar vxf - + gzip -d < XFree86-4.6.0-src-4.tgz | tar vxf - - gzip -d < XFree86-4.5.0-src-5.tgz | tar vxf - + gzip -d < XFree86-4.6.0-src-5.tgz | tar vxf - - gzip -d < XFree86-4.5.0-src-6.tgz | tar vxf - + gzip -d < XFree86-4.6.0-src-6.tgz | tar vxf - - gzip -d < XFree86-4.5.0-src-7.tgz | tar vxf - + gzip -d < XFree86-4.6.0-src-7.tgz | tar vxf - -Alternatively, if you already have a pristine copy of the XFree86 4.4.0 +Alternatively, if you already have a pristine copy of the XFree86 4.5.0 source, you can download patches from -ftp://ftp.xfree86.org/pub/XFree86/4.5.0/patches/ that will allow you to con- -vert it to 4.5.0. Information about which patch files to download and how to +ftp://ftp.xfree86.org/pub/XFree86/4.6.0/patches/ that will allow you to con- +vert it to 4.6.0. Information about which patch files to download and how to apply them can be found in the "How to get XFree86" section of the README for this release. @@ -103,8 +102,8 @@ sarily. Before making too many modifications, check the configuration param- eters specified in the xc/config/cf/README file. -If you are using just the XFree86-4.5.0-src-1.tgz, XFree86-4.5.0-src-2.tgz -and XFree86-4.5.0-src-3.tgz parts of the source dist, you will need to define +If you are using just the XFree86-4.6.0-src-1.tgz, XFree86-4.6.0-src-2.tgz +and XFree86-4.6.0-src-3.tgz parts of the source dist, you will need to define BuildFonts to NO. 3. Using a shadow directory of symbolic links for the build @@ -282,7 +281,7 @@ them manually in host.def and report the problem to . - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/BUILD.sgml,v 3.19 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/BUILD.sgml,v 3.20 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/BUILD,v 3.34 2005/03/17 01:11:54 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/BUILD,v 3.35 2006/04/12 01:50:31 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/CODING diff -u xc/programs/Xserver/hw/xfree86/doc/CODING:3.6 xc/programs/Xserver/hw/xfree86/doc/CODING:3.8 --- xc/programs/Xserver/hw/xfree86/doc/CODING:3.6 Mon Dec 23 01:44:38 1996 +++ xc/programs/Xserver/hw/xfree86/doc/CODING Wed Feb 8 19:48:09 2006 @@ -1,8 +1,8 @@ - $XFree86: xc/programs/Xserver/hw/xfree86/doc/CODING,v 3.6 1996/12/23 06:44:38 dawes Exp $ + $XFree86: xc/programs/Xserver/hw/xfree86/doc/CODING,v 3.8 2006/02/09 00:48:09 dawes Exp $ GNU indent options: -bad -bap -c40 -cd0 -ncdb -ci4 -cli0 -cp0 -ncs -d0 --di4 -i4 -ip4 -l78 -nlp -npcs -psl -sob -ss -br -ce -sc +-di4 -i4 -ip4 -l78 -nlp -npcs -psl -sob -ss -br -ce -sc -ts8 -ut -bad forces a blank line after every block of declarations. -bap forces a blank line after every procedure body. @@ -18,7 +18,7 @@ -i4 set indentation level to 4 spaces -ip4 indent parameter types in old-style function definitions by 4 spaces -l78 set maximum line length to 78 --nlp don't line up continued lines at parentheses +-lp line up continued lines at parentheses -npcs do not put space after the function in function calls -psl put the type of a procedure on the line before its name -sob swallow optional blank lines @@ -26,10 +26,11 @@ n -ce cuddle else and preceeding `}' -sc put the `*' character at the left of comments +-t8 size is 8 spaces +-ut use characters for indentations greater than the size -br formats braces like this: if (x > 0) { x--; } -$XConsortium: CODING /main/2 1996/02/21 17:41:28 kaleb $ Index: xc/programs/Xserver/hw/xfree86/doc/DESIGN diff -u xc/programs/Xserver/hw/xfree86/doc/DESIGN:1.54 xc/programs/Xserver/hw/xfree86/doc/DESIGN:1.58 --- xc/programs/Xserver/hw/xfree86/doc/DESIGN:1.54 Wed Dec 8 17:32:05 2004 +++ xc/programs/Xserver/hw/xfree86/doc/DESIGN Tue Apr 18 13:16:36 2006 @@ -2,7 +2,7 @@ The XFree86 Project, Inc - 19 December 2003 + 13 October 2005 NOTE: This is a DRAFT document, and the interfaces described here are subject to change without notice. @@ -1926,7 +1926,7 @@ during OPERATING state. Note that the resource ranges have to match those specified during registration. If a range has been specified starting at A and ending at B - and suppose C us a value satisfying A < C < B one may not + and suppose C is a value satisfying A < C < B one may not specify the resource range (A,B) by splitting it into two ranges (A,C) and (C,B). @@ -2313,7 +2313,7 @@ "xf86_OSlib.h" - "Xos.h" + In addition, "xf86_libc.h" must not be included explicitly. It is included implicitly by "xf86_ansic.h". @@ -3566,11 +3566,13 @@ modreq An optional XF86ModReqInfo* containing ver- - sion/ABI/vendor information to requirements to - check the newly loaded module against. The - main purpose of this is to allow the loader to - verify that a module of the correct type/ver- - sion before running its SetupProc function. + sion/ABI/vendor information specifying require- + ments to check the newly loaded module against. + The main purpose of this is to allow the loader + to verify that a module of the correct + type/version before running its SetupProc func- + tion. + The XF86ModReqInfo struct is defined as fol- lows: @@ -3813,9 +3815,9 @@ } XF86ModuleData; The vers parameter must be initialised to a pointer to a correctly ini- -tialised XF86ModuleVersionInfo struct. The other two parameter are optional, -and should be initialised to NULL when not required. The other parameters -are defined as +tialised XF86ModuleVersionInfo struct. The other two parameters are +optional, and should be initialised to NULL when not required. The other +parameters are defined as typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *) @@ -3857,6 +3859,11 @@ The following is the Loader interface that is available to any part of the server, and may also be used from within modules. +Some of these have xf86* wrappers with simpler interfaces declared in +"xf86.h". These wrappers are the preferred interface for modules, given that +they are also available in a statically built server, whereas the functions +below are not. + pointer LoadSubModule(pointer parent, const char *module, const char **subdirlist, const char **patternlist, @@ -3945,20 +3952,20 @@ depend on runtime factors. The end of the argument list is indicated by a NULL argument. - int LoaderCheckUnresolved(int delayflag) + int LoaderCheckUnresolved(int dummy) This function checks for unresolved symbols. It gener- ates warnings for unresolved symbols that have not been - registered with LoaderRefSymLists(), and maps them to a - dummy function. This behaviour may change in future. If - unresolved symbols are found that have been registered - with LoaderReqSymLists() or LoaderReqSymbols() then this - function returns a non-zero value. If none of these sym- - bols are unresolved the return value is zero, indicating - success. + registered with LoaderRefSymLists(). All such symbols + are automatically mapped to a dummy function. If unre- + solved symbols are found that have been registered with + LoaderReqSymLists() or LoaderReqSymbols() then this func- + tion returns a non-zero value. If none of these symbols + are unresolved the return value is zero, indicating suc- + cess. - The delayflag parameter should normally be set to - LD_RESOLV_IFDONE. + The dummy parameter is not used, and should be set to 0. + It is kept only for compatibility purposes. LoaderErrorMsg(const char *name, const char *modname, @@ -3970,6 +3977,18 @@ errmin. If name is non-NULL, it is printed as an identi- fying prefix to the message (followed by a `:'). + LoaderSetParentModuleRequirements(pointer module, + + pointer req); + + This function is intended to be called from a module's + Setup function. It associates an XF86ModReqInfo struc- + ture occurrence (addressed by req) with the module being + loaded (specified by module). This structure occurrence + will then be used to check this module's parent modules + against. This mechanism allows a module to ensure its + callers are compatible. + 17.5 Special Registration Functions The loader contains some functions for registering some classes of modules. @@ -4811,7 +4830,7 @@ that match the detected hardware. They are described above in the Probe (section 5.8, page 1) and Available Functions (section 9.3, page 1) sections. -18.7 Probing discrete clocks on old hardware +18.7 Probing discrete clocks on older hardware The xf86GetClocks() function may be used to assist in finding the discrete pixel clock values on older hardware. @@ -4837,9 +4856,9 @@ CLK_REG_RESTORE. ProtectRegs is a function that does whatever is required to protect the hardware state while selecting a new clock. BlankScreen is a function that - blanks the screen. vertsyncreg and maskval are the reg- - ister and bitmask to check for the presence of vertical - sync pulses. knownclkindex and knownclkvalue are the + blanks the screen. vertsyncreg and maskval are the I/O + register and bitmask to check for the presence of verti- + cal sync pulses. knownclkindex and knownclkvalue are the index and value of a known clock. These are the known references on which the comparative measurements are based. The number of clocks probed is set in pScrn->num- @@ -5316,8 +5335,8 @@ The following is an outline for writing a basic unaccelerated driver for a PCI video card with a linear mapped framebuffer, and which has a VGA core. -It is includes some general information that is relevant to most drivers -(even those which don't fit that basic description). +It includes some general information that is relevant to most drivers (even +those which don't fit that basic description). The information here is based on the initial conversion of the Matrox Millen- nium driver to the ``new design''. For a fleshing out and sample implementa- @@ -5329,7 +5348,9 @@ prefix all of its externally visible symbols. This is to avoid name space clashes when loading multiple drivers. The examples here are for the ``ZZZ'' driver, which uses the ``ZZZ'' or ``zzz'' prefix for its externally visible -symbols. +symbols, with preference given to the uppercase prefix. Internal symbols +should also follow this convention to facilitate the debugging of a stati- +cally built server. 20.1 Include files @@ -5416,7 +5437,7 @@ "xf86_OSlib.h" - "Xos.h" + any OS header @@ -6370,7 +6391,7 @@ ZZZFreeRec(xf86Screens[scrnIndex]); } - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.57 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.62 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/DESIGN,v 1.54 2004/12/08 22:32:05 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/DESIGN,v 1.58 2006/04/18 17:16:36 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/Install diff -u xc/programs/Xserver/hw/xfree86/doc/Install:1.38 xc/programs/Xserver/hw/xfree86/doc/Install:1.39 --- xc/programs/Xserver/hw/xfree86/doc/Install:1.38 Wed Mar 16 20:11:54 2005 +++ xc/programs/Xserver/hw/xfree86/doc/Install Tue Apr 11 21:50:31 2006 @@ -1,4 +1,4 @@ - Installation Details for XFree86® 4.5.0 + Installation Details for XFree86® 4.6.0 The XFree86 Project, Inc @@ -22,11 +22,11 @@ XFree86 CVS repository's "utils" module, and from our ftp site .) -2. Downloading the XFree86 4.5.0 binaries +2. Downloading the XFree86 4.6.0 binaries -We provide XFree86 4.5.0 binaries for a range of operating systems at our ftp -site and our web site -. Often during +We provide XFree86 4.6.0 binaries for a range of operating systems at our ftp +site and our web site +. Often during releases our site is heavily loaded. Instead of downloading directly from us we recommend that instead you use one of our mirror sites. @@ -71,9 +71,9 @@ that your target will not be be available for this release. This is likeliest possibility if you are looking more than about two weeks after the release date. Check here - for information about + for information about updates to our binary distributions, and here - for errata related to + for errata related to this release. Assuming that you have run the Xinstall.sh script and found the binary dis- @@ -138,9 +138,9 @@ If you miss some and want to install them later, go to the Manual Installa- tion (section 4., page 1) section. -3. Installing XFree86 4.5.0 using the Xinstall.sh script +3. Installing XFree86 4.6.0 using the Xinstall.sh script -We strongly recommend that our XFree86 4.5.0 binaries be installed using the +We strongly recommend that our XFree86 4.6.0 binaries be installed using the Xinstall.sh script we provide. There are a lot of steps in the manual installation process, and those steps can vary according to the platform and hardware setup. There is a description of the manual installation process @@ -284,9 +284,9 @@ After the X server configuration is done, it may be advisable to reboot, especially if you run xdm (or equivalent) or the font server (xfs). -4. Installing XFree86 4.5.0 manually +4. Installing XFree86 4.6.0 manually -This section contains information about manually installing the XFree86 4.5.0 +This section contains information about manually installing the XFree86 4.6.0 binary distributions. You should only use this method if you know what you're doing. The information here covers some common cases, but not every possible case. It also may not be complete or up to date. Use at your own @@ -396,4 +396,4 @@ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml,v 1.22 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/Install,v 1.38 2005/03/17 01:11:54 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/Install,v 1.39 2006/04/12 01:50:31 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/LICENSE diff -u xc/programs/Xserver/hw/xfree86/doc/LICENSE:1.46 xc/programs/Xserver/hw/xfree86/doc/LICENSE:1.49 --- xc/programs/Xserver/hw/xfree86/doc/LICENSE:1.46 Wed Mar 16 20:11:54 2005 +++ xc/programs/Xserver/hw/xfree86/doc/LICENSE Tue Apr 18 13:16:36 2006 @@ -2,7 +2,7 @@ Compiled by The XFree86 Project - 9 March 2005 + April 2006 1. Introduction @@ -49,14 +49,14 @@ 3.1 Open Source -We believe that all of the code in this release (4.5.0) of XFree86 meet the +We believe that all of the code in this release (4.6.0) of XFree86 meet the requirements of the Open Source Definition , as maintained by the Open Source Initiative (OSI) . 3.2 Free Software -We believe that most of the code in this release (4.5.0) of XFree86 meets the +We believe that most of the code in this release (4.6.0) of XFree86 meets the requirements of the Free Software definition as defined by the Free Software Foundation (FSF) . @@ -70,7 +70,7 @@ licence can be found at the XFree86 web site -Copyright (C) 1994-2005 The XFree86 Project, Inc. +Copyright (C) 1994-2006 The XFree86 Project, Inc. All rights reserved. @@ -131,6 +131,8 @@ Copyright (C) 2002 Apple Computer, Inc. All Rights Reserved. +Copyright (C) 2005 ASPEED Technology Inc. + Copyright (C) 1988 AT&T. All Rights Reserved. Copyright (C) 1992 by Robert Baron @@ -186,7 +188,7 @@ Copyright (C) 1999-2003 by Peter Kunzmann, Citron GmbH, Germany. -Copyright (C) 1994 through 2005 by Marc Aurele La France (TSI @ UQV), +Copyright (C) 1994 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org Copyright (C) 1996 by Steven Lang @@ -802,9 +804,9 @@ 6.7 X-Oz Technologies -Copyright 2003, 2004, 2005 by David H. Dawes. +Copyright 2003-2006 by David H. Dawes. -Copyright 2003, 2004, 2005 by X-Oz Technologies. +Copyright 2003-2006 by X-Oz Technologies. All rights reserved. @@ -1636,7 +1638,7 @@ authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/LICENSE.sgml,v 1.41 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/LICENSE.sgml,v 1.43 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/LICENSE,v 1.46 2005/03/17 01:11:54 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/LICENSE,v 1.49 2006/04/18 17:16:36 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/README diff -u xc/programs/Xserver/hw/xfree86/doc/README:3.151 xc/programs/Xserver/hw/xfree86/doc/README:3.152 --- xc/programs/Xserver/hw/xfree86/doc/README:3.151 Wed Mar 16 20:11:54 2005 +++ xc/programs/Xserver/hw/xfree86/doc/README Tue Apr 11 21:50:31 2006 @@ -1,8 +1,8 @@ - README for XFree86® 4.5.0 + README for XFree86® 4.6.0 The XFree86 Project, Inc - 16 March 2005 + April 2006 Abstract @@ -11,20 +11,20 @@ Linux, FreeBSD, NetBSD, OpenBSD and Solaris) on Intel and other platforms. This version is compatible with X11R6.6. -1. What is XFree86 4.5.0? +1. What is XFree86 4.6.0? -XFree86 4.5.0 is the eighth full release in the XFree86 4.x series. +XFree86 4.6.0 is the ninth full release in the XFree86 4.x series. XFree86 4.x is the current XFree86 release series. The first release in this series was in early 2000. The core of XFree86 4.x is a modular X server. -The 4.5.0 version is a new release that includes additional hardware support, +The 4.6.0 version is a new release that includes additional hardware support, functional enhancements and bug fixes. Specific release enhancements can be viewed in the Release Notes. -Most modern PC video hardware is supported in XFree86 4.5.0, and most PC +Most modern PC video hardware is supported in XFree86 4.6.0, and most PC video hardware that isn't supported explicitly can be used with the "vesa" driver. The Release Notes has a table showing the drivers provided with -XFree86 4.5.0, and links to related documentation. +XFree86 4.6.0, and links to related documentation. XFree86® is produced by The XFree86 Project, Inc through the work of a group of volunteer independent developers. The XFree86 Project is a non-commercial @@ -61,7 +61,7 @@ 3. Pointers to additional information The documentation for this release can be found online at the XFree86 web -site . Documentation for the latest +site . Documentation for the latest release version can always be found here , and documentation for the latest pre-release snapshot can be found here . @@ -116,23 +116,23 @@ Current information about the XFree86 development process can be found at our web site . -6. How to get XFree86 4.5.0 +6. How to get XFree86 4.6.0 -XFree86 4.5.0 can be found at the XFree86 ftp server -, and at mirrors of this -server. Information about obtaining and installing binary distributions of -this release can be found in the Installation Document. Information about -obtaining the release in source form is given below. - -The source for version 4.5.0 is split into seven tarballs: - - XFree86-4.5.0-src-1.tgz - XFree86-4.5.0-src-2.tgz - XFree86-4.5.0-src-3.tgz - XFree86-4.5.0-src-4.tgz - XFree86-4.5.0-src-5.tgz - XFree86-4.5.0-src-6.tgz - XFree86-4.5.0-src-7.tgz +XFree86 4.6.0 can be found at the XFree86 ftp server +. Information about obtaining +and installing binary distributions of this release can be found in the +Installation Document. Information about obtaining the release in source +form is given below. + +The source for version 4.6.0 is split into seven tarballs: + + XFree86-4.6.0-src-1.tgz + XFree86-4.6.0-src-2.tgz + XFree86-4.6.0-src-3.tgz + XFree86-4.6.0-src-4.tgz + XFree86-4.6.0-src-5.tgz + XFree86-4.6.0-src-6.tgz + XFree86-4.6.0-src-7.tgz The first three contain everything except the fonts and general X11 documen- tation. Those three are sufficient for building XFree86 if you already have @@ -140,36 +140,36 @@ the source for the general X11 documentation. The seventh contains the gen- eral X11 documentation in hardcopy format. -A source patch relative to version 4.4.0 is also available. Because of its +A source patch relative to version 4.5.0 is also available. Because of its size, it is split into four parts. The patch files are: - XFree86-4.4.0-4.5.0.diff1.gz - XFree86-4.4.0-4.5.0.diff2.gz - XFree86-4.4.0-4.5.0.diff3.gz - XFree86-4.4.0-4.5.0.diff4.gz + XFree86-4.5.0-4.6.0.diff1.gz + XFree86-4.5.0-4.6.0.diff2.gz + XFree86-4.5.0-4.6.0.diff3.gz + XFree86-4.5.0-4.6.0.diff4.gz There is also a tarball and a cleanup script that handle files that have com- ponents that can't be included in a diff. These are: - XFree86-4.4.0-4.5.0-diff0.tgz - XFree86-4.4.0-4.5.0-cleanup.sh + XFree86-4.5.0-4.6.0-diff0.tgz + XFree86-4.5.0-4.6.0-cleanup.sh -These patches should be applied to a clean 4.4.0 source tree, working from +These patches should be applied to a clean 4.5.0 source tree, working from the directory containing the xc/ directory. The patches should be applied by running: - gzip -d < XFree86-4.4.0-4.5.0.diff1.gz | patch -p0 -E - gzip -d < XFree86-4.4.0-4.5.0.diff2.gz | patch -p0 -E - gzip -d < XFree86-4.4.0-4.5.0.diff3.gz | patch -p0 -E - gzip -d < XFree86-4.4.0-4.5.0.diff4.gz | patch -p0 -E + gzip -d < XFree86-4.5.0-4.6.0.diff1.gz | patch -p0 -E + gzip -d < XFree86-4.5.0-4.6.0.diff2.gz | patch -p0 -E + gzip -d < XFree86-4.5.0-4.6.0.diff3.gz | patch -p0 -E + gzip -d < XFree86-4.5.0-4.6.0.diff4.gz | patch -p0 -E - sh XFree86-4.4.0-4.5.0-cleanup.sh - gzip -d < XFree86-4.4.0-4.5.0-diff0.tgz | tar vxf - + sh XFree86-4.5.0-4.6.0-cleanup.sh + gzip -d < XFree86-4.5.0-4.6.0-diff0.tgz | tar vxf - To format the XFree86 documentation use the latest version of our doctools package available from the XFree86 CVS repository's "doctools" module, and from our ftp site . +tools-1.3.4.tgz>. The XFree86 source code for this and all releases/snapshots as well as devel- opment versions can also be accessed via the XFree86 CVS repository. Infor- @@ -177,8 +177,8 @@ on our web site. It's also possible to browse the XFree86 CVS repository at our CVSWeb server . The CVS tag for this version is -"xf-4_5_0". The CVS tag for the stable branch for this release is -"xf-4_5-branch". To check out the latest development version, don't specify +"xf-4_6_0". The CVS tag for the stable branch for this release is +"xf-4_6-branch". To check out the latest development version, don't specify any tag. 7. Reporting Bugs @@ -190,7 +190,17 @@ system core dump. Do not edit the log file as our developers use it to reproduce and debug your problem. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.148 dawes Exp $ +8. Supporting XFree86 +The XFree86 Project, Inc is a nonprofit that oversees the development of +XFree86. As with the XFree86 software, the nonprofit is run and operated +entirely by unpaid volunteers. Donations to The XFree86 Project go towards +maintaining our online presence and related infrastructure and modest operat- +ing expenses. If you find XFree86 useful, and would like to help us continue +in our work, please consider a small donation +. -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README,v 3.151 2005/03/17 01:11:54 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.149 dawes Exp $ + + +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README,v 3.152 2006/04/12 01:50:31 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/README.DECtga diff -u xc/programs/Xserver/hw/xfree86/doc/README.DECtga:3.36 xc/programs/Xserver/hw/xfree86/doc/README.DECtga:3.37 --- xc/programs/Xserver/hw/xfree86/doc/README.DECtga:3.36 Wed Mar 16 20:11:54 2005 +++ xc/programs/Xserver/hw/xfree86/doc/README.DECtga Tue Apr 11 21:50:32 2006 @@ -6,7 +6,7 @@ 1. DEC 21030 - o The DEC 21030 is supported by XFree86 4.5.0. The driver is now par- + o The DEC 21030 is supported by XFree86 4.6.0. The driver is now par- tially accelerated. The built-in graphics on the Multia is supported in 8-plane mode, and PCI cards with 8 or 16 MB framebuffers are supported in 24-plane mode. TGA2 (aka PowerStorm 3D30/4D20) cards are not cur- @@ -65,4 +65,4 @@ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DECtga.sgml,v 3.9 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DECtga,v 3.36 2005/03/17 01:11:54 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DECtga,v 3.37 2006/04/12 01:50:32 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/README.Darwin diff -u xc/programs/Xserver/hw/xfree86/doc/README.Darwin:1.26 xc/programs/Xserver/hw/xfree86/doc/README.Darwin:1.27 --- xc/programs/Xserver/hw/xfree86/doc/README.Darwin:1.26 Wed Mar 16 20:11:54 2005 +++ xc/programs/Xserver/hw/xfree86/doc/README.Darwin Tue Apr 11 21:50:32 2006 @@ -66,7 +66,7 @@ If you don't feel the need to live on the cutting edge, you can save some time and effort by using the precompiled binaries available on the XFree86 -FTP server at . Fol- +FTP server at . Fol- low the instructions in the Install document to install it. This will create three new directory trees, /usr/X11R6, /etc/X11 and /etc/fonts. On Mac OS X the Xquartz.tgz tarball is required in addition to the other tarballs @@ -211,4 +211,4 @@ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml,v 1.11 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.Darwin,v 1.26 2005/03/17 01:11:54 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.Darwin,v 1.27 2006/04/12 01:50:32 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/README.LynxOS diff -u xc/programs/Xserver/hw/xfree86/doc/README.LynxOS:3.48 xc/programs/Xserver/hw/xfree86/doc/README.LynxOS:3.49 --- xc/programs/Xserver/hw/xfree86/doc/README.LynxOS:3.48 Wed Mar 16 20:11:54 2005 +++ xc/programs/Xserver/hw/xfree86/doc/README.LynxOS Tue Apr 11 21:50:32 2006 @@ -1,4 +1,4 @@ - README for XFree86® 4.5.0 on LynxOS + README for XFree86® 4.6.0 on LynxOS Thomas Mueller @@ -13,19 +13,16 @@ See the Copyright Notice. -The sources for XFree86 4.5.0 are available by anonymous ftp from: +The sources for XFree86 4.6.0 are available by anonymous ftp from: -ftp://ftp.XFree86.org/pub/XFree86/4.5.0 +ftp://ftp.XFree86.org/pub/XFree86/4.6.0 Binaries of XFree86 for LynxOS x86 are available from: -ftp://ftp.XFree86.org/pub/XFree86/4.5.0/binaries/LynxOS - -A list of mirror sites is provided by ftp://ftp.XFree86.org/pub/XFree86/MIR- -RORS +ftp://ftp.XFree86.org/pub/XFree86/4.6.0/binaries/LynxOS The binaries on the FTP site were built on the latest released LynxOS version -at the time XFree86 4.5.0 was released. In this case it is `LynxOS x86 +at the time XFree86 4.6.0 was released. In this case it is `LynxOS x86 3.0.1'. Because of changes made to the object format they don't run on LynxOS versions earlier than 3.0.0. @@ -37,7 +34,7 @@ 3.1.0' support has to be considered to be in `alpha state'. Initial tests were performed on LynxOS x86 only! -XFree86 4.5.0 supports LynxOS on the x86 and on the PowerPC platform. X +XFree86 4.6.0 supports LynxOS on the x86 and on the PowerPC platform. X servers are currently available only on the x86 platform. The X server may work with some PowerPC platforms supported by LynxOS though this has not (yet) been thoroughly tested. @@ -163,7 +160,7 @@ 3.5 X Server debug diagnostics output and other VT peculiarities Output made by the XFree86 X on its stdout or stderr will be lost after the -server switches to graphics mode. The XFree86 4.5.0 server stores its output +server switches to graphics mode. The XFree86 4.6.0 server stores its output in /usr/adm/XFree86.n.log (where n is the screen number). When the X server is running output made to other consoles will be lost. @@ -263,7 +260,7 @@ sort /usr/X11R6/man/whatis | uniq > /tmp/tmpfile mv /tmp/tmpfile /usr/X11R6/man/whatis - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/LynxOS.sgml,v 3.21 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/LynxOS.sgml,v 3.22 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.LynxOS,v 3.48 2005/03/17 01:11:54 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.LynxOS,v 3.49 2006/04/12 01:50:32 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/README.NetBSD diff -u xc/programs/Xserver/hw/xfree86/doc/README.NetBSD:3.100 xc/programs/Xserver/hw/xfree86/doc/README.NetBSD:3.101 --- xc/programs/Xserver/hw/xfree86/doc/README.NetBSD:3.100 Wed Mar 16 20:11:55 2005 +++ xc/programs/Xserver/hw/xfree86/doc/README.NetBSD Tue Apr 11 21:50:32 2006 @@ -1,4 +1,4 @@ - README for XFree86® 4.5.0 on NetBSD + README for XFree86® 4.6.0 on NetBSD Rich Murphey, David Dawes, Marc Wandschneider, Mark Weaver, Matthieu Herrb @@ -15,12 +15,10 @@ The sources for XFree86 are available by anonymous ftp from: -ftp://ftp.XFree86.org/pub/XFree86/4.5.0 +ftp://ftp.XFree86.org/pub/XFree86/4.6.0 Binaries for NetBSD 1.5 and later are available from: -ftp://ftp.XFree86.org/pub/XFree86/4.5.0/binaries/NetBSD - -A list of mirror sites is provided by http://www.xfree86.org/MIRRORS.shtml +ftp://ftp.XFree86.org/pub/XFree86/4.6.0/binaries/NetBSD XFree86 also builds on other NetBSD architectures. See section Building on other architectures (section 8.4, page 1) for details. @@ -34,7 +32,7 @@ 3. New OS dependent features -See the Release Notes for non-OS dependent new features in XFree86 4.5.0. +See the Release Notes for non-OS dependent new features in XFree86 4.6.0. 3.1 New OS dependent features in 4.2.0 @@ -112,7 +110,7 @@ 5.1 About mouse configuration -XFree86 4.5.0 has support for the mouse driver included in the wscons console +XFree86 4.6.0 has support for the mouse driver included in the wscons console driver introduced by NetBSD 1.4. Specify ``wsmouse'' as the protocol and ``/dev/wsmouse0'' as the device in /etc/X11/XF86Config if you're using NetBSD 1.4 or later with a PS/2 mouse. @@ -230,14 +228,14 @@ access to the /dev/mem device when in multi-users mode. But XFree86 servers can take advantage (or require) linear access to the display memory. -Most XFree86 4.5.0 card drivers require linear memory access. There are two +Most XFree86 4.6.0 card drivers require linear memory access. There are two ways to allow XFree86 to access linear memory: The first way is to disable the kernel security feature by adding ``option INSECURE'' in the kernel configuration file and build a new kernel. The second way is to install the aperture driver, included in source form in -xc/programs/Xserver/hw/xfree86/etc/apNetBSD.shar in the XFree86 4.5.0 source +xc/programs/Xserver/hw/xfree86/etc/apNetBSD.shar in the XFree86 4.6.0 source distribution. Unpack it in a new directory of your choice by running: sh apNetBSD.shar @@ -379,7 +377,7 @@ Hasty, Christoph Robitschko, Matthias Scheler, Michael Smith, Ignatios Sou- vatzis, Jack Velte, Nate Williams and Pace Willison. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.69 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.70 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.NetBSD,v 3.100 2005/03/17 01:11:55 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.NetBSD,v 3.101 2006/04/12 01:50:32 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD diff -u xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD:1.55 xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD:1.56 --- xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD:1.55 Wed Mar 16 20:11:55 2005 +++ xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD Tue Apr 11 21:50:32 2006 @@ -1,4 +1,4 @@ - README for XFree86® 4.5.0 on OpenBSD + README for XFree86® 4.6.0 on OpenBSD Matthieu Herrb @@ -13,15 +13,13 @@ See the Copyright Notice. -The sources for XFree86 4.5.0 are available by anonymous ftp from: +The sources for XFree86 4.6.0 are available by anonymous ftp from: -ftp://ftp.XFree86.org/pub/XFree86/4.5.0 +ftp://ftp.XFree86.org/pub/XFree86/4.6.0 Binaries for OpenBSD/i386 3.4 and later are available from: -ftp://ftp.XFree86.org/pub/XFree86/4.5.0/binaries/OpenBSD - -A list of mirror sites is provided by http://www.xfree86.org/MIRRORS.shtml +ftp://ftp.XFree86.org/pub/XFree86/4.6.0/binaries/OpenBSD XFree86 also builds on other OpenBSD architectures. See section Building on other architectures (section 8., page 1) for details. @@ -33,7 +31,7 @@ 3. New OS dependent features -See the Release Notes for non-OS dependent new features in XFree86 4.5.0. +See the Release Notes for non-OS dependent new features in XFree86 4.6.0. 3.1 New OS related features in 4.4 @@ -146,7 +144,7 @@ 5.1 About mouse configuration -XFree86 4.5.0 has support for the mouse driver included in the new wscons +XFree86 4.6.0 has support for the mouse driver included in the new wscons console driver introduced by OpenBSD-2.9. Specify ``wsmouse'' as the proto- col and ``/dev/wsmouse0'' as the device in /etc/X11/XF86Config if you're using OpenBSD-2.9 or later with a PS/2 or USB mouse. @@ -306,7 +304,7 @@ Hasty, Christoph Robitschko, Matthias Scheler, Michael Smith, Ignatios Sou- vatzis, Jack Velte, Nate Williams and Pace Willison. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml,v 1.35 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml,v 1.36 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD,v 1.55 2005/03/17 01:11:55 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD,v 1.56 2006/04/12 01:50:32 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/README.ati diff -u xc/programs/Xserver/hw/xfree86/doc/README.ati:3.67 xc/programs/Xserver/hw/xfree86/doc/README.ati:3.71 --- xc/programs/Xserver/hw/xfree86/doc/README.ati:3.67 Mon Feb 14 20:47:38 2005 +++ xc/programs/Xserver/hw/xfree86/doc/README.ati Tue Apr 11 21:50:32 2006 @@ -2,7 +2,7 @@ Marc Aurele La France - 2002 February 12 + 2005 June 06 Abstract @@ -11,11 +11,11 @@ 1. Statement of intent -Generally speaking, the driver is intended for all ATI video adapters, pro- +Generally speaking, this driver is intended for all ATI video adapters, pro- viding maximum video function within hardware limitations. The driver is also intended to optionally provide the same level of support for generic VGA -or 8514/A adapters. This driver is still being actively developed, meaning -that it currently does not yet fully meet these goals. +or 8514/A adapters. As this driver is still being actively developed, it +currently does not yet fully meet all of these goals. The driver will provide @@ -31,23 +31,24 @@ o generic VGA support if a non-ATI VGA-capable adapter is detected and the user has requested such support. -Thus, the level of support provided not only depends on what the driver -detects in the system, but also, on what the user specifies in the XF86Config -file. See the ``XF86Config specifications'' section below for details. - -If none of the above conditions are met, the ATI driver will essentially dis- -able itself to allow other drivers to examine the system. - -Note that I am currently considering removing the driver's support for -generic VGA. If you have any concerns about this, please contact me at -. +Thus, the level of support depends not only on what the driver detects in the +system, but also on what the user specifies in the XF86Config file. + +See the ``XF86Config specifications'' section below for details. + +If none of the aforementioned conditions are met, the ATI driver will essen- +tially disable itself to allow other drivers to examine the system. + +Note: I am currently considering removing the driver's support for generic +VGA. If you have concerns about this decision, please contact me at + and I will address them. 2. A note on acceleration The meaning of ``acceleration'', as used in this document, needs to be clari- fied. Two of the many components in an accelerator are the CRT controller (CRTC) and the Draw Engine. This is in addition to another CRTC that, gener- -ally, is also present in the system (often in the same chip) and typically +ally, is also present in the system, often in the same chip and typically provides EGA, VGA or SuperVGA functionality. A CRTC is the component of a graphics controller that is responsible for @@ -69,9 +70,10 @@ The driver currently supports the SuperVGA capabilities of all ATI adapters except some early Mach8 and Mach32 adapters that do not provide the required -functionality. This support works for monochrome, 16-colour and 256-colour -video modes, if one of the following ATI graphics controller chips is -present: +functionality. + +This support works for monochrome, 16-colour and 256-colour video modes, if +one of the following ATI graphics controller chips is present: VGAWonder series: 18800, 18800-1, 28800-2, 28800-4, 28800-5, 28800-6 Mach32 series: 68800-3, 68800-6, 68800AX, 68800LX @@ -112,8 +114,8 @@ XPERT@Play 98, XPERT@Work, XPERT 98, XPERT LCD, XPERT XL -Also, a number of mainboards, laptops and notebooks harbour a Mach32 or -Mach64 controller. +There are also a number of mainboards, laptops and notebooks that harbour a +Mach32 or Mach64 controller. VGAWonder, Mach8 and Mach32 ISA adapters are available with or without a mouse. @@ -124,12 +126,13 @@ For all but Mach64 adapters, this driver still does not provide support for accelerated drawing to the screen. This means that all drawing is done by -the CPU, rather than by any accelerator present in the system. This can make -opaque moves, for example, quite ``jerky''. Also, given that IBM 8514/A and -ATI Mach8 do not allow CPU access to their frame buffer, the driver will cur- -rently ignore these accelerators. Most Mach32 adapters provide both acceler- -ated function and SuperVGA functionality, but the driver currently only uses -the VGA. +the CPU, rather than by any accelerator present in the system and this can +make opaque moves, for example, quite ``jerky''. + +Given that IBM 8514/A and ATI Mach8 do not allow CPU access to their frame +buffer, the driver will currently ignore these accelerators. Most Mach32 +adapters provide both accelerated function and SuperVGA functionality, but +the driver currently only uses the VGA. The driver does however support the accelerator CRTC present in all ATI Mach64 adapters. For 256-colour, and higher depth modes, this support will @@ -145,9 +148,6 @@ to be used. This support is as yet incomplete and can be disabled entirely with an XF86Config option. -On non-Intel platforms, the driver can, currently, only support PCI Mach64 -adapters. - 4. Current implementation of generic VGA support for non-ATI adapters Support for generic VGA with non-ATI adapters is also implemented, but has @@ -233,9 +233,6 @@ fore, only be used when there is in fact such an adapter in the system. They are otherwise equivalent to ``ati''. -On non-Intel platforms, only ``ati'' and ``mach64'' ChipSet values are opera- -tive. - 5.3 ChipID & ChipRev specifications These specifications will cause the driver to associate the ``Device'' sec- @@ -247,19 +244,13 @@ the ``Device'' section. ChipRev is meaningful only with Mach64 adapters, and then only if ChipID is also specified in the same ``Device'' section. -5.4 IOBase - -This option limits the adapters that can be associated with the ``Device'' -section to the one with the specified I/O base. This option only applies to -Mach64 adapters and specifically excludes other adapters. - -5.5 BusID +5.4 BusID This option limits the adapters that can be associated with the ``Device'' section to the one with the specified PCI Bus ID. This specification excludes non-PCI adapters. -5.6 Clocks +5.5 Clocks For the purpose of specifying a clock line in your XF86Config, one of four different situations can occur, as follows. @@ -280,7 +271,7 @@ If you are uncertain which situation applies to your adapter, you can run a clock probe with the command ``X -probeonly''. -5.6.1 Clocks for supported programmable clock generators +5.5.1 Clocks for supported programmable clock generators At bootup, video BIOS initialisation programmes an initial set of frequen- cies. Two of these are reserved to allow the setting of modes that do not @@ -294,7 +285,7 @@ any XF86Config clock specification, and programme the clock generator as needed by the modes used during the X session. -5.6.2 Clocks for unsupported programmable clock generators +5.5.2 Clocks for unsupported programmable clock generators This case is unlikely to occur, but is documented for the sake of complete- ness. @@ -328,7 +319,7 @@ If the driver matches the clocks to the third setting above, functionality will be extremely limited (assuming the driver works at all). -5.6.3 Clocks for fixed clock generators on ATI adapters +5.5.3 Clocks for fixed clock generators on ATI adapters This section applies to all VGAWonder and Mach32 adapters, and to early Mach64 prototypes. @@ -399,7 +390,7 @@ owners should note that this order is different than what they would use for previous XFree86 accelerated servers. -5.6.4 Clocks for non-ATI adapters +5.5.4 Clocks for non-ATI adapters If no clocks are specified in the XF86Config, the driver will probe for four clocks, the second of which will be assumed to be 28.322 MHz. The first @@ -407,7 +398,7 @@ include up to four clock frequencies in your XF86Config to specify the actual values used by the adapter. Any more will be ignored. -5.7 Option ``nopanel_display'' +5.6 Option ``nopanel_display'' This specification is only effective when the driver detects that the adapter's BIOS has initialised both the digital flat panel and CRT inter- @@ -416,7 +407,7 @@ flat panel and display the screen image on the CRT instead, which could potentially allow for larger physical resolutions than the panel can handle. -5.8 Option ``crt_display'' +5.7 Option ``crt_display'' This specification is only effective when the driver detects that the adapter's BIOS has initialised the digital flat panel interface, but has dis- @@ -424,24 +415,21 @@ only the panel. This specification causes the driver to instead display the same image on both the panel and the CRT. -5.9 Option ``noaccel'' +5.8 Option ``noaccel'' By default, the driver will accelerate draw operations if a Mach64 CRTC is used to drive the display. As implemented in this driver, acceleration does not require a linear video memory aperture. This option disables this accel- eration. -5.10 Option ``nolinear'' +5.9 Option ``nolinear'' By default, the driver will enable a linear video memory aperture for 256-colour and higher depth modes if it is also using a Mach64 accelerator CRTC or an integrated Mach64 graphics chip. This option disables this linear aperture. -On non-Intel platforms, the driver requires a linear aperture and, so, this -option is ignored. - -5.11 Option ``HWCursor'' and Option ``SWCursor'' +5.10 Option ``HWCursor'' and Option ``SWCursor'' Option ``HWCursor'', which is the default, specifies that hardware facilities are to be used to paint the mouse pointer on the screen. Option ``SWCursor'' @@ -452,7 +440,7 @@ being used. In all other situations, a software cursor will be used, regard- less of what these options specify. -5.12 Option ``SilkenMouse'' +5.11 Option ``SilkenMouse'' This option is only acted upon when a hardware cursor is being used. It specifies that the cursor's position on the screen is to be updated as @@ -460,7 +448,7 @@ If this option is negated, the cursor may lag the mouse when the X server is very busy. -5.13 Option ``shadowfb'' +5.12 Option ``shadowfb'' If this option is enabled, the driver will cause the CPU to do each drawing operation first into a shadow frame buffer in system virtual memory and then @@ -476,19 +464,19 @@ a linear video memory aperture is not enabled, when the frame buffer depth is less than 8, or when acceleration is used. -5.14 Option ``dpms'' +5.13 Option ``dpms'' This option enables the driver's support for VESA's Display Power Management Specification. -5.15 Option ``backingstore'' +5.14 Option ``backingstore'' This is not specifically a driver option. It is used to enable the server's support for backing store, a mechanism by which pixel data for occluded win- dow regions is remembered by the server thereby alleviating the need to send expose events to X clients when the data needs to be redisplayed. -5.16 MemBase address +5.15 MemBase address This specification is only effective for non-PCI Mach64 adapters, and is used to override the CPU address at which the adapter will map its video memory. @@ -502,14 +490,14 @@ requirements of most devices in the system. This means the driver can not easily change the linear aperture address. -5.17 Option ``ReferenceClock'' ``frequency'' +5.16 Option ``ReferenceClock'' ``frequency'' This option is only applicable to non-Intel platforms, where an adapter BIOS is not available to the driver. The option specifies the reference frequency used by the adapter's clock generator. The default is 14.318 MHz, and other typical values are 28.636, or 29.5 MHz. -5.18 ClockChip ``name'' +5.17 ClockChip ``name'' This option is only applicable to non-Intel platforms, where an adapter BIOS is not available to the driver, and the driver cannot reliably determine @@ -538,10 +526,10 @@ fied in the corresponding ``Monitor'' section. For a digital flat panel, any sync tolerances should be removed from the cor- -responding ``Monitor'' section. The driver will automatically calculate -these from the mode that is active on server entry. The driver also inserts -timings for a mode called "Native panel mode" that represents the panel's -native resolution. +responding ``Monitor'' section. If any are specified, they will be ignored. +The driver will automatically calculate these from the mode that is active on +server entry. The driver also inserts timings for a mode called "Native +panel mode" that represents the panel's native resolution. 7. Known problems and limitations @@ -601,7 +589,10 @@ o The use of a laptop's hot-keys to switch displays while this driver is active can cause lockups and/or other woes, and is therefore not recom- - mended. It is not currently possible to solve this problem. + mended. It is not currently possible to solve this problem. By + default, the driver disables the use of such keys, by communicating to + the video BIOS to ignore them. These hot-keys can be re-enabled with + Option ``BIOSDisplay'' but results will be unpredictable. o In situations where the driver is to simultaneously display on both a panel and a CRT, the same image will be seen on both. In particular, @@ -645,7 +636,7 @@ Secondly, please check XFree86's doc directory for additional information. Thirdly, a scan through the comp.windows.x.i386unix and comp.os.linux.x news- -groups and the xfree86 mailing list using your favourite archiving service +groups and the xfree86 mailing lists using your favourite archiving service can also prove useful in resolving problems. If you are still experiencing problems, you can send me non-HTMLised e-mail @@ -676,34 +667,38 @@ 10. Driver versions -Due to the introduction of loadable drivers in XFree86 4.0, it has become -necessary to track driver versions separately. Driver releases use the fol- -lowing version numbering scheme. +With the introduction of loadable drivers in XFree86 4.0, it has become nec- +essary to track driver versions separately. Driver releases use the follow- +ing version numbering scheme. + +Version 1 of this driver is the one I inherited from Rik Faith and is the +version found in XFree86 releases 2.0 and 2.1. -Version 1 of this driver is the one I inherited from Rik Faith. This is the -version found in XFree86 2.0 and 2.1. +Version 2 is my first rewrite which ended up being a partially successful +attempt at generalising the driver for all of VGA Wonders, Mach32, and the +early Mach64 adapters. Various releases of this version of the driver can be +found in XFree86 2.1.1, 3.1, 3.1.1 and 3.1.2. -Version 2 is my first rewrite of this code which only ended up being a par- -tially unsuccessful attempt at generalising the driver for all VGA Wonder, -Mach32, and early Mach64 adapters. Various releases of this version of the -driver can be found in XFree86 2.1.1, 3.1, 3.1.1 and 3.1.2. +Version 3 represents my second rewrite, a rather lame one at that, but in +version 3, I introduced clock programming for Mach64 adapters and merged in +the old ati_test debugging tool. This is found in XFree86 releases 3.2, 3.3 +and 3.3.1. -Version 3 represents my second rewrite (although a rather lame one as -rewrites go). Into version 3, I introduced clock programming for Mach64 -adapters and merged in the old ati_test debugging tool. This is the version -found in XFree86 3.2, 3.3 and 3.3.1. +Version 4 is a major restructuring of the previous version which became +larger than I could comfortably handle in one source file. This is the ver- +sion found in XFree86 releases 3.3.2, 3.3.3, 3.3.3.1, 3.3.3.2, 3.3.4, 3.3.5 +and 3.3.6. -Version 4 is a rather major restructuring of version 3, which became larger -than I could comfortably handle in one source file. This is the version -found in XFree86 3.3.2, 3.3.3, 3.3.3.1, 3.3.3.2, 3.3.4, 3.3.5 and 3.3.6. +Version 5 is an almost complete restructuring of version 4, made to fit into +the new driver API that XFree86 4.0 and later adopted. -Version 5 is an almost complete restructuring of version 4 to fit in the -newer driver API of XFree86 4.0 and later. +Version 6 begins the process of porting the driver to non-Intel architec- +tures. -The introduction of version 6 is a first swipe at porting the driver to non- -Intel architectures. +Version 7 introduces a much more ``mature'' port of this driver to all archi- +tectures supported by the core server. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml,v 3.43 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml,v 3.46 tsi Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.ati,v 3.67 2005/02/15 01:47:38 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.ati,v 3.71 2006/04/12 01:50:32 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/README.chips diff -u xc/programs/Xserver/hw/xfree86/doc/README.chips:3.58 xc/programs/Xserver/hw/xfree86/doc/README.chips:3.59 --- xc/programs/Xserver/hw/xfree86/doc/README.chips:3.58 Wed Mar 16 20:11:55 2005 +++ xc/programs/Xserver/hw/xfree86/doc/README.chips Tue Apr 11 21:50:32 2006 @@ -6,7 +6,7 @@ 1. Introduction -With the release of XFree86 version 4.5.0, the Chips and Technologies driver +With the release of XFree86 version 4.6.0, the Chips and Technologies driver has been extensively rewritten and contains many new features. This driver must be considered work in progress, and those users wanting stability are encouraged to use the older XFree86 3.3.x versions. However this version of @@ -976,7 +976,7 @@ startx -- -depth 24 -fbbpp 32 8-8-8 RGB truecolor - however as XFree86 version 4.5.0 allows 32bpp pixmaps to be used + however as XFree86 version 4.6.0 allows 32bpp pixmaps to be used with framebuffers operating in 24bpp, this mode of operating will cost performance for no gain in functionality. @@ -1050,4 +1050,4 @@ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml,v 3.39 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.chips,v 3.58 2005/03/17 01:11:55 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.chips,v 3.59 2006/04/12 01:50:32 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/README.mouse diff -u xc/programs/Xserver/hw/xfree86/doc/README.mouse:1.34 xc/programs/Xserver/hw/xfree86/doc/README.mouse:1.35 --- xc/programs/Xserver/hw/xfree86/doc/README.mouse:1.34 Wed Mar 16 20:11:55 2005 +++ xc/programs/Xserver/hw/xfree86/doc/README.mouse Tue Apr 11 21:50:32 2006 @@ -6,7 +6,7 @@ 1. Introduction -This document describes mouse support in XFree86 4.5.0. +This document describes mouse support in XFree86 4.6.0. Mouse configuration has often been a mysterious task for novice users. With XFree86 4.5.0 and later, mouse configuration is automatic for most common @@ -1001,4 +1001,4 @@ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/mouse.sgml,v 1.16 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.mouse,v 1.34 2005/03/17 01:11:55 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.mouse,v 1.35 2006/04/12 01:50:32 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/README.s3virge diff -u xc/programs/Xserver/hw/xfree86/doc/README.s3virge:1.27 xc/programs/Xserver/hw/xfree86/doc/README.s3virge:1.28 --- xc/programs/Xserver/hw/xfree86/doc/README.s3virge:1.27 Wed Mar 16 20:11:55 2005 +++ xc/programs/Xserver/hw/xfree86/doc/README.s3virge Tue Apr 11 21:50:32 2006 @@ -6,7 +6,7 @@ 1. Supported hardware -The s3virge driver in XFree86 4.5.0 supports the S3 ViRGE, ViRGE DX, GX, GX2, +The s3virge driver in XFree86 4.6.0 supports the S3 ViRGE, ViRGE DX, GX, GX2, MX, MX+, and VX chipsets. It also supports Trio3D and Trio3D/2x chips. A majority of testing is done on ViRGE DX chips, making them the most stable to date. This release has added support for doublescan modes on DX. @@ -63,4 +63,4 @@ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/s3virge.sgml,v 1.7 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.s3virge,v 1.27 2005/03/17 01:11:55 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.s3virge,v 1.28 2006/04/12 01:50:32 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/RELNOTES diff -u xc/programs/Xserver/hw/xfree86/doc/RELNOTES:3.149 xc/programs/Xserver/hw/xfree86/doc/RELNOTES:3.152 --- xc/programs/Xserver/hw/xfree86/doc/RELNOTES:3.149 Wed Mar 16 20:11:55 2005 +++ xc/programs/Xserver/hw/xfree86/doc/RELNOTES Fri Apr 28 23:38:00 2006 @@ -1,34 +1,36 @@ - Release Notes for XFree86® 4.5.0 + Release Notes for XFree86® 4.6.0 The XFree86 Project, Inc - 16 March 2005 + April 2006 Abstract This document contains information about the various features and - their current status in the XFree86 4.5.0 release. + their current status in the XFree86 4.6.0 release. 1. Introduction to the 4.x Release Series XFree86 4.0 was the first official release of the XFree86 4 series. The cur- -rent release (4.5.0) is the latest in that series. The XFree86 4.x series +rent release (4.6.0) is the latest in that series. The XFree86 4.x series represents a significant redesign of the XFree86 X server, with a strong focus on modularity and configurability. 2. Configuration: a Quick Synopsis Automatic configuration was introduced with XFree86 4.4.0 which makes it pos- -sible to start XFree86 without first creating a configuration file. This was -further improved in XFree86 4.5.0. +sible to start XFree86 without first creating a configuration file. This has +been further improved in XFree86 4.5.0 and 4.6.0. If you experienced any +problems with automatic configuration in a previous release, it is worth try- +ing it again with this release. While the initial automatic configuration support was originally targeted ust -for Linux and the FreeBSD variants, in 4.5.0 it now includes Solaris, NetBSD -and OpenBSD support, and it is planned that automatic configuration will be -supported on other platforms in future releases. +for Linux and the FreeBSD variants, as of 4.5.0 it also includes Solaris, +NetBSD and OpenBSD support. Full support for automatic configuration is +planned for other platforms in future releases. -If you are running either Linux, FreeBSD, NetBSD, OpenBSD, or Solaris, try -Auto Configuration by running: +If you are running Linux, FreeBSD, NetBSD, OpenBSD, or Solaris, try Auto Con- +figuration by running: XFree86 -autoconfig @@ -70,13 +72,13 @@ through the Installation Document as it can point out which particular binary you should download. -The next section describes what is new in the latest version (4.5.0) compared -with the previous full release (4.4.0). There are many new features in this +The next section describes what is new in the latest version (4.6.0) compared +with the previous full release (4.5.0). There are many new features in this release and we unfortunately do not have enough space to cover them all here. -3. Summary of new features in 4.5.0. +3. Summary of new features in 4.6.0. -This is a sampling of the new features in XFree86 4.5.0. A more complete +This is a sampling of the new features in XFree86 4.6.0. A more complete list of changes can be found in the CHANGELOG that is part of the XFree86 source tree. It can also be viewed online at our CVSweb server ). - - o Integer overflow in libICE/libSM. - - o libXpm stack and integer overflow and other issues (CAN-2004-0687 - , - CAN-2004-0688 , CAN-2004-0914 - , - CAN-2005-0605 ). - - o Potential security issues related to wrap-around of memory allocation - requests in font handling and other areas. + o X server pixmap allocation flaw (CERT Vulnerability Note VU#102441 + , CAN-2005-2495 + ). 3.2 Video Driver Enhancements -3.2.1 General + o Remove cfb support from the i740, nsc, s3virge, siliconmotion and via + drivers. + +3.2.1 aspeed - o In most drivers, fix a long-standing off-by-one error in the programming - of sync pulse start and end for video modes based on VGA or its exten- - sions. + o A new driver for ASPEED Technologies' AST2000 graphics chips. 3.2.2 ati - o Fix various bugs in the Mach64-based panel support. + o Reinstate support for all ATI adapters on all architectures supported by + the XFree86 common layer. + + o Restore accuracy of atimisc's clock probe despite certain I/O errors. + + o Change the atimisc driver on big-endian systems to allow depth 24 even + if the big-endian aperture is not available, by swapping RGB masks. + + o Fix an ATI driver probe crash. + + o Workaround for screen-to-screen copy corruption in second-generation + integrated controllers. - o Re-instate atimisc's support for DGA on UltraSPARC platforms. + o Improve accuracy of atmisc's calculations that are based on a 29.5 MHz + reference clock. -3.2.3 chips + o Chrontel 8398 related changes to the Mach64 support. - o Fix the stretching option and centering. + o Fix one cause of video memory corruption when using XAA with second gen- + eration integrated Mach64 controllers. -3.2.4 cirrus +3.2.3 glint - o Add support for the NEC PC-9821 with CLGD755x. + o Fix the size of the DAC registers storage for pm2v and pm3 chipsets. + +3.2.4 i740 + + o Save and restore more of the mode on server entry. 3.2.5 i810 - o Add support for memory size tweaking in the BIOS for 845G. + o Make sure the DDC-probed parameters are applied before modes are + selected. + + o Fix some bad alignment problems when allocating memory from the end of + AGP space. - o Fix Xv flickering on the 830GM and later. + o Adjust the display width according to the VESA BIOS scanline require- + ments. - o Add support for the 915G/915GM chipsets. + o Add support for the Intel E7221 server chipset. - o Add dual-head and clone support for the 915G, 855GM, 830GM chipsets. + o Improve display switching support for mobile chipsets using the Fn+F? + combination keys. - o Add ARGB cursor support for all chipsets. This requires an updated agp- - gart kernel driver. + o Add DirectColor support for the i830 and later. - o Add module lid status checking. + o Add gamma correction support for the i830 and later. - o Fix XVideo when high resolutions are used on local flat panels. + o Add rotation support for the i830 and later. - o Add PanelID identification. + o Improve refresh rate selection for custom modelines. - o Detect monitor changes on VT switch (830GM and up). + o Add support for the 945G and 945GM. o Support custom video modes in the video BIOS, when available. - o Fix some Xv bugs. + o Fix some offset, pitch, and overlay scaler size problems with the video + overlay. This solves various spontaneous lockups. - o Set the default monitor parameters to match the display size for the - 830GM and up when they are not available from another source, improving - the default video mode selection in these cases. + o Fix text restoration when display switching has been activated. -3.2.6 mga + o Add support to check the built-in VESA mode list. + + o Fix XVideo when operating in one line mode and video is pushed off the + top of the screen, and fix some XVideo skew problems at certain resolu- + tions. - o Make the Mystique lockup workaround more selective, avoiding different - problems on cards that do not require the workaround. + o Sync the accelerator before calling AdjustFrame to avoid lockups. - o Fix segfaults that occur when the XaaNoSolidFillRect and/or - XaaNoMono8x8PatternFillRect options are used. + o Fix a lockup when spend and resume when playing video (shutdown the + overlay on LeaveVT). - o Fix for Xv resolution loss problem. + o Support 1920x1088 for HDTV movies using a new option (LinearAlloc) to + add more memory for the video overlay. - o Add i2c and Maven support, providing DDC and DPMS support for the second - head on dual-head cards. + o Add ACPI hotkey switching support. + +3.2.6 mga + + o Reduce the Mystique's SYSCLK from 197 MHz to 166 MHz, allowing the + higher clock to still be used when the "OverclockMem" option is acti- + vated. This fixes the instability seen on some Mystique cards, and + removes the need for the workaround in previous releases. + + o Revert the HALlib MGASetDisplayStart interface back to HALSetDis- + playStart. + + o Make 8+24 mode honour the default visual. 3.2.7 nv - o PCI-Xpress support added. + o Some of the panel DPMS support in 4.5.0 only works for TMDS, and caused + some panel blooming on some LVDS panels, so skip the DPMS panel code + when the panel is LVDS. - o Add support for newer hardware. + o Add DPMS support for GeForce4 and newer laptops. - o Workaround for Toshiba M30 laptop issue. + o Fix some console restore code for the NV11. - o Reject modes larger than the flat panel. + o Workaround for 512MB video cards (can only map 256MB of it). - o DPMS support for DVI added. + o Fix a graphics acceleration hang that occurred on some NVIDIA GeForce + 6xxx cards. - o Cursor update for NV11 so that alpha blended cursors will work in con- - junction with dithering (laptop panels). + o Fix a potential problem with pixmap cache corruption on GeForce 6xxx and + 7xxx parts. -3.2.8 r128 + o Add support for new hardware. - o Improve the handling of timeouts in R128CCEWaitForIdle() +3.2.8 siliconmotion -3.2.9 radeon + o Merge in support for SiliconMotion's SM501 controller. - o The DAC is turned off for DPMS modes, fixing a problem that can badly - affect some monitors. +3.2.9 suncg6 - o Add an option for avoid flickering and blank screen problems with - iBooks. + o Add screen-to-screen copy, solid fill, and CPU-to-screen colour expan- + sion acceleration. -3.2.10 rendition + o Map more of a Sun CG6's video memory for use by the pixmap cache. - o Fix bad free() calls in the probe function. +3.2.10 sunffb -3.2.11 s3 + o Prevent turning off the FPU on NetBSD. - o Add support for interlaced video modes. + o Fix build problems on NetBSD (global register usage declaration, and + increase stack usage). - o Remove cfb support. + o Workaround for VRAM corruption when unblanking FFB1 adapters. - o Correct the depth checking (32 is not a supported depth). +3.2.11 tdfx - o Fix DAC probing. + o Add DDC2 support. - o Add IBM RGB525 support. +3.2.12 trident - o Fix a ScreenToScreenCopy bug that shows up with xtest. + o Do not wait for vertical retrace on PC98 systems. -3.2.12 s3virge + o Fix an offset problem in Xv for the Cyber9397 and later chipsets. - o Fix a bug that shows up when mode restoration results in a switch - between colour and mono operation. + o Add XGI (Trident) Volari XP5 support to the trident driver. -3.2.13 savage +3.2.13 via - o Fix HW cursor state on VT switching. + o Add a "ConnectedDevice" option to the via driver to force selection of + output devices. - o Disable the RANDR extension when using rotation. +3.2.14 vmware - o Turn off the back light on panels when DPMS "off" mode is activated. + o Implement a workaround in the generic int10 module to allow unaligned + I/O access specific to VMWare's second generation emulated adapter. - o Allow black as an Xv colour key. +3.2.15 xgi -3.2.14 sis + o A new driver for the Volari V3XT, V5, V8, Z7 chipsets. - o Fix some modes for 1400x1050 and 1600x1200 panels. +3.3 Input Driver Enhancements - o BIOS data layout-related fixes for 661/741/760. +3.3.1 keyboard - o Xv fixes. + o Ignore KEY_UNUSED scancodes. - o Fix LCD support for ECS A90x and ECS A907. +3.3.2 mouse - o Add video blitter as a second Xv adaptor for the M650/651 and later. + o Fix auto-detection of Sun mice on Linux/SPARC. - o Add (display?) hot plug support. +3.3.3 magictouch - o Add preliminary support for the SiS340. + o Port of the magictouch driver to XFree86 4.x. - o Fix bad external symbols in this driver module. +3.4 XKB updates -3.2.15 sunffb + o Replace the macintosh/fr map with the "fr_new" map, release 4. - o Fix a segfault when acceleration is disabled. + o Fix a bug in XKB group adjustment. -3.2.16 vesa + o Fix off-by-one errors in XKBMalloc.c. - o Do not attempt to set the palette format for depths greater than 8. - This fixes a problem on some platforms. + o Shrink tables instead of only growing them. - o Fix a substantial memory leak on server regeneration. + o Fix various vmodmap vs modmap cut and paste bugs. - o Fix screen blanking for non-VGA compatible modes. + o Improve synthesized core X events for reporting XKB changes to XKB- + unaware clients. - o Blank the screen at startup, so that the contents of the previous ses- - sion are not initially visible. + o Fix a setxkbmap segfault. -3.2.17 via + o Add Eszett (ssharp) to the us_intl map. - o Restructuring and acceleration cleanups. + o Add dvorak_intl map. - o Fix some DRM-related problems. + o Add a Khmer layout. - o Cleanup the DDC/EDID retrieval. + o Add multimedia keysyms for the Inspiron 6000 laptop to the "inspiron" + set. -3.2.18 vmware +3.5 X Server and Extension Updates - o Various register state save/restore fixes. + o Updates to the handling of the X server RGB database: - o Fix host-cursor mode. + o Ignore white space, dash, and underscore characters, as well as + case when matching colour names, and remove the unnecessary dupli- + cates in rgb.txt. - o Allow any reasonable depth if 8BIT_EMULATION is set, supporting non-host - depths. + o Allow a copy of the RGB database to be included into the X servers + as a fallback for when the rgb.txt file cannot be found. - o Set the "monitor" parameters to allow the default resolution to be a - little smaller than the host resolution rather than simply 640x480. + o Remove the (unused) support for DBM-compiled RGB database files. -3.3 Input Driver Enhancements + o Make the AMD64/x86_64 platform tests consistent throughout. -3.3.1 keyboard + o Rework the way that extension support is built into the servers to allow + for servers with different sets of extensions in the same build. This + includes minimising the number of pervasive extensions, and adding DIX + helpers for extensions such as Xinerama and XCSECURITY. - o A bug in the application of the Linux KDKBDREP ioctl has been fixed, - preventing unnecessary use of a fallback that directly programs the key- - board hardware and produces warning message with recent Linux kernels. + o Modify the X server handling of SIGINT to provide a faster exit path + than SIGTERM, while ensuring that all hardware state gets restored. + This change is used by xinit as a cleaner alternative to using SIGKILL + for a slowly exiting server. - o Differentiate between Alt+Ctrl+SPECIAL and Alt+Ctrl+Shift+SPECIAL key - sequences. +3.5.1 Loader - o Avoid various keycode conversions on NEC PC-98 platforms. + o Add support for relocation type 10 for Alpha to the ELF loader. - o Fix off-by-one problem for keys on FreeBSD/sparc64. + o Fix issues with Linux/SPARC 2.6 kernels. -3.3.2 mouse + o Add loader infrastructure to implement inter-module version checks. - o Add a serial PNP entry for the Genius NetScroll+ mouse. + o Use mprotect on NetBSD. - o Fix a problem with the wsmouse driver losing events on 64-bit architec- - tures. + o Fix support for NetBSD/arm. - o Add/improve protocol and device auto-detection for FreeBSD, Linux, - NetBSD, OpenBSD, and SunOS/Solaris, eliminating the need to provide any - of this information in the config file in the majority of situations. + o Add support for R_SPARC_OLO10 relocations. - o Increase the maximum number of buttons supported from 12 to 24. + o Make error messages for unsupported relocations more useful. - o Fix a multiple-free bug, that could lead to a crash. + o Improve the loader server's emulation of shmctl() calls. -3.3.3 elographics + o Fix some problems with the a.out header macros used by the loader, which + was causing incorrect header interpretation for some a.out object types. - o Fix problems where the driver gets out of sync under heavy loads. + o Major loader enhancements, including: - o Add an "AllowNoCntl" option, which allows the driver to be used with - some other protocols, like the SmartSet 2500s, which share the same - default protocol. + o Per-module export symbol lists. - o Fix a problem with the cursor not correctly following the touch in a - dual-head configuration. This fix has also been applied to other rele- - vant input drivers. + o Improved symbol hash. -3.3.4 eloinput + o A mechanism for specifying the scope of symbols. - o A new driver for ELO Graphics 2500U USB touch screens. + o Keep track of relocations, and undo them when they become unre- + solved on module unload, and recalculate them when they change on + module load. -3.3.5 fpit + o Check relocations on each module load/unload, ensuring that func- + tion references that are unresolved at any time are always mapped + to the catch-all function, preventing calls into nowhere. - o Add support for the passive pen of the Stylistic 2400. + o Efficient handling of invariant relocations. - o Fix some driver bugs. + o Cleanup/update the memleak stack trace code, and print a stack + trace when an unresolved function is called or when XFree86 aborts. -3.4 XKB updates + o Update the catch-all function to identify the unresolved function + that was called. - o Update the Hindi/Devanagari map. + o Read the XFree86 executable's symbol table in order to get the most + useful stack traces, and use dladdr() where available for identify- + ing shared library references. - o Add Sorbian map. + o Cleanup and unify debug messages for the loader components. - o Add German Dvorak map. + o Use module-instance-specific referenced and required symbol lists. - o Fix wrong brokenbar keysym in the de_CH map. + o Update drivers to make use of some of the new loader functionality, + including the instance-specific ref/req lists, and some unloading + of modules when they are no longer needed. - o Rename the microsoftprose keyboard model to microsoftprousb because it - is not Swedish-specific but a common USB variant. + o Don't build the coff loader on platforms that it doesn't support. - o Add nodeadkeys variant to the gb map. + o Use stronger typing of the module-visible instance-specific module + descriptor. - o Replace the comma keysym on the KPDL key in the Brazilian map with - KP_Separator. + o No longer disable xf86UnloadSubModule() since the loader now han- + dles unloads and reloads cleanly. - o Add multi-layout compatible Hungarian, Azerbaijani, Canadian, Mongolian, - and Vietnamese maps. + o Do not defer unloading drivers when using autoconfig, since that is + not necessary with the loader updates. - o Update Serbian map with new variant. +3.5.2 XFree86 core server and modules - o Add Genius KB-12e model to the inet map. + o Modify the handling of preferred EDID modes to allow user-specified + modes that are larger than the preferred mode. - o Update ABNT2 geometry (including two variants) and change the Brazilian - map to avoid ABNT2 specific keycodes section. + o Refine VGA routing emulation through Sun's Simba P2P bridges. - o Add Classical Latin map. + o Allow a static server's -configure to generate an XF86Config for the + loader server. - o Replace the Latvian map with a new one. + o Fix a bug relating to the forwarding of 64-bit memory addresses by PCI- + to-PCI bridges on 32-bit systems. - o Fix some errors in the Dzongka/Tibetan map. + o Fix a bug in the decoding of I/O forwarding by Cardbus bridges. - o Add ur_PK (Urdu) map. + o Update -configure to detect when wscons support should be used for the + keyboard on NetBSD. - o Fixes for the Bengali map. + o Fix an endianness bug in the xf4bpp module. - o Add Sinhala (Sri Lanka) map. + o Fix some of the endianness bugs in the vbe module. - o Add missing keycode to the "xfree86" keycodes files. + o Remove obsolete VBE functions that have not been compiled-in for some + time. - o Update the mapping for the Microsoft Natural Multimedia keyboard. + o Fix VBE's reporting of video memory size. - o Fixes for the Croatian map. + o Re-implement Alpha kludge in x86emu's ops.c to be more portable. - o Add a Polish variant to the French keyboard layout. + o Intercept "raw" requests for PCI configuration space from video BIOSes + on all architectures. - o Add a standard Kyrgyz map. + o Handle unaligned I/O requests more gracefully and be more tolerant of + spurious I/O errors in the int10 module. -3.5 X Server and Extension Updates + o Make sparse I/O masks more portable throughout the server. - o Mesa as used in the XFree86 "GLcore" module for indirect GLX rendering - has been updated to version 6.2.1. + o Fix a long-standing off-by-one bug in the setting of RGB offsets when + the driver supplies RGB masks. - o Fixed bugs in the Screen Saver extension that could cause an X server - crash. + o Make I/O error handling more reliable on SPARC. - o Fixed a bug in the X-Resource extension that could cause an X server - crash when the client host and server host have different endianness. + o Change the OS-specific module subdirectory name for all SunOS variants + from "solaris" to "sunos". - o Added support to the Xvfb server for specifying the screen origins when - Xinerama is enabled. + o Port of SBUS drivers to SunOS variants. This also allows for multihead + using a mix of SBUS and PCI devices. - o Ensure that the Xvfb's root window depth and visuals are set correctly. + o Fix text mode restore on x86/Solaris 8 and later. - o Work around bug in Mac OS X 10.1's AppKit that causes rootless XDarwin - to lock up when creating windows + o Change autoconfiguration to include PCI and SBUS BusIDs in generated + device sections. This fixes some problems when fbdev is active. - o Fix XDarwin's launch of X clients by double clicking in the Finder when - there is a space in the path. + o Prevent the sharing of a PCI entity by more than one driver. - o Allow XDarwin to interpret scroll wheel mouse events correctly when the - shift key is held down. + o Insulate various common layer functions against out-of-bounds entity + indices. - o Add initial XInput support for XDarwin. + o Fix XAA's support for TRIPLE_BITS_24BPP on big-endian systems. - o Add an option for XDarwin to always use Mac command key equivalents. + o Fix unaligned access in XAA's handling of 24bpp. - o Make XDarwin not default to StaticColor on ix86. + o The xf24_32bpp module is no longer used by any of our drivers, so don't + include it in static builds. - o Fix a bug that caused restacks to be optimized away in rootless mode. + o The xf8_32wid module is only used by the sunffb driver, so don't include + it in non-SPARC static builds. - o Add support for dynamic screen configuration changes in rootless XDar- - win. + o Fix generic int10 memory accesses on little-endian systems. - o Fix a problem with multiple glyphs in the RENDER extension's RenderAddG- - lyphs that caused malloc corruption. + o Fix a SEGV that can occur under certain builds of glibc 2.3.4 and up, + when linux/int10 attempts to determine kernel support for the vm86() + system call. - o Fix a segfault when XAA's overlay acceleration is invoked with the - XaaNoSolidFillRect option. + o Add an xf86DeallocateGARTMemory() function. - o Fix the disabling of individual DPMS states. + o Make autoconfig stop at the first successful probe on each retry, min- + imising unnecessary probes. - o Rework the XFree86 server's SBUS code so that SBUS adapters are properly - detected on SunOS. +3.5.3 TinyX - o Auto-detect DPMS support based on EDID data. + o Allow build-time selection of which font renderers get built in to the + TinyX servers. - o Fix DPMS enable/disable logic. + o Fix a problem where VT switching back to TinyX servers was failing due + to blocking on keyboard read. - o Allow multiple probe phases when using automatic configuration, which - allows the driver search to continue after failures at the PreInit - stage. + o Fix a TinyX build issue under !XserverStaticFontLib. - o Update the static XFree86 driver list to allow automatic configuration - to work with statically linked XFree86 servers. + o Move Xserver/*/tiny directories under Xserver/hw/tinyx. - o Add a '-autoconfig' command line option to the XFree86 server to enable - automatic configuration even when a configuration file is present. + o TinyX build fixes. - o Integrate the TinyX servers into the standard XFree86 build. +3.5.4 Xnest - o Fix a problem where a big request length of zero does not generate a - BadLength error. + o Add a "-noinput" option that allows Xnest to be run in a view-only mode. - o Add a Distributed Multihead X server (DMX) and related extension. +3.5.5 Xsun - o Fix a segfault in the cfb module. + o Fix incorrect bitsPerPixel for depth 12 in pixmap formats advertised by + the Xsun24 server. - o Fixes for the MIT-SHM extension's Xineramafication. +3.5.6 cfb - o Fix detection of phantom PCI devices. + o Fix a bug that occurs when using cfb to tile 32-bit rectangles on SPARC. - o Fix x86emu's handling of the 0xe8 and 0xe9 opcodes. + o cfb24 is no longer needed. Keep the loadable module, but no longer + statically link it into servers. - o Modify x86emu's handling of SHLD/SHRD instructions to allow shifts - greater than 15 for 16-bit operands. This undocumented behaviour is - expected by the BIOS in an SM722 controller. +3.5.7 shadow - o Avoid some references to unloaded data in the XFree86 server, which can - cause crashes in some situations. + o Rewrite shadowUpdateRotatePacked() to reduce cache misses. - o Change the DDC/EDID root window property data from signed to unsigned. +3.5.8 Xinerama - o Fix the XFree86-Misc extension's PassMessage function. + o Cause the server to FatalError() when Xinerama attempts to create a + screen whose root depth has no visuals, causing Xlib to segfault. - o Fix XFree86-DGA for multi-domain architectures. + o Allow Xinerama to initialise even when there is only one screen to com- + bine. - o Extend the XF86Config format and parser/config to allow multiple Monitor - sections to be referenced from a Screen section. + o Make loadable modules and MI independent of Xinerama: - o Allow multiple XFree86 configuration sources to be combined, and add a - -appendauto" command line option to allow automatic configuration data - to be appended to a partial static configuration. + o Add a DIX helper to determine whether Xinerama is active and use it + instead of #ifdef's code in all loadable modules. - o Extend the XF86Config format and parser/config to allow multiple Server- - Flags, Files, and Module sections in a config file. + o Re-implement, as a screen wrapper, Xinerama's PaintWindow*() hacks. - o Use a more complete set of the probed EDID data in determining the - default monitor parameters. + o Move down to DIX Xinerama's only MI hook. - o Add a "preferred" video mode type, which can be obtained from the probed - EDID information, or from the static configuration. This allows the - native video mode to be used by default for digital panels. +3.5.9 XFree86-DGA - o Add tentative support for newer iterations of HP's zx1 chipsets. + o Do not call a screen's PointerMoved entry if a DGA mode is active on + that screen. - o Fix xf86fbman's largest linear area offscreen computation. + o Fix client-side framebuffer mapping on NetBSD. - o Print the XFree86 server's command line in the log file. + o Make sure that DGAShutdown() is always called before HW state is + restored on exit and reset, and make sure that it is not called after + the HW state has been restored. - o Update getconfig to work with older versions of Perl, and to detect when - the version of Perl is too old and when Perl is not available. +3.5.10 Render - o Extend automatic configuration and getconfig to work with SBUS video - devices in SPARC platforms. + o Fix unaligned access in RenderCompositeGlyphs request. - o Update the ValidMode functions in most video drivers to return more spe- - cific status values when a mode is rejected. +3.5.11 RandR -3.6 Client and Library Updates + o Use xf86SetViewport as well as SetCursorPosition during RandR rotation, + as xf86SetViewport will call AdjustFrame to reposition the window if + necessary and avoid the cursor ending up off screen. -3.6.1 Xlib and related libraries + o Add a new function xf86GetRotation() to allow third party modules to + obtain the current rotation. - o Fix an Xlib segfault that may occur when IPv6 XDM-AUTHORIZATION-1 data - is present in the .Xauthority file. + o Fix up error case when rotation fails and the framebuffer needs to be + re-enabled. - o Add WrapHelp.c and enable XdmAuth by default. +3.6 Library, Client and Utility Updates - o Fix a null dereference in libSM when given a bad previous session ID. +3.6.1 Xlib -3.6.2 Xterm + o Fix typos in XErrorDB that were preventing descriptive messages for some + extension errors. -The changes to xterm since XFree86 4.4 are: +3.6.2 Xt -Improved behavior + o Fix an uninitialised pointer dereference in Xt/Initialize.c on WIN32 + platforms that happens if $HOME is set in the environment. - o Change resource settings for color4 and color12, add some discussion in - XTerm-col.ad. + o Add support to Xt's string to float converter to read resources in frac- + tional notation. - o Modify the criteria for disowning primary selection. Previously, this - happened anytime the cursor was moved before the end of the selection. - That would ensure that any insert/delete of char or line, as well as - scrolling, would disown the selection. The new criteria change this to - checking if the operations would modify the data which is highlighted. + o Add some XChar2b string manipulation functions to Xt. - o Change default translations so a BtnDown which is not recognized is sim- - ply ignored rather than emitting a bell. That makes it less obtrusive - when the user tries to use a mouse which provides more capabilities than - the X mouse driver supports, e.g., one with a horizontal scroll wheel. + o Bump the minor revision of the Xt shared library to reflect the fact + that some new interfaces have been added. - o Modify to allow turning UTF-8 mode via escape sequence even if -wc - option was not given at startup. +3.6.3 Xaw - o Add menu items and corresponding actions for switching on/off the UTF-8 - mode and Xft (TrueType) support. + o Extend the tool tip resource for Xaw's simpleWidgetClass to allow a + function to be called - o Modify FreeType support to allow resizing the font, in the same ways the - window can be resized if fixed fonts are used. The relative font sizes - are derived from the fixed font sizes. + o Fix problems with Xaw's label widget when using XChar2b strings. - o Implement blinking text, using the timer for blinking cursor. + o Add a new connectionType property to Xaw's tree widget. - o Add translation to ASCII of commonly-used characters that groff trans- - lates to Unicode, when the font in use does not provide the correspond- - ing glyphs. + o Make Xaw Form widgets inherit dimensions from their parent at widget + initialisation time. - o Modify constraints in form used to layout toolbar, to work with newer - Xaw in XFree86 4.x. + o Add mouse wheel support for Scrollbars in Xaw's Viewport widget. - o Make active-icon work properly when TrueType fonts are used, as well as - when UTF-8 mode is used. + o Fix a performance issue with Xaw's Tree widget caused by useless relay- + outs. - o Improve rendering for Xft, allow it to draw non-linedrawing characters - such as "pi", which were drawn from internal tables with patch #180. + o Fix i18n for Xaw's tooltip widget. - o Modify initialization of 256- and 88-colors so that colors beyond 16 are - normally not X resources. This works around a hard-coded limit in Xt - which breaks xterm when 256-colors and luit are both configured (report - by Noah Friedman). + o Add two new functions that can be used to scroll the content of an Xaw + viewport from outside the viewportWidgetClass. - o Fix problem responding to session management events, e.g., which would - make logging out very slow. + o Fix the cursor in Xaw textWidget when the input field has focus. -Modified behavior + o Bump the minor revision of the Xaw shared library to reflect the fact + that some new interfaces have been added. - o Enable utmpx support for NetBSD 1.6C and newer. + o Add user_data field to Xaw's simpleWidgetClass. - o Modify Help() to make "xterm -h" write to standard output rather than - standard error. + o Fix Xaw viewport scrollbar flickering problem. - o Improve error-reporting for root user by checking if $DISPLAY is set - rather than using the useless message from X11 library. +3.6.4 pswrap - o Improve $WINDOWID for configuration with toolbar by making it refer to - the top-level shell rather than the parent of the current window. For - that case, the parent is a form widget, which does not have a name, - which made the $WINDOWID not very useful as a parameter for xwininfo. + o Fix a problem where pswrap generates a bogus .c file when the -h option + is not used. - o Improve pattern used in uxterm to check for UTF-8 locale, e.g., for - HPUX. + o Document pswrap's -f option. - o Modify uxterm script to use locale program to verify if the derived - locale is installed. +3.6.5 mmapr, mmapw - o Add case to uxterm to accommodate locales ending with "@euro", e.g., - fr_FR.UTF-8@euro. + o Extend mmapr and mmapw on Linux to allow specification of which PCI + address space (I/O or memory) to mmap. - o For Linux, if IUTF8 is defined, e.g., on recent 2.6.x kernels, set the - corresponding flag for the slave pty, to enable UTF-8 interpretation of - backspace in cooked mode. + o Add options to mmapr and mmapw to allow unaligned accesses for testing + purposes - o Modify faceSize resource to use a floating-point internal value. +3.6.6 cpconfig - o Modify XTerm.ad to set saveLines default to 1024. + o Use the same default XF86Config search path as the XFree86 server. - o Change xterm version string to use __vendorversion__ where that is - available, and "XTerm" otherwise. Rather than reporting the version of - X that was current when xterm was modified, it reports the version - against which it was built. +3.6.7 xterm -New resource settings +These changes correspond to xterm patches #200 through #212. - o Add scoFunctionKeys resource, to match manpage. + o Improved behavior - o Add -fd option and resource faceNameDoublesize to specify double-wide - fonts with Xft. + o add a new selection feature: regular expressions, and new + resources which specify what happens on multiple mouse clicks: + on2Clicks, on3Clicks, on4Clicks and on5Clicks. - o Add resource showMissingGlyphs to outline places on the screen where a - font lacks the corresponding glyph. + o improve initialization of toolbar so that individual pulldown menus + are initialized on demand, as they are in the scenario where they + are invoked as popup menus. - o Add resource showBlinkAsBold to control whether blinking text should be - shown as bold or actual blinking text. + o improve error-reporting when chown/chmod of the pseudo-terminal + fails, e.g., if a copy of xterm which was designed to work with + old-style pseudo-terminals is not installed setuid or setgid. - o Add utmpDisplayId resource to allow users to control whether the display - identifier (display number and screen number) are retained in the con- - nection information recorded in utmp. + o add support for interpreting the underline attribute as an italic + font in Xft mode. - o Add bellOnReset resource to allow users to disable bell which sounds on - hard reset since patch #183 changes to DECSCL. + o modify configure script --disable-imake to use the script's defini- + tions anyway if it cannot detect imake. -New configure script options + o improve resource files to show how the menubar and popup menus can + be colored. - o Add --disable-setuid option to configure script. + o modify initialization of allowSendEvents and allowWindowOps to pre- + vent modification with the editres protocol. - o Add --disable-full-tgetent option to configure script, allowing one to - ignore a termcap library in favor of ncurses/curses. + o improved some of the built-in line-drawing glyphs. -Other new features + o set the _NET_WM_PID property. - o Add mini-luit feature, which supports Latin9 directly rather than via - luit, provided that Unicode fonts are used. + o update table for mk_width() from UnicodeData 4.1.0. - o Add dynamic abbreviation support like Emacs. + o implement the remaining pieces to make xterm allocate cells for + wide-characters when the "UTF-8" menu entry is selected. Also, + load the UTF-8 font when that menu entry is selected, or the escape + sequence for UTF-8 mode is received : - o Add "erase2" and "eol2" keywords to ttyModes resource, for recent/cur- - rent FreeBSD. + o improve behavior when switching to UTF-8 mode after startup so + xterm will check if the current fonts are already wide + (ISO-10646-1). If they are not, xterm will use the utf8Fonts sub- + resource to load appropriate fonts. -Bug-fixes (see http://invisible-island.net/xterm/xterm.log.html for a more -complete list): + o modify initialization for wide-bold fontname, to search for one if + none is given. - o Modify initialization and cleanup of utmp data to also compare the - ut_line member. + o modify interaction between +u8 and locale resource to allow the + command-line option to override the resource. - o Correct table entry for DEL in the ground state, which marked it as a - printable character from patch #171. + o modify initialization to decide whether to default to built-in + wcwidth() versus system's version based on the starting locale and + whether the system's version is poor quality. - o Correct change from patch #157 which uses getlogin() to check for an - alias; the storage used for the related getpwuid() call was overwritten - by the data used for comparison. + o make paste of UTF-8 faster for Western character sets by checking + range of incoming data. - o Correct case of SCS for character set 0 (line-drawing) to allow it to be - selected into GR. + o improve initialization due to utf8 resource by loading the + utf8Fonts resource in the case where locale resource is false. + Also in this case, do not disable switching UTF-8 mode on/off. - o Modify creat_as() to only fork if xterm is actually running as setuid - and/or setgid. This works around a Cygwin bug which hangs when logging - is enabled and makes xterm a little faster for systems using interfaces - such as utempter. + o Modified behavior - o Modify Cleanup() to avoid operations such as X calls that might use - unsafe functions when it is called by a signal handler. + o modify parsing of OSC (and SOS, etc), strings so their contents are + not interpreted as UTF-8. This allows non-ASCII title strings to + be set, provided that the window manager complies. - o Check for type of failure in xim_real_init() to avoid looping when the - problem is an unsupported input method rather than a failure to connect - to the XIM server. Problem was introduced in patch #175. + o modify parsing of control sequence CSI T to allow scroll-down to be + sent while mouse tracking is enabled. - o Add missing #undef OPT_SESSION_MGT to xtermcfg.hin to make the configure - script's --disable-session-mgt option work. + o modify command-processing to accept an optional parameter that + tells xterm which shell program to use. - o Correct options parsing for -into option so it can be combined with -e. + o change xterm manpage to show the actual color resource names XtDe- + faultForeground and XtDefaultBackground rather than black and + white. - o Make escape sequence reporting dynamic colors consistent with the logic - that sets it; choosing the opposite color when reverse video is set. + o modify xterm-new terminfo entry to use capabilities for shifted + scroll forward/reverse as shifted cursor up/down. - o Fix a repainting bug introduced in patch #180: when using a font lack- - ing line-drawing characters, a repaint of the screen could skip horizon- - tally an extra amount after filling in the missing character. + o remove menu entry for "Enable Curses Emulation" (to make room for + "Select To Clipboard"). - o Modify terminfo to accommodate luit, which relies on G1 being used via - an ISO-2022 escape sequence. Note that this relies in turn on bug fixes - in ncurses after the 5.4 release. + o modify resource files to make the font-resources a little more spe- + cific, e.g., changing "*VT100*" to "*VT100.", to make the distinc- + tion between VT100.font and VT100.utf8Fonts.font sharper, in case a + packager modifies one of those. -3.6.3 Luit + o allow cursor to have the same color as foreground (text), since it + is rendered as reverse. - o Fix a synchronization problem with luit's handling of tty settings. + o modify Imakefile to use setgid mode for installing with Linux, + OpenBSD and FreeBSD. - o Extract information from the pty before forking rather than after, to - avoid conflicting with the child process's modifications to the line. + o New resource settings -3.6.4 GLX/DRI + o add utf8Title resource and menu entry, allowing the user to control + whether title strings are interpreted as ISO-8859-1 or UTF-8 encod- + ing. - o Mesa and its DRI drivers have been updated to version 6.2.1, plus some - bug fixes. + o add scrollBarBorder resource. - o Add a 915G DRI driver. + o add resource selectToClipboard, action set-select and a menu entry + to allow users to switch between PRIMARY and CLIPBOARD for + select/paste. - o Fix a GLX multi-thread bug. + o add resource mkWidth and command-line option -mk_width to control + whether xterm uses the built-in version of wcwidth(). -3.6.5 twm + o add resource settings for minimum/maximum input buffer size, and + call to sched_yield to improve performance with newer Linux kernels - o Add support for XPM icons. + o add simpler resource keyboardType which, when set, overrides the + individual keyboard-type resources and eliminates the possibility + of conflict between them. - o Add IconMaxWidth and TitleIndent configuration parameters. + o New configure script options -3.6.6 xdm + o the --with-utmp-setgid allows the packager to configure xterm to + use setgid permissions for utmp. - o Improve the operation of IPv6-enabled xdm when the platforms's IPv6 sup- - port is disabled. + o add configure option --enable-readline-mouse, which turns on the + experimental OPT_READLINE code. - o Make use of Xlib's _XGetHostname rather than attempting to duplicate it. + o add --enable-narrowproto configure option to accommodate X.org + "modular" build. - o Fix sessreg for NetBSD. + o add configure --with-app-defaults option to allow app-defaults + directory for install-rules to be customized. - o Update docs and config to handle authDir being in a non-default loca- - tion. + o add configure option --with-tty-group to help work around deficien- + cies in packager's build environment. -3.6.7 xfs + o add configure --with-setuid and --with-reference options to allow + packagers more flexibility in customizing install permissions. - o Fix log file opening with the '-user nobody' option. + o add configure --with-symlink option to make it simpler to install + successive versions of xterm renamed using the --program-prefix, + etc., options with a symbolic link pointing to the most recent. -3.7 I18n and Fonts + o add a configure check for the actual path of luit, to work around + broken imake configurations. - o FreeType has been updated to version 2.1.8. + o add a configure check for pkg-config. - o The FreeType-1.x based X-TrueType XFree86 server font backend has been - retired. The functionality it provides is now available in the - "FreeType" font backend. The old "xtt" module is now a wrapper that - loads the "freetype" module. + o modify install rule for uxterm to account for the --program-prefix, + etc., options by invoking the transformed name of xterm rather than + simply "xterm". - o A bug that prevented the VeraIt.ttf font from being installed has been - fixed. + o modify configure --with-app-defaults option to allow --without-app- + defaults. - o Fix a problem that could cause apps using the zh_CN.UTF-8 locale to - crash. + o add configure option --disable-leaks. - o Fix freetype module segfault with some Type1 fonts. + o add experimental option to allow applications to get or set the + selection data as a BASE64 string. - o Replace unicode keysyms in the en_US.UTF-8 Compose file with "tradi- - tional" ones where such keysyms exist. + o Other new features - o Fix the ct_encoding sequence in the zh_CN.gbk locale. + o add select-cursor-extend() action. - o Update the 8859-7 unicode conversion data file to the current version. + o add environment variables $XTERM_SHELL and $XTERM_VERSION. - o Update the gb3212.1980-0 encoding to handle fonts that do not have a - unicode table. + o add menu entry (alt-esc) and corresponding action (alt-sends-esc) + to toggle the eightBitInput resource setting. - o Add encoding files for cns11643-1, cns11643-2, cns11643-3, and - suneu_greek. + o add command-line options (-tb, +tb) and resource toolBar to allow + menu/toolbar to disabled or enabled at startup. - o Add support for the si_LK.UTF-8 locale. + o add extended shift- and control-modifier cursor keys to + "xterm+pcfkeys" terminfo entry to correspond to ncurses 20050430 + patch. - o Reinstate the original mkfontdir program, because its mkfontscale equiv- - alent does not handle creating encodings.dir files as well as is neces- - sary. + o enable lastlogx support for NetBSD (was added, but not enabled in + patch #186). - o Fix for fstobdf generating corrupted BDF files. + o Bug-fixes (see http://invisible-island.net/xterm/xterm.log.html for a + more complete list): - o Update locale info for Kinyarwanda, the language of Rwanda. + o correct typo in configure script's --enable-dec-locator option - o Add nine missing South African locales. + o correct a typo in CF_FUNC_TGETENT introduced in patch #198 fix - o Add extra fontset records into XLC_LOCALE, fixing problems with text - output by Xuft8 functions under non-Unicode locales. + o fix an off-by-one error parsing -S/nn option. - o Add a Kyrgyz locale. + o add a check in Bell to ensure that the VT100 widget is realized, + since it may be called by xtermLoadFont given an incorrect font + resource. -3.8 OS Support Updates + o correct treatment of iconBorderWidth for resizing an active-icon, + and its description in manpage. + + o add a limit check for scrolling margins in a one-line screen, over- + looked in fixes for patch #198. + + o correct computation of width for wide characters with the invisible + attribute. + + o improve fix from patch #198 for Cleanup() by ensuring it is not + called from the SIGCHLD handler. + + o fixes to make -geom option work properly with the toolbar configu- + ration. + + o fix logic in find_utmp, which did not reset result in getutid(), + causing an infinite loop in some conditions. + + o fix a rare case where text would be written with the wrong colors + because output of scrolled text would reset the colors and the new + text would be written with the same colors. + + o implement logic in termcap query to process multiple parameters as + documented in ctlseqs.ms + + o fix buffer size used for termcap query, which was not long enough + for the terminfo "colors" name. + + o initialize the saved-cursor data so a restore-cursor operation + without a preceding save-cursor operation will not modify the fore- + ground color. + + o modify Imakefile to work around old problems in imake configuration + to allow test-builds using xmkmf on Linux. (This was not noticed + since several releases had broken definitions relating to Xft which + were harder to work around). + + o remove default translations for dabbrev-expand() due to conflicts + with existing keyboard arrangements. + + o set icon border width explicitly to work around fvwm problem with + active icon resizing. + + o eliminate a retry for a better-matching bold font, to work around + recent font server changes. + + o modify prefix/suffix transformation in makefile to make uxterm + install properly on Cygwin. + + o correct termcap "me" (mode-end) string so it does not modify the + alternate character set. + + o modify computation of rows/columns on resize to avoid extending + beyond the given limits, e.g., if resizing in response to a "maxi- + mize" in Gnome or KDE which do not use the window manager hints for + this case. - o Numerous fixes and enhancements for the Solaris/SPARC platform support, - including the ability to build 64-bit shared libraries. + o make a special case of resizing work like vt100: a hard reset also + resets the 132/80 mode. The code to support this was present since + X11R5, but not used because the corresponding initial state of the + -132 option was not saved. - o Support added for OpenBSD/amd64. +3.6.8 GLX/DRI - o Differentiate left and right modifier keys on Mac OS X 10.3. + o Mesa build fixes for NetBSD/sparc64. - o Fix some path-related issues on OS/2 with xman and xf86cfg. + o Solaris/SPARC 64-bit libGL fixes. - o Update the transport layer to allow LOCAL SCO connection types to be - used for more than just X protocol connections. +3.6.9 dbedizzy - o Cleanups for the SCO port. + o Resurrect this DBE extension test utility. - o Fixes for FreeBSD/amd64 support. +3.6.10 xclock - o Add support for newer UltraSPARC variants to the SunOS/Solaris and Linux - ports. + o Use the Xaw tooltip to display the date in xclock. - o Understand the PCI bus naming scheme found in Linux 2.6 kernels. +3.6.11 twm + + o Add a new function to allow the window text title to be changed interac- + tively. + + o Allow environment variables to be used in menu names. + + o Add a new "f.totalzoom" function that zooms windows to cover the whole + area of a screen with no window decoration visible. + + o Don't highlight "f.nop" menu items in menus. + +3.6.12 xbiff + + o Add a tooltip to xbiff that shows the number of messages in a mail + folder. + +3.6.13 xdm + + o Fix a potential infinite loop when the "willing" command fails to pro- + duce any output. + +3.6.14 xfd + + o Fix a bug that prevents properly paging through xft fonts beyond 0xFFFF. + +3.6.15 xfs + + o Modify the font server transport messages to go through xfs's logging + mechanism. + + o Fix a bug introduced when syslog support was added that prevents exit on + fatal errors. + +3.6.16 xinit + + o Send SIGINT to slowing exiting X servers instead of SIGKILL. This works + together with the new SIGINT handling in the X servers, and results in a + clean exit. Sending SIGKILL only results in the hardware state not + being restored, often requiring a reboot to recover from. + +3.6.17 xmessage + + o Fix a bug in the handling of escapes in button labels. + +3.6.18 xvidtune + + o Fix the -timeout option. + +3.7 I18n and Fonts + + o Update mkfontscale's handling of font weights. + + o Replace lib/font/fontfile/decompress.c with a version derived from BSD's + src/usr.bin/compress/zopen.c. + + o Modify the fontconfig library to use getpwnam/getpwuid to find the home + directory when $HOME is not set. + + o Fix a bug in fontconfig's pattern matching that can cause FcFontMatch() + to fail when it shouldn't. + + o Fix a double-free problem in fontconfig. + + o Rework printf format specifiers used in XLFD code to make them more por- + table and avoid infinite loops in some glibc versions. + + o Update the Serbian locale naming to reflect the country's name change + from "Yugoslavia" to "Serbia and Montenegro". + +3.8 OS Support Updates + + o Fix some cases in the Darwin build where a variable is declared static + and later as extern. + + o Avoid /tmp files in NetBSD.cf's man page creation. + + o Install man page source as well as formatted man pages on NetBSD. + + o Fix a problem where builds would continue past errors on NetBSD. 4. Drivers 4.1 Video Drivers -XFree86 4.5.0 includes the following video drivers: +XFree86 4.6.0 includes the following video drivers: +--------------+--------------------------+--------------------------------+ |Driver Name | Description | Further Information | +--------------+--------------------------+--------------------------------+ |apm | Alliance Pro Motion | README.apm | |ark | Ark Logic | | + |aspeed | ASPEED Technology | | |ati | ATI | README.ati, README.r128, | | | | r128(4), radeon(4) | |chips | Chips & Technologies | README.chips, chips(4) | @@ -839,10 +1013,11 @@ |tga | DEC TGA | README.DECtga | |trident | Trident | trident(4) | |tseng | Tseng Labs | | - |via | VIA | via(4) | |vesa | VESA | vesa(4) | |vga | Generic VGA | vga(4) | + |via | VIA | via(4) | |vmware | VMWare guest OS | vmware(4) | + |xgi | Xabre Graphics Inc | xgi(4) | +--------------+--------------------------+--------------------------------+ Drivers marked with (*) are present in a preliminary form in this release, @@ -857,7 +1032,7 @@ 4.2 Input Drivers -XFree86 4.5.0 includes the following input drivers: +XFree86 4.6.0 includes the following input drivers: +------------+----------------------------------+---------------------+ |Driver Name | Description | Further Information | @@ -875,6 +1050,7 @@ |js_x | JamStudio pentablet | js_x(4) | |kbd | generic keyboards (alternate) | kbd(4) | |keyboard | generic keyboards | keyboard(4) | + |magictouch | MagicTouch ProE-X | magictouch(4) | |microtouch | MicroTouch | | |mouse | most mouse devices | mouse(4) | |mutouch | MicroTouch | | @@ -901,7 +1077,7 @@ usually, dynamically, and in that manner load the video drivers, input driv- ers, and other modules that are needed. -XFree86 4.5.0 has X server support for most UNIX® and UNIX-like operating +XFree86 4.6.0 has X server support for most UNIX® and UNIX-like operating systems on Intel/x86 platforms, plus support for Linux and some BSD OSs on Alpha, PowerPC, IA-64, AMD64, SPARC, and Mips platforms, and for Darwin on PowerPC. Support for additional architectures and operating systems is in @@ -997,7 +1173,7 @@ 6.7 DGA version 2 -DGA 2.0 is included in 4.5.0. Documentation for the client libraries can be +DGA 2.0 is included in 4.6.0. Documentation for the client libraries can be found in the XDGA(3) man page. A good degree of backwards compatibility with version 1.0 is provided. @@ -1052,7 +1228,7 @@ overlays and other image operations not possible with the core X rendering system. -XFree86 4.5.0 provides a partial implementation of Render sufficient for +XFree86 4.6.0 provides a partial implementation of Render sufficient for drawing anti-aliased text and image composition. Still to be implemented are geometric primitives and affine transformation of images. @@ -1087,12 +1263,12 @@ 6.11.2 FreeType support in Xft -XFree86 4.5.0 includes sources for FreeType version 2.1.8, and, by default, -they are built and installed automatically. +XFree86 4.6.0 includes sources for FreeType version 2.1.8, and, by default, +it is built and installed automatically. 6.11.3 Application Support For Anti-Aliased Text -Only three applications have been modified in XFree86 4.5.0 to work with the +Only three applications have been modified in this release to work with the Render extension and the Xft and FreeType libraries to provide anti-aliased text. Xterm, xditview and x11perf. Migration of other applications may occur in future releases. @@ -1251,7 +1427,7 @@ 6.21 Luxi fonts from Bigelow and Holmes -XFree86 now includes the ``Luxi'' family of Type 1 fonts and TrueType fonts. +XFree86 includes the ``Luxi'' family of Type 1 fonts and TrueType fonts. This family consists of the fonts ``Luxi Serif'', ``Luxi Sans'' and ``Luxi Mono'' in Roman, oblique, bold and bold oblique variants. The True- Type version have glyphs covering the basic ASCII Unicode range, the Latin 1 @@ -1276,7 +1452,7 @@ 7. Credits -This section lists the credits for the XFree86 4.5.0 release. For a more +This section lists the credits for the XFree86 4.6.0 release. For a more detailed breakdown, refer to the CHANGELOG file in the XFree86 source tree, the cvs-commit archives , or the 'cvs log' information for individual @@ -1284,77 +1460,61 @@ New Features, Enhancements and Updates: - Xterm enhancements and updates: - Thomas Dickey + Security Updates: + Marc La France. + + ASPEED Technologies driver: + Y. C. Chen, ASPEED Technologies. - Integrate TinyX into the mainline XFree86 build: - X-Oz Technologies + Xabre Graphics driver: + Jong Lin, XGI. - Intel i915GM support, dual head i830/i855/i915 support: - Tungsten Graphics, Alan Hourihane, Keith Whitwell + X server extension rework: + Marc La France. - Automatic configuration enhancements: - X-Oz Technologies, David Dawes + Loader Enhancements: + David H. Dawes, X-Oz Technologies. - Distributed Multihead X: - Kevin Martin, Rik Faith + Intel i945G/i945GM support and other driver enhancements: + Alan Hourihane, Tungsten Graphics. - Preliminary work on SunOS/SPARC and IRIX ports: - Marc La France + NVIDIA driver updates and new hardware support: + Mark Vojkovich + + Improved SunOS/SPARC and SBUS support: + Marc La France. + + Xterm enhancements and updates: + Thomas Dickey. + + Xaw enhancements: + Alexander Pohoyda. Integration: General Integration of Submissions: - David H. Dawes, Marc La France, Alan Hourihane, Ivan - Pascal. - - DRI Integration: - Alan Hourihane, David H. Dawes. + Marc La France, David H. Dawes. Release Engineering: David H. Dawes. Patches and other submissions (in alphabetical order): - Szilveszter Adam, Tim Adye, Taneem Ahmed, Andrew Aitchison, Raoul - Arranz, Zaeem Arshad, Dwayne Bailey, Ilyas Bakirov, Denis Bar- - bier, Kyle Bateman, J. Scott Berg, Thomas Biege, Dmitry - Bolkhovityanov, H Merijn Brand, Peter Breitenlohner, Benjamin - Burke, Dale L Busacker, busmanus, Julian Cable, Mike Castle, - David M. Clay, Philip Clayton, Alan Coopersmith, Ricardo Cruz, - Michel Dänzer, J. D. Darling, David Dawes, Michael Dawes, Rafael - Ávila de Espíndola, Rick De Laet, Josip Deanovic, Angelus Dei, - Laurent Deniel, Thomas Dickey, Stefan Dirsch, Charles Dobson, DRI - Project, Emmanuel Dreyfus, Boris Dusek, Georgina O. Economou, - Egbert Eich, Bernd Ernesti, Chris Evans, Rik Faith, Adrian - Fiechter, Matthew Fischer, FreeType Team, Terry R. Frienrichsen, - Christopher Fynn, Hubert Gburzynski, Nicolas George, Frank - Giessler, Fred Gleason, Dmitry Golubev, Alexander Gottwald, Her- - bert Graeber, Miroslav Halas, John Harper, Harshula, John - Heasley, Matthieu Herrb, David Holl, Alex Holland, Peng Hongbo, - Alan Hourihane, Harold L Hunt II, Alan Iwi, Timur Jamakeev, Paul - Jarc, Kean Johnston, Nicolas Joly, Mark Kandianis, Kaleb Keith- - ley, Chamath Keppitiyagama, Jung-uk Kim, Satoshi Kimura, Michael - Knudsen, Vlatko Kosturjak, Alexei Kosut, Anton Kovalenko, Joachim - Kuebart, Marc La France, David Laight, Zarick Lau, Pierre Lalet, - Michael Lampe, Lanka Linux User Group, Nolan Leake, Werner Lem- - berg, Dejan Lesjak, Noah Levitt, Greg Lewis, Bernhard R Link, - Jonas Lund, S. Lussos, Torrey T. Lyons, Roland Mainz, N Marci, - Kevin Martin, Stephen McCamant, Mesa Developers, Luke Mewburn, - Petr Mladek, Bram Moolenaar, Steve Murphy, Ishikawa MUTSUMI, Radu - Octavian, Lee Olsen, Greg Parker, Ivan Pascal, Alexander E. - Patrakov, Mike Pechkin, Soós Péter, Zvezdan Petkovic, Alexander - Pohoyda, Xie Qian, Bill Randle, Adam J. Richter, Tim Roberts, - Bernhard Rosenkraenzer, Andreas Rüden, Steve Rumble, Oleg Safi- - ullin, Ty Sarna, Leo Savernik, Barry Scott, Shantonu Sen, Yu - Shao, Andreas Schwab, Matthias Scheler, Dan Shearer, Michael - Shell, Paul Shupak, Alexander Stohr, Marius Strobl, Mikko Markus - Torni, Jess Thrysoee, Izumi Tsutsui, Tungsten Graphics, Ryan - Underwood, Tristan Van Berkom, Michael van Elst, Phillip Vandry, - Roman Vasylyev, Luc Verhaegen, Rodion Vshevtsov, Mark Vojkovich, - Edi Werner, Keith Whitwell, Scot Wilcoxon, Dave Williss, Thomas - Winischhofer, Kuang-che Wu, X-Oz Technologies, Chisato Yamauchi, - Michael Yaroslavtsev, David Yerger, Su Yong, Hui Yu, Sagi Zeevi, - Christian Zietz + ASPEED Technologies, Andrew Aitchison, James Ascroft-Leigh, + Étienne Bersac, Peter Breitenlohner, Terry Chang, Y. C. Chen, + Jeff Chua, James Cloos, Alan Coopersmith, Miguel González + Cuadrado, David Dawes, Thomas Dickey, Stefan Dirsch, Bernd + Ernesti, Jordan Frank, Will L G, Frank Giessler, Thorsten Glaser, + Damian Janusz Gruszka, Lukas Hejtmanek, Evil Mr Henry, Jens Her- + den, Alan Hourihane, Nicolas Joly, Bang Jun-Young, Alexander + Kabaev, Satoshi Kimura, Milos Komarcevic, Marc La France, Dejan + Lesjak, Khong Jye Liew, Jong Lin, Michael Lorenz, Michael + Macallan, Michal Maruska, Luke Mewburn, Timothy Musson, Newsh, + Takaaki Nomura, Ivan Pascal, Bob Peterson, Pierre, Aaron Plat- + tner, Alexander Pohoyda, Jeremy C. Reed, Conrad Schuler, Bruno + Schwander, Olaf Seibert, Aaron Solochek, Helmar Spangenberg, Ken + Stailey, Tobias Stoeckmann, Tungsten Graphics, James Richard + Tyrer, Staffan Ulfberg, Denis Vlasenko, Mark Vojkovich, Tom + Williams, Dave Williss, X-Oz Technologies, XGI, Christos Zoulas. Webmaster: Georgina O. Economou @@ -1381,7 +1541,7 @@ This product includes software developed by X-Oz Technologies (http://www.x- oz.com/). - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml,v 1.135 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml,v 1.142 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/RELNOTES,v 3.149 2005/03/17 01:11:55 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/RELNOTES,v 3.152 2006/04/29 03:38:00 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/Versions diff -u xc/programs/Xserver/hw/xfree86/doc/Versions:1.20 xc/programs/Xserver/hw/xfree86/doc/Versions:1.21 --- xc/programs/Xserver/hw/xfree86/doc/Versions:1.20 Wed Mar 16 20:11:55 2005 +++ xc/programs/Xserver/hw/xfree86/doc/Versions Tue Apr 11 21:50:32 2006 @@ -33,8 +33,8 @@ update releases typically consist of source code patches plus binary updates that may be layered on top of the previous release. -The current release is 4.5.0, and the next release will be 4.6.0. No update -release is scheduled, but if one is needed it will be version 4.5.1. +The current release is 4.6.0, and the next release will be 4.7.0. No update +release is scheduled, but if one is needed it will be version 4.6.1. Aside from releases, snapshots of the development trunk are tagged in the CVS repository at regular intervals, normally every two weeks. Each snapshot has @@ -315,4 +315,4 @@ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Versions.sgml,v 1.8 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/Versions,v 1.20 2005/03/17 01:11:55 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/Versions,v 1.21 2006/04/12 01:50:32 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/doc/man/XF86Misc.man diff -u xc/programs/Xserver/hw/xfree86/doc/man/XF86Misc.man:3.13 xc/programs/Xserver/hw/xfree86/doc/man/XF86Misc.man:3.14 --- xc/programs/Xserver/hw/xfree86/doc/man/XF86Misc.man:3.13 Sun Nov 23 00:40:36 2003 +++ xc/programs/Xserver/hw/xfree86/doc/man/XF86Misc.man Mon Jan 9 09:59:53 2006 @@ -1,10 +1,6 @@ -.\" $TOG: XF86Misc.man /main/7 1997/07/19 10:30:32 kaleb $ -.\" -.\" -.\" .\" Copyright (c) 1996 Joe Moss, The XFree86 Project .\" -.\" $XFree86: xc/programs/Xserver/hw/xfree86/doc/man/XF86Misc.man,v 3.13 2003/11/23 05:40:36 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/doc/man/XF86Misc.man,v 3.14 2006/01/09 14:59:53 dawes Exp $ .de ZN .ie t \fB\^\\$1\^\fR\\$2 .el \fI\^\\$1\^\fP\\$2 Index: xc/programs/Xserver/hw/xfree86/doc/man/XF86VM.man diff -u xc/programs/Xserver/hw/xfree86/doc/man/XF86VM.man:3.15 xc/programs/Xserver/hw/xfree86/doc/man/XF86VM.man:3.16 --- xc/programs/Xserver/hw/xfree86/doc/man/XF86VM.man:3.15 Sun Nov 23 00:40:36 2003 +++ xc/programs/Xserver/hw/xfree86/doc/man/XF86VM.man Mon Jan 9 09:59:53 2006 @@ -1,10 +1,5 @@ -.\" $TOG: XF86VM.man /main/6 1997/07/19 10:30:39 kaleb $ -.\" -.\" -.\" -.\" .\" Copyright (c) 1996 Joe Moss, The XFree86 Project -.\" $XFree86: xc/programs/Xserver/hw/xfree86/doc/man/XF86VM.man,v 3.15 2003/11/23 05:40:36 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/doc/man/XF86VM.man,v 3.16 2006/01/09 14:59:53 dawes Exp $ .\" .de ZN .ie t \fB\^\\$1\^\fR\\$2 Index: xc/programs/Xserver/hw/xfree86/doc/sgml/BUILD.sgml diff -u xc/programs/Xserver/hw/xfree86/doc/sgml/BUILD.sgml:3.19 xc/programs/Xserver/hw/xfree86/doc/sgml/BUILD.sgml:3.20 --- xc/programs/Xserver/hw/xfree86/doc/sgml/BUILD.sgml:3.19 Wed Mar 16 12:12:47 2005 +++ xc/programs/Xserver/hw/xfree86/doc/sgml/BUILD.sgml Tue Apr 11 21:39:22 2006 @@ -8,7 +8,7 @@ 16 March 2005 -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/BUILD.sgml,v 3.19 2005/03/16 17:12:47 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/BUILD.sgml,v 3.20 2006/04/12 01:39:22 dawes Exp $ @@ -62,8 +62,7 @@ These can be found at - and similar locations on XFree86 mirror sites. + url="ftp://ftp.xfree86.org/pub/XFree86/&fullrelvers;/source/">. XFree86-&fullrelvers;-src-4.tgz and XFree86-&fullrelvers;-src-5.tgz contains the fonts. XFree86-&fullrelvers;-src-6.tgz contains the documentation Index: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml diff -u xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml:1.57 xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml:1.62 --- xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml:1.57 Wed Dec 8 17:27:11 2004 +++ xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml Tue Apr 18 13:13:22 2006 @@ -27,7 +27,7 @@ XFree86® server 4.x Design (DRAFT) <author>The XFree86 Project, Inc -<date>19 December 2003 +<date>13 October 2005 @@ -36,7 +36,7 @@ <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.57 2004/12/08 22:27:11 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.62 2006/04/18 17:13:22 dawes Exp $ </ident> @@ -2341,7 +2341,7 @@ that the resource ranges have to match those specified during registration. If a range has been specified starting at &s.code;A&e.code; and ending at &s.code;B&e.code; and suppose - &s.code;C&e.code; us a value satisfying + &s.code;C&e.code; is a value satisfying &s.code;A < C < B&e.code; one may not specify the resource range &s.code;(A,B)&e.code; by splitting it into two ranges &s.code;(A,C)&e.code; and &s.code;(C,B)&e.code;. @@ -2791,7 +2791,7 @@ &s.code;"xf86Priv.h"&nl; "xf86Privstr.h"&nl; "xf86_OSlib.h"&nl; - "Xos.h"&e.code; + <X11/Xos.h>&e.code; </quote> In addition, "xf86_libc.h" must not be included explicitly. It is @@ -4247,7 +4247,7 @@ &s.code;modreq&e.code; <quote><p> An optional &s.code;XF86ModReqInfo*&e.code; containing - version/ABI/vendor information to requirements to + version/ABI/vendor information specifying requirements to check the newly loaded module against. The main purpose of this is to allow the loader to verify that a module of the correct type/version before running @@ -4541,7 +4541,7 @@ The vers parameter must be initialised to a pointer to a correctly initialised &s.code;XF86ModuleVersionInfo&e.code; struct. The other -two parameter are optional, and should be initialised to +two parameters are optional, and should be initialised to &s.code;NULL&e.code; when not required. The other parameters are defined as @@ -4593,6 +4593,12 @@ The following is the Loader interface that is available to any part of the server, and may also be used from within modules. +<p> +Some of these have &s.code;xf86*&e.code; wrappers with simpler interfaces +declared in &s.code;"xf86.h"&e.code;. +These wrappers are the preferred interface for modules, given that they are also +available in a statically built server, whereas the functions below are not. + <quote><p> &s.code;pointer LoadSubModule(pointer parent, const char *module, &f.indent;const char **subdirlist, const char **patternlist, @@ -4697,20 +4703,20 @@ </quote> - &s.code;int LoaderCheckUnresolved(int delayflag)&e.code; + &s.code;int LoaderCheckUnresolved(int dummy)&e.code; <quote><p> This function checks for unresolved symbols. It generates warnings for unresolved symbols that have not been registered with - &s.code;LoaderRefSymLists()&e.code;, and maps them to a dummy - function. This behaviour may change in future. If unresolved + &s.code;LoaderRefSymLists()&e.code;. All such symbols are automatically + mapped to a dummy function. If unresolved symbols are found that have been registered with &s.code;LoaderReqSymLists()&e.code; or &s.code;LoaderReqSymbols()&e.code; then this function returns a non-zero value. If none of these symbols are unresolved the return value is zero, indicating success. - The &s.code;delayflag&e.code; parameter should normally be set to - &s.code;LD_RESOLV_IFDONE&e.code;. + The &s.code;dummy&e.code; parameter is not used, and should be set to + &s.code;0&e.code;. It is kept only for compatibility purposes. </quote> @@ -4725,6 +4731,19 @@ to the message (followed by a `:'). </quote> + + &s.code;LoaderSetParentModuleRequirements(pointer module, + &f.indent;pointer req);&e.code; + <quote><p> + This function is intended to be called from a module's + &s.code;Setup&e.code; function. It associates an + &s.code;XF86ModReqInfo&e.code; structure occurrence (addressed by + &s.code;req&e.code;) with the module being loaded (specified by + &s.code;module&e.code;). This structure occurrence will then be used to + check this module's parent modules against. This mechanism allows a module + to ensure its callers are compatible. + + </quote> </quote> <sect1>Special Registration Functions @@ -5644,7 +5663,7 @@ <ref id="avail" name="Available Functions"> sections. -<sect1>Probing discrete clocks on old hardware +<sect1>Probing discrete clocks on older hardware <p> The &s.code;xf86GetClocks()&e.code; function may be used to assist @@ -5669,7 +5688,7 @@ a function that does whatever is required to protect the hardware state while selecting a new clock. &s.code;BlankScreen&e.code; is a function that blanks the screen. &s.code;vertsyncreg&e.code; - and &s.code;maskval&e.code; are the register and bitmask to + and &s.code;maskval&e.code; are the I/O register and bitmask to check for the presence of vertical sync pulses. &s.code;knownclkindex&e.code; and &s.code;knownclkvalue&e.code; are the index and value of a known clock. These are the known @@ -6259,7 +6278,7 @@ The following is an outline for writing a basic unaccelerated driver for a PCI video card with a linear mapped framebuffer, and which has a -VGA core. It is includes some general information that is relevant to +VGA core. It includes some general information that is relevant to most drivers (even those which don't fit that basic description). The information here is based on the initial conversion of the Matrox @@ -6272,8 +6291,9 @@ to prefix all of its externally visible symbols. This is to avoid name space clashes when loading multiple drivers. The examples here are for the ``ZZZ'' driver, which uses the ``ZZZ'' or ``zzz'' prefix for its externally -visible symbols. - +visible symbols, with preference given to the uppercase prefix. +Internal symbols should also follow this convention to facilitate the debugging +of a statically built server. <sect1>Include files <p> @@ -6364,7 +6384,7 @@ "xf86Privstr.h"&nl; "xf86_libc.h"&nl; "xf86_OSlib.h"&nl; - "Xos.h"&e.code;&nl; + <X11/Xos.h>&e.code;&nl; any OS header </quote> Index: xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile diff -u xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile:3.91 xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile:3.92 --- xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile:3.91 Tue Mar 8 16:11:14 2005 +++ xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile Sun Apr 23 13:03:51 2006 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile,v 3.91 2005/03/08 21:11:14 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile,v 3.92 2006/04/23 17:03:51 dawes Exp $ #include <Server.tmpl> #include <lnxdoc.rules> @@ -106,6 +106,24 @@ clean:: RemoveFile(index.sgml) +#if XFree86Devel + +lindex.sgml: $(INDEXLIST) index.pre index.post add.sh Imakefile $(SGMLDEPENDS) $(MANSGMLDEPENDS) + RemoveFile(lindex.sgml) + cat index.pre > lindex.sgml + echo "<!-- This file is auto-generated. Do not edit! -->" >> lindex.sgml + for i in $(INDEXLIST); do \ + $(SHELL) add.sh -f lindex.sgml -p ./ $$i; \ + done + cat index.post >> lindex.sgml + +LinuxDocTarget(lindex) + +clean:: + RemoveFile(lindex.sgml) + +#endif + FORMATTEDDIR = .. Index: xc/programs/Xserver/hw/xfree86/doc/sgml/LICENSE.sgml diff -u xc/programs/Xserver/hw/xfree86/doc/sgml/LICENSE.sgml:1.41 xc/programs/Xserver/hw/xfree86/doc/sgml/LICENSE.sgml:1.43 --- xc/programs/Xserver/hw/xfree86/doc/sgml/LICENSE.sgml:1.41 Wed Mar 9 21:35:07 2005 +++ xc/programs/Xserver/hw/xfree86/doc/sgml/LICENSE.sgml Tue Apr 18 13:07:24 2006 @@ -5,10 +5,10 @@ <article> <title>Licenses Compiled by The XFree86 Project -9 March 2005 +April 2006 -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/LICENSE.sgml,v 1.41 2005/03/10 02:35:07 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/LICENSE.sgml,v 1.43 2006/04/18 17:07:24 dawes Exp $ Introduction @@ -83,7 +83,7 @@ licence can be found at the -Copyright (C) 1994-2005 The XFree86 Project, Inc. +Copyright (C) 1994-2006 The XFree86 Project, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining @@ -148,6 +148,7 @@ Copyright (C) 1984-1989, 1994 Adobe Systems Incorporated. Copyright (C) 2003 Eric Anholt Copyright (C) 2002 Apple Computer, Inc. All Rights Reserved. +Copyright (C) 2005 ASPEED Technology Inc. Copyright (C) 1988 AT&T. All Rights Reserved. Copyright (C) 1992 by Robert Baron Copyright (C) 1996-1998 by David Bateman <dbateman@ee.uts.edu.au> @@ -175,7 +176,7 @@ Copyright (C) 2000, 2001 Ani Joshi Copyright (C) 2000 by Rainer Keller Copyright (C) 1999-2003 by Peter Kunzmann, Citron GmbH, Germany. -Copyright (C) 1994 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org +Copyright (C) 1994 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org Copyright (C) 1996 by Steven Lang Copyright (C) 1995, 1999 by Patrick Lecoanet, France. Copyright (C) 2001 by Patrick LERDA @@ -745,8 +746,8 @@ X-Oz Technologies

-Copyright 2003, 2004, 2005 by David H. Dawes. -Copyright 2003, 2004, 2005 by X-Oz Technologies. +Copyright 2003-2006 by David H. Dawes. +Copyright 2003-2006 by X-Oz Technologies. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a Index: xc/programs/Xserver/hw/xfree86/doc/sgml/LynxOS.sgml diff -u xc/programs/Xserver/hw/xfree86/doc/sgml/LynxOS.sgml:3.21 xc/programs/Xserver/hw/xfree86/doc/sgml/LynxOS.sgml:3.22 --- xc/programs/Xserver/hw/xfree86/doc/sgml/LynxOS.sgml:3.21 Wed Dec 8 17:27:11 2004 +++ xc/programs/Xserver/hw/xfree86/doc/sgml/LynxOS.sgml Tue Apr 11 21:39:22 2006 @@ -8,7 +8,7 @@ 25 February 2000 -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/LynxOS.sgml,v 3.21 2004/12/08 22:27:11 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/LynxOS.sgml,v 3.22 2006/04/12 01:39:22 dawes Exp $ @@ -32,10 +32,6 @@ -A list of mirror sites is provided by - - The binaries on the FTP site were built on the latest released LynxOS version at the time XFree86 &relvers; was released. In this case it is `LynxOS x86 3.0.1'. Because of changes made to the object format they Index: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml diff -u xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml:3.69 xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml:3.70 --- xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml:3.69 Wed Dec 8 17:27:11 2004 +++ xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml Tue Apr 11 21:39:22 2006 @@ -12,7 +12,7 @@ Last modified on: 9 November 2002 -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.69 2004/12/08 22:27:11 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.70 2006/04/12 01:39:22 dawes Exp $ @@ -32,18 +32,12 @@ +]]> Binaries for NetBSD 1.5 and later are available from: - -A list of mirror sites is provided by - -]]> - - XFree86 also builds on other NetBSD architectures. See section for details. Index: xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml diff -u xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml:1.35 xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml:1.36 --- xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml:1.35 Mon Feb 14 20:36:54 2005 +++ xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml Tue Apr 11 21:39:22 2006 @@ -9,7 +9,7 @@ Last modified on: 9 December 2003 -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml,v 1.35 2005/02/15 01:36:54 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml,v 1.36 2006/04/12 01:39:22 dawes Exp $ @@ -30,17 +30,13 @@ +]]> Binaries for OpenBSD/i386 3.4 and later are available from: -A list of mirror sites is provided by - -]]> -

XFree86 also builds on other OpenBSD architectures. See section Index: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml diff -u xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml:3.148 xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml:3.149 --- xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml:3.148 Wed Mar 16 20:11:56 2005 +++ xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml Tue Apr 11 21:39:22 2006 @@ -13,10 +13,10 @@ README for XFree86® &relvers; <author>The XFree86 Project, Inc -<date>16 March 2005 +<date>April 2006 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.148 2005/03/17 01:11:56 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.149 2006/04/12 01:39:22 dawes Exp $ </ident> <abstract> @@ -201,16 +201,16 @@ <![ %snapshot; [ <![ %havebindist; [ XFree86 &relvers; can be found at the <url name="XFree86 ftp server" -url="ftp://ftp.xfree86.org/pub/XFree86/snapshots/&relvers;/">, and at -mirrors of this server. This snapshot is available primarily in binary +url="ftp://ftp.xfree86.org/pub/XFree86/snapshots/&relvers;/">. +This snapshot is available primarily in binary form for several popular platforms. ]]> ]]> <![ %release; [ XFree86 &relvers; can be found at the <url name="XFree86 ftp server" -url="ftp://ftp.xfree86.org/pub/XFree86/&relvers;/">, -and at mirrors of this server. Information about obtaining and installing +url="ftp://ftp.xfree86.org/pub/XFree86/&relvers;/">. +Information about obtaining and installing binary distributions of this release can be found in the <htmlurl name="Installation Document" url="Install.html">. Information about obtaining the release in source form is given below. @@ -414,6 +414,15 @@ bug report but not the operating system core dump. Do not edit the log file as our developers use it to reproduce and debug your problem. +<sect>Supporting XFree86 +<p> +The XFree86 Project, Inc is a nonprofit that oversees the development +of XFree86. As with the XFree86 software, the nonprofit is run and +operated entirely by unpaid volunteers. Donations to The XFree86 Project +go towards maintaining our online presence and related infrastructure +and modest operating expenses. If you find XFree86 useful, and would like +to help us continue in our work, please consider a small <url name=" +donation" url="http://www.xfree86.org/donations/">. </article> Index: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml diff -u xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml:1.135 xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml:1.142 --- xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml:1.135 Wed Mar 16 20:11:56 2005 +++ xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml Fri Apr 28 23:35:46 2006 @@ -6,10 +6,10 @@ <title>Release Notes for XFree86® &relvers; <author>The XFree86 Project, Inc -<date>16 March 2005 +<date>April 2006 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml,v 1.135 2005/03/17 01:11:56 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml,v 1.142 2006/04/29 03:35:46 dawes Exp $ </ident> <abstract> @@ -54,16 +54,17 @@ <p> Automatic configuration was introduced with XFree86 4.4.0 which makes it possible to start XFree86 without first creating a -configuration file. This was further improved in XFree86 -4.5.0. +configuration file. This has been further improved in XFree86 +4.5.0 and 4.6.0. If you experienced any problems with automatic configuration +in a previous release, it is worth trying it again with this release. + +While the initial automatic configuration support was originally targeted +ust for Linux and the FreeBSD variants, as of 4.5.0 it also includes +Solaris, NetBSD and OpenBSD support. Full support for automatic +configuration is planned for other platforms in future releases. -While the initial automatic configuration support was originally targeted -ust for Linux and the FreeBSD variants, in 4.5.0 it now includes Solaris, NetBSD and OpenBSD support, -and it is planned that automatic configuration will be supported on other -platforms in future releases. - -If you are running either Linux, FreeBSD, NetBSD, OpenBSD, or Solaris, -try Auto Configuration by running: +If you are running Linux, FreeBSD, NetBSD, OpenBSD, or Solaris, try Auto +Configuration by running: <tscreen><verb> XFree86 -autoconfig @@ -148,39 +149,31 @@ <sect1>Security Updates <p> -The following security issues have been fixed in this release: +The following security issue has been fixed in this release: <itemize> -<item>xdm would listen on a random socket when the -<tt>DisplayManager.requestPort</tt> resource was set to <tt>0</tt> -(<url name="CAN-2004-0419" url="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0419">). - -<item>Integer overflow in libICE/libSM. - -<item>libXpm stack and integer overflow and other issues (<url -name="CAN-2004-0687" -url="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0687">, <url -name="CAN-2004-0688" -url="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0688">, <url -name="CAN-2004-0914" -url="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0914">, <url -name="CAN-2005-0605" -url="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-0605">). -<item>Potential security issues related to wrap-around of memory allocation -requests in font handling and other areas. +<item>X server pixmap allocation flaw (<url name="CERT Vulnerability +Note VU#102441" url="http://www.kb.cert.org/vuls/id/102441">, <url +name="CAN-2005-2495" +url="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-2495">). </itemize> <sect1>Video Driver Enhancements <p> -<sect2>General +<itemize> +<item>Remove cfb support from the i740, nsc, s3virge, siliconmotion and via +drivers. + +</itemize> + +<sect2>aspeed <p> <itemize> -<item>In most drivers, fix a long-standing off-by-one error in the programming -of sync pulse start and end for video modes based on VGA or its extensions. +<item>A new driver for ASPEED Technologies' AST2000 graphics chips. </itemize> @@ -188,25 +181,42 @@ <p> <itemize> -<item>Fix various bugs in the Mach64-based panel support. +<item>Reinstate support for all ATI adapters on all architectures supported +by the XFree86 common layer. + +<item>Restore accuracy of atimisc's clock probe despite certain I/O errors. + +<item>Change the atimisc driver on big-endian systems to allow depth 24 +even if the big-endian aperture is not available, by swapping RGB masks. + +<item>Fix an ATI driver probe crash. -<item>Re-instate atimisc's support for DGA on UltraSPARC platforms. +<item>Workaround for screen-to-screen copy corruption in second-generation +integrated controllers. + +<item>Improve accuracy of atmisc's calculations that are based on a +29.5 MHz reference clock. + +<item>Chrontel 8398 related changes to the Mach64 support. + +<item>Fix one cause of video memory corruption when using XAA with second +generation integrated Mach64 controllers. </itemize> -<sect2>chips +<sect2>glint <p> <itemize> -<item>Fix the stretching option and centering. +<item>Fix the size of the DAC registers storage for pm2v and pm3 chipsets. </itemize> -<sect2>cirrus +<sect2>i740 <p> <itemize> -<item>Add support for the NEC PC-9821 with CLGD755x. +<item>Save and restore more of the mode on server entry. </itemize> @@ -214,33 +224,51 @@ <p> <itemize> -<item>Add support for memory size tweaking in the BIOS for 845G. +<item>Make sure the DDC-probed parameters are applied before modes are +selected. + +<item>Fix some bad alignment problems when allocating memory from the end of +AGP space. -<item>Fix Xv flickering on the 830GM and later. +<item>Adjust the display width according to the VESA BIOS scanline +requirements. -<item>Add support for the 915G/915GM chipsets. +<item>Add support for the Intel E7221 server chipset. -<item>Add dual-head and clone support for the 915G, 855GM, 830GM chipsets. +<item>Improve display switching support for mobile chipsets using the +Fn+F? combination keys. -<item>Add ARGB cursor support for all chipsets. This requires an updated -agpgart kernel driver. +<item>Add DirectColor support for the i830 and later. -<item>Add module lid status checking. +<item>Add gamma correction support for the i830 and later. -<item>Fix XVideo when high resolutions are used on local flat panels. +<item>Add rotation support for the i830 and later. -<item>Add PanelID identification. +<item>Improve refresh rate selection for custom modelines. -<item>Detect monitor changes on VT switch (830GM and up). +<item>Add support for the 945G and 945GM. <item>Support custom video modes in the video BIOS, when available. -<item>Fix some Xv bugs. +<item>Fix some offset, pitch, and overlay scaler size problems with the +video overlay. This solves various spontaneous lockups. + +<item>Fix text restoration when display switching has been activated. + +<item>Add support to check the built-in VESA mode list. + +<item>Fix XVideo when operating in one line mode and video is pushed off the +top of the screen, and fix some XVideo skew problems at certain resolutions. -<item>Set the default monitor parameters to match the display size for -the 830GM and up when they are not available from another source, improving -the default video mode selection in these cases. +<item>Sync the accelerator before calling AdjustFrame to avoid lockups. +<item>Fix a lockup when spend and resume when playing video (shutdown the +overlay on LeaveVT). + +<item>Support 1920x1088 for HDTV movies using a new option (LinearAlloc) to add +more memory for the video overlay. + +<item>Add ACPI hotkey switching support. </itemize> @@ -248,16 +276,15 @@ <p> <itemize> -<item>Make the Mystique lockup workaround more selective, avoiding different -problems on cards that do not require the workaround. +<item>Reduce the Mystique's SYSCLK from 197 MHz to 166 MHz, +allowing the higher clock to still be used when the "OverclockMem" option +is activated. This fixes the instability seen on some Mystique cards, +and removes the need for the workaround in previous releases. -<item>Fix segfaults that occur when the XaaNoSolidFillRect and/or -XaaNoMono8x8PatternFillRect options are used. +<item>Revert the HALlib MGASetDisplayStart interface back to +HALSetDisplayStart. -<item>Fix for Xv resolution loss problem. - -<item>Add i2c and Maven support, providing DDC and DPMS support for the -second head on dual-head cards. +<item>Make 8+24 mode honour the default visual. </itemize> @@ -265,655 +292,867 @@ <p> <itemize> -<item>PCI-Xpress support added. +<item>Some of the panel DPMS support in 4.5.0 only works for TMDS, and +caused some panel blooming on some LVDS panels, so skip the DPMS panel code +when the panel is LVDS. + +<item>Add DPMS support for GeForce4 and newer laptops. -<item>Add support for newer hardware. +<item>Fix some console restore code for the NV11. -<item>Workaround for Toshiba M30 laptop issue. +<item>Workaround for 512MB video cards (can only map 256MB of it). -<item>Reject modes larger than the flat panel. +<item>Fix a graphics acceleration hang that occurred on some NVIDIA GeForce +6xxx cards. -<item>DPMS support for DVI added. +<item>Fix a potential problem with pixmap cache corruption on GeForce 6xxx +and 7xxx parts. -<item>Cursor update for NV11 so that alpha blended cursors will work -in conjunction with dithering (laptop panels). +<item>Add support for new hardware. </itemize> -<sect2>r128 +<sect2>siliconmotion <p> <itemize> -<item>Improve the handling of timeouts in R128CCEWaitForIdle() +<item>Merge in support for SiliconMotion's SM501 controller. </itemize> -<sect2>radeon +<sect2>suncg6 <p> <itemize> -<item>The DAC is turned off for DPMS modes, fixing a problem that can badly -affect some monitors. +<item>Add screen-to-screen copy, solid fill, and CPU-to-screen colour +expansion acceleration. -<item>Add an option for avoid flickering and blank screen problems with -iBooks. +<item>Map more of a Sun CG6's video memory for use by the pixmap cache. </itemize> -<sect2>rendition +<sect2>sunffb <p> <itemize> -<item>Fix bad free() calls in the probe function. +<item>Prevent turning off the FPU on NetBSD. + +<item>Fix build problems on NetBSD (global register usage declaration, +and increase stack usage). + +<item>Workaround for VRAM corruption when unblanking FFB1 adapters. + </itemize> -<sect2>s3 +<sect2>tdfx <p> <itemize> -<item>Add support for interlaced video modes. +<item>Add DDC2 support. -<item>Remove cfb support. +</itemize> -<item>Correct the depth checking (32 is not a supported depth). +<sect2>trident +<p> -<item>Fix DAC probing. +<itemize> +<item>Do not wait for vertical retrace on PC98 systems. -<item>Add IBM RGB525 support. +<item>Fix an offset problem in Xv for the Cyber9397 and later chipsets. -<item>Fix a ScreenToScreenCopy bug that shows up with xtest. +<item>Add XGI (Trident) Volari XP5 support to the trident driver. </itemize> -<sect2>s3virge +<sect2>via <p> <itemize> -<item>Fix a bug that shows up when mode restoration results in a switch -between colour and mono operation. +<item>Add a "ConnectedDevice" option to the via driver to force selection +of output devices. </itemize> -<sect2>savage +<sect2>vmware <p> <itemize> -<item>Fix HW cursor state on VT switching. - -<item>Disable the RANDR extension when using rotation. - -<item>Turn off the back light on panels when DPMS "off" mode is activated. - -<item>Allow black as an Xv colour key. +<item>Implement a workaround in the generic int10 module to allow unaligned +I/O access specific to VMWare's second generation emulated adapter. </itemize> -<sect2>sis +<sect2>xgi <p> <itemize> -<item>Fix some modes for 1400x1050 and 1600x1200 panels. +<item>A new driver for the Volari V3XT, V5, V8, Z7 chipsets. -<item>BIOS data layout-related fixes for 661/741/760. +</itemize> -<item>Xv fixes. +<sect1>Input Driver Enhancements -<item>Fix LCD support for ECS A90x and ECS A907. +<p> +<sect2>keyboard +<p> -<item>Add video blitter as a second Xv adaptor for the M650/651 and later. +<itemize> +<item>Ignore <tt>KEY_UNUSED</tt> scancodes. -<item>Add (display?) hot plug support. +</itemize> -<item>Add preliminary support for the SiS340. +<sect2>mouse +<p> -<item>Fix bad external symbols in this driver module. +<itemize> +<item>Fix auto-detection of Sun mice on Linux/SPARC. </itemize> -<sect2>sunffb +<sect2>magictouch <p> <itemize> -<item>Fix a segfault when acceleration is disabled. +<item>Port of the magictouch driver to XFree86 4.x. </itemize> -<sect2>vesa +<sect1>XKB updates <p> <itemize> -<item>Do not attempt to set the palette format for depths greater than 8. -This fixes a problem on some platforms. +<item>Replace the macintosh/fr map with the "fr_new" map, release 4. -<item>Fix a substantial memory leak on server regeneration. +<item>Fix a bug in XKB group adjustment. -<item>Fix screen blanking for non-VGA compatible modes. +<item>Fix off-by-one errors in XKBMalloc.c. -<item>Blank the screen at startup, so that the contents of the previous -session are not initially visible. +<item>Shrink tables instead of only growing them. + +<item>Fix various vmodmap vs modmap cut and paste bugs. + +<item>Improve synthesized core X events for reporting XKB changes to +XKB-unaware clients. + +<item>Fix a setxkbmap segfault. + +<item>Add Eszett (ssharp) to the us_intl map. + +<item>Add dvorak_intl map. + +<item>Add a Khmer layout. + +<item>Add multimedia keysyms for the Inspiron 6000 laptop to the "inspiron" +set. </itemize> -<sect2>via + +<sect1>X Server and Extension Updates + <p> <itemize> -<item>Restructuring and acceleration cleanups. +<item>Updates to the handling of the X server RGB database: + + <itemize> + <item>Ignore white space, dash, and underscore characters, as well as + case when matching colour names, and remove the unnecessary duplicates + in rgb.txt. + + <item>Allow a copy of the RGB database to be included into the X servers + as a fallback for when the rgb.txt file cannot be found. + + <item>Remove the (unused) support for DBM-compiled RGB database files. -<item>Fix some DRM-related problems. + </itemize> -<item>Cleanup the DDC/EDID retrieval. +<item>Make the AMD64/x86_64 platform tests consistent throughout. + +<item>Rework the way that extension support is built into the servers to +allow for servers with different sets of extensions in the same build. This +includes minimising the number of pervasive extensions, and adding DIX helpers +for extensions such as Xinerama and XCSECURITY. + +<item>Modify the X server handling of SIGINT to provide a faster exit path +than SIGTERM, while ensuring that all hardware state gets restored. This +change is used by xinit as a cleaner alternative to using SIGKILL for a +slowly exiting server. </itemize> -<sect2>vmware +<sect2>Loader <p> <itemize> -<item>Various register state save/restore fixes. +<item>Add support for relocation type 10 for Alpha to the ELF loader. -<item>Fix host-cursor mode. +<item>Fix issues with Linux/SPARC 2.6 kernels. -<item>Allow any reasonable depth if 8BIT_EMULATION is set, supporting non-host -depths. +<item>Add loader infrastructure to implement inter-module version checks. -<item>Set the "monitor" parameters to allow the default resolution to be -a little smaller than the host resolution rather than simply 640x480. +<item>Use mprotect on NetBSD. -</itemize> +<item>Fix support for NetBSD/arm. -<sect1>Input Driver Enhancements +<item>Add support for <tt>R_SPARC_OLO10</tt> relocations. -<p> -<sect2>keyboard +<item>Make error messages for unsupported relocations more useful. + +<item>Improve the loader server's emulation of shmctl() calls. + +<item>Fix some problems with the a.out header macros used by the loader, +which was causing incorrect header interpretation for some a.out object +types. + +<item>Major loader enhancements, including: + + <itemize> + <item>Per-module export symbol lists. + + <item>Improved symbol hash. + + <item>A mechanism for specifying the scope of symbols. + + <item>Keep track of relocations, and undo them when they become unresolved + on module unload, and recalculate them when they change on module load. + + <item>Check relocations on each module load/unload, ensuring that function + references that are unresolved at any time are always mapped to the + catch-all function, preventing calls into nowhere. + + <item>Efficient handling of invariant relocations. + + <item>Cleanup/update the memleak stack trace code, and print a stack trace + when an unresolved function is called or when XFree86 aborts. + + <item>Update the catch-all function to identify the unresolved function that + was called. + + <item>Read the XFree86 executable's symbol table in order to get the most + useful stack traces, and use dladdr() where available for identifying shared + library references. + + <item>Cleanup and unify debug messages for the loader components. + + <item>Use module-instance-specific referenced and required symbol lists. + + <item>Update drivers to make use of some of the new loader functionality, + including the instance-specific ref/req lists, and some unloading of + modules when they are no longer needed. + + <item>Don't build the coff loader on platforms that it doesn't support. + + <item>Use stronger typing of the module-visible instance-specific module + descriptor. + + <item>No longer disable xf86UnloadSubModule() since the loader now handles + unloads and reloads cleanly. + + <item>Do not defer unloading drivers when using autoconfig, since that is + not necessary with the loader updates. + + </itemize> + +</itemize> + +<sect2>XFree86 core server and modules <p> <itemize> -<item>A bug in the application of the Linux <tt>KDKBDREP</tt> ioctl has -been fixed, preventing unnecessary use of a fallback that directly programs -the keyboard hardware and produces warning message with recent Linux kernels. +<item>Modify the handling of preferred EDID modes to allow user-specified +modes that are larger than the preferred mode. + +<item>Refine VGA routing emulation through Sun's Simba P2P bridges. + +<item>Allow a static server's -configure to generate an XF86Config for the +loader server. + +<item>Fix a bug relating to the forwarding of 64-bit memory addresses by +PCI-to-PCI bridges on 32-bit systems. + +<item>Fix a bug in the decoding of I/O forwarding by Cardbus bridges. + +<item>Update -configure to detect when wscons support should be used for the +keyboard on NetBSD. + +<item>Fix an endianness bug in the xf4bpp module. + +<item>Fix some of the endianness bugs in the vbe module. + +<item>Remove obsolete VBE functions that have not been compiled-in for some +time. + +<item>Fix VBE's reporting of video memory size. + +<item>Re-implement Alpha kludge in x86emu's ops.c to be more portable. + +<item>Intercept "raw" requests for PCI configuration space from video +BIOSes on all architectures. + +<item>Handle unaligned I/O requests more gracefully and be more tolerant +of spurious I/O errors in the int10 module. + +<item>Make sparse I/O masks more portable throughout the server. + +<item>Fix a long-standing off-by-one bug in the setting of RGB offsets +when the driver supplies RGB masks. + +<item>Make I/O error handling more reliable on SPARC. + +<item>Change the OS-specific module subdirectory name for all SunOS variants +from "solaris" to "sunos". + +<item>Port of SBUS drivers to SunOS variants. This also allows for multihead +using a mix of SBUS and PCI devices. + +<item>Fix text mode restore on x86/Solaris 8 and later. + +<item>Change autoconfiguration to include PCI and SBUS BusIDs in generated +device sections. This fixes some problems when fbdev is active. + +<item>Prevent the sharing of a PCI entity by more than one driver. + +<item>Insulate various common layer functions against out-of-bounds entity +indices. + +<item>Fix XAA's support for <tt>TRIPLE_BITS_24BPP</tt> on big-endian systems. + +<item>Fix unaligned access in XAA's handling of 24bpp. + +<item>The xf24_32bpp module is no longer used by any of our drivers, so don't +include it in static builds. + +<item>The xf8_32wid module is only used by the sunffb driver, so don't include +it in non-SPARC static builds. + +<item>Fix generic int10 memory accesses on little-endian systems. -<item>Differentiate between Alt+Ctrl+SPECIAL and Alt+Ctrl+Shift+SPECIAL -key sequences. +<item>Fix a SEGV that can occur under certain builds of glibc 2.3.4 and +up, when linux/int10 attempts to determine kernel support for the vm86() +system call. -<item>Avoid various keycode conversions on NEC PC-98 platforms. +<item>Add an xf86DeallocateGARTMemory() function. -<item>Fix off-by-one problem for keys on FreeBSD/sparc64. +<item>Make autoconfig stop at the first successful probe on each retry, +minimising unnecessary probes. </itemize> -<sect2>mouse +<sect2>TinyX <p> <itemize> -<item>Add a serial PNP entry for the Genius NetScroll+ mouse. +<item>Allow build-time selection of which font renderers get built in to +the TinyX servers. -<item>Fix a problem with the wsmouse driver losing events on 64-bit -architectures. +<item>Fix a problem where VT switching back to TinyX servers was failing +due to blocking on keyboard read. -<item>Add/improve protocol and device auto-detection for FreeBSD, Linux, -NetBSD, OpenBSD, and SunOS/Solaris, eliminating the need to provide any -of this information in the config file in the majority of situations. +<item>Fix a TinyX build issue under <tt>!XserverStaticFontLib</tt>. -<item>Increase the maximum number of buttons supported from 12 to 24. +<item>Move Xserver/*/tiny directories under Xserver/hw/tinyx. -<item>Fix a multiple-free bug, that could lead to a crash. +<item>TinyX build fixes. </itemize> -<sect2>elographics +<sect2>Xnest <p> <itemize> -<item>Fix problems where the driver gets out of sync under heavy loads. +<item>Add a "-noinput" option that allows Xnest to be run in a view-only mode. + +</itemize> -<item>Add an <tt>"AllowNoCntl"</tt> option, which allows the driver to be -used with some other protocols, like the SmartSet 2500s, which share the -same default protocol. +<sect2>Xsun +<p> -<item>Fix a problem with the cursor not correctly following the touch -in a dual-head configuration. This fix has also been applied to other -relevant input drivers. +<itemize> +<item>Fix incorrect bitsPerPixel for depth 12 in pixmap formats advertised by +the Xsun24 server. </itemize> -<sect2>eloinput +<sect2>cfb <p> + <itemize> -<item>A new driver for ELO Graphics 2500U USB touch screens. +<item>Fix a bug that occurs when using cfb to tile 32-bit rectangles on SPARC. + +<item>cfb24 is no longer needed. Keep the loadable module, but no longer +statically link it into servers. </itemize> -<sect2>fpit +<sect2>shadow <p> <itemize> -<item>Add support for the passive pen of the Stylistic 2400. - -<item>Fix some driver bugs. +<item>Rewrite shadowUpdateRotatePacked() to reduce cache misses. </itemize> -<sect1>XKB updates +<sect2>Xinerama <p> <itemize> -<item>Update the Hindi/Devanagari map. +<item>Cause the server to FatalError() when Xinerama attempts to create +a screen whose root depth has no visuals, causing Xlib to segfault. -<item>Add Sorbian map. +<item>Allow Xinerama to initialise even when there is only one screen +to combine. -<item>Add German Dvorak map. +<item>Make loadable modules and MI independent of Xinerama: -<item>Fix wrong brokenbar keysym in the de_CH map. + <itemize> + <item>Add a DIX helper to determine whether Xinerama is active and use it + instead of #ifdef's code in all loadable modules. -<item>Rename the microsoftprose keyboard model to microsoftprousb because it -is not Swedish-specific but a common USB variant. + <item>Re-implement, as a screen wrapper, Xinerama's PaintWindow*() hacks. -<item>Add nodeadkeys variant to the gb map. + <item>Move down to DIX Xinerama's only MI hook. -<item>Replace the comma keysym on the KPDL key in the Brazilian map with -KP_Separator. + </itemize> -<item>Add multi-layout compatible Hungarian, Azerbaijani, Canadian, -Mongolian, and Vietnamese maps. +</itemize> -<item>Update Serbian map with new variant. +<sect2>XFree86-DGA +<p> -<item>Add Genius KB-12e model to the inet map. +<itemize> +<item>Do not call a screen's PointerMoved entry if a DGA mode is active on that +screen. -<item>Update ABNT2 geometry (including two variants) and change the -Brazilian map to avoid ABNT2 specific keycodes section. +<item>Fix client-side framebuffer mapping on NetBSD. -<item>Add Classical Latin map. +<item>Make sure that DGAShutdown() is always called before HW state is restored +on exit and reset, and make sure that it is not called after the HW state has +been restored. -<item>Replace the Latvian map with a new one. +</itemize> -<item>Fix some errors in the Dzongka/Tibetan map. +<sect2>Render +<p> -<item>Add ur_PK (Urdu) map. +<itemize> +<item>Fix unaligned access in RenderCompositeGlyphs request. -<item>Fixes for the Bengali map. +</itemize> -<item>Add Sinhala (Sri Lanka) map. +<sect2>RandR +<p> -<item>Add missing keycode to the "xfree86" keycodes files. +<itemize> +<item>Use xf86SetViewport as well as SetCursorPosition during RandR +rotation, as xf86SetViewport will call AdjustFrame to reposition the +window if necessary and avoid the cursor ending up off screen. -<item>Update the mapping for the Microsoft Natural Multimedia keyboard. +<item>Add a new function xf86GetRotation() to allow third party modules +to obtain the current rotation. -<item>Fixes for the Croatian map. +<item>Fix up error case when rotation fails and the framebuffer needs to +be re-enabled. -<item>Add a Polish variant to the French keyboard layout. +</itemize> + +<sect1>Library, Client and Utility Updates + +<p> -<item>Add a standard Kyrgyz map. +<sect2>Xlib +<p> +<itemize> +<item>Fix typos in XErrorDB that were preventing descriptive messages +for some extension errors. </itemize> +<sect2>Xt +<p> -<sect1>X Server and Extension Updates +<itemize> +<item>Fix an uninitialised pointer dereference in Xt/Initialize.c on WIN32 +platforms that happens if <tt>$HOME</tt> is set in the environment. + +<item>Add support to Xt's string to float converter to read resources in +fractional notation. + +<item>Add some XChar2b string manipulation functions to Xt. +<item>Bump the minor revision of the Xt shared library to reflect +the fact that some new interfaces have been added. + +</itemize> + +<sect2>Xaw <p> + <itemize> -<item>Mesa as used in the XFree86 <tt>"GLcore"</tt> module for indirect -GLX rendering has been updated to version 6.2.1. -<item>Fixed bugs in the Screen Saver extension that could cause an X server -crash. +<item>Extend the tool tip resource for Xaw's simpleWidgetClass to allow +a function to be called -<item>Fixed a bug in the X-Resource extension that could cause an X -server crash when the client host and server host have different -endianness. +<item>Fix problems with Xaw's label widget when using XChar2b strings. -<item>Added support to the Xvfb server for specifying the screen origins -when Xinerama is enabled. +<item>Add a new connectionType property to Xaw's tree widget. -<item>Ensure that the Xvfb's root window depth and visuals are set -correctly. +<item>Make Xaw Form widgets inherit dimensions from their parent at widget +initialisation time. -<item>Work around bug in Mac OS X 10.1's AppKit that causes rootless -XDarwin to lock up when creating windows +<item>Add mouse wheel support for Scrollbars in Xaw's Viewport widget. -<item>Fix XDarwin's launch of X clients by double clicking in the Finder when -there is a space in the path. +<item>Fix a performance issue with Xaw's Tree widget caused by useless +relayouts. -<item>Allow XDarwin to interpret scroll wheel mouse events correctly when -the shift key is held down. +<item>Fix i18n for Xaw's tooltip widget. -<item>Add initial XInput support for XDarwin. +<item>Add two new functions that can be used to scroll the content of an +Xaw viewport from outside the viewportWidgetClass. -<item>Add an option for XDarwin to always use Mac command key equivalents. +<item>Fix the cursor in Xaw textWidget when the input field has focus. -<item>Make XDarwin not default to StaticColor on ix86. +<item>Bump the minor revision of the Xaw shared library to reflect +the fact that some new interfaces have been added. -<item>Fix a bug that caused restacks to be optimized away in rootless mode. +<item>Add user_data field to Xaw's simpleWidgetClass. -<item>Add support for dynamic screen configuration changes in rootless -XDarwin. +<item>Fix Xaw viewport scrollbar flickering problem. -<item>Fix a problem with multiple glyphs in the RENDER extension's -RenderAddGlyphs that caused malloc corruption. +</itemize> -<item>Fix a segfault when XAA's overlay acceleration is invoked with -the XaaNoSolidFillRect option. +<sect2>pswrap +<p> -<item>Fix the disabling of individual DPMS states. +<itemize> +<item>Fix a problem where pswrap generates a bogus .c file when the -h option +is not used. -<item>Rework the XFree86 server's SBUS code so that SBUS adapters are properly -detected on SunOS. +<item>Document pswrap's -f option. -<item>Auto-detect DPMS support based on EDID data. +</itemize> -<item>Fix DPMS enable/disable logic. +<sect2>mmapr, mmapw +<p> -<item>Allow multiple probe phases when using automatic configuration, which -allows the driver search to continue after failures at the PreInit stage. +<itemize> +<item>Extend mmapr and mmapw on Linux to allow specification of which +PCI address space (I/O or memory) to mmap. -<item>Update the static XFree86 driver list to allow automatic configuration -to work with statically linked XFree86 servers. +<item>Add options to mmapr and mmapw to allow unaligned accesses for testing +purposes -<item>Add a '-autoconfig' command line option to the XFree86 server to -enable automatic configuration even when a configuration file is present. +</itemize> -<item>Integrate the TinyX servers into the standard XFree86 build. +<sect2>cpconfig +<p> -<item>Fix a problem where a big request length of zero does not generate -a BadLength error. +<itemize> +<item>Use the same default XF86Config search path as the XFree86 server. -<item>Add a Distributed Multihead X server (DMX) and related extension. +</itemize> -<item>Fix a segfault in the cfb module. +<sect2>xterm +<p> +These changes correspond to xterm patches #200 through #212. -<item>Fixes for the MIT-SHM extension's Xineramafication. +<itemize> +<item>Improved behavior -<item>Fix detection of phantom PCI devices. + <itemize> + <item>add a new selection feature: regular expressions, and new resources + which specify what happens on multiple mouse clicks: on2Clicks, + on3Clicks, on4Clicks and on5Clicks. -<item>Fix x86emu's handling of the 0xe8 and 0xe9 opcodes. + <item>improve initialization of toolbar so that individual pulldown menus + are initialized on demand, as they are in the scenario where they + are invoked as popup menus. -<item>Modify x86emu's handling of SHLD/SHRD instructions to allow shifts -greater than 15 for 16-bit operands. This undocumented behaviour is -expected by the BIOS in an SM722 controller. + <item>improve error-reporting when chown/chmod of the pseudo-terminal + fails, e.g., if a copy of xterm which was designed to work with + old-style pseudo-terminals is not installed setuid or setgid. -<item>Avoid some references to unloaded data in the XFree86 server, which -can cause crashes in some situations. + <item>add support for interpreting the underline attribute as an italic + font in Xft mode. -<item>Change the DDC/EDID root window property data from signed to unsigned. + <item>modify configure script --disable-imake to use the script's + definitions anyway if it cannot detect imake. -<item>Fix the XFree86-Misc extension's PassMessage function. + <item>improve resource files to show how the menubar and popup menus can + be colored. -<item>Fix XFree86-DGA for multi-domain architectures. + <item>modify initialization of allowSendEvents and allowWindowOps to + prevent modification with the editres protocol. -<item>Extend the XF86Config format and parser/config to allow multiple Monitor -sections to be referenced from a Screen section. + <item>improved some of the built-in line-drawing glyphs. -<item>Allow multiple XFree86 configuration sources to be combined, and -add a -appendauto" command line option to allow automatic configuration data -to be appended to a partial static configuration. + <item>set the _NET_WM_PID property. -<item>Extend the XF86Config format and parser/config to allow multiple -ServerFlags, Files, and Module sections in a config file. + <item>update table for mk_width() from UnicodeData 4.1.0. -<item>Use a more complete set of the probed EDID data in determining the -default monitor parameters. + <item>implement the remaining pieces to make xterm allocate cells for + wide-characters when the "UTF-8" menu entry is selected. Also, load + the UTF-8 font when that menu entry is selected, or the escape + sequence for UTF-8 mode is received : -<item>Add a "preferred" video mode type, which can be obtained from the -probed EDID information, or from the static configuration. This allows -the native video mode to be used by default for digital panels. + <item>improve behavior when switching to UTF-8 mode after startup so + xterm will check if the current fonts are already wide + (ISO-10646-1). If they are not, xterm will use the utf8Fonts + subresource to load appropriate fonts. -<item>Add tentative support for newer iterations of HP's zx1 chipsets. + <item>modify initialization for wide-bold fontname, to search for one if + none is given. -<item>Fix xf86fbman's largest linear area offscreen computation. + <item>modify interaction between +u8 and locale resource to allow the + command-line option to override the resource. -<item>Print the XFree86 server's command line in the log file. + <item>modify initialization to decide whether to default to built-in + wcwidth() versus system's version based on the starting locale and + whether the system's version is poor quality. -<item>Update getconfig to work with older versions of Perl, and to -detect when the version of Perl is too old and when Perl is not available. + <item>make paste of UTF-8 faster for Western character sets by checking + range of incoming data. -<item>Extend automatic configuration and getconfig to work with SBUS video -devices in SPARC platforms. + <item>improve initialization due to utf8 resource by loading the + utf8Fonts resource in the case where locale resource is false. Also + in this case, do not disable switching UTF-8 mode on/off. -<item>Update the ValidMode functions in most video drivers to return -more specific status values when a mode is rejected. + </itemize> -</itemize> +<item>Modified behavior -<sect1>Client and Library Updates + <itemize> + <item>modify parsing of OSC (and SOS, etc), strings so their contents are + not interpreted as UTF-8. This allows non-ASCII title strings to be + set, provided that the window manager complies. -<p> + <item>modify parsing of control sequence CSI T to allow scroll-down to be + sent while mouse tracking is enabled. -<sect2>Xlib and related libraries -<p> -<itemize> -<item>Fix an Xlib segfault that may occur when IPv6 XDM-AUTHORIZATION-1 data is -present in the .Xauthority file. + <item>modify command-processing to accept an optional parameter that + tells xterm which shell program to use. -<item>Add WrapHelp.c and enable XdmAuth by default. + <item>change xterm manpage to show the actual color resource names + XtDefaultForeground and XtDefaultBackground rather than black and + white. -<item>Fix a null dereference in libSM when given a bad previous session ID. + <item>modify xterm-new terminfo entry to use capabilities for shifted + scroll forward/reverse as shifted cursor up/down. -</itemize> + <item>remove menu entry for "Enable Curses Emulation" (to make room for + "Select To Clipboard"). -<sect2>Xterm -<p> -The changes to xterm since XFree86 4.4 are: + <item>modify resource files to make the font-resources a little more + specific, e.g., changing "*VT100*" to "*VT100.", to make the + distinction between VT100.font and VT100.utf8Fonts.font sharper, in + case a packager modifies one of those. -Improved behavior -<itemize> -<item>Change resource settings for color4 and color12, add some discussion - in XTerm-col.ad. + <item>allow cursor to have the same color as foreground (text), since it + is rendered as reverse. -<item>Modify the criteria for disowning primary selection. Previously, - this happened anytime the cursor was moved before the end of the - selection. That would ensure that any insert/delete of char or - line, as well as scrolling, would disown the selection. The new - criteria change this to checking if the operations would modify - the data which is highlighted. + <item>modify Imakefile to use setgid mode for installing with Linux, + OpenBSD and FreeBSD. -<item>Change default translations so a BtnDown which is not recognized - is simply ignored rather than emitting a bell. That makes it - less obtrusive when the user tries to use a mouse which provides - more capabilities than the X mouse driver supports, e.g., one - with a horizontal scroll wheel. + </itemize> -<item>Modify to allow turning UTF-8 mode via escape sequence even if - -wc option was not given at startup. +<item>New resource settings -<item>Add menu items and corresponding actions for switching on/off the - UTF-8 mode and Xft (TrueType) support. + <itemize> -<item>Modify FreeType support to allow resizing the font, in the same - ways the window can be resized if fixed fonts are used. The - relative font sizes are derived from the fixed font sizes. + <item>add utf8Title resource and menu entry, allowing the user to control + whether title strings are interpreted as ISO-8859-1 or UTF-8 + encoding. -<item>Implement blinking text, using the timer for blinking cursor. + <item>add scrollBarBorder resource. -<item>Add translation to ASCII of commonly-used characters that groff - translates to Unicode, when the font in use does not provide the - corresponding glyphs. + <item>add resource selectToClipboard, action set-select and a menu entry + to allow users to switch between PRIMARY and CLIPBOARD for + select/paste. -<item>Modify constraints in form used to layout toolbar, to work with - newer Xaw in XFree86 4.x. + <item>add resource mkWidth and command-line option -mk_width to control + whether xterm uses the built-in version of wcwidth(). -<item>Make active-icon work properly when TrueType fonts are used, as - well as when UTF-8 mode is used. + <item>add resource settings for minimum/maximum input buffer size, and + call to sched_yield to improve performance with newer Linux kernels -<item>Improve rendering for Xft, allow it to draw non-linedrawing - characters such as "pi", which were drawn from internal tables - with patch #180. + <item>add simpler resource keyboardType which, when set, overrides the + individual keyboard-type resources and eliminates the possibility + of conflict between them. -<item>Modify initialization of 256- and 88-colors so that colors beyond - 16 are normally not X resources. This works around a hard-coded - limit in Xt which breaks xterm when 256-colors and luit are both - configured (report by Noah Friedman). + </itemize> -<item>Fix problem responding to session management events, e.g., which - would make logging out very slow. +<item>New configure script options -</itemize> + <itemize> -Modified behavior + <item>the --with-utmp-setgid allows the packager to configure xterm to + use setgid permissions for utmp. -<itemize> + <item>add configure option --enable-readline-mouse, which turns on the + experimental OPT_READLINE code. -<item>Enable utmpx support for NetBSD 1.6C and newer. + <item>add --enable-narrowproto configure option to accommodate X.org + "modular" build. -<item>Modify Help() to make "xterm -h" write to standard output rather - than standard error. + <item>add configure --with-app-defaults option to allow app-defaults + directory for install-rules to be customized. -<item>Improve error-reporting for root user by checking if $DISPLAY is - set rather than using the useless message from X11 library. + <item>add configure option --with-tty-group to help work around + deficiencies in packager's build environment. -<item>Improve $WINDOWID for configuration with toolbar by making it - refer to the top-level shell rather than the parent of the - current window. For that case, the parent is a form widget, - which does not have a name, which made the $WINDOWID not very - useful as a parameter for xwininfo. + <item>add configure --with-setuid and --with-reference options to allow + packagers more flexibility in customizing install permissions. -<item>Improve pattern used in uxterm to check for UTF-8 locale, e.g., - for HPUX. + <item>add configure --with-symlink option to make it simpler to install + successive versions of xterm renamed using the --program-prefix, + etc., options with a symbolic link pointing to the most recent. -<item>Modify uxterm script to use locale program to verify if the - derived locale is installed. + <item>add a configure check for the actual path of luit, to work around + broken imake configurations. -<item>Add case to uxterm to accommodate locales ending with "@euro", - e.g., fr_FR.UTF-8@euro. + <item>add a configure check for pkg-config. -<item>For Linux, if IUTF8 is defined, e.g., on recent 2.6.x kernels, - set the corresponding flag for the slave pty, to enable UTF-8 - interpretation of backspace in cooked mode. + <item>modify install rule for uxterm to account for the --program-prefix, + etc., options by invoking the transformed name of xterm rather than + simply "xterm". -<item>Modify faceSize resource to use a floating-point internal value. + <item>modify configure --with-app-defaults option to allow + --without-app-defaults. -<item>Modify XTerm.ad to set saveLines default to 1024. + <item>add configure option --disable-leaks. -<item>Change xterm version string to use __vendorversion__ where that - is available, and "XTerm" otherwise. Rather than reporting the - version of X that was current when xterm was modified, it reports - the version against which it was built. + <item>add experimental option to allow applications to get or set the + selection data as a BASE64 string. -</itemize> + </itemize> -New resource settings +<item>Other new features -<itemize> + <itemize> -<item>Add scoFunctionKeys resource, to match manpage. + <item>add select-cursor-extend() action. -<item>Add -fd option and resource faceNameDoublesize to specify - double-wide fonts with Xft. + <item>add environment variables $XTERM_SHELL and $XTERM_VERSION. -<item>Add resource showMissingGlyphs to outline places on the screen - where a font lacks the corresponding glyph. + <item>add menu entry (alt-esc) and corresponding action (alt-sends-esc) + to toggle the eightBitInput resource setting. -<item>Add resource showBlinkAsBold to control whether blinking text - should be shown as bold or actual blinking text. + <item>add command-line options (-tb, +tb) and resource toolBar to allow + menu/toolbar to disabled or enabled at startup. -<item>Add utmpDisplayId resource to allow users to control whether the - display identifier (display number and screen number) are - retained in the connection information recorded in utmp. + <item>add extended shift- and control-modifier cursor keys to + "xterm+pcfkeys" terminfo entry to correspond to ncurses 20050430 + patch. -<item>Add bellOnReset resource to allow users to disable bell which - sounds on hard reset since patch #183 changes to DECSCL. + <item>enable lastlogx support for NetBSD (was added, but not enabled in + patch #186). -</itemize> + </itemize> -New configure script options +<item>Bug-fixes (see http://invisible-island.net/xterm/xterm.log.html for a +more complete list): -<itemize> + <itemize> -<item>Add --disable-setuid option to configure script. + <item>correct typo in configure script's --enable-dec-locator option -<item>Add --disable-full-tgetent option to configure script, allowing - one to ignore a termcap library in favor of ncurses/curses. + <item>correct a typo in CF_FUNC_TGETENT introduced in patch #198 fix -</itemize> + <item>fix an off-by-one error parsing -S/nn option. -Other new features + <item>add a check in Bell to ensure that the VT100 widget is realized, + since it may be called by xtermLoadFont given an incorrect font + resource. -<itemize> + <item>correct treatment of iconBorderWidth for resizing an active-icon, + and its description in manpage. -<item>Add mini-luit feature, which supports Latin9 directly rather than - via luit, provided that Unicode fonts are used. + <item>add a limit check for scrolling margins in a one-line screen, + overlooked in fixes for patch #198. -<item>Add dynamic abbreviation support like Emacs. + <item>correct computation of width for wide characters with the invisible + attribute. -<item>Add "erase2" and "eol2" keywords to ttyModes resource, for - recent/current FreeBSD. + <item>improve fix from patch #198 for Cleanup() by ensuring it is + not called from the SIGCHLD handler. -</itemize> + <item>fixes to make -geom option work properly with the toolbar + configuration. -Bug-fixes (see http://invisible-island.net/xterm/xterm.log.html for a -more complete list): + <item>fix logic in find_utmp, which did not reset result in getutid(), + causing an infinite loop in some conditions. -<itemize> + <item>fix a rare case where text would be written with the wrong colors + because output of scrolled text would reset the colors and the new + text would be written with the same colors. -<item>Modify initialization and cleanup of utmp data to also compare - the ut_line member. + <item>implement logic in termcap query to process multiple parameters as + documented in ctlseqs.ms -<item>Correct table entry for DEL in the ground state, which marked it - as a printable character from patch #171. + <item>fix buffer size used for termcap query, which was not long enough + for the terminfo "colors" name. -<item>Correct change from patch #157 which uses getlogin() to check for - an alias; the storage used for the related getpwuid() call was - overwritten by the data used for comparison. + <item>initialize the saved-cursor data so a restore-cursor operation + without a preceding save-cursor operation will not modify the + foreground color. -<item>Correct case of SCS for character set 0 (line-drawing) to allow - it to be selected into GR. + <item>modify Imakefile to work around old problems in imake configuration + to allow test-builds using xmkmf on Linux. (This was not noticed + since several releases had broken definitions relating to Xft which + were harder to work around). -<item>Modify creat_as() to only fork if xterm is actually running as - setuid and/or setgid. This works around a Cygwin bug which hangs - when logging is enabled and makes xterm a little faster for - systems using interfaces such as utempter. + <item>remove default translations for dabbrev-expand() due to conflicts + with existing keyboard arrangements. -<item>Modify Cleanup() to avoid operations such as X calls that might - use unsafe functions when it is called by a signal handler. + <item>set icon border width explicitly to work around fvwm problem with + active icon resizing. -<item>Check for type of failure in xim_real_init() to avoid looping - when the problem is an unsupported input method rather than a - failure to connect to the XIM server. Problem was introduced in - patch #175. + <item>eliminate a retry for a better-matching bold font, to work around + recent font server changes. -<item>Add missing #undef OPT_SESSION_MGT to xtermcfg.hin to make the - configure script's --disable-session-mgt option work. + <item>modify prefix/suffix transformation in makefile to make uxterm + install properly on Cygwin. -<item>Correct options parsing for -into option so it can be combined - with -e. + <item>correct termcap "me" (mode-end) string so it does not modify the + alternate character set. -<item>Make escape sequence reporting dynamic colors consistent with the - logic that sets it; choosing the opposite color when reverse - video is set. + <item>modify computation of rows/columns on resize to avoid extending + beyond the given limits, e.g., if resizing in response to a + "maximize" in Gnome or KDE which do not use the window manager + hints for this case. -<item>Fix a repainting bug introduced in patch #180: when using a font - lacking line-drawing characters, a repaint of the screen could - skip horizontally an extra amount after filling in the missing - character. + <item>make a special case of resizing work like vt100: a hard reset also + resets the 132/80 mode. The code to support this was present since + X11R5, but not used because the corresponding initial state of the + -132 option was not saved. -<item>Modify terminfo to accommodate luit, which relies on G1 being - used via an ISO-2022 escape sequence. Note that this relies in - turn on bug fixes in ncurses after the 5.4 release. + </itemize> </itemize> -<sect2>Luit +<sect2>GLX/DRI <p> <itemize> -<item>Fix a synchronization problem with luit's handling of tty settings. +<item>Mesa build fixes for NetBSD/sparc64. -<item>Extract information from the pty before forking rather than after, -to avoid conflicting with the child process's modifications to the line. +<item>Solaris/SPARC 64-bit libGL fixes. </itemize> -<sect2>GLX/DRI +<sect2>dbedizzy <p> - <itemize> -<item>Mesa and its DRI drivers have been updated to version 6.2.1, plus -some bug fixes. +<item>Resurrect this DBE extension test utility. -<item>Add a 915G DRI driver. +</itemize> -<item>Fix a GLX multi-thread bug. +<sect2>xclock +<p> + +<itemize> +<item>Use the Xaw tooltip to display the date in xclock. </itemize> @@ -921,9 +1160,24 @@ <p> <itemize> -<item>Add support for XPM icons. +<item>Add a new function to allow the window text title to be changed +interactively. -<item>Add IconMaxWidth and TitleIndent configuration parameters. +<item>Allow environment variables to be used in menu names. + +<item>Add a new "f.totalzoom" function that zooms windows to cover the whole +area of a screen with no window decoration visible. + +<item>Don't highlight "f.nop" menu items in menus. + +</itemize> + +<sect2>xbiff +<p> + +<itemize> +<item>Add a tooltip to xbiff that shows the number of messages in a mail +folder. </itemize> @@ -931,16 +1185,17 @@ <p> <itemize> -<item>Improve the operation of IPv6-enabled xdm when the platforms's -IPv6 support is disabled. +<item>Fix a potential infinite loop when the "willing" command fails to produce +any output. -<item>Make use of Xlib's _XGetHostname rather than attempting to duplicate -it. +</itemize> -<item>Fix sessreg for NetBSD. +<sect2>xfd +<p> -<item>Update docs and config to handle authDir being in a non-default -location. +<itemize> +<item>Fix a bug that prevents properly paging through xft fonts beyond +0xFFFF. </itemize> @@ -948,57 +1203,63 @@ <p> <itemize> -<item>Fix log file opening with the '-user nobody' option. +<item>Modify the font server transport messages to go through xfs's +logging mechanism. + +<item>Fix a bug introduced when syslog support was added that prevents +exit on fatal errors. </itemize> -<sect1>I18n and Fonts +<sect2>xinit <p> -<itemize> -<item>FreeType has been updated to version 2.1.8. -<item>The FreeType-1.x based X-TrueType XFree86 server font backend has -been retired. The functionality it provides is now available in the -"FreeType" font backend. The old <tt>"xtt"</tt> module is now a wrapper -that loads the <tt>"freetype"</tt> module. +<itemize> +<item>Send SIGINT to slowing exiting X servers instead of SIGKILL. This +works together with the new SIGINT handling in the X servers, and results +in a clean exit. Sending SIGKILL only results in the hardware state not +being restored, often requiring a reboot to recover from. -<item>A bug that prevented the <tt>VeraIt.ttf</tt> font from being -installed has been fixed. +</itemize> -<item>Fix a problem that could cause apps using the zh_CN.UTF-8 locale -to crash. +<sect2>xmessage +<p> -<item>Fix freetype module segfault with some Type1 fonts. +<itemize> +<item>Fix a bug in the handling of escapes in button labels. -<item>Replace unicode keysyms in the en_US.UTF-8 Compose file with "traditional" -ones where such keysyms exist. +</itemize> -<item>Fix the ct_encoding sequence in the zh_CN.gbk locale. +<sect2>xvidtune +<p> -<item>Update the 8859-7 unicode conversion data file to the current version. +<itemize> +<item>Fix the -timeout <n> option. -<item>Update the gb3212.1980-0 encoding to handle fonts that do not have -a unicode table. +</itemize> -<item>Add encoding files for cns11643-1, cns11643-2, cns11643-3, and -suneu_greek. -<item>Add support for the si_LK.UTF-8 locale. +<sect1>I18n and Fonts +<p> +<itemize> +<item>Update mkfontscale's handling of font weights. -<item>Reinstate the original mkfontdir program, because its mkfontscale -equivalent does not handle creating encodings.dir files as well as is -necessary. +<item>Replace lib/font/fontfile/decompress.c with a version derived from +BSD's src/usr.bin/compress/zopen.c. -<item>Fix for fstobdf generating corrupted BDF files. +<item>Modify the fontconfig library to use getpwnam/getpwuid to find the +home directory when <tt>$HOME</tt> is not set. -<item>Update locale info for Kinyarwanda, the language of Rwanda. +<item>Fix a bug in fontconfig's pattern matching that can cause FcFontMatch() +to fail when it shouldn't. -<item>Add nine missing South African locales. +<item>Fix a double-free problem in fontconfig. -<item>Add extra fontset records into XLC_LOCALE, fixing problems with text -output by Xuft8 functions under non-Unicode locales. +<item>Rework printf format specifiers used in XLFD code to make them more +portable and avoid infinite loops in some glibc versions. -<item>Add a Kyrgyz locale. +<item>Update the Serbian locale naming to reflect the country's name change +from "Yugoslavia" to "Serbia and Montenegro". </itemize> @@ -1006,34 +1267,17 @@ <p> <itemize> -<item>Numerous fixes and enhancements for the Solaris/SPARC platform support, -including the ability to build 64-bit shared libraries. - -<item>Support added for OpenBSD/amd64. - -<item>Differentiate left and right modifier keys on Mac OS X 10.3. - -<item>Fix some path-related issues on OS/2 with xman and xf86cfg. +<item>Fix some cases in the Darwin build where a variable is declared +static and later as extern. -<item>Update the transport layer to allow LOCAL SCO connection types to be -used for more than just X protocol connections. +<item>Avoid /tmp files in NetBSD.cf's man page creation. -<item>Cleanups for the SCO port. +<item>Install man page source as well as formatted man pages on NetBSD. -<item>Fixes for FreeBSD/amd64 support. - -<item>Add support for newer UltraSPARC variants to the SunOS/Solaris and -Linux ports. - -<item>Understand the PCI bus naming scheme found in Linux 2.6 kernels. +<item>Fix a problem where builds would continue past errors on NetBSD. </itemize> -<!-- -<sect>Summary of new features in &prevrelvers;. -<p> ---> - <sect>Drivers<label id="drivertables"> <p> @@ -1049,6 +1293,7 @@ <tabrow><tt>apm</tt><colsep>Alliance Pro Motion<colsep><htmlurl name="README.apm" url="apm.html"></tabrow> <tabrow><tt>ark</tt><colsep>Ark Logic<colsep> </tabrow> + <tabrow><tt>aspeed</tt><colsep>ASPEED Technology<colsep> </tabrow> <tabrow><tt>ati</tt><colsep>ATI<colsep><htmlurl name="README.ati" url="ati.html">, <htmlurl name="README.r128" url="r128.html">,</tabrow> @@ -1115,14 +1360,16 @@ <tabrow><tt>trident</tt><colsep>Trident<colsep><htmlurl name="trident(4)" url="trident.4.html"></tabrow> <tabrow><tt>tseng</tt><colsep>Tseng Labs<colsep> </tabrow> - <tabrow><tt>via</tt><colsep>VIA<colsep><htmlurl - name="via(4)" url="via.4.html"></tabrow> <tabrow><tt>vesa</tt><colsep>VESA<colsep><htmlurl name="vesa(4)" url="vesa.4.html"></tabrow> <tabrow><tt>vga</tt><colsep>Generic VGA<colsep><htmlurl name="vga(4)" url="vga.4.html"></tabrow> + <tabrow><tt>via</tt><colsep>VIA<colsep><htmlurl + name="via(4)" url="via.4.html"></tabrow> <tabrow><tt>vmware</tt><colsep>VMWare guest OS<colsep><htmlurl name="vmware(4)" url="vmware.4.html"></tabrow> + <tabrow><tt>xgi</tt><colsep>Xabre Graphics Inc<colsep><htmlurl + name="xgi(4)" url="xgi.4.html"></tabrow> </tabular> </table> @@ -1174,6 +1421,8 @@ name="kbd(4)" url="kbd.4.html"></tabrow> <tabrow><tt>keyboard</tt><colsep>generic keyboards<colsep><htmlurl name="keyboard(4)" url="keyboard.4.html"></tabrow> + <tabrow><tt>magictouch</tt><colsep>MagicTouch ProE-X<colsep><htmlurl + name="magictouch(4)" url="magictouch.4.html"></tabrow> <tabrow><tt>microtouch</tt><colsep>MicroTouch<colsep> </tabrow> <tabrow><tt>mouse</tt><colsep>most mouse devices<colsep><htmlurl name="mouse(4)" url="mouse.4.html"></tabrow> @@ -1431,14 +1680,14 @@ <p> XFree86 &relvers; includes sources for FreeType version &freetypevers;, -and, by default, they are built and installed automatically. +and, by default, it is built and installed automatically. </sect2> <sect2>Application Support For Anti-Aliased Text <p> -Only three applications have been modified in XFree86 &relvers; to work +Only three applications have been modified in this release to work with the Render extension and the Xft and FreeType libraries to provide anti-aliased text. Xterm, xditview and x11perf. Migration of other applications may occur in future releases. @@ -1633,7 +1882,7 @@ <sect1>Luxi fonts from Bigelow and Holmes <label id="luxi"> <p> -XFree86 now includes the ``Luxi'' family of Type 1 fonts and TrueType +XFree86 includes the ``Luxi'' family of Type 1 fonts and TrueType fonts. This family consists of the fonts ``Luxi Serif'', ``Luxi Sans'' and ``Luxi Mono'' in Roman, oblique, bold and bold oblique variants. The TrueType version have glyphs covering the @@ -1681,190 +1930,98 @@ <descrip> <tag>New Features, Enhancements and Updates:</tag> <descrip> - <tag>Xterm enhancements and updates:</tag>Thomas Dickey + <tag>Security Updates:</tag> Marc La France. + + <tag>ASPEED Technologies driver:</tag>Y. C. Chen, ASPEED Technologies. - <tag>Integrate TinyX into the mainline XFree86 build:</tag>X-Oz Technologies + <tag>Xabre Graphics driver:</tag>Jong Lin, XGI. - <tag>Intel i915GM support, dual head i830/i855/i915 support:</tag>Tungsten - Graphics, Alan Hourihane, Keith Whitwell + <tag>X server extension rework:</tag> Marc La France. - <tag>Automatic configuration enhancements:</tag>X-Oz Technologies, David Dawes + <tag>Loader Enhancements:</tag>David H. Dawes, X-Oz Technologies. - <tag>Distributed Multihead X:</tag>Kevin Martin, Rik Faith + <tag>Intel i945G/i945GM support and other driver enhancements:</tag>Alan + Hourihane, Tungsten Graphics. - <tag>Preliminary work on SunOS/SPARC and IRIX ports:</tag>Marc La France + <tag>NVIDIA driver updates and new hardware support:</tag>Mark Vojkovich + <tag>Improved SunOS/SPARC and SBUS support:</tag> Marc La France. + + <tag>Xterm enhancements and updates:</tag>Thomas Dickey. + + <tag>Xaw enhancements:</tag>Alexander Pohoyda. </descrip> + <tag>Integration:</tag> <descrip> - <tag>General Integration of Submissions:</tag>David H. Dawes, Marc La France, - Alan Hourihane, Ivan Pascal. - <tag>DRI Integration:</tag>Alan Hourihane, David H. Dawes. + <tag>General Integration of Submissions:</tag>Marc La France, David H. Dawes. </descrip> <tag>Release Engineering:</tag>David H. Dawes. <tag>Patches and other submissions (in alphabetical order):</tag> -Szilveszter Adam, -Tim Adye, -Taneem Ahmed, +ASPEED Technologies, Andrew Aitchison, -Raoul Arranz, -Zaeem Arshad, -Dwayne Bailey, -Ilyas Bakirov, -Denis Barbier, -Kyle Bateman, -J. Scott Berg, -Thomas Biege, -Dmitry Bolkhovityanov, -H Merijn Brand, +James Ascroft-Leigh, +Étienne Bersac, Peter Breitenlohner, -Benjamin Burke, -Dale L Busacker, -busmanus, -Julian Cable, -Mike Castle, -David M. Clay, -Philip Clayton, +Terry Chang, +Y. C. Chen, +Jeff Chua, +James Cloos, Alan Coopersmith, -Ricardo Cruz, -Michel Dänzer, -J. D. Darling, +Miguel González Cuadrado, David Dawes, -Michael Dawes, -Rafael Ávila de Espíndola, -Rick De Laet, -Josip Deanovic, -Angelus Dei, -Laurent Deniel, Thomas Dickey, Stefan Dirsch, -Charles Dobson, -DRI Project, -Emmanuel Dreyfus, -Boris Dusek, -Georgina O. Economou, -Egbert Eich, Bernd Ernesti, -Chris Evans, -Rik Faith, -Adrian Fiechter, -Matthew Fischer, -FreeType Team, -Terry R. Frienrichsen, -Christopher Fynn, -Hubert Gburzynski, -Nicolas George, +Jordan Frank, +Will L G, Frank Giessler, -Fred Gleason, -Dmitry Golubev, -Alexander Gottwald, -Herbert Graeber, -Miroslav Halas, -John Harper, -Harshula, -John Heasley, -Matthieu Herrb, -David Holl, -Alex Holland, -Peng Hongbo, +Thorsten Glaser, +Damian Janusz Gruszka, +Lukas Hejtmanek, +Evil Mr Henry, +Jens Herden, Alan Hourihane, -Harold L Hunt II, -Alan Iwi, -Timur Jamakeev, -Paul Jarc, -Kean Johnston, Nicolas Joly, -Mark Kandianis, -Kaleb Keithley, -Chamath Keppitiyagama, -Jung-uk Kim, +Bang Jun-Young, +Alexander Kabaev, Satoshi Kimura, -Michael Knudsen, -Vlatko Kosturjak, -Alexei Kosut, -Anton Kovalenko, -Joachim Kuebart, +Milos Komarcevic, Marc La France, -David Laight, -Zarick Lau, -Pierre Lalet, -Michael Lampe, -Lanka Linux User Group, -Nolan Leake, -Werner Lemberg, Dejan Lesjak, -Noah Levitt, -Greg Lewis, -Bernhard R Link, -Jonas Lund, -S. Lussos, -Torrey T. Lyons, -Roland Mainz, -N Marci, -Kevin Martin, -Stephen McCamant, -Mesa Developers, +Khong Jye Liew, +Jong Lin, +Michael Lorenz, +Michael Macallan, +Michal Maruska, Luke Mewburn, -Petr Mladek, -Bram Moolenaar, -Steve Murphy, -Ishikawa MUTSUMI, -Radu Octavian, -Lee Olsen, -Greg Parker, +Timothy Musson, +Newsh, +Takaaki Nomura, Ivan Pascal, -Alexander E. Patrakov, -Mike Pechkin, -Soós Péter, -Zvezdan Petkovic, +Bob Peterson, +Pierre, +Aaron Plattner, Alexander Pohoyda, -Xie Qian, -Bill Randle, -Adam J. Richter, -Tim Roberts, -Bernhard Rosenkraenzer, -Andreas Rüden, -Steve Rumble, -Oleg Safiullin, -Ty Sarna, -Leo Savernik, -Barry Scott, -Shantonu Sen, -Yu Shao, -Andreas Schwab, -Matthias Scheler, -Dan Shearer, -Michael Shell, -Paul Shupak, -Alexander Stohr, -Marius Strobl, -Mikko Markus Torni, -Jess Thrysoee, -Izumi Tsutsui, +Jeremy C. Reed, +Conrad Schuler, +Bruno Schwander, +Olaf Seibert, +Aaron Solochek, +Helmar Spangenberg, +Ken Stailey, +Tobias Stoeckmann, Tungsten Graphics, -Ryan Underwood, -Tristan Van Berkom, -Michael van Elst, -Phillip Vandry, -Roman Vasylyev, -Luc Verhaegen, -Rodion Vshevtsov, +James Richard Tyrer, +Staffan Ulfberg, +Denis Vlasenko, Mark Vojkovich, -Edi Werner, -Keith Whitwell, -Scot Wilcoxon, +Tom Williams, Dave Williss, -Thomas Winischhofer, -Kuang-che Wu, X-Oz Technologies, -Chisato Yamauchi, -Michael Yaroslavtsev, -David Yerger, -Su Yong, -Hui Yu, -Sagi Zeevi, -Christian Zietz +XGI, +Christos Zoulas. <tag>Webmaster:</tag>Georgina O. Economou Index: xc/programs/Xserver/hw/xfree86/doc/sgml/add.sh diff -u xc/programs/Xserver/hw/xfree86/doc/sgml/add.sh:1.4 xc/programs/Xserver/hw/xfree86/doc/sgml/add.sh:1.5 --- xc/programs/Xserver/hw/xfree86/doc/sgml/add.sh:1.4 Mon Feb 14 23:07:54 2005 +++ xc/programs/Xserver/hw/xfree86/doc/sgml/add.sh Sun Apr 23 13:03:51 2006 @@ -1,13 +1,31 @@ #!/bin/sh # -# $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/add.sh,v 1.4 2005/02/15 04:07:54 dawes Exp $ +# $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/add.sh,v 1.5 2006/04/23 17:03:51 dawes Exp $ # + +sgmlfile=index.sgml +pdfprefix=../PDF/ + +while [ $# -gt 1 ]; do + case $1 in + -f) + shift + sgmlfile="$1" + ;; + -p) + shift + pdfprefix="$1" + ;; + esac + shift +done + name=`basename $1 .sgml` sgmlfmt -f index $1 | \ sed -e 's,<title>,<item><htmlurl name=",' \ - -e 's,," url="'$name.html'"> ,' \ + -e 's,," url="'$name.html'"> ,' \ -e 's,,,' \ -e 's,,,' >> index.sgml + -e 's,, -->,' >> $sgmlfile exit 0 Index: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml diff -u xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml:3.43 xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml:3.46 --- xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml:3.43 Tue Feb 25 14:31:02 2003 +++ xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml Mon Jun 6 17:21:41 2005 @@ -8,14 +8,10 @@ ATI Adapters README file <author>Marc Aurele La France -<date>2002 February 12 - - - - +<date>2005 June 06 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml,v 3.43 2003/02/25 19:31:02 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml,v 3.46 2005/06/06 21:21:41 tsi Exp $ </ident> <abstract> @@ -28,12 +24,12 @@ <!-- Begin the document --> <sect>Statement of intent<p> -Generally speaking, the driver is intended for all ATI video adapters, +Generally speaking, this driver is intended for all ATI video adapters, providing maximum video function within hardware limitations. The driver is also intended to optionally provide the same level of support for generic VGA or 8514/A adapters. -This driver is still being actively developed, meaning that it currently does -not yet fully meet these goals.<p> +As this driver is still being actively developed, it currently does +not yet fully meet all of these goals.<p> The driver will provide <itemize> <item>accelerated support if an ATI accelerator is detected <it>and</it> the @@ -45,40 +41,49 @@ <item>generic VGA support if a non-ATI VGA-capable adapter is detected <it>and</it> the user has requested such support. </itemize> -Thus, the level of support provided not only depends on what the driver detects -in the system, but also, on what the user specifies in the XF86Config file. +Thus, the level of support depends not only on what the driver detects +in the system, but also on what the user specifies in the XF86Config file. + See the <bf>``XF86Config specifications''</bf> section below for details.<p> -If none of the above conditions are met, the ATI driver will essentially -disable itself to allow other drivers to examine the system.<p> -Note that I am currently considering removing the driver's support for generic + +If none of the aforementioned conditions are met, the ATI driver will +essentially disable itself to allow other drivers to examine the system.<p> + +Note: I am currently considering removing the driver's support for generic VGA. -If you have any concerns about this, please contact me at -<email>tsi@xfree86.org</email>. +If you have concerns about this decision, please contact me at +<email>tsi@xfree86.org</email> and I will address them. + <sect>A note on acceleration<p> The meaning of ``acceleration'', as used in this document, needs to be clarified. Two of the many components in an accelerator are the CRT controller (CRTC) and the Draw Engine. This is in addition to another CRTC that, generally, is also present in the -system (often in the same chip) and typically provides EGA, VGA or SuperVGA +system, often in the same chip and typically provides EGA, VGA or SuperVGA functionality.<p> + A CRTC is the component of a graphics controller that is responsible for reading video memory for output to the screen. A Draw Engine is an accelerator component that can be programmed to manipulate video memory contents, thus freeing the CPU for other tasks.<p> + When the VGA CRTC is used, all drawing operations into video memory are the responsibility of the system's CPU, i.e. no Draw Engine can be used. On the other hand, if the accelerator's CRTC is chosen to drive the screen, the Draw Engine can also be used for drawing operations, although the CPU can still be used for this purpose if it can access the accelerator's video memory.<p> + Video acceleration refers to the programming of an accelerator's Draw Engine to offload drawing operations from the CPU, and thus also implies the use of the accelerator's CRTC.<p> + <sect>Current implementation for ATI adapters<p> The driver currently supports the SuperVGA capabilities of all ATI adapters except some early Mach8 and Mach32 adapters that do not provide the required functionality. + This support works for monochrome, 16-colour and 256-colour video modes, if one of the following ATI graphics controller chips is present: <verb> @@ -89,6 +94,7 @@ 264VT4, 264GT-B (3D Rage II), 3D Rage IIc, 3D Rage Pro, 3D Rage LT, 3D Rage LT Pro, 3D Rage XL, 3D Rage XC, 3D Rage Mobility (including the -M and -P variants)</verb> + The driver also supports 32K, 64K and 16M-colour modes on the 264xT and 3D Rage series of adapters using the accelerator CRTC (but not the VGA CRTC).<p> The newer Rage 128 and Radeon chips are not yet supported by this driver. @@ -97,6 +103,7 @@ drivers. This driver will also invoke the appropriate driver if it finds Rage 128 and/or Radeon adapter(s) in the system.<p> + Adapters based on the above chips have been marketed under a rather large number of names over the years. Among them are: @@ -119,8 +126,9 @@ All-In-Wonder PRO, 3D Pro Turbo, XPERT@Play, XPERT@Play 98, XPERT@Work, XPERT 98, XPERT LCD, XPERT XL</verb> -Also, a number of mainboards, laptops and notebooks harbour a Mach32 or Mach64 -controller.<p> + +There are also a number of mainboards, laptops and notebooks that harbour a +Mach32 or Mach64 controller.<p> VGAWonder, Mach8 and Mach32 ISA adapters are available with or without a mouse.<p> These adapters are available with a variety of clock generators and RAMDACs. @@ -129,10 +137,10 @@ For all but Mach64 adapters, this driver still does not provide support for accelerated drawing to the screen. This means that all drawing is done by the CPU, rather than by any accelerator -present in the system. -This can make opaque moves, for example, quite ``jerky''. -Also, given that IBM 8514/A and ATI Mach8 do not allow CPU access to their -frame buffer, the driver will currently ignore these accelerators. +present in the system and this can make opaque moves, for example, quite +``jerky''.<p> +Given that IBM 8514/A and ATI Mach8 do not allow CPU access to their frame +buffer, the driver will currently ignore these accelerators. Most Mach32 adapters provide both accelerated function and SuperVGA functionality, but the driver currently only uses the VGA.<p> The driver <it>does</it> however support the accelerator CRTC present in all @@ -150,8 +158,6 @@ used. This support is as yet incomplete and can be disabled entirely with an XF86Config option.<p> -On non-Intel platforms, the driver can, currently, only support PCI Mach64 -adapters.<p> <sect>Current implementation of generic VGA support for non-ATI adapters<p> Support for generic VGA with non-ATI adapters is also implemented, but has undergone only limited testing. @@ -226,8 +232,6 @@ These ChipSet names should, therefore, only be used when there is in fact such an adapter in the system. They are otherwise equivalent to ``<it>ati</it>''.<p> -On non-Intel platforms, only ``<it>ati</it>'' and ``<it>mach64</it>'' ChipSet -values are operative.<p> <sect1>ChipID & ChipRev specifications<p> These specifications will cause the driver to associate the ``Device'' section only with an adapter having the same attributes, or an adapter whose PCI device @@ -238,11 +242,6 @@ excludes any other adapter from matching the ``Device'' section. ChipRev is meaningful only with Mach64 adapters, and then only if ChipID is also specified in the same ``Device'' section.<p> -<sect1>IOBase<p> -This option limits the adapters that can be associated with the ``Device'' -section to the one with the specified I/O base. -This option only applies to Mach64 adapters and specifically excludes other -adapters.<p> <sect1>BusID<p> This option limits the adapters that can be associated with the ``Device'' section to the one with the specified PCI Bus ID. @@ -405,8 +404,6 @@ 256-colour and higher depth modes if it is also using a Mach64 accelerator CRTC or an integrated Mach64 graphics chip. This option disables this linear aperture.<p> -On non-Intel platforms, the driver requires a linear aperture and, so, this -option is ignored.<p> <sect1>Option <it>``HWCursor''</it> and Option <it>``SWCursor''</it><p> Option <it>``HWCursor''</it>, which is the default, specifies that hardware facilities are to be used to paint the mouse pointer on the screen. @@ -493,6 +490,7 @@ ``Monitor'' section.<p> For a digital flat panel, any sync tolerances should be removed from the corresponding ``Monitor'' section. +If any are specified, they will be ignored. The driver will automatically calculate these from the mode that is active on server entry. The driver also inserts timings for a mode called <it>"Native panel mode"</it> @@ -551,7 +549,11 @@ This will eventually be fixed in a future release. <item>The use of a laptop's hot-keys to switch displays while this driver is active can cause lockups and/or other woes, and is therefore not recommended. -It is not currently possible to solve this problem.<p> +It is not currently possible to solve this problem. +By default, the driver disables the use of such keys, by communicating to the +video BIOS to ignore them. +These hot-keys can be re-enabled with Option ``BIOSDisplay'' but results will +be unpredictable.<p> <item>In situations where the driver is to simultaneously display on both a panel and a CRT, the same image will be seen on both. In particular, this means the CRT must be able to synchronise with the timings @@ -586,7 +588,7 @@ url="ftp://ftp.xfree86.org/pub/XFree86"> if you are uncertain.<p> Secondly, please check XFree86's doc directory for additional information.<p> Thirdly, a scan through the comp.windows.x.i386unix and comp.os.linux.x -newsgroups and the xfree86 mailing list using your favourite archiving +newsgroups and the xfree86 mailing lists using your favourite archiving service can also prove useful in resolving problems.<p> If you are still experiencing problems, you can send me <it>non-HTMLised</it> e-mail at <email>tsi@xfree86.org</email>. @@ -607,27 +609,28 @@ I (Marc Aurele La France) took over development and maintenance of the driver in the fall of 1993 after Rik got rid of his VGA Wonder adapter.<p> <sect>Driver versions<p> -Due to the introduction of loadable drivers in XFree86 4.0, it has become +With the introduction of loadable drivers in XFree86 4.0, it has become necessary to track driver versions separately. Driver releases use the following version numbering scheme.<p> -Version 1 of this driver is the one I inherited from Rik Faith. -This is the version found in XFree86 2.0 and 2.1.<p> -Version 2 is my first rewrite of this code which only ended up being a -partially unsuccessful attempt at generalising the driver for all VGA Wonder, -Mach32, and early Mach64 adapters. +Version 1 of this driver is the one I inherited from Rik Faith and is the +version found in XFree86 releases 2.0 and 2.1.<p> +Version 2 is my first rewrite which ended up being a partially successful +attempt at generalising the driver for all of VGA Wonders, Mach32, and the +early Mach64 adapters. Various releases of this version of the driver can be found in XFree86 2.1.1, 3.1, 3.1.1 and 3.1.2.<p> -Version 3 represents my second rewrite (although a rather lame one as rewrites -go). -Into version 3, I introduced clock programming for Mach64 adapters and merged -in the old ati_test debugging tool. -This is the version found in XFree86 3.2, 3.3 and 3.3.1.<p> -Version 4 is a rather major restructuring of version 3, which became larger +Version 3 represents my second rewrite, a rather lame one at that, but in +version 3, I introduced clock programming for Mach64 adapters and merged in the +old ati_test debugging tool. +This is found in XFree86 releases 3.2, 3.3 and 3.3.1.<p> +Version 4 is a major restructuring of the previous version which became larger than I could comfortably handle in one source file. -This is the version found in XFree86 3.3.2, 3.3.3, 3.3.3.1, 3.3.3.2, 3.3.4, +This is the version found in XFree86 releases 3.3.2, 3.3.3, 3.3.3.1, 3.3.3.2, 3.3.4, 3.3.5 and 3.3.6.<p> -Version 5 is an almost complete restructuring of version 4 to fit in the newer -driver API of XFree86 4.0 and later.<p> -The introduction of version 6 is a first swipe at porting the driver to -non-Intel architectures.<p> +Version 5 is an almost complete restructuring of version 4, made to fit into +the new driver API that XFree86 4.0 and later adopted.<p> +Version 6 begins the process of porting the driver to non-Intel +architectures.<p> +Version 7 introduces a much more ``mature'' port of this driver to all +architectures supported by the core server.<p> </article> Index: xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent diff -u xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent:1.48 xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent:1.50 --- xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent:1.48 Wed Mar 16 20:11:56 2005 +++ xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent Sun Apr 23 13:03:51 2006 @@ -1,36 +1,36 @@ -<!-- $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent,v 1.48 2005/03/17 01:11:56 dawes Exp $ --> +<!-- $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent,v 1.50 2006/04/23 17:03:51 dawes Exp $ --> <!-- shared entity definitions for the XFree86 documentation --> <!-- XFree86 version string --> -<!ENTITY relvers CDATA "4.5.0"> -<!ENTITY prevrelvers CDATA "4.4.0"> -<!ENTITY fullrelvers CDATA "4.5.0"> -<!ENTITY prevfullrelvers CDATA "4.4.0"> -<!ENTITY nextfullrelvers CDATA "4.6.0"> +<!ENTITY relvers CDATA "4.6.0"> +<!ENTITY prevrelvers CDATA "4.5.0"> +<!ENTITY fullrelvers CDATA "4.6.0"> +<!ENTITY prevfullrelvers CDATA "4.5.0"> +<!ENTITY nextfullrelvers CDATA "4.7.0"> <!ENTITY nextfullreldate CDATA "not scheduled"> -<!ENTITY nextupdrelvers CDATA "4.5.1"> -<!ENTITY srcvers CDATA "450"> -<!ENTITY prevsrcvers CDATA "440"> -<!ENTITY fullsrcvers CDATA "450"> -<!ENTITY prevfullsrcvers CDATA "440"> -<!ENTITY whichfullrel CDATA "eighth"> +<!ENTITY nextupdrelvers CDATA "4.6.1"> +<!ENTITY srcvers CDATA "460"> +<!ENTITY prevsrcvers CDATA "450"> +<!ENTITY fullsrcvers CDATA "460"> +<!ENTITY prevfullsrcvers CDATA "450"> +<!ENTITY whichfullrel CDATA "ninth"> <!ENTITY whichupdaterel CDATA "none"> -<!ENTITY reltag CDATA "xf-4_5_0"> -<!ENTITY relbranchtag CDATA "xf-4_5-branch"> +<!ENTITY reltag CDATA "xf-4_6_0"> +<!ENTITY relbranchtag CDATA "xf-4_6-branch"> <!ENTITY rcnum CDATA "none"> <!-- Version of the most recent 3.3.x release --> <!ENTITY legacyvers CDATA "3.3.6"> <!-- doctools version strings --> -<!ENTITY doctoolsvers CDATA "1.3.3"> +<!ENTITY doctoolsvers CDATA "1.3.4"> <!-- utils version strings --> <!ENTITY utilsvers CDATA "1.1.3"> <!-- xtest version strings --> -<!ENTITY xtestvers CDATA "4.0.12"> +<!ENTITY xtestvers CDATA "4.0.14"> <!-- FreeType version strings --> <!ENTITY freetypevers CDATA "2.1.8"> Index: xc/programs/Xserver/hw/xfree86/doc/sgml/index.pre diff -u xc/programs/Xserver/hw/xfree86/doc/sgml/index.pre:1.29 xc/programs/Xserver/hw/xfree86/doc/sgml/index.pre:1.30 --- xc/programs/Xserver/hw/xfree86/doc/sgml/index.pre:1.29 Wed Mar 16 20:11:56 2005 +++ xc/programs/Xserver/hw/xfree86/doc/sgml/index.pre Tue Apr 11 21:39:22 2006 @@ -8,10 +8,10 @@ <!-- Title information --> <title>Documentation for XFree86® version &relvers; <author>The XFree86 Project, Inc -<date>16 March 2005 +<date>April 2006 <!-- -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/index.pre,v 1.29 2005/03/17 01:11:56 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/index.pre,v 1.30 2006/04/12 01:39:22 dawes Exp $ --> <p> Index: xc/programs/Xserver/hw/xfree86/drivers/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/Imakefile:1.23 xc/programs/Xserver/hw/xfree86/drivers/Imakefile:1.24 --- xc/programs/Xserver/hw/xfree86/drivers/Imakefile:1.23 Fri May 31 14:45:59 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/Imakefile Fri Oct 14 11:16:36 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/Imakefile,v 1.23 2002/05/31 18:45:59 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/Imakefile,v 1.24 2005/10/14 15:16:36 tsi Exp $ #define IHaveModules #include <Server.tmpl> @@ -27,8 +27,8 @@ #endif #endif -INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/include \ - -I$(XINCLUDESRC) +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/include + #if !DoLoadableServer ConfigTargetNoDepend(drvConf,$(ICONFIGFILES),confdrv.SHsuf,$(DRIVERS)) DriverObjectList($(DRIVERS),driver.list) Index: xc/programs/Xserver/hw/xfree86/drivers/apm/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/apm/Imakefile:1.26 xc/programs/Xserver/hw/xfree86/drivers/apm/Imakefile:1.28 --- xc/programs/Xserver/hw/xfree86/drivers/apm/Imakefile:1.26 Mon May 31 20:17:00 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/apm/Imakefile Sun Feb 19 10:51:26 2006 @@ -1,6 +1,6 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/Imakefile,v 1.26 2004/06/01 00:17:00 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/Imakefile,v 1.28 2006/02/19 15:51:26 tsi Exp $ /* - * Copyright (c) 1994-2004 by The XFree86 Project, Inc. + * Copyright (c) 1994-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -52,27 +52,28 @@ #if BuildXF86RushExt RUSH_SRC = apm_rush.c RUSH_OBJ = apm_rush.o -DEFINES = -DXF86RUSH_EXT +RUSH_DEFINES = -DXF86RUSH_EXT #endif +DEFINES = $(RUSH_DEFINES) $(EXT_DEFINES) + SRCS = apm_accel.c apm_cursor.c apm_dga.c apm_driver.c apm_i2c.c $(RUSH_SRC) OBJS = apm_accel.o apm_cursor.o apm_dga.o apm_driver.o apm_i2c.o $(RUSH_OBJ) #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa \ -I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ - -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ - -I$(XF86SRC)/shadowfb \ - -I$(XF86SRC)/i2c -I$(XF86SRC)/ddc \ - -I$(SERVERSRC)/Xext -I$(EXTINCSRC) -I$(SERVERSRC)/render \ - -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(XF86SRC)/vbe -I$(FONTINCSRC) + -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ + -I$(XF86SRC)/shadowfb \ + -I$(XF86SRC)/i2c -I$(XF86SRC)/ddc \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ + -I$(SERVERSRC)/include -I$(XF86SRC)/vbe #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h diff -u xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h:1.21 xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h:1.22 --- xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h:1.21 Mon Mar 29 11:25:16 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h Fri Oct 14 11:16:36 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h,v 1.21 2004/03/29 16:25:16 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h,v 1.22 2005/10/14 15:16:36 tsi Exp $ */ /* All drivers should typically include these */ @@ -53,7 +53,7 @@ #include "xf86DDC.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #ifdef TRUE #undef TRUE Index: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_cursor.c diff -u xc/programs/Xserver/hw/xfree86/drivers/apm/apm_cursor.c:1.15 xc/programs/Xserver/hw/xfree86/drivers/apm/apm_cursor.c:1.16 --- xc/programs/Xserver/hw/xfree86/drivers/apm/apm_cursor.c:1.15 Thu Oct 30 13:37:20 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/apm/apm_cursor.c Fri Oct 14 11:16:36 2005 @@ -1,8 +1,8 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_cursor.c,v 1.15 2003/10/30 18:37:20 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_cursor.c,v 1.16 2005/10/14 15:16:36 tsi Exp $ */ -#include "X.h" -#include "Xproto.h" +#include <X11/X.h> +#include <X11/Xproto.h> #include "misc.h" #include "input.h" #include "cursorstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c:1.68 xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c:1.71 --- xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c:1.68 Thu Feb 17 21:55:05 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c Thu Mar 16 11:49:57 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c,v 1.68 2005/02/18 02:55:05 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c,v 1.71 2006/03/16 16:49:57 dawes Exp $ */ #include "apm.h" #include "xf86cmap.h" @@ -10,7 +10,7 @@ #include "opaque.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> #define VERSION 4000 #define APM_NAME "APM" @@ -132,8 +132,8 @@ * List of symbols from other modules that this module references. This * list is used to tell the loader that it is OK for symbols here to be * unresolved providing that it hasn't been told that they haven't been - * told that they are essential via a call to xf86LoaderReqSymbols() or - * xf86LoaderReqSymLists(). The purpose is this is to avoid warnings about + * told that they are essential via a call to xf86LoaderModReqSymbols() or + * xf86LoaderModReqSymLists(). The purpose is this is to avoid warnings about * unresolved symbols that are not required. */ @@ -173,14 +173,12 @@ NULL }; -#ifdef XFree86LOADER static const char *vbeSymbols[] = { "VBEInit", "vbeDoEDID", "vbeFree", NULL }; -#endif static const char *ddcSymbols[] = { "xf86DoEDID_DDC1", @@ -244,7 +242,7 @@ XF86ModuleData apmModuleData = { &apmVersRec, apmSetup, NULL }; static pointer -apmSetup(pointer module, pointer opts, int *errmaj, int *errmain) +apmSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmain) { static Bool setupDone = FALSE; @@ -252,10 +250,10 @@ setupDone = TRUE; xf86AddDriver(&APM, module, 0); - LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, - miscfbSymbols, ramdacSymbols, vbeSymbols, - ddcSymbols, i2cSymbols, shadowSymbols, - int10Symbols, NULL); + LoaderModRefSymLists(module, vgahwSymbols, fbSymbols, xaaSymbols, + miscfbSymbols, ramdacSymbols, vbeSymbols, + ddcSymbols, i2cSymbols, shadowSymbols, + int10Symbols, NULL); return (pointer)1; } @@ -498,11 +496,14 @@ ApmProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; + ModuleDescPtr pMod; - if (xf86LoadSubModule(pScrn, "vbe")) { + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); pVbe = VBEInit(NULL, index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } @@ -518,6 +519,7 @@ int i; xf86MonPtr MonInfo = NULL; double real; + ModuleDescPtr pMod; /* * Note: This function is only called once at server startup, and @@ -560,10 +562,10 @@ } /* The vgahw module should be allocated here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* * Allocate a vgaHWRec @@ -827,10 +829,10 @@ xf86DrvMsg(pScrn->scrnIndex, from, "Linear framebuffer at 0x%lX\n", (unsigned long)pApm->LinAddress); - if (xf86LoadSubModule(pScrn, "ddc")) { - xf86LoaderReqSymLists(ddcSymbols, NULL); - if (xf86LoadSubModule(pScrn, "i2c")) { - xf86LoaderReqSymLists(i2cSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "ddc"))) { + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "i2c"))) { + xf86LoaderModReqSymLists(pMod, i2cSymbols, NULL); pApm->I2C = TRUE; } } @@ -853,10 +855,10 @@ pApm->FbMapSize = 4 * 1024 * 1024; } - if (xf86LoadSubModule(pScrn, "int10")) { + if ((pMod = xf86LoadSubModule(pScrn, "int10"))) { void *ptr; - xf86LoaderReqSymLists(int10Symbols, NULL); + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n"); ptr = xf86InitInt10(pEnt->index); if (ptr) @@ -1143,44 +1145,44 @@ break; } - if (mod && xf86LoadSubModule(pScrn, mod) == NULL) { + if (mod && !(pMod = xf86LoadSubModule(pScrn, mod))) { ApmFreeRec(pScrn); return FALSE; } if (mod) { if (req) { - xf86LoaderReqSymbols(req, NULL); + xf86LoaderModReqSymbols(pMod, req, NULL); } else { - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); } } /* Load XAA if needed */ if (!pApm->NoAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { ApmFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } /* Load ramdac if needed */ if (pApm->hwCursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { ApmFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } /* Load shadowfb if needed */ if (pApm->ShadowFB) { - if (!xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { ApmFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } pApm->CurrentLayout.displayWidth = pScrn->virtualX; Index: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c diff -u xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c:1.12 xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c:1.15 --- xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c:1.12 Wed Feb 12 16:46:42 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c Sun Feb 19 10:51:26 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c,v 1.12 2003/02/12 21:46:42 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c,v 1.15 2006/02/19 15:51:26 tsi Exp $ */ /* * Copyright Loïc Grenié 1999 */ @@ -308,16 +308,16 @@ #define NEED_REPLIES #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" +#include <X11/X.h> +#include <X11/Xproto.h> #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" #include "scrnintstr.h" #define _XF86RUSH_SERVER_ -#include "xf86rushstr.h" +#include <X11/extensions/xf86rushstr.h> +#include <X11/extensions/panoramiXproto.h> -static unsigned char RushReqCode = 0; static int RushErrorBase; static DISPATCH_PROC(ProcXF86RushDispatch); @@ -345,10 +345,13 @@ { ExtensionEntry* extEntry; -#ifdef PANORAMIX - if (!noPanoramiXExtension) + if (IsXineramaActive()) { + xf86DrvMsg(pScreen->myNum, X_NOTICE, + "\"" XF86RUSHNAME "\" and \"" PANORAMIX_PROTOCOL_NAME + "\" extensions not supported simultaneously.\n"); return; -#endif + } + if (rush_ext_generation == serverGeneration) { if (xf86Screens[pScreen->myNum]->drv == &APM && APMPTR(xf86Screens[pScreen->myNum])->Chipset == AT3D) { @@ -365,7 +368,6 @@ SProcXF86RushDispatch, XF86RushResetProc, StandardMinorOpcode))) { - RushReqCode = (unsigned char)extEntry->base; RushErrorBase = extEntry->errorBase; if (xf86Screens[pScreen->myNum]->drv == &APM && APMPTR(xf86Screens[pScreen->myNum])->Chipset == AT3D) { @@ -663,8 +665,8 @@ return BadMatch; pApm->Rush = 0x04; if (!pApm->noLinear) { - db = RDXL(0xDB); - WRXL(0xDB, db | 0x04); + db = RDXB(0xDB); + WRXB(0xDB, db | 0x04); WRXB(0x110, 0x03); tmp = RDXB(0x1F0); WRXB(0x1F0, tmp | 0xD0); @@ -674,8 +676,8 @@ WRXB(0x1F2, tmp | 0x10); } else { - db = RDXL(0xDB); - WRXL_IOP(0xDB, db | 0x04); + db = RDXB(0xDB); + WRXB_IOP(0xDB, db | 0x04); WRXB_IOP(0x110, 0x03); tmp = RDXB_IOP(0x1F0); WRXB_IOP(0x1F0, tmp | 0xD0); @@ -712,8 +714,8 @@ WRXB(0x1F0, tmp & ~0xD0); WRXB(0x110, 0); pApm->Rush = 0x00; - db = RDXL(0xDB); - WRXL(0xDB, db & ~0x04); + db = RDXB(0xDB); + WRXB(0xDB, db & ~0x04); } else { tmp = RDXB_IOP(0x1F2); Index: xc/programs/Xserver/hw/xfree86/drivers/ark/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/ark/Imakefile:1.8 xc/programs/Xserver/hw/xfree86/drivers/ark/Imakefile:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/ark/Imakefile:1.8 Mon May 31 20:17:00 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ark/Imakefile Fri Oct 14 11:16:37 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/Imakefile,v 1.8 2004/06/01 00:17:00 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/Imakefile,v 1.11 2005/10/14 15:16:37 tsi Exp $ /* * * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> @@ -59,19 +59,15 @@ OBJS = ark_driver.o ark_accel.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ - -I$(XF86SRC)/xaa \ - -I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \ - -I$(XF86SRC)/xf24_32bpp -I$(SERVERSRC)/Xext \ + -I$(XF86SRC)/xaa -I$(SERVERSRC)/Xext \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ - -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ - -I$(XF86SRC)/fbdevhw -I$(XF86SRC)/ddc \ - -I$(XF86SRC)/i2c \ - -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(FONTINCSRC) \ - -I$(EXTINCSRC) -I$(SERVERSRC)/render + -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ + -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ + -I$(SERVERSRC)/include -I$(SERVERSRC)/render #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ark/ark_accel.c:1.7 xc/programs/Xserver/hw/xfree86/drivers/ark/ark_accel.c:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/ark/ark_accel.c:1.7 Wed Dec 11 12:09:39 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/ark/ark_accel.c Fri Oct 14 11:16:37 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_accel.c,v 1.7 2002/12/11 17:09:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_accel.c,v 1.8 2005/10/14 15:16:37 tsi Exp $ */ /* * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> * @@ -29,7 +29,7 @@ */ -#include "Xarch.h" +#include <X11/Xarch.h> #include "xf86.h" #include "xf86_ansic.h" #include "xf86_OSproc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c:1.24 xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c:1.25 --- xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c:1.24 Fri Nov 26 08:44:59 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c Thu Mar 16 11:49:58 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c,v 1.24 2004/11/26 13:44:59 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c,v 1.25 2006/03/16 16:49:58 dawes Exp $ */ /* * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> * @@ -158,14 +158,15 @@ XF86ModuleData arkModuleData = { &ARKVersRec, ARKSetup, NULL }; -pointer ARKSetup(pointer module, pointer opts, int *errmaj, int *errmin) +pointer ARKSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; if (!setupDone) { setupDone = TRUE; xf86AddDriver(&ARK, module, 0); - LoaderRefSymLists(fbSymbols, vgaHWSymbols, xaaSymbols, NULL); + LoaderModRefSymLists(module, fbSymbols, vgaHWSymbols, + xaaSymbols, NULL); return (pointer) 1; } else { if (errmaj) @@ -268,14 +269,15 @@ rgb zeros = {0, 0, 0}; Gamma gzeros = {0.0, 0.0, 0.0}; unsigned char tmp; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) return FALSE; - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgaHWSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgaHWSymbols, NULL); if (!vgaHWGetHWRec(pScrn)) return FALSE; @@ -483,19 +485,19 @@ xf86PrintModes(pScrn); xf86SetDpi(pScrn, 0, 0); - if (!xf86LoadSubModule(pScrn, "fb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { ARKFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); if (!pARK->NoAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { ARKFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } return TRUE; Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/Imakefile diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/Imakefile:1.1 --- /dev/null Tue May 9 21:56:43 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/Imakefile Thu Apr 13 20:50:38 2006 @@ -0,0 +1,70 @@ +XCOMM +XCOMM Copyright (c) 2005 ASPEED Technology Inc. +XCOMM +XCOMM Permission to use, copy, modify, distribute, and sell this software and its +XCOMM documentation for any purpose is hereby granted without fee, provided that +XCOMM the above copyright notice appear in all copies and that both that +XCOMM copyright notice and this permission notice appear in supporting +XCOMM documentation, and that the name of the authors not be used in +XCOMM advertising or publicity pertaining to distribution of the software without +XCOMM specific, written prior permission. The authors makes no representations +XCOMM about the suitability of this software for any purpose. It is provided +XCOMM "as is" without express or implied warranty. +XCOMM +XCOMM THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +XCOMM INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +XCOMM EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR +XCOMM CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +XCOMM DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +XCOMM TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +XCOMM PERFORMANCE OF THIS SOFTWARE. +XCOMM +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/Imakefile,v 1.1 2006/04/14 00:50:38 dawes Exp $ + +#define IHaveModules +#include <Server.tmpl> + +SRCS = ast_driver.c ast_mode.c ast_accel.c ast_tool.c ast_vgatool.c \ + ast_2dtool.c ast_cursor.c +OBJS = ast_driver.o ast_mode.o ast_accel.o ast_tool.o ast_vgatool.o \ + ast_2dtool.o ast_cursor.o + +#if defined(XF86DriverSDK) +INCLUDES = -I../../include +#else +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c -I$(XF86SRC)/int10 \ + -I$(XF86SRC)/rac -I$(XF86SRC)/ramdac -I$(XF86SRC)/vbe \ + -I$(XF86SRC)/vgahw -I$(XF86SRC)/xaa \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/render -I$(SERVERSRC)/mi \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/include +#endif + +#if MakeHasPosixVariableSubstitutions +SubdirLibraryRule($(OBJS)) +#endif + +ModuleObjectRule() + +ObjectModuleTarget(aspeed,$(OBJS),drivers) + +InstallObjectModule(aspeed,$(MODULEDIR),drivers) + +DependTarget() + +InstallDriverSDKNonExecFile(Imakefile,$(DRIVERSDKDIR)/drivers/aspeed) +InstallDriverSDKNonExecFile(ast.h,$(DRIVERSDKDIR)/drivers/aspeed) +InstallDriverSDKNonExecFile(ast_driver.c,$(DRIVERSDKDIR)/drivers/aspeed) +InstallDriverSDKNonExecFile(ast_mode.h,$(DRIVERSDKDIR)/drivers/aspeed) +InstallDriverSDKNonExecFile(ast_mode.c,$(DRIVERSDKDIR)/drivers/aspeed) +InstallDriverSDKNonExecFile(ast_accel.c,$(DRIVERSDKDIR)/drivers/aspeed) +InstallDriverSDKNonExecFile(ast_tool.h,$(DRIVERSDKDIR)/drivers/aspeed) +InstallDriverSDKNonExecFile(ast_tool.c,$(DRIVERSDKDIR)/drivers/aspeed) +InstallDriverSDKNonExecFile(ast_vgatool.h,$(DRIVERSDKDIR)/drivers/aspeed) +InstallDriverSDKNonExecFile(ast_vgatool.c,$(DRIVERSDKDIR)/drivers/aspeed) +InstallDriverSDKNonExecFile(ast_2dtool.h,$(DRIVERSDKDIR)/drivers/aspeed) +InstallDriverSDKNonExecFile(ast_2dtool.c,$(DRIVERSDKDIR)/drivers/aspeed) +InstallDriverSDKNonExecFile(ast_cursor.h,$(DRIVERSDKDIR)/drivers/aspeed) +InstallDriverSDKNonExecFile(ast_cursor.c,$(DRIVERSDKDIR)/drivers/aspeed) + +InstallDriverSDKObjectModule(aspeed,$(DRIVERSDKMODULEDIR),drivers) Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast.h:1.1 --- /dev/null Tue May 9 21:56:43 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast.h Thu Apr 13 20:50:38 2006 @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2005 ASPEED Technology Inc. + * + * 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 the authors not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The authors makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHORS 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast.h,v 1.1 2006/04/14 00:50:38 dawes Exp $ */ + +#ifndef __AST_H__ +#define __AST_H__ 1 + +#include "xf86PciInfo.h" +#include "xf86Cursor.h" +#include "xaa.h" + +/* Compiler Options */ +#define Accel_2D +/* #define MMIO_2D */ +#define HWC +/* #define PATCH_ABI_VERSION */ + +/* Vendor & Device Info */ +#ifndef PCI_VENDOR_AST +#define PCI_VENDOR_AST 0x1A03 +#endif + +#ifndef PCI_CHIP_AST2000 +#define PCI_CHIP_AST2000 0x2000 +#endif + +/* AST REC Info */ +#define AST_NAME "AST" +#define AST_DRIVER_NAME "ast" +#define AST_MAJOR_VERSION 0 +#define AST_MINOR_VERSION 80 +#define AST_PATCH_VERSION 0 +#define AST_VERSION \ + ((AST_MAJOR_VERSION << 20) | (AST_MINOR_VERSION << 10) | AST_PATCH_VERSION) + +/* Customized Info */ +#define DEFAULT_VIDEOMEM_SIZE 0x00800000 +#define DEFAULT_MMIO_SIZE 0x00020000 +#define DEFAULT_CMDQ_SIZE 0x00100000 +#define MIN_CMDQ_SIZE 0x00040000 +#define CMD_QUEUE_GUARD_BAND 0x00000020 +#define DEFAULT_HWC_NUM 0x00000002 + +/* Patch Info */ +#define ABI_VIDEODRV_VERSION_PATCH SET_ABI_VERSION(0, 1) + +/* Data Type Definition */ +typedef INT32 LONG; +typedef CARD8 UCHAR; +typedef CARD16 USHORT; +typedef CARD32 ULONG; + +/* Data Structure Definition */ +typedef struct _ASTRegRec { + UCHAR ExtCRTC[0x50]; + +} ASTRegRec, *ASTRegPtr; + +typedef struct _VIDEOMODE { + + int ScreenWidth; + int ScreenHeight; + int bitsPerPixel; + int ScreenPitch; + +} VIDEOMODE, *PVIDEOMODE; + +typedef struct { + + ULONG ulCMDQSize; + ULONG ulCMDQType; + + ULONG ulCMDQOffsetAddr; + UCHAR *pjCMDQVirtualAddr; + + UCHAR *pjCmdQBasePort; + UCHAR *pjWritePort; + UCHAR *pjReadPort; + UCHAR *pjEngStatePort; + + ULONG ulCMDQMask; + ULONG ulCurCMDQueueLen; + + ULONG ulWritePointer; + ULONG ulReadPointer; + + ULONG ulReadPointer_OK; /* for Eng_DBGChk */ + +} CMDQINFO, *PCMDQINFO; + +typedef struct { + + int HWC_NUM; + int HWC_NUM_Next; + + ULONG ulHWCOffsetAddr; + UCHAR *pjHWCVirtualAddr; + + USHORT cursortype; + USHORT width; + USHORT height; + USHORT offset_x; + USHORT offset_y; + ULONG fg; + ULONG bg; + + +} HWCINFO, *PHWCINFO; + +typedef struct _ASTRec { + + EntityInfoPtr pEnt; + pciVideoPtr PciInfo; + PCITAG PciTag; + + OptionInfoPtr Options; + DisplayModePtr ModePtr; + FBLinearPtr pCMDQPtr; + XAAInfoRecPtr AccelInfoPtr; + xf86CursorInfoPtr HWCInfoPtr; + FBLinearPtr pHWCPtr; + + CloseScreenProcPtr CloseScreen; + ScreenBlockHandlerProcPtr BlockHandler; + + Bool noAccel; + Bool noHWC; + Bool MMIO2D; + int ENGCaps; + int DBGSelect; + + ULONG FBPhysAddr; /* Frame buffer physical address */ + ULONG MMIOPhysAddr; /* MMIO region physical address */ + ULONG BIOSPhysAddr; /* BIOS physical address */ + + UCHAR *FBVirtualAddr; /* Map of frame buffer */ + UCHAR *MMIOVirtualAddr; /* Map of MMIO region */ + + unsigned long FbMapSize; + unsigned long MMIOMapSize; + + IOADDRESS IODBase; /* Base of PIO memory area */ + IOADDRESS PIOOffset; + IOADDRESS RelocateIO; + + VIDEOMODE VideoModeInfo; + ASTRegRec SavedReg; + CMDQINFO CMDQInfo; + HWCINFO HWCInfo; + ULONG ulCMDReg; + Bool EnableClip; + +} ASTRec, *ASTRecPtr; + +#define ASTPTR(p) ((ASTRecPtr)((p)->driverPrivate)) + +/* Include Files */ +#include "ast_mode.h" +#include "ast_vgatool.h" +#include "ast_2dtool.h" +#include "ast_cursor.h" +#include "ast_tool.h" +#include "ast_accel.h" + +#endif /* __AST_H__ */ Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_2dtool.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_2dtool.c:1.1 --- /dev/null Tue May 9 21:56:43 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_2dtool.c Thu Apr 13 20:50:38 2006 @@ -0,0 +1,369 @@ +/* + * Copyright (c) 2005 ASPEED Technology Inc. + * + * 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 the authors not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The authors makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHORS 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_2dtool.c,v 1.1 2006/04/14 00:50:38 dawes Exp $ */ + +#include "xf86.h" +#include "xf86_ansic.h" +#include "compiler.h" + +/* Driver specific headers */ +#include "ast.h" + +#ifdef Accel_2D + +static Bool +bInitCMDQInfo(ScrnInfoPtr pScrn, ASTRecPtr pAST) +{ + pAST->CMDQInfo.pjCmdQBasePort = pAST->MMIOVirtualAddr+ 0x8044; + pAST->CMDQInfo.pjWritePort = pAST->MMIOVirtualAddr+ 0x8048; + pAST->CMDQInfo.pjReadPort = pAST->MMIOVirtualAddr+ 0x804C; + pAST->CMDQInfo.pjEngStatePort = pAST->MMIOVirtualAddr+ 0x804C; + + /* CMDQ mode Init */ + if (!pAST->MMIO2D) { + ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; + + pAST->CMDQInfo.ulCMDQType = VM_CMD_QUEUE; + + do { + pAST->pCMDQPtr = xf86AllocateOffscreenLinear (pScreen, pAST->CMDQInfo.ulCMDQSize, 8, NULL, NULL, NULL); + if (pAST->pCMDQPtr) + break; + pAST->CMDQInfo.ulCMDQSize >>= 1; + } while (pAST->CMDQInfo.ulCMDQSize >= MIN_CMDQ_SIZE); + + if (pAST->pCMDQPtr) + { + pAST->CMDQInfo.ulCMDQOffsetAddr = pAST->pCMDQPtr->offset*((pScrn->bitsPerPixel + 1) / 8); + pAST->CMDQInfo.pjCMDQVirtualAddr = pAST->FBVirtualAddr + pAST->CMDQInfo.ulCMDQOffsetAddr; + + pAST->CMDQInfo.ulCurCMDQueueLen = pAST->CMDQInfo.ulCMDQSize - CMD_QUEUE_GUARD_BAND; + pAST->CMDQInfo.ulCMDQMask = pAST->CMDQInfo.ulCMDQSize - 1 ; + } + else + { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"Allocate CMDQ failed \n"); + pAST->MMIO2D = TRUE; /* set to MMIO mode if CMDQ allocate failed */ + } + } + + /* MMIO mode init */ + if (pAST->MMIO2D) { + pAST->CMDQInfo.ulCMDQType = VM_CMD_MMIO; + } + + return (TRUE); +} + +static Bool +bEnableCMDQ(ScrnInfoPtr pScrn, ASTRecPtr pAST) +{ + ULONG ulVMCmdQBasePort = 0; + + vASTWaitEngIdle(pScrn, pAST); + + /* set DBG Select Info */ + if (pAST->DBGSelect) + { + *(ULONG *) (pAST->MMIOVirtualAddr + 0x804C) = (ULONG) (pAST->DBGSelect); + } + + /* set CMDQ base */ + switch (pAST->CMDQInfo.ulCMDQType) + { + case VM_CMD_QUEUE: + ulVMCmdQBasePort = (pAST->CMDQInfo.ulCMDQOffsetAddr - 0) >> 3; + + /* set CMDQ Threshold */ + ulVMCmdQBasePort |= 0xF0000000; + + /* set CMDQ Size */ + switch (pAST->CMDQInfo.ulCMDQSize) + { + case CMD_QUEUE_SIZE_256K: + ulVMCmdQBasePort |= 0x00000000; + break; + + case CMD_QUEUE_SIZE_512K: + ulVMCmdQBasePort |= 0x04000000; + break; + + case CMD_QUEUE_SIZE_1M: + ulVMCmdQBasePort |= 0x08000000; + break; + + case CMD_QUEUE_SIZE_2M: + ulVMCmdQBasePort |= 0x0C000000; + break; + + default: + return(FALSE); + break; + } + + *(ULONG *) (pAST->CMDQInfo.pjCmdQBasePort) = ulVMCmdQBasePort; + pAST->CMDQInfo.ulWritePointer = *(ULONG *) (pAST->CMDQInfo.pjWritePort); + break; + + case VM_CMD_MMIO: + /* set CMDQ Threshold */ + ulVMCmdQBasePort |= 0xF0000000; + + ulVMCmdQBasePort |= 0x02000000; /* MMIO mode */ + *(ULONG *) (pAST->CMDQInfo.pjCmdQBasePort) = ulVMCmdQBasePort; + break; + + default: + return (FALSE); + break; + } + + return (TRUE); +} + +Bool +bASTEnable2D(ScrnInfoPtr pScrn, ASTRecPtr pAST) +{ + SetIndexRegMask(CRTC_PORT, 0xA4, 0xFE, 0x01); /* enable 2D */ + + if (!bInitCMDQInfo(pScrn, pAST)) + { + vASTDisable2D(pScrn, pAST); + return (FALSE); + } + + if (!bEnableCMDQ(pScrn, pAST)) + { + vASTDisable2D(pScrn, pAST); + return (FALSE); + } + + return (TRUE); +} + +void +vASTDisable2D(ScrnInfoPtr pScrn, ASTRecPtr pAST) +{ + + vASTWaitEngIdle(pScrn, pAST); + vASTWaitEngIdle(pScrn, pAST); + + SetIndexRegMask(CRTC_PORT, 0xA4, 0xFE, 0x00); + +} + + +void +vASTWaitEngIdle(ScrnInfoPtr pScrn, ASTRecPtr pAST) +{ + ULONG ulEngState, ulEngState2; + UCHAR jReg; + ULONG ulEngCheckSetting; + + if (pAST->MMIO2D) + ulEngCheckSetting = 0x10000000; + else + ulEngCheckSetting = 0x80000000; + + /* 2D disable if 0xA4 D[0] = 1 */ + GetIndexRegMask(CRTC_PORT, 0xA4, 0x01, jReg); + if (!jReg) goto Exit_vWaitEngIdle; + + /* 2D not work if in std. mode */ + GetIndexRegMask(CRTC_PORT, 0xA3, 0x0F, jReg); + if (!jReg) goto Exit_vWaitEngIdle; + + do + { + ulEngState = (*(volatile ULONG *)(pAST->CMDQInfo.pjEngStatePort)) & 0xFFFC0000; + ulEngState2 = (*(volatile ULONG *)(pAST->CMDQInfo.pjEngStatePort)) & 0xFFFC0000; + ulEngState2 = (*(volatile ULONG *)(pAST->CMDQInfo.pjEngStatePort)) & 0xFFFC0000; + ulEngState2 = (*(volatile ULONG *)(pAST->CMDQInfo.pjEngStatePort)) & 0xFFFC0000; + ulEngState2 = (*(volatile ULONG *)(pAST->CMDQInfo.pjEngStatePort)) & 0xFFFC0000; + ulEngState2 = (*(volatile ULONG *)(pAST->CMDQInfo.pjEngStatePort)) & 0xFFFC0000; + + } while ((ulEngState & ulEngCheckSetting) || (ulEngState != ulEngState2)); + +Exit_vWaitEngIdle: + ; +} + +/* ULONG ulGetCMDQLength() */ +static __inline ULONG ulGetCMDQLength(ASTRecPtr pAST, ULONG ulWritePointer, ULONG ulCMDQMask) +{ + ULONG ulReadPointer, ulReadPointer2; + + do { + ulReadPointer = *((volatile ULONG *)(pAST->CMDQInfo.pjReadPort)) & 0x0003FFFF; + ulReadPointer2 = *((volatile ULONG *)(pAST->CMDQInfo.pjReadPort)) & 0x0003FFFF; + ulReadPointer2 = *((volatile ULONG *)(pAST->CMDQInfo.pjReadPort)) & 0x0003FFFF; + ulReadPointer2 = *((volatile ULONG *)(pAST->CMDQInfo.pjReadPort)) & 0x0003FFFF; + ulReadPointer2 = *((volatile ULONG *)(pAST->CMDQInfo.pjReadPort)) & 0x0003FFFF; + ulReadPointer2 = *((volatile ULONG *)(pAST->CMDQInfo.pjReadPort)) & 0x0003FFFF; + } while (ulReadPointer != ulReadPointer2); + + return ((ulReadPointer << 3) - ulWritePointer - CMD_QUEUE_GUARD_BAND) & ulCMDQMask; +} + +UCHAR *pjASTRequestCMDQ( +ASTRecPtr pAST, ULONG ulDataLen) +{ + UCHAR *pjBuffer; + ULONG i, ulWritePointer, ulCMDQMask, ulCurCMDQLen, ulContinueCMDQLen; + + ulWritePointer = pAST->CMDQInfo.ulWritePointer; + ulContinueCMDQLen = pAST->CMDQInfo.ulCMDQSize - ulWritePointer; + ulCMDQMask = pAST->CMDQInfo.ulCMDQMask; + + if (ulContinueCMDQLen >= ulDataLen) + { + /* Get CMDQ Buffer */ + if (pAST->CMDQInfo.ulCurCMDQueueLen >= ulDataLen) + { + ; + } + else + { + + do + { + ulCurCMDQLen = ulGetCMDQLength(pAST, ulWritePointer, ulCMDQMask); + } while (ulCurCMDQLen < ulDataLen); + + pAST->CMDQInfo.ulCurCMDQueueLen = ulCurCMDQLen; + + } + + pjBuffer = pAST->CMDQInfo.pjCMDQVirtualAddr + ulWritePointer; + pAST->CMDQInfo.ulCurCMDQueueLen -= ulDataLen; + pAST->CMDQInfo.ulWritePointer = (ulWritePointer + ulDataLen) & ulCMDQMask; + return pjBuffer; + } + else + { + + /* Fill NULL CMD to the last of the CMDQ */ + if (pAST->CMDQInfo.ulCurCMDQueueLen >= ulContinueCMDQLen) + { + ; + } + else + { + + do + { + ulCurCMDQLen = ulGetCMDQLength(pAST, ulWritePointer, ulCMDQMask); + } while (ulCurCMDQLen < ulContinueCMDQLen); + + pAST->CMDQInfo.ulCurCMDQueueLen = ulCurCMDQLen; + + } + + pjBuffer = pAST->CMDQInfo.pjCMDQVirtualAddr + ulWritePointer; + for (i = 0; i<ulContinueCMDQLen/8; i++, pjBuffer+=8) + { + *(ULONG *)pjBuffer = (ULONG) PKT_NULL_CMD; + *(ULONG *) (pjBuffer+4) = 0; + + } + pAST->CMDQInfo.ulCurCMDQueueLen -= ulContinueCMDQLen; + pAST->CMDQInfo.ulWritePointer = ulWritePointer = 0; + + /* Get CMDQ Buffer */ + if (pAST->CMDQInfo.ulCurCMDQueueLen >= ulDataLen) + { + ; + } + else + { + + do + { + ulCurCMDQLen = ulGetCMDQLength(pAST, ulWritePointer, ulCMDQMask); + } while (ulCurCMDQLen < ulDataLen); + + pAST->CMDQInfo.ulCurCMDQueueLen = ulCurCMDQLen; + + } + + pAST->CMDQInfo.ulCurCMDQueueLen -= ulDataLen; + pjBuffer = pAST->CMDQInfo.pjCMDQVirtualAddr + ulWritePointer; + pAST->CMDQInfo.ulWritePointer = (ulWritePointer + ulDataLen) & ulCMDQMask; + return pjBuffer; + + } + +} /* end of pjRequestCmdQ() */ + +Bool bASTGetLineTerm(_LINEInfo *LineInfo, LINEPARAM *dsLineParam) +{ + LONG GAbsX, GAbsY, GXInc, GYInc, GXMajor; + LONG MM, mm, Error0, K1, K2; + + /* Init */ +#ifdef LONG64 + GAbsX = abs (LineInfo->X1 - LineInfo->X2); + GAbsY = abs (LineInfo->Y1 - LineInfo->Y2); +#else + GAbsX = labs (LineInfo->X1 - LineInfo->X2); + GAbsY = labs (LineInfo->Y1 - LineInfo->Y2); +#endif + + GXInc = (LineInfo->X1 < LineInfo->X2) ? 1:0; + GYInc = (LineInfo->Y1 < LineInfo->Y2) ? 1:0; + GXMajor = (GAbsX >= GAbsY) ? 1:0; + + /* Calculate */ + if (GXMajor) + { + MM = GAbsX; + mm = GAbsY; + } + else + { + MM = GAbsY; + mm = GAbsX; + } + + Error0 = (signed) (2*mm - MM); + + K1 = 2* mm; + K2 = (signed) (2*mm - 2*MM); + + /*save the Param to dsLineParam */ + dsLineParam->dsLineX = (USHORT) LineInfo->X1; + dsLineParam->dsLineY = (USHORT) LineInfo->Y1; + dsLineParam->dsLineWidth = (USHORT) MM; + dsLineParam->dwErrorTerm = (ULONG) Error0; + dsLineParam->dwK1Term = K1; + dsLineParam->dwK2Term = K2; + + dsLineParam->dwLineAttributes = 0; + if (GXMajor) dsLineParam->dwLineAttributes |= LINEPARAM_XM; + if (!GXInc) dsLineParam->dwLineAttributes |= LINEPARAM_X_DEC; + if (!GYInc) dsLineParam->dwLineAttributes |= LINEPARAM_Y_DEC; + + return(TRUE); + +} + +#endif /* end of Accel_2D */ Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_2dtool.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_2dtool.h:1.1 --- /dev/null Tue May 9 21:56:43 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_2dtool.h Thu Apr 13 20:50:38 2006 @@ -0,0 +1,491 @@ +/* + * Copyright (c) 2005 ASPEED Technology Inc. + * + * 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 the authors not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The authors makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHORS 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_2dtool.h,v 1.1 2006/04/14 00:50:38 dawes Exp $ */ + +#ifndef __AST_2DTOOL_H__ +#define __AST_2DTOOL_H__ 1 + +/* Eng Capability Definition */ +#define ENG_CAP_Sync 0x0001 +#define ENG_CAP_ScreenToScreenCopy 0x0002 +#define ENG_CAP_SolidFill 0x0004 +#define ENG_CAP_SolidLine 0x0008 +#define ENG_CAP_DashedLine 0x0010 +#define ENG_CAP_Mono8x8PatternFill 0x0020 +#define ENG_CAP_Color8x8PatternFill 0x0040 +#define ENG_CAP_CPUToScreenColorExpand 0x0080 +#define ENG_CAP_ScreenToScreenColorExpand 0x0100 +#define ENG_CAP_Clipping 0x0200 +#define ENG_CAP_ALL (ENG_CAP_Sync | ENG_CAP_ScreenToScreenCopy | ENG_CAP_SolidFill | \ + ENG_CAP_SolidLine | ENG_CAP_DashedLine | \ + ENG_CAP_Mono8x8PatternFill | ENG_CAP_Color8x8PatternFill | \ + ENG_CAP_Clipping); + +/* CMDQ Definition */ +#define AGP_CMD_QUEUE 1 +#define VM_CMD_QUEUE 0 +#define VM_CMD_MMIO 2 + +#define CMD_QUEUE_SIZE_256K 0x00040000 +#define CMD_QUEUE_SIZE_512K 0x00080000 +#define CMD_QUEUE_SIZE_1M 0x00100000 +#define CMD_QUEUE_SIZE_2M 0x00200000 +#define CMD_QUEUE_SIZE_4M 0x00400000 + +/* CMD Type Info */ +#define PKT_NULL_CMD 0x00009561 + +#define PKT_SINGLE_LENGTH 8 +#define PKT_SINGLE_CMD_HEADER 0x00009562 + +typedef struct _PKT_SC +{ + ULONG PKT_SC_dwHeader; + ULONG PKT_SC_dwData[1]; + +} PKT_SC, *PPKT_SC; + +/* Eng Reg. Limitation */ +#define MAX_SRC_PITCH 0x1FFF +#define MAX_DST_PITCH 0x1FFF +#define MAX_DST_HEIGHT 0x7FF +#define MAX_SRC_X 0x7FF +#define MAX_SRC_Y 0x7FF +#define MAX_DST_X 0x7FF +#define MAX_DST_Y 0x7FF +#define MAX_RECT_WIDTH 0x7FF +#define MAX_RECT_HEIGHT 0x7FF +#define MAX_CLIP 0xFFF + +#define MAX_LINE_X 0x7FF +#define MAX_LINE_Y 0x7FF +#define MAX_LINE_ERR 0x3FFFFF +#define MAX_LINE_WIDTH 0x7FF +#define MAX_LINE_K1 0x3FFFFF +#define MAX_LINE_K2 0x3FFFFF + +#define MAX_PATReg_Size 256 + +/* Eng Reg. Definition */ +/* MMIO Reg */ +#define MMIOREG_SRC_BASE (pAST->MMIOVirtualAddr + 0x8000) +#define MMIOREG_SRC_PITCH (pAST->MMIOVirtualAddr + 0x8004) +#define MMIOREG_DST_BASE (pAST->MMIOVirtualAddr + 0x8008) +#define MMIOREG_DST_PITCH (pAST->MMIOVirtualAddr + 0x800C) +#define MMIOREG_DST_XY (pAST->MMIOVirtualAddr + 0x8010) +#define MMIOREG_SRC_XY (pAST->MMIOVirtualAddr + 0x8014) +#define MMIOREG_RECT_XY (pAST->MMIOVirtualAddr + 0x8018) +#define MMIOREG_FG (pAST->MMIOVirtualAddr + 0x801C) +#define MMIOREG_BG (pAST->MMIOVirtualAddr + 0x8020) +#define MMIOREG_FG_SRC (pAST->MMIOVirtualAddr + 0x8024) +#define MMIOREG_BG_SRC (pAST->MMIOVirtualAddr + 0x8028) +#define MMIOREG_MONO1 (pAST->MMIOVirtualAddr + 0x802C) +#define MMIOREG_MONO2 (pAST->MMIOVirtualAddr + 0x8030) +#define MMIOREG_CLIP1 (pAST->MMIOVirtualAddr + 0x8034) +#define MMIOREG_CLIP2 (pAST->MMIOVirtualAddr + 0x8038) +#define MMIOREG_CMD (pAST->MMIOVirtualAddr + 0x803C) +#define MMIOREG_PAT (pAST->MMIOVirtualAddr + 0x8100) + +#define MMIOREG_LINE_XY (pAST->MMIOVirtualAddr + 0x8010) +#define MMIOREG_LINE_Err (pAST->MMIOVirtualAddr + 0x8014) +#define MMIOREG_LINE_WIDTH (pAST->MMIOVirtualAddr + 0x8018) +#define MMIOREG_LINE_K1 (pAST->MMIOVirtualAddr + 0x8024) +#define MMIOREG_LINE_K2 (pAST->MMIOVirtualAddr + 0x8028) +#define MMIOREG_LINE_STYLE1 (pAST->MMIOVirtualAddr + 0x802C) +#define MMIOREG_LINE_STYLE2 (pAST->MMIOVirtualAddr + 0x8030) + +/* CMDQ Reg */ +#define CMDQREG_SRC_BASE (0x00 << 24) +#define CMDQREG_SRC_PITCH (0x01 << 24) +#define CMDQREG_DST_BASE (0x02 << 24) +#define CMDQREG_DST_PITCH (0x03 << 24) +#define CMDQREG_DST_XY (0x04 << 24) +#define CMDQREG_SRC_XY (0x05 << 24) +#define CMDQREG_RECT_XY (0x06 << 24) +#define CMDQREG_FG (0x07 << 24) +#define CMDQREG_BG (0x08 << 24) +#define CMDQREG_FG_SRC (0x09 << 24) +#define CMDQREG_BG_SRC (0x0A << 24) +#define CMDQREG_MONO1 (0x0B << 24) +#define CMDQREG_MONO2 (0x0C << 24) +#define CMDQREG_CLIP1 (0x0D << 24) +#define CMDQREG_CLIP2 (0x0E << 24) +#define CMDQREG_CMD (0x0F << 24) +#define CMDQREG_PAT (0x40 << 24) + +#define CMDQREG_LINE_XY (0x04 << 24) +#define CMDQREG_LINE_Err (0x05 << 24) +#define CMDQREG_LINE_WIDTH (0x06 << 24) +#define CMDQREG_LINE_K1 (0x09 << 24) +#define CMDQREG_LINE_K2 (0x0A << 24) +#define CMDQREG_LINE_STYLE1 (0x0B << 24) +#define CMDQREG_LINE_STYLE2 (0x0C << 24) + +/* CMD Reg. Definition */ +#define CMD_BITBLT 0x00000000 +#define CMD_LINEDRAW 0x00000001 +#define CMD_COLOREXP 0x00000002 +#define CMD_ENHCOLOREXP 0x00000003 +#define CMD_MASK 0x00000007 + +#define CMD_DISABLE_CLIP 0x00000000 +#define CMD_ENABLE_CLIP 0x00000008 + +#define CMD_COLOR_08 0x00000000 +#define CMD_COLOR_16 0x00000010 +#define CMD_COLOR_32 0x00000020 + +#define CMD_SRC_SIQ 0x00000040 + +#define CMD_TRANSPARENT 0x00000080 + +#define CMD_PAT_FGCOLOR 0x00000000 +#define CMD_PAT_MONOMASK 0x00010000 +#define CMD_PAT_PATREG 0x00020000 + +#define CMD_OPAQUE 0x00000000 +#define CMD_FONT_TRANSPARENT 0x00040000 + +#define CMD_X_INC 0x00000000 +#define CMD_X_DEC 0x00200000 + +#define CMD_Y_INC 0x00000000 +#define CMD_Y_DEC 0x00100000 + +#define CMD_DRAW_LAST_PIXEL 0x00000000 +#define CMD_NOT_DRAW_LAST_PIXEL 0x00800000 + +#define CMD_DISABLE_LINE_STYLE 0x00000000 +#define CMD_ENABLE_LINE_STYLE 0x40000000 + +#define CMD_RESET_STYLE_COUNTER 0x80000000 +#define CMD_NOT_RESET_STYLE_COUNTER 0x00000000 + +#define BURST_FORCE_CMD 0x80000000 + +/* Line */ +#define LINEPARAM_XM 0x00000001 +#define LINEPARAM_X_DEC 0x00000002 +#define LINEPARAM_Y_DEC 0x00000004 + +typedef struct _LINEPARAM { + USHORT dsLineX; + USHORT dsLineY; + USHORT dsLineWidth; + ULONG dwErrorTerm; + ULONG dwK1Term; + ULONG dwK2Term; + ULONG dwLineAttributes; +} LINEPARAM, *PLINEPARAM; + +typedef struct { + + ULONG X1; + ULONG Y1; + ULONG X2; + ULONG Y2; + +} _LINEInfo; + +/* Macro */ +/* MMIO 2D Macro */ +#define ASTSetupSRCBase_MMIO(base) \ + { \ + do { \ + *(ULONG *)(MMIOREG_SRC_BASE) = (ULONG) (base); \ + } while (*(ULONG *)(MMIOREG_SRC_BASE) != (ULONG) (base)); \ + } +#define ASTSetupSRCPitch_MMIO(pitch) \ + { \ + do { \ + *(ULONG *)(MMIOREG_SRC_PITCH) = (ULONG)(pitch << 16); \ + } while (*(ULONG *)(MMIOREG_SRC_PITCH) != (ULONG)(pitch << 16)); \ + } +#define ASTSetupDSTBase_MMIO(base) \ + { \ + do { \ + *(ULONG *)(MMIOREG_DST_BASE) = (ULONG)(base); \ + } while (*(ULONG *)(MMIOREG_DST_BASE) != (ULONG)(base)); \ + } +#define ASTSetupDSTPitchHeight_MMIO(pitch, height) \ + { \ + ULONG dstpitch; \ + dstpitch = (ULONG)((pitch << 16) + ((height) & MAX_DST_HEIGHT)); \ + do { \ + *(ULONG *)(MMIOREG_DST_PITCH) = dstpitch; \ + } while (*(ULONG *)(MMIOREG_DST_PITCH) != dstpitch); \ + } +#define ASTSetupDSTXY_MMIO(x, y) \ + { \ + ULONG dstxy; \ + dstxy = (ULONG)(((x & MAX_DST_X) << 16) + (y & MAX_DST_Y)); \ + do { \ + *(ULONG *)(MMIOREG_DST_XY) = dstxy; \ + } while (*(ULONG *)(MMIOREG_DST_XY) != dstxy); \ + } +#define ASTSetupSRCXY_MMIO(x, y) \ + { \ + ULONG srcxy; \ + srcxy = (ULONG)(((x & MAX_SRC_X) << 16) + (y & MAX_SRC_Y)); \ + do { \ + *(ULONG *)(MMIOREG_SRC_XY) = srcxy; \ + } while (*(ULONG *)(MMIOREG_SRC_XY) != srcxy); \ + } +#define ASTSetupRECTXY_MMIO(x, y) \ + { \ + ULONG rectxy; \ + rectxy = (ULONG)(((x & MAX_RECT_WIDTH) << 16) + (y & MAX_RECT_WIDTH)); \ + do { \ + *(ULONG *)(MMIOREG_RECT_XY) = rectxy; \ + } while (*(ULONG *)(MMIOREG_RECT_XY) != rectxy); \ + } +#define ASTSetupFG_MMIO(color) \ + { \ + do { \ + *(ULONG *)(MMIOREG_FG) = (ULONG)(color); \ + } while (*(ULONG *)(MMIOREG_FG) != (ULONG)(color)); \ + } +#define ASTSetupBG_MMIO(color) \ + { \ + do { \ + *(ULONG *)(MMIOREG_BG) = (ULONG)(color); \ + } while (*(ULONG *)(MMIOREG_BG) != (ULONG)(color)); \ + } +#define ASTSetupMONO1_MMIO(pat) \ + { \ + do { \ + *(ULONG *)(MMIOREG_MONO1) = (ULONG)(pat); \ + } while (*(ULONG *)(MMIOREG_MONO1) != (ULONG)(pat)); \ + } +#define ASTSetupMONO2_MMIO(pat) \ + { \ + do { \ + *(ULONG *)(MMIOREG_MONO2) = (ULONG)(pat); \ + } while (*(ULONG *)(MMIOREG_MONO2) != (ULONG)(pat)); \ + } +#define ASTSetupCLIP1_MMIO(left, top) \ + { \ + ULONG clip1; \ + clip1 = (ULONG)(((left & MAX_CLIP) << 16) + (top & MAX_CLIP)); \ + do { \ + *(ULONG *)(MMIOREG_CLIP1) = clip1; \ + } while (*(ULONG *)(MMIOREG_CLIP1) != clip1); \ + } +#define ASTSetupCLIP2_MMIO(right, bottom) \ + { \ + ULONG clip2; \ + clip2 = (ULONG)(((right & MAX_CLIP) << 16) + (bottom & MAX_CLIP)); \ + do { \ + *(ULONG *)(MMIOREG_CLIP2) = clip2; \ + } while (*(ULONG *)(MMIOREG_CLIP2) != clip2); \ + } +#define ASTSetupCMDReg_MMIO(reg) \ + { \ + *(ULONG *)(MMIOREG_CMD) = (ULONG)(reg); \ + } +#define ASTSetupPatReg_MMIO(patreg, pat) \ + { \ + do { \ + *(ULONG *)(MMIOREG_PAT + patreg*4) = (ULONG)(pat); \ + } while (*(ULONG *)(MMIOREG_PAT + patreg*4) != (ULONG)(pat)); \ + } + +/* Line CMD */ +#define ASTSetupLineXY_MMIO(x, y) \ + { \ + ULONG linexy; \ + linexy = (ULONG)(((x & MAX_LINE_X) << 16) + (y & MAX_LINE_Y)); \ + do { \ + *(ULONG *)(MMIOREG_LINE_XY) = linexy; \ + } while (*(ULONG *)(MMIOREG_LINE_XY) != linexy); \ + } +#define ASTSetupLineXMErrTerm_MMIO(xm, err) \ + { \ + ULONG lineerr; \ + lineerr = (ULONG)((xm << 24) + (err & MAX_LINE_ERR)); \ + do { \ + *(ULONG *)(MMIOREG_LINE_Err) = lineerr; \ + } while (*(ULONG *)(MMIOREG_LINE_Err) != lineerr); \ + } +#define ASTSetupLineWidth_MMIO(width) \ + { \ + ULONG linewidth; \ + linewidth = (ULONG)((width & MAX_LINE_WIDTH) << 16); \ + do { \ + *(ULONG *)(MMIOREG_LINE_WIDTH) = linewidth; \ + } while (*(ULONG *)(MMIOREG_LINE_WIDTH) != linewidth); \ + } +#define ASTSetupLineK1Term_MMIO(err) \ + { \ + do { \ + *(ULONG *)(MMIOREG_LINE_K1) = (ULONG)(err & MAX_LINE_K1); \ + } while (*(ULONG *)(MMIOREG_LINE_K1) != (ULONG)(err & MAX_LINE_K1)); \ + } +#define ASTSetupLineK2Term_MMIO(err) \ + { \ + do { \ + *(ULONG *)(MMIOREG_LINE_K2) = (ULONG)(err & MAX_LINE_K2); \ + } while (*(ULONG *)(MMIOREG_LINE_K2) != (ULONG)(err & MAX_LINE_K2)); \ + } +#define ASTSetupLineStyle1_MMIO(pat) \ + { \ + do { \ + *(ULONG *)(MMIOREG_LINE_STYLE1) = (ULONG)(pat); \ + } while (*(ULONG *)(MMIOREG_LINE_STYLE1) != (ULONG)(pat)); \ + } +#define ASTSetupLineStyle2_MMIO(pat) \ + { \ + do { \ + *(ULONG *)(MMIOREG_LINE_STYLE2) = (ULONG)(pat); \ + } while (*(ULONG *)(MMIOREG_LINE_STYLE2) != (ULONG)(pat)); \ + } + +/* CMDQ Mode Macro */ +#define mUpdateWritePointer *(ULONG *) (pAST->CMDQInfo.pjWritePort) = (pAST->CMDQInfo.ulWritePointer >>3) + +/* General CMD */ +#define ASTSetupSRCBase(addr, base) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_SRC_BASE); \ + addr->PKT_SC_dwData[0] = (ULONG)(base); \ + } +#define ASTSetupSRCPitch(addr, pitch) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_SRC_PITCH); \ + addr->PKT_SC_dwData[0] = (ULONG)(pitch << 16); \ + } +#define ASTSetupDSTBase(addr, base) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_DST_BASE); \ + addr->PKT_SC_dwData[0] = (ULONG)(base); \ + } +#define ASTSetupDSTPitchHeight(addr, pitch, height) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_DST_PITCH); \ + addr->PKT_SC_dwData[0] = (ULONG)((pitch << 16) + ((height) & MAX_DST_HEIGHT)); \ + } +#define ASTSetupDSTXY(addr, x, y) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_DST_XY); \ + addr->PKT_SC_dwData[0] = (ULONG)(((x & MAX_DST_X) << 16) + (y & MAX_DST_Y)); \ + } +#define ASTSetupSRCXY(addr, x, y) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_SRC_XY); \ + addr->PKT_SC_dwData[0] = (ULONG)(((x & MAX_SRC_X) << 16) + (y & MAX_SRC_Y)); \ + } +#define ASTSetupRECTXY(addr, x, y) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_RECT_XY); \ + addr->PKT_SC_dwData[0] = (ULONG)(((x & MAX_RECT_WIDTH) << 16) + (y & MAX_RECT_WIDTH)); \ + } +#define ASTSetupFG(addr, color) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_FG); \ + addr->PKT_SC_dwData[0] = (ULONG)(color); \ + } +#define ASTSetupBG(addr, color) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_BG); \ + addr->PKT_SC_dwData[0] = (ULONG)(color); \ + } +#define ASTSetupMONO1(addr, pat) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_MONO1); \ + addr->PKT_SC_dwData[0] = (ULONG)(pat); \ + } +#define ASTSetupMONO2(addr, pat) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_MONO2); \ + addr->PKT_SC_dwData[0] = (ULONG)(pat); \ + } +#define ASTSetupCLIP1(addr, left, top) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_CLIP1); \ + addr->PKT_SC_dwData[0] = (ULONG)(((left & MAX_CLIP) << 16) + (top & MAX_CLIP)); \ + } +#define ASTSetupCLIP2(addr, right, bottom) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_CLIP2); \ + addr->PKT_SC_dwData[0] = (ULONG)(((right & MAX_CLIP) << 16) + (bottom & MAX_CLIP)); \ + } +#define ASTSetupCMDReg(addr, reg) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_CMD); \ + addr->PKT_SC_dwData[0] = (ULONG)(reg); \ + } +#define ASTSetupPatReg(addr, patreg, pat) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + (CMDQREG_PAT + (patreg << 24))); \ + addr->PKT_SC_dwData[0] = (ULONG)(pat); \ + } + +/* Line CMD */ +#define ASTSetupLineXY(addr, x, y) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_LINE_XY); \ + addr->PKT_SC_dwData[0] = (ULONG)(((x & MAX_LINE_X) << 16) + (y & MAX_LINE_Y)); \ + } +#define ASTSetupLineXMErrTerm(addr, xm, err) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_LINE_Err); \ + addr->PKT_SC_dwData[0] = (ULONG)((xm << 24) + (err & MAX_LINE_ERR)); \ + } +#define ASTSetupLineWidth(addr, width) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_LINE_WIDTH); \ + addr->PKT_SC_dwData[0] = (ULONG)((width & MAX_LINE_WIDTH) << 16); \ + } +#define ASTSetupLineK1Term(addr, err) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_LINE_K1); \ + addr->PKT_SC_dwData[0] = (ULONG)(err & MAX_LINE_K1); \ + } +#define ASTSetupLineK2Term(addr, err) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_LINE_K2); \ + addr->PKT_SC_dwData[0] = (ULONG)(err & MAX_LINE_K2); \ + } +#define ASTSetupLineStyle1(addr, pat) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_LINE_STYLE1); \ + addr->PKT_SC_dwData[0] = (ULONG)(pat); \ + } +#define ASTSetupLineStyle2(addr, pat) \ + { \ + addr->PKT_SC_dwHeader = (ULONG)(PKT_SINGLE_CMD_HEADER + CMDQREG_LINE_STYLE2); \ + addr->PKT_SC_dwData[0] = (ULONG)(pat); \ + } + +#define ASTSetupNULLCMD(addr) \ + { \ + addr->PKT_SC_dwHeader = (ULONG) (PKT_NULL_CMD); \ + addr->PKT_SC_dwData[0] = (ULONG) 0; \ + } + +extern Bool bASTEnable2D(ScrnInfoPtr pScrn, ASTRecPtr pAST); +extern void vASTDisable2D(ScrnInfoPtr pScrn, ASTRecPtr pAST); +extern void vASTWaitEngIdle(ScrnInfoPtr pScrn, ASTRecPtr pAST); +extern UCHAR *pjASTRequestCMDQ(ASTRecPtr pAST, ULONG ulDataLen); +extern Bool bASTGetLineTerm(_LINEInfo *LineInfo, LINEPARAM *dsLineParam); + +#endif /* __AST_2DTOOL_H__ */ Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_accel.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_accel.c:1.1 --- /dev/null Tue May 9 21:56:43 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_accel.c Thu Apr 13 20:50:38 2006 @@ -0,0 +1,1326 @@ +/* + * Copyright (c) 2005 ASPEED Technology Inc. + * + * 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 the authors not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The authors makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHORS 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_accel.c,v 1.1 2006/04/14 00:50:38 dawes Exp $ */ + +#include "xf86.h" + +/* XAA include */ +#include "xaarop.h" + +/* Driver specific headers */ +#include "ast.h" + +#ifdef Accel_2D + +/* Prototype type declaration */ +static void ASTSync(ScrnInfoPtr pScrn); +static void ASTSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, + int xdir, int ydir, int rop, + unsigned int planemask, int trans_color); +static void ASTSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2, + int y2, int w, int h); +static void ASTSetupForSolidFill(ScrnInfoPtr pScrn, + int color, int rop, unsigned int planemask); +static void ASTSubsequentSolidFillRect(ScrnInfoPtr pScrn, + int dst_x, int dst_y, int width, int height); +static void ASTSetupForSolidLine(ScrnInfoPtr pScrn, + int color, int rop, unsigned int planemask); +static void ASTSubsequentSolidHorVertLine(ScrnInfoPtr pScrn, + int x, int y, int len, int dir); +static void ASTSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, + int x1, int y1, int x2, int y2, int flags); +static void ASTSetupForDashedLine(ScrnInfoPtr pScrn, + int fg, int bg, int rop, unsigned int planemask, + int length, UCHAR *pattern); +static void ASTSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, + int x1, int y1, int x2, int y2, + int flags, int phase); +static void ASTSetupForMonoPatternFill(ScrnInfoPtr pScrn, + int patx, int paty, int fg, int bg, + int rop, unsigned int planemask); +static void ASTSubsequentMonoPatternFill(ScrnInfoPtr pScrn, + int patx, int paty, + int x, int y, int w, int h); +static void ASTSetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, + int rop, unsigned int planemask, int trans_col); +static void ASTSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn, int patx, int paty, + int x, int y, int w, int h); +static void ASTSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, + int fg, int bg, + int rop, unsigned int planemask); +static void ASTSubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, + int x, int y, + int width, int height, int skipleft); +static void ASTSetupForScreenToScreenColorExpandFill(ScrnInfoPtr pScrn, + int fg, int bg, + int rop, unsigned int planemask); +static void ASTSubsequentScreenToScreenColorExpandFill(ScrnInfoPtr pScrn, + int x, int y, int width, int height, + int src_x, int src_y, int offset); +static void ASTSetClippingRectangle(ScrnInfoPtr pScrn, + int left, int top, int right, int bottom); +static void ASTDisableClipping(ScrnInfoPtr pScrn); + +Bool +ASTAccelInit(ScreenPtr pScreen) +{ + XAAInfoRecPtr infoPtr; + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ASTRecPtr pAST = ASTPTR(pScrn); + + pAST->AccelInfoPtr = infoPtr = XAACreateInfoRec(); + if (!infoPtr) return FALSE; + + infoPtr->Flags = LINEAR_FRAMEBUFFER | + OFFSCREEN_PIXMAPS | + PIXMAP_CACHE; + + /* Sync */ + if (pAST->ENGCaps & ENG_CAP_Sync) + infoPtr->Sync = ASTSync; + + /* Screen To Screen copy */ + if (pAST->ENGCaps & ENG_CAP_ScreenToScreenCopy) + { + infoPtr->SetupForScreenToScreenCopy = ASTSetupForScreenToScreenCopy; + infoPtr->SubsequentScreenToScreenCopy = ASTSubsequentScreenToScreenCopy; + infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY | NO_PLANEMASK; + } + + /* Solid fill */ + if (pAST->ENGCaps & ENG_CAP_SolidFill) + { + infoPtr->SetupForSolidFill = ASTSetupForSolidFill; + infoPtr->SubsequentSolidFillRect = ASTSubsequentSolidFillRect; + infoPtr->SolidFillFlags = NO_PLANEMASK; + } + + /* Solid Lines */ + if (pAST->ENGCaps & ENG_CAP_SolidLine) + { + infoPtr->SetupForSolidLine = ASTSetupForSolidLine; + infoPtr->SubsequentSolidHorVertLine = ASTSubsequentSolidHorVertLine; + infoPtr->SubsequentSolidTwoPointLine = ASTSubsequentSolidTwoPointLine; + infoPtr->SolidLineFlags = NO_PLANEMASK; + } + + /* Dashed Lines */ + if (pAST->ENGCaps & ENG_CAP_DashedLine) + { + infoPtr->SetupForDashedLine = ASTSetupForDashedLine; + infoPtr->SubsequentDashedTwoPointLine = ASTSubsequentDashedTwoPointLine; + infoPtr->DashPatternMaxLength = 64; + infoPtr->DashedLineFlags = NO_PLANEMASK | + LINE_PATTERN_MSBFIRST_LSBJUSTIFIED; + } + + /* 8x8 mono pattern fill */ + if (pAST->ENGCaps & ENG_CAP_Mono8x8PatternFill) + { + infoPtr->SetupForMono8x8PatternFill = ASTSetupForMonoPatternFill; + infoPtr->SubsequentMono8x8PatternFillRect = ASTSubsequentMonoPatternFill; + infoPtr->Mono8x8PatternFillFlags = NO_PLANEMASK | + NO_TRANSPARENCY | + HARDWARE_PATTERN_SCREEN_ORIGIN | + HARDWARE_PATTERN_PROGRAMMED_BITS | + BIT_ORDER_IN_BYTE_MSBFIRST; + } + + /* 8x8 color pattern fill */ + if (pAST->ENGCaps & ENG_CAP_Color8x8PatternFill) + { + infoPtr->SetupForColor8x8PatternFill = ASTSetupForColor8x8PatternFill; + infoPtr->SubsequentColor8x8PatternFillRect = ASTSubsequentColor8x8PatternFillRect; + infoPtr->Color8x8PatternFillFlags = NO_PLANEMASK | + NO_TRANSPARENCY | + HARDWARE_PATTERN_SCREEN_ORIGIN; + } + + /* CPU To Screen Color Expand */ + if (pAST->ENGCaps & ENG_CAP_CPUToScreenColorExpand) + { + infoPtr->SetupForCPUToScreenColorExpandFill = ASTSetupForCPUToScreenColorExpandFill; + infoPtr->SubsequentCPUToScreenColorExpandFill = ASTSubsequentCPUToScreenColorExpandFill; + infoPtr->ColorExpandRange = MAX_PATReg_Size; + infoPtr->ColorExpandBase = MMIOREG_PAT; + infoPtr->CPUToScreenColorExpandFillFlags = NO_PLANEMASK | + BIT_ORDER_IN_BYTE_MSBFIRST; + } + + /* Screen To Screen Color Expand */ + if (pAST->ENGCaps & ENG_CAP_ScreenToScreenColorExpand) + { + infoPtr->SetupForScreenToScreenColorExpandFill = ASTSetupForScreenToScreenColorExpandFill; + infoPtr->SubsequentScreenToScreenColorExpandFill = ASTSubsequentScreenToScreenColorExpandFill; + infoPtr->ScreenToScreenColorExpandFillFlags = NO_PLANEMASK | + BIT_ORDER_IN_BYTE_MSBFIRST; + } + + /* Clipping */ + if (pAST->ENGCaps & ENG_CAP_Clipping) + { + infoPtr->SetClippingRectangle = ASTSetClippingRectangle; + infoPtr->DisableClipping = ASTDisableClipping; + infoPtr->ClippingFlags = HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY | + HARDWARE_CLIP_MONO_8x8_FILL | + HARDWARE_CLIP_COLOR_8x8_FILL | + HARDWARE_CLIP_SOLID_FILL | + HARDWARE_CLIP_SOLID_LINE | + HARDWARE_CLIP_DASHED_LINE | + HARDWARE_CLIP_SOLID_LINE; + } + + return(XAAInit(pScreen, infoPtr)); + +} /* end of ASTAccelInit */ + + +static void +ASTSync(ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + + /* wait engle idle */ + vASTWaitEngIdle(pScrn, pAST); + +} /* end of ASTSync */ + + +static void ASTSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, + int xdir, int ydir, int rop, + unsigned int planemask, int trans_color) +{ + + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + ULONG cmdreg; + +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForScreenToScreenCopy\n"); +*/ + /* Modify Reg. Value */ + cmdreg = CMD_BITBLT; + switch (pAST->VideoModeInfo.bitsPerPixel) + { + case 8: + cmdreg |= CMD_COLOR_08; + break; + case 15: + case 16: + cmdreg |= CMD_COLOR_16; + break; + case 24: + case 32: + cmdreg |= CMD_COLOR_32; + break; + } + cmdreg |= (XAACopyROP[rop] << 8); + pAST->ulCMDReg = cmdreg; + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*2); + + ASTSetupSRCPitch(pSingleCMD, pAST->VideoModeInfo.ScreenPitch); + pSingleCMD++; + ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); + } + else + { + /* Write to MMIO */ + ASTSetupSRCPitch_MMIO(pAST->VideoModeInfo.ScreenPitch); + ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); + } + +} /* end of ASTSetupForScreenToScreenCopy */ + +static void +ASTSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2, + int y2, int width, int height) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + int src_x, src_y, dst_x, dst_y; + ULONG srcbase, dstbase, cmdreg; +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentScreenToScreenCopy\n"); +*/ + + /* Modify Reg. Value */ + cmdreg = pAST->ulCMDReg; + if (pAST->EnableClip) + cmdreg |= CMD_ENABLE_CLIP; + srcbase = dstbase = 0; + + if (y1 >= MAX_SRC_Y) + { + srcbase=pAST->VideoModeInfo.ScreenPitch*y1; + y1=0; + } + + if (y2 >= pScrn->virtualY) + { + dstbase=pAST->VideoModeInfo.ScreenPitch*y2; + y2=0; + } + + if (x1 < x2) + { + src_x = x1 + width - 1; + dst_x = x2 + width - 1; + cmdreg |= CMD_X_DEC; + } + else + { + src_x = x1; + dst_x = x2; + } + + if (y1 < y2) + { + src_y = y1 + height - 1; + dst_y = y2 + height - 1; + cmdreg |= CMD_Y_DEC; + } + else + { + src_y = y1; + dst_y = y2; + } + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*6); + + ASTSetupSRCBase(pSingleCMD, srcbase); + pSingleCMD++; + ASTSetupDSTBase(pSingleCMD, dstbase); + pSingleCMD++; + ASTSetupDSTXY(pSingleCMD, dst_x, dst_y); + pSingleCMD++; + ASTSetupSRCXY(pSingleCMD, src_x, src_y); + pSingleCMD++; + ASTSetupRECTXY(pSingleCMD, width, height); + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, cmdreg); + + /* Update Write Pointer */ + mUpdateWritePointer; + + } + else + { + ASTSetupSRCBase_MMIO(srcbase); + ASTSetupDSTBase_MMIO(dstbase); + ASTSetupDSTXY_MMIO(dst_x, dst_y); + ASTSetupSRCXY_MMIO(src_x, src_y); + ASTSetupRECTXY_MMIO(width, height); + ASTSetupCMDReg_MMIO(cmdreg); + + vASTWaitEngIdle(pScrn, pAST); + } + +} /* end of ASTSubsequentScreenToScreenCopy */ + +static void +ASTSetupForSolidFill(ScrnInfoPtr pScrn, + int color, int rop, unsigned int planemask) +{ + + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + ULONG cmdreg; + +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForSolidFill\n"); +*/ + /* Modify Reg. Value */ + cmdreg = CMD_BITBLT | CMD_PAT_FGCOLOR; + switch (pAST->VideoModeInfo.bitsPerPixel) + { + case 8: + cmdreg |= CMD_COLOR_08; + break; + case 15: + case 16: + cmdreg |= CMD_COLOR_16; + break; + case 24: + case 32: + cmdreg |= CMD_COLOR_32; + break; + } + cmdreg |= (XAAPatternROP[rop] << 8); + pAST->ulCMDReg = cmdreg; + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*2); + + ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); + pSingleCMD++; + ASTSetupFG(pSingleCMD, color); + } + else + { + ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); + ASTSetupFG_MMIO(color); + } + +} /* end of ASTSetupForSolidFill */ + + +static void +ASTSubsequentSolidFillRect(ScrnInfoPtr pScrn, + int dst_x, int dst_y, int width, int height) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + ULONG dstbase, cmdreg; +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentSolidFillRect\n"); +*/ + + /* Modify Reg. Value */ + cmdreg = pAST->ulCMDReg; + if (pAST->EnableClip) + cmdreg |= CMD_ENABLE_CLIP; + dstbase = 0; + + if (dst_y >= pScrn->virtualY) + { + dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y; + dst_y=0; + } + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*4); + + ASTSetupDSTBase(pSingleCMD, dstbase); + pSingleCMD++; + ASTSetupDSTXY(pSingleCMD, dst_x, dst_y); + pSingleCMD++; + ASTSetupRECTXY(pSingleCMD, width, height); + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, cmdreg); + + /* Update Write Pointer */ + mUpdateWritePointer; + + } + else + { + ASTSetupDSTBase_MMIO(dstbase); + ASTSetupDSTXY_MMIO(dst_x, dst_y); + ASTSetupRECTXY_MMIO(width, height); + ASTSetupCMDReg_MMIO(cmdreg); + + vASTWaitEngIdle(pScrn, pAST); + + } + + +} /* end of ASTSubsequentSolidFillRect */ + +/* Line */ +static void ASTSetupForSolidLine(ScrnInfoPtr pScrn, + int color, int rop, unsigned int planemask) +{ + + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + ULONG cmdreg; +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForSolidLine\n"); +*/ + /* Modify Reg. Value */ + cmdreg = CMD_BITBLT; + switch (pAST->VideoModeInfo.bitsPerPixel) + { + case 8: + cmdreg |= CMD_COLOR_08; + break; + case 15: + case 16: + cmdreg |= CMD_COLOR_16; + break; + case 24: + case 32: + cmdreg |= CMD_COLOR_32; + break; + } + cmdreg |= (XAAPatternROP[rop] << 8); + pAST->ulCMDReg = cmdreg; + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*3); + + ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); + pSingleCMD++; + ASTSetupFG(pSingleCMD, color); + pSingleCMD++; + ASTSetupBG(pSingleCMD, 0); + + } + else + { + /* Write to MMIO */ + ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); + ASTSetupFG_MMIO(color); + ASTSetupBG_MMIO(0); + } + +} /* end of ASTSetupForSolidLine */ + + +static void ASTSubsequentSolidHorVertLine(ScrnInfoPtr pScrn, + int x, int y, int len, int dir) +{ + + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + ULONG dstbase, cmdreg; + int width, height; +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentSolidHorVertLine\n"); +*/ + + /* Modify Reg. Value */ + cmdreg = (pAST->ulCMDReg & (~CMD_MASK)) | CMD_BITBLT; + if (pAST->EnableClip) + cmdreg |= CMD_ENABLE_CLIP; + dstbase = 0; + + if(dir == DEGREES_0) { /* horizontal */ + width = len; + height = 1; + } else { /* vertical */ + width = 1; + height = len; + } + + if ((y + height) >= pScrn->virtualY) + { + dstbase=pAST->VideoModeInfo.ScreenPitch*y; + y=0; + } + + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*4); + + ASTSetupDSTBase(pSingleCMD, dstbase); + pSingleCMD++; + ASTSetupDSTXY(pSingleCMD, x, y); + pSingleCMD++; + ASTSetupRECTXY(pSingleCMD, width, height); + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, cmdreg); + + /* Update Write Pointer */ + mUpdateWritePointer; + + } + else + { + ASTSetupDSTBase_MMIO(dstbase); + ASTSetupDSTXY_MMIO(x, y); + ASTSetupRECTXY_MMIO(width, height); + ASTSetupCMDReg_MMIO(cmdreg); + + vASTWaitEngIdle(pScrn, pAST); + + } + + +} /* end of ASTSubsequentSolidHorVertLine */ + +static void ASTSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, + int x1, int y1, int x2, int y2, int flags) +{ + + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + LINEPARAM dsLineParam; + _LINEInfo LineInfo; + ULONG dstbase, ulCommand; + ULONG miny, maxy; + USHORT usXM; +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentSolidTwoPointLine\n"); +*/ + + /* Modify Reg. Value */ + ulCommand = (pAST->ulCMDReg & (~CMD_MASK)) | CMD_LINEDRAW; + if(flags & OMIT_LAST) + ulCommand |= CMD_NOT_DRAW_LAST_PIXEL; + else + ulCommand &= ~CMD_NOT_DRAW_LAST_PIXEL; + if (pAST->EnableClip) + ulCommand |= CMD_ENABLE_CLIP; + dstbase = 0; + miny = (y1 > y2) ? y2 : y1; + maxy = (y1 > y2) ? y1 : y2; + if(maxy >= pScrn->virtualY) { + dstbase = pAST->VideoModeInfo.ScreenPitch * miny; + y1 -= miny; + y2 -= miny; + } + + LineInfo.X1 = x1; + LineInfo.Y1 = y1; + LineInfo.X2 = x2; + LineInfo.Y2 = y2; + + bASTGetLineTerm(&LineInfo, &dsLineParam); /* Get Line Parameter */ + + if (dsLineParam.dwLineAttributes & LINEPARAM_X_DEC) + ulCommand |= CMD_X_DEC; + if (dsLineParam.dwLineAttributes & LINEPARAM_Y_DEC) + ulCommand |= CMD_Y_DEC; + + usXM = (dsLineParam.dwLineAttributes & LINEPARAM_XM) ? 1:0; + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*7); + + ASTSetupDSTBase(pSingleCMD, dstbase); + pSingleCMD++; + ASTSetupLineXY(pSingleCMD, dsLineParam.dsLineX, dsLineParam.dsLineY); + pSingleCMD++; + ASTSetupLineXMErrTerm(pSingleCMD, usXM , dsLineParam.dwErrorTerm); + pSingleCMD++; + ASTSetupLineWidth(pSingleCMD, dsLineParam.dsLineWidth); + pSingleCMD++; + ASTSetupLineK1Term(pSingleCMD, dsLineParam.dwK1Term); + pSingleCMD++; + ASTSetupLineK2Term(pSingleCMD, dsLineParam.dwK2Term); + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, ulCommand); + + /* Update Write Pointer */ + mUpdateWritePointer; + + } + else + { + ASTSetupDSTBase_MMIO(dstbase); + ASTSetupLineXY_MMIO(dsLineParam.dsLineX, dsLineParam.dsLineY); + ASTSetupLineXMErrTerm_MMIO( usXM , dsLineParam.dwErrorTerm); + ASTSetupLineWidth_MMIO(dsLineParam.dsLineWidth); + ASTSetupLineK1Term_MMIO(dsLineParam.dwK1Term); + ASTSetupLineK2Term_MMIO(dsLineParam.dwK2Term); + ASTSetupCMDReg_MMIO(ulCommand); + + vASTWaitEngIdle(pScrn, pAST); + + } + + +} /* end of ASTSubsequentSolidTwoPointLine */ + +/* Dash Line */ +static void +ASTSetupForDashedLine(ScrnInfoPtr pScrn, + int fg, int bg, int rop, unsigned int planemask, + int length, UCHAR *pattern) +{ + + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + ULONG cmdreg; +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForDashedLine\n"); +*/ + /* Modify Reg. Value */ + cmdreg = CMD_LINEDRAW | CMD_RESET_STYLE_COUNTER | CMD_ENABLE_LINE_STYLE; + + switch (pAST->VideoModeInfo.bitsPerPixel) + { + case 8: + cmdreg |= CMD_COLOR_08; + break; + case 15: + case 16: + cmdreg |= CMD_COLOR_16; + break; + case 24: + case 32: + cmdreg |= CMD_COLOR_32; + break; + } + cmdreg |= (XAAPatternROP[rop] << 8); + if(bg == -1) { + cmdreg |= CMD_TRANSPARENT; + bg = 0; + } + cmdreg |= (((length-1) & 0x3F) << 24); /* line period */ + pAST->ulCMDReg = cmdreg; + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*5); + + ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); + pSingleCMD++; + ASTSetupFG(pSingleCMD, fg); + pSingleCMD++; + ASTSetupBG(pSingleCMD, bg); + pSingleCMD++; + ASTSetupLineStyle1(pSingleCMD, *pattern); + pSingleCMD++; + ASTSetupLineStyle2(pSingleCMD, *(pattern+4)); + + } + else + { + /* Write to MMIO */ + ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); + ASTSetupFG_MMIO(fg); + ASTSetupBG_MMIO(bg); + ASTSetupLineStyle1_MMIO(*pattern); + ASTSetupLineStyle2_MMIO(*(pattern+4)); + + } + +} + +static void +ASTSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, + int x1, int y1, int x2, int y2, + int flags, int phase) +{ + + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + LINEPARAM dsLineParam; + _LINEInfo LineInfo; + ULONG dstbase, ulCommand; + ULONG miny, maxy; + USHORT usXM; +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentDashedTwoPointLine\n"); +*/ + + /* Modify Reg. Value */ + ulCommand = pAST->ulCMDReg; + if(flags & OMIT_LAST) + ulCommand |= CMD_NOT_DRAW_LAST_PIXEL; + else + ulCommand &= ~CMD_NOT_DRAW_LAST_PIXEL; + if (pAST->EnableClip) + ulCommand |= CMD_ENABLE_CLIP; + dstbase = 0; + miny = (y1 > y2) ? y2 : y1; + maxy = (y1 > y2) ? y1 : y2; + if(maxy >= pScrn->virtualY) { + dstbase = pAST->VideoModeInfo.ScreenPitch * miny; + y1 -= miny; + y2 -= miny; + } + + LineInfo.X1 = x1; + LineInfo.Y1 = y1; + LineInfo.X2 = x2; + LineInfo.Y2 = y2; + + bASTGetLineTerm(&LineInfo, &dsLineParam); /* Get Line Parameter */ + + if (dsLineParam.dwLineAttributes & LINEPARAM_X_DEC) + ulCommand |= CMD_X_DEC; + if (dsLineParam.dwLineAttributes & LINEPARAM_Y_DEC) + ulCommand |= CMD_Y_DEC; + + usXM = (dsLineParam.dwLineAttributes & LINEPARAM_XM) ? 1:0; + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*7); + + ASTSetupDSTBase(pSingleCMD, dstbase); + pSingleCMD++; + ASTSetupLineXY(pSingleCMD, dsLineParam.dsLineX, dsLineParam.dsLineY); + pSingleCMD++; + ASTSetupLineXMErrTerm(pSingleCMD, usXM , dsLineParam.dwErrorTerm); + pSingleCMD++; + ASTSetupLineWidth(pSingleCMD, dsLineParam.dsLineWidth); + pSingleCMD++; + ASTSetupLineK1Term(pSingleCMD, dsLineParam.dwK1Term); + pSingleCMD++; + ASTSetupLineK2Term(pSingleCMD, dsLineParam.dwK2Term); + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, ulCommand); + + /* Update Write Pointer */ + mUpdateWritePointer; + + } + else + { + ASTSetupDSTBase_MMIO(dstbase); + ASTSetupLineXY_MMIO(dsLineParam.dsLineX, dsLineParam.dsLineY); + ASTSetupLineXMErrTerm_MMIO( usXM , dsLineParam.dwErrorTerm); + ASTSetupLineWidth_MMIO(dsLineParam.dsLineWidth); + ASTSetupLineK1Term_MMIO(dsLineParam.dwK1Term); + ASTSetupLineK2Term_MMIO(dsLineParam.dwK2Term); + ASTSetupCMDReg_MMIO(ulCommand); + + vASTWaitEngIdle(pScrn, pAST); + + } + +} + +/* Mono Pattern Fill */ +static void +ASTSetupForMonoPatternFill(ScrnInfoPtr pScrn, + int patx, int paty, int fg, int bg, + int rop, unsigned int planemask) +{ + + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + ULONG cmdreg; + +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForMonoPatternFill\n"); +*/ + /* Modify Reg. Value */ + cmdreg = CMD_BITBLT | CMD_PAT_MONOMASK; + switch (pAST->VideoModeInfo.bitsPerPixel) + { + case 8: + cmdreg |= CMD_COLOR_08; + break; + case 15: + case 16: + cmdreg |= CMD_COLOR_16; + break; + case 24: + case 32: + cmdreg |= CMD_COLOR_32; + break; + } + cmdreg |= (XAAPatternROP[rop] << 8); + pAST->ulCMDReg = cmdreg; + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*5); + + ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); + pSingleCMD++; + ASTSetupFG(pSingleCMD, fg); + pSingleCMD++; + ASTSetupBG(pSingleCMD, bg); + pSingleCMD++; + ASTSetupMONO1(pSingleCMD, patx); + pSingleCMD++; + ASTSetupMONO2(pSingleCMD, paty); + } + else + { + ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); + ASTSetupFG_MMIO(fg); + ASTSetupBG_MMIO(bg); + ASTSetupMONO1_MMIO(patx); + ASTSetupMONO2_MMIO(paty); + } + +} /* end of ASTSetupForMonoPatternFill */ + + +static void +ASTSubsequentMonoPatternFill(ScrnInfoPtr pScrn, + int patx, int paty, + int dst_x, int dst_y, int width, int height) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + ULONG dstbase, cmdreg; +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentMonoPatternFill\n"); +*/ + + /* Modify Reg. Value */ + cmdreg = pAST->ulCMDReg; + if (pAST->EnableClip) + cmdreg |= CMD_ENABLE_CLIP; + dstbase = 0; + + if (dst_y >= pScrn->virtualY) + { + dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y; + dst_y=0; + } + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*4); + + ASTSetupDSTBase(pSingleCMD, dstbase); + pSingleCMD++; + ASTSetupDSTXY(pSingleCMD, dst_x, dst_y); + pSingleCMD++; + ASTSetupRECTXY(pSingleCMD, width, height); + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, cmdreg); + + /* Update Write Pointer */ + mUpdateWritePointer; + + } + else + { + ASTSetupDSTBase_MMIO(dstbase); + ASTSetupDSTXY_MMIO(dst_x, dst_y); + ASTSetupRECTXY_MMIO(width, height); + ASTSetupCMDReg_MMIO(cmdreg); + + vASTWaitEngIdle(pScrn, pAST); + } + +} /* end of ASTSubsequentMonoPatternFill */ + +static void +ASTSetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, + int rop, unsigned int planemask, int trans_col) +{ + + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + ULONG cmdreg; + CARD32 *pataddr; + ULONG ulPatSize; + int i, j, cpp; +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForColor8x8PatternFill\n"); +*/ + /* Modify Reg. Value */ + cmdreg = CMD_BITBLT | CMD_PAT_PATREG; + switch (pAST->VideoModeInfo.bitsPerPixel) + { + case 8: + cmdreg |= CMD_COLOR_08; + break; + case 15: + case 16: + cmdreg |= CMD_COLOR_16; + break; + case 24: + case 32: + cmdreg |= CMD_COLOR_32; + break; + } + cmdreg |= (XAAPatternROP[rop] << 8); + pAST->ulCMDReg = cmdreg; + cpp = (pScrn->bitsPerPixel + 1) / 8; + pataddr = (CARD32 *)(pAST->FBVirtualAddr + + (paty * pAST->VideoModeInfo.ScreenWidth) + (patx * cpp)); + ulPatSize = 8*8*cpp; + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*(1 + ulPatSize/4)); + ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); + pSingleCMD++; + for (i=0; i<8; i++) + { + for (j=0; j<8*cpp/4; j++) + { + ASTSetupPatReg(pSingleCMD, (i*j + j) , (*(CARD32 *) (pataddr++))); + pSingleCMD++; + } + } + } + else + { + ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); + for (i=0; i<8; i++) + { + for (j=0; j<8*cpp/4; j++) + { + ASTSetupPatReg_MMIO((i*j + j) , (*(CARD32 *) (pataddr++))); + } + } + + } + +} /* end of ASTSetupForColor8x8PatternFill */ + +static void +ASTSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn, int patx, int paty, + int dst_x, int dst_y, int width, int height) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + ULONG dstbase, cmdreg; +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentColor8x8PatternFillRect\n"); +*/ + + /* Modify Reg. Value */ + cmdreg = pAST->ulCMDReg; + if (pAST->EnableClip) + cmdreg |= CMD_ENABLE_CLIP; + dstbase = 0; + + if (dst_y >= pScrn->virtualY) + { + dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y; + dst_y=0; + } + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*4); + + ASTSetupDSTBase(pSingleCMD, dstbase); + pSingleCMD++; + ASTSetupDSTXY(pSingleCMD, dst_x, dst_y); + pSingleCMD++; + ASTSetupRECTXY(pSingleCMD, width, height); + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, cmdreg); + + /* Update Write Pointer */ + mUpdateWritePointer; + + } + else + { + ASTSetupDSTBase_MMIO(dstbase); + ASTSetupDSTXY_MMIO(dst_x, dst_y); + ASTSetupRECTXY_MMIO(width, height); + ASTSetupCMDReg_MMIO(cmdreg); + + vASTWaitEngIdle(pScrn, pAST); + } + +} /* ASTSubsequentColor8x8PatternFillRect */ + +/* CPU to Screen Expand */ +static void +ASTSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, + int fg, int bg, + int rop, unsigned int planemask) +{ + + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + ULONG cmdreg; + +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForCPUToScreenColorExpandFill\n"); +*/ + /* Modify Reg. Value */ + cmdreg = CMD_COLOREXP; + switch (pAST->VideoModeInfo.bitsPerPixel) + { + case 8: + cmdreg |= CMD_COLOR_08; + break; + case 15: + case 16: + cmdreg |= CMD_COLOR_16; + break; + case 24: + case 32: + cmdreg |= CMD_COLOR_32; + break; + } + cmdreg |= (XAAPatternROP[rop] << 8); + if(bg == -1) { + cmdreg |= CMD_FONT_TRANSPARENT; + bg = 0; + } + pAST->ulCMDReg = cmdreg; + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*3); + + ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); + pSingleCMD++; + ASTSetupFG(pSingleCMD, fg); + pSingleCMD++; + ASTSetupBG(pSingleCMD, bg); + + } + else + { + ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); + ASTSetupFG_MMIO(fg); + ASTSetupBG_MMIO(bg); + + } + +} + +static void +ASTSubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, + int dst_x, int dst_y, + int width, int height, int offset) +{ + + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + ULONG dstbase, cmdreg; + +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentCPUToScreenColorExpandFill\n"); +*/ + + /* Modify Reg. Value */ + cmdreg = pAST->ulCMDReg; + if (pAST->EnableClip) + cmdreg |= CMD_ENABLE_CLIP; + dstbase = 0; + + if (dst_y >= pScrn->virtualY) + { + dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y; + dst_y=0; + } + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*5); + + ASTSetupSRCPitch(pSingleCMD, ((width+7)/8)); + pSingleCMD++; + ASTSetupDSTBase(pSingleCMD, dstbase); + pSingleCMD++; + ASTSetupDSTXY(pSingleCMD, dst_x, dst_y); + pSingleCMD++; + ASTSetupRECTXY(pSingleCMD, width, height); + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, cmdreg); + + /* Update Write Pointer */ + mUpdateWritePointer; + + } + else + { + ASTSetupSRCPitch_MMIO((width+7)/8); + ASTSetupDSTBase_MMIO(dstbase); + ASTSetupDSTXY_MMIO(dst_x, dst_y); + ASTSetupSRCXY_MMIO(0, 0); + + ASTSetupRECTXY_MMIO(width, height); + ASTSetupCMDReg_MMIO(cmdreg); + + vASTWaitEngIdle(pScrn, pAST); + + } + +} + + +/* Screen to Screen Color Expand */ +static void +ASTSetupForScreenToScreenColorExpandFill(ScrnInfoPtr pScrn, + int fg, int bg, + int rop, unsigned int planemask) +{ + + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + ULONG cmdreg; + +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetupForScreenToScreenColorExpandFill\n"); +*/ + + /* Modify Reg. Value */ + cmdreg = CMD_ENHCOLOREXP; + switch (pAST->VideoModeInfo.bitsPerPixel) + { + case 8: + cmdreg |= CMD_COLOR_08; + break; + case 15: + case 16: + cmdreg |= CMD_COLOR_16; + break; + case 24: + case 32: + cmdreg |= CMD_COLOR_32; + break; + } + cmdreg |= (XAAPatternROP[rop] << 8); + if(bg == -1) { + cmdreg |= CMD_FONT_TRANSPARENT; + bg = 0; + } + pAST->ulCMDReg = cmdreg; + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*3); + + ASTSetupDSTPitchHeight(pSingleCMD, pAST->VideoModeInfo.ScreenPitch, -1); + pSingleCMD++; + ASTSetupFG(pSingleCMD, fg); + pSingleCMD++; + ASTSetupBG(pSingleCMD, bg); + + } + else + { + ASTSetupDSTPitchHeight_MMIO(pAST->VideoModeInfo.ScreenPitch, -1); + ASTSetupFG_MMIO(fg); + ASTSetupBG_MMIO(bg); + + } + +} + + + +static void +ASTSubsequentScreenToScreenColorExpandFill(ScrnInfoPtr pScrn, + int dst_x, int dst_y, int width, int height, + int src_x, int src_y, int offset) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; + ULONG srcbase, dstbase, cmdreg; + USHORT srcpitch; + +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentScreenToScreenColorExpandFill\n"); +*/ + + /* Modify Reg. Value */ + cmdreg = pAST->ulCMDReg; + if (pAST->EnableClip) + cmdreg |= CMD_ENABLE_CLIP; + dstbase = 0; + if (dst_y >= pScrn->virtualY) + { + dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y; + dst_y=0; + } + srcbase = pAST->VideoModeInfo.ScreenPitch*src_y + ((pScrn->bitsPerPixel+1)/8)*src_x; + srcpitch = (pScrn->displayWidth+7)/8; + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*6); + + ASTSetupSRCBase(pSingleCMD, srcbase); + pSingleCMD++; + ASTSetupSRCPitch(pSingleCMD,srcpitch); + pSingleCMD++; + ASTSetupDSTBase(pSingleCMD, dstbase); + pSingleCMD++; + ASTSetupDSTXY(pSingleCMD, dst_x, dst_y); + pSingleCMD++; + ASTSetupRECTXY(pSingleCMD, width, height); + pSingleCMD++; + ASTSetupCMDReg(pSingleCMD, cmdreg); + + /* Update Write Pointer */ + mUpdateWritePointer; + + } + else + { + ASTSetupSRCBase_MMIO(srcbase); + ASTSetupSRCPitch_MMIO(srcpitch); + ASTSetupDSTBase_MMIO(dstbase); + ASTSetupDSTXY_MMIO(dst_x, dst_y); + ASTSetupRECTXY_MMIO(width, height); + ASTSetupCMDReg_MMIO(cmdreg); + + vASTWaitEngIdle(pScrn, pAST); + + } + +} + + +/* Clipping */ +static void +ASTSetClippingRectangle(ScrnInfoPtr pScrn, + int left, int top, int right, int bottom) +{ + + ASTRecPtr pAST = ASTPTR(pScrn); + PKT_SC *pSingleCMD; +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetClippingRectangle\n"); +*/ + pAST->EnableClip = TRUE; + + if (!pAST->MMIO2D) + { + /* Write to CMDQ */ + pSingleCMD = (PKT_SC *) pjASTRequestCMDQ(pAST, PKT_SINGLE_LENGTH*2); + + ASTSetupCLIP1(pSingleCMD, left, top); + pSingleCMD++; + ASTSetupCLIP2(pSingleCMD, right, bottom); + } + else + { + ASTSetupCLIP1_MMIO(left, top); + ASTSetupCLIP2_MMIO(right, bottom); + } + +} + +static void +ASTDisableClipping(ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST = ASTPTR(pScrn); +/* + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTDisableClipping\n"); +*/ + pAST->EnableClip = FALSE; +} + + +#endif /* end of Accel_2D */ Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_accel.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_accel.h:1.1 --- /dev/null Tue May 9 21:56:43 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_accel.h Thu Apr 13 20:50:38 2006 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2005 ASPEED Technology Inc. + * + * 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 the authors not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The authors makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHORS 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_accel.h,v 1.1 2006/04/14 00:50:38 dawes Exp $ */ + +#ifndef __AST_ACCEL_H__ +#define __AST_ACCEL_H__ 1 + +extern Bool ASTAccelInit(ScreenPtr pScreen); + +#endif /* __AST_ACCEL_H */ Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_cursor.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_cursor.c:1.1 --- /dev/null Tue May 9 21:56:44 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_cursor.c Thu Apr 13 20:50:38 2006 @@ -0,0 +1,365 @@ +/* + * Copyright (c) 2005 ASPEED Technology Inc. + * + * 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 the authors not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The authors makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHORS 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_cursor.c,v 1.1 2006/04/14 00:50:38 dawes Exp $ */ + +#include "xf86.h" +#include "xf86_ansic.h" +#include "compiler.h" + +/* Cursor includes */ +#include "cursorstr.h" + +/* Driver specific headers */ +#include "ast.h" + +#ifdef HWC +/* Prototype type declaration */ +static void ASTShowCursor(ScrnInfoPtr pScrn); +static void ASTHideCursor(ScrnInfoPtr pScrn); +static void ASTSetCursorPosition(ScrnInfoPtr pScrn, int x, int y); +static void ASTSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg); +static void ASTLoadCursorImage(ScrnInfoPtr pScrn, UCHAR *src); +static Bool ASTUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs); +static void ASTLoadCursorARGB(ScrnInfoPtr pScrn, CursorPtr pCurs); +static Bool ASTUseHWCursorARGB(ScreenPtr pScreen, CursorPtr pCurs); + +static void ASTFireCursor(ScrnInfoPtr pScrn); + +Bool +ASTCursorInit(ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ASTRecPtr pAST = ASTPTR(pScrn); + xf86CursorInfoPtr infoPtr; + + infoPtr = xf86CreateCursorInfoRec(); + if(!infoPtr) return FALSE; + + pAST->HWCInfoPtr = infoPtr; + + infoPtr->Flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | + HARDWARE_CURSOR_INVERT_MASK | + HARDWARE_CURSOR_BIT_ORDER_MSBFIRST; + + infoPtr->MaxWidth = MAX_HWC_WIDTH; + infoPtr->MaxHeight = MAX_HWC_HEIGHT; + infoPtr->ShowCursor = ASTShowCursor; + infoPtr->HideCursor = ASTHideCursor; + infoPtr->SetCursorPosition = ASTSetCursorPosition; + infoPtr->SetCursorColors = ASTSetCursorColors; + infoPtr->LoadCursorImage = ASTLoadCursorImage; + infoPtr->UseHWCursor = ASTUseHWCursor; +#ifdef ARGB_CURSOR + infoPtr->UseHWCursorARGB = ASTUseHWCursorARGB; + infoPtr->LoadCursorARGB = ASTLoadCursorARGB; +#endif + + return(xf86InitCursor(pScreen, infoPtr)); + +} + +Bool bASTInitHWC(ScrnInfoPtr pScrn, ASTRecPtr pAST) +{ + ScreenPtr pScreen; + + /* init cursor cache info */ + /* Set HWC_NUM in Options instead */ + /* pAST->HWCInfo.HWC_NUM = DEFAULT_HWC_NUM; */ + pAST->HWCInfo.HWC_NUM_Next = 0; + + /* allocate HWC cache */ + if (!pAST->pHWCPtr) { + pScreen = screenInfo.screens[pScrn->scrnIndex]; + pAST->pHWCPtr = xf86AllocateOffscreenLinear (pScreen, (HWC_SIZE+HWC_SIGNATURE_SIZE)*pAST->HWCInfo.HWC_NUM, HWC_ALIGN, NULL, NULL, NULL); + + if (!pAST->pHWCPtr) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"Allocate HWC Cache failed \n"); + return (FALSE); + } + + pAST->HWCInfo.ulHWCOffsetAddr = pAST->pHWCPtr->offset*((pScrn->bitsPerPixel + 1) / 8); + pAST->HWCInfo.pjHWCVirtualAddr = pAST->FBVirtualAddr + pAST->HWCInfo.ulHWCOffsetAddr; + } + + return (TRUE); +} + + +static void +ASTShowCursor(ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + UCHAR jReg; + + jReg= 0x02; + if (pAST->HWCInfo.cursortype ==HWC_COLOR) + jReg |= 0x01; + + SetIndexRegMask(CRTC_PORT, 0xCB, 0xFC, jReg); /* enable mono */ + +} + +static void +ASTHideCursor(ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + + SetIndexRegMask(CRTC_PORT, 0xCB, 0xFC, 0x00); /* disable HWC */ + +} + +static void +ASTSetCursorPosition(ScrnInfoPtr pScrn, int x, int y) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + DisplayModePtr mode = pAST->ModePtr; + int x_offset, y_offset; + UCHAR *pjSignature; + + /* Set cursor info to Offscreen */ + pjSignature = (UCHAR *) pAST->HWCInfo.pjHWCVirtualAddr + (HWC_SIZE+HWC_SIGNATURE_SIZE)*pAST->HWCInfo.HWC_NUM_Next + HWC_SIZE; + *((ULONG *) (pjSignature + HWC_SIGNATURE_X)) = x; + *((ULONG *) (pjSignature + HWC_SIGNATURE_Y)) = y; + + + x_offset = pAST->HWCInfo.offset_x; + y_offset = pAST->HWCInfo.offset_y; + + if(x < 0) { + x_offset = (-x) + pAST->HWCInfo.offset_x; + x = 0; + } + + if(y < 0) { + y_offset = (-y) + pAST->HWCInfo.offset_y; + y = 0; + } + + if(mode->Flags & V_DBLSCAN) y *= 2; + + /* Set to Reg. */ + SetIndexReg(CRTC_PORT, 0xC2, (UCHAR) (x_offset)); + SetIndexReg(CRTC_PORT, 0xC3, (UCHAR) (y_offset)); + SetIndexReg(CRTC_PORT, 0xC4, (UCHAR) (x & 0xFF)); + SetIndexReg(CRTC_PORT, 0xC5, (UCHAR) ((x >> 8) & 0x0F)); + SetIndexReg(CRTC_PORT, 0xC6, (UCHAR) (y & 0xFF)); + SetIndexReg(CRTC_PORT, 0xC7, (UCHAR) ((y >> 8) & 0x07)); + + /* Fire HWC */ + ASTFireCursor(pScrn); + +} + +static void +ASTSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + + pAST->HWCInfo.fg = (fg & 0x0F) | (((fg>>8) & 0x0F) << 4) | (((fg>>16) & 0x0F) << 8); + pAST->HWCInfo.bg = (bg & 0x0F) | (((bg>>8) & 0x0F) << 4) | (((bg>>16) & 0x0F) << 8); +} + +static void +ASTLoadCursorImage(ScrnInfoPtr pScrn, UCHAR *src) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + int i, j, k; + UCHAR *pjSrcAnd, *pjSrcXor, *pjDstData; + ULONG ulTempDstAnd32[2], ulTempDstXor32[2], ulTempDstData32[2]; + UCHAR jTempSrcAnd32, jTempSrcXor32; + ULONG ulCheckSum = 0; + ULONG ulPatternAddr; + + /* init cursor info. */ + pAST->HWCInfo.cursortype = HWC_MONO; + pAST->HWCInfo.width = (USHORT) MAX_HWC_WIDTH; + pAST->HWCInfo.height = (USHORT) MAX_HWC_HEIGHT; + pAST->HWCInfo.offset_x = MAX_HWC_WIDTH - pAST->HWCInfo.width; + pAST->HWCInfo.offset_y = MAX_HWC_HEIGHT - pAST->HWCInfo.height; + + /* copy cursor image to cache */ + pjSrcXor = src; + pjSrcAnd = src + (MAX_HWC_WIDTH*MAX_HWC_HEIGHT/8); + pjDstData = pAST->HWCInfo.pjHWCVirtualAddr+(HWC_SIZE+HWC_SIGNATURE_SIZE)*pAST->HWCInfo.HWC_NUM_Next; + + for (j = 0; j < MAX_HWC_HEIGHT; j++) + { + for (i = 0; i < (MAX_HWC_WIDTH/8); i++ ) + { + for (k=7; k>0; k-=2) + { + jTempSrcAnd32 = *((UCHAR *) pjSrcAnd); + jTempSrcXor32 = *((UCHAR *) pjSrcXor); + ulTempDstAnd32[0] = ((jTempSrcAnd32 >> k) & 0x01) ? 0x00008000L:0x00L; + ulTempDstXor32[0] = ((jTempSrcXor32 >> k) & 0x01) ? 0x00004000L:0x00L; + ulTempDstData32[0] = ((jTempSrcXor32 >> k) & 0x01) ? pAST->HWCInfo.fg:pAST->HWCInfo.bg; + ulTempDstAnd32[1] = ((jTempSrcAnd32 >> (k-1)) & 0x01) ? 0x80000000L:0x00L; + ulTempDstXor32[1] = ((jTempSrcXor32 >> (k-1)) & 0x01) ? 0x40000000L:0x00L; + ulTempDstData32[1] = ((jTempSrcXor32 >> (k-1)) & 0x01) ? (pAST->HWCInfo.fg << 16):(pAST->HWCInfo.bg << 16); + *((ULONG *) pjDstData) = ulTempDstAnd32[0] | ulTempDstXor32[0] | ulTempDstData32[0] | ulTempDstAnd32[1] | ulTempDstXor32[1] | ulTempDstData32[1]; + ulCheckSum += *((ULONG *) pjDstData); + pjDstData += 4; + + } + pjSrcAnd ++; + pjSrcXor ++; + + } + + } + + /* Write Checksum as signature */ + pjDstData = (UCHAR *) pAST->HWCInfo.pjHWCVirtualAddr + (HWC_SIZE+HWC_SIGNATURE_SIZE)*pAST->HWCInfo.HWC_NUM_Next + HWC_SIZE; + *((ULONG *) pjDstData) = ulCheckSum; + *((ULONG *) (pjDstData + HWC_SIGNATURE_SizeX)) = pAST->HWCInfo.width; + *((ULONG *) (pjDstData + HWC_SIGNATURE_SizeY)) = pAST->HWCInfo.height; + *((ULONG *) (pjDstData + HWC_SIGNATURE_HOTSPOTX)) = 0; + *((ULONG *) (pjDstData + HWC_SIGNATURE_HOTSPOTY)) = 0; + + /* set pattern offset */ + ulPatternAddr = ((pAST->HWCInfo.ulHWCOffsetAddr+(HWC_SIZE+HWC_SIGNATURE_SIZE)*pAST->HWCInfo.HWC_NUM_Next) >> 3); + SetIndexReg(CRTC_PORT, 0xC8, (UCHAR) (ulPatternAddr & 0xFF)); + SetIndexReg(CRTC_PORT, 0xC9, (UCHAR) ((ulPatternAddr >> 8) & 0xFF)); + SetIndexReg(CRTC_PORT, 0xCA, (UCHAR) ((ulPatternAddr >> 16) & 0xFF)); + + /* update HWC_NUM_Next */ + pAST->HWCInfo.HWC_NUM_Next = (pAST->HWCInfo.HWC_NUM_Next+1) % pAST->HWCInfo.HWC_NUM; + +} + +static Bool +ASTUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs) +{ + return TRUE; +} + +static void +ASTLoadCursorARGB(ScrnInfoPtr pScrn, CursorPtr pCurs) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + + UCHAR *pjDstXor, *pjSrcXor; + ULONG i, j, ulSrcWidth, ulSrcHeight; + ULONG ulPerPixelCopy, ulTwoPixelCopy; + LONG lAlphaDstDelta, lLastAlphaDstDelta; + union + { + ULONG ul; + UCHAR b[4]; + } ulSrcData32[2], ulData32; + union + { + USHORT us; + UCHAR b[2]; + } usData16; + ULONG ulCheckSum = 0; + ULONG ulPatternAddr; + + /* init cursor info. */ + pAST->HWCInfo.cursortype = HWC_COLOR; + pAST->HWCInfo.width = pCurs->bits->width; + pAST->HWCInfo.height = pCurs->bits->height; + pAST->HWCInfo.offset_x = MAX_HWC_WIDTH - pAST->HWCInfo.width; + pAST->HWCInfo.offset_y = MAX_HWC_HEIGHT - pAST->HWCInfo.height; + + /* copy cursor image to cache */ + ulSrcWidth = pAST->HWCInfo.width; + ulSrcHeight = pAST->HWCInfo.height; + + lAlphaDstDelta = MAX_HWC_WIDTH << 1; + lLastAlphaDstDelta = lAlphaDstDelta - (ulSrcWidth << 1); + + pjSrcXor = (UCHAR *) pCurs->bits->argb;; + pjDstXor = (UCHAR *) pAST->HWCInfo.pjHWCVirtualAddr + (HWC_SIZE+HWC_SIGNATURE_SIZE)*pAST->HWCInfo.HWC_NUM_Next + + lLastAlphaDstDelta + (MAX_HWC_HEIGHT - ulSrcHeight) * lAlphaDstDelta; + + ulPerPixelCopy = ulSrcWidth & 1; + ulTwoPixelCopy = ulSrcWidth >> 1; + + for (j = 0; j < ulSrcHeight; j++) + { + + for (i = 0; i < ulTwoPixelCopy; i++ ) + { + ulSrcData32[0].ul = *((ULONG *) pjSrcXor) & 0xF0F0F0F0; + ulSrcData32[1].ul = *((ULONG *) (pjSrcXor+4)) & 0xF0F0F0F0; + ulData32.b[0] = ulSrcData32[0].b[1] | (ulSrcData32[0].b[0] >> 4); + ulData32.b[1] = ulSrcData32[0].b[3] | (ulSrcData32[0].b[2] >> 4); + ulData32.b[2] = ulSrcData32[1].b[1] | (ulSrcData32[1].b[0] >> 4); + ulData32.b[3] = ulSrcData32[1].b[3] | (ulSrcData32[1].b[2] >> 4); + *((ULONG *) pjDstXor) = ulData32.ul; + ulCheckSum += (ULONG) ulData32.ul; + pjDstXor += 4; + pjSrcXor += 8; + } + + for (i = 0; i < ulPerPixelCopy; i++ ) + { + ulSrcData32[0].ul = *((ULONG *) pjSrcXor) & 0xF0F0F0F0; + usData16.b[0] = ulSrcData32[0].b[1] | (ulSrcData32[0].b[0] >> 4); + usData16.b[1] = ulSrcData32[0].b[3] | (ulSrcData32[0].b[2] >> 4); + *((USHORT *) pjDstXor) = usData16.us; + ulCheckSum += (ULONG) usData16.us; + pjDstXor += 2; + pjSrcXor += 4; + } + + /* Point to next source and dest scans */ + pjDstXor += lLastAlphaDstDelta; + + } /* end of for-loop */ + + /* Write Checksum as signature */ + pjDstXor = (UCHAR *) pAST->HWCInfo.pjHWCVirtualAddr + (HWC_SIZE+HWC_SIGNATURE_SIZE)*pAST->HWCInfo.HWC_NUM_Next + HWC_SIZE; + *((ULONG *) pjDstXor) = ulCheckSum; + *((ULONG *) (pjDstXor + HWC_SIGNATURE_SizeX)) = pAST->HWCInfo.width; + *((ULONG *) (pjDstXor + HWC_SIGNATURE_SizeY)) = pAST->HWCInfo.height; + *((ULONG *) (pjDstXor + HWC_SIGNATURE_HOTSPOTX)) = 0; + *((ULONG *) (pjDstXor + HWC_SIGNATURE_HOTSPOTY)) = 0; + + /* set pattern offset */ + ulPatternAddr = ((pAST->HWCInfo.ulHWCOffsetAddr +(HWC_SIZE+HWC_SIGNATURE_SIZE)*pAST->HWCInfo.HWC_NUM_Next) >> 3); + SetIndexReg(CRTC_PORT, 0xC8, (UCHAR) (ulPatternAddr & 0xFF)); + SetIndexReg(CRTC_PORT, 0xC9, (UCHAR) ((ulPatternAddr >> 8) & 0xFF)); + SetIndexReg(CRTC_PORT, 0xCA, (UCHAR) ((ulPatternAddr >> 16) & 0xFF)); + + /* update HWC_NUM_Next */ + pAST->HWCInfo.HWC_NUM_Next = (pAST->HWCInfo.HWC_NUM_Next+1) % pAST->HWCInfo.HWC_NUM; + +} + +static Bool +ASTUseHWCursorARGB(ScreenPtr pScreen, CursorPtr pCurs) +{ + return TRUE; +} + +static void +ASTFireCursor(ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + + SetIndexRegMask(CRTC_PORT, 0xCB, 0xFF, 0x00); /* dummp write to fire HWC */ + +} + +#endif /* End of HWC */ Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_cursor.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_cursor.h:1.1 --- /dev/null Tue May 9 21:56:44 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_cursor.h Thu Apr 13 20:50:38 2006 @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2005 ASPEED Technology Inc. + * + * 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 the authors not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The authors makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHORS 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_cursor.h,v 1.1 2006/04/14 00:50:38 dawes Exp $ */ + +#ifndef __AST_CURSOR_H__ +#define __AST_CURSOR_H__ 1 + +#define MAX_HWC_WIDTH 64 +#define MAX_HWC_HEIGHT 64 +#define HWC_SIZE (MAX_HWC_WIDTH*MAX_HWC_HEIGHT*2) +#define HWC_SIGNATURE_SIZE 32 +#define HWC_ALIGN 32 + +#define HWC_MONO 0 +#define HWC_COLOR 1 + +/* define for signature structure */ +#define HWC_SIGNATURE_CHECKSUM 0x00 +#define HWC_SIGNATURE_SizeX 0x04 +#define HWC_SIGNATURE_SizeY 0x08 +#define HWC_SIGNATURE_X 0x0C +#define HWC_SIGNATURE_Y 0x10 +#define HWC_SIGNATURE_HOTSPOTX 0x14 +#define HWC_SIGNATURE_HOTSPOTY 0x18 + +extern Bool ASTCursorInit(ScreenPtr pScreen); +extern Bool bASTInitHWC(ScrnInfoPtr pScrn, ASTRecPtr pAST); + +#endif /* __AST_CURSOR_H__ */ Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_driver.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_driver.c:1.1 --- /dev/null Tue May 9 21:56:44 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_driver.c Thu Apr 13 20:50:38 2006 @@ -0,0 +1,1157 @@ +/* + * Copyright (c) 2005 ASPEED Technology Inc. + * + * 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 the authors not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The authors makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHORS 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_driver.c,v 1.1 2006/04/14 00:50:38 dawes Exp $ */ + +#include "xf86.h" +#include "xf86_ansic.h" +#include "compiler.h" +#include "xf86Resources.h" +#include "xf86RAC.h" +#include "xf86cmap.h" +#include "mibstore.h" +#include "vgaHW.h" +#include "micmap.h" + +#include "fb.h" + +#include "vbe.h" +#ifndef xf86LoadVBEModule +# define xf86LoadVBEModule(_pScrn) xf86LoadSubModule((_pScrn), "vbe") +#endif + +/* Driver specific headers */ +#include "ast.h" + +/* Mandatory functions */ +static void ASTIdentify(int flags); +const OptionInfoRec *ASTAvailableOptions(int chipid, int busid); +static Bool ASTProbe(DriverPtr drv, int flags); +static Bool ASTPreInit(ScrnInfoPtr pScrn, int flags); +static Bool ASTScreenInit(int Index, ScreenPtr pScreen, int argc, char **argv); +static Bool ASTSwitchMode(int scrnIndex, DisplayModePtr mode, int flags); +static void ASTAdjustFrame(int scrnIndex, int x, int y, int flags); +static Bool ASTEnterVT(int scrnIndex, int flags); +static void ASTLeaveVT(int scrnIndex, int flags); +static void ASTFreeScreen(int scrnIndex, int flags); +static ModeStatus ASTValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags); + +/* Internally used functions */ +static Bool ASTGetRec(ScrnInfoPtr pScrn); +static void ASTFreeRec(ScrnInfoPtr pScrn); +static Bool ASTSaveScreen(ScreenPtr pScreen, Bool unblack); +static Bool ASTCloseScreen(int scrnIndex, ScreenPtr pScreen); +static void ASTSave(ScrnInfoPtr pScrn); +static void ASTRestore(ScrnInfoPtr pScrn); +static void ASTProbeDDC(ScrnInfoPtr pScrn, int index); +static xf86MonPtr ASTDoDDC(ScrnInfoPtr pScrn, int index); +static void vFillASTModeInfo (ScrnInfoPtr pScrn); +static Bool ASTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); + +/* + * This is intentionally screen-independent. It indicates the binding + * choice made in the first PreInit. + */ +DriverRec ASPEED = { + AST_VERSION, + AST_DRIVER_NAME, + ASTIdentify, + ASTProbe, + ASTAvailableOptions, + NULL, + 0 +}; + +/* Chipsets */ +static SymTabRec ASTChipsets[] = { + {PCI_CHIP_AST2000, "AST2000"}, + {-1, NULL} +}; + +static PciChipsets ASTPciChipsets[] = { + {PCI_CHIP_AST2000, PCI_CHIP_AST2000, RES_SHARED_VGA}, + {-1, -1, RES_UNDEFINED } +}; + +typedef enum { + OPTION_NOACCEL, + OPTION_MMIO2D, + OPTION_SW_CURSOR, + OPTION_HWC_NUM, + OPTION_ENG_CAPS, + OPTION_DBG_SELECT, + OPTION_NO_DDC +} ASTOpts; + +static const OptionInfoRec ASTOptions[] = { + {OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_MMIO2D, "MMIO2D", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_SW_CURSOR, "SWCursor", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_HWC_NUM, "HWCNumber", OPTV_INTEGER, {0}, FALSE}, + {OPTION_ENG_CAPS, "ENGCaps", OPTV_INTEGER, {0}, FALSE}, + {OPTION_DBG_SELECT, "DBGSelect", OPTV_INTEGER, {0}, FALSE}, + {OPTION_NO_DDC, "NoDDC", OPTV_BOOLEAN, {0}, FALSE}, + {-1, NULL, OPTV_NONE, {0}, FALSE} +}; + +static const char *vgahwSymbols[] = { + "vgaHWFreeHWRec", + "vgaHWGetHWRec", + "vgaHWGetIOBase", + "vgaHWGetIndex", + "vgaHWInit", + "vgaHWLock", + "vgaHWProtect", + "vgaHWRestore", + "vgaHWSave", + "vgaHWSaveScreen", + "vgaHWUnlock", + NULL +}; + +static const char *fbSymbols[] = { + "fbPictureInit", + "fbScreenInit", + NULL +}; + +static const char *vbeSymbols[] = { + "VBEInit", + "vbeDoEDID", + "vbeFree", + NULL +}; + +static const char *ddcSymbols[] = { + "xf86PrintEDID", + "xf86SetDDCproperties", + NULL +}; + +static const char *xaaSymbols[] = { + "XAACreateInfoRec", + "XAADestroyInfoRec", + "XAAInit", + "XAACopyROP", + "XAAPatternROP", + NULL +}; + +static const char *ramdacSymbols[] = { + "xf86CreateCursorInfoRec", + "xf86DestroyCursorInfoRec", + "xf86InitCursor", + NULL +}; + + +#ifdef XFree86LOADER + +static MODULESETUPPROTO(astSetup); + +static XF86ModuleVersionInfo astVersRec = { + AST_DRIVER_NAME, + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + AST_MAJOR_VERSION, AST_MINOR_VERSION, AST_PATCH_VERSION, + ABI_CLASS_VIDEODRV, +#ifdef PATCH_ABI_VERSION + ABI_VIDEODRV_VERSION_PATCH, +#else + ABI_VIDEODRV_VERSION, +#endif + MOD_CLASS_VIDEODRV, + {0, 0, 0, 0} +}; + +XF86ModuleData aspeedModuleData = { &astVersRec, astSetup, NULL }; + +static pointer +astSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) +{ + static Bool setupDone = FALSE; + + /* This module should be loaded only once, but check to be sure. + */ + if (!setupDone) { + setupDone = TRUE; + xf86AddDriver(&ASPEED, module, 0); + + /* + * Tell the loader about symbols from other modules that this module + * might refer to. + */ + xf86LoaderModRefSymLists(module, vgahwSymbols, + fbSymbols, xaaSymbols, ramdacSymbols, + vbeSymbols, ddcSymbols, NULL); + + /* + * The return value must be non-NULL on success even though there + * is no TearDownProc. + */ + return (pointer) TRUE; + } else { + if (errmaj) + *errmaj = LDR_ONCEONLY; + return NULL; + } +} + +#endif /* XFree86LOADER */ + +/* + * ASTIdentify -- + * + * Returns the string name for the driver based on the chipset. In this + * case it will always be an AST, so we can return a static string. + * + */ +static void +ASTIdentify(int flags) +{ + xf86PrintChipsets(AST_NAME, "Driver for AST Graphics Chipsets", + ASTChipsets); +} + +const OptionInfoRec * +ASTAvailableOptions(int chipid, int busid) +{ + + return ASTOptions; + +} + +/* + * ASTProbe -- + * + * Look through the PCI bus to find cards that are AST boards. + * Setup the dispatch table for the rest of the driver functions. + * + */ +static Bool +ASTProbe(DriverPtr drv, int flags) +{ + int i, numUsed, numDevSections, *usedChips; + Bool foundScreen = FALSE; + GDevPtr *devSections; + + /* + * Find the config file Device sections that match this + * driver, and return if there are none. + */ + if ((numDevSections = + xf86MatchDevice(AST_DRIVER_NAME, &devSections)) <= 0) { + return FALSE; + } + + /* + * This probing is just checking the PCI data the server already + * collected. + */ + if (xf86GetPciVideoInfo() == NULL) { + return FALSE; + } + + numUsed = xf86MatchPciInstances(AST_NAME, PCI_VENDOR_AST, + ASTChipsets, ASTPciChipsets, + devSections, numDevSections, + drv, &usedChips); + + xfree(devSections); + + if (flags & PROBE_DETECT) { + if (numUsed > 0) + foundScreen = TRUE; + } else { + for (i = 0; i < numUsed; i++) { + ScrnInfoPtr pScrn = NULL; + + /* Allocate new ScrnInfoRec and claim the slot */ + if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i], + ASTPciChipsets, 0, 0, 0, 0, 0))) + { + pScrn->driverVersion = AST_VERSION; + pScrn->driverName = AST_DRIVER_NAME; + pScrn->name = AST_NAME; + + pScrn->Probe = ASTProbe; + pScrn->PreInit = ASTPreInit; + pScrn->ScreenInit = ASTScreenInit; + pScrn->SwitchMode = ASTSwitchMode; + pScrn->AdjustFrame = ASTAdjustFrame; + pScrn->EnterVT = ASTEnterVT; + pScrn->LeaveVT = ASTLeaveVT; + pScrn->FreeScreen = ASTFreeScreen; + pScrn->ValidMode = ASTValidMode; + + foundScreen = TRUE; + + } /* end of if */ + } /* end of for-loop */ + } /* end of if flags */ + + xfree(usedChips); + + return foundScreen; +} + +/* + * ASTPreInit -- + * + * Do initial setup of the board before we know what resolution we will + * be running at. + * + */ +static Bool +ASTPreInit(ScrnInfoPtr pScrn, int flags) +{ + EntityInfoPtr pEnt; + int flags24; + rgb defaultWeight = { 0, 0, 0 }; + + ASTRecPtr pAST; + + ClockRangePtr clockRanges; + int i; + MessageType from; + ModuleDescPtr pMod; + + /* Suport one adapter only now */ + if (pScrn->numEntities != 1) + return FALSE; + + pEnt = xf86GetEntityInfo(pScrn->entityList[0]); + + if (flags & PROBE_DETECT) { + ASTProbeDDC(pScrn, pEnt->index); + return TRUE; + } + + if (pEnt->location.type != BUS_PCI) + return FALSE; + + if (xf86RegisterResources(pEnt->index, 0, ResExclusive)) + return FALSE; + + /* The vgahw module should be loaded here when needed */ + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) + return FALSE; + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); + + /* The fb module should be loaded here when needed */ + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) + return FALSE; + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); + + /* Allocate a vgaHWRec */ + if (!vgaHWGetHWRec(pScrn)) + return FALSE; + + /* Color Depth Check */ + flags24 = Support32bppFb; + if (!xf86SetDepthBpp(pScrn, 0, 0, 0, flags24)) { + return FALSE; + } else { + switch (pScrn->depth) { + case 8: + case 16: + case 24: + break; + default: + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Given depth (%d) is not supported by ast driver\n", + pScrn->depth); + return FALSE; + } + } + xf86PrintDepthBpp(pScrn); + + switch (pScrn->bitsPerPixel) { + case 8: + case 16: + case 32: + break; + default: + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Given bpp (%d) is not supported by ast driver\n", + pScrn->bitsPerPixel); + return FALSE; + } + + /* fill pScrn misc. */ + pScrn->progClock = TRUE; + pScrn->rgbBits = 6; + pScrn->monitor = pScrn->confScreen->monitor; /* should be initialized before set gamma */ + pScrn->racMemFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT; + pScrn->racIoFlags = RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT; + + /* + * If the driver can do gamma correction, it should call xf86SetGamma() + * here. + */ + { + Gamma zeros = { 0.0, 0.0, 0.0 }; + + if (!xf86SetGamma(pScrn, zeros)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "call xf86SetGamma failed \n"); + return FALSE; + } + } + + + if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight)) { + return FALSE; + } + + if (!xf86SetDefaultVisual(pScrn, -1)) { + return FALSE; + } + + /* Allocate driverPrivate */ + if (!ASTGetRec(pScrn)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "call ASTGetRec failed \n"); + return FALSE; + } + + /* Fill AST Info */ + pAST = ASTPTR(pScrn); + pAST->pEnt = xf86GetEntityInfo(pScrn->entityList[0]); + pAST->PciInfo = xf86GetPciInfoForEntity(pAST->pEnt->index); + pAST->PciTag = pciTag(pAST->PciInfo->bus, pAST->PciInfo->device, + pAST->PciInfo->func); + + /* Process the options + * pScrn->confScreen, pScrn->display, pScrn->monitor, pScrn->numEntities, + * and pScrn->entityList should be initialized before + */ + xf86CollectOptions(pScrn, NULL); + if (!(pAST->Options = xalloc(sizeof(ASTOptions)))) + { + ASTFreeRec(pScrn); + return FALSE; + } + memcpy(pAST->Options, ASTOptions, sizeof(ASTOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pAST->Options); + + /* + * Set the Chipset and ChipRev, allowing config file entries to + * override. + */ + if (pAST->pEnt->device->chipset && *pAST->pEnt->device->chipset) { + pScrn->chipset = pAST->pEnt->device->chipset; + from = X_CONFIG; + } else if (pAST->pEnt->device->chipID >= 0) { + pScrn->chipset = (char *)xf86TokenToString(ASTChipsets, + pAST->pEnt->device->chipID); + from = X_CONFIG; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n", + pAST->pEnt->device->chipID); + } else { + from = X_PROBED; + pScrn->chipset = (char *)xf86TokenToString(ASTChipsets, + pAST->PciInfo->chipType); + } + if (pAST->pEnt->device->chipRev >= 0) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n", + pAST->pEnt->device->chipRev); + } + + xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", + (pScrn->chipset != NULL) ? pScrn->chipset : "Unknown ast"); + + /* Resource Allocation */ +#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) + pAST->IODBase = 0; +#else + pAST->IODBase = pScrn->domainIOBase; +#endif + /* "Patch" the PIOOffset inside vgaHW in order to force + * the vgaHW module to use our relocated i/o ports. + */ + VGAHWPTR(pScrn)->PIOOffset = pAST->PIOOffset = pAST->IODBase + pAST->PciInfo->ioBase[2] - 0x380; + + pAST->RelocateIO = (IOADDRESS)(pAST->PciInfo->ioBase[2] + pAST->IODBase); + + if (pAST->pEnt->device->MemBase != 0) { + pAST->FBPhysAddr = pAST->pEnt->device->MemBase; + from = X_CONFIG; + } else { + if (pAST->PciInfo->memBase[0] != 0) { + pAST->FBPhysAddr = pAST->PciInfo->memBase[0] & 0xFFF00000; + from = X_PROBED; + } else { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "No valid FB address in PCI config space\n"); + ASTFreeRec(pScrn); + return FALSE; + } + } + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Linear framebuffer at 0x%lX\n", + (unsigned long) pAST->FBPhysAddr); + + if (pAST->pEnt->device->IOBase != 0) { + pAST->MMIOPhysAddr = pAST->pEnt->device->IOBase; + from = X_CONFIG; + } else { + if (pAST->PciInfo->memBase[1]) { + pAST->MMIOPhysAddr = pAST->PciInfo->memBase[1] & 0xFFFF0000; + from = X_PROBED; + } else { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "No valid MMIO address in PCI config space\n"); + ASTFreeRec(pScrn); + return FALSE; + } + } + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "IO registers at addr 0x%lX\n", + (unsigned long) pAST->MMIOPhysAddr); + + pScrn->videoRam = ASTGetVRAMInfo(pScrn) / 1024; + from = X_DEFAULT; + + + if (pAST->pEnt->device->videoRam) { + pScrn->videoRam = pAST->pEnt->device->videoRam; + from = X_CONFIG; + } + + pAST->FbMapSize = pScrn->videoRam * 1024; + pAST->MMIOMapSize = DEFAULT_MMIO_SIZE; + + /* Map resource */ + if (!ASTMapMem(pScrn)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Map FB Memory Failed \n"); + return FALSE; + } + + if (!ASTMapMMIO(pScrn)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Map Memory Map IO Failed \n"); + return FALSE; + } + + pScrn->memPhysBase = (ULONG)pAST->FBPhysAddr; + pScrn->fbOffset = 0; + + /* Do DDC + * should be done after xf86CollectOptions + */ + pScrn->monitor->DDC = ASTDoDDC(pScrn, pAST->pEnt->index); + + /* Mode Valid */ + clockRanges = xnfcalloc(sizeof(ClockRange), 1); + clockRanges->next = NULL; + clockRanges->minClock = 9500; + clockRanges->maxClock = GetMaxDCLK(pScrn) * 1000; + clockRanges->clockIndex = -1; + clockRanges->interlaceAllowed = FALSE; + clockRanges->doubleScanAllowed = FALSE; + + i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, + pScrn->display->modes, clockRanges, + 0, 320, 1600, 8 * pScrn->bitsPerPixel, + 200, 1200, + pScrn->display->virtualX, pScrn->display->virtualY, + pAST->FbMapSize, LOOKUP_BEST_REFRESH); + + if (i == -1) { + ASTFreeRec(pScrn); + return FALSE; + } + + xf86PruneDriverModes(pScrn); + + if (!i || !pScrn->modes) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); + ASTFreeRec(pScrn); + return FALSE; + } + + xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V); + + pScrn->currentMode = pScrn->modes; + + xf86PrintModes(pScrn); + + xf86SetDpi(pScrn, 0, 0); + + /* Accelaration Check */ + pAST->noAccel = TRUE; + pAST->AccelInfoPtr = NULL; + pAST->pCMDQPtr = NULL; + pAST->CMDQInfo.ulCMDQSize = 0; +#ifdef Accel_2D + if (!xf86ReturnOptValBool(pAST->Options, OPTION_NOACCEL, FALSE)) + { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { + ASTFreeRec(pScrn); + return FALSE; + } + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); + + pAST->noAccel = FALSE; + + pAST->MMIO2D = TRUE; +#ifndef MMIO_2D + if (!xf86ReturnOptValBool(pAST->Options, OPTION_MMIO2D, FALSE)) { + pAST->CMDQInfo.ulCMDQSize = DEFAULT_CMDQ_SIZE; + pAST->MMIO2D = FALSE; + } +#endif + + pAST->ENGCaps = ENG_CAP_ALL; + if (!xf86GetOptValInteger(pAST->Options, OPTION_ENG_CAPS, &pAST->ENGCaps)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No ENG Capability options found\n"); + } + + pAST->DBGSelect = 0; + if (!xf86GetOptValInteger(pAST->Options, OPTION_DBG_SELECT, &pAST->DBGSelect)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No DBG Seleclt options found\n"); + } + } +#endif + + /* HW Cursor Check */ + pAST->noHWC = TRUE; + pAST->HWCInfoPtr = NULL; + pAST->pHWCPtr = NULL; +#ifdef HWC + if (!xf86ReturnOptValBool(pAST->Options, OPTION_SW_CURSOR, FALSE)) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { + ASTFreeRec(pScrn); + return FALSE; + } + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); + + pAST->noHWC = FALSE; + pAST->HWCInfo.HWC_NUM = DEFAULT_HWC_NUM; + if (!xf86GetOptValInteger(pAST->Options, OPTION_HWC_NUM, &pAST->HWCInfo.HWC_NUM)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No HWC_NUM options found\n"); + } + + } +#endif + + /* We won't be using the VGA access after the probe */ + xf86SetOperatingState(resVgaIo, pAST->pEnt->index, ResUnusedOpr); + xf86SetOperatingState(resVgaMem, pAST->pEnt->index, ResDisableOpr); + + return TRUE; +} + + +static Bool +ASTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) +{ + ScrnInfoPtr pScrn; + ASTRecPtr pAST; + vgaHWPtr hwp; + VisualPtr visual; + + /* for FB Manager */ + BoxRec FBMemBox; + int AvailFBSize; + + pScrn = xf86Screens[pScreen->myNum]; + pAST = ASTPTR(pScrn); + hwp = VGAHWPTR(pScrn); + +/* if (!pAST->noAccel) */ + { + /* AvailFBSize = pAST->FbMapSize - pAST->CMDQInfo.ulCMDQSize; */ + AvailFBSize = pAST->FbMapSize; + + FBMemBox.x1 = 0; + FBMemBox.y1 = 0; + FBMemBox.x2 = pScrn->displayWidth; + FBMemBox.y2 = (AvailFBSize / (pScrn->displayWidth * ((pScrn->bitsPerPixel+1)/8))) - 1; + + if (!xf86InitFBManager(pScreen, &FBMemBox)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to init memory manager\n"); + return FALSE; + } + + } + + vgaHWGetIOBase(hwp); + + vFillASTModeInfo (pScrn); + + ASTSave(pScrn); + if (!ASTModeInit(pScrn, pScrn->currentMode)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Mode Init Failed \n"); + return FALSE; + } + + ASTSaveScreen(pScreen, FALSE); + ASTAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + + miClearVisualTypes(); + + /* Re-implemented Direct Color support, -jens */ + if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; + + if (!miSetPixmapDepths()) + { + ASTSaveScreen(pScreen, SCREEN_SAVER_OFF); + return FALSE; + } + + switch(pScrn->bitsPerPixel) { + case 8: + case 16: + case 32: + if (!fbScreenInit(pScreen, pAST->FBVirtualAddr + pScrn->fbOffset, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth, pScrn->bitsPerPixel)) + return FALSE; + break; + default: + return FALSE; + + } + + if (pScrn->bitsPerPixel > 8) { + /* Fixup RGB ordering */ + visual = pScreen->visuals + pScreen->numVisuals; + while (--visual >= pScreen->visuals) { + if ((visual->class | DynamicClass) == DirectColor) { + visual->offsetRed = pScrn->offset.red; + visual->offsetGreen = pScrn->offset.green; + visual->offsetBlue = pScrn->offset.blue; + visual->redMask = pScrn->mask.red; + visual->greenMask = pScrn->mask.green; + visual->blueMask = pScrn->mask.blue; + } + } + } + + fbPictureInit(pScreen, 0, 0); + + xf86SetBlackWhitePixels(pScreen); + +#ifdef Accel_2D + if (!pAST->noAccel) + { + if (!ASTAccelInit(pScreen)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"Hardware acceleration initialization failed\n"); + pAST->noAccel = TRUE; + } + } +#endif /* end of Accel_2D */ + + miInitializeBackingStore(pScreen); + xf86SetBackingStore(pScreen); + xf86SetSilkenMouse(pScreen); + + miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); + + if (!pAST->noHWC) + { + if (!ASTCursorInit(pScreen)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"Hardware cursor initialization failed\n"); + pAST->noHWC = TRUE; + } + } + + if (!miCreateDefColormap(pScreen)) + return FALSE; + + if(!xf86HandleColormaps(pScreen, 256, (pScrn->depth == 8) ? 8 : pScrn->rgbBits, + vASTLoadPalette, NULL, + CMAP_PALETTED_TRUECOLOR | CMAP_RELOAD_ON_MODE_SWITCH)) { + return FALSE; + } + + xf86DPMSInit(pScreen, ASTDisplayPowerManagementSet, 0); + + pScreen->SaveScreen = ASTSaveScreen; + pAST->CloseScreen = pScreen->CloseScreen; + pScreen->CloseScreen = ASTCloseScreen; + + if (serverGeneration == 1) + xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); + + return TRUE; + +} /* ASTScreenInit */ + + +static Bool +ASTSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) +{ + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + ASTRecPtr pAST = ASTPTR(pScrn); + +#ifdef HWC + if (pAST->pHWCPtr) { + xf86FreeOffscreenLinear(pAST->pHWCPtr); /* free HWC Cache */ + pAST->pHWCPtr = NULL; + } +#endif + +#ifdef Accel_2D + if (pAST->pCMDQPtr) { + xf86FreeOffscreenLinear(pAST->pCMDQPtr); /* free CMDQ */ + pAST->pCMDQPtr = NULL; + } + vASTDisable2D(pScrn, pAST); +#endif + + ASTRestore(pScrn); + + return ASTModeInit(pScrn, mode); + +} + +static void +ASTAdjustFrame(int scrnIndex, int x, int y, int flags) +{ + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + ASTRecPtr pAST = ASTPTR(pScrn); + ULONG base; + + base = y * pAST->VideoModeInfo.ScreenWidth + x * ((pAST->VideoModeInfo.bitsPerPixel + 1) / 8); + base = base >> 2; /* DW unit */ + + vASTSetStartAddressCRT1(pAST, base); + +} + +/* enter into X Server */ +static Bool +ASTEnterVT(int scrnIndex, int flags) +{ + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + + if (!ASTModeInit(pScrn, pScrn->currentMode)) + return FALSE; + ASTAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + + return TRUE; + +} + +/* leave X server */ +static void +ASTLeaveVT(int scrnIndex, int flags) +{ + + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + vgaHWPtr hwp = VGAHWPTR(pScrn); + ASTRecPtr pAST = ASTPTR(pScrn); + +#ifdef HWC + if (pAST->pHWCPtr) { + xf86FreeOffscreenLinear(pAST->pHWCPtr); /* free HWC Cache */ + pAST->pHWCPtr = NULL; + } +#endif + +#ifdef Accel_2D + if (pAST->pCMDQPtr) { + xf86FreeOffscreenLinear(pAST->pCMDQPtr); /* free CMDQ */ + pAST->pCMDQPtr = NULL; + } + vASTDisable2D(pScrn, pAST); +#endif + + ASTRestore(pScrn); + vgaHWLock(hwp); + +} + +static void +ASTFreeScreen(int scrnIndex, int flags) +{ + ASTFreeRec(xf86Screens[scrnIndex]); + if (xf86LoaderCheckSymbol("vgaHWFreeHWRec")) + vgaHWFreeHWRec(xf86Screens[scrnIndex]); +} + + +static ModeStatus +ASTValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) +{ + + ModeStatus Flags = MODE_NOMODE; + + if (mode->Flags & V_INTERLACE) { + if (verbose) { + xf86DrvMsg(scrnIndex, X_PROBED, + "Removing interlaced mode \"%s\"\n", mode->name); + } + return MODE_NO_INTERLACE; + } + + if ((mode->CrtcHDisplay > MAX_HResolution) || (mode->CrtcVDisplay > MAX_VResolution)) { + if (verbose) { + xf86DrvMsg(scrnIndex, X_PROBED, + "Removing the mode \"%s\"\n", mode->name); + } + return Flags; + } + + switch (mode->CrtcHDisplay) + { + case 640: + if (mode->CrtcVDisplay == 480) Flags=MODE_OK; + break; + case 800: + if (mode->CrtcVDisplay == 600) Flags=MODE_OK; + break; + case 1024: + if (mode->CrtcVDisplay == 768) Flags=MODE_OK; + break; + case 1280: + if (mode->CrtcVDisplay == 1024) Flags=MODE_OK; + break; + case 1600: + if (mode->CrtcVDisplay == 1200) Flags=MODE_OK; + break; + default: + return Flags; + } + + return Flags; +} + + +/* Internal used modules */ +/* + * ASTGetRec and ASTFreeRec -- + * + * Private data for the driver is stored in the screen structure. + * These two functions create and destroy that private data. + * + */ +static Bool +ASTGetRec(ScrnInfoPtr pScrn) +{ + if (pScrn->driverPrivate) + return TRUE; + + pScrn->driverPrivate = xnfcalloc(sizeof(ASTRec), 1); + return TRUE; +} + +static void +ASTFreeRec(ScrnInfoPtr pScrn) +{ + if (!pScrn) + return; + if (!pScrn->driverPrivate) + return; + xfree(pScrn->driverPrivate); + pScrn->driverPrivate = 0; +} + +static Bool +ASTSaveScreen(ScreenPtr pScreen, Bool unblack) +{ + /* more ref. SiS */ + return vgaHWSaveScreen(pScreen, unblack); +} + +static Bool +ASTCloseScreen(int scrnIndex, ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + vgaHWPtr hwp = VGAHWPTR(pScrn); + ASTRecPtr pAST = ASTPTR(pScrn); + + if (pScrn->vtSema == TRUE) + { +#ifdef HWC + if (pAST->pHWCPtr) { + xf86FreeOffscreenLinear(pAST->pHWCPtr); /* free HWC Cache */ + pAST->pHWCPtr = NULL; + } +#endif + +#ifdef Accel_2D + if (pAST->pCMDQPtr) { + xf86FreeOffscreenLinear(pAST->pCMDQPtr); /* free CMDQ */ + pAST->pCMDQPtr = NULL; + } + vASTDisable2D(pScrn, pAST); +#endif + + ASTRestore(pScrn); + vgaHWLock(hwp); + } + + ASTUnmapMem(pScrn); + + if(pAST->AccelInfoPtr) { + XAADestroyInfoRec(pAST->AccelInfoPtr); + pAST->AccelInfoPtr = NULL; + } + + if(pAST->HWCInfoPtr) { + xf86DestroyCursorInfoRec(pAST->HWCInfoPtr); + pAST->HWCInfoPtr = NULL; + } + + pScrn->vtSema = FALSE; + pScreen->CloseScreen = pAST->CloseScreen; + return (*pScreen->CloseScreen) (scrnIndex, pScreen); +} + +static void +ASTSave(ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST; + vgaRegPtr vgaReg; + ASTRegPtr astReg; + int i; + + pAST = ASTPTR(pScrn); + vgaReg = &VGAHWPTR(pScrn)->SavedReg; + astReg = &pAST->SavedReg; + + /* do save */ + vgaHWSave(pScrn, vgaReg, VGA_SR_ALL); + + /* Ext. Save */ + vASTOpenKey(pScrn); + + for (i=0; i<0x50; i++) + GetIndexReg(CRTC_PORT, (UCHAR) (i+0x80), astReg->ExtCRTC[i]); + +} + +static void +ASTRestore(ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST; + vgaRegPtr vgaReg; + ASTRegPtr astReg; + int i; + + pAST = ASTPTR(pScrn); + vgaReg = &VGAHWPTR(pScrn)->SavedReg; + astReg = &pAST->SavedReg; + + /* do restore */ + vgaHWProtect(pScrn, TRUE); + vgaHWRestore(pScrn, vgaReg, VGA_SR_ALL); + vgaHWProtect(pScrn, FALSE); + + /* Ext. restore */ + vASTOpenKey(pScrn); + + for (i=0; i<0x50; i++) + SetIndexReg(CRTC_PORT, (UCHAR) (i+0x80), astReg->ExtCRTC[i]); + +} + +static void +ASTProbeDDC(ScrnInfoPtr pScrn, int index) +{ + vbeInfoPtr pVbe; + ModuleDescPtr pMod; + + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); + pVbe = VBEInit(NULL, index); + ConfiguredMonitor = vbeDoEDID(pVbe, NULL); + vbeFree(pVbe); + xf86UnloadSubModule(pMod); + } +} + +static xf86MonPtr +ASTDoDDC(ScrnInfoPtr pScrn, int index) +{ + vbeInfoPtr pVbe; + xf86MonPtr MonInfo = NULL; + ASTRecPtr pAST = ASTPTR(pScrn); + ModuleDescPtr pMod, pDDCMod; + + /* Honour Option "noDDC" */ + if (xf86ReturnOptValBool(pAST->Options, OPTION_NO_DDC, FALSE)) { + return MonInfo; + } + + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); + if ((pVbe = VBEInit(NULL, index))) { + if ((pDDCMod = xf86LoadSubModule(pScrn, "ddc"))) { + xf86LoaderModReqSymLists(pDDCMod, ddcSymbols, NULL); + MonInfo = vbeDoEDID(pVbe, pDDCMod); + xf86PrintEDID(MonInfo); + xf86SetDDCproperties(pScrn, MonInfo); + xf86UnloadSubModule(pDDCMod); + } + vbeFree(pVbe); + } + xf86UnloadSubModule(pMod); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "this driver cannot do DDC without VBE\n"); + } + + return MonInfo; +} + +static void +vFillASTModeInfo (ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST; + + pAST = ASTPTR(pScrn); + + pAST->VideoModeInfo.ScreenWidth = pScrn->virtualX; + pAST->VideoModeInfo.ScreenHeight = pScrn->virtualY; + pAST->VideoModeInfo.bitsPerPixel = pScrn->bitsPerPixel; + pAST->VideoModeInfo.ScreenPitch = pScrn->virtualX * ((pScrn->bitsPerPixel + 1) / 8) ; + +} + +static Bool +ASTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) +{ + vgaHWPtr hwp; + ASTRecPtr pAST; + + hwp = VGAHWPTR(pScrn); + pAST = ASTPTR(pScrn); + + vgaHWUnlock(hwp); + + if (!vgaHWInit(pScrn, mode)) + return FALSE; + + pScrn->vtSema = TRUE; + pAST->ModePtr = mode; + + if (!ASTSetMode(pScrn, mode)) + return FALSE; + + vgaHWProtect(pScrn, FALSE); + + return TRUE; +} Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_mode.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_mode.c:1.1 --- /dev/null Tue May 9 21:56:44 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_mode.c Thu Apr 13 20:50:38 2006 @@ -0,0 +1,675 @@ +/* + * Copyright (c) 2005 ASPEED Technology Inc. + * + * 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 the authors not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The authors makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHORS 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_mode.c,v 1.1 2006/04/14 00:50:38 dawes Exp $ */ + +#include "xf86.h" +#include "xf86_ansic.h" +#include "compiler.h" + +/* Driver specific headers */ +#include "ast.h" + +/* Prototype type declaration */ +static Bool bSetDACReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAModeInfo); +static void vSetCRTCReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAModeInfo); +static void vSetDCLKReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAModeInfo); +static void vSetOffsetReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAModeInfo); +static void vSetExtReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAModeInfo); +static void vSetStdReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAModeInfo); + +static VBIOS_STDTABLE_STRUCT StdTable[] = { + /* MD_2_3_400 */ + { + 0x67, + {0x00,0x03,0x00,0x02}, + {0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f, + 0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00, + 0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3, + 0xff}, + {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07, + 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f, + 0x0c,0x00,0x0f,0x08}, + {0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00, + 0xff} + }, + /* Mode12/ExtEGATable */ + { + 0xe3, + {0x01,0x0f,0x00,0x06}, + {0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0xe9,0x8b,0xdf,0x28,0x00,0xe7,0x04,0xe3, + 0xff}, + {0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07, + 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f, + 0x01,0x00,0x0f,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f, + 0xff} + }, + /* ExtVGATable */ + { + 0x2f, + {0x01,0x0f,0x00,0x0e}, + {0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0xea,0x8c,0xdf,0x28,0x40,0xe7,0x04,0xa3, + 0xff}, + {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, + 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f, + 0x01,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f, + 0xff} + }, + /* ExtHiCTable */ + { + 0x2f, + {0x01,0x0f,0x00,0x0e}, + {0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0xea,0x8c,0xdf,0x28,0x40,0xe7,0x04,0xa3, + 0xff}, + {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, + 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f, + 0x01,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f, + 0xff} + }, + /* ExtTrueCTable */ + { + 0x2f, + {0x01,0x0f,0x00,0x0e}, + {0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0xea,0x8c,0xdf,0x28,0x40,0xe7,0x04,0xa3, + 0xff}, + {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, + 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f, + 0x01,0x00,0x00,0x00}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f, + 0xff} + }, +}; + +static VBIOS_ENHTABLE_STRUCT Res640x480Table[] = { + { 800, 640, 8, 96, 525, 480, 2, 2, VCLK28_322, /* 60Hz */ + (SyncNN | HBorder | VBorder | Charx8Dot), 60, 1, 0x2E }, + { 832, 640, 16, 40, 520, 480, 1, 3, VCLK31_5, /* 72Hz */ + (SyncNN | HBorder | VBorder | Charx8Dot), 72, 2, 0x2E }, + { 840, 640, 16, 64, 500, 480, 1, 3, VCLK31_5, /* 75Hz */ + (SyncNN | Charx8Dot) , 75, 3, 0x2E }, + { 832, 640, 56, 56, 509, 480, 1, 3, VCLK36, /* 85Hz */ + (SyncNN | Charx8Dot) , 85, 4, 0x2E }, + { 832, 640, 56, 56, 509, 480, 1, 3, VCLK36, /* end */ + (SyncNN | Charx8Dot) , 0xFF, 4, 0x2E }, +}; + + +static VBIOS_ENHTABLE_STRUCT Res800x600Table[] = { + {1024, 800, 24, 72, 625, 600, 1, 2, VCLK36, /* 56Hz */ + (SyncPP | Charx8Dot), 56, 1, 0x30 }, + {1056, 800, 40, 128, 628, 600, 1, 4, VCLK40, /* 60Hz */ + (SyncPP | Charx8Dot), 60, 2, 0x30 }, + {1040, 800, 56, 120, 666, 600, 37, 6, VCLK50, /* 72Hz */ + (SyncPP | Charx8Dot), 72, 3, 0x30 }, + {1056, 800, 16, 80, 625, 600, 1, 3, VCLK49_5, /* 75Hz */ + (SyncPP | Charx8Dot), 75, 4, 0x30 }, + {1048, 800, 32, 64, 631, 600, 1, 3, VCLK56_25, /* 85Hz */ + (SyncPP | Charx8Dot), 85, 5, 0x30 }, + {1048, 800, 32, 64, 631, 600, 1, 3, VCLK56_25, /* end */ + (SyncPP | Charx8Dot), 0xFF, 5, 0x30 }, +}; + + +static VBIOS_ENHTABLE_STRUCT Res1024x768Table[] = { + {1344, 1024, 24, 136, 806, 768, 3, 6, VCLK65, /* 60Hz */ + (SyncNN | Charx8Dot), 60, 1, 0x31 }, + {1328, 1024, 24, 136, 806, 768, 3, 6, VCLK75, /* 70Hz */ + (SyncNN | Charx8Dot), 70, 2, 0x31 }, + {1312, 1024, 16, 96, 800, 768, 1, 3, VCLK78_75, /* 75Hz */ + (SyncPP | Charx8Dot), 75, 3, 0x31 }, + {1376, 1024, 48, 96, 808, 768, 1, 3, VCLK94_5, /* 85Hz */ + (SyncPP | Charx8Dot), 85, 4, 0x31 }, + {1376, 1024, 48, 96, 808, 768, 1, 3, VCLK94_5, /* end */ + (SyncPP | Charx8Dot), 0xFF, 4, 0x31 }, +}; + +static VBIOS_ENHTABLE_STRUCT Res1280x1024Table[] = { + {1688, 1280, 48, 112, 1066, 1024, 1, 3, VCLK108, /* 60Hz */ + (SyncPP | Charx8Dot), 60, 1, 0x32 }, + {1688, 1280, 16, 144, 1066, 1024, 1, 3, VCLK135, /* 75Hz */ + (SyncPP | Charx8Dot), 75, 2, 0x32 }, + {1728, 1280, 64, 160, 1072, 1024, 1, 3, VCLK157_5, /* 85Hz */ + (SyncPP | Charx8Dot), 85, 3, 0x32 }, + {1728, 1280, 64, 160, 1072, 1024, 1, 3, VCLK157_5, /* end */ + (SyncPP | Charx8Dot), 0xFF, 3, 0x32 }, +}; + +static VBIOS_ENHTABLE_STRUCT Res1600x1200Table[] = { + {2160, 1600, 64, 192, 1250, 1200, 1, 3, VCLK162, /* 60Hz */ + (SyncPP | Charx8Dot), 60, 1, 0x33 }, + {2160, 1600, 64, 192, 1250, 1200, 1, 3, VCLK162, /* end */ + (SyncPP | Charx8Dot), 60, 1, 0x33 }, +}; + +static VBIOS_DCLK_INFO DCLKTable [] = { + {0x2C, 0xE7, 0x03}, /* 00: VCLK25_175 */ + {0x95, 0x62, 0x03}, /* 01: VCLK28_322 */ + {0x67, 0x63, 0x01}, /* 02: VCLK31_5 */ + {0x76, 0x63, 0x01}, /* 03: VCLK36 */ + {0xEE, 0x67, 0x01}, /* 04: VCLK40 */ + {0x82, 0x62, 0x01}, /* 05: VCLK49_5 */ + {0xC6, 0x64, 0x01}, /* 06: VCLK50 */ + {0x94, 0x62, 0x01}, /* 07: VCLK56_25 */ + {0x80, 0x64, 0x00}, /* 08: VCLK65 */ + {0x7B, 0x63, 0x00}, /* 09: VCLK75 */ + {0x67, 0x62, 0x00}, /* 0A: VCLK78_75 */ + {0x7C, 0x62, 0x00}, /* 0B: VCLK94_5 */ + {0x8E, 0x62, 0x00}, /* 0C: VCLK108 */ + {0x85, 0x24, 0x00}, /* 0D: VCLK135 */ + {0x67, 0x22, 0x00}, /* 0E: VCLK157_5 */ + {0x6A, 0x22, 0x00}, /* 0F: VCLK162 */ +}; + +#if 0 +static VBIOS_DAC_INFO DAC_TEXT[] = { + { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x2a }, { 0x00, 0x2a, 0x00 }, { 0x00, 0x2a, 0x2a }, + { 0x2a, 0x00, 0x00 }, { 0x2a, 0x00, 0x2a }, { 0x2a, 0x2a, 0x00 }, { 0x2a, 0x2a, 0x2a }, + { 0x00, 0x00, 0x15 }, { 0x00, 0x00, 0x3f }, { 0x00, 0x2a, 0x15 }, { 0x00, 0x2a, 0x3f }, + { 0x2a, 0x00, 0x15 }, { 0x2a, 0x00, 0x3f }, { 0x2a, 0x2a, 0x15 }, { 0x2a, 0x2a, 0x3f }, + { 0x00, 0x15, 0x00 }, { 0x00, 0x15, 0x2a }, { 0x00, 0x3f, 0x00 }, { 0x00, 0x3f, 0x2a }, + { 0x2a, 0x15, 0x00 }, { 0x2a, 0x15, 0x2a }, { 0x2a, 0x3f, 0x00 }, { 0x2a, 0x3f, 0x2a }, + { 0x00, 0x15, 0x15 }, { 0x00, 0x15, 0x3f }, { 0x00, 0x3f, 0x15 }, { 0x00, 0x3f, 0x3f }, + { 0x2a, 0x15, 0x15 }, { 0x2a, 0x15, 0x3f }, { 0x2a, 0x3f, 0x15 }, { 0x2a, 0x3f, 0x3f }, + { 0x15, 0x00, 0x00 }, { 0x15, 0x00, 0x2a }, { 0x15, 0x2a, 0x00 }, { 0x15, 0x2a, 0x2a }, + { 0x3f, 0x00, 0x00 }, { 0x3f, 0x00, 0x2a }, { 0x3f, 0x2a, 0x00 }, { 0x3f, 0x2a, 0x2a }, + { 0x15, 0x00, 0x15 }, { 0x15, 0x00, 0x3f }, { 0x15, 0x2a, 0x15 }, { 0x15, 0x2a, 0x3f }, + { 0x3f, 0x00, 0x15 }, { 0x3f, 0x00, 0x3f }, { 0x3f, 0x2a, 0x15 }, { 0x3f, 0x2a, 0x3f }, + { 0x15, 0x15, 0x00 }, { 0x15, 0x15, 0x2a }, { 0x15, 0x3f, 0x00 }, { 0x15, 0x3f, 0x2a }, + { 0x3f, 0x15, 0x00 }, { 0x3f, 0x15, 0x2a }, { 0x3f, 0x3f, 0x00 }, { 0x3f, 0x3f, 0x2a }, + { 0x15, 0x15, 0x15 }, { 0x15, 0x15, 0x3f }, { 0x15, 0x3f, 0x15 }, { 0x15, 0x3f, 0x3f }, + { 0x3f, 0x15, 0x15 }, { 0x3f, 0x15, 0x3f }, { 0x3f, 0x3f, 0x15 }, { 0x3f, 0x3f, 0x3f }, +}; + +static VBIOS_DAC_INFO DAC_EGA[] = { + { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x2a }, { 0x00, 0x2a, 0x00 }, { 0x00, 0x2a, 0x2a }, + { 0x2a, 0x00, 0x00 }, { 0x2a, 0x00, 0x2a }, { 0x2a, 0x2a, 0x00 }, { 0x2a, 0x2a, 0x2a }, + { 0x00, 0x00, 0x15 }, { 0x00, 0x00, 0x3f }, { 0x00, 0x2a, 0x15 }, { 0x00, 0x2a, 0x3f }, + { 0x2a, 0x00, 0x15 }, { 0x2a, 0x00, 0x3f }, { 0x2a, 0x2a, 0x15 }, { 0x2a, 0x2a, 0x3f }, + { 0x00, 0x15, 0x00 }, { 0x00, 0x15, 0x2a }, { 0x00, 0x3f, 0x00 }, { 0x00, 0x3f, 0x2a }, + { 0x2a, 0x15, 0x00 }, { 0x2a, 0x15, 0x2a }, { 0x2a, 0x3f, 0x00 }, { 0x2a, 0x3f, 0x2a }, + { 0x00, 0x15, 0x15 }, { 0x00, 0x15, 0x3f }, { 0x00, 0x3f, 0x15 }, { 0x00, 0x3f, 0x3f }, + { 0x2a, 0x15, 0x15 }, { 0x2a, 0x15, 0x3f }, { 0x2a, 0x3f, 0x15 }, { 0x2a, 0x3f, 0x3f }, + { 0x15, 0x00, 0x00 }, { 0x15, 0x00, 0x2a }, { 0x15, 0x2a, 0x00 }, { 0x15, 0x2a, 0x2a }, + { 0x3f, 0x00, 0x00 }, { 0x3f, 0x00, 0x2a }, { 0x3f, 0x2a, 0x00 }, { 0x3f, 0x2a, 0x2a }, + { 0x15, 0x00, 0x15 }, { 0x15, 0x00, 0x3f }, { 0x15, 0x2a, 0x15 }, { 0x15, 0x2a, 0x3f }, + { 0x3f, 0x00, 0x15 }, { 0x3f, 0x00, 0x3f }, { 0x3f, 0x2a, 0x15 }, { 0x3f, 0x2a, 0x3f }, + { 0x15, 0x15, 0x00 }, { 0x15, 0x15, 0x2a }, { 0x15, 0x3f, 0x00 }, { 0x15, 0x3f, 0x2a }, + { 0x3f, 0x15, 0x00 }, { 0x3f, 0x15, 0x2a }, { 0x3f, 0x3f, 0x00 }, { 0x3f, 0x3f, 0x2a }, + { 0x15, 0x15, 0x15 }, { 0x15, 0x15, 0x3f }, { 0x15, 0x3f, 0x15 }, { 0x15, 0x3f, 0x3f }, + { 0x3f, 0x15, 0x15 }, { 0x3f, 0x15, 0x3f }, { 0x3f, 0x3f, 0x15 }, { 0x3f, 0x3f, 0x3f }, +}; +#endif + +static VBIOS_DAC_INFO DAC_VGA[] = { + { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x2a }, { 0x00, 0x2a, 0x00 }, { 0x00, 0x2a, 0x2a }, + { 0x2a, 0x00, 0x00 }, { 0x2a, 0x00, 0x2a }, { 0x2a, 0x15, 0x00 }, { 0x2a, 0x2a, 0x2a }, + { 0x15, 0x15, 0x15 }, { 0x15, 0x15, 0x3f }, { 0x15, 0x3f, 0x15 }, { 0x15, 0x3f, 0x3f }, + { 0x3f, 0x15, 0x15 }, { 0x3f, 0x15, 0x3f }, { 0x3f, 0x3f, 0x15 }, { 0x3f, 0x3f, 0x3f }, + { 0x00, 0x00, 0x00 }, { 0x05, 0x05, 0x05 }, { 0x08, 0x08, 0x08 }, { 0x0b, 0x0b, 0x0b }, + { 0x0e, 0x0e, 0x0e }, { 0x11, 0x11, 0x11 }, { 0x14, 0x14, 0x14 }, { 0x18, 0x18, 0x18 }, + { 0x1c, 0x1c, 0x1c }, { 0x20, 0x20, 0x20 }, { 0x24, 0x24, 0x24 }, { 0x28, 0x28, 0x28 }, + { 0x2d, 0x2d, 0x2d }, { 0x32, 0x32, 0x32 }, { 0x38, 0x38, 0x38 }, { 0x3f, 0x3f, 0x3f }, + { 0x00, 0x00, 0x3f }, { 0x10, 0x00, 0x3f }, { 0x1f, 0x00, 0x3f }, { 0x2f, 0x00, 0x3f }, + { 0x3f, 0x00, 0x3f }, { 0x3f, 0x00, 0x2f }, { 0x3f, 0x00, 0x1f }, { 0x3f, 0x00, 0x10 }, + { 0x3f, 0x00, 0x00 }, { 0x3f, 0x10, 0x00 }, { 0x3f, 0x1f, 0x00 }, { 0x3f, 0x2f, 0x00 }, + { 0x3f, 0x3f, 0x00 }, { 0x2f, 0x3f, 0x00 }, { 0x1f, 0x3f, 0x00 }, { 0x10, 0x3f, 0x00 }, + { 0x00, 0x3f, 0x00 }, { 0x00, 0x3f, 0x10 }, { 0x00, 0x3f, 0x1f }, { 0x00, 0x3f, 0x2f }, + { 0x00, 0x3f, 0x3f }, { 0x00, 0x2f, 0x3f }, { 0x00, 0x1f, 0x3f }, { 0x00, 0x10, 0x3f }, + { 0x1f, 0x1f, 0x3f }, { 0x27, 0x1f, 0x3f }, { 0x2f, 0x1f, 0x3f }, { 0x37, 0x1f, 0x3f }, + { 0x3f, 0x1f, 0x3f }, { 0x3f, 0x1f, 0x37 }, { 0x3f, 0x1f, 0x2f }, { 0x3f, 0x1f, 0x27 }, + { 0x3f, 0x1f, 0x1f }, { 0x3f, 0x27, 0x1f }, { 0x3f, 0x2f, 0x1f }, { 0x3f, 0x37, 0x1f }, + { 0x3f, 0x3f, 0x1f }, { 0x37, 0x3f, 0x1f }, { 0x2f, 0x3f, 0x1f }, { 0x27, 0x3f, 0x1f }, + { 0x1f, 0x3f, 0x1f }, { 0x1f, 0x3f, 0x27 }, { 0x1f, 0x3f, 0x2f }, { 0x1f, 0x3f, 0x37 }, + { 0x1f, 0x3f, 0x3f }, { 0x1f, 0x37, 0x3f }, { 0x1f, 0x2f, 0x3f }, { 0x1f, 0x27, 0x3f }, + { 0x2d, 0x2d, 0x3f }, { 0x31, 0x2d, 0x3f }, { 0x36, 0x2d, 0x3f }, { 0x3a, 0x2d, 0x3f }, + { 0x3f, 0x2d, 0x3f }, { 0x3f, 0x2d, 0x3a }, { 0x3f, 0x2d, 0x36 }, { 0x3f, 0x2d, 0x31 }, + { 0x3f, 0x2d, 0x2d }, { 0x3f, 0x31, 0x2d }, { 0x3f, 0x36, 0x2d }, { 0x3f, 0x3a, 0x2d }, + { 0x3f, 0x3f, 0x2d }, { 0x3a, 0x3f, 0x2d }, { 0x36, 0x3f, 0x2d }, { 0x31, 0x3f, 0x2d }, + { 0x2d, 0x3f, 0x2d }, { 0x2d, 0x3f, 0x31 }, { 0x2d, 0x3f, 0x36 }, { 0x2d, 0x3f, 0x3a }, + { 0x2d, 0x3f, 0x3f }, { 0x2d, 0x3a, 0x3f }, { 0x2d, 0x36, 0x3f }, { 0x2d, 0x31, 0x3f }, + { 0x00, 0x00, 0x1c }, { 0x07, 0x00, 0x1c }, { 0x0e, 0x00, 0x1c }, { 0x15, 0x00, 0x1c }, + { 0x1c, 0x00, 0x1c }, { 0x1c, 0x00, 0x15 }, { 0x1c, 0x00, 0x0e }, { 0x1c, 0x00, 0x07 }, + { 0x1c, 0x00, 0x00 }, { 0x1c, 0x07, 0x00 }, { 0x1c, 0x0e, 0x00 }, { 0x1c, 0x15, 0x00 }, + { 0x1c, 0x1c, 0x00 }, { 0x15, 0x1c, 0x00 }, { 0x0e, 0x1c, 0x00 }, { 0x07, 0x1c, 0x00 }, + { 0x00, 0x1c, 0x00 }, { 0x00, 0x1c, 0x07 }, { 0x00, 0x1c, 0x0e }, { 0x00, 0x1c, 0x15 }, + { 0x00, 0x1c, 0x1c }, { 0x00, 0x15, 0x1c }, { 0x00, 0x0e, 0x1c }, { 0x00, 0x07, 0x1c }, + { 0x0e, 0x0e, 0x1c }, { 0x11, 0x0e, 0x1c }, { 0x15, 0x0e, 0x1c }, { 0x18, 0x0e, 0x1c }, + { 0x1c, 0x0e, 0x1c }, { 0x1c, 0x0e, 0x18 }, { 0x1c, 0x0e, 0x15 }, { 0x1c, 0x0e, 0x11 }, + { 0x1c, 0x0e, 0x0e }, { 0x1c, 0x11, 0x0e }, { 0x1c, 0x15, 0x0e }, { 0x1c, 0x18, 0x0e }, + { 0x1c, 0x1c, 0x0e }, { 0x18, 0x1c, 0x0e }, { 0x15, 0x1c, 0x0e }, { 0x11, 0x1c, 0x0e }, + { 0x0e, 0x1c, 0x0e }, { 0x0e, 0x1c, 0x11 }, { 0x0e, 0x1c, 0x15 }, { 0x0e, 0x1c, 0x18 }, + { 0x0e, 0x1c, 0x1c }, { 0x0e, 0x18, 0x1c }, { 0x0e, 0x15, 0x1c }, { 0x0e, 0x11, 0x1c }, + { 0x14, 0x14, 0x1c }, { 0x16, 0x14, 0x1c }, { 0x18, 0x14, 0x1c }, { 0x1a, 0x14, 0x1c }, + { 0x1c, 0x14, 0x1c }, { 0x1c, 0x14, 0x1a }, { 0x1c, 0x14, 0x18 }, { 0x1c, 0x14, 0x16 }, + { 0x1c, 0x14, 0x14 }, { 0x1c, 0x16, 0x14 }, { 0x1c, 0x18, 0x14 }, { 0x1c, 0x1a, 0x14 }, + { 0x1c, 0x1c, 0x14 }, { 0x1a, 0x1c, 0x14 }, { 0x18, 0x1c, 0x14 }, { 0x16, 0x1c, 0x14 }, + { 0x14, 0x1c, 0x14 }, { 0x14, 0x1c, 0x16 }, { 0x14, 0x1c, 0x18 }, { 0x14, 0x1c, 0x1a }, + { 0x14, 0x1c, 0x1c }, { 0x14, 0x1a, 0x1c }, { 0x14, 0x18, 0x1c }, { 0x14, 0x16, 0x1c }, + { 0x00, 0x00, 0x10 }, { 0x04, 0x00, 0x10 }, { 0x08, 0x00, 0x10 }, { 0x0c, 0x00, 0x10 }, + { 0x10, 0x00, 0x10 }, { 0x10, 0x00, 0x0c }, { 0x10, 0x00, 0x08 }, { 0x10, 0x00, 0x04 }, + { 0x10, 0x00, 0x00 }, { 0x10, 0x04, 0x00 }, { 0x10, 0x08, 0x00 }, { 0x10, 0x0c, 0x00 }, + { 0x10, 0x10, 0x00 }, { 0x0c, 0x10, 0x00 }, { 0x08, 0x10, 0x00 }, { 0x04, 0x10, 0x00 }, + { 0x00, 0x10, 0x00 }, { 0x00, 0x10, 0x04 }, { 0x00, 0x10, 0x08 }, { 0x00, 0x10, 0x0c }, + { 0x00, 0x10, 0x10 }, { 0x00, 0x0c, 0x10 }, { 0x00, 0x08, 0x10 }, { 0x00, 0x04, 0x10 }, + { 0x08, 0x08, 0x10 }, { 0x0a, 0x08, 0x10 }, { 0x0c, 0x08, 0x10 }, { 0x0e, 0x08, 0x10 }, + { 0x10, 0x08, 0x10 }, { 0x10, 0x08, 0x0e }, { 0x10, 0x08, 0x0c }, { 0x10, 0x08, 0x0a }, + { 0x10, 0x08, 0x08 }, { 0x10, 0x0a, 0x08 }, { 0x10, 0x0c, 0x08 }, { 0x10, 0x0e, 0x08 }, + { 0x10, 0x10, 0x08 }, { 0x0e, 0x10, 0x08 }, { 0x0c, 0x10, 0x08 }, { 0x0a, 0x10, 0x08 }, + { 0x08, 0x10, 0x08 }, { 0x08, 0x10, 0x0a }, { 0x08, 0x10, 0x0c }, { 0x08, 0x10, 0x0e }, + { 0x08, 0x10, 0x10 }, { 0x08, 0x0e, 0x10 }, { 0x08, 0x0c, 0x10 }, { 0x08, 0x0a, 0x10 }, + { 0x0b, 0x0b, 0x10 }, { 0x0c, 0x0b, 0x10 }, { 0x0d, 0x0b, 0x10 }, { 0x0f, 0x0b, 0x10 }, + { 0x10, 0x0b, 0x10 }, { 0x10, 0x0b, 0x0f }, { 0x10, 0x0b, 0x0d }, { 0x10, 0x0b, 0x0c }, + { 0x10, 0x0b, 0x0b }, { 0x10, 0x0c, 0x0b }, { 0x10, 0x0d, 0x0b }, { 0x10, 0x0f, 0x0b }, + { 0x10, 0x10, 0x0b }, { 0x0f, 0x10, 0x0b }, { 0x0d, 0x10, 0x0b }, { 0x0c, 0x10, 0x0b }, + { 0x0b, 0x10, 0x0b }, { 0x0b, 0x10, 0x0c }, { 0x0b, 0x10, 0x0d }, { 0x0b, 0x10, 0x0f }, + { 0x0b, 0x10, 0x10 }, { 0x0b, 0x0f, 0x10 }, { 0x0b, 0x0d, 0x10 }, { 0x0b, 0x0c, 0x10 }, + { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, +}; + +Bool +ASTSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) +{ + ASTRecPtr pAST; + VBIOS_MODE_INFO vgamodeinfo; + + pAST = ASTPTR(pScrn); + + vASTOpenKey(pScrn); + bASTRegInit(pScrn); + + /* pre set mode */ + bGetAST1000VGAModeInfo(pScrn, mode, &vgamodeinfo); + + /* set mode */ + vSetStdReg(pScrn, mode, &vgamodeinfo); + vSetCRTCReg(pScrn, mode, &vgamodeinfo); + vSetOffsetReg(pScrn, mode, &vgamodeinfo); + vSetDCLKReg(pScrn, mode, &vgamodeinfo); + vSetExtReg(pScrn, mode, &vgamodeinfo); + bSetDACReg(pScrn, mode, &vgamodeinfo); + + /* post set mode */ +#ifdef Accel_2D + if (!pAST->noAccel) { + if (!bASTEnable2D(pScrn, pAST)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"Enable 2D failed\n"); + pAST->noAccel = TRUE; + } + } +#endif +#ifdef HWC + if (!pAST->noHWC) { + if (!bASTInitHWC(pScrn, pAST)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"Init HWC failed\n"); + pAST->noHWC = TRUE; + } + } +#endif + vAST1000DisplayOn(pAST); + + return (TRUE); +} + + +Bool bGetAST1000VGAModeInfo(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAModeInfo) +{ + ASTRecPtr pAST; + ULONG ulModeID, ulColorIndex, ulRefreshRate, ulRefreshRateIndex = 0; + ULONG ulHBorder, ulVBorder; + + pAST = ASTPTR(pScrn); + + switch (pScrn->bitsPerPixel) + { + case 8: + pVGAModeInfo->pStdTableEntry = (PVBIOS_STDTABLE_STRUCT) &StdTable[VGAModeIndex]; + ulColorIndex = VGAModeIndex-1; + break; + case 16: + pVGAModeInfo->pStdTableEntry = (PVBIOS_STDTABLE_STRUCT) &StdTable[HiCModeIndex]; + ulColorIndex = HiCModeIndex-1; + break; + case 24: + case 32: + pVGAModeInfo->pStdTableEntry = (PVBIOS_STDTABLE_STRUCT) &StdTable[TrueCModeIndex]; + ulColorIndex = TrueCModeIndex-1; + break; + default: + return (FALSE); + } + + switch (mode->CrtcHDisplay) + { + case 640: + pVGAModeInfo->pEnhTableEntry = (PVBIOS_ENHTABLE_STRUCT) &Res640x480Table[ulRefreshRateIndex]; + break; + case 800: + pVGAModeInfo->pEnhTableEntry = (PVBIOS_ENHTABLE_STRUCT) &Res800x600Table[ulRefreshRateIndex]; + break; + case 1024: + pVGAModeInfo->pEnhTableEntry = (PVBIOS_ENHTABLE_STRUCT) &Res1024x768Table[ulRefreshRateIndex]; + break; + case 1280: + pVGAModeInfo->pEnhTableEntry = (PVBIOS_ENHTABLE_STRUCT) &Res1280x1024Table[ulRefreshRateIndex]; + break; + case 1600: + pVGAModeInfo->pEnhTableEntry = (PVBIOS_ENHTABLE_STRUCT) &Res1600x1200Table[ulRefreshRateIndex]; + break; + default: + return (FALSE); + } + + /* Get Proper Mode Index */ + ulRefreshRate = (mode->Clock * 1000) / (mode->HTotal * mode->VTotal); + + while (pVGAModeInfo->pEnhTableEntry->ulRefreshRate < ulRefreshRate) + { + pVGAModeInfo->pEnhTableEntry++; + if ((pVGAModeInfo->pEnhTableEntry->ulRefreshRate > ulRefreshRate) || + (pVGAModeInfo->pEnhTableEntry->ulRefreshRate == 0xFF)) + { + pVGAModeInfo->pEnhTableEntry--; + break; + } + } + + /* Update mode CRTC info */ + ulHBorder = (pVGAModeInfo->pEnhTableEntry->Flags & HBorder) ? 1:0; + ulVBorder = (pVGAModeInfo->pEnhTableEntry->Flags & VBorder) ? 1:0; + + mode->CrtcHTotal = (int) pVGAModeInfo->pEnhTableEntry->HT; + mode->CrtcHBlankStart = (int) (pVGAModeInfo->pEnhTableEntry->HDE + ulHBorder); + mode->CrtcHBlankEnd = (int) (pVGAModeInfo->pEnhTableEntry->HT - ulHBorder); + mode->CrtcHSyncStart = (int) (pVGAModeInfo->pEnhTableEntry->HDE + ulHBorder + + pVGAModeInfo->pEnhTableEntry->HFP); + mode->CrtcHSyncEnd = (int) (pVGAModeInfo->pEnhTableEntry->HDE + ulHBorder + + pVGAModeInfo->pEnhTableEntry->HFP + + pVGAModeInfo->pEnhTableEntry->HSYNC); + + mode->CrtcVTotal = (int) pVGAModeInfo->pEnhTableEntry->VT; + mode->CrtcVBlankStart = (int) (pVGAModeInfo->pEnhTableEntry->VDE + ulVBorder); + mode->CrtcVBlankEnd = (int) (pVGAModeInfo->pEnhTableEntry->VT - ulVBorder); + mode->CrtcVSyncStart = (int) (pVGAModeInfo->pEnhTableEntry->VDE + ulVBorder + + pVGAModeInfo->pEnhTableEntry->VFP); + mode->CrtcVSyncEnd = (int) (pVGAModeInfo->pEnhTableEntry->VDE + ulVBorder + + pVGAModeInfo->pEnhTableEntry->VFP + + pVGAModeInfo->pEnhTableEntry->VSYNC); + + /* Write mode info to scratch */ + ulRefreshRateIndex = pVGAModeInfo->pEnhTableEntry->ulRefreshRateIndex; + ulModeID = pVGAModeInfo->pEnhTableEntry->ulModeID; + + SetIndexReg(CRTC_PORT, 0x8C, (UCHAR) ((ulColorIndex & 0x0F) << 4)); + SetIndexReg(CRTC_PORT, 0x8D, (UCHAR) (ulRefreshRateIndex & 0xFF)); + SetIndexReg(CRTC_PORT, 0x8E, (UCHAR) (ulModeID & 0xFF)); + + return (TRUE); +} + +static void vSetStdReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAModeInfo) +{ + + PVBIOS_STDTABLE_STRUCT pStdModePtr; + ASTRecPtr pAST; + ULONG i; + UCHAR jReg; + + pStdModePtr = pVGAModeInfo->pStdTableEntry; + pAST = ASTPTR(pScrn); + + /* Set Misc */ + jReg = pStdModePtr->MISC; + SetReg(MISC_PORT_WRITE,jReg); + + /* Set Seq */ + SetIndexReg(SEQ_PORT,0x00, 0x03); + for (i=0; i<4; i++) + { + jReg = pStdModePtr->SEQ[i]; + if (!i) (jReg |= 0x20); /* display off */ + SetIndexReg(SEQ_PORT,(UCHAR) (i+1), jReg); + } + + /* Set CRTC */ + SetIndexRegMask(CRTC_PORT,0x11, 0x7F, 0x00); + for (i=0; i<25; i++) + { + jReg = pStdModePtr->CRTC[i]; + SetIndexReg(CRTC_PORT,(UCHAR) i, jReg); + } + + /* Set AR */ + jReg = GetReg(INPUT_STATUS1_READ); + for (i=0; i<20; i++) + { + jReg = pStdModePtr->AR[i]; + SetReg(AR_PORT_WRITE, (UCHAR) i); + SetReg(AR_PORT_WRITE, jReg); + } + SetReg(AR_PORT_WRITE, 0x14); + SetReg(AR_PORT_WRITE, 0x00); + + jReg = GetReg(INPUT_STATUS1_READ); + SetReg (AR_PORT_WRITE, 0x20); /* set POS */ + + /* Set GR */ + for (i=0; i<9; i++) + { + SetIndexReg(GR_PORT,(UCHAR) i, jReg); + + } + + +} + +static void +vSetCRTCReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAModeInfo) +{ + ASTRecPtr pAST; + USHORT usTemp; + UCHAR jReg05, jReg07, jReg09, jRegAC, jRegAD, jRegAE; + + pAST = ASTPTR(pScrn); + jReg05 = jReg07 = jReg09 = jRegAC = jRegAD = jRegAE = 0; + + /* unlock CRTC */ + SetIndexRegMask(CRTC_PORT,0x11, 0x7F, 0x00); + + /* Horizontal Timing Programming */ + usTemp = (mode->CrtcHTotal >> 3) - 5; + if (usTemp & 0x100) jRegAC |= 0x01; /* HT D[8] */ + SetIndexRegMask(CRTC_PORT,0x00, 0x00, (UCHAR) usTemp); + usTemp = (mode->CrtcHDisplay >> 3) - 1; + if (usTemp & 0x100) jRegAC |= 0x04; /* HDE D[8] */ + SetIndexRegMask(CRTC_PORT,0x01, 0x00, (UCHAR) usTemp); + usTemp = (mode->CrtcHBlankStart >> 3) - 1; + if (usTemp & 0x100) jRegAC |= 0x10; /* HBS D[8] */ + SetIndexRegMask(CRTC_PORT,0x02, 0x00, (UCHAR) usTemp); + usTemp = ((mode->CrtcHBlankEnd >> 3) - 1) & 0x7F; + if (usTemp & 0x20) jReg05 |= 0x80; /* HBE D[5] */ + if (usTemp & 0x40) jRegAD |= 0x01; /* HBE D[6] */ + SetIndexRegMask(CRTC_PORT,0x03, 0xE0, (UCHAR) (usTemp & 0x1F)); + usTemp = (mode->CrtcHSyncStart >> 3 ); + if (usTemp & 0x100) jRegAC |= 0x40; /* HRS D[5] */ + SetIndexRegMask(CRTC_PORT,0x04, 0x00, (UCHAR) (usTemp)); + usTemp = (mode->CrtcHSyncEnd >> 3 ) & 0x3F; + if (usTemp & 0x20) jRegAD |= 0x04; /* HRE D[5] */ + SetIndexRegMask(CRTC_PORT,0x05, 0x60, (UCHAR) ((usTemp & 0x1F) | jReg05)); + + SetIndexRegMask(CRTC_PORT,0xAC, 0x00, (UCHAR) jRegAC); + SetIndexRegMask(CRTC_PORT,0xAD, 0x00, (UCHAR) jRegAD); + + /* Vetical Timing Programming */ + usTemp = (mode->CrtcVTotal) - 2; + if (usTemp & 0x100) jReg07 |= 0x01; /* VT D[8] */ + if (usTemp & 0x200) jReg07 |= 0x20; + if (usTemp & 0x400) jRegAE |= 0x01; /* VT D[10] */ + SetIndexRegMask(CRTC_PORT,0x06, 0x00, (UCHAR) usTemp); + usTemp = (mode->CrtcVSyncStart) - 1; + if (usTemp & 0x100) jReg07 |= 0x04; /* VRS D[8] */ + if (usTemp & 0x200) jReg07 |= 0x80; /* VRS D[9] */ + if (usTemp & 0x400) jRegAE |= 0x08; /* VRS D[10] */ + SetIndexRegMask(CRTC_PORT,0x10, 0x00, (UCHAR) usTemp); + usTemp = ((mode->CrtcVSyncEnd) - 1) & 0x3F; + if (usTemp & 0x10) jRegAE |= 0x20; /* VRE D[4] */ + if (usTemp & 0x20) jRegAE |= 0x40; /* VRE D[5] */ + SetIndexRegMask(CRTC_PORT,0x11, 0x70, (UCHAR) (usTemp & 0x0F)); + usTemp = (mode->CrtcVDisplay) - 1; + if (usTemp & 0x100) jReg07 |= 0x02; /* VDE D[8] */ + if (usTemp & 0x200) jReg07 |= 0x40; /* VDE D[9] */ + if (usTemp & 0x400) jRegAE |= 0x02; /* VDE D[10] */ + SetIndexRegMask(CRTC_PORT,0x12, 0x00, (UCHAR) usTemp); + usTemp = (mode->CrtcVBlankStart) - 1; + if (usTemp & 0x100) jReg07 |= 0x08; /* VBS D[8] */ + if (usTemp & 0x200) jReg09 |= 0x20; /* VBS D[9] */ + if (usTemp & 0x400) jRegAE |= 0x04; /* VBS D[10] */ + SetIndexRegMask(CRTC_PORT,0x15, 0x00, (UCHAR) usTemp); + usTemp = (mode->CrtcVBlankEnd) - 1 ; + if (usTemp & 0x100) jRegAE |= 0x10; /* VBE D[8] */ + SetIndexRegMask(CRTC_PORT,0x16, 0x00, (UCHAR) usTemp); + + SetIndexRegMask(CRTC_PORT,0x07, 0x00, (UCHAR) jReg07); + SetIndexRegMask(CRTC_PORT,0x09, 0xDF, (UCHAR) jReg09); + SetIndexRegMask(CRTC_PORT,0xAE, 0x00, (UCHAR) (jRegAE | 0x80)); /* disable line compare */ + + /* lock CRTC */ + SetIndexRegMask(CRTC_PORT,0x11, 0x7F, 0x80); + +} + +static void vSetOffsetReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAModeInfo) +{ + ASTRecPtr pAST; + USHORT usOffset; + + pAST = ASTPTR(pScrn); + + usOffset = pAST->VideoModeInfo.ScreenPitch >> 3; /* Unit: char */ + + SetIndexReg(CRTC_PORT,0x13, (UCHAR) (usOffset & 0xFF)); + SetIndexReg(CRTC_PORT,0xB0, (UCHAR) ((usOffset >> 8) & 0x3F)); + +} + +static void vSetDCLKReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAModeInfo) +{ + PVBIOS_ENHTABLE_STRUCT pEnhModePtr; + PVBIOS_DCLK_INFO pDCLKPtr; + ASTRecPtr pAST; + + pAST = ASTPTR(pScrn); + + pEnhModePtr = pVGAModeInfo->pEnhTableEntry; + pDCLKPtr = &DCLKTable[pEnhModePtr->DCLKIndex]; + + SetIndexRegMask(CRTC_PORT,0xC0, 0x00, pDCLKPtr->Param1); + SetIndexRegMask(CRTC_PORT,0xC1, 0x00, pDCLKPtr->Param2); + SetIndexRegMask(CRTC_PORT,0xBB, 0xCF, ((pDCLKPtr->Param3 & 0x03) << 4)); + +} + + +static void vSetExtReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAModeInfo) +{ + + ASTRecPtr pAST; + UCHAR jRegA0, jRegA3, jRegA8; + + pAST = ASTPTR(pScrn); + + jRegA0=jRegA3=jRegA8=0; + /* Mode Type Setting */ + switch (pScrn->bitsPerPixel) { + case 8: + jRegA0 = 0x70; + jRegA3 = 0x01; + jRegA8 = 0x00; + break; + case 15: + case 16: + jRegA0 = 0x70; + jRegA3 = 0x04; + jRegA8 = 0x02; + break; + case 32: + jRegA0 = 0x70; + jRegA3 = 0x08; + jRegA8 = 0x02; + break; + } + SetIndexRegMask(CRTC_PORT,0xA0, 0x8F, (UCHAR) jRegA0); + SetIndexRegMask(CRTC_PORT,0xA3, 0xF0, (UCHAR) jRegA3); + SetIndexRegMask(CRTC_PORT,0xA8, 0xFD, (UCHAR) jRegA8); + + /* Set Threshold */ + SetIndexReg(CRTC_PORT,0xA7, 0x2F); + SetIndexReg(CRTC_PORT,0xA6, 0x1F); + +} + + +static Bool bSetDACReg(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAModeInfo) +{ + PVBIOS_DAC_INFO pDACPtr; + ASTRecPtr pAST; + ULONG i, ulDACNumber; + UCHAR DACR, DACG, DACB; + + pAST = ASTPTR(pScrn); + + switch (pScrn->bitsPerPixel) + { + case 8: + ulDACNumber = DAC_NUM_VGA; + pDACPtr = (PVBIOS_DAC_INFO) &DAC_VGA[0]; + break; + default: + return (FALSE); + } + + for (i=0; i<ulDACNumber; i++) + { + DACR = pDACPtr->DACR; + DACG = pDACPtr->DACG; + DACB = pDACPtr->DACB; + + VGA_LOAD_PALETTE_INDEX (i, DACR, DACG, DACB); + + pDACPtr++; + } + + return (TRUE); + +} + + Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_mode.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_mode.h:1.1 --- /dev/null Tue May 9 21:56:44 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_mode.h Thu Apr 13 20:50:38 2006 @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2005 ASPEED Technology Inc. + * + * 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 the authors not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The authors makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHORS 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_mode.h,v 1.1 2006/04/14 00:50:38 dawes Exp $ */ + +#ifndef __AST_MODE_H__ +#define __AST_MODE_H__ 1 + +/* Mode Limitation */ +#define MAX_HResolution 1600 +#define MAX_VResolution 1200 + +/* Std. Table Index Definition */ +#define TextModeIndex 0 +#define EGAModeIndex 1 +#define VGAModeIndex 2 +#define HiCModeIndex 3 +#define TrueCModeIndex 4 + +/* DCLK Index */ +#define VCLK25_175 0x00 +#define VCLK28_322 0x01 +#define VCLK31_5 0x02 +#define VCLK36 0x03 +#define VCLK40 0x04 +#define VCLK49_5 0x05 +#define VCLK50 0x06 +#define VCLK56_25 0x07 +#define VCLK65 0x08 +#define VCLK75 0x09 +#define VCLK78_75 0x0A +#define VCLK94_5 0x0B +#define VCLK108 0x0C +#define VCLK135 0x0D +#define VCLK157_5 0x0E +#define VCLK162 0x0F + +/* Flags Definition */ +#define Charx8Dot 0x00000001 +#define HalfDCLK 0x00000002 +#define DoubleScanMode 0x00000004 +#define LineCompareOff 0x00000008 +#define SyncPP 0x00000000 +#define SyncPN 0x00000040 +#define SyncNP 0x00000080 +#define SyncNN 0x000000C0 +#define HBorder 0x00000020 +#define VBorder 0x00000010 + +/* DAC Definition */ +#define DAC_NUM_TEXT 64 +#define DAC_NUM_EGA 64 +#define DAC_NUM_VGA 256 + +/* Data Structure decalration for internal use */ +typedef struct { + + UCHAR MISC; + UCHAR SEQ[4]; + UCHAR CRTC[25]; + UCHAR AR[20]; + UCHAR GR[9]; + +} VBIOS_STDTABLE_STRUCT, *PVBIOS_STDTABLE_STRUCT; + +typedef struct { + + ULONG HT; + ULONG HDE; + ULONG HFP; + ULONG HSYNC; + ULONG VT; + ULONG VDE; + ULONG VFP; + ULONG VSYNC; + ULONG DCLKIndex; + ULONG Flags; + + ULONG ulRefreshRate; + ULONG ulRefreshRateIndex; + ULONG ulModeID; + +} VBIOS_ENHTABLE_STRUCT, *PVBIOS_ENHTABLE_STRUCT; + +typedef struct { + UCHAR Param1; + UCHAR Param2; + UCHAR Param3; +} VBIOS_DCLK_INFO, *PVBIOS_DCLK_INFO; + +typedef struct { + UCHAR DACR; + UCHAR DACG; + UCHAR DACB; +} VBIOS_DAC_INFO, *PVBIOS_DAC_INFO; + +typedef struct { + PVBIOS_STDTABLE_STRUCT pStdTableEntry; + PVBIOS_ENHTABLE_STRUCT pEnhTableEntry; + +} VBIOS_MODE_INFO, *PVBIOS_MODE_INFO; + +extern Bool ASTSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode); +extern Bool bGetAST1000VGAModeInfo(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIOS_MODE_INFO pVGAModeInfo); + +#endif /* __AST_MODE_H__ */ Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_tool.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_tool.c:1.1 --- /dev/null Tue May 9 21:56:44 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_tool.c Thu Apr 13 20:50:38 2006 @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2005 ASPEED Technology Inc. + * + * 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 the authors not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The authors makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHORS 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_tool.c,v 1.1 2006/04/14 00:50:38 dawes Exp $ */ + +#include "xf86_OSproc.h" + +/* Driver specific headers */ +#include "ast.h" + +Bool +ASTMapMem(ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + + + pAST->FBVirtualAddr = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, + pAST->PciTag, + pAST->FBPhysAddr, pAST->FbMapSize); + + if (!pAST->FBVirtualAddr) + return FALSE; + + return TRUE; +} + +Bool +ASTUnmapMem(ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + + xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pAST->FBVirtualAddr, + pAST->FbMapSize); + + pAST->FBVirtualAddr = 0; + + return TRUE; +} + +Bool +ASTMapMMIO(ScrnInfoPtr pScrn) +{ + int mmioFlags; + ASTRecPtr pAST = ASTPTR(pScrn); + +#if !defined(__alpha__) + mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT; +#else + mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT | VIDMEM_SPARSE; +#endif + + pAST->MMIOVirtualAddr = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, + pAST->PciTag, + pAST->MMIOPhysAddr, pAST->MMIOMapSize); + if (!pAST->MMIOVirtualAddr) + return FALSE; + + return TRUE; +} + +void +ASTUnmapMMIO(ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + + xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pAST->MMIOVirtualAddr, + pAST->MMIOMapSize); + pAST->MMIOVirtualAddr = 0; + +} + + Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_tool.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_tool.h:1.1 --- /dev/null Tue May 9 21:56:44 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_tool.h Thu Apr 13 20:50:38 2006 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2005 ASPEED Technology Inc. + * + * 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 the authors not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The authors makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHORS 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_tool.h,v 1.1 2006/04/14 00:50:38 dawes Exp $ */ + +#ifndef __AST_TOOL_H__ +#define __AST_TOOL_H__ 1 + +Bool ASTMapMem(ScrnInfoPtr pScrn); +Bool ASTUnmapMem(ScrnInfoPtr pScrn); +Bool ASTMapMMIO(ScrnInfoPtr pScrn); +void ASTUnmapMMIO(ScrnInfoPtr pScrn); + +#endif /* __AST_TOOL_H__ */ Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_vgatool.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_vgatool.c:1.1 --- /dev/null Tue May 9 21:56:44 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_vgatool.c Thu Apr 13 20:50:38 2006 @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2005 ASPEED Technology Inc. + * + * 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 the authors not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The authors makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHORS 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_vgatool.c,v 1.1 2006/04/14 00:50:38 dawes Exp $ */ + +#include "xf86.h" +#include "xf86_ansic.h" +#include "compiler.h" + +#define DPMS_SERVER +#include <X11/extensions/dpms.h> + +/* Driver specific headers */ +#include "ast.h" + +void +vASTOpenKey(ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + + SetIndexReg(CRTC_PORT,0x80, 0xA8); + +} + +Bool +bASTRegInit(ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + + /* Enable MMIO */ + SetIndexRegMask(CRTC_PORT,0xA1, 0xFF, 0x04); + + return (TRUE); + +} + +ULONG +ASTGetVRAMInfo(ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + UCHAR jReg; + + vASTOpenKey(pScrn); + + GetIndexRegMask(CRTC_PORT, 0xAA, 0xFF, jReg); + + switch (jReg & 0x03) + { + case 0x00: + return (VIDEOMEM_SIZE_08M); + case 0x01: + return (VIDEOMEM_SIZE_16M); + case 0x02: + return (VIDEOMEM_SIZE_32M); + case 0x03: + return (VIDEOMEM_SIZE_64M); + } + + return (DEFAULT_VIDEOMEM_SIZE); + +} + + +void +vASTSetStartAddressCRT1(ASTRecPtr pAST, ULONG base) +{ + SetIndexReg(CRTC_PORT,0x0D, (UCHAR) (base & 0xFF)); + SetIndexReg(CRTC_PORT,0x0C, (UCHAR) ((base >> 8) & 0xFF)); + SetIndexReg(CRTC_PORT,0xAF, (UCHAR) ((base >> 16) & 0xFF)); + +} + +void +vAST1000DisplayOff(ASTRecPtr pAST) +{ + SetIndexRegMask(SEQ_PORT,0x01, 0xDF, 0x20); + +} + +ULONG +GetMaxDCLK(ScrnInfoPtr pScrn) +{ + ASTRecPtr pAST = ASTPTR(pScrn); + UCHAR jReg; + ULONG ulData, ulData2; + ULONG ulRefPLL, ulDeNumerator, ulNumerator, ulDivider; + ULONG ulDRAMBusWidth, ulMCLK, ulDRAMBandwidth, ActualDRAMBandwidth, DRAMEfficiency = 500; + ULONG ulDCLK; + + vASTOpenKey(pScrn); + + *(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = 0x1e6e0000; + *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x00000001; + + /* Get BusWidth */ + ulData = *(ULONG * ) (pAST->MMIOVirtualAddr + 0x10004); + if (ulData & 0x40) + ulDRAMBusWidth = 16; + else + ulDRAMBusWidth = 32; + + /* Get MCLK */ + { + *(ULONG *) (pAST->MMIOVirtualAddr + 0x10100) = 0x000000A8; + + ulData = *(ULONG *) (pAST->MMIOVirtualAddr + 0x10120); + ulData2 = *(ULONG *) (pAST->MMIOVirtualAddr + 0x10170); + if (ulData2 & 0x2000) + ulRefPLL = 14318; + else + ulRefPLL = 12000; + + ulDeNumerator = ulData & 0x1F; + ulNumerator = (ulData & 0x3FE0) >> 5; + + ulData = (ulData & 0xC000) >> 14; + switch (ulData) + { + case 0x03: + ulDivider = 0x04; + break; + case 0x02: + case 0x01: + ulDivider = 0x02; + break; + default: + ulDivider = 0x01; + } + + ulMCLK = ulRefPLL * (ulNumerator + 2) / ((ulDeNumerator + 2) * ulDivider * 1000); + + } + + /* Get Bandwidth */ + ulDRAMBandwidth = ulMCLK * ulDRAMBusWidth * 2 / 8; + ActualDRAMBandwidth = ulDRAMBandwidth * DRAMEfficiency / 1000; + + /* Get Max DCLK */ + GetIndexRegMask(CRTC_PORT, 0xD0, 0xFF, jReg); + if (jReg & 0x08) + ulDCLK = ActualDRAMBandwidth / ((pScrn->bitsPerPixel+1+16) / 8); + else + ulDCLK = ActualDRAMBandwidth / ((pScrn->bitsPerPixel+1) / 8); + + if (ulDCLK > 165) ulDCLK = 165; + + return(ulDCLK); + +} + + +void +vAST1000DisplayOn(ASTRecPtr pAST) +{ + + SetIndexRegMask(SEQ_PORT,0x01, 0xDF, 0x00); + +} + + +void +vASTLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, + VisualPtr pVisual) +{ + + ASTRecPtr pAST = ASTPTR(pScrn); + int i, j, index; + UCHAR DACIndex, DACR, DACG, DACB; + + switch (pScrn->bitsPerPixel) { + case 15: + for(i=0; i<numColors; i++) { + index = indices[i]; + for(j=0; j<8; j++) { + DACIndex = (index * 8) + j; + DACR = colors[index].red << (8- pScrn->rgbBits); + DACG = colors[index].green << (8- pScrn->rgbBits); + DACB = colors[index].blue << (8- pScrn->rgbBits); + + VGA_LOAD_PALETTE_INDEX (DACIndex, DACR, DACG, DACB); + } + } + break; + + case 16: + for(i=0; i<numColors; i++) { + index = indices[i]; + for(j=0; j<4; j++) { + DACIndex = (index * 4) + j; + DACR = colors[index/2].red << (8- pScrn->rgbBits); + DACG = colors[index].green << (8- pScrn->rgbBits); + DACB = colors[index/2].blue << (8- pScrn->rgbBits); + + VGA_LOAD_PALETTE_INDEX (DACIndex, DACR, DACG, DACB); + } + } + break; + + case 24: + for(i=0; i<numColors; i++) { + index = indices[i]; + DACIndex = index; + DACR = colors[index].red; + DACG = colors[index].green; + DACB = colors[index].blue; + + VGA_LOAD_PALETTE_INDEX (DACIndex, DACR, DACG, DACB); + } + break; + + default: + for(i=0; i<numColors; i++) { + index = indices[i]; + DACIndex = index; + DACR = colors[index].red >> (8 - pScrn->rgbBits); + DACG = colors[index].green >> (8 - pScrn->rgbBits); + DACB = colors[index].blue >> (8 - pScrn->rgbBits); + + VGA_LOAD_PALETTE_INDEX (DACIndex, DACR, DACG, DACB); + } + + } /* end of switch */ + +} /* end of vASTLoadPalette */ + +void +ASTDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags) +{ + ASTRecPtr pAST; + UCHAR SEQ01, CRB6; + + pAST = ASTPTR(pScrn); + SEQ01=CRB6=0; + + vASTOpenKey(pScrn); + + switch (PowerManagementMode) { + case DPMSModeOn: + /* Screen: On; HSync: On, VSync: On */ + SEQ01 = 0x00; + CRB6 = 0x00; + break; + case DPMSModeStandby: + /* Screen: Off; HSync: Off, VSync: On */ + SEQ01 = 0x20; + CRB6 = 0x01; + break; + case DPMSModeSuspend: + /* Screen: Off; HSync: On, VSync: Off */ + SEQ01 = 0x20; + CRB6 = 0x02; + break; + case DPMSModeOff: + /* Screen: Off; HSync: Off, VSync: Off */ + SEQ01 = 0x20; + CRB6 = 0x03; + break; + } + + SetIndexRegMask(SEQ_PORT,0x01, 0xDF, SEQ01); + SetIndexRegMask(CRTC_PORT,0xB6, 0xFC, CRB6); + +} Index: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_vgatool.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_vgatool.h:1.1 --- /dev/null Tue May 9 21:56:44 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_vgatool.h Thu Apr 13 20:50:38 2006 @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2005 ASPEED Technology Inc. + * + * 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 the authors not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. The authors makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHORS 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/aspeed/ast_vgatool.h,v 1.1 2006/04/14 00:50:38 dawes Exp $ */ + +#ifndef __AST_VGATOOL_H__ +#define __AST_VGATOOL_H__ 1 + +/* VRAM Size Definition */ +#define VIDEOMEM_SIZE_08M 0x00800000 +#define VIDEOMEM_SIZE_16M 0x01000000 +#define VIDEOMEM_SIZE_32M 0x02000000 +#define VIDEOMEM_SIZE_64M 0x04000000 + +#define AR_PORT_WRITE (pAST->RelocateIO + 0x40) +#define MISC_PORT_WRITE (pAST->RelocateIO + 0x42) +#define SEQ_PORT (pAST->RelocateIO + 0x44) +#define DAC_INDEX_WRITE (pAST->RelocateIO + 0x48) +#define DAC_DATA (pAST->RelocateIO + 0x49) +#define GR_PORT (pAST->RelocateIO + 0x4E) +#define CRTC_PORT (pAST->RelocateIO + 0x54) +#define INPUT_STATUS1_READ (pAST->RelocateIO + 0x5A) + +#define GetReg(base) inb(base) +#define SetReg(base,val) outb(base,val) +#define GetIndexReg(base,index,val) do { \ + outb(base,index); \ + val = inb(base+1); \ + } while (0) +#define SetIndexReg(base,index, val) do { \ + outb(base,index); \ + outb(base+1,val); \ + } while (0) +#define GetIndexRegMask(base,index, and, val) do { \ + outb(base,index); \ + val = (inb(base+1) & and); \ + } while (0) +#define SetIndexRegMask(base,index, and, val) do { \ + UCHAR __Temp; \ + outb(base,index); \ + __Temp = (inb((base)+1)&(and))|(val); \ + SetIndexReg(base,index,__Temp); \ + } while (0) + +#define VGA_LOAD_PALETTE_INDEX(index, red, green, blue) \ +{ \ + UCHAR __junk; \ + SetReg(DAC_INDEX_WRITE,(UCHAR)(index)); \ + __junk = GetReg(SEQ_PORT); \ + SetReg(DAC_DATA,(UCHAR)(red)); \ + __junk = GetReg(SEQ_PORT); \ + SetReg(DAC_DATA,(UCHAR)(green)); \ + __junk = GetReg(SEQ_PORT); \ + SetReg(DAC_DATA,(UCHAR)(blue)); \ + __junk = GetReg(SEQ_PORT); \ + (void)__junk; \ +} + +extern void vASTOpenKey(ScrnInfoPtr pScrn); +extern Bool bASTRegInit(ScrnInfoPtr pScrn); +extern ULONG ASTGetVRAMInfo(ScrnInfoPtr pScrn); +extern ULONG GetMaxDCLK(ScrnInfoPtr pScrn); +extern void vAST1000DisplayOn(ASTRecPtr pAST); +extern void vAST1000DisplayOff(ASTRecPtr pAST); +extern void vASTSetStartAddressCRT1(ASTRecPtr pAST, ULONG base); +extern void vASTLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual); +extern void ASTDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags); + +#endif /* __AST_VGATOOL_H__ */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile:1.58 xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile:1.61 --- xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile:1.58 Mon Feb 28 22:48:52 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile,v 1.58 2005/03/01 03:48:52 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile,v 1.61 2006/01/05 18:55:29 tsi Exp $ XCOMM -XCOMM Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org +XCOMM Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org XCOMM XCOMM Permission to use, copy, modify, distribute, and sell this software and XCOMM its documentation for any purpose is hereby granted without fee, provided @@ -50,101 +50,36 @@ DRIOBJS3 = r128_dri.o DRIOBJS4 = radeon_dri.o -DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri -I$(TOP)/include \ - -I$(DRMINCLUDESDIR) +DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri -I$(DRMINCLUDESDIR) DRIDEFINES = $(GLX_DEFINES) #endif -/* - * The following configuration logic is only meant as a first cut, and is - * therefore incomplete. ...And, no, you do NOT have permission to move this - * into xfree86.cf... - * - * Currently, ATIAvoidCPIO >MUST< be #define'd as YES for those platforms - * (architecture/OS combinations) that neither provide nor emulate a - * little-endian undirected PIO address space of at least 64 kB in size. - * - * "Undirected" means the driver does not need to determine the identity nor - * location of the responding adapter before accessing a particular location in - * the PIO address space. - * - * #define'ing ATIAvoidCPIO to YES generates a driver that will only support - * PCI/AGP Mach64 adapters using a linear aperture and the accelerator CRTC. - * The resulting driver will also require the same of the environment on server - * entry. - * - * For testing purposes, #define'ing ATIAvoidCPIO as YES is also supported on - * platforms that do, in fact, provide or emulate a PIO address space as - * described above, but this should not be the default driver configuration. - * - * Currently, ATIAvoidNonPCI needs to be set to YES for those platforms that do - * not tolerate PCI master aborts. - */ -#if defined(i386Architecture) || \ - defined(ia64Architecture) || \ - defined(AMD64Architecture) || \ - defined(AlphaArchitecture) -# ifndef ATIAvoidCPIO -# define ATIAvoidCPIO NO -# endif -#elif defined(SparcArchitecture) || 1 -# undef ATIAvoidCPIO /* Clobber any previous setting */ -# define ATIAvoidCPIO YES -#endif - -#if defined(PpcArchitecture) -# undef ATIAvoidNonPCI -# define ATIAvoidNonPCI YES -#elif !defined(ATIAvoidNonPCI) -# define ATIAvoidNonPCI NO -#endif - -#if ATIAvoidNonPCI - -NONPCIDEFINES = -DAVOID_NON_PCI - -#endif - -#if ATIAvoidCPIO - -CPIODEFINES = -DAVOID_CPIO +DEFINES = $(DRIDEFINES) -#else - -CPIOSRCS1 = ativgaio.c -CPIOSRCS2 = atibank.c ativga.c atiwonder.c atiwonderio.c - -CPIOOBJS1 = ativgaio.o -CPIOOBJS2 = atibank.o ativga.o atiwonder.o atiwonderio.o - -#endif - -DEFINES = $(CPIODEFINES) $(NONPCIDEFINES) $(DRIDEFINES) - -SRCS1 = ati.c atiadapter.c atibus.c atichip.c atiident.c atioption.c \ - atiprobe.c atividmem.c $(CPIOSRCS1) $(MODSRCS1) \ +SRCS1 = ati.c atiadapter.c atibus.c atichip.c atiendian.c atiident.c \ + atioption.c atiprobe.c ativgaio.c atividmem.c $(MODSRCS1) \ radeon_probe.c r128_probe.c -SRCS2 = atiaccel.c atiadjust.c atiaudio.c aticlock.c aticonfig.c aticonsole.c \ - aticursor.c atidac.c atidecoder.c atidga.c atidsp.c atii2c.c \ - atilock.c atimach64.c atimach64accel.c atimach64cursor.c \ +SRCS2 = atiaccel.c atiadjust.c atiaudio.c atibank.c aticlock.c aticonfig.c \ + aticonsole.c aticursor.c atidac.c atidecoder.c atidga.c atidsp.c \ + atii2c.c atilock.c atimach64.c atimach64accel.c atimach64cursor.c \ atimach64i2c.c atimach64io.c atimach64xv.c atimode.c atipreinit.c \ atiprint.c atirgb514.c atiscreen.c atituner.c atiutil.c ativalid.c \ - atixv.c $(CPIOSRCS2) $(MODSRCS2) + ativga.c atiwonder.c atiwonderio.c atixv.c $(MODSRCS2) SRCS3 = r128_accel.c r128_cursor.c r128_dga.c r128_driver.c \ r128_video.c $(DRISRCS3) $(MODSRCS3) SRCS4 = radeon_accel.c radeon_cursor.c radeon_dga.c radeon_driver.c \ radeon_video.c $(DRISRCS4) $(MODSRCS4) -OBJS1 = ati.o atiadapter.o atibus.o atichip.o atiident.o atioption.o \ - atiprobe.o atividmem.o $(CPIOOBJS1) $(MODOBJS1) \ +OBJS1 = ati.o atiadapter.o atibus.o atichip.o atiendian.o atiident.o \ + atioption.o atiprobe.o ativgaio.o atividmem.o $(MODOBJS1) \ radeon_probe.o r128_probe.o -OBJS2 = atiaccel.o atiadjust.o atiaudio.o aticlock.o aticonfig.o aticonsole.o \ - aticursor.o atidac.o atidecoder.o atidga.o atidsp.o atii2c.o \ - atilock.o atimach64.o atimach64accel.o atimach64cursor.o \ +OBJS2 = atiaccel.o atiadjust.o atiaudio.o atibank.o aticlock.o aticonfig.o \ + aticonsole.o aticursor.o atidac.o atidecoder.o atidga.o atidsp.o \ + atii2c.o atilock.o atimach64.o atimach64accel.o atimach64cursor.o \ atimach64i2c.o atimach64io.o atimach64xv.o atimode.o atipreinit.o \ atiprint.o atirgb514.o atiscreen.o atituner.o atiutil.o ativalid.o \ - atixv.o $(CPIOOBJS2) $(MODOBJS2) + ativga.o atiwonder.o atiwonderio.o atixv.o $(MODOBJS2) OBJS3 = r128_accel.o r128_cursor.o r128_dga.o r128_driver.o \ r128_video.o $(DRIOBJS3) $(MODOBJS3) OBJS4 = radeon_accel.o radeon_cursor.o radeon_dga.o radeon_driver.o \ @@ -154,9 +89,9 @@ OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(XF86SRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(XF86SRC) \ -I$(XF86SRC)/vbe -I$(XF86SRC)/int10 \ -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ -I$(XF86SRC)/rac -I$(XF86SRC)/ramdac \ @@ -166,7 +101,7 @@ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ -I$(SERVERSRC)/miext/shadow \ -I$(SERVERSRC)/render -I$(SERVERSRC)/Xext -I$(SERVERSRC)/include \ - $(DRIINCLUDES) -I$(FONTINCSRC) -I$(EXTINCSRC) -I$(XINCLUDESRC) + $(DRIINCLUDES) #endif #if MakeHasPosixVariableSubstitutions @@ -231,6 +166,8 @@ InstallDriverSDKNonExecFile(atidga.h,$(DRIVERSDKDIR)/drivers/ati) InstallDriverSDKNonExecFile(atidsp.c,$(DRIVERSDKDIR)/drivers/ati) InstallDriverSDKNonExecFile(atidsp.h,$(DRIVERSDKDIR)/drivers/ati) +InstallDriverSDKNonExecFile(atiendian.c,$(DRIVERSDKDIR)/drivers/ati) +InstallDriverSDKNonExecFile(atiendian.h,$(DRIVERSDKDIR)/drivers/ati) InstallDriverSDKNonExecFile(atiident.c,$(DRIVERSDKDIR)/drivers/ati) InstallDriverSDKNonExecFile(atiident.h,$(DRIVERSDKDIR)/drivers/ati) InstallDriverSDKNonExecFile(atii2c.c,$(DRIVERSDKDIR)/drivers/ati) @@ -335,8 +272,12 @@ InstallDriverSDKObjectModule(r128,$(DRIVERSDKMODULEDIR),drivers) InstallDriverSDKObjectModule(radeon,$(DRIVERSDKMODULEDIR),drivers) -/* Remove instances of ati2 module */ +/* A rule for convenience */ +atimisc:: $(OBJS1) $(OBJS2) + @echo Target atimisc is up-to-date. + #if DoLoadableServer +/* Remove instances of the old ati2 module */ #undef ATI2DriverModuleName #if MakeDllModules Index: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c:1.26 xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c:1.27 --- xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c:1.26 Fri Dec 31 11:07:05 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c,v 1.26 2004/12/31 16:07:05 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c,v 1.27 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h:1.11 xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h:1.11 Fri Dec 31 11:07:05 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h,v 1.11 2004/12/31 16:07:05 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.h,v 1.12 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1999 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c:1.15 xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c:1.17 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c:1.15 Fri Dec 31 11:07:05 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c,v 1.15 2004/12/31 16:07:05 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c,v 1.17 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2001 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2001 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -58,12 +58,7 @@ } } -#ifndef AVOID_CPIO - if (!pATI->BankInfo.BankSize) - -#endif /* AVOID_CPIO */ - { /* * Note: If PixelArea exceeds the engine's maximum, the excess is Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h:1.7 xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h:1.7 Fri Dec 31 11:07:05 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h,v 1.7 2004/12/31 16:07:05 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h,v 1.8 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2001 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2001 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c:1.19 xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c:1.21 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c:1.19 Fri Dec 31 11:07:05 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c,v 1.19 2004/12/31 16:07:05 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.c,v 1.21 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -29,9 +29,6 @@ const char *ATIAdapterNames[] = { "Unknown", - -#ifndef AVOID_CPIO - "ATI EGA Wonder800", "ATI EGA Wonder800+", "IBM VGA or compatible", @@ -45,9 +42,6 @@ "IBM 8514/A or compatible", "ATI Mach8", "ATI Mach32", - -#endif /* AVOID_CPIO */ - "ATI Mach64", "ATI Rage128", "ATI Radeon" Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h:1.12 xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h:1.14 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h:1.12 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h,v 1.12 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadapter.h,v 1.14 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -30,9 +30,6 @@ typedef enum { ATI_ADAPTER_NONE = 0, - -#ifndef AVOID_CPIO - ATI_ADAPTER_EGA, ATI_ADAPTER_EGA_PLUS, ATI_ADAPTER_VGA, @@ -46,9 +43,6 @@ ATI_ADAPTER_8514A, ATI_ADAPTER_MACH8, ATI_ADAPTER_MACH32, - -#endif /* AVOID_CPIO */ - ATI_ADAPTER_MACH64, ATI_ADAPTER_RAGE128, ATI_ADAPTER_RADEON, Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c:1.17 xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c:1.19 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c:1.17 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c,v 1.17 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c,v 1.19 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -51,8 +51,6 @@ { unsigned long MaxBase; -#ifndef AVOID_CPIO - if ((pATI->CPIO_VGAWonder) && (pATI->Chip <= ATI_CHIP_18800_1) && (pATI->VideoRAM == 256) && @@ -63,9 +61,6 @@ pATI->AdjustMask = (unsigned long)(-32); } else - -#endif /* AVOID_CPIO */ - { pATI->AdjustDepth = (pATI->bitsPerPixel + 7) >> 3; @@ -79,9 +74,6 @@ switch (pATI->NewHW.crtc) { - -#ifndef AVOID_CPIO - case ATI_CRTC_VGA: if (pATI->Chip >= ATI_CHIP_264CT) { @@ -103,8 +95,6 @@ } break; -#endif /* AVOID_CPIO */ - case ATI_CRTC_MACH64: pATI->AdjustMaxBase = MaxBits(CRTC_OFFSET) << 3; break; @@ -124,9 +114,8 @@ /* * ATIAdjustFrame -- * - * This function is used to initialise the SVGA Start Address - the first - * displayed location in video memory. This is used to implement the virtual - * window. + * This function is used to set the SVGA Start Address - the first displayed + * location in video memory. This is used to implement the virtual window. */ void ATIAdjustFrame @@ -173,8 +162,6 @@ /* Unlock registers */ ATIUnlock(pATI); -#ifndef AVOID_CPIO - if ((pATI->NewHW.crtc == ATI_CRTC_VGA) && (pATI->Chip < ATI_CHIP_264CT)) { PutReg(CRTX(pATI->CPIO_VGABase), 0x0CU, GetByte(Base, 1)); @@ -212,18 +199,10 @@ SetBits(Base, CRTC_OFFSET)); } else - -#endif /* AVOID_CPIO */ - { - -#ifndef AVOID_CPIO - if (pATI->NewHW.crtc == ATI_CRTC_VGA) Base <<= 1; /* LSBit must be zero */ -#endif /* AVOID_CPIO */ - outr(CRTC_OFF_PITCH, SetBits(pATI->displayWidth >> 3, CRTC_PITCH) | SetBits(Base, CRTC_OFFSET)); } Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h:1.10 xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h:1.10 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h,v 1.10 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.h,v 1.11 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.c:1.3 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.c,v 1.3 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.c,v 1.4 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.h:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.h:1.3 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.h,v 1.3 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaudio.h,v 1.4 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c:1.14 xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c:1.16 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c:1.14 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c,v 1.14 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.c,v 1.16 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -26,8 +26,6 @@ #include "atimach64io.h" #include "atiwonderio.h" -#ifndef AVOID_CPIO - /* * ATI VGA Wonder V3 adapters use an ATI 18800 chip and are single-banked. * Bank selection is done with bits 0x1E of ATI extended VGA register index @@ -405,5 +403,3 @@ ATIMach64SetBankPlanar(ATIPTR(XF86SCRNINFO(pScreen)), iBank); return 0; } - -#endif /* AVOID_CPIO */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h:1.10 xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h:1.10 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h,v 1.10 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibank.h,v 1.12 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -29,8 +29,6 @@ #include "mibank.h" -#ifndef AVOID_CPIO - /* * Banking definitions. */ @@ -83,6 +81,4 @@ ATIMach64SetBankPacked, ATIMach64SetBankPlanar; -#endif /* AVOID_CPIO */ - #endif /* ___ATIBANK_H___ */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c:1.20 xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c:1.22 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c:1.20 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c,v 1.20 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.c,v 1.22 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -64,8 +64,6 @@ { resPtr pResources; -#ifndef AVOID_CPIO - resRange Resources[2] = {{0, 0, 0}, _END}; /* Claim VGA and VGAWonder resources */ @@ -91,9 +89,9 @@ Resources[0].type = ResExcIoSparse | ResBus; Resources[0].rBase = pATI->CPIO_VGAWonder; if (pATI->Chip <= ATI_CHIP_18800_1) - Resources[0].rMask = 0x03FEU; + Resources[0].rMask = (int)0xFFFF03FEU; else - Resources[0].rMask = 0xF3FEU; + Resources[0].rMask = (int)0xFFFFF3FEU; xf86ClaimFixedResources(Resources, pATI->iEntity); @@ -113,14 +111,14 @@ /* Claim Mach64 sparse I/O resources */ if ((pATI->Adapter == ATI_ADAPTER_MACH64) && - (pATI->CPIODecoding == SPARSE_IO)) + (pATI->IODecoding == SPARSE_IO)) { if (pATI->SharedAccelerator) Resources[0].type = ResShrIoSparse | ResBus; else Resources[0].type = ResExcIoSparse | ResBus; - Resources[0].rBase = pATI->CPIOBase; - Resources[0].rMask = 0x03FCU; + Resources[0].rBase = pATI->CPIOBase - pATI->DomainIOBase; + Resources[0].rMask = (int)0xFFFF03FCU; xf86ClaimFixedResources(Resources, pATI->iEntity); } @@ -128,13 +126,6 @@ if (Active) return; -#else /* AVOID_CPIO */ - - if (pATI->SharedAccelerator) - return; - -#endif /* AVOID_CPIO */ - /* Register unshared relocatable resources for inactive adapters */ do { Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h:1.13 xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h:1.14 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h:1.13 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h,v 1.13 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atibus.h,v 1.14 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c:1.40 xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c:1.42 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c:1.40 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c,v 1.40 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.c,v 1.42 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -33,9 +33,6 @@ const char *ATIChipNames[] = { "Unknown", - -#ifndef AVOID_CPIO - "IBM VGA or compatible", "ATI 18800", "ATI 18800-1", @@ -51,9 +48,6 @@ "ATI 68800-6", "ATI 68800LX", "ATI 68800AX", - -#endif /* AVOID_CPIO */ - "ATI 88800GX-C", "ATI 88800GX-D", "ATI 88800GX-E", @@ -109,8 +103,6 @@ const char *ATIFoundryNames[] = { "SGS", "NEC", "KCS", "UMC", "TSMC", "5", "6", "UMC" }; -#ifndef AVOID_CPIO - /* * ATIMach32ChipID -- * @@ -153,8 +145,6 @@ } } -#endif /* AVOID_CPIO */ - /* * ATIMach64ChipID -- * @@ -443,9 +433,6 @@ { switch (ChipID) { - -#ifndef AVOID_CPIO - case OldChipID('A', 'A'): case NewChipID('A', 'A'): return ATI_CHIP_68800_3; @@ -458,8 +445,6 @@ case OldChipID('A', 'X'): case NewChipID('A', 'X'): return ATI_CHIP_68800AX; -#endif /* AVOID_CPIO */ - case OldChipID('G', 'X'): case NewChipID('G', 'X'): switch (ChipRev) { Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h:1.28 xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h:1.31 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h:1.28 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h,v 1.28 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atichip.h,v 1.31 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -27,7 +27,7 @@ #include "atipriv.h" #include "atiregs.h" -#include "Xmd.h" +#include <X11/Xmd.h> /* * Chip-related definitions. @@ -35,9 +35,6 @@ typedef enum { ATI_CHIP_NONE = 0, - -#ifndef AVOID_CPIO - ATI_CHIP_VGA, /* Generic VGA */ ATI_CHIP_18800, ATI_CHIP_18800_1, @@ -53,9 +50,6 @@ ATI_CHIP_68800_6, /* Mach32 */ ATI_CHIP_68800LX, /* Mach32 */ ATI_CHIP_68800AX, /* Mach32 */ - -#endif /* AVOID_CPIO */ - ATI_CHIP_88800GXC, /* Mach64 */ ATI_CHIP_88800GXD, /* Mach64 */ ATI_CHIP_88800GXE, /* Mach64 */ @@ -127,12 +121,7 @@ extern const char *ATIFoundryNames[]; -#ifndef AVOID_CPIO - extern void ATIMach32ChipID FunctionPrototype((ATIPtr)); - -#endif /* AVOID_CPIO */ - extern void ATIMach64ChipID FunctionPrototype((ATIPtr, const CARD16)); extern ATIChipType ATIChipID FunctionPrototype((const CARD16, const CARD8)); Index: xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.c:1.24 xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.c:1.29 --- xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.c:1.24 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.c Sat Jan 28 20:45:05 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.c,v 1.24 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.c,v 1.29 2006/01/29 01:45:05 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -448,12 +448,7 @@ /* For ATI adapters, reject generic VGA clocks */ -#ifndef AVOID_CPIO - if (pATI->Adapter != ATI_ADAPTER_VGA) - -#endif /* AVOID_CPIO */ - { if (ClockLine == SpecificationClockLine) ClockChipIndex++; @@ -467,15 +462,11 @@ { int MaximumGap = 0, ClockCount = 0, ClockIndex = 0; -#ifndef AVOID_CPIO - /* Only Mach64's and later can have programmable clocks */ if ((ClockChipIndex >= ATI_CLOCK_MACH64A) && (pATI->Adapter < ATI_ADAPTER_MACH64)) break; -#endif /* AVOID_CPIO */ - for (; ClockIndex < NumberOfClocks; ClockIndex++) { int Gap, XF86ConfigClock, SpecificationClock; @@ -518,15 +509,9 @@ break; SkipThisClockGenerator:; - -#ifndef AVOID_CPIO - /* For non-ATI adapters, only normalise standard VGA clocks */ if (pATI->Adapter == ATI_ADAPTER_VGA) break; - -#endif /* AVOID_CPIO */ - } return ClockChip; @@ -552,13 +537,7 @@ unsigned short int NumberOfDividers, NumberOfClocks; int CalibrationClockNumber, CalibrationClockValue; int ClockIndex, SpecificationClock, ClockMap = 0, Index; - CARD8 CanDisableInterrupts; - -#ifndef AVOID_CPIO - - CARD8 genmo; - -#endif /* AVOID_CPIO */ + CARD8 CanDisableInterrupts, genmo; /* * Decide what to do about the XF86Config clocks for programmable clock @@ -591,18 +570,12 @@ pScreenInfo->progClock = TRUE; /* Set internal clock ordering */ - -#ifndef AVOID_CPIO - if (pATI->NewHW.crtc == ATI_CRTC_VGA) { pATI->NewHW.ClockMap = ATIVGAProgrammableClockMap; pATI->NewHW.ClockUnmap = ATIVGAProgrammableClockUnmap; } else - -#endif /* AVOID_CPIO */ - { pATI->NewHW.ClockMap = ATIProgrammableClockMap; pATI->NewHW.ClockUnmap = ATIProgrammableClockUnmap; @@ -647,22 +620,15 @@ } } -#ifndef AVOID_CPIO - /* Set default clock maps */ pATI->NewHW.ClockMap = ATIVGAWonderClockMap; pATI->NewHW.ClockUnmap = ATIVGAWonderClockUnmap; -#endif /* AVOID_CPIO */ - /* * Determine the number of clock values the adapter should be able to * generate and the dot clock to use for probe calibration. */ ProbeClocks: - -#ifndef AVOID_CPIO - if (pATI->Adapter == ATI_ADAPTER_VGA) { NumberOfDividers = 1; @@ -671,13 +637,7 @@ CalibrationClockValue = 28322; } else - -#endif /* AVOID_CPIO */ - { - -#ifndef AVOID_CPIO - NumberOfDividers = 4; if ((pATI->Chip <= ATI_CHIP_18800) || (pATI->Adapter == ATI_ADAPTER_V4)) @@ -688,20 +648,11 @@ CalibrationClockValue = 56644; } else - -#endif /* AVOID_CPIO */ - { NumberOfUndividedClocks = 16; - -#ifndef AVOID_CPIO - CalibrationClockNumber = 7; CalibrationClockValue = 36000; if (pATI->Chip >= ATI_CHIP_68800) - -#endif /* AVOID_CPIO */ - { NumberOfDividers = 2; if (pATI->Chip >= ATI_CHIP_264CT) @@ -711,14 +662,7 @@ CalibrationClockNumber = 1; CalibrationClockValue = 28322; } - else - -#ifndef AVOID_CPIO - - if (pATI->Adapter >= ATI_ADAPTER_MACH64) - -#endif /* AVOID_CPIO */ - + else if (pATI->Adapter >= ATI_ADAPTER_MACH64) { CalibrationClockNumber = 10 /* or 11 */; CalibrationClockValue = 75000 /* or 65000 */; @@ -728,18 +672,12 @@ * When selecting clocks, all ATI accelerators use a different * clock ordering. */ - -#ifndef AVOID_CPIO - if (pATI->NewHW.crtc == ATI_CRTC_VGA) { pATI->NewHW.ClockMap = ATIMachVGAClockMap; pATI->NewHW.ClockUnmap = ATIMachVGAClockUnmap; } else - -#endif /* AVOID_CPIO */ - { pATI->NewHW.ClockMap = ATIAcceleratorClockMap; pATI->NewHW.ClockUnmap = ATIAcceleratorClockUnmap; @@ -784,8 +722,6 @@ CalibrationClockValue *= 10; } -#ifndef AVOID_CPIO - if (pATI->VGAAdapter != ATI_ADAPTER_NONE) { /* @@ -802,8 +738,6 @@ ATIModifyExtReg(pATI, 0xB5U, pATI->OldHW.b5, 0x7FU, 0x00U); } -#endif /* AVOID_CPIO */ - /* * Probe the adapter for clock values. The following is essentially * the common layer's xf86GetClocks() reworked to fit. One difference @@ -811,6 +745,13 @@ */ CanDisableInterrupts = TRUE; /* An assumption verified below */ + /* + * It's unfortunate this message can only show up when the server is + * started remotely. + */ + xf86DrvMsgVerb(pScreenInfo->scrnIndex, X_INFO, 0, + "Probing clocks. Please standby...\n"); + for (ClockIndex = 0; ClockIndex < NumberOfClocks; ClockIndex++) { pScreenInfo->clock[ClockIndex] = 0; @@ -821,9 +762,6 @@ /* Select the clock */ switch (pATI->OldHW.crtc) { - -#ifndef AVOID_CPIO - case ATI_CRTC_VGA: /* Get generic two low-order bits */ genmo = (inb(R_GENMO) & 0xF3U) | ((Index << 2) & 0x0CU); @@ -886,8 +824,6 @@ break; -#endif /* AVOID_CPIO */ - case ATI_CRTC_MACH64: out8(CLOCK_CNTL, CLOCK_STROBE | SetBits(Index, CLOCK_SELECT | CLOCK_DIVIDER)); @@ -910,6 +846,8 @@ CanDisableInterrupts = FALSE; } + xf86InterceptSignals(&pATI->CaughtSignal); + /* * Generate a count while monitoring the vertical sync or blanking * pulse. This is dependent on the CRTC used by the mode on server @@ -917,36 +855,51 @@ */ switch (pATI->OldHW.crtc) { - -#ifndef AVOID_CPIO - case ATI_CRTC_VGA: /* Verify vertical sync pulses are in fact occurring */ Index = 1 << 19; - while (!(inb(GENS1(pATI->CPIO_VGABase)) & 0x08U)) + while (!(inb(GENS1(pATI->CPIO_VGABase)) & 0x08U) || + (pATI->CaughtSignal >= 0)) if (Index-- <= 0) goto EnableInterrupts; Index = 1 << 19; - while (inb(GENS1(pATI->CPIO_VGABase)) & 0x08U) + while ((inb(GENS1(pATI->CPIO_VGABase)) & 0x08U) || + (pATI->CaughtSignal >= 0)) if (Index-- <= 0) goto EnableInterrupts; Index = 1 << 19; - while (!(inb(GENS1(pATI->CPIO_VGABase)) & 0x08U)) + while (!(inb(GENS1(pATI->CPIO_VGABase)) & 0x08U) || + (pATI->CaughtSignal >= 0)) if (Index-- <= 0) goto EnableInterrupts; /* Generate the count */ - for (Index = 0; Index < 8; Index++) + for (Index = 0; Index < 8; ) { - while (inb(GENS1(pATI->CPIO_VGABase)) & 0x08U) - pScreenInfo->clock[ClockIndex]++; - while (!(inb(GENS1(pATI->CPIO_VGABase)) & 0x08U)) - pScreenInfo->clock[ClockIndex]++; + int count1 = 0, count2 = 0; + + while ((inb(GENS1(pATI->CPIO_VGABase)) & 0x08U) || + (pATI->CaughtSignal >= 0)) + { + count1--; + count2 += pATI->CaughtSignal; + } + + while (!(inb(GENS1(pATI->CPIO_VGABase)) & 0x08U) || + (pATI->CaughtSignal >= 0)) + { + count1--; + count2 += pATI->CaughtSignal; + } + + if (count1 != count2) + continue; + + pScreenInfo->clock[ClockIndex] -= count1; + Index++; } break; -#endif /* AVOID_CPIO */ - case ATI_CRTC_MACH64: /* Verify vertical blanking pulses are in fact occurring */ Index = 1 << 19; @@ -977,6 +930,8 @@ } EnableInterrupts: + xf86InterceptSignals(NULL); + if (CanDisableInterrupts) xf86EnableInterrupts(); @@ -1001,8 +956,6 @@ pScreenInfo->numClocks = NumberOfClocks; -#ifndef AVOID_CPIO - if (pATI->VGAAdapter != ATI_ADAPTER_NONE) { /* Restore video state */ @@ -1011,8 +964,6 @@ pATI->OldHW.frame_buffer = NULL; } -#endif /* AVOID_CPIO */ - /* Tell user clocks were probed, instead of supplied */ pATI->OptionProbeClocks = TRUE; @@ -1021,8 +972,6 @@ SpecificationClockLine, NumberOfUndividedClocks, CalibrationClockNumber, 0); -#ifndef AVOID_CPIO - if ((pATI->Chip <= ATI_CHIP_18800) || (pATI->Adapter == ATI_ADAPTER_V4)) { @@ -1031,9 +980,6 @@ pATI->Clock = ATI_CLOCK_NONE; } else - -#endif /* AVOID_CPIO */ - { /* All others don't have crystals */ if (pATI->Clock == ATI_CLOCK_CRYSTALS) @@ -1062,12 +1008,7 @@ pATI->Clock = ATIMatchClockLine(pScreenInfo, pATI, pRange, SpecificationClockLine, NumberOfUndividedClocks, -1, 0); -#ifndef AVOID_CPIO - if (pATI->Adapter != ATI_ADAPTER_VGA) - -#endif /* AVOID_CPIO */ - { if (pATI->Clock == ATI_CLOCK_NONE) { @@ -1081,15 +1022,8 @@ { pATI->OptionProbeClocks = TRUE; } - else - -#ifndef AVOID_CPIO - - if ((pATI->Chip >= ATI_CHIP_18800) && - (pATI->Adapter != ATI_ADAPTER_V4)) - -#endif /* AVOID_CPIO */ - + else if ((pATI->Chip >= ATI_CHIP_18800) && + (pATI->Adapter != ATI_ADAPTER_V4)) { /* * Check for clocks that are specified in the wrong order. @@ -1114,9 +1048,6 @@ } else /* Ensure crystals are not matched to clock chips, and vice versa */ - -#ifndef AVOID_CPIO - if ((pATI->Chip <= ATI_CHIP_18800) || (pATI->Adapter == ATI_ADAPTER_V4)) { @@ -1124,9 +1055,6 @@ pATI->OptionProbeClocks = TRUE; } else - -#endif /* AVOID_CPIO */ - { if (pATI->Clock == ATI_CLOCK_CRYSTALS) pATI->OptionProbeClocks = TRUE; @@ -1151,19 +1079,12 @@ xf86DrvMsgVerb(pScreenInfo->scrnIndex, X_WARNING, 0, "Unknown clock generator detected.\n"); } - else - -#ifndef AVOID_CPIO - - if (pATI->Clock == ATI_CLOCK_CRYSTALS) + else if (pATI->Clock == ATI_CLOCK_CRYSTALS) { xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, "This adapter uses crystals to generate clock frequencies.\n"); } else if (pATI->Clock != ATI_CLOCK_VGA) - -#endif /* AVOID_CPIO */ - { xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, "%s clock chip detected.\n", ATIClockNames[pATI->Clock]); @@ -1245,18 +1166,12 @@ { if (pScreenInfo->vtSema && (pATI->ProgrammableClock > ATI_CLOCK_FIXED)) { - -#ifndef AVOID_CPIO - if (pATIHW->crtc == ATI_CRTC_VGA) { pATIHW->ClockMap = ATIVGAProgrammableClockMap; pATIHW->ClockUnmap = ATIVGAProgrammableClockUnmap; } else - -#endif /* AVOID_CPIO */ - { pATIHW->ClockMap = ATIProgrammableClockMap; pATIHW->ClockUnmap = ATIProgrammableClockUnmap; @@ -1264,20 +1179,11 @@ } else { - -#ifndef AVOID_CPIO - if (pATIHW->crtc != ATI_CRTC_VGA) - -#endif /* AVOID_CPIO */ - { pATIHW->ClockMap = ATIAcceleratorClockMap; pATIHW->ClockUnmap = ATIAcceleratorClockUnmap; } - -#ifndef AVOID_CPIO - else if (pATI->Chip < ATI_CHIP_68800) { pATIHW->ClockMap = ATIVGAWonderClockMap; @@ -1288,9 +1194,6 @@ pATIHW->ClockMap = ATIMachVGAClockMap; pATIHW->ClockUnmap = ATIMachVGAClockUnmap; } - -#endif /* AVOID_CPIO */ - } } @@ -1314,11 +1217,12 @@ int Frequency, Multiple; /* Used as temporaries */ /* Set default values */ - pATIHW->FeedbackDivider = pATIHW->ReferenceDivider = pATIHW->PostDivider = 0; + pATIHW->FeedbackDivider = pATIHW->ReferenceDivider = + pATIHW->PostDivider = 0; if ((pATI->ProgrammableClock <= ATI_CLOCK_FIXED) || ((pATI->ProgrammableClock == ATI_CLOCK_CH8398) && - (pMode->ClockIndex < 2))) + ((unsigned)pMode->ClockIndex < 2))) { /* Use a fixed clock */ ClockSelect = pMode->ClockIndex; @@ -1417,9 +1321,6 @@ switch (pATIHW->crtc) { - -#ifndef AVOID_CPIO - case ATI_CRTC_VGA: pATIHW->genmo = (pATIHW->genmo & 0xF3U) | ((ClockSelect << 2) & 0x0CU); @@ -1450,8 +1351,6 @@ } break; -#endif /* AVOID_CPIO */ - case ATI_CRTC_MACH64: pATIHW->clock_cntl = CLOCK_STROBE | SetBits(ClockSelect, CLOCK_SELECT | CLOCK_DIVIDER); @@ -1520,7 +1419,7 @@ break; case ATI_CLOCK_STG1703: - (void)ATIGetDACCmdReg(pATI); + (void)ATIGetDACCmdReg(pATI, (ATICRTCType)(pATIHW->crtc)); (void)in8(M64_DAC_MASK); out8(M64_DAC_MASK, (pATIHW->clock << 1) + 0x20U); out8(M64_DAC_MASK, 0); @@ -1529,14 +1428,24 @@ break; case ATI_CLOCK_CH8398: - tmp = inr(DAC_CNTL) | (DAC_EXT_SEL_RS2 | DAC_EXT_SEL_RS3); + tmp = inr(DAC_CNTL) | (DAC_EXT_SEL_RS3 | DAC_EXT_SEL_RS2); + (void)in8(M64_DAC_READ); outr(DAC_CNTL, tmp); out8(M64_DAC_WRITE, pATIHW->clock); out8(M64_DAC_DATA, SetBits(N, 0xFFU)); out8(M64_DAC_DATA, SetBits(M, 0x3FU) | SetBits(D, 0xC0U)); out8(M64_DAC_MASK, 0x04U); - outr(DAC_CNTL, tmp & ~(DAC_EXT_SEL_RS2 | DAC_EXT_SEL_RS3)); + (void)in8(M64_DAC_READ); + (void)in8(M64_DAC_WRITE); + (void)in8(M64_DAC_WRITE); + (void)in8(M64_DAC_WRITE); + (void)in8(M64_DAC_WRITE); tmp2 = in8(M64_DAC_WRITE); + (void)in8(M64_DAC_READ); + (void)in8(M64_DAC_WRITE); + (void)in8(M64_DAC_WRITE); + (void)in8(M64_DAC_WRITE); + (void)in8(M64_DAC_WRITE); out8(M64_DAC_WRITE, (tmp2 & 0x70U) | 0x80U); outr(DAC_CNTL, tmp & ~DAC_EXT_SEL_RS2); break; @@ -1571,9 +1480,9 @@ break; case ATI_CLOCK_ATT20C408: - (void)ATIGetDACCmdReg(pATI); + (void)ATIGetDACCmdReg(pATI, (ATICRTCType)(pATIHW->crtc)); tmp = in8(M64_DAC_MASK); - (void)ATIGetDACCmdReg(pATI); + (void)ATIGetDACCmdReg(pATI, (ATICRTCType)(pATIHW->crtc)); out8(M64_DAC_MASK, tmp | 1); out8(M64_DAC_WRITE, 1); out8(M64_DAC_MASK, tmp | 9); Index: xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h:1.10 xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h:1.10 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h,v 1.10 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticlock.h,v 1.11 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.c:1.17 xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.c:1.20 --- xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.c:1.17 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.c Fri Feb 24 10:31:31 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.c,v 1.17 2004/12/31 16:07:06 tsi Exp $*/ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.c,v 1.20 2006/02/24 15:31:31 tsi Exp $*/ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -111,13 +111,7 @@ # define CSync PublicOption[ATI_OPTION_CSYNC].value.bool # define Devel PrivateOption[ATI_OPTION_DEVEL].value.bool # define HWCursor PublicOption[ATI_OPTION_HWCURSOR].value.bool - -#ifndef AVOID_CPIO - # define Linear PublicOption[ATI_OPTION_LINEAR].value.bool - -#endif /* AVOID_CPIO */ - # define CacheMMIO PublicOption[ATI_OPTION_MMIO_CACHE].value.bool # define TestCacheMMIO PublicOption[ATI_OPTION_TEST_MMIO_CACHE].value.bool # define PanelDisplay PublicOption[ATI_OPTION_PANEL_DISPLAY].value.bool @@ -133,45 +127,19 @@ xf86CollectOptions(pScreenInfo, NULL); /* Set non-zero defaults */ - -#ifndef AVOID_CPIO - if (pATI->Adapter >= ATI_ADAPTER_MACH64) - -#endif /* AVOID_CPIO */ - - { - Accel = CacheMMIO = HWCursor = TRUE; - -#ifndef AVOID_CPIO - - Linear = TRUE; - -#endif /* AVOID_CPIO */ - - } + Accel = CacheMMIO = HWCursor = Linear = Blend = PanelDisplay = TRUE; ReferenceClock = ((double)157500000.0) / ((double)11.0); -#ifndef AVOID_CPIO - if (pATI->PCIInfo) - -#endif /* AVOID_CPIO */ - - { ShadowFB = TRUE; - } - - Blend = PanelDisplay = TRUE; xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options, PublicOption); xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options, PrivateOption); -#ifndef AVOID_CPIO - /* Disable linear apertures if the OS doesn't support them */ if (!xf86LinearVidMem() && Linear) { @@ -181,8 +149,6 @@ Linear = FALSE; } -#endif /* AVOID_CPIO */ - /* Move option values into driver private structure */ pATI->OptionAccel = Accel; pATI->OptionBIOSDisplay = BIOSDisplay; @@ -190,13 +156,7 @@ pATI->OptionCRTDisplay = CRTDisplay; pATI->OptionCSync = CSync; pATI->OptionDevel = Devel; - -#ifndef AVOID_CPIO - pATI->OptionLinear = Linear; - -#endif /* AVOID_CPIO */ - pATI->OptionMMIOCache = CacheMMIO; pATI->OptionTestMMIOCache = TestCacheMMIO; pATI->OptionProbeClocks = ProbeClocks; @@ -232,7 +192,7 @@ /* Only set the reference clock if it hasn't already been determined */ if (!pATI->ReferenceNumerator || !pATI->ReferenceDenominator) { - switch ((int)(ReferenceClock / ((double)100000.0))) + switch ((int)((ReferenceClock + 50000) / ((double)100000.0))) { case 143: pATI->ReferenceNumerator = 157500; @@ -244,6 +204,11 @@ pATI->ReferenceDenominator = 11; break; + case 295: + pATI->ReferenceNumerator = 324480; + pATI->ReferenceDenominator = 11; + break; + default: pATI->ReferenceNumerator = (int)(ReferenceClock / ((double)1000.0)); Index: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.h:1.7 xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.h:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.h:1.7 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.h,v 1.7 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.h,v 1.8 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c:1.25 xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c:1.27 --- xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c:1.25 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c,v 1.25 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c,v 1.27 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -62,15 +62,10 @@ pATI = ATIPTR(pScreenInfo); switch (pATI->NewHW.crtc) { - -#ifndef AVOID_CPIO - case ATI_CRTC_VGA: ATIVGASaveScreen(pATI, Mode); break; -#endif /* AVOID_CPIO */ - case ATI_CRTC_MACH64: ATIMach64SaveScreen(pATI, Mode); break; @@ -110,9 +105,6 @@ break; default: - -#ifndef AVOID_CPIO - /* Assume EGA/VGA */ ATIVGASetDPMSMode(pATI, DPMSMode); break; @@ -120,9 +112,6 @@ case ATI_ADAPTER_NONE: case ATI_ADAPTER_8514A: case ATI_ADAPTER_MACH8: - -#endif /* AVOID_CPIO */ - break; } } @@ -266,14 +255,10 @@ if (pATI->OptionShadowFB) return TRUE; -#ifndef AVOID_CPIO - /* If used, modify banking interface */ if (!miModifyBanking(pScreen, &pATI->BankInfo)) return FALSE; -#endif /* AVOID_CPIO */ - pScreenPixmap = (*pScreen->GetScreenPixmap)(pScreen); PixmapPrivate = pScreenPixmap->devPrivate; if (!PixmapPrivate.ptr) @@ -334,13 +319,9 @@ ATILeaveGraphics(pScreenInfo, pATI); -#ifndef AVOID_CPIO - xfree(pATI->OldHW.frame_buffer); xfree(pATI->NewHW.frame_buffer); -#endif /* AVOID_CPIO */ - xfree(pATI->pShadow); xfree(pATI->pDGAMode); xfree(pATI); Index: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h:1.11 xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h:1.11 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h,v 1.11 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.h,v 1.12 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h:1.10 xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h:1.10 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h,v 1.10 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticrtc.h,v 1.12 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -29,14 +29,8 @@ */ typedef enum { - -#ifndef AVOID_CPIO - ATI_CRTC_VGA, /* Use VGA CRTC */ ATI_CRTC_8514, /* Use 8514/Mach8/Mach32 accelerator CRTC */ - -#endif /* AVOID_CPIO */ - ATI_CRTC_MACH64 /* Use Mach64 accelerator CRTC */ } ATICRTCType; Index: xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.c:1.6 xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.c:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.c:1.6 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.c,v 1.6 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.c,v 1.7 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2001 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2001 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.h:1.5 xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.h:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.h:1.5 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.h,v 1.5 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticursor.h,v 1.6 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2001 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2001 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c:1.20 xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c:1.24 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c:1.20 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c,v 1.20 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c,v 1.24 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -57,12 +57,13 @@ {ATI_DAC_UNKNOWN, "Unknown"} /* Must be last */ }; -#ifndef AVOID_CPIO - /* * ATISetDACIOPorts -- * - * This function sets up DAC access I/O port numbers. + * This function sets up DAC access I/O port numbers. It is important there be + * no side-effects when reading the CPIO_DAC_WAIT port. The current settings + * might need to be changed should they end up interfering with accessing + * certain RAMDACs. */ void ATISetDACIOPorts @@ -78,7 +79,7 @@ pATI->CPIO_DAC_MASK = VGA_DAC_MASK; pATI->CPIO_DAC_READ = VGA_DAC_READ; pATI->CPIO_DAC_WRITE = VGA_DAC_WRITE; - pATI->CPIO_DAC_WAIT = GENS1(pATI->CPIO_VGABase); + pATI->CPIO_DAC_WAIT = GENENB; break; case ATI_CRTC_8514: @@ -90,11 +91,12 @@ break; case ATI_CRTC_MACH64: + /* This is no longer used, but is kept for reference */ pATI->CPIO_DAC_DATA = ATIIOPort(DAC_REGS) + 1; pATI->CPIO_DAC_MASK = ATIIOPort(DAC_REGS) + 2; pATI->CPIO_DAC_READ = ATIIOPort(DAC_REGS) + 3; pATI->CPIO_DAC_WRITE = ATIIOPort(DAC_REGS) + 0; - pATI->CPIO_DAC_WAIT = pATI->CPIOBase; + pATI->CPIO_DAC_WAIT = pATI->CPIO_DAC_MASK; break; default: @@ -102,8 +104,6 @@ } } -#endif /* AVOID_CPIO */ - /* * ATIGetDACCmdReg -- * @@ -112,28 +112,26 @@ CARD8 ATIGetDACCmdReg ( - ATIPtr pATI + ATIPtr pATI, + ATICRTCType crtc ) { + switch (crtc) + { + case ATI_CRTC_MACH64: + (void)in8(M64_DAC_WRITE); /* Reset to PEL mode */ + (void)in8(M64_DAC_MASK); + (void)in8(M64_DAC_MASK); + (void)in8(M64_DAC_MASK); + return in8(M64_DAC_MASK); -#ifdef AVOID_CPIO - - (void)in8(M64_DAC_WRITE); /* Reset to PEL mode */ - (void)in8(M64_DAC_MASK); - (void)in8(M64_DAC_MASK); - (void)in8(M64_DAC_MASK); - return in8(M64_DAC_MASK); - -#else /* AVOID_CPIO */ - - (void)inb(pATI->CPIO_DAC_WRITE); /* Reset to PEL mode */ - (void)inb(pATI->CPIO_DAC_MASK); - (void)inb(pATI->CPIO_DAC_MASK); - (void)inb(pATI->CPIO_DAC_MASK); - return inb(pATI->CPIO_DAC_MASK); - -#endif /* AVOID_CPIO */ - + default: + (void)inb(pATI->CPIO_DAC_WRITE); /* Reset to PEL mode */ + (void)inb(pATI->CPIO_DAC_MASK); + (void)inb(pATI->CPIO_DAC_MASK); + (void)inb(pATI->CPIO_DAC_MASK); + return inb(pATI->CPIO_DAC_MASK); + } } /* @@ -159,6 +157,7 @@ * Set colour lookup table. The first entry has already been zeroed out. */ if (pATI->depth > 8) + { for (Index = 1; Index < (NumberOf(pATIHW->lut) / 3); Index++) { Index2 = Index * 3; @@ -166,6 +165,7 @@ pATIHW->lut[Index2 + 1] = pATIHW->lut[Index2 + 2] = Index; } + } else { /* @@ -182,8 +182,6 @@ pATIHW->lut[Index2 + 2] = maxColour; } -#ifndef AVOID_CPIO - if (pATI->depth == 1) { rgb blackColour = pScreenInfo->display->blackColour, @@ -227,9 +225,6 @@ pATIHW->lut[Index + 1] = pATIHW->lut[Index + 2] = 0x00U; } - -#endif /* AVOID_CPIO */ - } } @@ -248,60 +243,60 @@ { int Index; -#ifdef AVOID_CPIO - - pATIHW->dac_read = in8(M64_DAC_READ); - DACDelay; - pATIHW->dac_write = in8(M64_DAC_WRITE); - DACDelay; - pATIHW->dac_mask = in8(M64_DAC_MASK); - DACDelay; - - /* Save DAC's colour lookup table */ - out8(M64_DAC_MASK, 0xFFU); - DACDelay; - out8(M64_DAC_READ, 0x00U); - DACDelay; - for (Index = 0; Index < NumberOf(pATIHW->lut); Index++) + switch (pATIHW->crtc) { - pATIHW->lut[Index] = in8(M64_DAC_DATA); - DACDelay; - } + case ATI_CRTC_MACH64: + pATIHW->dac_read = in8(M64_DAC_READ); + DACDelay(in8(M64_DAC_WAIT)); + pATIHW->dac_write = in8(M64_DAC_WRITE); + DACDelay(in8(M64_DAC_WAIT)); + pATIHW->dac_mask = in8(M64_DAC_MASK); + DACDelay(in8(M64_DAC_WAIT)); + + /* Save DAC's colour lookup table */ + out8(M64_DAC_MASK, 0xFFU); + DACDelay(in8(M64_DAC_WAIT)); + out8(M64_DAC_READ, 0x00U); + DACDelay(in8(M64_DAC_WAIT)); + for (Index = 0; Index < NumberOf(pATIHW->lut); Index++) + { + pATIHW->lut[Index] = in8(M64_DAC_DATA); + DACDelay(in8(M64_DAC_WAIT)); + } - out8(M64_DAC_MASK, pATIHW->dac_mask); - DACDelay; - out8(M64_DAC_READ, pATIHW->dac_read); - DACDelay; - -#else /* AVOID_CPIO */ - - ATISetDACIOPorts(pATI, pATIHW->crtc); - - pATIHW->dac_read = inb(pATI->CPIO_DAC_READ); - DACDelay; - pATIHW->dac_write = inb(pATI->CPIO_DAC_WRITE); - DACDelay; - pATIHW->dac_mask = inb(pATI->CPIO_DAC_MASK); - DACDelay; - - /* Save DAC's colour lookup table */ - outb(pATI->CPIO_DAC_MASK, 0xFFU); - DACDelay; - outb(pATI->CPIO_DAC_READ, 0x00U); - DACDelay; - for (Index = 0; Index < NumberOf(pATIHW->lut); Index++) - { - pATIHW->lut[Index] = inb(pATI->CPIO_DAC_DATA); - DACDelay; - } + out8(M64_DAC_MASK, pATIHW->dac_mask); + DACDelay(in8(M64_DAC_WAIT)); + out8(M64_DAC_READ, pATIHW->dac_read); + DACDelay(in8(M64_DAC_WAIT)); + break; - outb(pATI->CPIO_DAC_MASK, pATIHW->dac_mask); - DACDelay; - outb(pATI->CPIO_DAC_READ, pATIHW->dac_read); - DACDelay; + default: + ATISetDACIOPorts(pATI, (ATICRTCType)(pATIHW->crtc)); -#endif /* AVOID_CPIO */ + pATIHW->dac_read = inb(pATI->CPIO_DAC_READ); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + pATIHW->dac_write = inb(pATI->CPIO_DAC_WRITE); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + pATIHW->dac_mask = inb(pATI->CPIO_DAC_MASK); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + + /* Save DAC's colour lookup table */ + outb(pATI->CPIO_DAC_MASK, 0xFFU); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + outb(pATI->CPIO_DAC_READ, 0x00U); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + for (Index = 0; Index < NumberOf(pATIHW->lut); Index++) + { + pATIHW->lut[Index] = inb(pATI->CPIO_DAC_DATA); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + } + outb(pATI->CPIO_DAC_MASK, pATIHW->dac_mask); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + outb(pATI->CPIO_DAC_READ, pATIHW->dac_read); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + break; + } } /* @@ -318,50 +313,89 @@ { int Index; -#ifdef AVOID_CPIO - - /* Load DAC's colour lookup table */ - out8(M64_DAC_MASK, 0xFFU); - DACDelay; - out8(M64_DAC_WRITE, 0x00U); - DACDelay; - for (Index = 0; Index < NumberOf(pATIHW->lut); Index++) + switch (pATIHW->crtc) { - out8(M64_DAC_DATA, pATIHW->lut[Index]); - DACDelay; - } + case ATI_CRTC_MACH64: + /* Load DAC's colour lookup table */ + out8(M64_DAC_MASK, 0xFFU); + DACDelay(in8(M64_DAC_WAIT)); + out8(M64_DAC_WRITE, 0x00U); + DACDelay(in8(M64_DAC_WAIT)); + for (Index = 0; Index < NumberOf(pATIHW->lut); Index++) + { + out8(M64_DAC_DATA, pATIHW->lut[Index]); + DACDelay(in8(M64_DAC_WAIT)); + } - out8(M64_DAC_MASK, pATIHW->dac_mask); - DACDelay; - out8(M64_DAC_READ, pATIHW->dac_read); - DACDelay; - out8(M64_DAC_WRITE, pATIHW->dac_write); - DACDelay; - -#else /* AVOID_CPIO */ - - ATISetDACIOPorts(pATI, pATIHW->crtc); - - /* Load DAC's colour lookup table */ - outb(pATI->CPIO_DAC_MASK, 0xFFU); - DACDelay; - outb(pATI->CPIO_DAC_WRITE, 0x00U); - DACDelay; - for (Index = 0; Index < NumberOf(pATIHW->lut); Index++) - { - outb(pATI->CPIO_DAC_DATA, pATIHW->lut[Index]); - DACDelay; - } + out8(M64_DAC_MASK, pATIHW->dac_mask); + DACDelay(in8(M64_DAC_WAIT)); + out8(M64_DAC_READ, pATIHW->dac_read); + DACDelay(in8(M64_DAC_WAIT)); + out8(M64_DAC_WRITE, pATIHW->dac_write); + DACDelay(in8(M64_DAC_WAIT)); + break; - outb(pATI->CPIO_DAC_MASK, pATIHW->dac_mask); - DACDelay; - outb(pATI->CPIO_DAC_READ, pATIHW->dac_read); - DACDelay; - outb(pATI->CPIO_DAC_WRITE, pATIHW->dac_write); - DACDelay; + default: + ATISetDACIOPorts(pATI, (ATICRTCType)(pATIHW->crtc)); -#endif /* AVOID_CPIO */ + /* Load DAC's colour lookup table */ + outb(pATI->CPIO_DAC_MASK, 0xFFU); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + outb(pATI->CPIO_DAC_WRITE, 0x00U); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + for (Index = 0; Index < NumberOf(pATIHW->lut); Index++) + { + outb(pATI->CPIO_DAC_DATA, pATIHW->lut[Index]); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + } + outb(pATI->CPIO_DAC_MASK, pATIHW->dac_mask); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + outb(pATI->CPIO_DAC_READ, pATIHW->dac_read); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + outb(pATI->CPIO_DAC_WRITE, pATIHW->dac_write); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + break; + } +} + +/* + * ATISetLUTEntry -- + * + * This function is called to set one of a DAC's LUT entries. + */ +static void +ATISetLUTEntry +( + ATIPtr pATI, + int Index, + CARD8 *LUTEntry +) +{ + switch (pATI->NewHW.crtc) + { + case ATI_CRTC_MACH64: + out8(M64_DAC_WRITE, Index); + DACDelay(in8(M64_DAC_WAIT)); + out8(M64_DAC_DATA, LUTEntry[0]); + DACDelay(in8(M64_DAC_WAIT)); + out8(M64_DAC_DATA, LUTEntry[1]); + DACDelay(in8(M64_DAC_WAIT)); + out8(M64_DAC_DATA, LUTEntry[2]); + DACDelay(in8(M64_DAC_WAIT)); + break; + + default: + outb(pATI->CPIO_DAC_WRITE, Index); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + outb(pATI->CPIO_DAC_DATA, LUTEntry[0]); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + outb(pATI->CPIO_DAC_DATA, LUTEntry[1]); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + outb(pATI->CPIO_DAC_DATA, LUTEntry[2]); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + break; + } } /* @@ -445,35 +479,8 @@ for (Index = 0; Index < (SizeOf(pATI->NewHW.lut) / 3); Index += i, LUTEntry += i * 3) - { - if (!fChanged[Index]) - continue; - -#ifdef AVOID_CPIO - - out8(M64_DAC_WRITE, Index); - DACDelay; - out8(M64_DAC_DATA, LUTEntry[0]); - DACDelay; - out8(M64_DAC_DATA, LUTEntry[1]); - DACDelay; - out8(M64_DAC_DATA, LUTEntry[2]); - DACDelay; - -#else /* AVOID_CPIO */ - - outb(pATI->CPIO_DAC_WRITE, Index); - DACDelay; - outb(pATI->CPIO_DAC_DATA, LUTEntry[0]); - DACDelay; - outb(pATI->CPIO_DAC_DATA, LUTEntry[1]); - DACDelay; - outb(pATI->CPIO_DAC_DATA, LUTEntry[2]); - DACDelay; - -#endif /* AVOID_CPIO */ - - } + if (fChanged[Index]) + ATISetLUTEntry(pATI, Index, LUTEntry); } } else @@ -490,33 +497,7 @@ LUTEntry[2] = Colours[Index].blue; if (pScreenInfo->vtSema || pATI->currentMode) - { - -#ifdef AVOID_CPIO - - out8(M64_DAC_WRITE, Index); - DACDelay; - out8(M64_DAC_DATA, LUTEntry[0]); - DACDelay; - out8(M64_DAC_DATA, LUTEntry[1]); - DACDelay; - out8(M64_DAC_DATA, LUTEntry[2]); - DACDelay; - -#else /* AVOID_CPIO */ - - outb(pATI->CPIO_DAC_WRITE, Index); - DACDelay; - outb(pATI->CPIO_DAC_DATA, LUTEntry[0]); - DACDelay; - outb(pATI->CPIO_DAC_DATA, LUTEntry[1]); - DACDelay; - outb(pATI->CPIO_DAC_DATA, LUTEntry[2]); - DACDelay; - -#endif /* AVOID_CPIO */ - - } + ATISetLUTEntry(pATI, Index, LUTEntry); } } } Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h:1.17 xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h:1.19 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h:1.17 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h,v 1.17 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.h,v 1.19 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -73,31 +73,23 @@ ATI_DAC_MAX_SUBTYPE) extern const SymTabRec ATIDACDescriptors[]; -#ifdef AVOID_CPIO +#define DACDelay(IODelay) \ + do \ + { \ + (void)IODelay; \ + (void)IODelay; \ + } while (0) + +extern void ATISetDACIOPorts FunctionPrototype((ATIPtr, ATICRTCType)); + +extern CARD8 ATIGetDACCmdReg FunctionPrototype((ATIPtr, ATICRTCType)); + +extern void ATIDACPreInit FunctionPrototype((ScrnInfoPtr, ATIPtr, + ATIHWPtr)); +extern void ATIDACSave FunctionPrototype((ATIPtr, ATIHWPtr)); +extern void ATIDACSet FunctionPrototype((ATIPtr, ATIHWPtr)); -# define DACDelay /* Nothing */ - -#else /* AVOID_CPIO */ - -# define DACDelay \ - do \ - { \ - (void)inb(pATI->CPIO_DAC_WAIT); \ - (void)inb(pATI->CPIO_DAC_WAIT); \ - } while (0) - - extern void ATISetDACIOPorts FunctionPrototype((ATIPtr, ATICRTCType)); - -#endif /* AVOID_CPIO */ - -extern CARD8 ATIGetDACCmdReg FunctionPrototype((ATIPtr)); - -extern void ATIDACPreInit FunctionPrototype((ScrnInfoPtr, ATIPtr, - ATIHWPtr)); -extern void ATIDACSave FunctionPrototype((ATIPtr, ATIHWPtr)); -extern void ATIDACSet FunctionPrototype((ATIPtr, ATIHWPtr)); - -extern void ATILoadPalette FunctionPrototype((ScrnInfoPtr, int, int *, - LOCO *, VisualPtr)); +extern void ATILoadPalette FunctionPrototype((ScrnInfoPtr, int, int *, + LOCO *, VisualPtr)); #endif /* ___ATIDAC_H___ */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.c:1.3 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.c,v 1.3 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.c,v 1.4 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.h:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.h:1.3 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.h,v 1.3 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidecoder.h,v 1.4 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c:1.14 xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c:1.16 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c:1.14 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c,v 1.14 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.c,v 1.16 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -395,9 +395,6 @@ if (!pATI->nDGAMode) { - -#ifndef AVOID_CPIO - /* * Contrary to previous extension versions, DGA 2 does not support * banked framebuffers. Also, disable DGA when non-DGA server modes @@ -406,8 +403,6 @@ if (pATI->BankInfo.BankSize || (pScreenInfo->depth <= 4)) return FALSE; -#endif /* AVOID_CPIO */ - /* Set up DGA callbacks */ pATI->ATIDGAFunctions.OpenFramebuffer = ATIDGAOpenFramebuffer; pATI->ATIDGAFunctions.SetMode = ATIDGASetMode; Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h:1.10 xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h:1.10 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h,v 1.10 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidga.h,v 1.11 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c:1.23 xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c:1.26 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c:1.23 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c Fri Feb 17 12:01:39 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c,v 1.23 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.c,v 1.26 2006/02/17 17:01:39 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -220,26 +220,14 @@ pATI->ClockDescriptor.PostDividers[pATIHW->PostDivider]; Divider = pATIHW->FeedbackDivider * pATI->XCLKReferenceDivider; -#ifndef AVOID_CPIO - if (pATI->depth >= 8) - -#endif /* AVOID_CPIO */ - - { Divider *= pATI->bitsPerPixel / 4; - } /* Start by assuming a display FIFO width of 64 bits */ vshift = (6 - 2) - pATI->XCLKPostDivider; - -#ifndef AVOID_CPIO - if (pATIHW->crtc == ATI_CRTC_VGA) vshift--; /* Nope, it's 32 bits wide */ -#endif /* AVOID_CPIO */ - if (pATI->OptionPanelDisplay && (pATI->LCDPanelID >= 0)) { /* Compensate for horizontal stretching */ @@ -267,9 +255,6 @@ vshift, -1) - ATIDivide(1, 1, vshift - xshift, 1); /* Next is dsp_on */ - -#ifndef AVOID_CPIO - if ((pATIHW->crtc == ATI_CRTC_VGA) /* && (dsp_precision < 3) */) { /* @@ -279,9 +264,6 @@ dsp_on = ATIDivide(Multiplier * 5, Divider, vshift + 2, 1); } else - -#endif /* AVOID_CPIO */ - { dsp_on = ATIDivide(Multiplier, Divider, vshift, 1); tmp = ATIDivide(RASMultiplier, RASDivider, xshift, 1); @@ -297,8 +279,17 @@ if (dsp_on >= ((dsp_off / (tmp + 1)) * (tmp + 1))) { - dsp_on = dsp_off - ATIDivide(Multiplier, Divider, vshift, -1); - dsp_on = (dsp_on / (tmp + 1)) * (tmp + 1); + /* + * dsp_on represents somewhat of a minimum, so first try moving dsp_off + * forward. + */ + dsp_off = ATIDivide(Multiplier * (pATI->DisplayFIFODepth - 1), Divider, + vshift, 1); + if (dsp_on >= ((dsp_off / (tmp + 1)) * (tmp + 1))) + { + dsp_on = dsp_off - ATIDivide(Multiplier, Divider, vshift, -1); + dsp_on = (dsp_on / (tmp + 1)) * (tmp + 1); + } } /* Last but not least: dsp_xclks */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h:1.12 xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h:1.13 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h:1.12 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h,v 1.12 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidsp.h,v 1.13 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiendian.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/ati/atiendian.c:1.5 --- /dev/null Tue May 9 21:56:44 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiendian.c Thu Jan 5 13:55:29 2006 @@ -0,0 +1,85 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiendian.c,v 1.5 2006/01/05 18:55:29 tsi Exp $ */ +/* + * Copyright 2005 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * + * 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 Marc Aurele La France not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. Marc Aurele La France makes no representations + * about the suitability of this software for any purpose. It is provided + * "as-is" without express or implied warranty. + * + * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL MARC AURELE LA FRANCE 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. + */ + +#include "atiendian.h" + +/* + * Definitions related to endianness. + */ +const ATIEndianType ATIEndian = +{ + {0x01U, 0x23U, 0x45U, 0x67U} +}; + +/* + * ATIEndianCopy -- + * + * This function applies a null endianness transformation on an integer. + */ +int +ATIEndianCopy +( + const int value +) +{ + return value; +} + +/* + * ATIEndianSwap -- + * + * This function applies a big-endian transformation on a 32-bit value. + */ +int +ATIEndianSwap32 +( + const int value +) +{ + union + { + unsigned int word; + unsigned char byte[4]; + } copy; + + copy.word = (unsigned int)value; + return (int)((((((copy.byte[3] << 8) | + copy.byte[2]) << 8) | + copy.byte[1]) << 8) | + copy.byte[0]); +} + +/* + * ATIEndianSwap24 -- + * + * This function applies a big-endian transformation on a 24-bit value. + */ +int +ATIEndianSwap24 +( + const int value +) +{ + return ((value & 0x000000FFU) << 16) | (value & 0x0000FF00U) | + ((value & 0x00FF0000U) >> 16); +} Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiendian.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/ati/atiendian.h:1.4 --- /dev/null Tue May 9 21:56:44 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiendian.h Thu Jan 5 13:55:29 2006 @@ -0,0 +1,49 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiendian.h,v 1.4 2006/01/05 18:55:29 tsi Exp $ */ +/* + * Copyright 2005 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * + * 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 Marc Aurele La France not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. Marc Aurele La France makes no representations + * about the suitability of this software for any purpose. It is provided + * "as-is" without express or implied warranty. + * + * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL MARC AURELE LA FRANCE 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. + */ + +#ifndef ___ATIENDIAN_H___ +#define ___ATIENDIAN_H___ 1 + +#include "atiproto.h" + +/* + * Declarations related to endianness. + */ +typedef union +{ + const unsigned char byte[4]; + const unsigned int endian; +} ATIEndianType; + +extern const ATIEndianType ATIEndian; + +#define ATI_LITTLE_ENDIAN 0x67452301U +#define ATI_BIG_ENDIAN 0x01234567U + +typedef int ATIApplyEndianProc FunctionPrototype((const int)); + +extern ATIApplyEndianProc ATIEndianCopy; +extern ATIApplyEndianProc ATIEndianSwap32; +extern ATIApplyEndianProc ATIEndianSwap24; + +#endif /* ___ATIENDIAN_H___ */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.c:1.5 xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.c:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.c:1.5 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.c,v 1.5 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.c,v 1.7 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -347,7 +347,7 @@ switch (pATI->Adapter) { case ATI_ADAPTER_MACH64: - if (!ATILoadModule(pScreenInfo, "i2c", ATIi2cSymbols)) + if (!ATILoadSubModule(pScreenInfo, "i2c", ATIi2cSymbols)) return; ATIMach64I2CPreInit(pScreenInfo, pATI); Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.h:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.h:1.3 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.h,v 1.3 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atii2c.h,v 1.4 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c:1.13 xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c:1.15 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c:1.13 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c,v 1.13 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.c,v 1.15 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -32,18 +32,12 @@ const char *ATIChipsetNames[] = { "ati", - -#ifndef AVOID_CPIO - "ativga", "ibmvga", "ibm8514", "vgawonder", "mach8", "mach32", - -#endif /* AVOID_CPIO */ - "mach64", "rage128", "radeon" @@ -52,9 +46,6 @@ static SymTabRec ATIPublicChipsetNames[] = { {ATI_CHIPSET_ATI, "ati"}, - -#ifndef AVOID_CPIO - {ATI_CHIPSET_ATIVGA, "ativga"}, #ifdef __MAYBE_NOT__ {ATI_CHIPSET_IBMVGA, "ibmvga"}, @@ -62,9 +53,6 @@ #ifdef __NOT_YET__ {ATI_CHIPSET_IBM8514, "ibm8514"}, #endif - -#endif /* AVOID_CPIO */ - {-1, NULL} }; @@ -104,17 +92,11 @@ static SymTabRec SpecificNames[] = { - -#ifndef AVOID_CPIO - {ATI_CHIPSET_VGAWONDER, "vgawonder"}, #ifdef __NOT_YET__ {ATI_CHIPSET_MACH8, "mach8"}, #endif {ATI_CHIPSET_MACH32, "mach32"}, - -#endif /* AVOID_CPIO */ - {ATI_CHIPSET_MACH64, "mach64"}, {ATI_CHIPSET_RAGE128, "rage128"}, {ATI_CHIPSET_RADEON, "radeon"}, Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h:1.12 xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h:1.14 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h:1.12 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h,v 1.12 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiident.h,v 1.14 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -29,18 +29,12 @@ typedef enum { ATI_CHIPSET_ATI, - -#ifndef AVOID_CPIO - ATI_CHIPSET_ATIVGA, ATI_CHIPSET_IBMVGA, ATI_CHIPSET_IBM8514, ATI_CHIPSET_VGAWONDER, ATI_CHIPSET_MACH8, ATI_CHIPSET_MACH32, - -#endif /* AVOID_CPIO */ - ATI_CHIPSET_MACH64, ATI_CHIPSET_RAGE128, ATI_CHIPSET_RADEON, Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h:1.16 xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h:1.18 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h:1.16 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h,v 1.16 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiio.h,v 1.18 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -38,11 +38,10 @@ typedef enum { SPARSE_IO, - BLOCK_IO + BLOCK_IO, + MEMORY_IO } ATIIODecodingType; -#ifndef AVOID_CPIO - /* Wait until "n" queue entries are free */ #define ibm8514WaitQueue(_n) \ { \ @@ -78,6 +77,4 @@ while (!(inw(GP_STAT) & DATARDY)); \ } -#endif /* AVOID_CPIO */ - #endif /* ___ATIIO_H___ */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.c:1.18 xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.c:1.23 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.c:1.18 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.c Thu Mar 16 11:49:58 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.c,v 1.18 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.c,v 1.23 2006/03/16 16:49:58 dawes Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -28,6 +28,8 @@ #include "atiload.h" #include "atistruct.h" +#include "vbe.h" + /* * All symbol lists belong here. They are externalised so that they can be * referenced elsewhere. Note the naming convention for these things... @@ -56,8 +58,6 @@ NULL }; -#ifndef AVOID_CPIO - const char *ATIxf1bppSymbols[] = { "xf1bppScreenInit", @@ -70,8 +70,6 @@ NULL }; -#endif /* AVOID_CPIO */ - const char *ATIfbSymbols[] = { "fbPictureInit", @@ -114,34 +112,53 @@ }; /* - * ATILoadModule -- + * ATILoadSubModule -- * * Load a specific module and register with the loader those of its entry * points that are referenced by this driver. */ -pointer -ATILoadModule +ModuleDescPtr +ATILoadSubModule ( ScrnInfoPtr pScreenInfo, const char *Module, const char **SymbolList ) { - pointer pModule = xf86LoadSubModule(pScreenInfo, Module); + ModuleDescPtr pModule = xf86LoadSubModule(pScreenInfo, Module); + + if (pModule) + xf86LoaderModReqSymLists(pModule, SymbolList, NULL); + + return pModule; +} + +/* + * ATILoadVBEModule -- + * + * A variant of ATILoadSubModule() specifically for loading the 'vbe' module. + */ +ModuleDescPtr +ATILoadVBEModule +( + ScrnInfoPtr pScreenInfo +) +{ + ModuleDescPtr pModule = xf86LoadVBEModule(pScreenInfo); if (pModule) - xf86LoaderReqSymLists(SymbolList, NULL); + xf86LoaderModReqSymLists(pModule, ATIvbeSymbols, NULL); return pModule; } /* - * ATILoadModules -- + * ATILoadSubModules -- * * This function loads other modules required for a screen. */ -pointer -ATILoadModules +ModuleDescPtr +ATILoadSubModules ( ScrnInfoPtr pScreenInfo, ATIPtr pATI @@ -149,38 +166,33 @@ { /* Load shadow frame buffer code if needed */ if (pATI->OptionShadowFB && - !ATILoadModule(pScreenInfo, "shadowfb", ATIshadowfbSymbols)) + !ATILoadSubModule(pScreenInfo, "shadowfb", ATIshadowfbSymbols)) return NULL; /* Load XAA if needed */ if (pATI->OptionAccel && - !ATILoadModule(pScreenInfo, "xaa", ATIxaaSymbols)) + !ATILoadSubModule(pScreenInfo, "xaa", ATIxaaSymbols)) return NULL; /* Load ramdac module if needed */ if ((pATI->Cursor > ATI_CURSOR_SOFTWARE) && - !ATILoadModule(pScreenInfo, "ramdac", ATIramdacSymbols)) + !ATILoadSubModule(pScreenInfo, "ramdac", ATIramdacSymbols)) return NULL; /* Load depth-specific entry points */ switch (pATI->bitsPerPixel) { - -#ifndef AVOID_CPIO - case 1: - return ATILoadModule(pScreenInfo, "xf1bpp", ATIxf1bppSymbols); + return ATILoadSubModule(pScreenInfo, "xf1bpp", ATIxf1bppSymbols); case 4: - return ATILoadModule(pScreenInfo, "xf4bpp", ATIxf4bppSymbols); - -#endif /* AVOID_CPIO */ + return ATILoadSubModule(pScreenInfo, "xf4bpp", ATIxf4bppSymbols); case 8: case 16: case 24: case 32: - return ATILoadModule(pScreenInfo, "fb", ATIfbSymbols); + return ATILoadSubModule(pScreenInfo, "fb", ATIfbSymbols); default: return NULL; Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.h:1.8 xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.h:1.13 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.h:1.8 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.h Sun Mar 19 14:06:34 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.h,v 1.8 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.h,v 1.13 2006/03/19 19:06:34 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -32,24 +32,22 @@ #include "xf86str.h" extern const char *ATIint10Symbols[], *ATIddcSymbols[], *ATIvbeSymbols[], + *ATIxf1bppSymbols[], *ATIxf4bppSymbols[], *ATIfbSymbols[], + *ATIshadowfbSymbols[], *ATIxaaSymbols[], *ATIramdacSymbols[], + *ATIi2cSymbols[]; + +extern ModuleDescPtr ATILoadSubModule FunctionPrototype((ScrnInfoPtr, + const char *, + const char **)); +extern ModuleDescPtr ATILoadVBEModule FunctionPrototype((ScrnInfoPtr)); -#ifndef AVOID_CPIO - - *ATIxf1bppSymbols[], *ATIxf4bppSymbols[], - -#endif /* AVOID_CPIO */ - - *ATIfbSymbols[], *ATIshadowfbSymbols[], *ATIxaaSymbols[], - *ATIramdacSymbols[], *ATIi2cSymbols[]; - -extern pointer ATILoadModule FunctionPrototype((ScrnInfoPtr, const char *, - const char **)); -extern pointer ATILoadModules FunctionPrototype((ScrnInfoPtr, ATIPtr)); +extern ModuleDescPtr ATILoadSubModules FunctionPrototype((ScrnInfoPtr, ATIPtr)); #else /* XFree86LOADER */ -#define ATILoadModule(pScreenInfo, Module, SymboList) ((pointer)1) -#define ATILoadModules(pScreenInfo, pATI) ((pointer)1) +#define ATILoadSubModule(pScreenInfo, Module, SymbolList) ((pointer)1) +#define ATILoadVBEModule(pScreenInfo) ((pointer)1) +#define ATILoadSubModules(pScreenInfo, pATI) ((pointer)1) #endif /* XFree86LOADER */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c:1.23 xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c:1.25 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c:1.23 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c,v 1.23 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c,v 1.25 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1999 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -40,20 +40,12 @@ ATIPtr pATI ) { - CARD32 tmp; - -#ifndef AVOID_CPIO - - CARD32 saved_lcd_gen_ctrl = 0, lcd_gen_ctrl = 0; - -#endif /* AVOID_CPIO */ + CARD32 saved_lcd_gen_ctrl = 0, lcd_gen_ctrl = 0, tmp; if (pATI->Unlocked) return; pATI->Unlocked = TRUE; -#ifndef AVOID_CPIO - if (pATI->ChipHasSUBSYS_CNTL) { /* Save register values to be modified */ @@ -92,9 +84,6 @@ ProbeWaitIdleEmpty(); } else if (pATI->Chip >= ATI_CHIP_88800GXC) - -#endif /* AVOID_CPIO */ - { /* Reset everything */ pATI->LockData.bus_cntl = inr(BUS_CNTL); @@ -161,15 +150,10 @@ if (pATI->Chip >= ATI_CHIP_264CT) tmp &= ~DAC_FEA_CON_EN; -#ifndef AVOID_CPIO - /* Ensure VGA aperture is enabled */ pATI->LockData.config_cntl = inr(CONFIG_CNTL); tmp |= DAC_VGA_ADR_EN; outr(CONFIG_CNTL, pATI->LockData.config_cntl & ~CFG_VGA_DIS); - -#endif /* AVOID_CPIO */ - outr(DAC_CNTL, tmp); if (pATI->Chip >= ATI_CHIP_264VTB) @@ -202,9 +186,6 @@ } } } - -#ifndef AVOID_CPIO - } if (pATI->VGAAdapter != ATI_ADAPTER_NONE) @@ -400,9 +381,6 @@ out8(LCD_INDEX, GetByte(pATI->LockData.lcd_index, 0)); } } - -#endif /* AVOID_CPIO */ - } } @@ -417,19 +395,12 @@ ATIPtr pATI ) { - -#ifndef AVOID_CPIO - CARD32 tmp, saved_lcd_gen_ctrl = 0, lcd_gen_ctrl = 0; -#endif /* AVOID_CPIO */ - if (!pATI->Unlocked) return; pATI->Unlocked = FALSE; -#ifndef AVOID_CPIO - if (pATI->VGAAdapter != ATI_ADAPTER_NONE) { if (pATI->LCDPanelID >= 0) @@ -537,9 +508,6 @@ ProbeWaitIdleEmpty(); } else if (pATI->Chip >= ATI_CHIP_88800GXC) - -#endif /* AVOID_CPIO */ - { /* Reset everything */ outr(BUS_CNTL, pATI->LockData.bus_cntl); @@ -550,16 +518,18 @@ outr(GEN_TEST_CNTL, pATI->LockData.gen_test_cntl); outr(GEN_TEST_CNTL, pATI->LockData.gen_test_cntl | GEN_GUI_EN); + /* + * Work around for yet another atyfb bug... If composite sync was in + * effect for server video modes, ensure it is also in effect in the + * mode on entry/exit. + */ + if (pATI->OptionCSync) + pATI->LockData.crtc_gen_cntl |= CRTC_CSYNC_EN; + outr(CRTC_GEN_CNTL, pATI->LockData.crtc_gen_cntl | CRTC_EN); outr(CRTC_GEN_CNTL, pATI->LockData.crtc_gen_cntl); outr(CRTC_GEN_CNTL, pATI->LockData.crtc_gen_cntl | CRTC_EN); - -#ifndef AVOID_CPIO - outr(CONFIG_CNTL, pATI->LockData.config_cntl); - -#endif /* AVOID_CPIO */ - outr(DAC_CNTL, pATI->LockData.dac_cntl); if (pATI->Chip < ATI_CHIP_264CT) outr(MEM_CNTL, pATI->LockData.mem_cntl); Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h:1.7 xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h:1.7 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h,v 1.7 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.h,v 1.8 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1999 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c:1.54 xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c:1.59 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c:1.54 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c Fri Feb 17 12:01:39 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c,v 1.54 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c,v 1.59 2006/02/17 17:01:39 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -30,10 +30,9 @@ #include "atimach64io.h" #include "atirgb514.h" -#ifndef DPMS_SERVER -# define DPMS_SERVER -#endif -#include "extensions/dpms.h" +#undef DPMS_SERVER +#define DPMS_SERVER 1 +#include <X11/extensions/dpms.h> /* * ATIMach64PreInit -- @@ -52,19 +51,10 @@ CARD32 bus_cntl, config_cntl; int tmp; -#ifndef AVOID_CPIO - if (pATI->depth <= 4) - { pATIHW->crtc_off_pitch = SetBits(pATI->displayWidth >> 4, CRTC_PITCH); - } else - -#endif /* AVOID_CPIO */ - - { pATIHW->crtc_off_pitch = SetBits(pATI->displayWidth >> 3, CRTC_PITCH); - } if ((pATI->LockData.crtc_gen_cntl & CRTC_CSYNC_EN) && !pATI->OptionCSync) { @@ -93,22 +83,11 @@ if (pATI->Chip >= ATI_CHIP_264VT) pATIHW->bus_cntl |= BUS_EXT_REG_EN; /* Enable Block 1 */ -#ifdef AVOID_CPIO - - pATIHW->mem_vga_wp_sel = SetBits(0, MEM_VGA_WPS0) | - SetBits(1, MEM_VGA_WPS1); - pATIHW->mem_vga_rp_sel = SetBits(0, MEM_VGA_RPS0) | - SetBits(1, MEM_VGA_RPS1); - -#else /* AVOID_CPIO */ - pATIHW->mem_vga_wp_sel = SetBits(0, MEM_VGA_WPS0) | SetBits(pATIHW->nPlane, MEM_VGA_WPS1); pATIHW->mem_vga_rp_sel = SetBits(0, MEM_VGA_RPS0) | SetBits(pATIHW->nPlane, MEM_VGA_RPS1); -#endif /* AVOID_CPIO */ - pATIHW->dac_cntl = inr(DAC_CNTL) & ~(DAC1_CLK_SEL | DAC_PALETTE_ACCESS_CNTL | DAC_8BIT_EN); if (pATI->Chip >= ATI_CHIP_264CT) @@ -122,19 +101,10 @@ pATIHW->config_cntl = config_cntl = inr(CONFIG_CNTL); -#ifndef AVOID_CPIO - if (pATI->UseSmallApertures) - { pATIHW->config_cntl |= CFG_MEM_VGA_AP_EN; - } else - -#endif /* AVOID_CPIO */ - - { pATIHW->config_cntl &= ~CFG_MEM_VGA_AP_EN; - } if (pATI->LinearBase && (pATI->Chip < ATI_CHIP_264CT)) { @@ -149,6 +119,7 @@ if (pATI->Chip >= ATI_CHIP_264VTB) { + pATIHW->mem_buf_cntl = inr(MEM_BUF_CNTL) | INVALIDATE_RB_CACHE; pATIHW->mem_cntl = (pATI->LockData.mem_cntl & ~(CTL_MEM_LOWER_APER_ENDIAN | CTL_MEM_UPPER_APER_ENDIAN)) | SetBits(CTL_MEM_APER_BYTE_ENDIAN, CTL_MEM_LOWER_APER_ENDIAN); @@ -275,11 +246,8 @@ break; } -#if X_BYTE_ORDER == X_LITTLE_ENDIAN - - pATIHW->dp_pix_width |= DP_BYTE_PIX_ORDER; - -#endif /* X_BYTE_ORDER */ + if (ATIEndian.endian == ATI_LITTLE_ENDIAN) + pATIHW->dp_pix_width |= DP_BYTE_PIX_ORDER; pATIHW->dp_mix = SetBits(MIX_SRC, DP_FRGD_MIX) | SetBits(MIX_DST, DP_BKGD_MIX); @@ -378,6 +346,7 @@ if (pATI->Chip >= ATI_CHIP_264VTB) { + pATIHW->mem_buf_cntl = inr(MEM_BUF_CNTL) | INVALIDATE_RB_CACHE; pATIHW->mem_cntl = inr(MEM_CNTL); pATIHW->mpp_config = inr(MPP_CONFIG); pATIHW->mpp_strobe_seq = inr(MPP_STROBE_SEQ); @@ -639,9 +608,6 @@ CRTC_EXT_DISP_EN | CRTC_EN | CRTC_VGA_LINEAR | CRTC_CNT_EN; switch (pATI->depth) { - -#ifndef AVOID_CPIO - case 1: pATIHW->crtc_gen_cntl |= SetBits(PIX_WIDTH_1BPP, CRTC_PIX_WIDTH); break; @@ -650,8 +616,6 @@ pATIHW->crtc_gen_cntl |= SetBits(PIX_WIDTH_4BPP, CRTC_PIX_WIDTH); break; -#endif /* AVOID_CPIO */ - case 8: pATIHW->crtc_gen_cntl |= SetBits(PIX_WIDTH_8BPP, CRTC_PIX_WIDTH); break; @@ -705,13 +669,7 @@ ATIHWPtr pATIHW ) { - -#ifndef AVOID_CPIO - if (pATIHW->crtc == ATI_CRTC_MACH64) - -#endif /* AVOID_CPIO */ - { if ((pATIHW->FeedbackDivider > 0) && (pATI->ProgrammableClock != ATI_CLOCK_NONE)) @@ -989,12 +947,7 @@ } } -#ifndef AVOID_CPIO - if (pATIHW->crtc == ATI_CRTC_MACH64) - -#endif /* AVOID_CPIO */ - { /* Aperture setup */ outr(MEM_VGA_WP_SEL, pATIHW->mem_vga_wp_sel); @@ -1007,6 +960,7 @@ if (pATI->Chip >= ATI_CHIP_264VTB) { + outr(MEM_BUF_CNTL, pATIHW->mem_buf_cntl); outr(MEM_CNTL, pATIHW->mem_cntl); outr(MPP_CONFIG, pATIHW->mpp_config); outr(MPP_STROBE_SEQ, pATIHW->mpp_strobe_seq); Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h:1.19 xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h:1.20 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h:1.19 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h,v 1.19 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.h,v 1.20 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.c:1.4 xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.c:1.10 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.c:1.4 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.c Fri Feb 17 12:01:39 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.c,v 1.4 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.c,v 1.10 2006/02/17 17:01:39 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -134,108 +134,110 @@ if (pATI->pXAAInfo) pATI->pXAAInfo->NeedToSync = FALSE; - if (pATI->OptionMMIOCache && pATI->OptionTestMMIOCache) + if (pATI->Chip >= ATI_CHIP_264VTB) { /* - * For debugging purposes, attempt to verify that each cached register - * should actually be cached. + * Flush the read-back cache (by turning on INVALIDATE_RB_CACHE), + * otherwise the host might get stale data when reading through the + * aperture. */ - TestRegisterCaching(SRC_CNTL); + outr(MEM_BUF_CNTL, pATI->NewHW.mem_buf_cntl); + } - TestRegisterCaching(HOST_CNTL); + if (!pATI->OptionMMIOCache || !pATI->OptionTestMMIOCache) + return; - TestRegisterCaching(PAT_REG0); - TestRegisterCaching(PAT_REG1); - TestRegisterCaching(PAT_CNTL); + /* + * For debugging purposes, attempt to verify that each cached register + * should actually be cached. + */ + TestRegisterCaching(SRC_CNTL); - if (RegisterIsCached(SC_LEFT_RIGHT) && /* Special case */ - (CacheSlot(SC_LEFT_RIGHT) != - (SetWord(inm(SC_RIGHT), 1) | SetWord(inm(SC_LEFT), 0)))) - { - UncacheRegister(SC_LEFT_RIGHT); - xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, - "SC_LEFT_RIGHT write cache disabled!\n"); - } + TestRegisterCaching(HOST_CNTL); - if (RegisterIsCached(SC_TOP_BOTTOM) && /* Special case */ - (CacheSlot(SC_TOP_BOTTOM) != - (SetWord(inm(SC_BOTTOM), 1) | SetWord(inm(SC_TOP), 0)))) - { - UncacheRegister(SC_TOP_BOTTOM); - xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, - "SC_TOP_BOTTOM write cache disabled!\n"); - } + TestRegisterCaching(PAT_REG0); + TestRegisterCaching(PAT_REG1); + TestRegisterCaching(PAT_CNTL); - TestRegisterCaching(DP_BKGD_CLR); - TestRegisterCaching(DP_FRGD_CLR); - TestRegisterCaching(DP_WRITE_MASK); - TestRegisterCaching(DP_MIX); - - TestRegisterCaching(CLR_CMP_CLR); - TestRegisterCaching(CLR_CMP_MSK); - TestRegisterCaching(CLR_CMP_CNTL); + if (RegisterIsCached(SC_LEFT_RIGHT) && /* Special case */ + (CacheSlot(SC_LEFT_RIGHT) != + (SetWord(inm(SC_RIGHT), 1) | SetWord(inm(SC_LEFT), 0)))) + { + UncacheRegister(SC_LEFT_RIGHT); + xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, + "SC_LEFT_RIGHT write cache disabled!\n"); + } - if (pATI->Block1Base) - { - TestRegisterCaching(OVERLAY_Y_X_START); - TestRegisterCaching(OVERLAY_Y_X_END); + if (RegisterIsCached(SC_TOP_BOTTOM) && /* Special case */ + (CacheSlot(SC_TOP_BOTTOM) != + (SetWord(inm(SC_BOTTOM), 1) | SetWord(inm(SC_TOP), 0)))) + { + UncacheRegister(SC_TOP_BOTTOM); + xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, + "SC_TOP_BOTTOM write cache disabled!\n"); + } - TestRegisterCaching(OVERLAY_GRAPHICS_KEY_CLR); - TestRegisterCaching(OVERLAY_GRAPHICS_KEY_MSK); + TestRegisterCaching(DP_BKGD_CLR); + TestRegisterCaching(DP_FRGD_CLR); + TestRegisterCaching(DP_WRITE_MASK); + TestRegisterCaching(DP_MIX); - TestRegisterCaching(OVERLAY_KEY_CNTL); + TestRegisterCaching(CLR_CMP_CLR); + TestRegisterCaching(CLR_CMP_MSK); + TestRegisterCaching(CLR_CMP_CNTL); - TestRegisterCaching(OVERLAY_SCALE_INC); - TestRegisterCaching(OVERLAY_SCALE_CNTL); + if (!pATI->Block1Base) + return; - TestRegisterCaching(SCALER_HEIGHT_WIDTH); + TestRegisterCaching(OVERLAY_Y_X_START); + TestRegisterCaching(OVERLAY_Y_X_END); - TestRegisterCaching(SCALER_TEST); + TestRegisterCaching(OVERLAY_GRAPHICS_KEY_CLR); + TestRegisterCaching(OVERLAY_GRAPHICS_KEY_MSK); - TestRegisterCaching(VIDEO_FORMAT); + TestRegisterCaching(OVERLAY_KEY_CNTL); - if (pATI->Chip < ATI_CHIP_264VTB) - { - TestRegisterCaching(BUF0_OFFSET); - TestRegisterCaching(BUF0_PITCH); - TestRegisterCaching(BUF1_OFFSET); - TestRegisterCaching(BUF1_PITCH); - } - else - { - TestRegisterCaching(SCALER_BUF0_OFFSET); - TestRegisterCaching(SCALER_BUF1_OFFSET); - TestRegisterCaching(SCALER_BUF_PITCH); - - TestRegisterCaching(OVERLAY_EXCLUSIVE_HORZ); - TestRegisterCaching(OVERLAY_EXCLUSIVE_VERT); - - if (pATI->Chip >= ATI_CHIP_264GTPRO) - { - TestRegisterCaching(SCALER_COLOUR_CNTL); - - TestRegisterCaching(SCALER_H_COEFF0); - TestRegisterCaching(SCALER_H_COEFF1); - TestRegisterCaching(SCALER_H_COEFF2); - TestRegisterCaching(SCALER_H_COEFF3); - TestRegisterCaching(SCALER_H_COEFF4); - - TestRegisterCaching(SCALER_BUF0_OFFSET_U); - TestRegisterCaching(SCALER_BUF0_OFFSET_V); - TestRegisterCaching(SCALER_BUF1_OFFSET_U); - TestRegisterCaching(SCALER_BUF1_OFFSET_V); - } - } - } + TestRegisterCaching(OVERLAY_SCALE_INC); + TestRegisterCaching(OVERLAY_SCALE_CNTL); + + TestRegisterCaching(SCALER_HEIGHT_WIDTH); + + TestRegisterCaching(SCALER_TEST); + + TestRegisterCaching(VIDEO_FORMAT); + + if (pATI->Chip < ATI_CHIP_264VTB) + { + TestRegisterCaching(BUF0_OFFSET); + TestRegisterCaching(BUF0_PITCH); + TestRegisterCaching(BUF1_OFFSET); + TestRegisterCaching(BUF1_PITCH); + + return; } - /* - * For VTB's and later, the first CPU read of the framebuffer will return - * zeroes, so do it here. This appears to be due to some kind of engine - * caching of framebuffer data I haven't found any way of disabling, or - * otherwise circumventing. Thanks to Mark Vojkovich for the suggestion. - */ - pATI = *(volatile ATIPtr *)pATI->pMemory; + TestRegisterCaching(SCALER_BUF0_OFFSET); + TestRegisterCaching(SCALER_BUF1_OFFSET); + TestRegisterCaching(SCALER_BUF_PITCH); + + TestRegisterCaching(OVERLAY_EXCLUSIVE_HORZ); + TestRegisterCaching(OVERLAY_EXCLUSIVE_VERT); + + if (pATI->Chip < ATI_CHIP_264GTPRO) + return; + + TestRegisterCaching(SCALER_COLOUR_CNTL); + + TestRegisterCaching(SCALER_H_COEFF0); + TestRegisterCaching(SCALER_H_COEFF1); + TestRegisterCaching(SCALER_H_COEFF2); + TestRegisterCaching(SCALER_H_COEFF3); + TestRegisterCaching(SCALER_H_COEFF4); + + TestRegisterCaching(SCALER_BUF0_OFFSET_U); + TestRegisterCaching(SCALER_BUF0_OFFSET_V); + TestRegisterCaching(SCALER_BUF1_OFFSET_U); + TestRegisterCaching(SCALER_BUF1_OFFSET_V); } /* @@ -259,9 +261,9 @@ ATIMach64WaitForFIFO(pATI, 3); outf(DP_WRITE_MASK, planemask); + outf(DP_MIX, SetBits(ATIMach64ALU[rop], DP_FRGD_MIX)); outf(DP_SRC, DP_MONO_SRC_ALLONES | SetBits(SRC_BLIT, DP_FRGD_SRC) | SetBits(SRC_BKGD, DP_BKGD_SRC)); - outf(DP_MIX, SetBits(ATIMach64ALU[rop], DP_FRGD_MIX)); if (!pATI->XAAForceTransBlit && (TransparencyColour == -1)) { @@ -333,6 +335,18 @@ outf(SRC_WIDTH1, w); outf(DST_Y_X, SetWord(xDst, 1) | SetWord(yDst, 0)); outf(DST_HEIGHT_WIDTH, SetWord(w, 1) | SetWord(h, 0)); + + /* + * On VTB's and later, the engine will randomly not wait for a copy + * operation to commit its results to video memory before starting the next + * one. The probability of such occurrences increases with GUI_WB_FLUSH + * (or GUI_WB_FLUSH_P) setting, bitsPerPixel and/or CRTC clock. This + * would point to some kind of video memory bandwidth problem were it noti + * for the fact that the problem occurs less often (but still occurs) when + * copying larger rectangles. + */ + if ((pATI->Chip >= ATI_CHIP_264VTB) && !pATI->OptionDevel) + ATIMach64Sync(pScreenInfo); } /* @@ -355,7 +369,7 @@ outf(DP_WRITE_MASK, planemask); outf(DP_SRC, DP_MONO_SRC_ALLONES | SetBits(SRC_FRGD, DP_FRGD_SRC) | SetBits(SRC_BKGD, DP_BKGD_SRC)); - outf(DP_FRGD_CLR, colour); + outf(DP_FRGD_CLR, (*pATI->ATIApplyEndian)(colour)); outf(DP_MIX, SetBits(ATIMach64ALU[rop], DP_FRGD_MIX)); outf(CLR_CMP_CNTL, CLR_CMP_FN_FALSE); @@ -415,17 +429,18 @@ { ATIPtr pATI = ATIPTR(pScreenInfo); + /* Disable clipping */ + ATIMach64ValidateClip(pATI, pATI->NewHW.sc_left, pATI->NewHW.sc_right, + pATI->NewHW.sc_top, pATI->NewHW.sc_bottom); + ATIMach64WaitForFIFO(pATI, 5); outf(DP_WRITE_MASK, planemask); outf(DP_SRC, DP_MONO_SRC_ALLONES | SetBits(SRC_FRGD, DP_FRGD_SRC) | SetBits(SRC_BKGD, DP_BKGD_SRC)); - outf(DP_FRGD_CLR, colour); + outf(DP_FRGD_CLR, (*pATI->ATIApplyEndian)(colour)); outf(DP_MIX, SetBits(ATIMach64ALU[rop], DP_FRGD_MIX)); outf(CLR_CMP_CNTL, CLR_CMP_FN_FALSE); - - ATIMach64ValidateClip(pATI, pATI->NewHW.sc_left, pATI->NewHW.sc_right, - pATI->NewHW.sc_top, pATI->NewHW.sc_bottom); } /* @@ -519,7 +534,7 @@ outf(DP_WRITE_MASK, planemask); outf(DP_SRC, DP_MONO_SRC_PATTERN | SetBits(SRC_FRGD, DP_FRGD_SRC) | SetBits(SRC_BKGD, DP_BKGD_SRC)); - outf(DP_FRGD_CLR, fg); + outf(DP_FRGD_CLR, (*pATI->ATIApplyEndian)(fg)); if (bg == -1) { @@ -529,7 +544,7 @@ else { ATIMach64WaitForFIFO(pATI, 2); - outf(DP_BKGD_CLR, bg); + outf(DP_BKGD_CLR, (*pATI->ATIApplyEndian)(bg)); outf(DP_MIX, SetBits(ATIMach64ALU[rop], DP_FRGD_MIX) | SetBits(ATIMach64ALU[rop], DP_BKGD_MIX)); } @@ -602,7 +617,7 @@ outf(DP_WRITE_MASK, planemask); outf(DP_SRC, DP_MONO_SRC_HOST | SetBits(SRC_FRGD, DP_FRGD_SRC) | SetBits(SRC_BKGD, DP_BKGD_SRC)); - outf(DP_FRGD_CLR, fg); + outf(DP_FRGD_CLR, (*pATI->ATIApplyEndian)(fg)); if (bg == -1) { @@ -612,7 +627,7 @@ else { ATIMach64WaitForFIFO(pATI, 2); - outf(DP_BKGD_CLR, bg); + outf(DP_BKGD_CLR, (*pATI->ATIApplyEndian)(bg)); outf(DP_MIX, SetBits(ATIMach64ALU[rop], DP_FRGD_MIX) | SetBits(ATIMach64ALU[rop], DP_BKGD_MIX)); } @@ -773,16 +788,8 @@ if (pATI->XModifier == 1) { pXAAInfo->Flags = PIXMAP_CACHE | OFFSCREEN_PIXMAPS; - -#ifndef AVOID_CPIO - if (!pATI->BankInfo.BankSize) - -#endif /* AVOID_CPIO */ - - { pXAAInfo->Flags |= LINEAR_FRAMEBUFFER; - } } /* Sync */ @@ -799,14 +806,9 @@ /* 8x8 mono pattern fills */ pXAAInfo->Mono8x8PatternFillFlags = - -#if X_BYTE_ORDER != X_LITTLE_ENDIAN - - BIT_ORDER_IN_BYTE_MSBFIRST | - -#endif /* X_BYTE_ORDER */ - HARDWARE_PATTERN_PROGRAMMED_BITS | HARDWARE_PATTERN_SCREEN_ORIGIN; + if (ATIEndian.endian == ATI_BIG_ENDIAN) + pXAAInfo->Mono8x8PatternFillFlags |= BIT_ORDER_IN_BYTE_MSBFIRST; pXAAInfo->SetupForMono8x8PatternFill = ATIMach64SetupForMono8x8PatternFill; pXAAInfo->SubsequentMono8x8PatternFillRect = ATIMach64SubsequentMono8x8PatternFillRect; @@ -824,7 +826,7 @@ /* Align bitmap data on a 64-byte boundary */ pATI->ExpansionBitmapWidth = /* DWord size in bits */ - ((pATI->displayWidth * pATI->XModifier) + 31) & ~31U; + ((pATI->displayWidth * pATI->XModifier) + 63) & ~31U; pATI->ExpansionBitmapScanlinePtr[1] = (CARD32 *)xnfalloc((pATI->ExpansionBitmapWidth >> 3) + 63); pATI->ExpansionBitmapScanlinePtr[0] = Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.h:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.h:1.3 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.h Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.h,v 1.3 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.h,v 1.4 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.c:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.c:1.3 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.c Thu Jan 5 13:55:29 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.c,v 1.3 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.c,v 1.6 2006/01/05 18:55:29 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -337,8 +337,6 @@ if (!pATI->CursorBase) return FALSE; -#ifndef AVOID_CPIO - /* * For some reason, the hardware cursor isn't vertically scaled when a VGA * doublescanned or multiscanned mode is in effect. @@ -349,8 +347,6 @@ (pScreenInfo->currentMode->VScan > 1)) return FALSE; -#endif /* AVOID_CPIO */ - return TRUE; } @@ -379,14 +375,9 @@ HARDWARE_CURSOR_SHOW_TRANSPARENT | HARDWARE_CURSOR_UPDATE_UNHIDDEN | HARDWARE_CURSOR_AND_SOURCE_WITH_MASK | - -#if X_BYTE_ORDER != X_LITTLE_ENDIAN - - HARDWARE_CURSOR_BIT_ORDER_MSBFIRST | - -#endif /* X_BYTE_ORDER */ - HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1; + if (ATIEndian.endian == ATI_BIG_ENDIAN) + pCursorInfo->Flags |= HARDWARE_CURSOR_BIT_ORDER_MSBFIRST; pCursorInfo->MaxWidth = pCursorInfo->MaxHeight = 64; pCursorInfo->SetCursorColors = ATIMach64SetCursorColours; Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.h:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.h:1.3 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.h,v 1.3 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.h,v 1.4 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.c:1.3 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.c Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.c,v 1.3 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.c,v 1.4 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.h:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.h:1.3 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.h,v 1.3 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64i2c.h,v 1.4 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.c:1.8 xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.c:1.10 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.c:1.8 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.c Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.c,v 1.8 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.c,v 1.10 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -48,6 +48,40 @@ } /* + * ATIMach64AccessLCDReg -- + * + * This function sets up the addressing required to access, for read or write, + * an LTPro's, XL/XC's or Mobility M1's LCD registers. This exists as a + * function instead of a macro to avoid a syntax error that would result. + */ +void +ATIMach64AccessLCDReg +( + ATIPtr pATI, + const CARD8 Index +) +{ + out8(LCD_INDEX, SetBits(Index, LCD_REG_INDEX)); +} + +/* + * ATIMach64AccessTVReg -- + * + * This function sets up the addressing required to access, for read or write, + * an LTPro's or Mobility M1's TVOUT registers. This exists as a function + * rather than a macro to avoid a syntax error that would result. + */ +void +ATIMach64AccessTVReg +( + ATIPtr pATI, + const CARD8 Index +) +{ + out8(TV_OUT_INDEX, SetBits(Index, TV_REG_INDEX)); +} + +/* * ATIMach64PollEngineStatus -- * * This function refreshes the driver's view of the draw engine's status. This Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h:1.17 xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h:1.19 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h:1.17 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h,v 1.17 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h,v 1.19 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -39,9 +39,10 @@ * inl/outl 32-bit R/W through PIO space. The register is specified as the * actual PIO address. These are actually defined in compiler.h. * - * inw/outw 16-bit counterparts to inl/outl. Not used for Mach64 support. + * inw/outw 16-bit counterparts to inl/outl. Not currently used for Mach64 + * support. Also defined in compiler.h. * - * inb/outb 8-bit counterparts to inl/outl. + * inb/outb 8-bit counterparts to inl/outl. Defined in compiler.h. * * inm/outm 32-bit R/W through MMIO space. The register is specified as * the actual MMIO offset (with Block 1 following Block 0), which, @@ -62,12 +63,16 @@ * 256 bytes of MMIO space (in Block 0). Note that all of these * registers are non-FIFO'ed. * + * inh/outh 16-bit counterparts to inr/outr. Not currently used for Mach64 + * support. + * * in8/out8 8-bit counterparts to inr/outr. * - * For portability reasons, inr/outr/in8/out8 should be used in preference to - * inl/outl/inb/outb to/from any register space starting with CRTC_H_TOTAL_DISP - * but before DST_OFF_PITCH (in the order defined by atiregs.h). None of - * inm/outm/outf should ever be used for these registers. + * For portability reasons, inr/outr/inh/outh/in8/out8 should be used in + * preference to inl/outl/inw/outw/inb/outb to/from any register space starting + * with CRTC_H_TOTAL_DISP but before DST_OFF_PITCH (in the order defined by + * atiregs.h). None of inm/outm/outf should ever be used for these registers. + * Also, all I/O from/to FIFO'ed registers must be 32-bit. * * outf()'s should be grouped together as much as possible, while respecting * any ordering constraints the engine might impose. Groups larger than 16 @@ -92,54 +97,62 @@ MMIO_OUT32(pATI->pBlock[GetBits(_Register, BLOCK_SELECT)], \ (_Register) & MM_IO_SELECT, _Value) -#ifdef AVOID_CPIO +#define ATIIOPort(_PortTag) \ + (((pATI->IODecoding == SPARSE_IO) ? \ + ((_PortTag) & (SPARSE_IO_SELECT | IO_BYTE_SELECT)) : \ + ((_PortTag) & (BLOCK_IO_SELECT | IO_BYTE_SELECT))) + \ + pATI->CPIOBase) + +#define inr(_Register) \ + ((pATI->IODecoding != MEMORY_IO) ? \ + inl(ATIIOPort(_Register & IO_LONG_PORT)) : \ + MMIO_IN32(pATI->pBlock[0], (_Register) & MM_IO_SELECT)) +#define outr(_Register, _Value) \ + do \ + { \ + CARD32 __Value = (_Value); \ + \ + if (pATI->IODecoding != MEMORY_IO) \ + outl(ATIIOPort(_Register & IO_LONG_PORT), __Value); \ + else \ + MMIO_OUT32(pATI->pBlock[0], (_Register) & MM_IO_SELECT, __Value); \ + } while (0) -# define inr(_Register) \ - MMIO_IN32(pATI->pBlock[0], (_Register) & MM_IO_SELECT) -# define outr(_Register, _Value) \ - MMIO_OUT32(pATI->pBlock[0], (_Register) & MM_IO_SELECT, _Value) - -# define in8(_Register) \ - MMIO_IN8(pATI->pBlock[0], \ - (_Register) & (MM_IO_SELECT | IO_BYTE_SELECT)) -# define out8(_Register, _Value) \ - MMIO_OUT8(pATI->pBlock[0], \ - (_Register) & (MM_IO_SELECT | IO_BYTE_SELECT), _Value) - -/* Cause a cpp syntax error if any of these are used */ -#undef inb -#undef inw -#undef inl -#undef outb -#undef outw -#undef outl - -#define inb() /* Nothing */ -#define inw() /* Nothing */ -#define inl() /* Nothing */ -#define outb() /* Nothing */ -#define outw() /* Nothing */ -#define outl() /* Nothing */ - -#else /* AVOID_CPIO */ - -# define ATIIOPort(_PortTag) \ - (((pATI->CPIODecoding == SPARSE_IO) ? \ - ((_PortTag) & (SPARSE_IO_SELECT | IO_BYTE_SELECT)) : \ - ((_PortTag) & (BLOCK_IO_SELECT | IO_BYTE_SELECT))) | \ - pATI->CPIOBase) - -# define inr(_Register) \ - inl(ATIIOPort(_Register)) -# define outr(_Register, _Value) \ - outl(ATIIOPort(_Register), _Value) - -# define in8(_Register) \ - inb(ATIIOPort(_Register)) -# define out8(_Register, _Value) \ - outb(ATIIOPort(_Register), _Value) +#define inh(_Register) \ + ((pATI->IODecoding != MEMORY_IO) ? \ + inw(ATIIOPort(_Register & IO_WORD_PORT)) : \ + MMIO_IN16(pATI->pBlock[0], \ + (_Register) & (MM_IO_SELECT | IO_WORD_SELECT))) +#define outh(_Register, _Value) \ + do \ + { \ + CARD16 __Value = (_Value); \ + \ + if (pATI->IODecoding != MEMORY_IO) \ + outw(ATIIOPort(_Register & IO_WORD_PORT), __Value); \ + else \ + MMIO_OUT16(pATI->Block[0], \ + (_Register) & (MM_IO_SELECT | IO_WORD_SELECT), \ + __Value); \ + } while (0) -#endif /* AVOID_CPIO */ +#define in8(_Register) \ + ((pATI->IODecoding != MEMORY_IO) ? \ + inb(ATIIOPort(_Register)) : \ + MMIO_IN8(pATI->pBlock[0], \ + (_Register) & (MM_IO_SELECT | IO_BYTE_SELECT))) +#define out8(_Register, _Value) \ + do \ + { \ + CARD8 __Value = (_Value); \ + \ + if (pATI->IODecoding != MEMORY_IO) \ + outb(ATIIOPort(_Register), __Value); \ + else \ + MMIO_OUT8(pATI->pBlock[0], \ + (_Register) & (MM_IO_SELECT | IO_BYTE_SELECT), \ + __Value); \ + } while (0) extern void ATIMach64PollEngineStatus FunctionPrototype((ATIPtr)); @@ -202,7 +215,7 @@ /* * An outf() variant to write two registers such that the second register is - * is always written whenever either is to be changed. + * always written whenever either is to be changed. */ #define outq(_Register1, _Register2, _Value1, _Value2) \ do \ @@ -250,28 +263,32 @@ out8(CLOCK_CNTL + 2, _Value); \ } while (0) -#define ATIMach64GetLCDReg(_Index) \ - ( \ - out8(LCD_INDEX, SetBits(_Index, LCD_REG_INDEX)), \ - inr(LCD_DATA) \ +extern void ATIMach64AccessLCDReg FunctionPrototype((ATIPtr, const CARD8)); + +#define ATIMach64GetLCDReg(_Index) \ + ( \ + ATIMach64AccessLCDReg(pATI, _Index), \ + inr(LCD_DATA) \ ) -#define ATIMach64PutLCDReg(_Index, _Value) \ - do \ - { \ - out8(LCD_INDEX, SetBits(_Index, LCD_REG_INDEX)); \ - outr(LCD_DATA, _Value); \ +#define ATIMach64PutLCDReg(_Index, _Value) \ + do \ + { \ + ATIMach64AccessLCDReg(pATI, _Index); \ + outr(LCD_DATA, _Value); \ } while (0) -#define ATIMach64GetTVReg(_Index) \ - ( \ - out8(TV_OUT_INDEX, SetBits(_Index, TV_REG_INDEX)), \ - inr(TV_OUT_DATA) \ +extern void ATIMach64AccessTVReg FunctionPrototype((ATIPtr, const CARD8)); + +#define ATIMach64GetTVReg(_Index) \ + ( \ + ATIMach64AccessTVReg(pATI, _Index), \ + inr(TV_OUT_DATA) \ ) -#define ATIMach64PutTVReg(_Index, _Value) \ - do \ - { \ - out8(TV_OUT_INDEX, SetBits(_Index, TV_REG_INDEX)); \ - outr(TV_OUT_DATA, _Value); \ +#define ATIMach64PutTVReg(_Index, _Value) \ + do \ + { \ + ATIMach64AccessTVReg(pATI, _Index); \ + outr(TV_OUT_DATA, _Value); \ } while (0) /* Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.c:1.9 xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.c:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.c:1.9 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.c Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.c,v 1.9 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.c,v 1.11 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -28,7 +28,7 @@ #include "atimach64io.h" #include "atimach64xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "fourcc.h" #define MAKE_ATOM(string) MakeAtom(string, strlen(string), TRUE) Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.h:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.h:1.3 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.h,v 1.3 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64xv.h,v 1.4 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimisc.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimisc.c:1.10 xc/programs/Xserver/hw/xfree86/drivers/ati/atimisc.c:1.15 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimisc.c:1.10 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimisc.c Sun Mar 19 14:06:34 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimisc.c,v 1.10 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimisc.c,v 1.15 2006/03/19 19:06:34 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -51,10 +51,10 @@ static pointer ATISetup ( - pointer Module, - pointer Options, - int *ErrorMajor, - int *ErrorMinor + ModuleDescPtr Module, + pointer Options, + int *ErrorMajor, + int *ErrorMinor ) { static Bool Inited = FALSE; @@ -99,18 +99,12 @@ * Tell loader about symbols from other modules that this module might * refer to. */ - xf86LoaderRefSymLists( + xf86LoaderModRefSymLists(Module, ATIint10Symbols, ATIddcSymbols, ATIvbeSymbols, - -#ifndef AVOID_CPIO - ATIxf1bppSymbols, ATIxf4bppSymbols, - -#endif /* AVOID_CPIO */ - ATIfbSymbols, ATIshadowfbSymbols, ATIxaaSymbols, @@ -132,4 +126,16 @@ NULL }; +const char *atimiscExportedSymbols[] = { + "ATIPreInit", + "ATIScreenInit", + "ATISwitchMode", + "ATIAdjustFrame", + "ATIEnterVT", + "ATILeaveVT", + "ATIFreeScreen", + "ATIValidMode", + NULL +}; + #endif /* XFree86LOADER */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.c:1.22 xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.c:1.25 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.c:1.22 Thu Feb 10 10:26:37 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.c Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.c,v 1.22 2005/02/10 15:26:37 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.c,v 1.25 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -35,8 +35,6 @@ #include "atiwonder.h" #include "atiwonderio.h" -#ifndef AVOID_CPIO - /* * ATICopyVGAMemory -- * @@ -226,8 +224,6 @@ } } -#endif /* AVOID_CPIO */ - /* * ATIModePreInit -- * @@ -244,8 +240,6 @@ { CARD32 lcd_index; -#ifndef AVOID_CPIO - if (pATI->VGAAdapter != ATI_ADAPTER_NONE) { /* Fill in VGA data */ @@ -257,9 +251,6 @@ } if (pATI->Chip >= ATI_CHIP_88800GXC) - -#endif /* AVOID_CPIO */ - { /* Fill in Mach64 data */ ATIMach64PreInit(pScreenInfo, pATI, pATIHW); @@ -359,16 +350,11 @@ ATIHWPtr pATIHW ) { - -#ifndef AVOID_CPIO - int Index; /* Get back to bank 0 */ (*pATIHW->SetBank)(pATI, 0); -#endif /* AVOID_CPIO */ - /* Save clock data */ ATIClockSave(pScreenInfo, pATI, pATIHW); @@ -418,8 +404,6 @@ } } -#ifndef AVOID_CPIO - if (pATI->VGAAdapter != ATI_ADAPTER_NONE) { /* Save VGA data */ @@ -431,9 +415,6 @@ } if (pATI->Chip >= ATI_CHIP_88800GXC) - -#endif /* AVOID_CPIO */ - { /* Save Mach64 data */ ATIMach64Save(pATI, pATIHW); @@ -455,8 +436,6 @@ (pATIHW->lcd_gen_ctrl & ~CRTC_RW_SELECT) | SHADOW_RW_EN); -#ifndef AVOID_CPIO - /* Save shadow VGA CRTC registers */ for (Index = 0; Index < NumberOf(pATIHW->shadow_vga); @@ -464,8 +443,6 @@ pATIHW->shadow_vga[Index] = GetReg(CRTX(pATI->CPIO_VGABase), Index); -#endif /* AVOID_CPIO */ - /* Save shadow Mach64 CRTC registers */ pATIHW->shadow_h_total_disp = inr(CRTC_H_TOTAL_DISP); pATIHW->shadow_h_sync_strt_wid = inr(CRTC_H_SYNC_STRT_WID); @@ -487,30 +464,24 @@ } } else if (pATI->DAC == ATI_DAC_IBMRGB514) + { ATIRGB514Save(pATI, pATIHW); + } } -#ifndef AVOID_CPIO - /* - * For some unknown reason, CLKDIV2 needs to be turned off to save the - * DAC's LUT reliably on VGA Wonder VLB adapters. + * For some unknown reason, CLKDIV2 needs to be turned off to reliably save + * the DAC's LUT on VGA Wonder VLB adapters. */ if ((pATI->Adapter == ATI_ADAPTER_NONISA) && (pATIHW->seq[1] & 0x08U)) PutReg(SEQX, 0x01U, pATIHW->seq[1] & ~0x08U); -#endif /* AVOID_CPIO */ - /* Save RAMDAC state */ ATIDACSave(pATI, pATIHW); -#ifndef AVOID_CPIO - if ((pATI->Adapter == ATI_ADAPTER_NONISA) && (pATIHW->seq[1] & 0x08U)) PutReg(SEQX, 0x01U, pATIHW->seq[1]); -#endif /* AVOID_CPIO */ - /* * The server has already saved video memory contents when switching out of * its virtual console, so don't do it again. @@ -519,22 +490,12 @@ { pATIHW->FeedbackDivider = 0; /* Don't programme clock */ -#ifndef AVOID_CPIO - /* Save video memory */ ATISwap(pScreenInfo->scrnIndex, pATI, pATIHW, FALSE); - -#endif /* AVOID_CPIO */ - } -#ifndef AVOID_CPIO - if (pATI->VGAAdapter != ATI_ADAPTER_NONE) ATIVGASaveScreen(pATI, SCREEN_SAVER_OFF); /* Turn on screen */ - -#endif /* AVOID_CPIO */ - } /* @@ -573,17 +534,12 @@ VScan = pATI->LCDVertical / pMode->VDisplay; switch (pATIHW->crtc) { - -#ifndef AVOID_CPIO - case ATI_CRTC_VGA: if (VScan > 64) VScan = 64; pMode->VScan = VScan; break; -#endif /* AVOID_CPIO */ - case ATI_CRTC_MACH64: pMode->VScan = 0; if (VScan <= 1) @@ -610,9 +566,6 @@ switch (pATIHW->crtc) { - -#ifndef AVOID_CPIO - case ATI_CRTC_VGA: /* Fill in VGA data */ ATIVGACalculate(pATI, pATIHW, pMode); @@ -725,8 +678,6 @@ } break; -#endif /* AVOID_CPIO */ - case ATI_CRTC_MACH64: /* Fill in Mach64 data */ ATIMach64Calculate(pATI, pATIHW, pMode); @@ -875,14 +826,10 @@ pATI->LCDVertical, VERT_STRETCH_RATIO0); } -#ifndef AVOID_CPIO - /* Copy non-shadow CRTC register values to the shadow set */ for (Index = 0; Index < NumberOf(pATIHW->shadow_vga); Index++) pATIHW->shadow_vga[Index] = pATIHW->crt[Index]; -#endif /* AVOID_CPIO */ - pATIHW->shadow_h_total_disp = pATIHW->crtc_h_total_disp; pATIHW->shadow_h_sync_strt_wid = pATIHW->crtc_h_sync_strt_wid; pATIHW->shadow_v_total_disp = pATIHW->crtc_v_total_disp; @@ -935,16 +882,11 @@ ATIHWPtr pATIHW ) { - -#ifndef AVOID_CPIO - int Index; /* Get back to bank 0 */ (*pATIHW->SetBank)(pATI, 0); -#endif /* AVOID_CPIO */ - if (pATI->Chip >= ATI_CHIP_88800GXC) { /* Stop CRTC */ @@ -1005,9 +947,6 @@ switch (pATIHW->crtc) { - -#ifndef AVOID_CPIO - case ATI_CRTC_VGA: /* Start sequencer reset */ PutReg(SEQX, 0x00U, 0x00U); @@ -1068,26 +1007,21 @@ break; -#endif /* AVOID_CPIO */ - case ATI_CRTC_MACH64: /* Load Mach64 CRTC registers */ ATIMach64Set(pATI, pATIHW); -#ifndef AVOID_CPIO - - if (pATI->UseSmallApertures) - { - /* Oddly enough, these need to be set also, maybe others */ - PutReg(SEQX, 0x02U, pATIHW->seq[2]); - PutReg(SEQX, 0x04U, pATIHW->seq[4]); - PutReg(GRAX, 0x06U, pATIHW->gra[6]); - if (pATI->CPIO_VGAWonder) - ATIModifyExtReg(pATI, 0xB6U, -1, 0x00U, pATIHW->b6); - } + if (!pATI->UseSmallApertures) + break; -#endif /* AVOID_CPIO */ + /* Oddly enough, these need to be set also, maybe others */ + PutReg(SEQX, 0x02U, pATIHW->seq[2]); + PutReg(SEQX, 0x04U, pATIHW->seq[4]); + PutReg(GRAX, 0x06U, pATIHW->gra[6]); + if (!pATI->CPIO_VGAWonder) + break; + ATIModifyExtReg(pATI, 0xB6U, -1, 0x00U, pATIHW->b6); break; default: @@ -1108,9 +1042,6 @@ /* Restore shadow registers */ switch (pATIHW->crtc) { - -#ifndef AVOID_CPIO - case ATI_CRTC_VGA: for (Index = 0; Index < NumberOf(pATIHW->shadow_vga); @@ -1119,8 +1050,6 @@ pATIHW->shadow_vga[Index]); /* Fall through */ -#endif /* AVOID_CPIO */ - case ATI_CRTC_MACH64: outr(CRTC_H_TOTAL_DISP, pATIHW->shadow_h_total_disp); outr(CRTC_H_SYNC_STRT_WID, pATIHW->shadow_h_sync_strt_wid); @@ -1164,16 +1093,12 @@ /* Reset hardware cursor caching */ pATI->CursorXOffset = pATI->CursorYOffset = (CARD16)(-1); -#ifndef AVOID_CPIO - /* Restore video memory */ ATISwap(pScreenInfo->scrnIndex, pATI, pATIHW, TRUE); if (pATI->VGAAdapter != ATI_ADAPTER_NONE) ATIVGASaveScreen(pATI, SCREEN_SAVER_OFF); /* Turn on screen */ -#endif /* AVOID_CPIO */ - if ((xf86GetVerbosity() > 3) && (pATIHW == &pATI->NewHW)) { xf86ErrorFVerb(4, "\n After setting mode \"%s\":\n\n", Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.h:1.7 xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.h:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.h:1.7 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.h,v 1.7 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimode.h,v 1.8 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c:1.18 xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c:1.22 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c:1.18 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c Sun Mar 19 14:06:34 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c,v 1.18 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.c,v 1.22 2006/03/19 19:06:34 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -53,6 +53,7 @@ "R128FreeScreen", "R128ValidMode", "R128Options", + "R128Module", NULL }; @@ -68,6 +69,7 @@ "RADEONValidMode", "RADEONOptions", "RADEONHandleMessage", + "RADEONModule", NULL }; @@ -93,10 +95,10 @@ static pointer ATISetup ( - pointer Module, - pointer Options, - int *ErrorMajor, - int *ErrorMinor + ModuleDescPtr Module, + pointer Options, + int *ErrorMajor, + int *ErrorMinor ) { static Bool Inited = FALSE; @@ -106,7 +108,7 @@ Inited = TRUE; xf86AddDriver(&ATI, Module, 0); - xf86LoaderRefSymLists( + xf86LoaderModRefSymLists(Module, ATISymbols, R128Symbols, RADEONSymbols, @@ -124,4 +126,30 @@ NULL }; +const char *atiExportedSymbols[] = { + "ATI", + "ATIAdapterNames", + "ATIBusNames", + "ATIChipID", + "ATIChipNames", + "ATIChipsetNames", + "ATIEndian", + "ATIEndianCopy", + "ATIEndianSwap24", + "ATIEndianSwap32", + "ATIFoundryNames", + "ATIMapApertures", + "ATIMemoryTypeNames_264xT", + "ATIMemoryTypeNames_88800CX", + "ATIMemoryTypeNames_Mach", + "ATIPublicOptionSize", + "ATIPublicOptions", + "ATISetVGAIOBase", + "ATIUnmapApertures", + "R128Chipsets", + "RADEONChipsets", + "gRADEONEntityIndex", + NULL +}; + #endif /* XFree86LOADER */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h:1.11 xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h:1.11 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h,v 1.11 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimodule.h,v 1.12 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h:1.9 xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h:1.10 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h:1.9 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h,v 1.9 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimono.h,v 1.10 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c:1.24 xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c:1.26 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c:1.24 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c,v 1.24 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c,v 1.26 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1999 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -60,9 +60,6 @@ {0, }, FALSE, }, - -#ifndef AVOID_CPIO - { ATI_OPTION_LINEAR, "linear", @@ -70,9 +67,6 @@ {0, }, FALSE }, - -#endif /* AVOID_CPIO */ - { ATI_OPTION_MMIO_CACHE, "mmio_cache", Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h:1.14 xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h:1.16 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h:1.14 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h,v 1.14 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h,v 1.16 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1999 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -37,13 +37,7 @@ ATI_OPTION_CRT_DISPLAY, ATI_OPTION_CSYNC, ATI_OPTION_HWCURSOR, - -#ifndef AVOID_CPIO - ATI_OPTION_LINEAR, - -#endif /* AVOID_CPIO */ - ATI_OPTION_MMIO_CACHE, ATI_OPTION_TEST_MMIO_CACHE, ATI_OPTION_PANEL_DISPLAY, Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c:1.81 xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c:1.91 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c:1.81 Thu Feb 10 10:26:37 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c Fri Feb 24 10:31:31 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c,v 1.81 2005/02/10 15:26:37 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c,v 1.91 2006/02/24 15:31:31 tsi Exp $ */ /* - * Copyright 1999 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -48,8 +48,6 @@ #include "vbe.h" #include "xf86RAC.h" -#ifndef AVOID_CPIO - typedef CARD16 Colour; /* The correct spelling should be OK :-) */ /* @@ -124,6 +122,7 @@ static Colour ATIMach32ReadPixel ( + ATIPtr pATI, const short int X, const short int Y ) @@ -162,6 +161,7 @@ static void ATIMach32WritePixel ( + ATIPtr pATI, const short int X, const short int Y, const Colour Pixel_Colour @@ -193,7 +193,7 @@ static int ATIMach32videoRam ( - void + ATIPtr pATI ) { CARD16 clock_sel, mem_bndry, misc_options, ext_ge_config; @@ -242,18 +242,18 @@ /* Save pixel colours that will be clobbered */ ForEachTestPixel saved_Pixel[Pixel_Number] = - ATIMach32ReadPixel(TestPixel.x, TestPixel.y); + ATIMach32ReadPixel(pATI, TestPixel.x, TestPixel.y); /* Write test patterns */ ForEachTestPixel - ATIMach32WritePixel(TestPixel.x, TestPixel.y, + ATIMach32WritePixel(pATI, TestPixel.x, TestPixel.y, Test_Pixel[Pixel_Number]); /* Test for lost pixels */ AllPixelsOK = TRUE; ForEachTestPixel { - if (ATIMach32ReadPixel(TestPixel.x, TestPixel.y) != + if (ATIMach32ReadPixel(pATI, TestPixel.x, TestPixel.y) != Test_Pixel[Pixel_Number]) { AllPixelsOK = FALSE; @@ -263,7 +263,7 @@ /* Restore clobbered pixels */ ForEachTestPixel - ATIMach32WritePixel(TestPixel.x, TestPixel.y, + ATIMach32WritePixel(pATI, TestPixel.x, TestPixel.y, saved_Pixel[Pixel_Number]); /* End test on success */ @@ -290,8 +290,6 @@ return Test_Case[Case_Number].videoRamSize; } -#endif /* AVOID_CPIO */ - /* * ATIReportMemory -- * @@ -311,8 +309,6 @@ snprintf(Buffer, SizeOf(Buffer), "%d kB of %s detected", pATI->VideoRAM, MemoryTypeName); -#ifndef AVOID_CPIO - if (pATI->depth == 1) { /* 1bpp only uses one plane of four */ @@ -320,15 +316,12 @@ Message += snprintf(Message, Buffer + SizeOf(Buffer) - Message, " (using %d kB)", pScreenInfo->videoRam); } - else - -#endif /* AVOID_CPIO */ - - if (pATI->VideoRAM > pScreenInfo->videoRam) + else if (pATI->VideoRAM > pScreenInfo->videoRam) { Message += snprintf(Message, Buffer + SizeOf(Buffer) - Message, " (using %d kB)", pScreenInfo->videoRam); } + xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, "%s.\n", Buffer); } @@ -412,12 +405,18 @@ resPtr pResources; pciVideoPtr pVideo; DisplayModePtr pMode; + xf86Int10InfoPtr pInt10Info = NULL; + vbeInfoPtr pVBE; + pointer pInt10Module, pDDCModule = NULL, pVBEModule = NULL; unsigned long Block0Base; CARD32 IOValue; - int i, j, AcceleratorVideoRAM = 0, ServerVideoRAM; + int i, j; + int VGAVideoRAM = 0, AcceleratorVideoRAM = 0, ServerVideoRAM; int Numerator, Denominator; int MinX, MinY; + rgb defaultMask = {0, 0, 0}; ClockRange ATIClockRange = {NULL, 0, 80000, 0, TRUE, TRUE, 1, 1, 0}; + resRange Resources[2] = {{0, 0, 0}, _END}; int DefaultmaxClock = 0; int minPitch, maxPitch = 0xFFU, maxHeight = 0; int ApertureSize = 0x00010000U; @@ -427,16 +426,6 @@ # define pATIHW (&pATI->OldHW) -#ifndef AVOID_CPIO - - xf86Int10InfoPtr pInt10Info = NULL; - vbeInfoPtr pVBE; - pointer pInt10Module, pDDCModule = NULL, pVBEModule = NULL; - int VGAVideoRAM = 0; - resRange Resources[2] = {{0, 0, 0}, _END}; - -#endif /* AVOID_CPIO */ - if (pScreenInfo->numEntities != 1) { xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, @@ -482,9 +471,6 @@ /* Promote chipset specification */ switch (pATI->Chipset) { - -#ifndef AVOID_CPIO - case ATI_CHIPSET_IBMVGA: if (pATI->Adapter == ATI_ADAPTER_VGA) break; /* XXX */ @@ -501,9 +487,6 @@ case ATI_CHIPSET_MACH8: case ATI_CHIPSET_MACH32: - -#endif /* AVOID_CPIO */ - case ATI_CHIPSET_MACH64: case ATI_CHIPSET_RAGE128: case ATI_CHIPSET_RADEON: @@ -537,15 +520,9 @@ { static const CARD8 AllowedDepthBpp[][2] = { - -#ifndef AVOID_CPIO - { 1, 1}, { 4, 4}, { 4, 8}, - -#endif /* AVOID_CPIO */ - { 8, 8}, {15, 16}, {16, 16}, @@ -584,24 +561,83 @@ return FALSE; } - /* Pick up XF86Config options */ + /* + * Pick up XF86Config options. This can only be done after + * xf86SetDepthBpp() has been called. + */ ATIProcessOptions(pScreenInfo, pATI); - } -#ifdef AVOID_CPIO + pATI->ATIApplyEndian = ATIEndianCopy; - else /* if (flags & PROBE_DETECT) */ - { - return TRUE; - } + if (ATIEndian.endian == ATI_BIG_ENDIAN) + { + if (pScreenInfo->bitsPerPixel == 24) + { + /* + * For bpp 24, the common layer's xf86SetWeight() sets a + * default of 'RGB'. Byte-swap this to 'BGR'. + */ + defaultMask.red = 0x000000FFU; + defaultMask.green = 0x0000FF00U; + defaultMask.blue = 0x00FF0000U; -#else /* AVOID_CPIO */ + pATI->ATIApplyEndian = ATIEndianSwap24; + } + else if (pScreenInfo->depth == 24) + { + if ((pATI->Chip < ATI_CHIP_264VTB) || !pATI->OptionLinear) + { + /* + * For bpp 32, the common layer's xf86SetWeight() sets a + * default of 'aRGB'. In the absence of a big-endian + * aperture, byte-swap this to 'BGRa'. + */ + defaultMask.red = 0x0000FF00U; + defaultMask.green = 0x00FF0000U; + defaultMask.blue = 0xFF000000U; + + pATI->ATIApplyEndian = ATIEndianSwap32; + } + } + else if (pScreenInfo->bitsPerPixel > 8) + { + /* + * A big-endian aperture is required in this case unless all + * draw primitives are guaranteed to be accelerated, which + * currently isn't the case, with or without XAA. + */ + if (pATI->Chip < ATI_CHIP_264VTB) + { + xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, + "This adapter does not provide a big-endian aperture" + " for depth %d.\n", pScreenInfo->depth); + return FALSE; + } + + /* + * "NoLinear" isn't the default, so respect the user's choice + * instead of over-ridding it. + */ + if (!pATI->OptionLinear) + { + xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, + "Depth %d is not supported without a big-endian" + " aperture.\n", pScreenInfo->depth); + return FALSE; + } + } + } + } /* * If there is an ix86-style BIOS, ensure its initialisation entry point * has been executed, and retrieve DDC and VBE information from it. + * XXX Should this be done for adapters accessed through MEMORY_IO? */ - if (!(pInt10Module = ATILoadModule(pScreenInfo, "int10", ATIint10Symbols))) + xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, + "Initialising int10 interface.\n"); + pInt10Module = ATILoadSubModule(pScreenInfo, "int10", ATIint10Symbols); + if (!pInt10Module) { xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, "Unable to load int10 module.\n"); @@ -613,25 +649,33 @@ } else { - if (!(pDDCModule = ATILoadModule(pScreenInfo, "ddc", ATIddcSymbols))) + xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, + "Determining BIOS support for VBE.\n"); + pDDCModule = ATILoadSubModule(pScreenInfo, "ddc", ATIddcSymbols); + if (!pDDCModule) { xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, "Unable to load ddc module.\n"); } else - if (!(pVBEModule = ATILoadModule(pScreenInfo, "vbe", ATIvbeSymbols))) - { - xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, - "Unable to load vbe module.\n"); - } - else { - if ((pVBE = VBEInit(pInt10Info, pATI->iEntity))) + pVBEModule = ATILoadVBEModule(pScreenInfo); + if (!pVBEModule) + { + xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, + "Unable to load vbe module.\n"); + } + else { - ConfiguredMonitor = vbeDoEDID(pVBE, pDDCModule); - vbeFree(pVBE); + if ((pVBE = VBEInit(pInt10Info, pATI->iEntity))) + { + xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, + "Video BIOS supports VBE.\n"); + ConfiguredMonitor = vbeDoEDID(pVBE, pDDCModule); + vbeFree(pVBE); + } + xf86UnloadSubModule(pVBEModule); } - xf86UnloadSubModule(pVBEModule); } if (!(flags & PROBE_DETECT)) @@ -673,13 +717,11 @@ /* DDC module is no longer needed at this point */ xf86UnloadSubModule(pDDCModule); -#endif /* AVOID_CPIO */ - pATI->Block0Base = 0; /* Might no longer be valid */ if ((pVideo = pATI->PCIInfo)) { - if (pATI->CPIODecoding == BLOCK_IO) - pATI->CPIOBase = pVideo->ioBase[1]; + if (pVideo->ioBase[1]) + pATI->CPIOBase = pVideo->ioBase[1] + pATI->DomainIOBase; /* Set MMIO address from PCI configuration space, if available */ if ((pATI->Block0Base = pVideo->memBase[2])) @@ -691,19 +733,10 @@ } } -#ifdef AVOID_CPIO - - pScreenInfo->racMemFlags = - RAC_FB | RAC_COLORMAP | RAC_VIEWPORT | RAC_CURSOR; - -#else /* AVOID_CPIO */ - pScreenInfo->racIoFlags = RAC_FB | RAC_COLORMAP | RAC_VIEWPORT | RAC_CURSOR; pScreenInfo->racMemFlags = RAC_FB | RAC_CURSOR; -#endif /* AVOID_CPIO */ - /* Deal with ChipID & ChipRev overrides */ if (pGDev->chipID >= 0) { @@ -739,17 +772,11 @@ /* Finish private area initialisation */ pATI->DAC = ATI_DAC_GENERIC; - -#ifndef AVOID_CPIO - pATI->NewHW.SetBank = ATIx8800SetBank; pATI->BankInfo.SetSourceBank = ATIx8800SetRead; pATI->BankInfo.SetDestinationBank = ATIx8800SetWrite; pATI->BankInfo.SetSourceAndDestinationBanks = ATIx8800SetReadWrite; pATI->BankInfo.BankSize = 0x00010000U; /* 64kB */ - -#endif /* AVOID_CPIO */ - pATI->LCDPanelID = -1; pATI->nFIFOEntries = 16; /* For now */ pATI->Audio = ATI_AUDIO_NONE; @@ -757,9 +784,6 @@ /* Finish probing the adapter */ switch (pATI->Adapter) { - -#ifndef AVOID_CPIO - case ATI_ADAPTER_NONE: case ATI_ADAPTER_EGA: case ATI_ADAPTER_EGA_PLUS: @@ -815,12 +839,10 @@ * size. */ if ((pATI->Chip == ATI_CHIP_68800_6) && (pATI->VideoRAM == 1024)) - pATI->VideoRAM = ATIMach32videoRam(); + pATI->VideoRAM = ATIMach32videoRam(pATI); break; -#endif /* AVOID_CPIO */ - case ATI_ADAPTER_MACH64: do { @@ -855,17 +877,15 @@ } while (0); pATI->Block0Base = Block0Base; -#ifdef AVOID_CPIO - - if (!pATI->pBlock[0]) + if ((pATI->IODecoding == MEMORY_IO) && !pATI->pBlock[0]) { xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, "Unable to mmap() adapter registers.\n"); + ATIUnmapApertures(pScreenInfo->scrnIndex, pATI); return FALSE; } -#endif /* AVOID_CPIO */ - + /* XXX Need a similar test for GX/CX */ pATIHW->crtc_gen_cntl = inr(CRTC_GEN_CNTL); if (!(pATIHW->crtc_gen_cntl & CRTC_EN) && (pATI->Chip >= ATI_CHIP_264CT)) @@ -877,20 +897,6 @@ return FALSE; } -#ifdef AVOID_CPIO - - if (!(pATIHW->crtc_gen_cntl & CRTC_EXT_DISP_EN)) - { - xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, - "Adapters found to be in VGA mode on server entry are not" - " supported by the MMIO-only version of this driver.\n"); - ATIPrintNoiseIfRequested(pATI, BIOS, BIOSSize); - ATIUnmapApertures(pScreenInfo->scrnIndex, pATI); - return FALSE; - } - -#endif /* AVOID_CPIO */ - pATIHW->mem_cntl = inr(MEM_CNTL); if (pATI->Chip < ATI_CHIP_264VTB) { @@ -1011,13 +1017,7 @@ * For Mach64 adapters, pick up, from the BIOS, the type of programmable * clock generator (if any), and various information about it. */ - -#ifndef AVOID_CPIO - if (pATI->Chip >= ATI_CHIP_88800GXC) - -#endif /* AVOID_CPIO */ - { CARD16 ClockDac; @@ -1070,7 +1070,7 @@ pATI->ProgrammableClock = BIOSByte(ClockTable); pATI->ClockNumberToProgramme = BIOSByte(ClockTable + 0x06U); - switch (BIOSWord(ClockTable + 0x08U) / 10) + switch ((BIOSWord(ClockTable + 0x08U) + 5) / 10) { case 143: pATI->ReferenceNumerator = 157500; @@ -1082,6 +1082,11 @@ pATI->ReferenceDenominator = 11; break; + case 295: + pATI->ReferenceNumerator = 324480; + pATI->ReferenceDenominator = 11; + break; + default: pATI->ReferenceNumerator = BIOSWord(ClockTable + 0x08U) * 10; @@ -1179,10 +1184,10 @@ case ATI_CLOCK_INTERNAL: /* * The reference divider has already been programmed by BIOS - * initialisation. Because, there is only one reference - * divider for all generated frequencies (including MCLK), it - * cannot be changed without reprogramming all clocks every - * time one of them needs a different reference divider. + * initialisation. Because there is only one reference divider + * for all generated frequencies (including MCLK), it cannot be + * changed without reprogramming all clocks every time one of + * them needs a different reference divider. * * Besides, it's not a good idea to change the reference * divider. BIOS initialisation sets it to a value that @@ -1388,8 +1393,6 @@ ATIUnlock(pATI); /* Unlock registers */ -#ifndef AVOID_CPIO - /* Sometimes, the BIOS lies about the chip */ if ((pATI->Chip >= ATI_CHIP_28800_4) && (pATI->Chip <= ATI_CHIP_28800_6)) { @@ -1399,18 +1402,11 @@ pATI->Chip = IOValue; } -#endif /* AVOID_CPIO */ - /* Report what was found */ xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, "%s graphics controller detected.\n", ATIChipNames[pATI->Chip]); -#ifndef AVOID_CPIO - if ((pATI->Chip >= ATI_CHIP_68800) && (pATI->Chip != ATI_CHIP_68800_3)) - -#endif /* AVOID_CPIO */ - { Message = Buffer + snprintf(Buffer, SizeOf(Buffer), "Chip type %04X", pATI->ChipType); @@ -1432,32 +1428,28 @@ Buffer, pATI->ChipClass, pATI->ChipRevision); } -#ifndef AVOID_CPIO + xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, "Adapter is in domain %d.\n", + pATI->Domain); if (pATI->Adapter >= ATI_ADAPTER_MACH8) - -#endif /* AVOID_CPIO */ - { Message = Buffer + snprintf(Buffer, SizeOf(Buffer), "%s bus interface detected", ATIBusNames[pATI->BusType]); -#ifndef AVOID_CPIO - - if (pATI->Adapter >= ATI_ADAPTER_MACH64) - { + if ((pATI->Adapter >= ATI_ADAPTER_MACH64) && + (pATI->IODecoding != MEMORY_IO)) Message += snprintf(Message, Buffer + SizeOf(Buffer) - Message, "; %s I/O base is 0x%04lX", - (pATI->CPIODecoding == SPARSE_IO) ? "sparse" : "block", - pATI->CPIOBase); - } - -#endif /* AVOID_CPIO */ + (pATI->IODecoding == SPARSE_IO) ? "sparse" : "block", + pATI->CPIOBase - pATI->DomainIOBase); xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, "%s.\n", Buffer); - } -#ifndef AVOID_CPIO + if (pVideo) + xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, + "Adapter is on bus %d, device %d, function %d.\n", + pVideo->bus, pVideo->device, pVideo->func); + } if (pATI->CPIO_VGAWonder) xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, @@ -1470,8 +1462,6 @@ " memory.\n", ATIChipNames[pATI->Coprocessor], pATI->VideoRAM); -#endif /* AVOID_CPIO */ - xf86DrvMsg(pScreenInfo->scrnIndex, X_PROBED, "%s adapter detected.\n", ATIAdapterNames[pATI->Adapter]); @@ -1507,20 +1497,6 @@ } } -#ifdef AVOID_CPIO - - if (!xf86LinearVidMem()) - { - xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, - "A linear aperture is not available.\n"); - ATILock(pATI); - ATIPrintNoiseIfRequested(pATI, BIOS, BIOSSize); - ATIUnmapApertures(pScreenInfo->scrnIndex, pATI); - return FALSE; - } - -#endif /* AVOID_CPIO */ - /* * Set colour weights. */ @@ -1530,7 +1506,7 @@ else pScreenInfo->rgbBits = 8; pATI->rgbBits = pScreenInfo->rgbBits; - if (!xf86SetWeight(pScreenInfo, defaultWeight, defaultWeight)) + if (!xf86SetWeight(pScreenInfo, defaultWeight, defaultMask)) { ATILock(pATI); ATIPrintNoiseIfRequested(pATI, BIOS, BIOSSize); @@ -1585,13 +1561,7 @@ /* * Set colour gamma. */ - -#ifndef AVOID_CPIO - if (pScreenInfo->depth > 1) - -#endif /* AVOID_CPIO */ - { if (!xf86SetGamma(pScreenInfo, defaultGamma)) { @@ -1610,23 +1580,15 @@ /* * Determine which CRT controller to use for video modes. */ - -#ifndef AVOID_CPIO - if ((pATI->Chip >= ATI_CHIP_88800GXC) && (pATI->depth >= 8) && (pATI->Chipset == ATI_CHIPSET_ATI)) - -#endif /* AVOID_CPIO */ - { pATI->NewHW.crtc = ATI_CRTC_MACH64; xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, "Using Mach64 accelerator CRTC.\n"); -#ifndef AVOID_CPIO - if (pATI->VGAAdapter != ATI_ADAPTER_NONE) { /* @@ -1655,13 +1617,7 @@ } } } - -#endif /* AVOID_CPIO */ - } - -#ifndef AVOID_CPIO - else { pATI->NewHW.crtc = ATI_CRTC_VGA; @@ -1694,8 +1650,6 @@ } } -#endif /* AVOID_CPIO */ - /* * Decide between the CRT and the panel. */ @@ -1743,8 +1697,6 @@ pATIHW->lcd_gen_ctrl & ~SHADOW_RW_EN); } -#ifndef AVOID_CPIO - if (!(pATIHW->crtc_gen_cntl & CRTC_EXT_DISP_EN)) { unsigned HBlankStart, HSyncStart, HSyncEnd, HBlankEnd, HTotal; @@ -1927,9 +1879,6 @@ VDisplay = VTotal + 2 - pATI->LCDVBlankWidth; } else - -#endif /* AVOID_CPIO */ - { pATIHW->clock = inr(CLOCK_CNTL) & 0x03U; @@ -2301,11 +2250,7 @@ /* * Finish detecting video RAM size. */ - pScreenInfo->videoRam = pATI->VideoRAM; - -#ifndef AVOID_CPIO - - AcceleratorVideoRAM = pScreenInfo->videoRam; + AcceleratorVideoRAM = pScreenInfo->videoRam = pATI->VideoRAM; if (pATI->Chip == ATI_CHIP_VGA) { if (pATI->depth <= 4) @@ -2375,17 +2320,8 @@ } else if ((pATI->NewHW.crtc == ATI_CRTC_MACH64) || (pATI->Chip >= ATI_CHIP_264CT)) - -#endif /* AVOID_CPIO */ - { - -#ifndef AVOID_CPIO - if (pATI->depth >= 8) - -#endif /* AVOID_CPIO */ - { /* Get adapter's linear aperture configuration */ pATIHW->config_cntl = inr(CONFIG_CNTL); @@ -2410,8 +2346,6 @@ } } -#ifndef AVOID_CPIO - /* Except for PCI & AGP, allow for user override */ if (!pVideo) { @@ -2463,8 +2397,6 @@ } } -#endif /* AVOID_CPIO */ - if (pATI->LinearBase && pATI->LinearSize) { /* @@ -2508,60 +2440,62 @@ pATI->CursorBase); } -#ifndef AVOID_CPIO - if (pATI->OptionLinear) - -#endif /* AVOID_CPIO */ - { CARD32 PageSize = (getpagesize() + 1023) >> 10; -#if X_BYTE_ORDER == X_LITTLE_ENDIAN - - /* - * MMIO areas must be mmap()'ed separately to avoid write - * combining them. Thus, they might not end up still - * adjacent with the little-endian linear aperture after - * mmap()'ing. So, round down the linear aperture size to - * avoid an overlap. Any hardware cursor image area might - * not end up being write combined, but this seems - * preferable to further reducing the video memory size - * advertised to the server. - * - * XXX Ideally this should be dealt with in the os-support - * layer, i.e., it should be possible to reset a - * subarea's write combining after it has been - * mmap()'ed, but doing so currently causes the removal - * of write combining for the entire aperture. - */ - if (pATI->MMIOInLinear) - AcceleratorVideoRAM -= AcceleratorVideoRAM % PageSize; - -#else /* if X_BYTE_ORDER != X_LITTLE_ENDIAN */ - /* - * Big-endian apertures are 8 MB higher and don't contain - * an MMIO area. + * Note: At this point, big-endian depths 15 & 16 without + * an appropriate aperture have already been disallowed. */ - pATI->LinearBase += 0x00800000U; - AcceleratorVideoRAM = pATI->LinearSize >> 10; - -#endif /* X_BYTE_ORDER */ + if ((ATIEndian.endian == ATI_LITTLE_ENDIAN) || + (pATI->Chip < ATI_CHIP_264VTB)) + { + /* + * MMIO areas must be mmap()'ed separately to avoid + * write-combining them. Thus, they might not end up + * still adjacent with the little-endian linear + * aperture after mmap()'ing. So, round down the + * linear aperture size to avoid an overlap. Any + * hardware cursor image area might not end up being + * write-combined, but this seems preferable to further + * reducing the video memory size advertised to the + * server. + * + * XXX Ideally this should be dealt with in the + * os-support layer, i.e., it should be possible to + * reset a subarea's write-combining after it has + * been mmap()'ed, but doing so currently causes + * the removal of write-combining for the entire + * aperture. + */ + if (pATI->MMIOInLinear) + AcceleratorVideoRAM -= + AcceleratorVideoRAM % PageSize; + } + else + { + /* + * Big-endian apertures are 8 MB higher and don't + * contain an MMIO area. + */ + pATI->LinearBase += 0x00800000U; + AcceleratorVideoRAM = pATI->LinearSize >> 10; + } if (ServerVideoRAM > AcceleratorVideoRAM) ServerVideoRAM = AcceleratorVideoRAM; else if (AcceleratorVideoRAM > pATI->VideoRAM) AcceleratorVideoRAM = pATI->VideoRAM; - PageSize--; - AcceleratorVideoRAM = - (AcceleratorVideoRAM + PageSize) & ~PageSize; - xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, "Using %d MB linear aperture at 0x%08lX.\n", pATI->LinearSize >> 20, pATI->LinearBase); + PageSize--; + AcceleratorVideoRAM = + (AcceleratorVideoRAM + PageSize) & ~PageSize; + /* Only mmap what is needed */ ApertureSize = pATI->LinearSize = AcceleratorVideoRAM << 10; @@ -2573,14 +2507,11 @@ xf86DrvMsg(pScreenInfo->scrnIndex, X_NOTICE, "Virtual resolutions will be limited to %d kB\n due to" " linear aperture size and/or placement of hardware" - " cursor image area.\n", - ServerVideoRAM); + " cursor image area.\n", ServerVideoRAM); } } } -#ifndef AVOID_CPIO - /* Set up for a banked aperture */ if (pATI->VGAAdapter != ATI_ADAPTER_NONE) { @@ -2620,17 +2551,9 @@ if (!pATI->OptionLinear) pATI->LinearBase = 0; /* Not needed */ -#endif /* AVOID_CPIO */ - if (!pATI->LinearBase || !pATI->LinearSize) { - -#ifndef AVOID_CPIO - if (pATI->VGAAdapter == ATI_ADAPTER_NONE) - -#endif /* AVOID_CPIO */ - { xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, "Linear aperture not available.\n"); @@ -2640,13 +2563,8 @@ return FALSE; } -#ifndef AVOID_CPIO - /* Insurance */ pATI->LinearBase = pATI->LinearSize = 0; - -#endif /* AVOID_CPIO */ - } if (pATI->Block0Base) @@ -2664,9 +2582,6 @@ } } } - -#ifndef AVOID_CPIO - else /* * After BIOS initialisation, the accelerator (if any) and the VGA won't @@ -2726,8 +2641,6 @@ } } -#endif /* AVOID_CPIO */ - if ((pATI->Cursor > ATI_CURSOR_SOFTWARE) && !pATI->CursorBase) { xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, @@ -2749,9 +2662,6 @@ if (pATI->OptionAccel) { - -#ifndef AVOID_CPIO - if (!pATI->Block0Base || (pATI->NewHW.crtc == ATI_CRTC_VGA)) { xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, @@ -2759,9 +2669,6 @@ pATI->OptionAccel = FALSE; } else - -#endif /* AVOID_CPIO */ - { xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, "MMIO write caching %sabled.\n", @@ -2769,12 +2676,7 @@ } } -#ifndef AVOID_CPIO - if (pATI->Adapter >= ATI_ADAPTER_MACH32) - -#endif /* AVOID_CPIO */ - { if (pATI->Chip >= ATI_CHIP_264CT) ATIReportMemory(pScreenInfo, pATI, @@ -2786,9 +2688,6 @@ ATIReportMemory(pScreenInfo, pATI, ATIMemoryTypeNames_Mach[pATI->MemoryType]); } - -#ifndef AVOID_CPIO - else if (pATI->Adapter >= ATI_ADAPTER_V3) { ATIReportMemory(pScreenInfo, pATI, @@ -2799,33 +2698,16 @@ ATIReportMemory(pScreenInfo, pATI, "video memory"); } -#endif /* AVOID_CPIO */ - /* * Finish banking setup. This needs to be fixed to not assume the mode on * entry is a VGA mode. XXX */ - -#ifndef AVOID_CPIO - if (pATI->VGAAdapter == ATI_ADAPTER_NONE) - -#endif /* AVOID_CPIO */ - { pATIHW->crtc = pATI->NewHW.crtc; - -#ifndef AVOID_CPIO - pATIHW->SetBank = (ATIBankProcPtr)NoopDDA; pATI->BankInfo.BankSize = 0; /* No banking */ - -#endif /* AVOID_CPIO */ - } - -#ifndef AVOID_CPIO - else { pATIHW->crtc = ATI_CRTC_VGA; @@ -2892,14 +2774,9 @@ pATI->BankInfo.BankSize = 0; /* No banking */ } -#endif /* AVOID_CPIO */ - if (pATI->OptionShadowFB) { /* Until ShadowFB becomes a true screen wrapper, if it ever does... */ - -#ifndef AVOID_CPIO - if (pATI->BankInfo.BankSize) { xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, @@ -2912,11 +2789,7 @@ "Cannot shadow a planar frame buffer.\n"); pATI->OptionShadowFB = FALSE; } - else - -#endif /* AVOID_CPIO */ - - if (pATI->OptionAccel) + else if (pATI->OptionAccel) { xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, "Cannot shadow an accelerated frame buffer.\n"); @@ -2977,25 +2850,13 @@ Denominator = pATI->ClockDescriptor.MinM * pATI->XCLKReferenceDivider * pATI->ReferenceDenominator; -#ifndef AVOID_CPIO - if (pATI->depth >= 8) - -#endif /* AVOID_CPIO */ - - { Denominator *= pATI->bitsPerPixel / 4; - } i = (6 - 2) - pATI->XCLKPostDivider; - -#ifndef AVOID_CPIO - if (pATI->NewHW.crtc == ATI_CRTC_VGA) i--; -#endif /* AVOID_CPIO */ - i = (ATIDivide(Numerator, Denominator, i, -1) / 1000) * 1000; if (i < ATIClockRange.maxClock) ATIClockRange.maxClock = i; @@ -3067,26 +2928,13 @@ case ATI_DAC_IBMRGB514: pATI->maxClock = 220000; - -#ifndef AVOID_CPIO - if (pATI->NewHW.crtc == ATI_CRTC_VGA) - { DefaultmaxClock = 100000; - } else - -#endif /* AVOID_CPIO */ - - { DefaultmaxClock = 220000; - } break; default: - -#ifndef AVOID_CPIO - /* * 80 MHz is too high in some cases. Limit 18800-x's to 40 * MHz. Don't exceed the memory clock on VGA Wonder capables @@ -3094,23 +2942,14 @@ */ if ((pATI->Chip == ATI_CHIP_18800) || (pATI->Chip == ATI_CHIP_18800_1)) - { DefaultmaxClock = 40000; - } else if (pATI->CPIO_VGAWonder && (pATI->VideoRAM < 1024) && (pATI->depth >= 8)) - { DefaultmaxClock = (GetBits(BIOSByte(0x44U), 0x04U) * 5000) + 40000; - } else - -#endif /* AVOID_CPIO */ - - { DefaultmaxClock = 80000; - } break; } @@ -3139,15 +2978,6 @@ * Mode validation. */ -#ifdef AVOID_CPIO - - if (pATI->Chip >= ATI_CHIP_264CT) - { - minPitch = 8; - } - -#else /* AVOID_CPIO */ - if ((pATI->depth >= 8) && (pATI->Chip >= ATI_CHIP_264CT)) { minPitch = 8; @@ -3160,31 +2990,17 @@ minPitch = 32; /* Very strange, but true */ maxPitch = 0x3FU; } - -#endif /* AVOID_CPIO */ - else { minPitch = 16; } pATI->pitchInc = minPitch; - -#ifndef AVOID_CPIO - if (pATI->depth >= 8) - -#endif /* AVOID_CPIO */ - - { pATI->pitchInc *= pATI->bitsPerPixel; - } switch (pATI->NewHW.crtc) { - -#ifndef AVOID_CPIO - case ATI_CRTC_VGA: /* * IBM's VGA doesn't allow for interlaced modes. @@ -3226,8 +3042,6 @@ break; -#endif /* AVOID_CPIO */ - case ATI_CRTC_MACH64: pScreenInfo->maxHValue = (MaxBits(CRTC_H_TOTAL) + 1) << 3; @@ -3427,7 +3241,7 @@ xf86SetDpi(pScreenInfo, 0, 0); /* Load required modules */ - if (!ATILoadModules(pScreenInfo, pATI)) + if (!ATILoadSubModules(pScreenInfo, pATI)) { ATILock(pATI); ATIPrintNoiseIfRequested(pATI, BIOS, BIOSSize); Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h:1.8 xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h:1.9 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h:1.8 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h,v 1.8 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.h,v 1.9 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1999 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c:1.30 xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c:1.38 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c:1.30 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c Tue Apr 18 11:52:57 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c,v 1.30 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.c,v 1.38 2006/04/18 15:52:57 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -29,53 +29,76 @@ #include "atiprint.h" #include "atiwonderio.h" +static const char digits[] = "0123456789ABCDEF"; + /* - * ATIPrintBIOS -- + * ATIPrintMemory -- * - * Display various parts of the BIOS when the server is invoked with -verbose. + * Print to stderr a formatted dump of a memory region. */ void -ATIPrintBIOS +ATIPrintMemory ( - const CARD8 *BIOS, - const unsigned int Length /* A multiple of 512 */ + const CARD8 *pMemory, + const unsigned int Length, + const int Verbosity ) { unsigned char *Char = NULL; unsigned int Index; unsigned char Printable[17]; + char Buffer[128], *Message = NULL; - if (xf86GetVerbosity() <= 4) - return; - - (void)memset(Printable, 0, SizeOf(Printable)); - - xf86ErrorFVerb(5, "\n BIOS image:"); - - for (Index = 0; Index < Length; Index++) + for (Index = 0; Index <= (Length + (16U - 1U)); Index++) { if (!(Index & (4U - 1U))) { if (!(Index & (16U - 1U))) { - if (Printable[0]) - xf86ErrorFVerb(5, " |%s|", Printable); + if (Char) + { + *Message = 0; + *Char = 0; + xf86ErrorFVerb(Verbosity, "%s |%s|\n", Buffer, Printable); + if (Index >= Length) + return; + } + Char = Printable; - xf86ErrorFVerb(5, "\n 0x%08X: ", Index); + Message = Buffer + + snprintf(Buffer, SizeOf(Buffer), " 0x%08X: ", Index); } - xf86ErrorFVerb(5, " "); + + *Message++ = ' '; } - xf86ErrorFVerb(5, "%02X", BIOS[Index]); - if (isprint(BIOS[Index])) - *Char++ = BIOS[Index]; + + *Message++ = digits[pMemory[Index] >> 4]; + *Message++ = digits[pMemory[Index] & (16U - 1U)]; + if ((pMemory[Index] >= 0x20U) && (pMemory[Index] < 0x7FU)) + *Char++ = pMemory[Index]; else *Char++ = '.'; } - - xf86ErrorFVerb(5, " |%s|\n", Printable); } -#ifndef AVOID_CPIO +/* + * ATIPrintBIOS -- + * + * Display the BIOS when the server is invoked with -verbose. + */ +void +ATIPrintBIOS +( + const CARD8 *BIOS, + const unsigned int Length +) +{ + if (xf86GetVerbosity() <= 4) + return; + + xf86ErrorFVerb(5, "\n BIOS image:\n"); + ATIPrintMemory(BIOS, Length, 5); +} /* * ATIPrintIndexedRegisters -- @@ -86,16 +109,21 @@ static void ATIPrintIndexedRegisters ( + ATIPtr pATI, const IOADDRESS Port, const CARD8 StartIndex, const CARD8 EndIndex, const char *Name, - const IOADDRESS GenS1 + const IOADDRESS CrtcIOBase ) { int Index; xf86ErrorFVerb(4, "\n %s register values:", Name); + + if (Port == ATTRX) + xf86InterceptSignals(&pATI->CaughtSignal); + for (Index = StartIndex; Index < EndIndex; Index++) { if (!(Index & (4U - 1U))) @@ -104,22 +132,23 @@ xf86ErrorFVerb(4, "\n 0x%02X: ", Index); xf86ErrorFVerb(4, " "); } + if (Port == ATTRX) - (void)inb(GenS1); /* Reset flip-flop */ + (void)inb(GENS1(CrtcIOBase)); /* Reset flip-flop */ xf86ErrorFVerb(4, "%02X", GetReg(Port, Index)); } if (Port == ATTRX) { - (void)inb(GenS1); /* Reset flip-flop */ + (void)inb(GENS1(CrtcIOBase)); /* Reset flip-flop */ outb(ATTRX, 0x20U); /* Turn on PAS bit */ + + xf86InterceptSignals(NULL); } xf86ErrorFVerb(4, "\n"); } -#endif /* AVOID_CPIO */ - /* * ATIMach64PrintRegisters -- * @@ -129,55 +158,102 @@ static void ATIMach64PrintRegisters ( - ATIPtr pATI, - CARD8 *crtc, - const char *Description + ATIPtr pATI, + ATICRTCType *crtc, + const char *Description, + Bool OnlyFirst256 ) { CARD32 IOValue; CARD8 dac_read, dac_mask, dac_data, dac_write; - int Index, Limit; + unsigned long Index = 0, Limit, Step; -#ifndef AVOID_CPIO - - int Step; + xf86ErrorFVerb(4, "\n Mach64 %s register values:", Description); -#endif /* AVOID_CPIO */ + if (pATI->IODecoding != MEMORY_IO) + { + Limit = ATIIOPort(IOPortTag(0x1FU, 0x3FU)); + Step = ATIIOPort(IOPortTag(0x01U, 0x01U)) - pATI->CPIOBase; + for (Index = pATI->CPIOBase; Index <= Limit; Index += Step) + { + if (!(((Index - pATI->CPIOBase) / Step) & 0x03U)) + xf86ErrorFVerb(4, "\n 0x%04lX: ", Index - pATI->DomainIOBase); + if (Index == ATIIOPort(DAC_REGS)) + { + dac_read = in8(DAC_REGS + 3); + DACDelay(in8(M64_DAC_WAIT)); + dac_mask = in8(DAC_REGS + 2); + DACDelay(in8(M64_DAC_WAIT)); + dac_data = in8(DAC_REGS + 1); + DACDelay(in8(M64_DAC_WAIT)); + dac_write = in8(DAC_REGS + 0); + DACDelay(in8(M64_DAC_WAIT)); + + xf86ErrorFVerb(4, " %02X%02X%02X%02X", + dac_read, dac_mask, dac_data, dac_write); + + out8(DAC_REGS + 2, dac_mask); + DACDelay(in8(M64_DAC_WAIT)); + out8(DAC_REGS + 3, dac_read); + DACDelay(in8(M64_DAC_WAIT)); + } + else + { + /* Must break an atimach64io.h rule here */ + IOValue = inl(Index); + + if ((Index == ATIIOPort(CRTC_GEN_CNTL)) && + (IOValue & CRTC_EXT_DISP_EN)) + *crtc = ATI_CRTC_MACH64; + + xf86ErrorFVerb(4, " %08lX", (unsigned long)IOValue); + } + } - xf86ErrorFVerb(4, "\n Mach64 %s register values:", Description); + xf86ErrorFVerb(4, "\n"); -#ifdef AVOID_CPIO + if (pATI->IODecoding == SPARSE_IO) + Index = 0; + else + Index = DST_OFF_PITCH; + } - if (pATI->pBlock[1]) + if (OnlyFirst256) + Limit = TVO_CNTL; + else if (pATI->pBlock[1]) Limit = DWORD_SELECT; else Limit = MM_IO_SELECT; - for (Index = 0; Index <= Limit; Index += UnitOf(MM_IO_SELECT)) + if (Index > Limit) + return; + + for (; Index <= Limit; Index += UnitOf(MM_IO_SELECT)) { if (!(Index & SetBits(3, MM_IO_SELECT))) - xf86ErrorFVerb(4, "\n 0x%04X: ", Index); + xf86ErrorFVerb(4, "\n 0x%04lX: ", Index); if (Index == (DAC_REGS & DWORD_SELECT)) { dac_read = in8(DAC_REGS + 3); - DACDelay; + DACDelay(in8(M64_DAC_WAIT)); dac_mask = in8(DAC_REGS + 2); - DACDelay; + DACDelay(in8(M64_DAC_WAIT)); dac_data = in8(DAC_REGS + 1); - DACDelay; + DACDelay(in8(M64_DAC_WAIT)); dac_write = in8(DAC_REGS + 0); - DACDelay; + DACDelay(in8(M64_DAC_WAIT)); xf86ErrorFVerb(4, " %02X%02X%02X%02X", dac_read, dac_mask, dac_data, dac_write); out8(DAC_REGS + 2, dac_mask); - DACDelay; + DACDelay(in8(M64_DAC_WAIT)); out8(DAC_REGS + 3, dac_read); - DACDelay; + DACDelay(in8(M64_DAC_WAIT)); } else { + /* Must break an atimach64io.h rule here */ IOValue = inm(Index); if ((Index == (CRTC_GEN_CNTL & DWORD_SELECT)) && @@ -188,47 +264,6 @@ } } -#else /* AVOID_CPIO */ - - Limit = ATIIOPort(IOPortTag(0x1FU, 0x3FU)); - Step = ATIIOPort(IOPortTag(0x01U, 0x01U)) - pATI->CPIOBase; - for (Index = pATI->CPIOBase; Index <= Limit; Index += Step) - { - if (!(((Index - pATI->CPIOBase) / Step) & 0x03U)) - xf86ErrorFVerb(4, "\n 0x%04X: ", Index); - if (Index == (int)ATIIOPort(DAC_REGS)) - { - dac_read = in8(DAC_REGS + 3); - DACDelay; - dac_mask = in8(DAC_REGS + 2); - DACDelay; - dac_data = in8(DAC_REGS + 1); - DACDelay; - dac_write = in8(DAC_REGS + 0); - DACDelay; - - xf86ErrorFVerb(4, " %02X%02X%02X%02X", - dac_read, dac_mask, dac_data, dac_write); - - out8(DAC_REGS + 2, dac_mask); - DACDelay; - out8(DAC_REGS + 3, dac_read); - DACDelay; - } - else - { - IOValue = inl(Index); - - if ((Index == (int)ATIIOPort(CRTC_GEN_CNTL)) && - (IOValue & CRTC_EXT_DISP_EN)) - *crtc = ATI_CRTC_MACH64; - - xf86ErrorFVerb(4, " %08lX", (unsigned long)IOValue); - } - } - -#endif /* AVOID_CPIO */ - xf86ErrorFVerb(4, "\n"); } @@ -274,6 +309,92 @@ } /* + * ATICH8398PrintRegisters -- + * + * Display Chrontel 8398 registers when the server is invoked with -verbose. + */ +static void +ATICH8398PrintRegisters +( + ATIPtr pATI +) +{ + CARD32 crtc_gen_cntl, dac_cntl; + CARD8 index_read, index_write; + CARD8 cs, idr, cr, aux, test; + int Index; + + /* Temporarily switch to Mach64 CRTC */ + crtc_gen_cntl = inr(CRTC_GEN_CNTL); + if (!(crtc_gen_cntl & CRTC_EXT_DISP_EN)) + outr(CRTC_GEN_CNTL, crtc_gen_cntl | CRTC_EXT_DISP_EN); + + dac_cntl = inr(DAC_CNTL); + + outr(DAC_CNTL, (dac_cntl | DAC_EXT_SEL_RS3) & ~DAC_EXT_SEL_RS2); + + (void)in8(M64_DAC_READ); + (void)in8(M64_DAC_MASK); + (void)in8(M64_DAC_MASK); + (void)in8(M64_DAC_MASK); + idr = in8(M64_DAC_MASK); + cr = in8(M64_DAC_MASK); + aux = in8(M64_DAC_MASK); + test = in8(M64_DAC_MASK); + + xf86ErrorFVerb(4, + " Identification register: 0x%02X\n" + " Control register (Alternate): 0x%02X\n" + " Auxiliary register: 0x%02X\n" + " Test register: 0x%02X\n", + idr, cr, aux, test); + + outr(DAC_CNTL, dac_cntl | (DAC_EXT_SEL_RS3 | DAC_EXT_SEL_RS2)); + + index_read = in8(M64_DAC_READ); + (void)in8(M64_DAC_DATA); + cr = in8(M64_DAC_MASK); + (void)in8(M64_DAC_READ); + index_write = in8(M64_DAC_WRITE); + (void)in8(M64_DAC_WRITE); + (void)in8(M64_DAC_WRITE); + (void)in8(M64_DAC_WRITE); + cs = in8(M64_DAC_WRITE); + + xf86ErrorFVerb(4, + " PLL RAM read index: 0x%02X\n" + " PLL RAM write index: 0x%02X\n" + " Control register: 0x%02X\n" + " Clock Select Register: 0x%02X\n\n" + " PLL registers:", + index_read, index_write, cr, cs); + + out8(M64_DAC_READ, 0); + + for (Index = 0; Index < 48; Index++) + { + if (!(Index & 1)) + { + if (!(Index & 15)) + xf86ErrorFVerb(4, "\n 0x%02X: ", Index / 2); + + xf86ErrorFVerb(4, " "); + } + + xf86ErrorFVerb(4, "%02X", in8(M64_DAC_DATA)); + } + + xf86ErrorFVerb(4, "\n"); + + out8(M64_DAC_READ, index_read); + + /* Restore registers */ + outr(DAC_CNTL, dac_cntl); + if (!(crtc_gen_cntl & CRTC_EXT_DISP_EN)) + outr(CRTC_GEN_CNTL, crtc_gen_cntl); +} + +/* * ATIRGB514PrintRegisters -- * * Display IBM RGB 514 registers when the server is invoked with -verbose. @@ -354,14 +475,9 @@ pciConfigPtr pPCI; int Index; CARD32 lcd_index, tv_out_index, lcd_gen_ctrl; + ATICRTCType crtc = ATI_CRTC_VGA; CARD8 dac_read, dac_mask, dac_write; - CARD8 crtc; - -#ifndef AVOID_CPIO - - CARD8 genmo, seq1 = 0; - - crtc = ATI_CRTC_VGA; + CARD8 genmo, seq1 = 0; if (pATI->VGAAdapter != ATI_ADAPTER_NONE) { @@ -375,11 +491,13 @@ lcd_gen_ctrl = inr(LCD_GEN_CTRL); outr(LCD_GEN_CTRL, lcd_gen_ctrl & ~SHADOW_RW_EN); - ATIPrintIndexedRegisters(CRTX(ColourIOBase), 0, 64, + ATIPrintIndexedRegisters(pATI, + CRTX(ColourIOBase + pATI->DomainIOBase), 0, 64, "Non-shadow colour CRT controller", 0); outr(LCD_GEN_CTRL, lcd_gen_ctrl | SHADOW_RW_EN); - ATIPrintIndexedRegisters(CRTX(ColourIOBase), 0, 64, + ATIPrintIndexedRegisters(pATI, + CRTX(ColourIOBase + pATI->DomainIOBase), 0, 64, "Shadow colour CRT controller", 0); outr(LCD_GEN_CTRL, lcd_gen_ctrl); @@ -393,12 +511,14 @@ ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl & ~(CRTC_RW_SELECT | SHADOW_RW_EN)); - ATIPrintIndexedRegisters(CRTX(ColourIOBase), 0, 64, + ATIPrintIndexedRegisters(pATI, + CRTX(ColourIOBase + pATI->DomainIOBase), 0, 64, "Non-shadow colour CRT controller", 0); ATIMach64PutLCDReg(LCD_GEN_CNTL, (lcd_gen_ctrl & ~CRTC_RW_SELECT) | SHADOW_RW_EN); - ATIPrintIndexedRegisters(CRTX(ColourIOBase), 0, 64, + ATIPrintIndexedRegisters(pATI, + CRTX(ColourIOBase + pATI->DomainIOBase), 0, 64, "Shadow colour CRT controller", 0); ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl); @@ -406,12 +526,13 @@ } else { - ATIPrintIndexedRegisters(CRTX(ColourIOBase), 0, 64, + ATIPrintIndexedRegisters(pATI, + CRTX(ColourIOBase + pATI->DomainIOBase), 0, 64, "Colour CRT controller", 0); } - ATIPrintIndexedRegisters(ATTRX, 0, 32, "Attribute controller", - GENS1(ColourIOBase)); + ATIPrintIndexedRegisters(pATI, ATTRX, 0, 32, + "Attribute controller", ColourIOBase + pATI->DomainIOBase); } else { @@ -420,11 +541,13 @@ lcd_gen_ctrl = inr(LCD_GEN_CTRL); outr(LCD_GEN_CTRL, lcd_gen_ctrl & ~SHADOW_RW_EN); - ATIPrintIndexedRegisters(CRTX(MonochromeIOBase), 0, 64, + ATIPrintIndexedRegisters(pATI, + CRTX(MonochromeIOBase + pATI->DomainIOBase), 0, 64, "Non-shadow monochrome CRT controller", 0); outr(LCD_GEN_CTRL, lcd_gen_ctrl | SHADOW_RW_EN); - ATIPrintIndexedRegisters(CRTX(MonochromeIOBase), 0, 64, + ATIPrintIndexedRegisters(pATI, + CRTX(MonochromeIOBase + pATI->DomainIOBase), 0, 64, "Shadow monochrome CRT controller", 0); outr(LCD_GEN_CTRL, lcd_gen_ctrl); @@ -438,12 +561,14 @@ ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl & ~(CRTC_RW_SELECT | SHADOW_RW_EN)); - ATIPrintIndexedRegisters(CRTX(MonochromeIOBase), 0, 64, + ATIPrintIndexedRegisters(pATI, + CRTX(MonochromeIOBase + pATI->DomainIOBase), 0, 64, "Non-shadow monochrome CRT controller", 0); ATIMach64PutLCDReg(LCD_GEN_CNTL, (lcd_gen_ctrl & ~CRTC_RW_SELECT) | SHADOW_RW_EN); - ATIPrintIndexedRegisters(CRTX(MonochromeIOBase), 0, 64, + ATIPrintIndexedRegisters(pATI, + CRTX(MonochromeIOBase + pATI->DomainIOBase), 0, 64, "Shadow monochrome CRT controller", 0); ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl); @@ -451,19 +576,21 @@ } else { - ATIPrintIndexedRegisters(CRTX(MonochromeIOBase), 0, 64, + ATIPrintIndexedRegisters(pATI, + CRTX(MonochromeIOBase + pATI->DomainIOBase), 0, 64, "Monochrome CRT controller", 0); } - ATIPrintIndexedRegisters(ATTRX, 0, 32, "Attribute controller", - GENS1(MonochromeIOBase)); + ATIPrintIndexedRegisters(pATI, ATTRX, 0, 32, + "Attribute controller", MonochromeIOBase + pATI->DomainIOBase); } - ATIPrintIndexedRegisters(GRAX, 0, 16, "Graphics controller", 0); - ATIPrintIndexedRegisters(SEQX, 0, 8, "Sequencer", 0); + ATIPrintIndexedRegisters(pATI, GRAX, 0, 16, "Graphics controller", 0); + ATIPrintIndexedRegisters(pATI, SEQX, 0, 8, "Sequencer", 0); if (pATI->CPIO_VGAWonder) - ATIPrintIndexedRegisters(pATI->CPIO_VGAWonder, + ATIPrintIndexedRegisters(pATI, + pATI->CPIO_VGAWonder + pATI->DomainIOBase, xf86ServerIsOnlyProbing() ? 0x80U : pATI->VGAOffset, 0xC0U, "ATI extended VGA", 0); } @@ -491,19 +618,15 @@ xf86ErrorFVerb(4, "\n"); } - else - -#endif /* AVOID_CPIO */ - - if (pATI->Chip == ATI_CHIP_264LT) + else if (pATI->Chip == ATI_CHIP_264LT) { lcd_gen_ctrl = inr(LCD_GEN_CTRL); outr(LCD_GEN_CTRL, lcd_gen_ctrl & ~SHADOW_RW_EN); - ATIMach64PrintRegisters(pATI, &crtc, "non-shadow"); + ATIMach64PrintRegisters(pATI, &crtc, "non-shadow", FALSE); outr(LCD_GEN_CTRL, lcd_gen_ctrl | SHADOW_RW_EN); - ATIMach64PrintRegisters(pATI, &crtc, "shadow"); + ATIMach64PrintRegisters(pATI, &crtc, "shadow", TRUE); outr(LCD_GEN_CTRL, lcd_gen_ctrl); @@ -518,16 +641,16 @@ ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl & ~(CRTC_RW_SELECT | SHADOW_RW_EN)); - ATIMach64PrintRegisters(pATI, &crtc, "non-shadow"); + ATIMach64PrintRegisters(pATI, &crtc, "non-shadow", FALSE); ATIMach64PutLCDReg(LCD_GEN_CNTL, (lcd_gen_ctrl & ~CRTC_RW_SELECT) | SHADOW_RW_EN); - ATIMach64PrintRegisters(pATI, &crtc, "shadow"); + ATIMach64PrintRegisters(pATI, &crtc, "shadow", TRUE); if (pATI->Chip != ATI_CHIP_264XL) { ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl | CRTC_RW_SELECT); - ATIMach64PrintRegisters(pATI, &crtc, "secondary"); + ATIMach64PrintRegisters(pATI, &crtc, "secondary", TRUE); } ATIMach64PutLCDReg(LCD_GEN_CNTL, lcd_gen_ctrl); @@ -539,7 +662,7 @@ { if (!(Index & 3)) xf86ErrorFVerb(4, "\n 0x%02X: ", Index); - xf86ErrorFVerb(4, " %08X", ATIMach64GetLCDReg(Index)); + xf86ErrorFVerb(4, " %08X", (int)ATIMach64GetLCDReg(Index)); } outr(LCD_INDEX, lcd_index); @@ -551,83 +674,29 @@ { if (!(Index & 3)) xf86ErrorFVerb(4, "\n 0x%02X: ", Index); - xf86ErrorFVerb(4, " %08X", ATIMach64GetTVReg(Index)); + xf86ErrorFVerb(4, " %08X", (int)ATIMach64GetTVReg(Index)); } outr(TV_OUT_INDEX, tv_out_index); xf86ErrorFVerb(4, "\n"); } - else - -#ifndef AVOID_CPIO - - if (pATI->Chip >= ATI_CHIP_88800GXC) - -#endif /* AVOID_CPIO */ - + else if (pATI->Chip >= ATI_CHIP_88800GXC) { - -#ifdef AVOID_CPIO - - ATIMach64PrintRegisters(pATI, &crtc, "MMIO"); - -#else /* AVOID_CPIO */ - ATIMach64PrintRegisters(pATI, &crtc, - (pATI->CPIODecoding == SPARSE_IO) ? "sparse" : "block"); - -#endif /* AVOID_CPIO */ + (pATI->IODecoding == SPARSE_IO) ? "sparse" : + ((pATI->IODecoding == BLOCK_IO) ? "block" : "MMIO"), FALSE); if (pATI->Chip >= ATI_CHIP_264CT) ATIMach64PrintPLLRegisters(pATI); + if (pATI->DAC == ATI_DAC_CH8398) + ATICH8398PrintRegisters(pATI); + if (pATI->DAC == ATI_DAC_IBMRGB514) ATIRGB514PrintRegisters(pATI); } -#ifdef AVOID_CPIO - - dac_read = in8(M64_DAC_READ); - DACDelay; - dac_write = in8(M64_DAC_WRITE); - DACDelay; - dac_mask = in8(M64_DAC_MASK); - DACDelay; - - xf86ErrorFVerb(4, "\n" - " DAC read index: 0x%02X\n" - " DAC write index: 0x%02X\n" - " DAC mask: 0x%02X\n\n" - " DAC colour lookup table:", - dac_read, dac_write, dac_mask); - - out8(M64_DAC_MASK, 0xFFU); - DACDelay; - out8(M64_DAC_READ, 0x00U); - DACDelay; - - for (Index = 0; Index < 256; Index++) - { - if (!(Index & 3)) - xf86ErrorFVerb(4, "\n 0x%02X:", Index); - xf86ErrorFVerb(4, " %02X", in8(M64_DAC_DATA)); - DACDelay; - xf86ErrorFVerb(4, " %02X", in8(M64_DAC_DATA)); - DACDelay; - xf86ErrorFVerb(4, " %02X", in8(M64_DAC_DATA)); - DACDelay; - } - - out8(M64_DAC_MASK, dac_mask); - DACDelay; - out8(M64_DAC_READ, dac_read); - DACDelay; - -#else /* AVOID_CPIO */ - - ATISetDACIOPorts(pATI, crtc); - /* Temporarily turn off CLKDIV2 while reading DAC's LUT */ if (pATI->Adapter == ATI_ADAPTER_NONISA) { @@ -636,47 +705,93 @@ PutReg(SEQX, 0x01U, seq1 & ~0x08U); } - dac_read = inb(pATI->CPIO_DAC_READ); - DACDelay; - dac_write = inb(pATI->CPIO_DAC_WRITE); - DACDelay; - dac_mask = inb(pATI->CPIO_DAC_MASK); - DACDelay; - - xf86ErrorFVerb(4, "\n" - " DAC read index: 0x%02X\n" - " DAC write index: 0x%02X\n" - " DAC mask: 0x%02X\n\n" - " DAC colour lookup table:", - dac_read, dac_write, dac_mask); - - outb(pATI->CPIO_DAC_MASK, 0xFFU); - DACDelay; - outb(pATI->CPIO_DAC_READ, 0x00U); - DACDelay; - - for (Index = 0; Index < 256; Index++) + /* XXX Should also print secondary DAC's LUT, where applicable */ + switch (crtc) { - if (!(Index & 3)) - xf86ErrorFVerb(4, "\n 0x%02X:", Index); - xf86ErrorFVerb(4, " %02X", inb(pATI->CPIO_DAC_DATA)); - DACDelay; - xf86ErrorFVerb(4, " %02X", inb(pATI->CPIO_DAC_DATA)); - DACDelay; - xf86ErrorFVerb(4, " %02X", inb(pATI->CPIO_DAC_DATA)); - DACDelay; - } + case ATI_CRTC_MACH64: + dac_read = in8(M64_DAC_READ); + DACDelay(in8(M64_DAC_WAIT)); + dac_write = in8(M64_DAC_WRITE); + DACDelay(in8(M64_DAC_WAIT)); + dac_mask = in8(M64_DAC_MASK); + DACDelay(in8(M64_DAC_WAIT)); + + xf86ErrorFVerb(4, "\n" + " DAC read index: 0x%02X\n" + " DAC write index: 0x%02X\n" + " DAC mask: 0x%02X\n\n" + " DAC colour lookup table:", + dac_read, dac_write, dac_mask); + + out8(M64_DAC_MASK, 0xFFU); + DACDelay(in8(M64_DAC_WAIT)); + out8(M64_DAC_READ, 0x00U); + DACDelay(in8(M64_DAC_WAIT)); + + for (Index = 0; Index < 256; Index++) + { + if (!(Index & 3)) + xf86ErrorFVerb(4, "\n 0x%02X:", Index); + + xf86ErrorFVerb(4, " %02X", in8(M64_DAC_DATA)); + DACDelay(in8(M64_DAC_WAIT)); + xf86ErrorFVerb(4, " %02X", in8(M64_DAC_DATA)); + DACDelay(in8(M64_DAC_WAIT)); + xf86ErrorFVerb(4, " %02X", in8(M64_DAC_DATA)); + DACDelay(in8(M64_DAC_WAIT)); + } + + out8(M64_DAC_MASK, dac_mask); + DACDelay(in8(M64_DAC_WAIT)); + out8(M64_DAC_READ, dac_read); + DACDelay(in8(M64_DAC_WAIT)); + break; + + default: + ATISetDACIOPorts(pATI, crtc); + + dac_read = inb(pATI->CPIO_DAC_READ); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + dac_write = inb(pATI->CPIO_DAC_WRITE); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + dac_mask = inb(pATI->CPIO_DAC_MASK); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + + xf86ErrorFVerb(4, "\n" + " DAC read index: 0x%02X\n" + " DAC write index: 0x%02X\n" + " DAC mask: 0x%02X\n\n" + " DAC colour lookup table:", + dac_read, dac_write, dac_mask); + + outb(pATI->CPIO_DAC_MASK, 0xFFU); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + outb(pATI->CPIO_DAC_READ, 0x00U); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + + for (Index = 0; Index < 256; Index++) + { + if (!(Index & 3)) + xf86ErrorFVerb(4, "\n 0x%02X:", Index); - outb(pATI->CPIO_DAC_MASK, dac_mask); - DACDelay; - outb(pATI->CPIO_DAC_READ, dac_read); - DACDelay; + xf86ErrorFVerb(4, " %02X", inb(pATI->CPIO_DAC_DATA)); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + xf86ErrorFVerb(4, " %02X", inb(pATI->CPIO_DAC_DATA)); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + xf86ErrorFVerb(4, " %02X", inb(pATI->CPIO_DAC_DATA)); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + } + + outb(pATI->CPIO_DAC_MASK, dac_mask); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + outb(pATI->CPIO_DAC_READ, dac_read); + DACDelay(inb(pATI->CPIO_DAC_WAIT)); + break; + } if ((pATI->Adapter == ATI_ADAPTER_NONISA) && (seq1 & 0x08U)) PutReg(SEQX, 0x01U, seq1); -#endif /* AVOID_CPIO */ - if ((pVideo = pATI->PCIInfo)) { pPCI = pVideo->thisCard; @@ -686,46 +801,35 @@ if (!(Index & 15)) xf86ErrorFVerb(4, "\n 0x%02X: ", Index); xf86ErrorFVerb(4, " 0x%08lX", - (unsigned long)pciReadLong(pPCI->tag, Index)); + (unsigned long)pciReadLong(pPCI->tag, Index)); } } - xf86ErrorFVerb(4, "\n"); - -#ifndef AVOID_CPIO + xf86ErrorFVerb(4, "\n\n Domain I/O at %08lX.", pATI->DomainIOBase); if (pATI->pBank) - xf86ErrorFVerb(4, "\n Banked aperture at 0x%0lX.", - (unsigned long)pATI->pBank); + xf86ErrorFVerb(4, "\n Banked aperture at %08lX.", + (unsigned long)pATI->pBank); else xf86ErrorFVerb(4, "\n No banked aperture."); if (pATI->pMemory == pATI->pBank) - { xf86ErrorFVerb(4, "\n No linear aperture.\n"); - } else - -#else /* AVOID_CPIO */ - - if (pATI->pMemory) - -#endif /* AVOID_CPIO */ - - { - xf86ErrorFVerb(4, "\n Linear aperture at %p.\n", pATI->pMemory); - } + xf86ErrorFVerb(4, "\n Linear aperture at %08lX.\n", + (unsigned long)pATI->pMemory); if (pATI->pBlock[0]) { - xf86ErrorFVerb(4, " Block 0 aperture at %p.\n", pATI->pBlock[0]); + xf86ErrorFVerb(4, " Block 0 aperture at %08lX.\n", + (unsigned long)pATI->pBlock[0]); if (inr(CONFIG_CHIP_ID) == pATI->config_chip_id) xf86ErrorFVerb(4, " MMIO registers are correctly mapped.\n"); else xf86ErrorFVerb(4, " MMIO mapping is in error!\n"); if (pATI->pBlock[1]) - xf86ErrorFVerb(4, " Block 1 aperture at %p.\n", - pATI->pBlock[1]); + xf86ErrorFVerb(4, " Block 1 aperture at %08lX.\n", + (unsigned long)pATI->pBlock[1]); } else { @@ -733,8 +837,8 @@ } if (pATI->pCursorImage) - xf86ErrorFVerb(4, " Hardware cursor image aperture at %p.\n", - pATI->pCursorImage); + xf86ErrorFVerb(4, " Hardware cursor image aperture at %08lX.\n", + (unsigned long)pATI->pCursorImage); else xf86ErrorFVerb(4, " No hardware cursor image aperture.\n"); Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h:1.12 xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h:1.14 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h:1.12 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h Fri Feb 17 12:01:39 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h,v 1.12 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprint.h,v 1.14 2006/02/17 17:01:39 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -29,6 +29,9 @@ #include "xf86str.h" +extern void ATIPrintMemory FunctionPrototype((const CARD8 *, + const unsigned int, + const int)); extern void ATIPrintBIOS FunctionPrototype((const CARD8 *, const unsigned int)); extern void ATIPrintRegisters FunctionPrototype((ATIPtr)); Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atipriv.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atipriv.h:1.7 xc/programs/Xserver/hw/xfree86/drivers/ati/atipriv.h:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atipriv.h:1.7 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atipriv.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipriv.h,v 1.7 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipriv.h,v 1.8 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1999 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c:1.64 xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c:1.73 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c:1.64 Fri Dec 31 11:07:06 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c Sun Mar 19 14:06:35 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.64 2004/12/31 16:07:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.73 2006/03/19 19:06:35 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -97,47 +97,65 @@ CARD8 Chipset; } ATIGDev, *ATIGDevPtr; -#ifndef AVOID_CPIO - /* * Definitions for I/O conflict avoidance. */ #define LongPort(_Port) GetBits(_Port, PCIGETIO(SPARSE_IO_BASE)) -#define DetectedVGA (1 << 0) -#define Detected8514A (1 << 1) -#define DetectedMach64 (1 << 2) -#define Allowed (1 << 3) -#define DoProbe (1 << 4) +#define DomainSize (LongPort(SPARSE_IO_BASE) + 1) +#define Allowed (1 << 0) +#define DoProbe (1 << 1) +#define DetectedVGA (0 << 2) +#define Detected8514A (1 << 2) +#define DetectedMach64 (2 << 2) +#define Conflict (3 << 2) +#define BadRouting (4 << 2) typedef struct { - IOADDRESS Base; - CARD8 Size; - CARD8 Flag; + int Domain; + CARD16 Base; + CARD8 Size; + CARD8 Flag; } PortRec, *PortPtr; +/* BIOS definitions */ +static const CARD8 ATISignature[] = " 761295520"; +static const CARD8 IBMSignature[] = "IBM"; +#define ATISize 10 +#define ATIOffset 0x30U +#define IBMSize 3 +#define IBMOffset 0x1EU + +#define PrefixSize 0x50U +#define BIOSWord(_n) (BIOS[_n] | (BIOS[(_n) + 1] << 8)) + /* * ATIScanPCIBases -- * * This function loops though a device's PCI registered bases and accumulates - * a list of block I/O bases in use in the system. + * a list of block I/O bases in use in the system. Of these bases, only those + * that are, or may have, ISA aliases are of interest. */ static void ATIScanPCIBases ( PortPtr *PCIPorts, int *nPCIPort, + const int Domain, const CARD32 *pBase, const int *pSize, const CARD8 ProbeFlag ) { - IOADDRESS Base; - int i, j; + CARD16 Base; + int i, j; for (i = 6; --i >= 0; pBase++, pSize++) { if (*pBase & PCI_MAP_IO) { + if (*pBase > (CARD16)(-1)) + continue; + Base = *pBase & ~IO_BYTE_SELECT; for (j = 0; ; j++) { @@ -146,13 +164,15 @@ (*nPCIPort)++; *PCIPorts = (PortPtr)xnfrealloc(*PCIPorts, *nPCIPort * SizeOf(PortRec)); + (*PCIPorts)[j].Domain = Domain; (*PCIPorts)[j].Base = Base; (*PCIPorts)[j].Size = (CARD8)*pSize; (*PCIPorts)[j].Flag = ProbeFlag; break; } - if (Base == (*PCIPorts)[j].Base) + if ((Domain == (*PCIPorts)[j].Domain) && + (Base == (*PCIPorts)[j].Base)) break; } @@ -177,19 +197,23 @@ static CARD8 ATICheckSparseIOBases ( - pciVideoPtr pVideo, - CARD8 *ProbeFlags, - const IOADDRESS IOBase, - const int Count, - const Bool Override + pciVideoPtr pVideo, + const CARD8 *ProbeFlags, + const int Domain, + const CARD16 IOBase, + const int Count, + const Bool Override ) { - CARD32 FirstPort, LastPort; + CARD16 FirstPort, LastPort; + CARD8 Result = DoProbe; if (!pVideo || !xf86IsPrimaryPci(pVideo)) { - FirstPort = LongPort(IOBase); - LastPort = LongPort(IOBase + Count - 1); + int domain = Domain * DomainSize; + + FirstPort = LongPort(IOBase) + domain; + LastPort = LongPort(IOBase + Count - 1) + domain; for (; FirstPort <= LastPort; FirstPort++) { @@ -201,44 +225,67 @@ if (!(ProbeFlag & Allowed)) return ProbeFlag; - if (Override) + if (Override || (Result != DoProbe)) continue; /* User might wish to override this decision */ xf86Msg(X_WARNING, - ATI_NAME ": Sparse I/O base 0x%04lX not probed.\n", IOBase); - return Allowed; + ATI_NAME ": Sparse I/O base 0x%04X not probed in domain" + " %d.\n", IOBase, Domain); + Result = Allowed; } } - return DoProbe; + return Result; } -#ifndef AVOID_NON_PCI - /* - * ATIClaimSparseIOBases -- + * ATISetSparseIOBases -- * * This function updates the sparse I/O base table with information from the * hardware probes. */ static void -ATIClaimSparseIOBases +ATISetSparseIOBases ( - CARD8 *ProbeFlags, - const IOADDRESS IOBase, - const int Count, - const CARD8 ProbeFlag + CARD8 *ProbeFlags, + const int Domain, + const CARD16 IOBase, + const int Count, + const CARD8 ProbeFlag ) { - CARD32 FirstPort = LongPort(IOBase), - LastPort = LongPort(IOBase + Count - 1); + int domain = Domain * DomainSize; + CARD16 FirstPort = LongPort(IOBase) + domain, + LastPort = LongPort(IOBase + Count - 1) + domain; for (; FirstPort <= LastPort; FirstPort++) - ProbeFlags[FirstPort] = ProbeFlag; + if ((ProbeFlag != Allowed) || (ProbeFlags[FirstPort] & Allowed)) + ProbeFlags[FirstPort] = ProbeFlag; } -#endif /* AVOID_NON_PCI */ +/* + * ATIValidateVGAWonderBIOS -- + * + * This function retrieves a VGAWonder port number from the first few bytes of + * a video BIOS. + */ +static Bool +ATIValidateVGAWonderBIOS +( + ATIPtr pATI, + const CARD8 *BIOS +) +{ + if ((BIOS[0x00U] == 0x55U) && (BIOS[0x01U] == 0xAAU) && + !(BIOS[0x10] & 0x01U) && + !memcmp(BIOS + IBMOffset, IBMSignature, IBMSize) && + !memcmp(BIOS + ATIOffset, ATISignature, ATISize) && + (pATI->CPIO_VGAWonder = (BIOSWord(0x10U) & SPARSE_IO_PORT))) + return TRUE; + + return FALSE; +} /* * ATIVGAProbe -- @@ -249,45 +296,55 @@ static ATIPtr ATIVGAProbe ( - ATIPtr pVGA + ATIPtr pATI, + const IOADDRESS DomainIOBase, + const int Domain ) { CARD8 IOValue1, IOValue2, IOValue3; - if (!pVGA) - pVGA = (ATIPtr)xnfcalloc(1, SizeOf(ATIRec)); + if (!pATI) + { + pATI = (ATIPtr)xnfcalloc(1, SizeOf(ATIRec)); + pATI->Domain = Domain; + pATI->DomainIOBase = DomainIOBase; + } /* * VGA has one more attribute register than EGA. See if it can be read and * written. Note that the CRTC registers are not used here, so there's no * need to unlock them. */ - ATISetVGAIOBase(pVGA, inb(R_GENMO)); - (void)inb(GENS1(pVGA->CPIO_VGABase)); + ATISetVGAIOBase(pATI, inb(R_GENMO)); + + xf86InterceptSignals(&pATI->CaughtSignal); + (void)inb(GENS1(pATI->CPIO_VGABase)); IOValue1 = inb(ATTRX); - (void)inb(GENS1(pVGA->CPIO_VGABase)); + (void)inb(GENS1(pATI->CPIO_VGABase)); IOValue2 = GetReg(ATTRX, 0x14U | 0x20U); outb(ATTRX, IOValue2 ^ 0x0FU); IOValue3 = GetReg(ATTRX, 0x14U | 0x20U); outb(ATTRX, IOValue2); outb(ATTRX, IOValue1); - (void)inb(GENS1(pVGA->CPIO_VGABase)); + (void)inb(GENS1(pATI->CPIO_VGABase)); + xf86InterceptSignals(NULL); + if (IOValue3 == (IOValue2 ^ 0x0FU)) { /* VGA device detected */ - if (pVGA->Chip == ATI_CHIP_NONE) - pVGA->Chip = ATI_CHIP_VGA; - if (pVGA->VGAAdapter == ATI_ADAPTER_NONE) - pVGA->VGAAdapter = ATI_ADAPTER_VGA; - if (pVGA->Adapter == ATI_ADAPTER_NONE) - pVGA->Adapter = ATI_ADAPTER_VGA; + if (pATI->Chip == ATI_CHIP_NONE) + pATI->Chip = ATI_CHIP_VGA; + if (pATI->VGAAdapter == ATI_ADAPTER_NONE) + pATI->VGAAdapter = ATI_ADAPTER_VGA; + if (pATI->Adapter == ATI_ADAPTER_NONE) + pATI->Adapter = ATI_ADAPTER_VGA; } else { - pVGA->VGAAdapter = ATI_ADAPTER_NONE; + pATI->VGAAdapter = ATI_ADAPTER_NONE; } - return pVGA; + return pATI; } /* @@ -303,27 +360,38 @@ pciVideoPtr pVideo, ATIPtr pATI, ATIPtr p8514, - CARD8 *ProbeFlags + CARD8 *ProbeFlags, + Bool *DontProbe, + const int Domain ) { CARD8 IOValue1, IOValue2, IOValue3, IOValue4, IOValue5, IOValue6; - switch (ATICheckSparseIOBases(pVideo, ProbeFlags, + switch (ATICheckSparseIOBases(pVideo, ProbeFlags, Domain, pATI->CPIO_VGAWonder, 2, TRUE)) { - case 0: + case BadRouting: + xf86Msg(X_WARNING, + ATI_NAME ": Expected VGA Wonder capability could not be" + " detected at I/O port 0x%04lX in domain %d due to unsuitable" + " PCI routing.\n", pATI->CPIO_VGAWonder, Domain); + pATI->CPIO_VGAWonder = 0; + break; + + case Conflict: xf86Msg(X_WARNING, ATI_NAME ": Expected VGA Wonder capability could not be" - " detected at I/O port 0x%04lX because it would conflict with" - " a non-video PCI/AGP device.\n", pATI->CPIO_VGAWonder); + " detected at I/O port 0x%04lX in domain %d because it would" + " conflict with a non-video PCI/AGP device.\n", + pATI->CPIO_VGAWonder, Domain); pATI->CPIO_VGAWonder = 0; break; case Detected8514A: xf86Msg(X_WARNING, ATI_NAME ": Expected VGA Wonder capability could not be" - " detected at I/O port 0x%04lX because it would conflict with" - " a %s %s.\n", pATI->CPIO_VGAWonder, + " detected at I/O port 0x%04lX in domain %d because it would" + " conflict with a %s %s.\n", pATI->CPIO_VGAWonder, Domain, ATIBusNames[p8514->BusType], ATIAdapterNames[p8514->Adapter]); pATI->CPIO_VGAWonder = 0; break; @@ -331,13 +399,45 @@ case DetectedMach64: xf86Msg(X_WARNING, ATI_NAME ": Expected VGA Wonder capability could not be" - " detected at I/O port 0x%04lX because it would conflict with" - " a Mach64.\n", pATI->CPIO_VGAWonder); + " detected at I/O port 0x%04lX in domain %d because it would" + " conflict with a Mach64.\n", pATI->CPIO_VGAWonder, Domain); pATI->CPIO_VGAWonder = 0; break; case DetectedVGA: default: /* Must be DoProbe */ + if (!xf86CheckPciSparseIO(Domain, pATI->CPIO_VGAWonder, 2, + (int)0xFFFF03FF, DontProbe)) + { + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Expected VGA Wonder capability could not be" + " detected at I/O port 0x%04lX in domain %d due to" + " unsuitable PCI routing.\n", + pATI->CPIO_VGAWonder, Domain); + + if (DontProbe) + ATISetSparseIOBases(ProbeFlags, Domain, + pATI->CPIO_VGAWonder, 2, BadRouting); + + pATI->CPIO_VGAWonder = 0; + break; + } + + if (DontProbe && *DontProbe) + { + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Expected VGA Wonder capability could not be" + " detected at I/O port 0x%04lX in domain %d due to a" + " potential hard-failed master abort.\n", + pATI->CPIO_VGAWonder, Domain); + + ATISetSparseIOBases(ProbeFlags, Domain, pATI->CPIO_VGAWonder, + 2, Allowed); + + pATI->CPIO_VGAWonder = 0; + break; + } + if (pVideo && !xf86IsPrimaryPci(pVideo) && (pATI->Chip <= ATI_CHIP_88800GXD)) { @@ -346,13 +446,14 @@ PutReg(GRAX, 0x51U, GetByte(pATI->CPIO_VGAWonder, 1) | pATI->VGAOffset); } + /* * Register 0xBB is used by the BIOS to keep track of various * things (monitor type, etc.). Except for 18800-x's, register * 0xBC must be zero and causes the adapter to enter a test mode * when written to with a non-zero value. */ - IOValue1 = inb(pATI->CPIO_VGAWonder); + IOValue1 = inb(pATI->CPIO_VGAWonder + pATI->DomainIOBase); IOValue2 = ATIGetExtReg(IOValue1); IOValue3 = ATIGetExtReg(0xBBU); ATIPutExtReg(0xBBU, IOValue3 ^ 0xAAU); @@ -371,16 +472,18 @@ (IOValue6 == 0)) { xf86MsgVerb(X_INFO, 3, - ATI_NAME ": VGA Wonder at I/O port 0x%04lX detected.\n", - pATI->CPIO_VGAWonder); + ATI_NAME ": VGA Wonder at I/O port 0x%04lX detected in" + " domain %d.\n", pATI->CPIO_VGAWonder, Domain); } else { xf86Msg(X_WARNING, ATI_NAME ": Expected VGA Wonder capability at I/O port" - " 0x%04lX was not detected.\n", pATI->CPIO_VGAWonder); + " 0x%04lX in domain %d was not detected.\n", + pATI->CPIO_VGAWonder, Domain); pATI->CPIO_VGAWonder = 0; } + break; } } @@ -396,11 +499,18 @@ static ATIPtr ATI8514Probe ( - pciVideoPtr pVideo + pciVideoPtr pVideo, + const IOADDRESS DomainIOBase, + const int Domain ) { - ATIPtr pATI = NULL; - CARD16 IOValue1, IOValue2; + ATIPtr pATI = (ATIPtr)xnfcalloc(1, SizeOf(ATIRec)); + pciConfigPtr pPCI; + CARD16 IOValue1, IOValue2; + CARD8 BIOS[PrefixSize]; + + pATI->Domain = Domain; + pATI->DomainIOBase = DomainIOBase; /* * Save register value to be modified, just in case there is no 8514/A @@ -424,7 +534,6 @@ outw(ERR_TERM, 0x2525U); if (inw(ERR_TERM) == 0x2525U) { - pATI = (ATIPtr)xnfcalloc(1, SizeOf(ATIRec)); pATI->Adapter = ATI_ADAPTER_8514A; pATI->ChipHasSUBSYS_CNTL = TRUE; pATI->PCIInfo = pVideo; @@ -433,9 +542,10 @@ outw(ERR_TERM, IOValue2); /* Restore register value clobbered by 8514/A reset attempt */ - if (!pATI) + if (!pATI->ChipHasSUBSYS_CNTL) { outw(SUBSYS_CNTL, IOValue1); + xfree(pATI); return NULL; } @@ -506,17 +616,31 @@ pATI->BusType = GetBits(IOValue1, BUS_TYPE); pATI->BIOSBase = 0x000C0000U + (GetBits(IOValue2, BIOS_BASE_SEGMENT) << 11); - if (!(IOValue1 & (_8514_ONLY | CHIP_DIS))) + do { + if (IOValue1 & (_8514_ONLY | CHIP_DIS)) + break; + pATI->VGAAdapter = ATI_ADAPTER_MACH32; - if ((xf86ReadBIOS(pATI->BIOSBase, 0x10U, - (pointer)(&pATI->CPIO_VGAWonder), - SizeOf(pATI->CPIO_VGAWonder)) < - SizeOf(pATI->CPIO_VGAWonder)) || - !(pATI->CPIO_VGAWonder &= SPARSE_IO_PORT)) - pATI->CPIO_VGAWonder = 0x01CEU; pATI->VGAOffset = 0x80U; - } + + /* + * Pick up the VGA Wonder port number from the BIOS. For a PCI + * adapter whose initialised BIOS is either non-existent or not + * accessible, use its PCI ROM. + */ + if (xf86DomainHasBIOSSegments(Domain) && + (xf86ReadBIOS(pATI->BIOSBase, 0, BIOS, SizeOf(BIOS)) == + SizeOf(BIOS)) && ATIValidateVGAWonderBIOS(pATI, BIOS)) + break; + + if (pVideo && (pPCI = pVideo->thisCard) && + (xf86ReadPciBIOS(0, pPCI->tag, 0, BIOS, SizeOf(BIOS)) == + SizeOf(BIOS)) && ATIValidateVGAWonderBIOS(pATI, BIOS)) + break; + + pATI->CPIO_VGAWonder = 0x01CEU; + } while (0); ATIMach32ChipID(pATI); break; @@ -528,8 +652,6 @@ return pATI; } -#endif /* AVOID_CPIO */ - /* * ATIMach64Detect -- * @@ -548,16 +670,12 @@ (void)ATIMapApertures(-1, pATI); /* Ignore errors */ -#ifdef AVOID_CPIO - - if (!pATI->pBlock[0]) + if ((pATI->IODecoding == MEMORY_IO) && !pATI->pBlock[0]) { ATIUnmapApertures(-1, pATI); return FALSE; } -#endif /* AVOID_CPIO */ - /* Make sure any Mach64 is not in some weird state */ bus_cntl = inr(BUS_CNTL); if (Chip < ATI_CHIP_264VTB) @@ -593,7 +711,7 @@ */ ATIMach64ChipID(pATI, ChipType); if ((pATI->Chip != ATI_CHIP_Mach64) || - (pATI->CPIODecoding == BLOCK_IO)) + (pATI->IODecoding == BLOCK_IO)) pATI->Adapter = ATI_ADAPTER_MACH64; } } @@ -605,7 +723,8 @@ if (pATI->Adapter != ATI_ADAPTER_MACH64) { outr(GEN_TEST_CNTL, gen_test_cntl); - outr(BUS_CNTL, bus_cntl); + if (Chip < ATI_CHIP_264VT4) + outr(BUS_CNTL, bus_cntl); ATIUnmapApertures(-1, pATI); return FALSE; } @@ -614,153 +733,124 @@ pATI->BIOSBase = 0x000C0000U + (GetBits(inr(SCRATCH_REG1), BIOS_BASE_SEGMENT) << 11); - ATIUnmapApertures(-1, pATI); - pATI->PCIInfo = NULL; - return TRUE; -} - -#ifdef AVOID_CPIO - -/* - * ATIMach64Probe -- - * - * This function looks for a Mach64 at a particular MMIO address and returns an - * ATIRec if one is found. - */ -static ATIPtr -ATIMach64Probe -( - pciVideoPtr pVideo, - const IOADDRESS IOBase, - const CARD8 IODecoding, - const ATIChipType Chip -) -{ - ATIPtr pATI = (ATIPtr)xnfcalloc(1, SizeOf(ATIRec)); - CARD16 ChipType = 0; - - pATI->CPIOBase = IOBase; - pATI->CPIODecoding = IODecoding; - - if (pVideo) + /* + * Determine VGA capability. VGA can always be enabled on integrated + * controllers. For the GX/CX, it's a board strap. + */ + if (pATI->Chip >= ATI_CHIP_264CT) { - pATI->PCIInfo = pVideo; - ChipType = pVideo->chipType; - - /* - * Probe through auxiliary MMIO aperture if one exists. Because such - * apertures can be enabled/disabled only through PCI, this probes no - * further. - */ - if ((pVideo->size[2] >= 12) && - (pATI->Block0Base = pVideo->memBase[2]) && - (pATI->Block0Base < (CARD32)(-1 << pVideo->size[2]))) - { - pATI->Block0Base += 0x00000400U; - goto LastProbe; - } - - /* - * Probe through the primary MMIO aperture that exists at the tail end - * of the linear aperture. Test for both 8MB and 4MB linear apertures. - */ - if ((pVideo->size[0] >= 22) && (pATI->Block0Base = pVideo->memBase[0])) + pATI->VGAAdapter = ATI_ADAPTER_MACH64; + } + else + { + IOValue = inr(CONFIG_STATUS64_0); + pATI->BusType = GetBits(IOValue, CFG_BUS_TYPE); + IOValue &= (CFG_VGA_EN | CFG_CHIP_EN); + if (pATI->Chip == ATI_CHIP_88800CX) + IOValue |= CFG_VGA_EN; + if (IOValue == (CFG_VGA_EN | CFG_CHIP_EN)) { - pATI->Block0Base += 0x007FFC00U; - if ((pVideo->size[0] >= 23) && - ATIMach64Detect(pATI, ChipType, Chip)) - return pATI; - - pATI->Block0Base -= 0x00400000U; - if (ATIMach64Detect(pATI, ChipType, Chip)) - return pATI; + pATI->VGAAdapter = ATI_ADAPTER_MACH64; + pATI->CPIO_VGAWonder = 0x01CEU; + pATI->VGAOffset = 0x80U; } } - /* - * A last, perhaps desparate, probe attempt. Note that if this succeeds, - * there's a VGA in the system and it's likely the PIO version of the - * driver should be used instead (barring OS issues). - */ - pATI->Block0Base = 0x000BFC00U; - -LastProbe: - if (ATIMach64Detect(pATI, ChipType, Chip)) - return pATI; - - xfree(pATI); - return NULL; + ATIUnmapApertures(-1, pATI); + return TRUE; } -#else /* AVOID_CPIO */ - /* * ATIMach64Probe -- * - * This function looks for a Mach64 at a particular PIO address and returns an - * ATIRec if one is found. + * This function looks for a Mach64 at a particular I/O or memory address and + * returns an ATIRec if one is found. */ static ATIPtr ATIMach64Probe ( pciVideoPtr pVideo, - const IOADDRESS IOBase, - const CARD8 IODecoding, + IOADDRESS IOBase, + const IOADDRESS DomainIOBase, + const int Domain, + CARD8 IODecoding, const ATIChipType Chip ) { - ATIPtr pATI; - CARD32 IOValue; + ATIPtr pATI = (ATIPtr)xnfcalloc(1, SizeOf(ATIRec)); CARD16 ChipType = 0; - if (!IOBase) - return NULL; + if (!IOBase) /* Stupid OS ... */ + IODecoding = MEMORY_IO; if (pVideo) { if ((IODecoding == BLOCK_IO) && ((pVideo->size[1] < 8) || (IOBase >= (CARD32)(-1 << pVideo->size[1])))) - return NULL; + { + IOBase = 0; + IODecoding = MEMORY_IO; + } ChipType = pVideo->chipType; } - pATI = (ATIPtr)xnfcalloc(1, SizeOf(ATIRec)); + if (IOBase) + IOBase += DomainIOBase; + + pATI->Domain = Domain; + pATI->DomainIOBase = DomainIOBase; pATI->CPIOBase = IOBase; - pATI->CPIODecoding = IODecoding; + pATI->IODecoding = IODecoding; pATI->PCIInfo = pVideo; - if (!ATIMach64Detect(pATI, ChipType, Chip)) - { - xfree(pATI); - return NULL; - } - - /* - * Determine VGA capability. VGA can always be enabled on integrated - * controllers. For the GX/CX, it's a board strap. - */ - if (pATI->Chip >= ATI_CHIP_264CT) - { - pATI->VGAAdapter = ATI_ADAPTER_MACH64; - } - else + if (IODecoding == MEMORY_IO) { - IOValue = inr(CONFIG_STATUS64_0); - pATI->BusType = GetBits(IOValue, CFG_BUS_TYPE); - IOValue &= (CFG_VGA_EN | CFG_CHIP_EN); - if (pATI->Chip == ATI_CHIP_88800CX) - IOValue |= CFG_VGA_EN; - if (IOValue == (CFG_VGA_EN | CFG_CHIP_EN)) + if (pVideo) { - pATI->VGAAdapter = ATI_ADAPTER_MACH64; - pATI->CPIO_VGAWonder = 0x01CEU; - pATI->VGAOffset = 0x80U; + /* + * Probe through auxiliary MMIO aperture if one exists. Because + * such apertures can be enabled/disabled only through PCI, this + * probes no further. + */ + if ((pVideo->size[2] >= 12) && + (pATI->Block0Base = pVideo->memBase[2]) && + (pATI->Block0Base < (CARD32)(-1 << pVideo->size[2]))) + { + pATI->Block0Base += 0x00000400U; + goto LastProbe; + } + + /* + * Probe through the primary MMIO aperture that exists at the tail + * end of the linear aperture. Test for both 8MB and 4MB linear + * apertures. + */ + if ((pVideo->size[0] >= 22) && + (pATI->Block0Base = pVideo->memBase[0])) + { + pATI->Block0Base += 0x007FFC00U; + if ((pVideo->size[0] >= 23) && + ATIMach64Detect(pATI, ChipType, Chip)) + return pATI; + + pATI->Block0Base -= 0x00400000U; + if (ATIMach64Detect(pATI, ChipType, Chip)) + return pATI; + } } + + /* A last, perhaps desparate, probe attempt */ + pATI->Block0Base = 0x000BFC00U; } - return pATI; +LastProbe: + if (ATIMach64Detect(pATI, ChipType, Chip)) + return pATI; + + xfree(pATI); + return NULL; } /* @@ -779,7 +869,9 @@ ATIPtr *ppVGA, ATIPtr pATI, ATIPtr p8514, - CARD8 *ProbeFlags + CARD8 *ProbeFlags, + Bool *DontProbe, + const int Domain ) { ATIPtr pVGA = *ppVGA; @@ -792,6 +884,13 @@ if ((pATI != pVGA) && (!pVGA || (pVGA->Adapter > ATI_ADAPTER_VGA))) return; + (void)ATIMapApertures(-1, pATI); + if ((pATI->IODecoding == MEMORY_IO) && !pATI->pBlock[0]) + { + ATIUnmapApertures(-1, pATI); + return; + } + switch (pATI->Adapter) { case ATI_ADAPTER_8514A: @@ -892,15 +991,14 @@ break; } + ATIUnmapApertures(-1, pATI); + if (pATI->VGAAdapter == ATI_ADAPTER_NONE) - { - pATI->CPIO_VGAWonder = 0; return; - } if (pATI->CPIO_VGAWonder) { - ATIVGAWonderProbe(pVideo, pATI, p8514, ProbeFlags); + ATIVGAWonderProbe(pVideo, pATI, p8514, ProbeFlags, DontProbe, Domain); if (!pATI->CPIO_VGAWonder) { /* @@ -909,8 +1007,9 @@ * cannot, in general, be used in a PCI environment due to routing * of I/O through the bus tree. */ - pATI->CPIO_VGAWonder = GRAX; - ATIVGAWonderProbe(pVideo, pATI, p8514, ProbeFlags); + pATI->CPIO_VGAWonder = 0x03CEU; + ATIVGAWonderProbe(pVideo, pATI, p8514, ProbeFlags, DontProbe, + Domain); } } @@ -927,8 +1026,6 @@ xf86MsgVerb(X_INFO, 3, ATI_NAME ": VGA assigned to this adapter.\n"); } -#ifndef AVOID_NON_PCI - /* * ATIClaimVGA -- * @@ -943,22 +1040,22 @@ ATIPtr pATI, ATIPtr p8514, CARD8 *ProbeFlags, - int Detected + Bool *DontProbe, + const int Domain, + const int Detected ) { - ATIAssignVGA(pVideo, ppVGA, pATI, p8514, ProbeFlags); + ATIAssignVGA(pVideo, ppVGA, pATI, p8514, ProbeFlags, DontProbe, Domain); if (pATI->VGAAdapter == ATI_ADAPTER_NONE) return; - ATIClaimSparseIOBases(ProbeFlags, MonochromeIOBase, 48, Detected); + ATISetSparseIOBases(ProbeFlags, Domain, MonochromeIOBase, 48, Detected); if (!pATI->CPIO_VGAWonder) return; - ATIClaimSparseIOBases(ProbeFlags, pATI->CPIO_VGAWonder, 2, Detected); + ATISetSparseIOBases(ProbeFlags, Domain, pATI->CPIO_VGAWonder, 2, Detected); } -#endif /* AVOID_NON_PCI */ - /* * ATIFindVGA -- * @@ -972,7 +1069,8 @@ ATIPtr *ppVGA, ATIPtr *ppATI, ATIPtr p8514, - CARD8 *ProbeFlags + CARD8 *ProbeFlags, + const int Domain ) { ATIPtr pATI = *ppATI; @@ -981,24 +1079,33 @@ { /* * An ATI PCI adapter has been detected at this point, and its VGA, if - * any, is shareable. Ensure the VGA isn't in sleep mode. + * any, is shareable. Ensure the VGA isn't in sleep mode. Note that + * it's possible GENENA (0x46E8) and/or GENVS (0x0102) are not routed + * to the adapter, potentially causing a hang. But then again, video + * BIOS initialisation would have caused (or, in ATIPreInit(), will + * cause) the same. */ - outb(GENENA, 0x16U); - outb(GENVS, 0x01U); - outb(GENENA, 0x0EU); + if (inb(GENENB) != 0x01U) + { + outb(GENENA, 0x16U); + outb(GENVS, 0x01U); + outb(GENENA, 0x0EU); + } - pATI = ATIVGAProbe(pATI); + pATI = ATIVGAProbe(pATI, 0, Domain); if (pATI->VGAAdapter == ATI_ADAPTER_NONE) + { + xf86Msg(X_WARNING, + ATI_NAME ": VGA not detected on this adapter.\n"); return; + } ppVGA = ppATI; } - ATIAssignVGA(pVideo, ppVGA, pATI, p8514, ProbeFlags); + ATIAssignVGA(pVideo, ppVGA, pATI, p8514, ProbeFlags, NULL, Domain); } -#endif /* AVOID_CPIO */ - /* * ATIProbe -- * @@ -1012,42 +1119,40 @@ int flags ) { - ATIPtr pATI, *ATIPtrs = NULL; - GDevPtr *GDevs, pGDev; - pciVideoPtr pVideo, *xf86PciVideoInfo = xf86GetPciVideoInfo(); - pciConfigPtr pPCI; - ATIGDev *ATIGDevs = NULL, *pATIGDev; - ScrnInfoPtr pScreenInfo; - CARD32 PciReg; - Bool ProbeSuccess = FALSE; - Bool DoRage128 = FALSE, DoRadeon = FALSE; - int i, j, k; - int nGDev, nATIGDev = -1, nATIPtr = 0; - int Chipset; - ATIChipType Chip; - -#ifndef AVOID_CPIO - - ATIPtr pVGA = NULL, p8514 = NULL; - ATIPtr pMach64[3] = {NULL, NULL, NULL}; - pciConfigPtr *xf86PciInfo = xf86GetPciConfigInfo(); - PortPtr PCIPorts = NULL; - int nPCIPort = 0; - CARD8 fChipsets[ATI_CHIPSET_MAX]; - static const IOADDRESS Mach64SparseIOBases[] = {0x02ECU, 0x01CCU, 0x01C8U}; - CARD8 ProbeFlags[LongPort(SPARSE_IO_BASE) + 1]; - - unsigned long BIOSBase; - static const CARD8 ATISignature[] = " 761295520"; -# define SignatureSize 10 -# define PrefixSize 0x50U -# define BIOSSignature 0x30U - CARD8 BIOS[PrefixSize]; -# define BIOSWord(_n) (BIOS[_n] | (BIOS[(_n) + 1] << 8)) +#ifdef XFree86LOADER + ModuleDescPtr pModule; +#endif + ATIPtr pATI, *ATIPtrs = NULL; + ATIPtr *ppVGA = NULL, *pp8514 = NULL, *ppMach64 = NULL; + GDevPtr *GDevs, pGDev; + pciVideoPtr pVideo, *xf86PciVideoInfo = xf86GetPciVideoInfo(); + pciConfigPtr pPCI, *xf86PciInfo = xf86GetPciConfigInfo(); + ATIGDev *ATIGDevs = NULL, *pATIGDev; + ScrnInfoPtr pScreenInfo; + IOADDRESS *pDomainIOBase = NULL; + PortPtr PCIPorts = NULL; + CARD8 *ProbeFlags = NULL; + int ProbeSize; + int nPCIPort = 0; + int Domain, MaxDomain = 0; + int i, j, k; + int nGDev, nATIGDev = -1, nATIPtr = 0; + int Chipset; + Bool DontProbe = FALSE; + Bool ProbeSuccess = FALSE; + Bool DoRage128 = FALSE, DoRadeon = FALSE; + CARD32 PciReg; + ATIChipType Chip; + ATIIODecodingType IODecoding; + static const CARD16 Mach64SparseIOBases[] = {0x02ECU, 0x01CCU, 0x01C8U}; + CARD16 Mach64SparseIOBase; + CARD8 fChipsets[ATI_CHIPSET_MAX]; + CARD8 ProbeFlag; -#endif /* AVOID_CPIO */ + unsigned long BIOSBase; + CARD8 BIOS[PrefixSize]; -# define AddAdapter(_p) \ +# define AddAdapter(_p) \ do \ { \ nATIPtr++; \ @@ -1056,20 +1161,24 @@ (_p)->iEntity = -2; \ } while (0) -#ifndef AVOID_CPIO + if ((ATIEndian.endian != ATI_LITTLE_ENDIAN) && + (ATIEndian.endian != ATI_BIG_ENDIAN)) + { + xf86Msg(X_ERROR, ATI_NAME ": Unsupported endianness: 0x%08X.\n", + ATIEndian.endian); + return FALSE; + } (void)memset(fChipsets, FALSE, SizeOf(fChipsets)); -#endif /* AVOID_CPIO */ - if (!(flags & PROBE_DETECT)) { /* * Get a list of XF86Config device sections whose "Driver" is either * not specified, or specified as this driver. From this list, - * eliminate those device sections that specify a "Chipset" or a - * "ChipID" not recognised by the driver. Those device sections that - * specify a "ChipRev" without a "ChipID" are also weeded out. + * eliminate those device sections that specify a "Chipset" not + * recognised by the driver. Those device sections that specify a + * "ChipRev" without a "ChipID" are also weeded out. */ nATIGDev = 0; if ((nGDev = xf86MatchDevice(ATI_NAME, &GDevs)) > 0) @@ -1087,16 +1196,8 @@ (pGDev->chipRev > (int)((CARD8)(-1)))) continue; - if (pGDev->chipID >= 0) - { - if (ATIChipID(pGDev->chipID, 0) == ATI_CHIP_Mach64) - continue; - } - else - { - if (pGDev->chipRev >= 0) - continue; - } + if ((pGDev->chipID < 0) && (pGDev->chipRev >= 0)) + continue; pATIGDev->pGDev = pGDev; pATIGDev->Chipset = Chipset; @@ -1107,12 +1208,7 @@ ATI_NAME ": Candidate \"Device\" section \"%s\".\n", pGDev->identifier); -#ifndef AVOID_CPIO - fChipsets[Chipset] = TRUE; - -#endif /* AVOID_CPIO */ - } xfree(GDevs); @@ -1130,27 +1226,15 @@ DoRadeon = TRUE; } -#ifndef AVOID_CPIO - /* - * Collect hardware information. This must be done with care to avoid - * lockups due to overlapping I/O port assignments. + * Collect hardware information. * * First, scan PCI configuration space for registered I/O ports (which will * be block I/O bases). Each such port is used to generate a list of * sparse I/O bases it precludes. This list is then used to decide whether - * or not certain sparse I/O probes are done. Unfortunately, this assumes - * that any registered I/O base actually reserves upto the full 256 ports - * allowed by the PCI specification. This assumption holds true for PCI - * Mach64, but probably doesn't for other device types. For some things, - * such as video devices, the number of ports a base represents is - * determined by the server's PCI probe, but, for other devices, this - * cannot be done by a user-level process without jeopardizing system - * integrity. This information should ideally be retrieved from the OS's - * own PCI probe (if any), but there's currently no portable way of doing - * so. The following allows sparse I/O probes to be forced in certain - * circumstances when an appropriate chipset specification is used in any - * XF86Config Device section. + * or not certain sparse I/O probes are done. These probes can be forced + * in certain circumstances when an appropriate chipset specification is + * used in any XF86Config Device section. * * Note that this is not bullet-proof. Lockups can still occur, but they * will usually be due to devices that are misconfigured to respond to the @@ -1163,12 +1247,18 @@ { for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) { - if ((pVideo->vendor == PCI_VENDOR_ATI) || - !(pPCI = pVideo->thisCard)) + if (!(pPCI = pVideo->thisCard)) + continue; + + Domain = xf86GetPciDomain(pPCI->tag); + if (Domain > MaxDomain) + MaxDomain = Domain; + + if ((pVideo->vendor == PCI_VENDOR_ATI)) continue; ATIScanPCIBases(&PCIPorts, &nPCIPort, - &pPCI->pci_base0, pVideo->size, + Domain, &pPCI->pci_base0, pVideo->size, (pciReadLong(pPCI->tag, PCI_CMD_STAT_REG) & PCI_CMD_IO_ENABLE) ? 0 : Allowed); } @@ -1179,6 +1269,10 @@ { for (i = 0; (pPCI = xf86PciInfo[i++]); ) { + Domain = xf86GetPciDomain(pPCI->tag); + if (Domain > MaxDomain) + MaxDomain = Domain; + if ((pPCI->pci_vendor == PCI_VENDOR_ATI) || (pPCI->pci_base_class == PCI_CLASS_BRIDGE) || (pPCI->pci_header_type & @@ -1186,19 +1280,25 @@ continue; ATIScanPCIBases(&PCIPorts, &nPCIPort, - &pPCI->pci_base0, pPCI->basesize, + Domain, &pPCI->pci_base0, pPCI->basesize, (pciReadLong(pPCI->tag, PCI_CMD_STAT_REG) & - PCI_CMD_IO_ENABLE) ? 0 : Allowed); + PCI_CMD_IO_ENABLE) ? Conflict : Allowed); } } + MaxDomain++; + /* Generate ProbeFlags array from list of registered PCI I/O bases */ - (void)memset(ProbeFlags, Allowed | DoProbe, SizeOf(ProbeFlags)); + ProbeSize = MaxDomain * DomainSize; + ProbeFlags = xnfalloc(ProbeSize); + (void)memset(ProbeFlags, Allowed | DoProbe, ProbeSize); for (i = 0; i < nPCIPort; i++) { CARD32 Base = PCIPorts[i].Base; CARD16 Count = (1 << PCIPorts[i].Size) - 1; - CARD8 ProbeFlag = PCIPorts[i].Flag; + + Domain = PCIPorts[i].Domain; + ProbeFlag = PCIPorts[i].Flag; /* * The following reduction of Count is based on the assumption that @@ -1208,12 +1308,12 @@ { CARD32 Base2 = PCIPorts[j].Base; - if (Base < Base2) + if ((Base < Base2) && (Domain == PCIPorts[j].Domain)) while ((Base + Count) >= Base2) Count >>= 1; } - Base = LongPort(Base); + Base = LongPort(Base) + (PCIPorts[i].Domain * DomainSize); Count = LongPort((Count | IO_BYTE_SELECT) + 1); while (Count--) ProbeFlags[Base++] &= ProbeFlag; @@ -1221,11 +1321,40 @@ xfree(PCIPorts); -#ifndef AVOID_NON_PCI + /* Allocate various sets of ATIPtr pointers for background adapters */ + ppVGA = xnfcalloc(MaxDomain, SizeOf(*ppVGA)); + pp8514 = xnfcalloc(MaxDomain, SizeOf(*pp8514)); + ppMach64 = xnfcalloc(MaxDomain * NumberOf(Mach64SparseIOBases), + SizeOf(*ppMach64)); + + /* Ensure I/O is mapped in for all domains */ + pDomainIOBase = xnfcalloc(MaxDomain, SizeOf(*pDomainIOBase)); + + if (xf86PciInfo) + { + for (i = 0, j = -1; (pPCI = xf86PciInfo[i++]); ) + { + Domain = xf86GetPciDomain(pPCI->tag); + if (Domain == j) + continue; + + j = Domain; + pDomainIOBase[j] = + xf86MapDomainIO(-1, VIDMEM_MMIO, pPCI->tag, 0, 0x10000); + } + } + + /* Combine VGA chipset overrides into one */ + fChipsets[ATI_CHIPSET_IBMVGA] |= + fChipsets[ATI_CHIPSET_ATIVGA] | fChipsets[ATI_CHIPSET_VGAWONDER]; + + /* Ditto for the 8514/A ones */ + fChipsets[ATI_CHIPSET_IBM8514] |= + fChipsets[ATI_CHIPSET_MACH8] | fChipsets[ATI_CHIPSET_MACH32]; /* - * A note on probe strategy. I/O and memory response by certain PCI - * devices has been disabled by the common layer at this point, + * A few notes on probe strategy. I/O and memory response by certain + * PCI devices has been disabled by the common layer at this point, * including any devices this driver might be interested in. The * following does sparse I/O probes, followed by block I/O probes. * Block I/O probes are dictated by what is found to be of interest in @@ -1236,121 +1365,312 @@ * failed to be detected the first time around. Each such device is * probed for again, this time with I/O temporarily enabled through * PCI. + * + * It's possible that even this second PCI scan fails to detect an + * adapter. So far, two different causes have been observed: + * + * 1) The resources the adapter registers in PCI configuration space + * are not actually being routed to the adapter. Barring OS and/or + * BIOS/firmware bugs, this is usually due to a prior X server crash + * that failed to properly restore PCI routing, in which case a + * power-down/reboot will normally rectify the problem. + * + * 2) The Linux kernel's atyfb can mis-guess the adapter's reference + * clock, so befuddling the adapter as to cause intermittent and/or + * incorrect response. This is more likely to happen for adapters + * that have not been initialised through the system's BIOS or + * firmware. + * + * The rationale for all of this is as follows. + * + * First off, at the C source level, this driver is to be as OS-neutral + * and architecture-neutral as possible. Indeed, even endianness can + * be accomodated at run-time. This means that any lobotomies (of PCI + * in particular) that occur on various architectures and OS'es are to + * be dealt with in the common layer, not here. For example, the + * alleged lack of ISA support on some architectures is _not_ a concern + * to be addressed here. Among other benefits, this policy aids and + * abets other drivers in dealing with the very same system-level + * idioms. + * + * Secondly, the driver is obviously interested in non-PCI ATI adapters + * that might exist in the system. Sparse I/O probes are done to + * detect such adapters. On PCI systems, master aborts will be + * generated should a probed-for adapter not exist. + * + * Third, a small number of ATI PCI adapters are known to claim + * transactions aimed at them whether or not they are disabled through + * the standard PCI mechanism. The driver needs to be aware of such + * anomalies so that it can correctly participate in the common layer's + * resource tracking scheme. Given no reliable list of affected + * adapters is available, the driver tests all ATI PCI Mach32's and + * Mach64's for this behaviour. Thus, master aborts will be generated + * for that majority of tested adapters that actually comply with PCI + * disablement. + * + * Due to a PCI loophole, some systems hard-fail certain master aborts, + * causing hangs, crashes or other more aberrant behaviours. Before + * each sparse I/O probe or PCI disablement test, the driver determines + * the likelihood of hard-failed master aborts. In this determination, + * the driver, with the common layer's help, leverages the fact that + * + * 1) the common layer disables the hard-failing of master aborts on + * non-root PCI bus segments; and + * 2) the presence of a PCI-to-ISA, or similar, bridge on a PCI bus + * segment acts to prevent master aborts on that same bus segment. + * + * The driver skips a probe or test (with a message) if it determines + * that a master abort on a PCI root segment cannot be completely + * avoided. + * + * Sparse I/O probes are also skipped when the common layer helper + * functions determine that the sparse I/O range is being routed to + * more than one PCI bus segment. In such a situation, any adapter + * that might, by chance, respond to the probe, would be unusable + * except perhaps as a VGA. + * + * Conflicts between sparse I/O ranges and pre-existing resource + * allocations (which cause a probe to be skipped) are dealt with here, + * rather than in the common layer, because the latter does not + * currently provide a mechanism generic enough to handle the + * ATI-specific probes this driver must perform. Furthermore, by the + * time ATIProbe() is called, the common layer has long ago forgotten + * the distinction between active and inactive resource allocations. + * + * It might be said that this driver does not trust PCI as much as + * other drivers do. There is some truth to that, but the reality is + * this driver's mission includes dealing with observed behaviours that + * are not codified in, or not compliant with, the PCI specifications. */ - if (ATICheckSparseIOBases(NULL, ProbeFlags, ATTRX, 16, TRUE) == - DoProbe) + for (Domain = 0; Domain < MaxDomain; Domain++) { - pATI = ATIVGAProbe(NULL); - if (pATI->Adapter == ATI_ADAPTER_NONE) + do /* Probe for background VGA */ { - xfree(pATI); + ProbeFlag = ATICheckSparseIOBases(NULL, ProbeFlags, Domain, + MonochromeIOBase, 48, fChipsets[ATI_CHIPSET_IBMVGA]); - xf86MsgVerb(X_INFO, 4, - ATI_NAME ": Unshared VGA not detected.\n"); - } - else - { - /* - * Claim all MDA/HGA/CGA/EGA/VGA I/O ports. This might need to - * be more selective. - */ - ATIClaimSparseIOBases(ProbeFlags, MonochromeIOBase, 48, - DetectedVGA); + if (ProbeFlag != DoProbe) + { + if (ProbeFlag == BadRouting) + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Unshared VGA not probed in domain %d" + " due to unsuitable PCI routing.\n", Domain); + else + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Unshared VGA not probed in domain %d" + " due to an I/O conflict.\n", Domain); + break; + } - pVGA = pATI; - strcpy(Identifier, "Unshared VGA"); + if (!xf86CheckPciSparseIO(Domain, MonochromeIOBase, 48, + (int)0xFFFF03FF, &DontProbe)) + { + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Unshared VGA not probed in domain %d due" + " to unsuitable PCI routing.\n", Domain); + + ATISetSparseIOBases(ProbeFlags, Domain, MonochromeIOBase, + 48, BadRouting); + break; + } + + if (DontProbe && !fChipsets[ATI_CHIPSET_IBMVGA]) + { + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Unshared VGA not probed in domain %d due" + " to a potential hard-failed master abort.\n", Domain); + + ATISetSparseIOBases(ProbeFlags, Domain, MonochromeIOBase, + 48, Allowed); + break; + } + + pATI = ATIVGAProbe(NULL, pDomainIOBase[Domain], Domain); + if (pATI->Adapter == ATI_ADAPTER_NONE) + { + xfree(pATI); + + xf86MsgVerb(X_INFO, 4, + ATI_NAME ": Unshared VGA not detected in domain" + " %d.\n", Domain); + break; + } + + /* + * Claim all MDA/HGA/CGA/EGA/VGA I/O ports. This might need to + * be more selective. + */ + ATISetSparseIOBases(ProbeFlags, Domain, MonochromeIOBase, 48, + DetectedVGA); + + ppVGA[Domain] = pATI; + strcpy(Identifier, "Unshared VGA"); xf86MsgVerb(X_INFO, 3, - ATI_NAME ": %s detected.\n", Identifier); - } - } - else - { - xf86MsgVerb(X_INFO, 2, ATI_NAME ": Unshared VGA not probed.\n"); - } + ATI_NAME ": %s detected in domain %d.\n", + Identifier, Domain); + } while (0); - if (ATICheckSparseIOBases(NULL, ProbeFlags, 0x02E8U, 8, - fChipsets[ATI_CHIPSET_IBM8514] || - fChipsets[ATI_CHIPSET_MACH8] || - fChipsets[ATI_CHIPSET_MACH32]) == DoProbe) - { - if ((pATI = ATI8514Probe(NULL))) + do /* Probe for background 8514/A */ { - strcpy(Identifier, "Unshared 8514/A"); - xf86MsgVerb(X_INFO, 3, - ATI_NAME ": %s detected.\n", Identifier); + ProbeFlag = ATICheckSparseIOBases(NULL, ProbeFlags, Domain, + 0x02E8U, 8, fChipsets[ATI_CHIPSET_IBM8514]); + + if (ProbeFlag != DoProbe) + { + if (ProbeFlag == BadRouting) + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Unshared 8514/A not probed in domain" + " %d due to unsuitable PCI routing.\n", Domain); + else + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Unshared 8514/A not probed in domain" + " %d due to an I/O conflict.\n", Domain); + break; + } - AddAdapter(p8514 = pATI); + if (!xf86CheckPciSparseIO(Domain, 0x02E8U, 8, + (int)0xFFFF03FF, &DontProbe)) + { + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Unshared 8514/A not probed in domain %d" + " due to unsuitable PCI routing.\n", Domain); + + ATISetSparseIOBases(ProbeFlags, Domain, 0x02E8U, 8, + BadRouting); + break; + } - if ((pATI->VGAAdapter != ATI_ADAPTER_NONE) || - (pATI->Coprocessor != ATI_CHIP_NONE)) - ATIClaimVGA(NULL, &pVGA, pATI, p8514, ProbeFlags, + if (DontProbe && !fChipsets[ATI_CHIPSET_IBM8514]) + { + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Unshared 8514/A not probed in domain %d" + " due to a potential hard-failed master abort.\n", + Domain); + + ATISetSparseIOBases(ProbeFlags, Domain, 0x02E8U, 8, + Allowed); + break; + } + + if ((pATI = ATI8514Probe(NULL, pDomainIOBase[Domain], Domain))) + { + strcpy(Identifier, "Unshared 8514/A"); + xf86MsgVerb(X_INFO, 3, + ATI_NAME ": %s detected in domain %d.\n", + Identifier, Domain); + + AddAdapter(pp8514[Domain] = pATI); + + if ((pATI->VGAAdapter != ATI_ADAPTER_NONE) || + (pATI->Coprocessor != ATI_CHIP_NONE)) + ATIClaimVGA(NULL, &ppVGA[Domain], pATI, pATI, + ProbeFlags, &DontProbe, Domain, Detected8514A); + + ATISetSparseIOBases(ProbeFlags, Domain, 0x02E8U, 8, Detected8514A); + break; + } - ATIClaimSparseIOBases(ProbeFlags, 0x02E8U, 8, Detected8514A); - } - else - { xf86MsgVerb(X_INFO, 4, - ATI_NAME ": Unshared 8514/A not detected.\n"); - } - } - else - { - xf86MsgVerb(X_INFO, 2, - ATI_NAME ": Unshared 8514/A not probed.\n"); - } + ATI_NAME ": Unshared 8514/A not detected in domain %d.\n", + Domain); + } while (0); + + /* Probe for background Mach64's */ + for (i = 0; i < NumberOf(Mach64SparseIOBases); i++) + { + ProbeFlag = ATICheckSparseIOBases(NULL, ProbeFlags, Domain, + Mach64SparseIOBases[i], 4, fChipsets[ATI_CHIPSET_MACH64]); + + if (ProbeFlag != DoProbe) + { + if (ProbeFlag == BadRouting) + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Unshared Mach64 at I/O base 0x%04X" + " not probed in domain %d due to unsuitable PCI" + " routing.\n", Mach64SparseIOBases[i], Domain); + else + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Unshared Mach64 at I/O base 0x%04X" + " not probed in domain %d due to I/O conflict.\n", + Mach64SparseIOBases[i], Domain); + continue; + } - for (i = 0; i < NumberOf(Mach64SparseIOBases); i++) - { - if (ATICheckSparseIOBases(NULL, ProbeFlags, Mach64SparseIOBases[i], - 4, fChipsets[ATI_CHIPSET_MACH64]) != DoProbe) - { - xf86MsgVerb(X_INFO, 2, - ATI_NAME ": Unshared Mach64 at PIO base 0x%04lX not" - " probed.\n", - Mach64SparseIOBases[i]); - continue; - } + if (!xf86CheckPciSparseIO(Domain, Mach64SparseIOBases[i], 4, + (int)0xFFFF03FF, &DontProbe)) + { + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Unshared Mach64 at I/O base 0x%04X not" + " probed in domain %d due to unsuitable PCI" + " routing.\n", Mach64SparseIOBases[i], Domain); - pATI = ATIMach64Probe(NULL, Mach64SparseIOBases[i], SPARSE_IO, 0); - if (!pATI) - { - xf86MsgVerb(X_INFO, 4, - ATI_NAME ": Unshared Mach64 at PIO base 0x%04lX not" - " detected.\n", Mach64SparseIOBases[i]); - continue; - } + ATISetSparseIOBases(ProbeFlags, Domain, + Mach64SparseIOBases[i], 4, BadRouting); + continue; + } - sprintf(Identifier, "Unshared Mach64 at sparse PIO base 0x%04lX", - Mach64SparseIOBases[i]); - xf86MsgVerb(X_INFO, 3, ATI_NAME ": %s detected.\n", Identifier); + if (DontProbe && !fChipsets[ATI_CHIPSET_MACH64]) + { + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Unshared Mach64 at I/O base 0x%04X not" + " probed in domain %d due to a potential master" + " abort.\n", Mach64SparseIOBases[i], Domain); - AddAdapter(pMach64[i] = pATI); + ATISetSparseIOBases(ProbeFlags, Domain, + Mach64SparseIOBases[i], 4, Allowed); + continue; + } + + /* + * The first 3D Rage (the GT) appears to have been the last + * Mach64 to support sparse I/O. + */ + pATI = ATIMach64Probe(NULL, Mach64SparseIOBases[i], + pDomainIOBase[Domain], Domain, SPARSE_IO, ATI_CHIP_264GT); + if (!pATI) + { + xf86MsgVerb(X_INFO, 4, + ATI_NAME ": Unshared Mach64 at I/O base 0x%04X not" + " detected in domain %d.\n", + Mach64SparseIOBases[i], Domain); + continue; + } - if (pATI->VGAAdapter != ATI_ADAPTER_NONE) - ATIClaimVGA(NULL, &pVGA, pATI, p8514, ProbeFlags, - DetectedMach64); + sprintf(Identifier, + "Unshared Mach64 at sparse I/O base 0x%04X", + Mach64SparseIOBases[i]); + xf86MsgVerb(X_INFO, 3, + ATI_NAME ": %s detected in domain %d.\n", + Identifier, Domain); - ATIClaimSparseIOBases(ProbeFlags, Mach64SparseIOBases[i], 4, - DetectedMach64); - } + AddAdapter(ppMach64[(Domain * 3) + i] = pATI); -#endif /* AVOID_NON_PCI */ + if (pATI->VGAAdapter != ATI_ADAPTER_NONE) + ATIClaimVGA(NULL, &ppVGA[Domain], pATI, pp8514[Domain], + ProbeFlags, &DontProbe, Domain, DetectedMach64); + ATISetSparseIOBases(ProbeFlags, Domain, Mach64SparseIOBases[i], + 4, DetectedMach64); + } + } } -#endif /* AVOID_CPIO */ - if (xf86PciVideoInfo) { if (nATIGDev) { +#ifdef __NOT_YET__ + /* + * Code similar to the next block will probably be needed for PCI + * Mach32's when the driver starts using their MEMORY_IO space. + */ +#endif -#ifndef AVOID_NON_PCI - -#ifdef AVOID_CPIO - - /* PCI sparse I/O adapters can still be used through MMIO */ + /* + * Mach64 PCI sparse I/O adapters can still be used through + * MEMORY_IO. + */ for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) { if ((pVideo->vendor != PCI_VENDOR_ATI) || @@ -1359,19 +1679,85 @@ !(pPCI = pVideo->thisCard)) continue; + /* + * Possibly fix block I/O and GENENA decoding indicators in PCI + * configuration space. + */ PciReg = pciReadLong(pPCI->tag, PCI_REG_USERCONFIG); - - /* Possibly fix block I/O indicator */ - if (PciReg & 0x00000004U) + if (PciReg & 0x0000000CU) pciWriteLong(pPCI->tag, PCI_REG_USERCONFIG, - PciReg & ~0x00000004U); + PciReg & ~0x0000000CU); + + Domain = xf86GetPciDomain(pPCI->tag); + Mach64SparseIOBase = 0; + j = PciReg & 0x03U; + if (j != 0x03U) + { + Mach64SparseIOBase = Mach64SparseIOBases[j]; + + switch (ATICheckSparseIOBases(pVideo, ProbeFlags, Domain, + Mach64SparseIOBase, 4, FALSE)) + { + case Detected8514A: + xf86MsgVerb(X_WARNING, 1, + ATI_NAME ": Disabled PCI Mach64 in slot" + " %d:%d:%d not probed due to a conflict with" + " an %s in domain %d.\n", + pVideo->bus, pVideo->device, pVideo->func, + ATIAdapterNames[pp8514[Domain]->Adapter], + Domain); + continue; + + case DetectedMach64: + /* Already detected? */ + pATI = ppMach64[(Domain * 3) + j]; + if (pATI->BusType >= ATI_BUS_PCI) + pATI->PCIInfo = pVideo; + else + xf86MsgVerb(X_WARNING, 1, + ATI_NAME ": Disabled PCI Mach64 in slot" + " %d:%d:%d not probed due to a conflict" + " with another %s Mach64 at sparse I/O" + " base 0x%04X in domain %d.\n", + pVideo->bus, pVideo->device, pVideo->func, + ATIBusNames[pATI->BusType], + Mach64SparseIOBase, Domain); + continue; + + case DoProbe: + /* Already probed (unsuccessfully) */ + continue; + + default: + /* Some kind of I/O problem */ + break; + } + } + + if (!xf86CheckPciVideo(pVideo, &DontProbe)) + { + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Disabled PCI Mach64 in slot %d:%d:%d not" + " probed in domain %d due to unsuitable PCI" + " routing.\n", + pVideo->bus, pVideo->device, pVideo->func, Domain); + continue; + } + + if (DontProbe) + { + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Disabled PCI Mach64 in slot %d:%d:%d not" + " probed in domain %d due to a potential hard-failed" + " master abort.\n", + pVideo->bus, pVideo->device, pVideo->func, Domain); + continue; + } Chip = ATIChipID(pVideo->chipType, pVideo->chipRev); - /* - * The CPIO base used by the adapter is of little concern here. - */ - pATI = ATIMach64Probe(pVideo, 0, SPARSE_IO, Chip); + pATI = ATIMach64Probe(pVideo, Mach64SparseIOBase, + pDomainIOBase[Domain], Domain, MEMORY_IO, Chip); if (!pATI) continue; @@ -1379,153 +1765,205 @@ "Unshared PCI sparse I/O Mach64 in slot %d:%d:%d", pVideo->bus, pVideo->device, pVideo->func); xf86MsgVerb(X_INFO, 3, - ATI_NAME ": %s detected through Block 0 at 0x%08lX.\n", - Identifier, pATI->Block0Base); + ATI_NAME ": %s detected through Block 0 at 0x%08lX in" + " domain %d.\n", Identifier, pATI->Block0Base, Domain); AddAdapter(pATI); - pATI->PCIInfo = pVideo; - } -#endif /* AVOID_CPIO */ + /* This is probably not necessary */ + if (pATI->VGAAdapter != ATI_ADAPTER_NONE) + ATIClaimVGA(pVideo, &ppVGA[Domain], pATI, pp8514[Domain], + ProbeFlags, &DontProbe, Domain, DetectedMach64); + + if (j != 0x03U) + { + ppMach64[(Domain * 3) + j] = pATI; + + ATISetSparseIOBases(ProbeFlags, Domain, Mach64SparseIOBase, + 4, DetectedMach64); + } + } + /* Probe for Mach64 PCI block I/O devices */ for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) { if ((pVideo->vendor != PCI_VENDOR_ATI) || (pVideo->chipType == PCI_CHIP_MACH32) || - !pVideo->size[1]) + !pVideo->size[1] || + !(pPCI = pVideo->thisCard)) continue; /* For now, ignore Rage128's and Radeon's */ Chip = ATIChipID(pVideo->chipType, pVideo->chipRev); - if ((Chip > ATI_CHIP_Mach64) || - !(pPCI = pVideo->thisCard)) + if (Chip > ATI_CHIP_Mach64) continue; /* - * Possibly fix block I/O indicator in PCI configuration space. + * Possibly fix block I/O and GENENA decoding indicators in PCI + * configuration space. */ PciReg = pciReadLong(pPCI->tag, PCI_REG_USERCONFIG); - if (!(PciReg & 0x00000004U)) + if ((PciReg & 0x00000008U) || + ((Chip < ATI_CHIP_264VTB) && !(PciReg & 0x00000004U))) pciWriteLong(pPCI->tag, PCI_REG_USERCONFIG, - PciReg | 0x00000004U); + (PciReg & ~0x00000008U) | 0x00000004U); + + Domain = xf86GetPciDomain(pPCI->tag); + + if (!xf86CheckPciVideo(pVideo, &DontProbe)) + { + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Disabled PCI/AGP Mach64 in slot %d:%d:%d" + " not probed in domain %d due to unsuitable PCI" + " routing.\n", + pVideo->bus, pVideo->device, pVideo->func, Domain); + continue; + } - pATI = - ATIMach64Probe(pVideo, pVideo->ioBase[1], BLOCK_IO, Chip); + if (DontProbe) + { + xf86MsgVerb(X_INFO, 2, + ATI_NAME ": Disabled PCI/AGP Mach64 in slot %d:%d:%d" + " not probed in domain %d due to a potential" + " hard-failed master abort.\n", + pVideo->bus, pVideo->device, pVideo->func, Domain); + continue; + } + + pATI = ATIMach64Probe(pVideo, pVideo->ioBase[1], + pDomainIOBase[Domain], Domain, BLOCK_IO, Chip); if (!pATI) continue; sprintf(Identifier, "Unshared PCI/AGP Mach64 in slot %d:%d:%d", pVideo->bus, pVideo->device, pVideo->func); xf86MsgVerb(X_INFO, 3, - ATI_NAME ": %s detected.\n", Identifier); + ATI_NAME ": %s detected in domain %d.\n", + Identifier, Domain); AddAdapter(pATI); -#ifndef AVOID_CPIO - /* This is probably not necessary */ if (pATI->VGAAdapter != ATI_ADAPTER_NONE) - ATIClaimVGA(pVideo, &pVGA, pATI, p8514, - ProbeFlags, DetectedMach64); - -#endif /* AVOID_CPIO */ - + ATIClaimVGA(pVideo, &ppVGA[Domain], pATI, pp8514[Domain], + ProbeFlags, &DontProbe, Domain, DetectedMach64); } -#endif /* AVOID_NON_PCI */ - -#ifndef AVOID_CPIO - /* * This is the second pass through PCI configuration space. Much * of this is verbiage to deal with potential situations that are * very unlikely to occur in practice. * - * First, look for non-ATI shareable VGA's. For now, these must - * the primary device. + * First, look for non-ATI shareable VGA's. */ - if (ATICheckSparseIOBases(NULL, ProbeFlags, ATTRX, 16, TRUE) == - DoProbe) + for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) { - for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) + if ((pVideo->vendor == PCI_VENDOR_ATI) || + !(pPCI = pVideo->thisCard)) + continue; + + switch (pVideo->class) { - if ((pVideo->vendor == PCI_VENDOR_ATI) || - !xf86IsPrimaryPci(pVideo)) + case PCI_CLASS_PREHISTORIC: + if (pVideo->subclass == PCI_SUBCLASS_PREHISTORIC_VGA) + break; + continue; + + case PCI_CLASS_DISPLAY: + if (pVideo->subclass == PCI_SUBCLASS_DISPLAY_VGA) + break; continue; - if (!xf86CheckPciSlot(pVideo->bus, - pVideo->device, - pVideo->func)) + default: continue; + } - xf86SetPciVideo(pVideo, MEM_IO); + if (!xf86CheckPciSlot(pVideo->bus, + pVideo->device, + pVideo->func)) + continue; - pATI = ATIVGAProbe(NULL); - if (pATI->Adapter == ATI_ADAPTER_NONE) - { - xfree(pATI); - xf86Msg(X_WARNING, - ATI_NAME ": PCI/AGP VGA compatible in slot" - " %d:%d:%d could not be detected!\n", - pVideo->bus, pVideo->device, pVideo->func); - } - else - { - sprintf(Identifier, - "Shared non-ATI VGA in PCI/AGP slot %d:%d:%d", - pVideo->bus, pVideo->device, pVideo->func); - xf86MsgVerb(X_INFO, 3, ATI_NAME ": %s detected.\n", - Identifier); - AddAdapter(pATI); - pATI->SharedVGA = TRUE; - pATI->BusType = ATI_BUS_PCI; - pATI->PCIInfo = pVideo; - } + Domain = xf86GetPciDomain(pPCI->tag); + if (ATICheckSparseIOBases(pVideo, ProbeFlags, Domain, + MonochromeIOBase, 48, TRUE) != DoProbe) + continue; - xf86SetPciVideo(NULL, NONE); + xf86SetPciVideo(pVideo, MEM_IO); + + pATI = ATIVGAProbe(NULL, pDomainIOBase[Domain], Domain); + if (pATI->Adapter == ATI_ADAPTER_NONE) + { + xfree(pATI); + xf86MsgVerb(X_WARNING, 0, + ATI_NAME ": PCI/AGP VGA compatible in slot %d:%d:%d" + " could not be detected!\n", + pVideo->bus, pVideo->device, pVideo->func); } + else + { + sprintf(Identifier, + "Shared non-ATI VGA in PCI/AGP slot %d:%d:%d", + pVideo->bus, pVideo->device, pVideo->func); + xf86MsgVerb(X_INFO, 3, ATI_NAME ": %s detected.\n", + Identifier); + AddAdapter(pATI); + pATI->SharedVGA = TRUE; + pATI->BusType = ATI_BUS_PCI; + pATI->PCIInfo = pVideo; + } + + xf86SetPciVideo(NULL, NONE); } /* Next, look for PCI Mach32's */ for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) { if ((pVideo->vendor != PCI_VENDOR_ATI) || - (pVideo->chipType != PCI_CHIP_MACH32)) + (pVideo->chipType != PCI_CHIP_MACH32) || + !(pPCI = pVideo->thisCard)) continue; - switch (ATICheckSparseIOBases(pVideo, ProbeFlags, + Domain = xf86GetPciDomain(pPCI->tag); + + switch (ATICheckSparseIOBases(pVideo, ProbeFlags, Domain, 0x02E8U, 8, TRUE)) { - case 0: + case Conflict: xf86Msg(X_WARNING, ATI_NAME ": PCI Mach32 in slot %d:%d:%d will not" - " be enabled\n because it conflicts with a" + " be enabled because it conflicts with a" " non-video PCI/AGP device.\n", pVideo->bus, pVideo->device, pVideo->func); - break; - -#ifndef AVOID_NON_PCI + continue; case Detected8514A: - if ((p8514->BusType >= ATI_BUS_PCI) && !p8514->PCIInfo) - p8514->PCIInfo = pVideo; - else - xf86Msg(X_WARNING, - ATI_NAME ": PCI Mach32 in slot %d:%d:%d will" - " not be enabled\n because it conflicts with" - " another %s %s.\n", - pVideo->bus, pVideo->device, pVideo->func, - ATIBusNames[p8514->BusType], - ATIAdapterNames[p8514->Adapter]); - break; + pATI = pp8514[Domain]; + if (pATI->BusType >= ATI_BUS_PCI) + { + if (pVideo == pATI->PCIInfo) + continue; + + if (!pATI->PCIInfo) + { + pATI->PCIInfo = pVideo; + continue; + } + } - case DetectedMach64: xf86Msg(X_WARNING, ATI_NAME ": PCI Mach32 in slot %d:%d:%d will not" - " be enabled\n because it conflicts with a Mach64" - " at I/O base 0x02EC.\n", - pVideo->bus, pVideo->device, pVideo->func); - break; + " be enabled because it conflicts with another %s" + " %s.\n", + pVideo->bus, pVideo->device, pVideo->func, + ATIBusNames[pATI->BusType], + ATIAdapterNames[pATI->Adapter]); + continue; -#endif /* AVOID_NON_PCI */ + case DetectedMach64: + xf86Msg(X_WARNING, + ATI_NAME ": PCI Mach32 in slot %d:%d:%d will not" + " be enabled because it conflicts with a Mach64 at" + " I/O base 0x02EC in domain %d.\n", + pVideo->bus, pVideo->device, pVideo->func, Domain); + continue; default: /* Must be DoProbe */ if (!xf86CheckPciSlot(pVideo->bus, @@ -1535,9 +1973,11 @@ xf86SetPciVideo(pVideo, MEM_IO); - if (!(pATI = ATI8514Probe(pVideo))) + pATI = ATI8514Probe(pVideo, pDomainIOBase[Domain], + Domain); + if (!pATI) { - xf86Msg(X_WARNING, + xf86MsgVerb(X_WARNING, 0, ATI_NAME ": PCI Mach32 in slot %d:%d:%d could" " not be detected!\n", pVideo->bus, pVideo->device, pVideo->func); @@ -1550,7 +1990,7 @@ xf86MsgVerb(X_INFO, 3, ATI_NAME ": %s detected.\n", Identifier); if (pATI->Adapter != ATI_ADAPTER_MACH32) - xf86Msg(X_WARNING, + xf86MsgVerb(X_WARNING, 0, ATI_NAME ": PCI Mach32 in slot %d:%d:%d" " could only be detected as an %s!\n", pVideo->bus, pVideo->device, pVideo->func, @@ -1561,12 +2001,12 @@ if ((pATI->VGAAdapter != ATI_ADAPTER_NONE) || (pATI->Coprocessor != ATI_CHIP_NONE)) - ATIFindVGA(pVideo, &pVGA, &pATI, p8514, - ProbeFlags); + ATIFindVGA(pVideo, &ppVGA[Domain], &pATI, + pp8514[Domain], ProbeFlags, Domain); } xf86SetPciVideo(NULL, NONE); - break; + continue; } } @@ -1575,119 +2015,69 @@ { if ((pVideo->vendor != PCI_VENDOR_ATI) || (pVideo->chipType == PCI_CHIP_MACH32) || - pVideo->size[1]) + pVideo->size[1] || + !(pPCI = pVideo->thisCard)) continue; - pPCI = pVideo->thisCard; PciReg = pciReadLong(pPCI->tag, PCI_REG_USERCONFIG); + Domain = xf86GetPciDomain(pPCI->tag); + + IODecoding = MEMORY_IO; j = PciReg & 0x03U; if (j == 0x03U) { - xf86Msg(X_WARNING, - ATI_NAME ": PCI Mach64 in slot %d:%d:%d cannot be" - " enabled\n because it has neither a block, nor a" - " sparse, I/O base.\n", - pVideo->bus, pVideo->device, pVideo->func); + /* + * These adapters can only be detected, let alone used, + * through MEMORY_IO. + */ + for (k = 0; k < nATIPtr; k++) + if (ATIPtrs[k]->PCIInfo == pVideo) + goto NextSparseMach64; + + Mach64SparseIOBase = 0; } - else switch(ATICheckSparseIOBases(pVideo, ProbeFlags, - Mach64SparseIOBases[j], 4, TRUE)) + else { - case 0: - xf86Msg(X_WARNING, - ATI_NAME ": PCI Mach64 in slot %d:%d:%d will not" - " be enabled\n because it conflicts with another" - " non-video PCI device.\n", - pVideo->bus, pVideo->device, pVideo->func); - break; + Mach64SparseIOBase = Mach64SparseIOBases[j]; -#ifndef AVOID_NON_PCI - - case Detected8514A: - xf86Msg(X_WARNING, - ATI_NAME ": PCI Mach64 in slot %d:%d:%d will not" - " be enabled\n because it conflicts with an %s.\n", - pVideo->bus, pVideo->device, pVideo->func, - ATIAdapterNames[p8514->Adapter]); - break; - - case DetectedMach64: - pATI = pMach64[j]; - if ((pATI->BusType >= ATI_BUS_PCI) && !pATI->PCIInfo) - pATI->PCIInfo = pVideo; - else + switch (ATICheckSparseIOBases(pVideo, ProbeFlags, Domain, + Mach64SparseIOBase, 4, TRUE)) + { + case Detected8514A: xf86Msg(X_WARNING, ATI_NAME ": PCI Mach64 in slot %d:%d:%d will" - " not be enabled\n because it conflicts with" - " another %s Mach64 at sparse I/O base" - " 0x%04lX.\n", + " not be enabled because it conflicts with an" + " %s in domain %d.\n", pVideo->bus, pVideo->device, pVideo->func, - ATIBusNames[pATI->BusType], - Mach64SparseIOBases[j]); - break; - -#endif /* AVOID_NON_PCI */ - - default: /* Must be DoProbe */ - if (!xf86CheckPciSlot(pVideo->bus, - pVideo->device, - pVideo->func)) + ATIAdapterNames[pp8514[Domain]->Adapter], + Domain); continue; - /* Possibly fix block I/O indicator */ - if (PciReg & 0x00000004U) - pciWriteLong(pPCI->tag, PCI_REG_USERCONFIG, - PciReg & ~0x00000004U); - - xf86SetPciVideo(pVideo, MEM_IO); + case DetectedMach64: + /* Already detected? */ + pATI = ppMach64[(Domain * 3) + j]; + if (pATI->PCIInfo == pVideo) + continue; - Chip = ATIChipID(pVideo->chipType, pVideo->chipRev); - pATI = ATIMach64Probe(pVideo, Mach64SparseIOBases[j], - SPARSE_IO, Chip); - if (!pATI) - { xf86Msg(X_WARNING, - ATI_NAME ": PCI Mach64 in slot %d:%d:%d could" - " not be detected!\n", - pVideo->bus, pVideo->device, pVideo->func); - } - else - { - sprintf(Identifier, - "Shared PCI Mach64 in slot %d:%d:%d", - pVideo->bus, pVideo->device, pVideo->func); - xf86MsgVerb(X_INFO, 3, - ATI_NAME ": %s with sparse PIO base 0x%04lX" - " detected.\n", Identifier, - Mach64SparseIOBases[j]); - AddAdapter(pATI); - pATI->SharedAccelerator = TRUE; - pATI->PCIInfo = pVideo; - - if (pATI->VGAAdapter != ATI_ADAPTER_NONE) - ATIFindVGA(pVideo, &pVGA, &pATI, p8514, - ProbeFlags); - } - - xf86SetPciVideo(NULL, NONE); - break; - } - } - -#else /* AVOID_CPIO */ + ATI_NAME ": PCI Mach64 in slot %d:%d:%d will" + " not be enabled because it conflicts with" + " another %s Mach64 at sparse I/O base 0x%04X" + " in domain %d.\n", + pVideo->bus, pVideo->device, pVideo->func, + ATIBusNames[pATI->BusType], Mach64SparseIOBase, + Domain); + continue; - for (i = 0; (pVideo = xf86PciVideoInfo[i++]); ) - { - if ((pVideo->vendor != PCI_VENDOR_ATI) || - (pVideo->chipType == PCI_CHIP_MACH32) || - pVideo->size[1]) - continue; + case DoProbe: + /* Do a sparse I/O probe */ + IODecoding = SPARSE_IO; + break; - /* Check if this one has already been detected */ - for (j = 0; j < nATIPtr; j++) - { - pATI = ATIPtrs[j]; - if (pATI->PCIInfo == pVideo) - goto SkipThisSlot; + default: + /* Some kind of I/O routing problem */ + break; + } } if (!xf86CheckPciSlot(pVideo->bus, @@ -1698,35 +2088,33 @@ xf86SetPciVideo(pVideo, MEM_IO); Chip = ATIChipID(pVideo->chipType, pVideo->chipRev); - - /* The adapter's CPIO base is of little concern here */ - pATI = ATIMach64Probe(pVideo, 0, SPARSE_IO, Chip); - if (pATI) + pATI = ATIMach64Probe(pVideo, Mach64SparseIOBase, + pDomainIOBase[Domain], Domain, IODecoding, Chip); + if (!pATI) { - sprintf(Identifier, "Shared PCI Mach64 in slot %d:%d:%d", + xf86MsgVerb(X_WARNING, 0, + ATI_NAME ": PCI Mach64 in slot %d:%d:%d could not be" + " detected!\n", pVideo->bus, pVideo->device, pVideo->func); - xf86MsgVerb(X_INFO, 3, - ATI_NAME ": %s with Block 0 base 0x%08lX detected.\n", - Identifier, pATI->Block0Base); - AddAdapter(pATI); - pATI->SharedAccelerator = TRUE; - pATI->PCIInfo = pVideo; } else { - xf86Msg(X_WARNING, - ATI_NAME ": PCI Mach64 in slot %d:%d:%d could not be" - " detected!\n", + sprintf(Identifier, "Shared PCI Mach64 in slot %d:%d:%d", pVideo->bus, pVideo->device, pVideo->func); + xf86MsgVerb(X_INFO, 3, ATI_NAME ": %s detected.\n", + Identifier); + AddAdapter(pATI); + pATI->SharedAccelerator = TRUE; + + if (pATI->VGAAdapter != ATI_ADAPTER_NONE) + ATIFindVGA(pVideo, &ppVGA[Domain], &pATI, + pp8514[Domain], ProbeFlags, Domain); } xf86SetPciVideo(NULL, NONE); - SkipThisSlot:; + NextSparseMach64:; } - -#endif /* AVOID_CPIO */ - } /* Lastly, look for block I/O devices */ @@ -1734,7 +2122,8 @@ { if ((pVideo->vendor != PCI_VENDOR_ATI) || (pVideo->chipType == PCI_CHIP_MACH32) || - !pVideo->size[1]) + !pVideo->size[1] || + !(pPCI = pVideo->thisCard)) continue; /* Check for Rage128's, Radeon's and later adapters */ @@ -1754,11 +2143,8 @@ /* Check if this one has already been detected */ for (j = 0; j < nATIPtr; j++) - { - pATI = ATIPtrs[j]; - if (pATI->CPIOBase == pVideo->ioBase[1]) - goto SetPCIInfo; - } + if (ATIPtrs[j]->PCIInfo == pVideo) + goto NextBlockMach64; if (!xf86CheckPciSlot(pVideo->bus, pVideo->device, pVideo->func)) continue; @@ -1766,7 +2152,9 @@ /* Probe for it */ xf86SetPciVideo(pVideo, MEM_IO); - pATI = ATIMach64Probe(pVideo, pVideo->ioBase[1], BLOCK_IO, Chip); + Domain = xf86GetPciDomain(pPCI->tag); + pATI = ATIMach64Probe(pVideo, pVideo->ioBase[1], + pDomainIOBase[Domain], Domain, BLOCK_IO, Chip); if (pATI) { sprintf(Identifier, "Shared PCI/AGP Mach64 in slot %d:%d:%d", @@ -1776,243 +2164,269 @@ AddAdapter(pATI); pATI->SharedAccelerator = TRUE; -#ifndef AVOID_CPIO - if (pATI->VGAAdapter != ATI_ADAPTER_NONE) - ATIFindVGA(pVideo, &pVGA, &pATI, p8514, ProbeFlags); - -#endif /* AVOID_CPIO */ - + ATIFindVGA(pVideo, &ppVGA[Domain], &pATI, pp8514[Domain], + ProbeFlags, Domain); } - - xf86SetPciVideo(NULL, NONE); - - if (!pATI) + else { - xf86Msg(X_WARNING, + xf86MsgVerb(X_WARNING, 0, ATI_NAME ": PCI/AGP Mach64 in slot %d:%d:%d could not be" " detected!\n", pVideo->bus, pVideo->device, pVideo->func); - continue; } - SetPCIInfo: - pATI->PCIInfo = pVideo; + xf86SetPciVideo(NULL, NONE); + + NextBlockMach64:; } } -#ifndef AVOID_CPIO - /* * At this point, if there's a non-shareable VGA with its own framebuffer, * find out if it's an ATI VGA Wonder. */ - do + if (nATIGDev) { - if (!nATIGDev || !pVGA || (pVGA->VGAAdapter > ATI_ADAPTER_VGA)) - break; + for (Domain = 0; Domain < MaxDomain; Domain++) + { + if (!(pATI = ppVGA[Domain]) || + (pATI->VGAAdapter > ATI_ADAPTER_VGA)) + continue; - /* If it has not been assigned to a coprocessor, keep track of it */ - if (pVGA->Coprocessor == ATI_CHIP_NONE) - AddAdapter(pVGA); + /* + * If it has not been assigned to a coprocessor, keep track of it. + */ + if (pATI->Coprocessor == ATI_CHIP_NONE) + AddAdapter(pATI); - /* - * A VGA should have installed its int 10 vector. Use that to find the - * VGA BIOS. If this fails, scan all legacy BIOS segments, in 512-byte - * increments. - */ - if (xf86ReadBIOS(0U, 0x42U, BIOS, 2) != 2) - goto NoVGAWonder; + /* The following test isn't entirely correct but will do for now */ + if (!xf86DomainHasBIOSSegments(Domain)) + continue; - pATI = NULL; - BIOSBase = 0; - if (!(BIOS[0] & 0x1FU)) /* Otherwise there's no 512-byte alignment */ - BIOSBase = ((BIOS[1] << 8) | BIOS[0]) << 4; - - /* Look for its BIOS */ - for(; ; BIOSBase += 0x00000200U) - { - if (!BIOSBase) - goto SkipBiosSegment; - - if (BIOSBase >= 0x000F8000U) - goto NoVGAWonder; - - /* Skip over those that are already known */ - for (i = 0; i < nATIPtr; i++) - if (ATIPtrs[i]->BIOSBase == BIOSBase) + /* + * A VGA should have installed its int 10 vector. Use that to find + * its BIOS. If this fails, scan all legacy BIOS segments, in + * 512-byte increments. + */ + if (xf86ReadBIOS(0U, 0x42U, BIOS, 2) != 2) + continue; + + pATI = NULL; + BIOSBase = 0; + if (!(BIOS[0] & 0x1FU)) + BIOSBase = ((BIOS[1] << 8) | BIOS[0]) << 4; + + /* Look for its BIOS */ + for(; ; BIOSBase += 0x00000200U) + { + if (!BIOSBase) goto SkipBiosSegment; - /* Get first 80 bytes of video BIOS */ - if (xf86ReadBIOS(BIOSBase, 0, BIOS, SizeOf(BIOS)) != - SizeOf(BIOS)) - goto NoVGAWonder; - - if ((BIOS[0x00U] != 0x55U) || (BIOS[0x01U] != 0xAAU)) - goto SkipBiosSegment; - - if ((BIOS[0x1EU] == 'I') && - (BIOS[0x1FU] == 'B') && - (BIOS[0x20U] == 'M')) - break; + if (BIOSBase >= 0x000F8000U) + goto NoVGAWonder; - /* XXX Should PCI BIOS signature be checked for here ? */ - if ((BIOS[0x20U] == 'P') && - (BIOS[0x21U] == 'C') && - (BIOS[0x22U] == 'I')) - break; + /* Skip over those that are already known */ + for (i = 0; i < nATIPtr; i++) + if ((ATIPtrs[i]->Domain == Domain) && + (ATIPtrs[i]->BIOSBase == BIOSBase)) + goto SkipBiosSegment; + + /* Get first 80 bytes of video BIOS */ + if (xf86ReadBIOS(BIOSBase, 0, BIOS, SizeOf(BIOS)) != + SizeOf(BIOS)) + goto NoVGAWonder; - SkipBiosSegment: - if (pATI) - continue; + if ((BIOS[0x00U] == 0x55U) && (BIOS[0x01U] == 0xAAU) && + !memcmp(BIOS + IBMOffset, IBMSignature, IBMSize)) + break; - pATI = pVGA; - BIOSBase = 0x000C0000U - 0x00000200U; - } + SkipBiosSegment: + if (pATI) + continue; - pVGA->BIOSBase = BIOSBase; + pATI = ppVGA[Domain]; + BIOSBase = 0x000C0000U - 0x00000200U; + } - /* Look for the ATI signature string */ - if (memcmp(BIOS + BIOSSignature, ATISignature, SignatureSize)) - break; + pATI = ppVGA[Domain]; + pATI->BIOSBase = BIOSBase; - if (BIOS[0x40U] != '3') - break; + /* Look for the ATI signature string */ + if (memcmp(BIOS + ATIOffset, ATISignature, ATISize)) + continue; - switch (BIOS[0x41U]) - { - case '1': - /* This is a Mach8 or VGA Wonder adapter of some kind */ - if ((BIOS[0x43U] >= '1') && (BIOS[0x43U] <= '6')) - pVGA->Chip = BIOS[0x43U] - ('1' - ATI_CHIP_18800); - - switch (BIOS[0x43U]) - { - case '1': /* ATI_CHIP_18800 */ - pVGA->VGAOffset = 0xB0U; - pVGA->VGAAdapter = ATI_ADAPTER_V3; - break; + if (BIOS[0x40U] != '3') + continue; - case '2': /* ATI_CHIP_18800_1 */ - pVGA->VGAOffset = 0xB0U; - if (BIOS[0x42U] & 0x10U) - pVGA->VGAAdapter = ATI_ADAPTER_V5; - else - pVGA->VGAAdapter = ATI_ADAPTER_V4; - break; + switch (BIOS[0x41U]) + { + case '1': + /* This is a Mach8 or VGA Wonder adapter of some kind */ + if ((BIOS[0x43U] >= '1') && (BIOS[0x43U] <= '6')) + pATI->Chip = BIOS[0x43U] - ('1' - ATI_CHIP_18800); - case '3': /* ATI_CHIP_28800_2 */ - case '4': /* ATI_CHIP_28800_4 */ - case '5': /* ATI_CHIP_28800_5 */ - case '6': /* ATI_CHIP_28800_6 */ - pVGA->VGAOffset = 0xA0U; - if (BIOS[0x44U] & 0x80U) - pVGA->VGAAdapter = ATI_ADAPTER_XL; - else - pVGA->VGAAdapter = ATI_ADAPTER_PLUS; - break; + switch (BIOS[0x43U]) + { + case '1': /* ATI_CHIP_18800 */ + pATI->VGAOffset = 0xB0U; + pATI->VGAAdapter = ATI_ADAPTER_V3; + break; - case 'a': /* A crippled Mach32 */ - case 'b': - case 'c': - pVGA->VGAOffset = 0x80U; - pVGA->VGAAdapter = ATI_ADAPTER_NONISA; - ATIMach32ChipID(pVGA); - ProbeWaitIdleEmpty(); - if (inw(SUBSYS_STAT) != (CARD16)(-1)) - pVGA->ChipHasSUBSYS_CNTL = TRUE; - break; + case '2': /* ATI_CHIP_18800_1 */ + pATI->VGAOffset = 0xB0U; + if (BIOS[0x42U] & 0x10U) + pATI->VGAAdapter = ATI_ADAPTER_V5; + else + pATI->VGAAdapter = ATI_ADAPTER_V4; + break; + + case '3': /* ATI_CHIP_28800_2 */ + case '4': /* ATI_CHIP_28800_4 */ + case '5': /* ATI_CHIP_28800_5 */ + case '6': /* ATI_CHIP_28800_6 */ + pATI->VGAOffset = 0xA0U; + if (BIOS[0x44U] & 0x80U) + pATI->VGAAdapter = ATI_ADAPTER_XL; + else + pATI->VGAAdapter = ATI_ADAPTER_PLUS; + break; + + case 'a': /* A crippled Mach32 */ + case 'b': + case 'c': + pATI->VGAOffset = 0x80U; + pATI->VGAAdapter = ATI_ADAPTER_NONISA; + ATIMach32ChipID(pATI); + ProbeWaitIdleEmpty(); + if (inw(SUBSYS_STAT) != (CARD16)(-1)) + pATI->ChipHasSUBSYS_CNTL = TRUE; + break; #if 0 - case ' ': /* A crippled Mach64 */ - pVGA->VGAOffset = 0x80U; - pVGA->VGAAdapter = ATI_ADAPTER_NONISA; - ATIMach64ChipID(pVGA, 0); - break; + case ' ': /* A crippled Mach64 */ + pATI->VGAOffset = 0x80U; + pATI->VGAAdapter = ATI_ADAPTER_NONISA; + ATIMach64ChipID(pATI, 0); + break; #endif - default: - break; - } + default: + break; + } - if (pVGA->VGAAdapter == ATI_ADAPTER_NONE) - break; + if (pATI->VGAAdapter == ATI_ADAPTER_NONE) + break; - /* Set VGA Wonder I/O port */ - pVGA->CPIO_VGAWonder = BIOSWord(0x10U) & SPARSE_IO_PORT; - if (!pVGA->CPIO_VGAWonder) - pVGA->CPIO_VGAWonder = 0x01CEU; + /* Set VGA Wonder I/O port */ + pATI->CPIO_VGAWonder = BIOSWord(0x10U) & SPARSE_IO_PORT; + if (!pATI->CPIO_VGAWonder) + pATI->CPIO_VGAWonder = 0x01CEU; - ATIVGAWonderProbe(NULL, pVGA, p8514, ProbeFlags); - break; + ATIVGAWonderProbe(NULL, pATI, pp8514[Domain], ProbeFlags, + NULL, Domain); + break; #if 0 - case '2': - pVGA->VGAOffset = 0xB0U; /* Presumably */ - pVGA->VGAAdapter = ATI_ADAPTER_EGA_PLUS; - break; + case '2': + pATI->VGAOffset = 0xB0U; /* Presumably */ + pATI->VGAAdapter = ATI_ADAPTER_EGA_PLUS; + break; - case '3': - pVGA->VGAOffset = 0xB0U; /* Presumably */ - pVGA->VGAAdapter = ATI_ADAPTER_BASIC; - break; + case '3': + pATI->VGAOffset = 0xB0U; /* Presumably */ + pATI->VGAAdapter = ATI_ADAPTER_BASIC; + break; - case '?': /* A crippled Mach64 */ - pVGA->VGAAdapter = ATI_ADAPTER_NONISA; - ATIMach64ChipID(pVGA, 0); - break; + case '?': /* A crippled Mach64 */ + pATI->VGAAdapter = ATI_ADAPTER_NONISA; + ATIMach64ChipID(pATI, 0); + break; #endif - default: - break; - } - - if (pVGA->Adapter <= ATI_ADAPTER_VGA) - pVGA->Adapter = pVGA->VGAAdapter; - -NoVGAWonder:; - } while (0); - -#endif /* AVOID_CPIO */ - - /* - * Re-order list of detected devices so that the primary device is before - * any other PCI device. - */ - for (i = 0; i < nATIPtr; i++) - { - if (!ATIPtrs[i]->PCIInfo) - continue; + default: + break; + } - for (j = i; j < nATIPtr; j++) - { - pATI = ATIPtrs[j]; - if (!xf86IsPrimaryPci(pATI->PCIInfo)) - continue; + if (pATI->Adapter <= ATI_ADAPTER_VGA) + pATI->Adapter = pATI->VGAAdapter; - for (; j > i; j--) - ATIPtrs[j] = ATIPtrs[j - 1]; - ATIPtrs[j] = pATI; - break; + NoVGAWonder:; } - break; + xfree(ppVGA); + xfree(pp8514); + xfree(ppMach64); + xfree(pDomainIOBase); + xfree(ProbeFlags); } if (flags & PROBE_DETECT) { /* * No XF86Config information available, so use the default Chipset of - * "ati", and as many device sections as there are adapters. + * "ati", and generate as many device sections as there are applicable + * adapters. + * + * Within each domain, generate device sections in a specific order: + * first non-PCI adapters in the order they are detected, then any PCI + * primary, followed by non-primary PCI in increasing PCITAG order. */ for (i = 0; i < nATIPtr; i++) { - pATI = ATIPtrs[i]; + if (!(pATI = ATIPtrs[i])) + continue; + + if ((pVideo = pATI->PCIInfo)) + { + PCITAG PCITag = 0; + + Domain = pATI->Domain; + if ((pPCI = pVideo->thisCard)) + PCITag = pPCI->tag; -#ifndef AVOID_CPIO + for (k = -1, j = i; ; j++) + { + if ((j >= nATIPtr) || + ((pATI = ATIPtrs[j]) && (Domain != pATI->Domain))) + { + if (k >= 0) + i = k; + pATI = ATIPtrs[i]; + break; + } + + if (!pATI) + continue; + + if (!(pVideo = pATI->PCIInfo)) + { + i = j; + break; + } + + if (k >= 0) + continue; + + if (xf86IsPrimaryPci(pVideo)) + { + k = j; + continue; + } + + if (!PCITag) + continue; + + if (!(pPCI = pVideo->thisCard)) + PCITag = 0; + else if (PCITag > pPCI->tag) + PCITag = pPCI->tag; + else + continue; + + i = j; + } + } if ((pATI->Adapter != ATI_ADAPTER_VGA) && ((pATI->Adapter != ATI_ADAPTER_8514A) || ((pATI->VGAAdapter != ATI_ADAPTER_VGA) && (pATI->VGAAdapter != ATI_ADAPTER_NONE)))) - -#endif /* AVOID_CPIO */ - { ProbeSuccess = TRUE; pGDev = xf86AddDeviceToConfigure(ATI_DRIVER_NAME, @@ -2028,6 +2442,8 @@ } xfree(pATI); + ATIPtrs[i] = NULL; + i = -1; } } else @@ -2054,9 +2470,6 @@ switch (pATIGDev->Chipset) { case ATI_CHIPSET_ATI: - -#ifndef AVOID_CPIO - if (pATI->Adapter == ATI_ADAPTER_VGA) continue; if (pATI->Adapter != ATI_ADAPTER_8514A) @@ -2093,8 +2506,6 @@ break; continue; -#endif /* AVOID_CPIO */ - case ATI_CHIPSET_MACH64: if (pATI->Adapter == ATI_ADAPTER_MACH64) break; @@ -2169,14 +2580,6 @@ } /* - * IOBase is next. This is the first specification that is - * potentially dependent on bus location. It is only allowed - * for Mach64 adapters, and is optional. - */ - if (pGDev->IOBase && (pATI->CPIOBase != pGDev->IOBase)) - continue; - - /* * Compare BusID's. This specification is only allowed for PCI * Mach32's or Mach64's and is optional. */ @@ -2184,14 +2587,8 @@ { pVideo = pATI->PCIInfo; -#ifndef AVOID_CPIO - - if (!pVideo) - continue; - -#endif /* AVOID_CPIO */ - - if (!xf86ComparePciBusString(pGDev->busID, + if (!pVideo || + !xf86ComparePciBusString(pGDev->busID, pVideo->bus, pVideo->device, pVideo->func)) continue; } @@ -2281,7 +2678,7 @@ #ifdef XFree86LOADER - if (!xf86LoadSubModule(pScreenInfo, "atimisc")) + if (!(pModule = xf86LoadSubModule(pScreenInfo, "atimisc"))) { xf86Msg(X_ERROR, ATI_NAME ": Failed to load \"atimisc\" module.\n"); @@ -2289,7 +2686,7 @@ continue; } - xf86LoaderReqSymLists(ATISymbols, NULL); + xf86LoaderModReqSymLists(pModule, ATISymbols, NULL); #endif @@ -2325,16 +2722,8 @@ if (!(pATI = ATIPtrs[i])) continue; -#ifndef AVOID_CPIO - - if (pATI->Adapter > ATI_ADAPTER_VGA) - -#endif /* AVOID_CPIO */ - - { - if (pATI->iEntity < 0) - (void)ATIClaimBusSlot(pDriver, 0, NULL, FALSE, pATI); - } + if ((pATI->Adapter > ATI_ADAPTER_VGA) && (pATI->iEntity < 0)) + (void)ATIClaimBusSlot(pDriver, 0, NULL, FALSE, pATI); xfree(pATI); } Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.h:1.10 xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.h:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.h:1.10 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.h,v 1.10 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.h,v 1.11 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiproto.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiproto.h:1.10 xc/programs/Xserver/hw/xfree86/drivers/ati/atiproto.h:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiproto.h:1.10 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiproto.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiproto.h,v 1.10 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiproto.h,v 1.12 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -24,7 +24,7 @@ #ifndef ___ATIPROTO_H___ #define ___ATIPROTO_H___ 1 -#include "Xfuncproto.h" +#include <X11/Xfuncproto.h> /* * This isn't quite ready for Xfuncproto.h yet. Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h:1.28 xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h:1.33 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h:1.28 Thu Feb 10 10:26:37 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h Sat Jan 28 20:45:05 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h,v 1.28 2005/02/10 15:26:37 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h,v 1.33 2006/01/29 01:45:05 tsi Exp $ */ /* - * Copyright 1994 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1994 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -49,48 +49,54 @@ #define DWORD_SELECT (BLOCK_SELECT | MM_IO_SELECT) #define IO_BYTE_SELECT 0x0003u +#define IO_WORD_SELECT 0x0002u #define SPARSE_IO_PORT (SPARSE_IO_BASE | IO_BYTE_SELECT) #define BLOCK_IO_PORT (BLOCK_IO_BASE | IO_BYTE_SELECT) +#define IO_LONG_PORT (SPARSE_IO_BASE | BLOCK_IO_BASE) +#define IO_WORD_PORT (IO_LONG_PORT | IO_WORD_SELECT) +#define IO_BYTE_PORT (IO_LONG_PORT | IO_BYTE_SELECT) + #define IOPortTag(_SparseIOSelect, _BlockIOSelect) \ (SetBits(_SparseIOSelect, SPARSE_IO_SELECT) | \ SetBits(_BlockIOSelect, DWORD_SELECT)) #define SparseIOTag(_IOSelect) IOPortTag(_IOSelect, 0) #define BlockIOTag(_IOSelect) IOPortTag(0, _IOSelect) +#define IOPort(_IOPort) (pATI->DomainIOBase + (_IOPort)) /* MDA/[M]CGA/EGA/VGA I/O ports */ -#define GENVS 0x0102u /* Write (and Read on uC only) */ +#define GENVS IOPort(0x0102u) /* W (& R on uC only) */ -#define R_GENLPS 0x03b9u /* Read */ +#define R_GENLPS IOPort(0x03b9u) /* R */ -#define GENHP 0x03bfu +#define GENHP IOPort(0x03bfu) -#define ATTRX 0x03c0u -#define ATTRD 0x03c1u -#define GENS0 0x03c2u /* Read */ -#define GENMO 0x03c2u /* Write */ -#define GENENB 0x03c3u /* Read */ -#define SEQX 0x03c4u -#define SEQD 0x03c5u -#define VGA_DAC_MASK 0x03c6u -#define VGA_DAC_READ 0x03c7u -#define VGA_DAC_WRITE 0x03c8u -#define VGA_DAC_DATA 0x03c9u -#define R_GENFC 0x03cau /* Read */ -/* ? 0x03cbu */ -#define R_GENMO 0x03ccu /* Read */ -/* ? 0x03cdu */ -#define GRAX 0x03ceu -#define GRAD 0x03cfu - -#define GENB 0x03d9u - -#define GENLPS 0x03dcu /* Write */ -#define KCX 0x03ddu -#define KCD 0x03deu +#define ATTRX IOPort(0x03c0u) +#define ATTRD IOPort(0x03c1u) +#define GENS0 IOPort(0x03c2u) /* R */ +#define GENMO IOPort(0x03c2u) /* W */ +#define GENENB IOPort(0x03c3u) /* R */ +#define SEQX IOPort(0x03c4u) +#define SEQD IOPort(0x03c5u) +#define VGA_DAC_MASK IOPort(0x03c6u) +#define VGA_DAC_READ IOPort(0x03c7u) +#define VGA_DAC_WRITE IOPort(0x03c8u) +#define VGA_DAC_DATA IOPort(0x03c9u) +#define R_GENFC IOPort(0x03cau) /* R */ +/* ? IOPort(0x03cbu) */ +#define R_GENMO IOPort(0x03ccu) /* R */ +/* ? IOPort(0x03cdu) */ +#define GRAX IOPort(0x03ceu) +#define GRAD IOPort(0x03cfu) + +#define GENB IOPort(0x03d9u) + +#define GENLPS IOPort(0x03dcu) /* W */ +#define KCX IOPort(0x03ddu) +#define KCD IOPort(0x03deu) -#define GENENA 0x46e8u /* Write */ +#define GENENA IOPort(0x46e8u) /* W */ /* I/O port base numbers */ #define MonochromeIOBase 0x03b0u @@ -107,40 +113,48 @@ /* ?(_IOBase) ((_IOBase) + 0x07u) */ #define GENMC(_IOBase) ((_IOBase) + 0x08u) /* ?(_IOBase) ((_IOBase) + 0x09u) */ /* R_GENLPS/GENB */ -#define GENS1(_IOBase) ((_IOBase) + 0x0au) /* Read */ -#define GENFC(_IOBase) ((_IOBase) + 0x0au) /* Write */ +#define GENS1(_IOBase) ((_IOBase) + 0x0au) /* R */ +#define GENFC(_IOBase) ((_IOBase) + 0x0au) /* W */ #define GENLPC(_IOBase) ((_IOBase) + 0x0bu) /* ?(_IOBase) ((_IOBase) + 0x0cu) */ /* /GENLPS */ /* ?(_IOBase) ((_IOBase) + 0x0du) */ /* /KCX */ /* ?(_IOBase) ((_IOBase) + 0x0eu) */ /* /KCD */ /* ?(_IOBase) ((_IOBase) + 0x0fu) */ /* GENHP/ */ +/* + * I have a Mach32 that gives me spurious parity errors only when reading + * GENS1... + */ +#undef GENS1 +#define GENS1(_IOBase) (pATI->CaughtSignal = -1, (_IOBase) + 0x0au) + /* 8514/A VESA approved register definitions */ -#define DISP_STAT 0x02e8u /* Read */ +#define DISP_STAT IOPort(0x02e8u) /* Read */ #define SENSE 0x0001u /* Presumably belong here */ #define VBLANK 0x0002u #define HORTOG 0x0004u -#define H_TOTAL 0x02e8u /* Write */ -#define IBM_DAC_MASK 0x02eau -#define IBM_DAC_READ 0x02ebu -#define IBM_DAC_WRITE 0x02ecu -#define IBM_DAC_DATA 0x02edu -#define H_DISP 0x06e8u /* Write */ -#define H_SYNC_STRT 0x0ae8u /* Write */ -#define H_SYNC_WID 0x0ee8u /* Write */ +#define H_TOTAL IOPort(0x02e8u) /* Write */ +#define IBM_DAC_MASK IOPort(0x02eau) +#define IBM_DAC_READ IOPort(0x02ebu) +#define IBM_DAC_WRITE IOPort(0x02ecu) +#define IBM_DAC_DATA IOPort(0x02edu) +#define IBM_DAC_WAIT IBM_DAC_MASK +#define H_DISP IOPort(0x06e8u) /* Write */ +#define H_SYNC_STRT IOPort(0x0ae8u) /* Write */ +#define H_SYNC_WID IOPort(0x0ee8u) /* Write */ #define HSYNCPOL_POS 0x0000u #define HSYNCPOL_NEG 0x0020u #define H_POLARITY_POS HSYNCPOL_POS /* Sigh */ #define H_POLARITY_NEG HSYNCPOL_NEG /* Sigh */ -#define V_TOTAL 0x12e8u /* Write */ -#define V_DISP 0x16e8u /* Write */ -#define V_SYNC_STRT 0x1ae8u /* Write */ -#define V_SYNC_WID 0x1ee8u /* Write */ +#define V_TOTAL IOPort(0x12e8u) /* Write */ +#define V_DISP IOPort(0x16e8u) /* Write */ +#define V_SYNC_STRT IOPort(0x1ae8u) /* Write */ +#define V_SYNC_WID IOPort(0x1ee8u) /* Write */ #define VSYNCPOL_POS 0x0000u #define VSYNCPOL_NEG 0x0020u #define V_POLARITY_POS VSYNCPOL_POS /* Sigh */ #define V_POLARITY_NEG VSYNCPOL_NEG /* Sigh */ -#define DISP_CNTL 0x22e8u /* Write */ +#define DISP_CNTL IOPort(0x22e8u) /* Write */ #define ODDBNKENAB 0x0001u #define MEMCFG_2 0x0000u #define MEMCFG_4 0x0002u @@ -151,14 +165,14 @@ #define DISPEN_NC 0x0000u #define DISPEN_ENAB 0x0020u #define DISPEN_DISAB 0x0040u -#define R_H_TOTAL 0x26e8u /* Read */ -/* ? 0x2ae8u */ -/* ? 0x2ee8u */ -/* ? 0x32e8u */ -/* ? 0x36e8u */ -/* ? 0x3ae8u */ -/* ? 0x3ee8u */ -#define SUBSYS_STAT 0x42e8u /* Read */ +#define R_H_TOTAL IOPort(0x26e8u) /* Read */ +/* ? IOPort(0x2ae8u) */ +/* ? IOPort(0x2ee8u) */ +/* ? IOPort(0x32e8u) */ +/* ? IOPort(0x36e8u) */ +/* ? IOPort(0x3ae8u) */ +/* ? IOPort(0x3ee8u) */ +#define SUBSYS_STAT IOPort(0x42e8u) /* Read */ #define VBLNKFLG 0x0001u #define PICKFLAG 0x0002u #define INVALIDIO 0x0004u @@ -174,7 +188,7 @@ #define MONITORID_8513 0x0060u #define MONITORID_NONE 0x0070u #define _8PLANE 0x0080u -#define SUBSYS_CNTL 0x42e8u /* Write */ +#define SUBSYS_CNTL IOPort(0x42e8u) /* Write */ #define RVBLNKFLG 0x0001u #define RPICKFLAG 0x0002u #define RINVALIDIO 0x0004u @@ -189,35 +203,35 @@ #define GPCTRL_NC 0x0000u #define GPCTRL_ENAB 0x4000u #define GPCTRL_RESET 0x8000u -#define ROM_PAGE_SEL 0x46e8u /* Write */ -#define ADVFUNC_CNTL 0x4ae8u /* Write */ +#define ROM_PAGE_SEL IOPort(0x46e8u) /* Write */ +#define ADVFUNC_CNTL IOPort(0x4ae8u) /* Write */ #define DISABPASSTHRU 0x0001u #define CLOKSEL 0x0004u -/* ? 0x4ee8u */ -#define EXT_CONFIG_0 0x52e8u /* C & T 82C480 */ -#define EXT_CONFIG_1 0x56e8u /* C & T 82C480 */ -#define EXT_CONFIG_2 0x5ae8u /* C & T 82C480 */ -#define EXT_CONFIG_3 0x5ee8u /* C & T 82C480 */ -/* ? 0x62e8u */ -/* ? 0x66e8u */ -/* ? 0x6ae8u */ -/* ? 0x6ee8u */ -/* ? 0x72e8u */ -/* ? 0x76e8u */ -/* ? 0x7ae8u */ -/* ? 0x7ee8u */ -#define CUR_Y 0x82e8u -#define CUR_X 0x86e8u -#define DESTY_AXSTP 0x8ae8u /* Write */ -#define DESTX_DIASTP 0x8ee8u /* Write */ -#define ERR_TERM 0x92e8u -#define MAJ_AXIS_PCNT 0x96e8u /* Write */ -#define GP_STAT 0x9ae8u /* Read */ -#define GE_STAT 0x9ae8u /* Alias */ +/* ? IOPort(0x4ee8u) */ +#define EXT_CONFIG_0 IOPort(0x52e8u) /* C & T 82C480 */ +#define EXT_CONFIG_1 IOPort(0x56e8u) /* C & T 82C480 */ +#define EXT_CONFIG_2 IOPort(0x5ae8u) /* C & T 82C480 */ +#define EXT_CONFIG_3 IOPort(0x5ee8u) /* C & T 82C480 */ +/* ? IOPort(0x62e8u) */ +/* ? IOPort(0x66e8u) */ +/* ? IOPort(0x6ae8u) */ +/* ? IOPort(0x6ee8u) */ +/* ? IOPort(0x72e8u) */ +/* ? IOPort(0x76e8u) */ +/* ? IOPort(0x7ae8u) */ +/* ? IOPort(0x7ee8u) */ +#define CUR_Y IOPort(0x82e8u) +#define CUR_X IOPort(0x86e8u) +#define DESTY_AXSTP IOPort(0x8ae8u) /* Write */ +#define DESTX_DIASTP IOPort(0x8ee8u) /* Write */ +#define ERR_TERM IOPort(0x92e8u) +#define MAJ_AXIS_PCNT IOPort(0x96e8u) /* Write */ +#define GP_STAT IOPort(0x9ae8u) /* Read */ +#define GE_STAT IOPort(0x9ae8u) /* Alias */ #define DATARDY 0x0100u -#define DATA_READY DATARDY /* Alias */ +#define DATA_READY DATARDY /* Alias */ #define GPBUSY 0x0200u -#define CMD 0x9ae8u /* Write */ +#define CMD IOPort(0x9ae8u) /* Write */ #define WRTDATA 0x0001u #define PLANAR 0x0002u #define LASTPIX 0x0004u @@ -237,7 +251,7 @@ #define CMD_RECTV2 0x8000u #define CMD_LINEAF 0xa000u #define CMD_BITBLT 0xc000u -#define SHORT_STROKE 0x9ee8u /* Write */ +#define SHORT_STROKE IOPort(0x9ee8u) /* Write */ #define SSVDRAW 0x0010u #define VECDIR_000 0x0000u #define VECDIR_045 0x0020u @@ -247,24 +261,24 @@ #define VECDIR_225 0x00a0u #define VECDIR_270 0x00c0u #define VECDIR_315 0x00e0u -#define BKGD_COLOR 0xa2e8u /* Write */ -#define FRGD_COLOR 0xa6e8u /* Write */ -#define WRT_MASK 0xaae8u /* Write */ -#define RD_MASK 0xaee8u /* Write */ -#define COLOR_CMP 0xb2e8u /* Write */ -#define BKGD_MIX 0xb6e8u /* Write */ +#define BKGD_COLOR IOPort(0xa2e8u) /* Write */ +#define FRGD_COLOR IOPort(0xa6e8u) /* Write */ +#define WRT_MASK IOPort(0xaae8u) /* Write */ +#define RD_MASK IOPort(0xaee8u) /* Write */ +#define COLOR_CMP IOPort(0xb2e8u) /* Write */ +#define BKGD_MIX IOPort(0xb6e8u) /* Write */ /* 0x001fu See MIX_* definitions below */ #define BSS_BKGDCOL 0x0000u #define BSS_FRGDCOL 0x0020u #define BSS_PCDATA 0x0040u #define BSS_BITBLT 0x0060u -#define FRGD_MIX 0xbae8u /* Write */ +#define FRGD_MIX IOPort(0xbae8u) /* Write */ /* 0x001fu See MIX_* definitions below */ #define FSS_BKGDCOL 0x0000u #define FSS_FRGDCOL 0x0020u #define FSS_PCDATA 0x0040u #define FSS_BITBLT 0x0060u -#define MULTIFUNC_CNTL 0xbee8u /* Write */ +#define MULTIFUNC_CNTL IOPort(0xbee8u) /* Write */ #define MIN_AXIS_PCNT 0x0000u #define SCISSORS_T 0x1000u #define SCISSORS_L 0x2000u @@ -296,31 +310,31 @@ #define MIXSEL_PATT 0x0040u #define MIXSEL_EXPPC 0x0080u #define MIXSEL_EXPBLT 0x00c0u -/* ? 0xc2e8u */ -/* ? 0xc6e8u */ -/* ? 0xcae8u */ -/* ? 0xcee8u */ -/* ? 0xd2e8u */ -/* ? 0xd6e8u */ -/* ? 0xdae8u */ -/* ? 0xdee8u */ -#define PIX_TRANS 0xe2e8u -/* ? 0xe6e8u */ -/* ? 0xeae8u */ -/* ? 0xeee8u */ -/* ? 0xf2e8u */ -/* ? 0xf6e8u */ -/* ? 0xfae8u */ -/* ? 0xfee8u */ +/* ? IOPort(0xc2e8u) */ +/* ? IOPort(0xc6e8u) */ +/* ? IOPort(0xcae8u) */ +/* ? IOPort(0xcee8u) */ +/* ? IOPort(0xd2e8u) */ +/* ? IOPort(0xd6e8u) */ +/* ? IOPort(0xdae8u) */ +/* ? IOPort(0xdee8u) */ +#define PIX_TRANS IOPort(0xe2e8u) +/* ? IOPort(0xe6e8u) */ +/* ? IOPort(0xeae8u) */ +/* ? IOPort(0xeee8u) */ +/* ? IOPort(0xf2e8u) */ +/* ? IOPort(0xf6e8u) */ +/* ? IOPort(0xfae8u) */ +/* ? IOPort(0xfee8u) */ /* ATI Mach8 & Mach32 register definitions */ -#define OVERSCAN_COLOR_8 0x02eeu /* Write */ /* Mach32 */ -#define OVERSCAN_BLUE_24 0x02efu /* Write */ /* Mach32 */ -#define OVERSCAN_GREEN_24 0x06eeu /* Write */ /* Mach32 */ -#define OVERSCAN_RED_24 0x06efu /* Write */ /* Mach32 */ -#define CURSOR_OFFSET_LO 0x0aeeu /* Write */ /* Mach32 */ -#define CURSOR_OFFSET_HI 0x0eeeu /* Write */ /* Mach32 */ -#define CONFIG_STATUS_1 0x12eeu /* Read */ +#define OVERSCAN_COLOR_8 IOPort(0x02eeu) /* Write */ /* Mach32 */ +#define OVERSCAN_BLUE_24 IOPort(0x02efu) /* Write */ /* Mach32 */ +#define OVERSCAN_GREEN_24 IOPort(0x06eeu) /* Write */ /* Mach32 */ +#define OVERSCAN_RED_24 IOPort(0x06efu) /* Write */ /* Mach32 */ +#define CURSOR_OFFSET_LO IOPort(0x0aeeu) /* Write */ /* Mach32 */ +#define CURSOR_OFFSET_HI IOPort(0x0eeeu) /* Write */ /* Mach32 */ +#define CONFIG_STATUS_1 IOPort(0x12eeu) /* Read */ #define CLK_MODE 0x0001u /* Mach8 */ #define BUS_16 0x0002u /* Mach8 */ #define MC_BUS 0x0004u /* Mach8 */ @@ -346,8 +360,8 @@ #define DACTYPE 0x0e00u /* Mach32 */ #define MC_ADR_DECODE 0x1000u /* Mach32 */ #define CARD_ID 0xe000u /* Mach32 */ -#define HORZ_CURSOR_POSN 0x12eeu /* Write */ /* Mach32 */ -#define CONFIG_STATUS_2 0x16eeu /* Read */ +#define HORZ_CURSOR_POSN IOPort(0x12eeu) /* Write */ /* Mach32 */ +#define CONFIG_STATUS_2 IOPort(0x16eeu) /* Read */ #define SHARE_CLOCK 0x0001u /* Mach8 */ #define HIRES_BOOT 0x0002u /* Mach8 */ #define EPROM_16_ENA 0x0004u /* Mach8 */ @@ -367,19 +381,19 @@ #define VESA_RDY 0x1000u /* Mach32 */ #define Z4GB 0x2000u /* Mach32 */ #define LOC2_MDRAM 0x4000u /* Mach32 */ -#define VERT_CURSOR_POSN 0x16eeu /* Write */ /* Mach32 */ -#define FIFO_TEST_DATA 0x1aeeu /* Read */ /* Mach32 */ -#define CURSOR_COLOR_0 0x1aeeu /* Write */ /* Mach32 */ -#define CURSOR_COLOR_1 0x1aefu /* Write */ /* Mach32 */ -#define HORZ_CURSOR_OFFSET 0x1eeeu /* Write */ /* Mach32 */ -#define VERT_CURSOR_OFFSET 0x1eefu /* Write */ /* Mach32 */ -#define PCI_CNTL 0x22eeu /* Mach32-PCI */ -#define CRT_PITCH 0x26eeu /* Write */ -#define CRT_OFFSET_LO 0x2aeeu /* Write */ -#define CRT_OFFSET_HI 0x2eeeu /* Write */ -#define LOCAL_CNTL 0x32eeu /* Mach32 */ -#define FIFO_OPT 0x36eeu /* Write */ /* Mach8 */ -#define MISC_OPTIONS 0x36eeu /* Mach32 */ +#define VERT_CURSOR_POSN IOPort(0x16eeu) /* Write */ /* Mach32 */ +#define FIFO_TEST_DATA IOPort(0x1aeeu) /* Read */ /* Mach32 */ +#define CURSOR_COLOR_0 IOPort(0x1aeeu) /* Write */ /* Mach32 */ +#define CURSOR_COLOR_1 IOPort(0x1aefu) /* Write */ /* Mach32 */ +#define HORZ_CURSOR_OFFSET IOPort(0x1eeeu) /* Write */ /* Mach32 */ +#define VERT_CURSOR_OFFSET IOPort(0x1eefu) /* Write */ /* Mach32 */ +#define PCI_CNTL IOPort(0x22eeu) /* Mach32-PCI */ +#define CRT_PITCH IOPort(0x26eeu) /* Write */ +#define CRT_OFFSET_LO IOPort(0x2aeeu) /* Write */ +#define CRT_OFFSET_HI IOPort(0x2eeeu) /* Write */ +#define LOCAL_CNTL IOPort(0x32eeu) /* Mach32 */ +#define FIFO_OPT IOPort(0x36eeu) /* Write */ /* Mach8 */ +#define MISC_OPTIONS IOPort(0x36eeu) /* Mach32 */ #define W_STATE_ENA 0x0000u /* Mach32 */ #define HOST_8_ENA 0x0001u /* Mach32 */ #define MEM_SIZE_ALIAS 0x000cu /* Mach32 */ @@ -394,14 +408,14 @@ #define TEST_MODE 0x0100u /* Mach32 */ #define BLK_WR_ENA 0x0400u /* Mach32 */ #define _64_DRAW_ENA 0x0800u /* Mach32 */ -#define FIFO_TEST_TAG 0x3aeeu /* Read */ /* Mach32 */ -#define EXT_CURSOR_COLOR_0 0x3aeeu /* Write */ /* Mach32 */ -#define EXT_CURSOR_COLOR_1 0x3eeeu /* Write */ /* Mach32 */ -#define MEM_BNDRY 0x42eeu /* Mach32 */ +#define FIFO_TEST_TAG IOPort(0x3aeeu) /* Read */ /* Mach32 */ +#define EXT_CURSOR_COLOR_0 IOPort(0x3aeeu) /* Write */ /* Mach32 */ +#define EXT_CURSOR_COLOR_1 IOPort(0x3eeeu) /* Write */ /* Mach32 */ +#define MEM_BNDRY IOPort(0x42eeu) /* Mach32 */ #define MEM_PAGE_BNDRY 0x000fu /* Mach32 */ #define MEM_BNDRY_ENA 0x0010u /* Mach32 */ -#define SHADOW_CTL 0x46eeu /* Write */ -#define CLOCK_SEL 0x4aeeu +#define SHADOW_CTL IOPort(0x46eeu) /* Write */ +#define CLOCK_SEL IOPort(0x4aeeu) /* DISABPASSTHRU 0x0001u See ADVFUNC_CNTL */ #define VFIFO_DEPTH_1 0x0100u /* Mach32 */ #define VFIFO_DEPTH_2 0x0200u /* Mach32 */ @@ -419,27 +433,27 @@ #define VFIFO_DEPTH_E 0x0e00u /* Mach32 */ #define VFIFO_DEPTH_F 0x0f00u /* Mach32 */ #define COMPOSITE_SYNC 0x1000u -/* ? 0x4eeeu */ -#define ROM_ADDR_1 0x52eeu +/* ? IOPort(0x4eeeu) */ +#define ROM_ADDR_1 IOPort(0x52eeu) #define BIOS_BASE_SEGMENT 0x007fu /* Mach32 */ /* ? 0xff80u */ /* Mach32 */ -#define ROM_ADDR_2 0x56eeu /* Sick ... */ -#define SHADOW_SET 0x5aeeu /* Write */ -#define MEM_CFG 0x5eeeu /* Mach32 */ +#define ROM_ADDR_2 IOPort(0x56eeu) /* Sick ... */ +#define SHADOW_SET IOPort(0x5aeeu) /* Write */ +#define MEM_CFG IOPort(0x5eeeu) /* Mach32 */ #define MEM_APERT_SEL 0x0003u /* Mach32 */ #define MEM_APERT_PAGE 0x000cu /* Mach32 */ #define MEM_APERT_LOC 0xfff0u /* Mach32 */ -#define EXT_GE_STATUS 0x62eeu /* Read */ /* Mach32 */ -#define HORZ_OVERSCAN 0x62eeu /* Write */ /* Mach32 */ -#define VERT_OVERSCAN 0x66eeu /* Write */ /* Mach32 */ -#define MAX_WAITSTATES 0x6aeeu -#define GE_OFFSET_LO 0x6eeeu /* Write */ -#define BOUNDS_LEFT 0x72eeu /* Read */ -#define GE_OFFSET_HI 0x72eeu /* Write */ -#define BOUNDS_TOP 0x76eeu /* Read */ -#define GE_PITCH 0x76eeu /* Write */ -#define BOUNDS_RIGHT 0x7aeeu /* Read */ -#define EXT_GE_CONFIG 0x7aeeu /* Write */ /* Mach32 */ +#define EXT_GE_STATUS IOPort(0x62eeu) /* Read */ /* Mach32 */ +#define HORZ_OVERSCAN IOPort(0x62eeu) /* Write */ /* Mach32 */ +#define VERT_OVERSCAN IOPort(0x66eeu) /* Write */ /* Mach32 */ +#define MAX_WAITSTATES IOPort(0x6aeeu) +#define GE_OFFSET_LO IOPort(0x6eeeu) /* Write */ +#define BOUNDS_LEFT IOPort(0x72eeu) /* Read */ +#define GE_OFFSET_HI IOPort(0x72eeu) /* Write */ +#define BOUNDS_TOP IOPort(0x76eeu) /* Read */ +#define GE_PITCH IOPort(0x76eeu) /* Write */ +#define BOUNDS_RIGHT IOPort(0x7aeeu) /* Read */ +#define EXT_GE_CONFIG IOPort(0x7aeeu) /* Write */ /* Mach32 */ #define MONITOR_ALIAS 0x0007u /* Mach32 */ /* MONITOR_? 0x0000u */ /* Mach32 */ #define MONITOR_8507 0x0001u /* Mach32 */ @@ -466,66 +480,66 @@ #define xBGR24 0x0600u /* Mach32 */ #define DAC_8_BIT_EN 0x4000u /* Mach32 */ #define ORDER_16BPP_565 RGB16_565 /* Mach32 */ -#define BOUNDS_BOTTOM 0x7eeeu /* Read */ -#define MISC_CNTL 0x7eeeu /* Write */ /* Mach32 */ -#define PATT_DATA_INDEX 0x82eeu -/* ? 0x86eeu */ -/* ? 0x8aeeu */ -#define R_EXT_GE_CONFIG 0x8eeeu /* Read */ /* Mach32 */ -#define PATT_DATA 0x8eeeu /* Write */ -#define R_MISC_CNTL 0x92eeu /* Read */ /* Mach32 */ -#define BRES_COUNT 0x96eeu -#define EXT_FIFO_STATUS 0x9aeeu /* Read */ -#define LINEDRAW_INDEX 0x9aeeu /* Write */ -/* ? 0x9eeeu */ -#define LINEDRAW_OPT 0xa2eeu +#define BOUNDS_BOTTOM IOPort(0x7eeeu) /* Read */ +#define MISC_CNTL IOPort(0x7eeeu) /* Write */ /* Mach32 */ +#define PATT_DATA_INDEX IOPort(0x82eeu) +/* ? IOPort(0x86eeu) */ +/* ? IOPort(0x8aeeu) */ +#define R_EXT_GE_CONFIG IOPort(0x8eeeu) /* Read */ /* Mach32 */ +#define PATT_DATA IOPort(0x8eeeu) /* Write */ +#define R_MISC_CNTL IOPort(0x92eeu) /* Read */ /* Mach32 */ +#define BRES_COUNT IOPort(0x96eeu) +#define EXT_FIFO_STATUS IOPort(0x9aeeu) /* Read */ +#define LINEDRAW_INDEX IOPort(0x9aeeu) /* Write */ +/* ? IOPort(0x9eeeu) */ +#define LINEDRAW_OPT IOPort(0xa2eeu) #define BOUNDS_RESET 0x0100u #define CLIP_MODE_0 0x0000u /* Clip exception disabled */ #define CLIP_MODE_1 0x0200u /* Line segments */ #define CLIP_MODE_2 0x0400u /* Polygon boundary lines */ #define CLIP_MODE_3 0x0600u /* Patterned lines */ -#define DEST_X_START 0xa6eeu /* Write */ -#define DEST_X_END 0xaaeeu /* Write */ -#define DEST_Y_END 0xaeeeu /* Write */ -#define R_H_TOTAL_DISP 0xb2eeu /* Read */ /* Mach32 */ -#define SRC_X_STRT 0xb2eeu /* Write */ -#define R_H_SYNC_STRT 0xb6eeu /* Read */ /* Mach32 */ -#define ALU_BG_FN 0xb6eeu /* Write */ -#define R_H_SYNC_WID 0xbaeeu /* Read */ /* Mach32 */ -#define ALU_FG_FN 0xbaeeu /* Write */ -#define SRC_X_END 0xbeeeu /* Write */ -#define R_V_TOTAL 0xc2eeu /* Read */ -#define SRC_Y_DIR 0xc2eeu /* Write */ -#define R_V_DISP 0xc6eeu /* Read */ /* Mach32 */ -#define EXT_SHORT_STROKE 0xc6eeu /* Write */ -#define R_V_SYNC_STRT 0xcaeeu /* Read */ /* Mach32 */ -#define SCAN_X 0xcaeeu /* Write */ -#define VERT_LINE_CNTR 0xceeeu /* Read */ /* Mach32 */ -#define DP_CONFIG 0xceeeu /* Write */ +#define DEST_X_START IOPort(0xa6eeu) /* Write */ +#define DEST_X_END IOPort(0xaaeeu) /* Write */ +#define DEST_Y_END IOPort(0xaeeeu) /* Write */ +#define R_H_TOTAL_DISP IOPort(0xb2eeu) /* Read */ /* Mach32 */ +#define SRC_X_STRT IOPort(0xb2eeu) /* Write */ +#define R_H_SYNC_STRT IOPort(0xb6eeu) /* Read */ /* Mach32 */ +#define ALU_BG_FN IOPort(0xb6eeu) /* Write */ +#define R_H_SYNC_WID IOPort(0xbaeeu) /* Read */ /* Mach32 */ +#define ALU_FG_FN IOPort(0xbaeeu) /* Write */ +#define SRC_X_END IOPort(0xbeeeu) /* Write */ +#define R_V_TOTAL IOPort(0xc2eeu) /* Read */ +#define SRC_Y_DIR IOPort(0xc2eeu) /* Write */ +#define R_V_DISP IOPort(0xc6eeu) /* Read */ /* Mach32 */ +#define EXT_SHORT_STROKE IOPort(0xc6eeu) /* Write */ +#define R_V_SYNC_STRT IOPort(0xcaeeu) /* Read */ /* Mach32 */ +#define SCAN_X IOPort(0xcaeeu) /* Write */ +#define VERT_LINE_CNTR IOPort(0xceeeu) /* Read */ /* Mach32 */ +#define DP_CONFIG IOPort(0xceeeu) /* Write */ #define READ_WRITE 0x0001u #define DATA_WIDTH 0x0200u #define DATA_ORDER 0x1000u #define FG_COLOR_SRC_FG 0x2000u #define FG_COLOR_SRC_BLIT 0x6000u -#define R_V_SYNC_WID 0xd2eeu /* Read */ -#define PATT_LENGTH 0xd2eeu /* Write */ -#define PATT_INDEX 0xd6eeu /* Write */ -#define READ_SRC_X 0xdaeeu /* Read */ /* Mach32 */ -#define EXT_SCISSOR_L 0xdaeeu /* Write */ -#define READ_SRC_Y 0xdeeeu /* Read */ /* Mach32 */ -#define EXT_SCISSOR_T 0xdeeeu /* Write */ -#define EXT_SCISSOR_R 0xe2eeu /* Write */ -#define EXT_SCISSOR_B 0xe6eeu /* Write */ -/* ? 0xeaeeu */ -#define DEST_COMP_FN 0xeeeeu /* Write */ -#define DEST_COLOR_CMP_MASK 0xf2eeu /* Write */ /* Mach32 */ -/* ? 0xf6eeu */ -#define CHIP_ID 0xfaeeu /* Read */ /* Mach32 */ +#define R_V_SYNC_WID IOPort(0xd2eeu) /* Read */ +#define PATT_LENGTH IOPort(0xd2eeu) /* Write */ +#define PATT_INDEX IOPort(0xd6eeu) /* Write */ +#define READ_SRC_X IOPort(0xdaeeu) /* Read */ /* Mach32 */ +#define EXT_SCISSOR_L IOPort(0xdaeeu) /* Write */ +#define READ_SRC_Y IOPort(0xdeeeu) /* Read */ /* Mach32 */ +#define EXT_SCISSOR_T IOPort(0xdeeeu) /* Write */ +#define EXT_SCISSOR_R IOPort(0xe2eeu) /* Write */ +#define EXT_SCISSOR_B IOPort(0xe6eeu) /* Write */ +/* ? IOPort(0xeaeeu) */ +#define DEST_COMP_FN IOPort(0xeeeeu) /* Write */ +#define DEST_COLOR_CMP_MASK IOPort(0xf2eeu) /* Write */ /* Mach32 */ +/* ? IOPort(0xf6eeu) */ +#define CHIP_ID IOPort(0xfaeeu) /* Read */ /* Mach32 */ #define CHIP_CODE_0 0x001fu /* Mach32 */ #define CHIP_CODE_1 0x03e0u /* Mach32 */ #define CHIP_CLASS 0x0c00u /* Mach32 */ #define CHIP_REV 0xf000u /* Mach32 */ -#define LINEDRAW 0xfeeeu /* Write */ +#define LINEDRAW IOPort(0xfeeeu) /* Write */ /* ATI Mach64 register definitions */ #define CRTC_H_TOTAL_DISP IOPortTag(0x00u, 0x00u) @@ -694,6 +708,19 @@ /* ? 0xf8000000ul */ #define TIMER_CONFIG BlockIOTag(0x0au) /* VTB/GTB/LT */ #define MEM_BUF_CNTL BlockIOTag(0x0bu) /* VTB/GTB/LT */ +#define Z_WB_FLUSH 0x00000007ul +#define Z_WB_FLUSH_P 0x0000000ful /* GTPro */ +#define VID_WB_FLUSH_P 0x000000f0ul /* GTPro */ +#define VID_WB_FLUSH_MSB 0x00000100ul +#define GUI_WB_FLUSH_P 0x00001f00ul /* GTPro */ +#define HST_WB_FLUSH_P 0x0000e000ul /* GTPro */ +#define SCL_MIN_BURST_LEN 0x001f0000ul +#define SCL_THRESH 0x003f0000ul /* GTPro */ +/* ? 0x00400000ul */ +#define INVALIDATE_RB_CACHE 0x00800000ul +#define HST_WB_FLUSH 0x03000000ul +#define VID_WB_FLUSH 0x1c000000ul +#define GUI_WB_FLUSH 0xe0000000ul #define SHARED_CNTL BlockIOTag(0x0cu) /* VTB/GTB/LT */ #define SHARED_MEM_CONFIG BlockIOTag(0x0du) /* VTB/GTB/LT */ #define MEM_ADDR_CONFIG BlockIOTag(0x0du) /* GTPro */ @@ -912,8 +939,8 @@ #define CLOCK_SELECT 0x0000000ful #define CLOCK_DIVIDER 0x00000030ul #define CLOCK_STROBE 0x00000040ul -#define CLOCK_DATA 0x00000080ul -/* ? 0x00000100ul */ +#define CLOCK_SERIAL_DATA_EN 0x00000080ul +#define CLOCK_SERIAL_DATA 0x00000100ul #define PLL_WR_EN 0x00000200ul /* For internal PLL */ #define PLL_ADDR 0x0000fc00ul /* For internal PLL */ #define PLL_DATA 0x00ff0000ul /* For internal PLL */ @@ -1085,6 +1112,7 @@ #define M64_DAC_DATA (DAC_REGS + 1) #define M64_DAC_MASK (DAC_REGS + 2) #define M64_DAC_READ (DAC_REGS + 3) +#define M64_DAC_WAIT M64_DAC_MASK #define DAC_CNTL IOPortTag(0x18u, 0x31u) #define DAC_EXT_SEL 0x00000003ul #define DAC_EXT_SEL_RS2 0x000000001ul @@ -1937,6 +1965,19 @@ #define CRT_HORZ_VERT_LOAD BlockIOTag(0x151u) /* VTB/GTB */ #define AGP_BASE BlockIOTag(0x152u) /* GTPro */ #define AGP_CNTL BlockIOTag(0x153u) /* GTPro */ +#define AGP_APER_SIZE_MASK 0x0000003ful +#define AGP_APER_SIZE_256MB 0x00000000ul +#define AGP_APER_SIZE_128MB 0x00000020ul +#define AGP_APER_SIZE_64MB 0x00000030ul +#define AGP_APER_SIZE_32MB 0x00000038ul +#define AGP_APER_SIZE_16MB 0x0000003cul +#define AGP_APER_SIZE_8MB 0x0000003eul +#define AGP_APER_SIZE_4MB 0x0000003ful +/* ? 0x000000c0ul */ +#define MAX_IDLE_CLK 0x0000ff00ul +#define HIGH_PRIORITY_READ_EN 0x00010000ul +#define AGP_TRDY_MODE 0x00020000ul +/* ? 0xfffc0000ul */ #define SCALER_COLOUR_CNTL BlockIOTag(0x154u) /* GTPro */ #define SCALE_BRIGHTNESS 0x0000007ful /* ? 0x00000080ul */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atirgb514.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atirgb514.c:1.6 xc/programs/Xserver/hw/xfree86/drivers/ati/atirgb514.c:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atirgb514.c:1.6 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atirgb514.c Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atirgb514.c,v 1.6 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atirgb514.c,v 1.8 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 2001 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2001 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -75,8 +75,6 @@ pATIHW->ibmrgb514[0x0070U] &= ~0x20U; pATIHW->ibmrgb514[0x0071U] = 0x41U; /* See workaround in ATIRGB514Set() */ -#ifndef AVOID_CPIO - if (pATIHW->crtc == ATI_CRTC_VGA) { /* Pixel Format */ @@ -89,9 +87,6 @@ pATIHW->ibmrgb514[0x0090U] = 0x03U; } else - -#endif /* AVOID_CPIO */ - { /* Miscellaneous Control */ pATIHW->ibmrgb514[0x0070U] &= ~0x40U; @@ -257,8 +252,6 @@ for (Index = 0; Index < NumberOf(pATIHW->ibmrgb514); Index++) out8(M64_DAC_MASK, pATIHW->ibmrgb514[Index]); -#ifndef AVOID_CPIO - /* Deal with documented anomaly */ if (pATIHW->crtc == ATI_CRTC_VGA) { @@ -268,8 +261,6 @@ out8(M64_DAC_MASK, pATIHW->ibmrgb514[0x0071U] & ~0x41U); } -#endif /* AVOID_CPIO */ - /* Restore registers */ out8(M64_DAC_WRITE, index_lo); out8(M64_DAC_DATA, index_hi); Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atirgb514.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atirgb514.h:1.5 xc/programs/Xserver/hw/xfree86/drivers/ati/atirgb514.h:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atirgb514.h:1.5 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atirgb514.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atirgb514.h,v 1.5 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atirgb514.h,v 1.6 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 2001 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2001 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c:1.34 xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c:1.36 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c:1.34 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c,v 1.34 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c,v 1.36 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1999 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -137,9 +137,6 @@ /* Initialise framebuffer layer */ switch (pATI->bitsPerPixel) { - -#ifndef AVOID_CPIO - case 1: pATI->Closeable = xf1bppScreenInit(pScreen, pFB, pScreenInfo->virtualX, pScreenInfo->virtualY, @@ -152,8 +149,6 @@ pScreenInfo->xDpi, pScreenInfo->yDpi, pATI->displayWidth); break; -#endif /* AVOID_CPIO */ - case 8: case 16: case 24: @@ -201,9 +196,6 @@ "RENDER extension not supported with a shadowed" " framebuffer.\n"); } - -#ifndef AVOID_CPIO - else if (pATI->BankInfo.BankSize) { if (serverGeneration == 1) @@ -211,9 +203,6 @@ "RENDER extension not supported with a banked" " framebuffer.\n"); } - -#endif /* AVOID_CPIO */ - else if (!fbPictureInit(pScreen, NULL, 0)) { if (serverGeneration == 1) @@ -232,16 +221,12 @@ xf86SetBlackWhitePixels(pScreen); -#ifndef AVOID_CPIO - /* Initialise banking if needed */ if (!miInitializeBanking(pScreen, pScreenInfo->virtualX, pScreenInfo->virtualY, pATI->displayWidth, &pATI->BankInfo)) return FALSE; -#endif /* AVOID_CPIO */ - /* Setup acceleration */ if (!ATIInitializeAcceleration(pScreen, pScreenInfo, pATI)) return FALSE; @@ -261,15 +246,6 @@ if (!miCreateDefColormap(pScreen)) return FALSE; -#ifdef AVOID_CPIO - - if (!xf86HandleColormaps(pScreen, 256, pATI->rgbBits, ATILoadPalette, NULL, - CMAP_PALETTED_TRUECOLOR | - CMAP_LOAD_EVEN_IF_OFFSCREEN)) - return FALSE; - -#else /* AVOID_CPIO */ - if (pATI->depth > 1) if (!xf86HandleColormaps(pScreen, (pATI->depth == 4) ? 16 : 256, pATI->rgbBits, ATILoadPalette, NULL, @@ -277,8 +253,6 @@ CMAP_LOAD_EVEN_IF_OFFSCREEN)) return FALSE; -#endif /* AVOID_CPIO */ - /* Initialise shadow framebuffer */ if (pATI->OptionShadowFB && !ShadowFBInit(pScreen, ATIRefreshArea)) Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.h:1.8 xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.h:1.9 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.h:1.8 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.h,v 1.8 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.h,v 1.9 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1999 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h:1.45 xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h:1.49 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h:1.45 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h Fri Feb 17 12:01:39 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h,v 1.45 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h,v 1.49 2006/02/17 17:01:39 tsi Exp $ */ /* - * Copyright 1999 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -26,6 +26,7 @@ #include "atibank.h" #include "aticlock.h" +#include "atiendian.h" #include "atiregs.h" #include "xaa.h" @@ -57,8 +58,6 @@ /* Colour lookup table */ CARD8 lut[256 * 3]; -#ifndef AVOID_CPIO - /* VGA registers */ CARD8 genmo, crt[25], seq[5], gra[9], attr[21]; @@ -69,8 +68,6 @@ /* Shadow VGA CRTC registers */ CARD8 shadow_vga[25]; -#endif /* AVOID_CPIO */ - /* Generic DAC registers */ CARD8 dac_read, dac_write, dac_mask; @@ -86,7 +83,7 @@ /* Mach64 CPIO registers */ CARD32 crtc_h_total_disp, crtc_h_sync_strt_wid, crtc_v_total_disp, crtc_v_sync_strt_wid, - crtc_off_pitch, crtc_gen_cntl, dsp_config, dsp_on_off, + crtc_off_pitch, crtc_gen_cntl, dsp_config, dsp_on_off, mem_buf_cntl, ovr_clr, ovr_wid_left_right, ovr_wid_top_bottom, cur_clr0, cur_clr1, cur_offset, cur_horz_vert_posn, cur_horz_vert_off, @@ -136,15 +133,10 @@ /* Clock programming data */ int FeedbackDivider, ReferenceDivider, PostDivider; -#ifndef AVOID_CPIO - - /* This is used by ATISwap() */ + /* These are used by ATISwap() */ pointer frame_buffer; ATIBankProcPtr SetBank; unsigned int nBank, nPlane; - -#endif /* AVOID_CPIO */ - } ATIHWRec; /* @@ -160,13 +152,7 @@ /* * Adapter-related definitions. */ - CARD8 Adapter; - -#ifndef AVOID_CPIO - - CARD8 VGAAdapter; - -#endif /* AVOID_CPIO */ + CARD8 Adapter, VGAAdapter; /* * Chip-related definitions. @@ -175,20 +161,14 @@ CARD16 ChipType; CARD8 Chip; CARD8 ChipClass, ChipRevision, ChipRev, ChipVersion, ChipFoundry; - -#ifndef AVOID_CPIO - CARD8 Coprocessor, ChipHasSUBSYS_CNTL; -#endif /* AVOID_CPIO */ - /* * Processor I/O decoding definitions. */ - CARD8 CPIODecoding; - IOADDRESS CPIOBase; - -#ifndef AVOID_CPIO + int Domain; + CARD8 IODecoding; + IOADDRESS CPIOBase, DomainIOBase; /* * Processor I/O port definition for VGA. @@ -202,19 +182,11 @@ CARD8 B2Reg; /* The B2 mirror */ CARD8 VGAOffset; /* Low index for CPIO_VGAWonder */ -#endif /* AVOID_CPIO */ - /* * DAC-related definitions. */ - -#ifndef AVOID_CPIO - IOADDRESS CPIO_DAC_MASK, CPIO_DAC_DATA, CPIO_DAC_READ, CPIO_DAC_WRITE, CPIO_DAC_WAIT; - -#endif /* AVOID_CPIO */ - CARD16 DAC; CARD8 rgbBits; @@ -222,15 +194,8 @@ * Definitions related to system bus interface. */ pciVideoPtr PCIInfo; - CARD8 BusType; - CARD8 SharedAccelerator; - -#ifndef AVOID_CPIO - - CARD8 SharedVGA; resRange VGAWonderResources[2]; - -#endif /* AVOID_CPIO */ + CARD8 BusType, SharedAccelerator, SharedVGA; /* * Definitions related to video memory. @@ -252,8 +217,6 @@ unsigned long LinearBase; int LinearSize, FBPitch; -#ifndef AVOID_CPIO - /* * Banking interface. */ @@ -261,8 +224,6 @@ pointer pBank; CARD8 UseSmallApertures; -#endif /* AVOID_CPIO */ - /* * Definitions related to MMIO register apertures. */ @@ -369,8 +330,6 @@ scratch_reg3, bus_cntl, lcd_index, mem_cntl, i2c_cntl_1, dac_cntl, gen_test_cntl, mpp_config, mpp_strobe_seq, tvo_cntl; -#ifndef AVOID_CPIO - CARD32 config_cntl; /* Mach8/Mach32 registers */ @@ -384,9 +343,6 @@ /* VGA shadow registers */ CARD8 shadow_crt03, shadow_crt11; - -#endif /* AVOID_CPIO */ - } LockData; /* Mode data */ @@ -408,13 +364,7 @@ unsigned int OptionCRTDisplay:1; /* Display on both CRT & DFP */ unsigned int OptionCSync:1; /* Use composite sync */ unsigned int OptionDevel:1; /* Intentionally undocumented */ - -#ifndef AVOID_CPIO - unsigned int OptionLinear:1; /* Use linear aperture if available */ - -#endif /* AVOID_CPIO */ - unsigned int OptionMMIOCache:1; /* Cache MMIO writes */ unsigned int OptionTestMMIOCache:1;/* Test MMIO cache integrity */ unsigned int OptionPanelDisplay:1; /* Prefer digital panel over CRT */ @@ -429,9 +379,19 @@ CARD8 MMIOInLinear; /* + * Number of signal that interrupts certain accesses. + */ + volatile int CaughtSignal; + + /* * Wrapped functions. */ CloseScreenProcPtr CloseScreen; + + /* + * Endianness transformation function. + */ + ATIApplyEndianProc *ATIApplyEndian; } ATIRec; #define ATIPTR(_p) ((ATIPtr)((_p)->driverPrivate)) Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atituner.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atituner.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/ati/atituner.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atituner.c:1.3 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atituner.c Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atituner.c,v 1.3 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atituner.c,v 1.4 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atituner.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atituner.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/ati/atituner.h:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atituner.h:1.3 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atituner.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atituner.h,v 1.3 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atituner.h,v 1.4 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 2003 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.c:1.10 xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.c:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.c:1.10 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.c Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.c,v 1.10 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.c,v 1.11 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.h:1.10 xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.h:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.h:1.10 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.h,v 1.10 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiutil.h,v 1.11 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.c:1.19 xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.c:1.21 --- xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.c:1.19 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.c Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.c,v 1.19 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.c,v 1.21 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -46,13 +46,7 @@ ScrnInfoPtr pScreenInfo = xf86Screens[iScreen]; ATIPtr pATI = ATIPTR(pScreenInfo); Bool InterlacedSeen; - int HBlankWidth, HAdjust, VScan, VInterlace; - -#ifndef AVOID_CPIO - - int VDisplay, VTotal; - -#endif /* AVOID_CPIO */ + int HBlankWidth, HAdjust, VScan, VInterlace, VDisplay, VTotal; if (flags & MODECHECK_FINAL) { @@ -185,9 +179,6 @@ switch (pATI->NewHW.crtc) { - -#ifndef AVOID_CPIO - case ATI_CRTC_VGA: /* Prevent overscans */ if (HBlankWidth > 63) @@ -219,8 +210,6 @@ break; -#endif /* AVOID_CPIO */ - case ATI_CRTC_MACH64: if (VScan > 2) return MODE_NO_VSCAN; Index: xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.h:1.11 xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.h:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.h:1.11 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.h,v 1.11 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativalid.h,v 1.12 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h:1.73 xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h:1.85 --- xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h:1.73 Fri Feb 4 10:03:30 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h Sun Mar 19 14:06:35 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h,v 1.73 2005/02/04 15:03:30 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h,v 1.85 2006/03/19 19:06:35 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -37,9 +37,9 @@ #define ATI_NAME "ATI" #define ATI_DRIVER_NAME "ati" -#define ATI_VERSION_MAJOR 6 -#define ATI_VERSION_MINOR 5 -#define ATI_VERSION_PATCH 12 +#define ATI_VERSION_MAJOR 7 +#define ATI_VERSION_MINOR 0 +#define ATI_VERSION_PATCH 10 #ifndef ATI_VERSION_EXTRA #define ATI_VERSION_EXTRA "" Index: xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.c:1.23 xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.c:1.27 --- xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.c:1.23 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.c Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.c,v 1.23 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.c,v 1.27 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -32,9 +32,7 @@ #ifndef DPMS_SERVER # define DPMS_SERVER #endif -#include "extensions/dpms.h" - -#ifndef AVOID_CPIO +#include <X11/extensions/dpms.h> /* * ATIVGAPreInit -- @@ -136,6 +134,8 @@ { int Index; + xf86InterceptSignals(&pATI->CaughtSignal); + /* Save miscellaneous output register */ pATIHW->genmo = inb(R_GENMO); ATISetVGAIOBase(pATI, pATIHW->genmo); @@ -158,6 +158,8 @@ /* Save graphics controller registers */ for (Index = 0; Index < NumberOf(pATIHW->gra); Index++) pATIHW->gra[Index] = GetReg(GRAX, Index); + + xf86InterceptSignals(NULL); } /* @@ -426,6 +428,8 @@ { int Index; + xf86InterceptSignals(&pATI->CaughtSignal); + /* Set VGA I/O base */ ATISetVGAIOBase(pATI, pATIHW->genmo); @@ -451,6 +455,8 @@ /* Load graphics controller registers */ for (Index = 0; Index < NumberOf(pATIHW->gra); Index++) PutReg(GRAX, Index, pATIHW->gra[Index]); + + xf86InterceptSignals(NULL); } /* @@ -465,7 +471,9 @@ int Mode ) { + xf86InterceptSignals(&pATI->CaughtSignal); (void)inb(GENS1(pATI->CPIO_VGABase)); /* Reset flip-flop */ + xf86InterceptSignals(NULL); switch (Mode) { @@ -530,7 +538,5 @@ crt17 |= GetReg(CRTX(pATI->CPIO_VGABase), 0x17U) & ~0x80U; usleep(10000); PutReg(CRTX(pATI->CPIO_VGABase), 0x17U, crt17); - PutReg(SEQX, 0x01U, 0x03U); /* End synchonous reset */ + PutReg(SEQX, 0x00U, 0x03U); /* End synchonous reset */ } - -#endif /* AVOID_CPIO */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.h:1.12 xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.h:1.14 --- xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.h:1.12 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.h,v 1.12 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativga.h,v 1.14 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -29,8 +29,6 @@ #include "xf86str.h" -#ifndef AVOID_CPIO - extern void ATIVGAPreInit FunctionPrototype((ATIPtr, ATIHWPtr)); extern void ATIVGASave FunctionPrototype((ATIPtr, ATIHWPtr)); extern void ATIVGACalculate FunctionPrototype((ATIPtr, ATIHWPtr, @@ -40,6 +38,4 @@ extern void ATIVGASaveScreen FunctionPrototype((ATIPtr, int)); extern void ATIVGASetDPMSMode FunctionPrototype((ATIPtr, int)); -#endif /* AVOID_CPIO */ - #endif /* ___ATIVGA_H___ */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/ativgaio.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/ativgaio.c:1.6 xc/programs/Xserver/hw/xfree86/drivers/ati/ativgaio.c:1.9 --- xc/programs/Xserver/hw/xfree86/drivers/ati/ativgaio.c:1.6 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/ativgaio.c Sun Mar 19 14:06:35 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativgaio.c,v 1.6 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativgaio.c,v 1.9 2006/03/19 19:06:35 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -25,13 +25,11 @@ #include "atistruct.h" #include "ativgaio.h" -#ifndef AVOID_CPIO - /* * ATISetVGAIOBase -- * - * This sets vgaIOBase according to the value of the passed value of the - * miscellaneous output register. + * This sets vgaIOBase according to the passed value of the miscellaneous + * output register. */ void ATISetVGAIOBase @@ -41,6 +39,5 @@ ) { pATI->CPIO_VGABase = (misc & 0x01U) ? ColourIOBase : MonochromeIOBase; + pATI->CPIO_VGABase += pATI->DomainIOBase; } - -#endif /* AVOID_CPIO */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/ativgaio.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/ativgaio.h:1.7 xc/programs/Xserver/hw/xfree86/drivers/ati/ativgaio.h:1.9 --- xc/programs/Xserver/hw/xfree86/drivers/ati/ativgaio.h:1.7 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/ativgaio.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativgaio.h,v 1.7 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativgaio.h,v 1.9 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -34,8 +34,6 @@ #include "atipriv.h" #include "atiproto.h" -#ifndef AVOID_CPIO - extern void ATISetVGAIOBase FunctionPrototype((ATIPtr, const CARD8)); /* Odds and ends to ease reading and writting of indexed registers */ @@ -51,6 +49,4 @@ outb((_Register) + 1, _Value); \ } while (0) -#endif /* AVOID_CPIO */ - #endif /* ___ATIVGAIO_H___ */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c:1.18 xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c:1.21 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c:1.18 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c,v 1.18 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.c,v 1.21 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -23,6 +23,7 @@ #include "ati.h" #include "atiadapter.h" +#include "atichip.h" #include "atistruct.h" #include "atividmem.h" @@ -65,8 +66,6 @@ "Unknown video memory type" }; -#ifndef AVOID_CPIO - /* * ATIUnmapVGA -- * @@ -87,8 +86,6 @@ pATI->pBank = pATI->BankInfo.pBankA = pATI->BankInfo.pBankB = NULL; } -#endif /* AVOID_CPIO */ - /* * ATIUnmapLinear -- * @@ -101,28 +98,13 @@ ATIPtr pATI ) { - -#ifdef AVOID_CPIO - - if (!pATI->pMemory) - return; - -#else /* AVOID_CPIO */ - if (pATI->pMemory != pATI->pBank) - -#endif /* AVOID_CPIO */ - { xf86UnMapVidMem(iScreen, pATI->pMemory, pATI->LinearSize); -#if X_BYTE_ORDER != X_LITTLE_ENDIAN - - if (pATI->pMemoryLE) + if ((pATI->Chip >= ATI_CHIP_264VTB) && + (ATIEndian.endian == ATI_BIG_ENDIAN) && pATI->pMemoryLE) xf86UnMapVidMem(iScreen, pATI->pMemoryLE, pATI->LinearSize); - -#endif /* X_BYTE_ORDER */ - } pATI->pMemory = pATI->pMemoryLE = NULL; @@ -140,19 +122,21 @@ ATIPtr pATI ) { - if (pATI->pMMIO) - { - unsigned long PageMask = getpagesize() - 1; - unsigned long MMIOBase, MMIOSize; + unsigned long PageMask; + unsigned long MMIOBase, MMIOSize; - if (!(MMIOBase = pATI->Block1Base)) - MMIOBase = pATI->Block0Base; - MMIOBase &= ~PageMask; - MMIOSize = - (pATI->Block0Base + 0x00000400U + PageMask - MMIOBase) & ~PageMask; + if (!pATI->pMMIO) + return; - xf86UnMapVidMem(iScreen, pATI->pMMIO, MMIOSize); - } + PageMask = getpagesize() - 1; + + if (!(MMIOBase = pATI->Block1Base)) + MMIOBase = pATI->Block0Base; + MMIOBase &= ~PageMask; + MMIOSize = + (pATI->Block0Base + 0x00000400U + PageMask - MMIOBase) & ~PageMask; + + xf86UnMapVidMem(iScreen, pATI->pMMIO, MMIOSize); pATI->pMMIO = pATI->pBlock[0] = pATI->pBlock[1] = NULL; } @@ -179,15 +163,17 @@ ~PageMask; xf86UnMapVidMem(iScreen, pATI->pCursorPage, CursorSize); + + pATI->pCursorPage = NULL; } - pATI->pCursorPage = pATI->pCursorImage = NULL; + pATI->pCursorImage = NULL; } /* * ATIMapApertures -- * - * This function maps all apertures used by the driver. + * This function maps all memory apertures used by the driver. */ Bool ATIMapApertures @@ -203,12 +189,7 @@ if (pATI->Mapped) return TRUE; -#ifndef AVOID_CPIO - if (pATI->VGAAdapter == ATI_ADAPTER_NONE) - -#endif /* AVOID_CPIO */ - { if (!pATI->LinearBase && !pATI->Block0Base) return FALSE; @@ -219,8 +200,6 @@ else Tag = 0; -#ifndef AVOID_CPIO - /* Map VGA aperture */ if (pATI->VGAAdapter != ATI_ADAPTER_NONE) { @@ -245,8 +224,6 @@ pATI->Mapped = TRUE; } -#endif /* AVOID_CPIO */ - /* Map linear aperture */ if (pATI->LinearBase) { @@ -259,55 +236,51 @@ if (!pATI->pMemory) { - -#ifndef AVOID_CPIO - ATIUnmapVGA(iScreen, pATI); -#endif /* AVOID_CPIO */ - pATI->Mapped = FALSE; return FALSE; } pATI->Mapped = TRUE; -#if X_BYTE_ORDER == X_LITTLE_ENDIAN - - if ((pATI->CursorBase >= pATI->LinearBase) && - ((pATI->CursorOffset + 0x00000400UL) <= (CARD32)pATI->LinearSize)) - pATI->pCursorImage = (char *)pATI->pMemory + pATI->CursorOffset; - - pATI->pMemoryLE = pATI->pMemory; - -#else /* if X_BYTE_ORDER != X_LITTLE_ENDIAN */ + if ((ATIEndian.endian == ATI_LITTLE_ENDIAN) || + (pATI->Chip < ATI_CHIP_264VTB)) + { + if ((pATI->CursorBase >= pATI->LinearBase) && + ((pATI->CursorOffset + 0x00000400UL) <= + (CARD32)pATI->LinearSize)) + pATI->pCursorImage = + (char *)pATI->pMemory + pATI->CursorOffset; - /* - * Map the little-endian aperture (used for video, etc.). Note that - * caching of this area is _not_ wanted. - */ - if (pVideo) + pATI->pMemoryLE = pATI->pMemory; + } + else if (pVideo) { + /* + * Map the little-endian aperture (used for Xv, etc.). Note that + * caching of this area is _not_ wanted. + */ + unsigned long LinearBase = pATI->LinearBase - 0x00800000U; + pATI->pMemoryLE = xf86MapPciMem(iScreen, VIDMEM_MMIO, Tag, - pATI->LinearBase - 0x00800000U, pATI->LinearSize); + LinearBase, pATI->LinearSize); if (!pATI->pMemoryLE) { ATIUnmapLinear(iScreen, pATI); - -#ifndef AVOID_CPIO - ATIUnmapVGA(iScreen, pATI); -#endif /* AVOID_CPIO */ - pATI->Mapped = FALSE; return FALSE; } - } - -#endif /* X_BYTE_ORDER */ + if ((pATI->CursorBase >= LinearBase) && + ((pATI->CursorOffset + 0x00000400UL) <= + (CARD32)pATI->LinearSize)) + pATI->pCursorImage = + (char *)pATI->pMemoryLE + pATI->CursorOffset; + } } PageSize = getpagesize(); @@ -333,21 +306,10 @@ if (!pATI->pMMIO) { - -#if X_BYTE_ORDER == X_LITTLE_ENDIAN - ATIUnmapCursor(iScreen, pATI); - -#endif /* X_BYTE_ORDER */ - ATIUnmapLinear(iScreen, pATI); - -#ifndef AVOID_CPIO - ATIUnmapVGA(iScreen, pATI); -#endif /* AVOID_CPIO */ - pATI->Mapped = FALSE; return FALSE; } @@ -360,12 +322,7 @@ if (pATI->Block1Base) pATI->pBlock[1] = (char *)pATI->pBlock[0] - 0x00000400U; -#if X_BYTE_ORDER == X_LITTLE_ENDIAN - if (!pATI->pCursorImage) - -#endif /* X_BYTE_ORDER */ - { if ((pATI->CursorBase >= MMIOBase) && ((pATI->CursorBase + 0x00000400UL) <= (MMIOBase + PageSize))) @@ -395,13 +352,8 @@ ATIUnmapCursor(iScreen, pATI); ATIUnmapMMIO(iScreen, pATI); ATIUnmapLinear(iScreen, pATI); - -#ifndef AVOID_CPIO - ATIUnmapVGA(iScreen, pATI); -#endif /* AVOID_CPIO */ - pATI->Mapped = FALSE; return FALSE; } @@ -416,7 +368,7 @@ /* * ATIUnmapApertures -- * - * This function unmaps all apertures used by the driver. + * This function unmaps all memory apertures used by the driver. */ void ATIUnmapApertures @@ -438,11 +390,6 @@ /* Unmap linear aperture */ ATIUnmapLinear(iScreen, pATI); -#ifndef AVOID_CPIO - /* Unmap VGA aperture */ ATIUnmapVGA(iScreen, pATI); - -#endif /* AVOID_CPIO */ - } Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.h:1.11 xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.h:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.h:1.11 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.h,v 1.11 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atividmem.h,v 1.12 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.c:1.16 xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.c:1.18 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.c:1.16 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.c Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.c,v 1.16 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.c,v 1.18 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -55,8 +55,6 @@ #include "atiwonder.h" #include "atiwonderio.h" -#ifndef AVOID_CPIO - /* * ATIVGAWonderPreInit -- * @@ -299,5 +297,3 @@ ATIModifyExtReg(pATI, 0xBAU, -1, 0x00U, pATIHW->ba); ATIModifyExtReg(pATI, 0xBDU, -1, 0x00U, pATIHW->bd); } - -#endif /* AVOID_CPIO */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.h:1.11 xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.h:1.13 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.h:1.11 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.h Thu Jan 5 13:55:30 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.h,v 1.11 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonder.h,v 1.13 2006/01/05 18:55:30 tsi Exp $ */ /* - * Copyright 1997 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -29,14 +29,10 @@ #include "xf86str.h" -#ifndef AVOID_CPIO - extern void ATIVGAWonderPreInit FunctionPrototype((ATIPtr, ATIHWPtr)); extern void ATIVGAWonderSave FunctionPrototype((ATIPtr, ATIHWPtr)); extern void ATIVGAWonderCalculate FunctionPrototype((ATIPtr, ATIHWPtr, DisplayModePtr)); extern void ATIVGAWonderSet FunctionPrototype((ATIPtr, ATIHWPtr)); -#endif /* AVOID_CPIO */ - #endif /* ___ATIWONDER_H___ */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonderio.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonderio.c:1.6 xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonderio.c:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonderio.c:1.6 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonderio.c Thu Jan 5 13:55:31 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonderio.c,v 1.6 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonderio.c,v 1.8 2006/01/05 18:55:31 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -25,8 +25,6 @@ #include "atichip.h" #include "atiwonderio.h" -#ifndef AVOID_CPIO - /* * ATIModifyExtReg -- * @@ -82,5 +80,3 @@ else ATIPutExtReg(Index, NewValue); } - -#endif /* AVOID_CPIO */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonderio.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonderio.h:1.6 xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonderio.h:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonderio.h:1.6 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonderio.h Thu Jan 5 13:55:31 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonderio.h,v 1.6 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiwonderio.h,v 1.8 2006/01/05 18:55:31 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -33,16 +33,12 @@ #include "atistruct.h" #include "ativgaio.h" -#ifndef AVOID_CPIO - extern void ATIModifyExtReg FunctionPrototype((ATIPtr, const CARD8, int, const CARD8, CARD8)); -#define ATIGetExtReg(_Index) \ - GetReg(pATI->CPIO_VGAWonder, _Index) -#define ATIPutExtReg(_Index, _Value) \ - PutReg(pATI->CPIO_VGAWonder, _Index, _Value) - -#endif /* AVOID_CPIO */ +#define ATIGetExtReg(_Index) \ + GetReg(pATI->CPIO_VGAWonder + pATI->DomainIOBase, _Index) +#define ATIPutExtReg(_Index, _Value) \ + PutReg(pATI->CPIO_VGAWonder + pATI->DomainIOBase, _Index, _Value) #endif /* ___ATIWONDERIO_H___ */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c:1.7 xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c:1.10 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c:1.7 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c Thu Jan 5 13:55:31 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c,v 1.7 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c,v 1.10 2006/01/05 18:55:31 tsi Exp $ */ /* - * Copyright 2001 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2001 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -22,6 +22,7 @@ */ #include "atiadapter.h" +#include "atichip.h" #include "atimach64xv.h" #include "atistruct.h" #include "atixv.h" @@ -97,15 +98,10 @@ ATIPtr pATI ) { - -#ifndef AVOID_CPIO - - /* Currently a linear aperture is needed ... */ + /* Currently a linear packed aperture is needed ... */ if (!pATI->LinearBase) return; -#endif /* AVOID_CPIO */ - (void)xf86XVRegisterGenericAdaptorDriver(ATIXVInitializeAdaptor); } @@ -126,9 +122,14 @@ int nAdaptor; Bool result; - if (!(pScreenInfo->memPhysBase = pATI->LinearBase)) + if ((pScreenInfo->depth < 8) || + !(pScreenInfo->memPhysBase = pATI->LinearBase)) return FALSE; + if ((ATIEndian.endian == ATI_BIG_ENDIAN) && + (pATI->Chip >= ATI_CHIP_264VTB)) + pScreenInfo->memPhysBase -= 0x00800000U; + pScreenInfo->fbOffset = 0; nAdaptor = xf86XVListGenericAdaptors(pScreenInfo, &ppAdaptor); Index: xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h:1.6 xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h:1.6 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h Thu Jan 5 13:55:31 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h,v 1.6 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h,v 1.7 2006/01/05 18:55:31 tsi Exp $ */ /* - * Copyright 2001 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2001 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c:1.90 xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c:1.94 --- xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c:1.90 Fri Dec 10 11:07:00 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c Thu Mar 16 11:49:59 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c,v 1.90 2004/12/10 16:07:00 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c,v 1.94 2006/03/16 16:49:59 dawes Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -321,13 +321,14 @@ NULL }; -void R128LoaderRefSymLists(void) +void R128LoaderRefSymLists(ModuleDescPtr module) { /* * Tell the loader about symbols from other modules that this module might * refer to. */ - xf86LoaderRefSymLists(vgahwSymbols, + xf86LoaderModRefSymLists(module, + vgahwSymbols, fbSymbols, xaaSymbols, ramdacSymbols, @@ -1180,23 +1181,33 @@ static Bool R128PreInitDDC(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) { + ModuleDescPtr pModule; +#if !(defined(__powerpc__) || defined(__alpha__)) R128InfoPtr info = R128PTR(pScrn); vbeInfoPtr pVbe; + ModuleDescPtr pVBEModule; +#endif - if (!xf86LoadSubModule(pScrn, "ddc")) return FALSE; - xf86LoaderReqSymLists(ddcSymbols, NULL); + if (!(pModule = xf86LoadSubModule(pScrn, "ddc"))) return FALSE; + xf86LoaderModReqSymLists(pModule, ddcSymbols, NULL); #if defined(__powerpc__) || defined(__alpha__) /* Int10 is broken on PPC and some Alphas */ return TRUE; #else - if (xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols,NULL); + if ((pVBEModule = xf86LoadVBEModule(pScrn))) { + Bool ret; + xf86LoaderModReqSymLists(pVBEModule, vbeSymbols, NULL); pVbe = VBEInit(pInt10,info->pEnt->index); - if (!pVbe) return FALSE; - xf86SetDDCproperties(pScrn,xf86PrintEDID(vbeDoEDID(pVbe,NULL))); - vbeFree(pVbe); - return TRUE; + if (!pVbe) { + ret = FALSE; + } else { + xf86SetDDCproperties(pScrn,xf86PrintEDID(vbeDoEDID(pVbe,pModule))); + vbeFree(pVbe); + ret = TRUE; + } + xf86UnloadSubModule(pVBEModule); + return ret; } else return FALSE; #endif @@ -1246,8 +1257,9 @@ R128I2cInit(ScrnInfoPtr pScrn) { R128InfoPtr info = R128PTR(pScrn); - if ( xf86LoadSubModule(pScrn, "i2c") ) - xf86LoaderReqSymLists(i2cSymbols,NULL); + ModuleDescPtr pModule; + if ((pModule = xf86LoadSubModule(pScrn, "i2c")) ) + xf86LoaderModReqSymLists(pModule, i2cSymbols,NULL); else{ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to load i2c module\n"); @@ -1571,6 +1583,7 @@ R128InfoPtr info = R128PTR(pScrn); ClockRangePtr clockRanges; int modesFound; + ModuleDescPtr pModule; if(info->isDFP) { R128MapMem(pScrn); @@ -1661,8 +1674,8 @@ xf86SetDpi(pScrn, 0, 0); /* Get ScreenInit function */ - if (!xf86LoadSubModule(pScrn, "fb")) return FALSE; - xf86LoaderReqSymLists(fbSymbols, NULL); + if (!(pModule = xf86LoadSubModule(pScrn, "fb"))) return FALSE; + xf86LoaderModReqSymLists(pModule, fbSymbols, NULL); info->CurrentLayout.displayWidth = pScrn->displayWidth; info->CurrentLayout.mode = pScrn->currentMode; @@ -1674,10 +1687,11 @@ static Bool R128PreInitCursor(ScrnInfoPtr pScrn) { R128InfoPtr info = R128PTR(pScrn); + ModuleDescPtr pModule; if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) { - if (!xf86LoadSubModule(pScrn, "ramdac")) return FALSE; - xf86LoaderReqSymLists(ramdacSymbols, NULL); + if (!(pModule = xf86LoadSubModule(pScrn, "ramdac"))) return FALSE; + xf86LoaderModReqSymLists(pModule, ramdacSymbols, NULL); } return TRUE; } @@ -1686,21 +1700,23 @@ static Bool R128PreInitAccel(ScrnInfoPtr pScrn) { R128InfoPtr info = R128PTR(pScrn); + ModuleDescPtr pModule; if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) { - if (!xf86LoadSubModule(pScrn, "xaa")) return FALSE; - xf86LoaderReqSymLists(xaaSymbols, NULL); + if (!(pModule = xf86LoadSubModule(pScrn, "xaa"))) return FALSE; + xf86LoaderModReqSymLists(pModule, xaaSymbols, NULL); } return TRUE; } static Bool R128PreInitInt10(ScrnInfoPtr pScrn, xf86Int10InfoPtr *ppInt10) { - R128InfoPtr info = R128PTR(pScrn); #if 1 && !defined(__alpha__) + R128InfoPtr info = R128PTR(pScrn); + ModuleDescPtr pModule; /* int10 is broken on some Alphas */ - if (xf86LoadSubModule(pScrn, "int10")) { - xf86LoaderReqSymLists(int10Symbols, NULL); + if ((pModule = xf86LoadSubModule(pScrn, "int10"))) { + xf86LoaderModReqSymLists(pModule, int10Symbols, NULL); xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n"); *ppInt10 = xf86InitInt10(info->pEnt->index); } @@ -1712,6 +1728,7 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn) { R128InfoPtr info = R128PTR(pScrn); + ModuleDescPtr pModule; if (xf86ReturnOptValBool(info->Options, OPTION_CCE_PIO, FALSE)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forcing CCE into PIO mode\n"); @@ -1809,12 +1826,12 @@ /* This option checked by the R128 DRM kernel module */ } - if (!xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pModule = xf86LoadSubModule(pScrn, "shadowfb"))) { info->allowPageFlip = 0; xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't load shadowfb module:\n"); } else { - xf86LoaderReqSymLists(driShadowFBSymbols, NULL); + xf86LoaderModReqSymLists(pModule, driShadowFBSymbols, NULL); info->allowPageFlip = xf86ReturnOptValBool(info->Options, OPTION_PAGE_FLIP, @@ -1832,10 +1849,13 @@ R128ProbeDDC(ScrnInfoPtr pScrn, int indx) { vbeInfoPtr pVbe; - if (xf86LoadSubModule(pScrn, "vbe")) { + ModuleDescPtr pModule; + if ((pModule = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pModule, vbeSymbols, NULL); pVbe = VBEInit(NULL,indx); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pModule); } } @@ -1844,6 +1864,7 @@ { R128InfoPtr info; xf86Int10InfoPtr pInt10 = NULL; + ModuleDescPtr pModule; R128TRACE(("R128PreInit\n")); @@ -1861,8 +1882,8 @@ return TRUE; } - if (!xf86LoadSubModule(pScrn, "vgahw")) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + if (!(pModule = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; + xf86LoaderModReqSymLists(pModule, vgahwSymbols, NULL); if (!vgaHWGetHWRec(pScrn)) { R128FreeRec(pScrn); return FALSE; @@ -1916,8 +1937,8 @@ if (info->FBDev) { /* check for linux framebuffer device */ - if (!xf86LoadSubModule(pScrn, "fbdevhw")) return FALSE; - xf86LoaderReqSymLists(fbdevHWSymbols, NULL); + if (!(pModule = xf86LoadSubModule(pScrn, "fbdevhw"))) return FALSE; + xf86LoaderModReqSymLists(pModule, fbdevHWSymbols, NULL); if (!fbdevHWInit(pScrn, info->PciInfo, NULL)) return FALSE; pScrn->SwitchMode = fbdevHWSwitchMode; pScrn->AdjustFrame = fbdevHWAdjustFrame; Index: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_misc.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/r128_misc.c:1.7 xc/programs/Xserver/hw/xfree86/drivers/ati/r128_misc.c:1.10 --- xc/programs/Xserver/hw/xfree86/drivers/ati/r128_misc.c:1.7 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/r128_misc.c Thu Mar 16 11:49:59 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_misc.c,v 1.7 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_misc.c,v 1.10 2006/03/16 16:49:59 dawes Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -46,6 +46,8 @@ {0, 0, 0, 0} }; +pointer R128Module = NULL; + /* * R128Setup -- * @@ -54,7 +56,7 @@ static pointer R128Setup ( - pointer Module, + ModuleDescPtr Module, pointer Options, int *ErrorMajor, int *ErrorMinor @@ -68,7 +70,7 @@ if (!xf86ServerIsOnlyDetecting() && !LoaderSymbol(ATI_NAME)) xf86LoadOneModule(ATI_DRIVER_NAME, Options); - R128LoaderRefSymLists(); + R128LoaderRefSymLists(Module); Inited = TRUE; } @@ -84,4 +86,18 @@ NULL }; +const char *r128ExportedSymbols[] = { + "R128PreInit", + "R128ScreenInit", + "R128SwitchMode", + "R128AdjustFrame", + "R128EnterVT", + "R128LeaveVT", + "R128FreeScreen", + "R128ValidMode", + "R128Options", + "R128Module", + NULL +}; + #endif /* XFree86LOADER */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c:1.18 xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c:1.20 --- xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c:1.18 Sun Feb 9 10:33:17 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c Thu Mar 16 11:49:59 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c,v 1.18 2003/02/09 15:33:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c,v 1.20 2006/03/16 16:49:59 dawes Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -268,15 +268,16 @@ ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0); #ifdef XFree86LOADER + ModuleDescPtr pModule; - if (!xf86LoadSubModule(pScrn, "r128")) { + if (!(pModule = xf86LoadSubModule(pScrn, "r128"))) { xf86Msg(X_ERROR, R128_NAME ": Failed to load \"r128\" module.\n"); xf86DeleteScreen(pScrn->scrnIndex, 0); continue; } - xf86LoaderReqSymLists(R128Symbols, NULL); + xf86LoaderModReqSymLists(pModule, R128Symbols, NULL); #endif Index: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h:1.7 xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h:1.9 --- xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h:1.7 Thu Oct 30 12:36:58 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h Thu Mar 16 11:49:59 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h,v 1.7 2003/10/30 17:36:58 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h,v 1.9 2006/03/16 16:49:59 dawes Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -54,7 +54,7 @@ /* r128_driver.c */ extern void R128LoaderRefSymLists - FunctionPrototype((void)); + FunctionPrototype((ModuleDescPtr)); extern Bool R128PreInit FunctionPrototype((ScrnInfoPtr, int)); extern Bool R128ScreenInit Index: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h:1.10 xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h:1.10 Fri Dec 10 11:07:01 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h Fri Oct 14 11:16:37 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h,v 1.10 2004/12/10 16:07:01 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h,v 1.11 2005/10/14 15:16:37 tsi Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -38,7 +38,7 @@ #ifndef _R128_SAREA_H_ #define _R128_SAREA_H_ -#include "Xmd.h" +#include <X11/Xmd.h> /* WARNING: If you change any of these defines, make sure to change the * defines in the kernel file (r128_drm.h) Index: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_version.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/r128_version.h:1.8 xc/programs/Xserver/hw/xfree86/drivers/ati/r128_version.h:1.9 --- xc/programs/Xserver/hw/xfree86/drivers/ati/r128_version.h:1.8 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/r128_version.h Thu Jan 5 13:55:31 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_version.h,v 1.8 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_version.h,v 1.9 2006/01/05 18:55:31 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c:1.32 xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c:1.33 --- xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c:1.32 Sat Mar 20 21:30:18 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c Fri Oct 14 11:16:37 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c,v 1.32 2004/03/21 02:30:18 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c,v 1.33 2005/10/14 15:16:37 tsi Exp $ */ #include "r128.h" #include "r128_reg.h" @@ -11,7 +11,7 @@ #include "xf86.h" #include "dixstruct.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "fourcc.h" #define OFF_DELAY 250 /* milliseconds */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h:1.46 xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h:1.47 --- xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h:1.46 Fri Dec 10 11:07:01 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h Thu Mar 16 11:49:59 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h,v 1.46 2004/12/10 16:07:01 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h,v 1.47 2006/03/16 16:49:59 dawes Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -317,6 +317,7 @@ Bool ddc_bios; Bool ddc1; Bool ddc2; + ModuleDescPtr pDDCModule; I2CBusPtr pI2CBus; CARD32 DDCReg; Index: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c:1.38 xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c:1.40 --- xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c:1.38 Fri Dec 10 11:07:01 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c Sat Jan 28 20:46:52 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c,v 1.38 2004/12/10 16:07:01 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c,v 1.40 2006/01/29 01:46:52 tsi Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -332,8 +332,8 @@ info->CurrentLayout.bitsPerPixel)); OUTREG(RADEON_RB3D_CNTL, 0); -#if defined(__powerpc__) -#if defined(XF86_DRI) +#ifdef __powerpc__ +#ifdef XF86DRI if(!info->directRenderingEnabled) #endif { Index: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c:1.127 xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c:1.132 --- xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c:1.127 Fri Dec 10 11:07:01 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c Thu Mar 16 11:49:59 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v 1.127 2004/12/10 16:07:01 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v 1.132 2006/03/16 16:49:59 dawes Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -246,13 +246,6 @@ NULL }; -#if 0 -static const char *xf8_32bppSymbols[] = { - "xf86Overlay8Plus32Init", - NULL -}; -#endif - static const char *ramdacSymbols[] = { "xf86CreateCursorInfoRec", "xf86DestroyCursorInfoRec", @@ -330,6 +323,7 @@ static const char *vbeSymbols[] = { "VBEInit", "vbeDoEDID", + "vbeFree", NULL }; @@ -346,18 +340,16 @@ NULL }; -void RADEONLoaderRefSymLists(void) +void RADEONLoaderRefSymLists(ModuleDescPtr module) { /* * Tell the loader about symbols from other modules that this module might * refer to. */ - xf86LoaderRefSymLists(vgahwSymbols, + xf86LoaderModRefSymLists(module, + vgahwSymbols, fbSymbols, xaaSymbols, -#if 0 - xf8_32bppSymbols, -#endif ramdacSymbols, #ifdef XF86DRI drmSymbols, @@ -1262,17 +1254,21 @@ else if((pRADEONEnt->MonType1 = RADEONDisplayDDCConnected(pScrn, DDC_VGA, &pRADEONEnt->MonInfo1))); else if((pRADEONEnt->MonType1 = RADEONDisplayDDCConnected(pScrn, DDC_CRT2, &pRADEONEnt->MonInfo1))); else if (pInt10) { - if (xf86LoadSubModule(pScrn, "vbe")) { + pointer pVBEModule; + if ((pVBEModule = xf86LoadVBEModule(pScrn))) { vbeInfoPtr pVbe; pVbe = VBEInit(pInt10, info->pEnt->index); if (pVbe) { for (i = 0; i < 5; i++) { - pRADEONEnt->MonInfo1 = vbeDoEDID(pVbe, NULL); + pRADEONEnt->MonInfo1 = + vbeDoEDID(pVbe, info->pDDCModule); } if (pRADEONEnt->MonInfo1->rawData[0x14] & 0x80) pRADEONEnt->MonType1 = MT_DFP; else pRADEONEnt->MonType1 = MT_CRT; + vbeFree(pVbe); } + xf86UnloadSubModule(pVBEModule); } } else pRADEONEnt->MonType1 = MT_CRT; @@ -2370,22 +2366,22 @@ static void RADEONPreInitDDC(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); - /* vbeInfoPtr pVbe; */ + ModuleDescPtr pModule; info->ddc1 = FALSE; info->ddc_bios = FALSE; - if (!xf86LoadSubModule(pScrn, "ddc")) { + if (!(info->pDDCModule = xf86LoadSubModule(pScrn, "ddc"))) { info->ddc2 = FALSE; } else { - xf86LoaderReqSymLists(ddcSymbols, NULL); + xf86LoaderModReqSymLists(info->pDDCModule, ddcSymbols, NULL); info->ddc2 = TRUE; } /* DDC can use I2C bus */ /* Load I2C if we have the code to use it */ if (info->ddc2) { - if (xf86LoadSubModule(pScrn, "i2c")) { - xf86LoaderReqSymLists(i2cSymbols,NULL); + if ((pModule = xf86LoadSubModule(pScrn, "i2c"))) { + xf86LoaderModReqSymLists(pModule, i2cSymbols,NULL); info->ddc2 = RADEONI2cInit(pScrn); } else info->ddc2 = FALSE; @@ -3337,6 +3333,7 @@ int modesFound; RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); char *s; + ModuleDescPtr pModule; /* This option has two purposes: * @@ -3644,9 +3641,9 @@ xf86SetDpi(pScrn, 0, 0); /* Get ScreenInit function */ - if (!xf86LoadSubModule(pScrn, "fb")) return FALSE; + if (!(pModule = xf86LoadSubModule(pScrn, "fb"))) return FALSE; - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pModule, fbSymbols, NULL); info->CurrentLayout.displayWidth = pScrn->displayWidth; info->CurrentLayout.mode = pScrn->currentMode; @@ -3658,10 +3655,11 @@ static Bool RADEONPreInitCursor(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); + ModuleDescPtr pModule; if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) { - if (!xf86LoadSubModule(pScrn, "ramdac")) return FALSE; - xf86LoaderReqSymLists(ramdacSymbols, NULL); + if (!(pModule = xf86LoadSubModule(pScrn, "ramdac"))) return FALSE; + xf86LoaderModReqSymLists(pModule, ramdacSymbols, NULL); } return TRUE; } @@ -3671,6 +3669,7 @@ { #ifdef XFree86LOADER RADEONInfoPtr info = RADEONPTR(pScrn); + ModuleDescPtr pModule; if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) { int errmaj = 0, errmin = 0; @@ -3678,17 +3677,18 @@ info->xaaReq.majorversion = 1; info->xaaReq.minorversion = 1; - if (!LoadSubModule(pScrn->module, "xaa", NULL, NULL, NULL, - &info->xaaReq, &errmaj, &errmin)) { + if (!(pModule = LoadSubModule(pScrn->module, "xaa", NULL, NULL, NULL, + &info->xaaReq, &errmaj, &errmin))) { info->xaaReq.minorversion = 0; - if (!LoadSubModule(pScrn->module, "xaa", NULL, NULL, NULL, - &info->xaaReq, &errmaj, &errmin)) { + if (!(pModule = LoadSubModule(pScrn->module, "xaa", NULL, NULL, + NULL, + &info->xaaReq, &errmaj, &errmin))) { LoaderErrorMsg(NULL, "xaa", errmaj, errmin); return FALSE; } } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pModule, xaaSymbols, NULL); } #endif @@ -3697,11 +3697,12 @@ static Bool RADEONPreInitInt10(ScrnInfoPtr pScrn, xf86Int10InfoPtr *ppInt10) { +#if !defined(__powerpc__) RADEONInfoPtr info = RADEONPTR(pScrn); + ModuleDescPtr pModule; -#if !defined(__powerpc__) - if (xf86LoadSubModule(pScrn, "int10")) { - xf86LoaderReqSymLists(int10Symbols, NULL); + if ((pModule = xf86LoadSubModule(pScrn, "int10"))) { + xf86LoaderModReqSymLists(pModule, int10Symbols, NULL); xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n"); *ppInt10 = xf86InitInt10(info->pEnt->index); } @@ -3713,6 +3714,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); + ModuleDescPtr pModule; if (xf86ReturnOptValBool(info->Options, OPTION_CP_PIO, FALSE)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forcing CP into PIO mode\n"); @@ -3832,12 +3834,12 @@ if (info->noBackBuffer) { info->allowPageFlip = 0; - } else if (!xf86LoadSubModule(pScrn, "shadowfb")) { + } else if (!(pModule = xf86LoadSubModule(pScrn, "shadowfb"))) { info->allowPageFlip = 0; xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't load shadowfb module:\n"); } else { - xf86LoaderReqSymLists(driShadowFBSymbols, NULL); + xf86LoaderModReqSymLists(pModule, driShadowFBSymbols, NULL); info->allowPageFlip = xf86ReturnOptValBool(info->Options, OPTION_PAGE_FLIP, @@ -3855,10 +3857,14 @@ RADEONProbeDDC(ScrnInfoPtr pScrn, int indx) { vbeInfoPtr pVbe; + ModuleDescPtr pModule; - if (xf86LoadSubModule(pScrn, "vbe")) { + if ((pModule = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pModule, vbeSymbols, NULL); pVbe = VBEInit(NULL,indx); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); + vbeFree(pVbe); + xf86UnloadSubModule(pModule); } } @@ -3869,6 +3875,7 @@ xf86Int10InfoPtr pInt10 = NULL; void *int10_save = NULL; const char *s; + ModuleDescPtr pModule; RADEONTRACE(("RADEONPreInit\n")); if (pScrn->numEntities != 1) return FALSE; @@ -3954,8 +3961,8 @@ return TRUE; } - if (!xf86LoadSubModule(pScrn, "vgahw")) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + if (!(pModule = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; + xf86LoaderModReqSymLists(pModule, vgahwSymbols, NULL); if (!vgaHWGetHWRec(pScrn)) { RADEONFreeRec(pScrn); goto fail2; @@ -4016,8 +4023,8 @@ if (xf86ReturnOptValBool(info->Options, OPTION_FBDEV, FALSE)) { /* check for Linux framebuffer device */ - if (xf86LoadSubModule(pScrn, "fbdevhw")) { - xf86LoaderReqSymLists(fbdevHWSymbols, NULL); + if ((pModule = xf86LoadSubModule(pScrn, "fbdevhw"))) { + xf86LoaderModReqSymLists(pModule, fbdevHWSymbols, NULL); if (fbdevHWInit(pScrn, info->PciInfo, NULL)) { pScrn->ValidMode = fbdevHWValidMode; Index: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_misc.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_misc.c:1.9 xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_misc.c:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_misc.c:1.9 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_misc.c Thu Mar 16 11:50:00 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_misc.c,v 1.9 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_misc.c,v 1.12 2006/03/16 16:50:00 dawes Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -46,6 +46,8 @@ {0, 0, 0, 0} }; +pointer RADEONModule = NULL; + /* * RADEONSetup -- * @@ -54,7 +56,7 @@ static pointer RADEONSetup ( - pointer Module, + ModuleDescPtr Module, pointer Options, int *ErrorMajor, int *ErrorMinor @@ -67,7 +69,7 @@ if (!xf86ServerIsOnlyDetecting() && !LoaderSymbol(ATI_NAME)) xf86LoadOneModule(ATI_DRIVER_NAME, Options); - RADEONLoaderRefSymLists(); + RADEONLoaderRefSymLists(Module); Inited = TRUE; } @@ -83,4 +85,19 @@ NULL }; +const char *radeonExportedSymbols[] = { + "RADEONPreInit", + "RADEONScreenInit", + "RADEONSwitchMode", + "RADEONAdjustFrame", + "RADEONEnterVT", + "RADEONLeaveVT", + "RADEONFreeScreen", + "RADEONValidMode", + "RADEONOptions", + "RADEONModule", + "RADEONHandleMessage", + NULL +}; + #endif /* XFree86LOADER */ Index: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c:1.31 xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c:1.34 --- xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c:1.31 Mon Nov 10 13:41:23 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c Thu Mar 16 11:50:00 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c,v 1.31 2003/11/10 18:41:23 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c,v 1.34 2006/03/16 16:50:00 dawes Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -46,7 +46,7 @@ #include "xf86.h" #include "xf86_ansic.h" #define _XF86MISC_SERVER_ -#include "xf86misc.h" +#include <X11/extensions/xf86misc.h> #include "xf86Resources.h" #ifdef XFree86LOADER @@ -307,14 +307,15 @@ RADEONPciChipsets, 0, 0, 0, 0, 0))) { #ifdef XFree86LOADER - if (!xf86LoadSubModule(pScrn, "radeon")) { + ModuleDescPtr pModule; + if (!(pModule = xf86LoadSubModule(pScrn, "radeon"))) { xf86Msg(X_ERROR, RADEON_NAME ": Failed to load \"radeon\" module.\n"); xf86DeleteScreen(pScrn->scrnIndex, 0); continue; } - xf86LoaderReqSymLists(RADEONSymbols, NULL); + xf86LoaderModReqSymLists(pModule, RADEONSymbols, NULL); #endif pScrn->driverVersion = RADEON_VERSION_CURRENT; Index: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h:1.14 xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h:1.17 --- xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h:1.14 Mon Nov 10 13:41:23 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h Thu Mar 16 11:50:00 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h,v 1.14 2003/11/10 18:41:23 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h,v 1.17 2006/03/16 16:50:00 dawes Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -43,7 +43,7 @@ #include "xf86DDC.h" #define _XF86MISC_SERVER_ -#include "xf86misc.h" +#include <X11/extensions/xf86misc.h> typedef struct { @@ -80,7 +80,7 @@ /* radeon_driver.c */ extern void RADEONLoaderRefSymLists - FunctionPrototype((void)); + FunctionPrototype((ModuleDescPtr)); extern Bool RADEONPreInit FunctionPrototype((ScrnInfoPtr, int)); extern Bool RADEONScreenInit Index: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h:1.12 xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h:1.13 --- xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h:1.12 Fri Dec 31 11:07:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h Thu Jan 5 13:55:31 2006 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h,v 1.12 2004/12/31 16:07:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_version.h,v 1.13 2006/01/05 18:55:31 tsi Exp $ */ /* - * Copyright 2000 through 2005 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2006 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that Index: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c:1.31 xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c:1.32 --- xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c:1.31 Mon Nov 10 13:41:23 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c Fri Oct 14 11:16:37 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c,v 1.31 2003/11/10 18:41:23 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c,v 1.32 2005/10/14 15:16:37 tsi Exp $ */ #include "radeon.h" #include "radeon_macros.h" @@ -8,7 +8,7 @@ #include "xf86.h" #include "dixstruct.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "fourcc.h" #define OFF_DELAY 250 /* milliseconds */ Index: xc/programs/Xserver/hw/xfree86/drivers/chips/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/chips/Imakefile:1.34 xc/programs/Xserver/hw/xfree86/drivers/chips/Imakefile:1.37 --- xc/programs/Xserver/hw/xfree86/drivers/chips/Imakefile:1.34 Sat Nov 27 21:13:46 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/chips/Imakefile Fri Oct 14 11:16:38 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/Imakefile,v 1.34 2004/11/28 02:13:46 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/Imakefile,v 1.37 2005/10/14 15:16:38 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -64,20 +64,17 @@ OBJS = ct_driver.o ct_bank.o ct_accel.o ct_accelmm.o ct_accelhi.o ct_cursor.o \ ct_ddc.o ct_regs.o ct_dga.o ct_shadow.o ct_video.o -DEFINES = -DPSZ=8 - #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(XF86SRC)/fbdevhw \ - -I$(SERVERSRC)/fb -I$(XF86SRC)/vgahw -I$(SERVERSRC)/include \ - -I$(SERVERSRC)/mi -I$(SERVERSRC)/cfb -I$(SERVERSRC)/mfb \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/fb -I$(XF86SRC)/vgahw -I$(SERVERSRC)/include \ + -I$(SERVERSRC)/mi -I$(SERVERSRC)/mfb \ -I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp -I$(SERVERSRC)/Xext \ - -I$(XINCLUDESRC) -I$(XF86SRC)/xaa -I$(FONTINCSRC) \ - -I$(XF86SRC)/ramdac -I$(XF86SRC)/rac -I$(XF86SRC)/ddc \ - -I$(XF86SRC)/i2c -I$(XF86SRC)/xf24_32bpp -I$(XF86SRC)/shadowfb \ + -I$(XF86SRC)/xaa -I$(XF86SRC)/ramdac -I$(XF86SRC)/rac \ + -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c -I$(XF86SRC)/shadowfb \ -I$(XF86SRC)/xf8_16bpp -I$(XF86SRC)/int10 \ - -I$(XF86SRC)/vbe -I$(EXTINCSRC) -I$(SERVERSRC)/render + -I$(XF86SRC)/vbe -I$(SERVERSRC)/render #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BlitMM.h diff -u xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BlitMM.h:1.5 xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BlitMM.h:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BlitMM.h:1.5 Mon Nov 25 09:04:58 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BlitMM.h Mon Jan 9 09:59:53 2006 @@ -1,10 +1,4 @@ -/* $XConsortium: ct_BlitMM.h /main/2 1996/10/25 10:28:31 kaleb $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BlitMM.h,v 1.5 2002/11/25 14:04:58 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BlitMM.h,v 1.6 2006/01/09 14:59:53 dawes Exp $ */ /* Definitions for the Chips and Technology BitBLT engine communication. */ /* These are done using Memory Mapped IO, of the registers */ Index: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_Blitter.h diff -u xc/programs/Xserver/hw/xfree86/drivers/chips/ct_Blitter.h:1.4 xc/programs/Xserver/hw/xfree86/drivers/chips/ct_Blitter.h:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/chips/ct_Blitter.h:1.4 Fri Jan 25 16:55:58 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/chips/ct_Blitter.h Mon Jan 9 09:59:53 2006 @@ -1,10 +1,4 @@ -/* $XConsortium: ct_Blitter.h /main/2 1996/10/25 10:28:37 kaleb $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_Blitter.h,v 1.4 2002/01/25 21:55:58 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_Blitter.h,v 1.5 2006/01/09 14:59:53 dawes Exp $ */ /* Definitions for the Chips and Technology BitBLT engine communication. */ /* registers */ Index: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BltHiQV.h diff -u xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BltHiQV.h:1.12 xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BltHiQV.h:1.13 --- xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BltHiQV.h:1.12 Mon Nov 25 09:04:58 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BltHiQV.h Mon Jan 9 09:59:53 2006 @@ -1,10 +1,4 @@ -/* $XConsortium: ct_BltHiQV.h /main/2 1996/10/25 10:28:43 kaleb $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BltHiQV.h,v 1.12 2002/11/25 14:04:58 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BltHiQV.h,v 1.13 2006/01/09 14:59:53 dawes Exp $ */ /* Definitions for the Chips and Technology BitBLT engine communication. */ /* These are done using Memory Mapped IO, of the registers */ Index: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_bank.c diff -u xc/programs/Xserver/hw/xfree86/drivers/chips/ct_bank.c:1.7 xc/programs/Xserver/hw/xfree86/drivers/chips/ct_bank.c:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/chips/ct_bank.c:1.7 Wed Dec 31 01:14:36 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/chips/ct_bank.c Sun Aug 28 13:47:59 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_bank.c,v 1.7 2003/12/31 06:14:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_bank.c,v 1.8 2005/08/28 17:47:59 tsi Exp $ */ /* * Copyright 1997 @@ -28,7 +28,6 @@ * negligence, tort, under statute, in equity, at law or otherwise, even if * advised of the possibility of such damage. */ -#define PSZ 8 /* * Define DIRECT_REGISTER_ACCESS if you want to bypass the wrapped register Index: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c:1.135 xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c:1.138 --- xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c:1.135 Fri Nov 26 08:44:59 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c Thu Mar 16 11:50:00 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c,v 1.135 2004/11/26 13:44:59 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c,v 1.138 2006/03/16 16:50:00 dawes Exp $ */ /* * Copyright 1993 by Jon Block <block@frc.com> @@ -108,7 +108,6 @@ #include "fb.h" #include "cfb8_16.h" - /* Needed for the 1 and 4 bpp framebuffers */ #include "xf1bpp.h" #include "xf4bpp.h" @@ -655,8 +654,8 @@ * List of symbols from other modules that this module references. This * list is used to tell the loader that it is OK for symbols here to be * unresolved providing that it hasn't been told that they haven't been - * told that they are essential via a call to xf86LoaderReqSymbols() or - * xf86LoaderReqSymLists(). The purpose is this is to avoid warnings about + * told that they are essential via a call to xf86LoaderModReqSymbols() or + * xf86LoaderModReqSymLists(). The purpose is this is to avoid warnings about * unresolved symbols that are not required. */ @@ -763,7 +762,7 @@ XF86ModuleData chipsModuleData = { &chipsVersRec, chipsSetup, NULL }; static pointer -chipsSetup(pointer module, pointer opts, int *errmaj, int *errmin) +chipsSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -780,9 +779,9 @@ * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(vgahwSymbols, miscfbSymbols, fbSymbols, xaaSymbols, - ramdacSymbols, ddcSymbols, i2cSymbols, - shadowSymbols, vbeSymbols, NULL); + LoaderModRefSymLists(module, vgahwSymbols, miscfbSymbols, fbSymbols, + xaaSymbols, ramdacSymbols, ddcSymbols, + i2cSymbols, shadowSymbols, vbeSymbols, NULL); /* * The return value must be non-NULL on success even though there @@ -819,9 +818,17 @@ static void CHIPSFreeRec(ScrnInfoPtr pScrn) { - if (pScrn->driverPrivate == NULL) + CHIPSPtr cPtr = CHIPSPTR(pScrn); + + if (!cPtr) return; - xfree(pScrn->driverPrivate); + + cPtr = CHIPSPTR(pScrn); + if (cPtr->pVbe) { + vbeFree(cPtr->pVbe); + cPtr->pVbe = NULL; + } + xfree(cPtr); pScrn->driverPrivate = NULL; } @@ -1065,13 +1072,14 @@ CHIPSPtr cPtr; Bool res = FALSE; CHIPSEntPtr cPtrEnt = NULL; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) return FALSE; /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* Allocate the ChipsRec driverPrivate */ if (!CHIPSGetRec(pScrn)) { @@ -1110,9 +1118,9 @@ } /* INT10 */ #if 0 - if (xf86LoadSubModule(pScrn, "int10")) { + if ((pMod = xf86LoadSubModule(pScrn, "int10"))) { xf86Int10InfoPtr pInt; - xf86LoaderReqSymLists(int10Symbols, NULL); + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); #if 1 xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n"); pInt = xf86InitInt10(cPtr->pEnt->index); @@ -1121,8 +1129,8 @@ } #endif - if (xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols, NULL); + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); cPtr->pVbe = VBEInit(NULL,cPtr->pEnt->index); } @@ -1203,8 +1211,7 @@ chipsUnmapMem(pScrn); if (!res) { - vbeFree(cPtr->pVbe); - cPtr->pVbe = NULL; + CHIPSFreeRec(pScrn); return FALSE; } @@ -1243,8 +1250,6 @@ LOOKUP_BEST_REFRESH); if (i == -1) { - vbeFree(cPtr->pVbe); - cPtr->pVbe = NULL; CHIPSFreeRec(pScrn); return FALSE; } @@ -1259,8 +1264,6 @@ if (i == 0 || pScrn->modes == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); - vbeFree(cPtr->pVbe); - cPtr->pVbe = NULL; CHIPSFreeRec(pScrn); return FALSE; } @@ -1287,73 +1290,59 @@ /* Load bpp-specific modules */ switch (pScrn->bitsPerPixel) { case 1: - if (xf86LoadSubModule(pScrn, "xf1bpp") == NULL) { - vbeFree(cPtr->pVbe); - cPtr->pVbe = NULL; + if (!(pMod = xf86LoadSubModule(pScrn, "xf1bpp"))) { CHIPSFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymbols("xf1bppScreenInit", NULL); + xf86LoaderModReqSymbols(pMod, "xf1bppScreenInit", NULL); break; case 4: - if (xf86LoadSubModule(pScrn, "xf4bpp") == NULL) { - vbeFree(cPtr->pVbe); - cPtr->pVbe = NULL; + if (!(pMod = xf86LoadSubModule(pScrn, "xf4bpp"))) { CHIPSFreeRec(pScrn); return FALSE; - } - xf86LoaderReqSymbols("xf4bppScreenInit", NULL); + } + xf86LoaderModReqSymbols(pMod, "xf4bppScreenInit", NULL); break; case 16: if (cPtr->Flags & ChipsOverlay8plus16) { - if (xf86LoadSubModule(pScrn, "xf8_16bpp") == NULL) { - vbeFree(cPtr->pVbe); - cPtr->pVbe = NULL; + if (!(pMod = xf86LoadSubModule(pScrn, "xf8_16bpp"))) { CHIPSFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymbols("cfb8_16bppScreenInit", NULL); + xf86LoaderModReqSymbols(pMod, "cfb8_16bppScreenInit", NULL); break; } default: - if (xf86LoadSubModule(pScrn, "fb") == NULL) { - vbeFree(cPtr->pVbe); - cPtr->pVbe = NULL; + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { CHIPSFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); break; } if (cPtr->Flags & ChipsAccelSupport) { - if (!xf86LoadSubModule(pScrn, "xaa")) { - vbeFree(cPtr->pVbe); - cPtr->pVbe = NULL; + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { CHIPSFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } if (cPtr->Flags & ChipsShadowFB) { - if (!xf86LoadSubModule(pScrn, "shadowfb")) { - vbeFree(cPtr->pVbe); - cPtr->pVbe = NULL; + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { CHIPSFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } if (cPtr->Accel.UseHWCursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { - vbeFree(cPtr->pVbe); - cPtr->pVbe = NULL; + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { CHIPSFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } if (cPtr->Flags & ChipsLinearSupport) @@ -1361,8 +1350,6 @@ if (cPtr->MMIOBaseVGA) xf86SetOperatingState(resVgaIo, cPtr->pEnt->index, ResDisableOpr); - vbeFree(cPtr->pVbe); - cPtr->pVbe = NULL; return TRUE; } @@ -1377,7 +1364,7 @@ double real; int val, indx; const char *s; - pointer pVbeModule = NULL; + ModuleDescPtr pDDCModule = NULL, pMod; vgaHWPtr hwp; CHIPSPtr cPtr = CHIPSPTR(pScrn); @@ -1884,23 +1871,23 @@ * Do DDC here: if VESA BIOS detects an external monitor it * might switch. SetPanelType() will detect this. */ - if ((pVbeModule = xf86LoadSubModule(pScrn, "ddc"))) { + if ((pDDCModule = xf86LoadSubModule(pScrn, "ddc"))) { Bool ddc_done = FALSE; xf86MonPtr pMon; - xf86LoaderReqSymLists(ddcSymbols, NULL); + xf86LoaderModReqSymLists(pDDCModule, ddcSymbols, NULL); if (cPtr->pVbe) { if ((pMon - = xf86PrintEDID(vbeDoEDID(cPtr->pVbe, pVbeModule))) != NULL) { + = xf86PrintEDID(vbeDoEDID(cPtr->pVbe, pDDCModule))) != NULL) { ddc_done = TRUE; xf86SetDDCproperties(pScrn,pMon); } } if (!ddc_done) - if (xf86LoadSubModule(pScrn, "i2c")) { - xf86LoaderReqSymLists(i2cSymbols,NULL); + if ((pMod = xf86LoadSubModule(pScrn, "i2c"))) { + xf86LoaderModReqSymLists(pMod, i2cSymbols,NULL); if (chips_i2cInit(pScrn)) { if ((pMon = xf86PrintEDID(xf86DoEDID_DDC2(pScrn->scrnIndex, @@ -2418,6 +2405,7 @@ Bool useLinear = FALSE; char *s; resRange linearRes[] = { {ResExcMemBlock|ResBios|ResBus,0,0},_END }; + ModuleDescPtr pMod; /* Set pScrn->monitor */ pScrn->monitor = pScrn->confScreen->monitor; @@ -2731,7 +2719,7 @@ } linearRes[0].type = ResExcIoSparse | ResBios | ResBus; linearRes[0].rBase = cPtr->Regs32[0]; - linearRes[0].rMask = 0x83FC; + linearRes[0].rMask = (int)0xFFFF83FC; if (xf86RegisterResources(cPtr->pEnt->index,linearRes,ResNone)) { if (cPtr->Flags & ChipsAccelSupport) { cPtr->Flags &= ~ChipsAccelSupport; @@ -2858,10 +2846,10 @@ (float)(cPtr->MaxClock / 1000.)); } - if (xf86LoadSubModule(pScrn, "ddc")) { - xf86LoaderReqSymLists(ddcSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "ddc"))) { + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); if (cPtr->pVbe) - xf86SetDDCproperties(pScrn,xf86PrintEDID(vbeDoEDID(cPtr->pVbe, NULL))); + xf86SetDDCproperties(pScrn,xf86PrintEDID(vbeDoEDID(cPtr->pVbe, pMod))); } return TRUE; } @@ -2879,6 +2867,7 @@ Bool useLinear = FALSE; char *s; resRange linearRes[] = { {ResExcMemBlock|ResBios|ResBus,0,0},_END }; + ModuleDescPtr pMod; /* Set pScrn->monitor */ pScrn->monitor = pScrn->confScreen->monitor; @@ -3407,7 +3396,7 @@ } linearRes[0].type = ResExcIoSparse | ResBios | ResBus; linearRes[0].rBase = cPtr->Regs32[0]; - linearRes[0].rMask = 0x83FC; + linearRes[0].rMask = (int)0xFFFF83FC; if (xf86RegisterResources(cPtr->pEnt->index,linearRes,ResNone)) { if (cPtr->Flags & ChipsAccelSupport) { cPtr->Flags &= ~ChipsAccelSupport; @@ -3631,10 +3620,10 @@ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Memory clock option not supported for this chipset\n"); - if (xf86LoadSubModule(pScrn, "ddc")) { - xf86LoaderReqSymLists(ddcSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "ddc"))) { + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); if (cPtr->pVbe) - xf86SetDDCproperties(pScrn,xf86PrintEDID(vbeDoEDID(cPtr->pVbe, NULL))); + xf86SetDDCproperties(pScrn,xf86PrintEDID(vbeDoEDID(cPtr->pVbe, pMod))); } return TRUE; } @@ -3931,7 +3920,7 @@ * function. If not, the visuals will need to be setup before calling * a fb ScreenInit() function and fixed up after. * - * For most PC hardware at depths >= 8, the defaults that cfb uses + * For most PC hardware at depths >= 8, the defaults that fb uses * are not appropriate. In this driver, we fixup the visuals after. */ Index: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h diff -u xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h:1.36 xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h:1.37 --- xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h:1.36 Mon Mar 29 11:25:16 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h Mon Jan 9 09:59:53 2006 @@ -1,4 +1,5 @@ -/* $XConsortium: ct_driver.h /main/3 1996/10/27 11:49:29 kaleb $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h,v 1.37 2006/01/09 14:59:53 dawes Exp $ */ + /* * Modified 1996 by Egbert Eich <eich@xfree86.org> * Modified 1996 by David Bateman <dbateman@club-internet.fr> @@ -22,9 +23,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h,v 1.36 2004/03/29 16:25:16 tsi Exp $ */ - - #ifndef _CT_DRIVER_H_ #define _CT_DRIVER_H_ Index: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c diff -u xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c:1.9 xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c:1.10 --- xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c:1.9 Mon Nov 3 00:11:09 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c Sun Mar 27 21:51:06 2005 @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c,v 1.9 2003/11/03 05:11:09 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c,v 1.10 2005/03/28 02:51:06 dawes Exp $ */ /* * The functions in this file are used to read/write the C&T extension register @@ -113,7 +113,7 @@ /* * PIO Access to the C&T extension registers */ -void +static void chipsStdWriteXR(CHIPSPtr cPtr, CARD8 index, CARD8 value) { outb(cPtr->PIOBase + CHIPS_XR_INDEX, index); Index: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c:1.18 xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c:1.19 --- xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c:1.18 Mon Mar 29 11:25:16 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c Fri Oct 14 11:16:38 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c,v 1.18 2004/03/29 16:25:16 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c,v 1.19 2005/10/14 15:16:38 tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -11,7 +11,7 @@ #include "regionstr.h" #include "ct_driver.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "xaa.h" #include "dixstruct.h" #include "fourcc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/chips/util/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/chips/util/Imakefile:1.4 xc/programs/Xserver/hw/xfree86/drivers/chips/util/Imakefile:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/chips/util/Imakefile:1.4 Sat Nov 27 21:13:46 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/chips/util/Imakefile Fri Oct 14 11:16:38 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/Imakefile,v 1.4 2004/11/28 02:13:46 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/Imakefile,v 1.5 2005/10/14 15:16:38 tsi Exp $ #include <Server.tmpl> @@ -13,7 +13,7 @@ ProgramTargetName(modClock) \ ProgramTargetName(memClock) INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(XF86SRC)/dummylib \ - -I$(SERVERSRC)/include -I$(XINCLUDESRC) + -I$(SERVERSRC)/include LOCALLIBS = $(XF86OSSRC)/libxf86_os.a $(XF86SRC)/dummylib/libdummy.a LOCAL_LDFLAGS = -L$(XF86OSSRC) -lxf86_os -L$(XF86SRC)/dummylib -ldummy \ $(SERVEREXTRASYSLIBS) MathLibrary Index: xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c diff -u xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c:1.11 xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c:1.11 Sat Nov 27 21:13:46 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c Mon Jan 9 09:59:53 2006 @@ -1,10 +1,4 @@ -/* $XConsortium: dRegs.c /main/2 1996/10/27 11:49:40 kaleb $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c,v 1.11 2004/11/28 02:13:46 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c,v 1.12 2006/01/09 14:59:53 dawes Exp $ */ #include "compiler.h" #include "xf86_OSproc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/chips/util/mRegs.c diff -u xc/programs/Xserver/hw/xfree86/drivers/chips/util/mRegs.c:1.7 xc/programs/Xserver/hw/xfree86/drivers/chips/util/mRegs.c:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/chips/util/mRegs.c:1.7 Sat Nov 27 21:13:46 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/chips/util/mRegs.c Mon Jan 9 09:59:53 2006 @@ -1,10 +1,4 @@ -/* $XConsortium: mRegs.c /main/2 1996/10/27 11:49:43 kaleb $ */ - - - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/mRegs.c,v 1.7 2004/11/28 02:13:46 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/mRegs.c,v 1.8 2006/01/09 14:59:53 dawes Exp $ */ #include "compiler.h" #include "xf86_OSproc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/cirrus/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/cirrus/Imakefile:1.35 xc/programs/Xserver/hw/xfree86/drivers/cirrus/Imakefile:1.37 --- xc/programs/Xserver/hw/xfree86/drivers/cirrus/Imakefile:1.35 Mon May 31 20:17:00 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/cirrus/Imakefile Fri Oct 14 11:16:38 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/Imakefile,v 1.35 2004/06/01 00:17:00 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/Imakefile,v 1.37 2005/10/14 15:16:38 tsi Exp $ XCOMM XCOMM This is an Imakefile for the Cirrus Logic driver. XCOMM @@ -63,20 +63,18 @@ OBJS = $(COBJS) $(AOBJS) $(LOBJS) #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(XF86SRC)/xf4bpp -I$(XF86SRC)/xf1bpp \ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa \ -I$(XF86SRC)/ramdac -I$(XF86SRC)/i2c \ -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/ddc \ - -I$(SERVERSRC)/Xext -I$(XF86SRC)/xf24_32bpp \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include \ - -I$(XINCLUDESRC) -I$(EXTINCSRC) \ - -I$(XF86OSSRC)/int10 -I$(XF86SRC)/shadowfb \ - -I$(SERVERSRC)/render -I$(XF86SRC)/vbe + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/include \ + -I$(XF86OSSRC)/int10 -I$(XF86SRC)/shadowfb \ + -I$(SERVERSRC)/render -I$(XF86SRC)/vbe #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c:1.39 xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c:1.41 --- xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c:1.39 Thu Feb 17 21:55:05 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c Thu Mar 16 11:50:01 2006 @@ -11,7 +11,7 @@ * Guy DESBIEF */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c,v 1.39 2005/02/18 02:55:05 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c,v 1.41 2006/03/16 16:50:01 dawes Exp $ */ /* All drivers should typically include these */ #include "xf86.h" @@ -66,7 +66,7 @@ #include "alp.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #ifdef ALPPROBEI2C /* For debugging... should go away. */ @@ -153,8 +153,8 @@ * List of symbols from other modules that this module references. This * list is used to tell the loader that it is OK for symbols here to be * unresolved providing that it hasn't been told that they haven't been - * told that they are essential via a call to xf86LoaderReqSymbols() or - * xf86LoaderReqSymLists(). The purpose is this is to avoid warnings about + * told that they are essential via a call to xf86LoaderModReqSymbols() or + * xf86LoaderModReqSymLists(). The purpose is this is to avoid warnings about * unresolved symbols that are not required. */ @@ -258,14 +258,15 @@ XF86ModuleData cirrus_alpineModuleData = { &alpVersRec, alpSetup, NULL }; static pointer -alpSetup(pointer module, pointer opts, int *errmaj, int *errmin) +alpSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; if (!setupDone) { setupDone = TRUE; - LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, - miscfbSymbols, ramdacSymbols,int10Symbols, - ddcSymbols, i2cSymbols, shadowSymbols, NULL); + LoaderModRefSymLists(module, vgahwSymbols, fbSymbols, + xaaSymbols, miscfbSymbols, ramdacSymbols, + int10Symbols, ddcSymbols, i2cSymbols, + shadowSymbols, NULL); } return (pointer)1; } @@ -528,6 +529,7 @@ ClockRangePtr clockRanges; char *s; xf86Int10InfoPtr pInt = NULL; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) { cirProbeDDC( pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index ); @@ -542,10 +544,10 @@ if (pScrn->numEntities != 1) return FALSE; - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* * Allocate a vgaHWRec @@ -577,8 +579,8 @@ pCir->PciInfo->device, pCir->PciInfo->func); - if (!xf86IsPc98() && xf86LoadSubModule(pScrn, "int10")) { - xf86LoaderReqSymLists(int10Symbols,NULL); + if (!xf86IsPc98() && (pMod = xf86LoadSubModule(pScrn, "int10"))) { + xf86LoaderModReqSymLists(pMod, int10Symbols,NULL); xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n"); pInt = xf86InitInt10(pCir->pEnt->index); xf86FreeInt10(pInt); @@ -798,17 +800,17 @@ return FALSE; } - if (!xf86LoadSubModule(pScrn, "i2c")) { + if (!(pMod = xf86LoadSubModule(pScrn, "i2c"))) { AlpFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(i2cSymbols,NULL); + xf86LoaderModReqSymLists(pMod, i2cSymbols,NULL); - if (!xf86LoadSubModule(pScrn, "ddc")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ddc"))) { AlpFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ddcSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); if(!AlpI2CInit(pScrn)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -1102,55 +1104,55 @@ /* Load bpp-specific modules */ switch (pScrn->bitsPerPixel) { case 1: - if (xf86LoadSubModule(pScrn, "xf1bpp") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "xf1bpp"))) { AlpFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymbols("xf1bppScreenInit",NULL); + xf86LoaderModReqSymbols(pMod, "xf1bppScreenInit", NULL); break; case 4: - if (xf86LoadSubModule(pScrn, "xf4bpp") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "xf4bpp"))) { AlpFreeRec(pScrn); return FALSE; - } - xf86LoaderReqSymbols("xf4bppScreenInit",NULL); + } + xf86LoaderModReqSymbols(pMod, "xf4bppScreenInit",NULL); break; case 8: case 16: case 24: case 32: - if (xf86LoadSubModule(pScrn, "fb") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { AlpFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); break; } /* Load XAA if needed */ if (!pCir->NoAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { AlpFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } /* Load ramdac if needed */ if (pCir->HWCursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { AlpFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } if (pCir->shadowFB) { - if (!xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { AlpFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } return TRUE; Index: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c:1.70 xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c:1.72 --- xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c:1.70 Mon Jun 7 21:28:56 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c Thu Mar 16 11:50:02 2006 @@ -11,7 +11,7 @@ * Guy DESBIEF */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c,v 1.70 2004/06/08 01:28:56 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c,v 1.72 2006/03/16 16:50:02 dawes Exp $ */ /* All drivers should typically include these */ #include "xf86.h" @@ -114,8 +114,8 @@ * List of symbols from other modules that this module references. This * list is used to tell the loader that it is OK for symbols here to be * unresolved providing that it hasn't been told that they haven't been - * told that they are essential via a call to xf86LoaderReqSymbols() or - * xf86LoaderReqSymLists(). The purpose of this is to avoid warnings about + * told that they are essential via a call to xf86LoaderModReqSymbols() or + * xf86LoaderModReqSymLists(). The purpose of this is to avoid warnings about * unresolved symbols that are not required. */ @@ -162,7 +162,7 @@ XF86ModuleData cirrusModuleData = { &cirVersRec, cirSetup, NULL }; static pointer -cirSetup(pointer module, pointer opts, int *errmaj, int *errmin) +cirSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -172,7 +172,8 @@ setupDone = TRUE; xf86AddDriver(&CIRRUS, module, 0); - LoaderRefSymLists(alpSymbols, lgSymbols, vbeSymbols, NULL); + LoaderModRefSymLists(module, alpSymbols, lgSymbols, + vbeSymbols, NULL); return (pointer)1; } if (errmaj) *errmaj = LDR_ONCEONLY; @@ -224,6 +225,7 @@ Bool foundScreen = FALSE; ScrnInfoPtr (*subProbe)(int entity); ScrnInfoPtr pScrn; + ModuleDescPtr pMod; #ifdef CIR_DEBUG ErrorF("CirProbe\n"); @@ -237,14 +239,14 @@ if (flags & PROBE_DETECT) { if (!lg_loaded) { - if (xf86LoadDrvSubModule(drv, "cirrus_laguna")) { - xf86LoaderReqSymLists(lgSymbols, NULL); + if ((pMod = xf86LoadDrvSubModule(drv, "cirrus_laguna"))) { + xf86LoaderModReqSymLists(pMod, lgSymbols, NULL); lg_loaded = TRUE; } } if (!alp_loaded) { - if (xf86LoadDrvSubModule(drv, "cirrus_alpine")) { - xf86LoaderReqSymLists(alpSymbols, NULL); + if ((pMod = xf86LoadDrvSubModule(drv, "cirrus_alpine"))) { + xf86LoaderModReqSymLists(pMod, alpSymbols, NULL); alp_loaded = TRUE; } } @@ -285,17 +287,17 @@ pPci->chipType == PCI_CHIP_GD5465)) { if (!lg_loaded) { - if (!xf86LoadDrvSubModule(drv, "cirrus_laguna")) + if (!(pMod = xf86LoadDrvSubModule(drv, "cirrus_laguna"))) continue; - xf86LoaderReqSymLists(lgSymbols, NULL); + xf86LoaderModReqSymLists(pMod, lgSymbols, NULL); lg_loaded = TRUE; } subProbe = LgProbe; } else { if (!alp_loaded) { - if (!xf86LoadDrvSubModule(drv, "cirrus_alpine")) + if (!(pMod = xf86LoadDrvSubModule(drv, "cirrus_alpine"))) continue; - xf86LoaderReqSymLists(alpSymbols, NULL); + xf86LoaderModReqSymLists(pMod, alpSymbols, NULL); alp_loaded = TRUE; } subProbe = AlpProbe; @@ -403,11 +405,13 @@ cirProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; + ModuleDescPtr pMod; - if (xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols,NULL); + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols,NULL); pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } Index: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c:1.52 xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c:1.54 --- xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c:1.52 Thu Feb 17 21:55:07 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c Thu Mar 16 11:50:02 2006 @@ -13,7 +13,7 @@ * David Dawes, Andrew E. Mileski, Leonard N. Zubkoff, * Guy DESBIEF, Itai Nahshon. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c,v 1.52 2005/02/18 02:55:07 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c,v 1.54 2006/03/16 16:50:02 dawes Exp $ */ #define EXPERIMENTAL @@ -63,7 +63,7 @@ #include "lg.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> /* * Forward definitions for the functions that make up the driver. @@ -162,8 +162,8 @@ * List of symbols from other modules that this module references. This * list is used to tell the loader that it is OK for symbols here to be * unresolved providing that it hasn't been told that they haven't been - * told that they are essential via a call to xf86LoaderReqSymbols() or - * xf86LoaderReqSymLists(). The purpose is this is to avoid warnings about + * told that they are essential via a call to xf86LoaderModReqSymbols() or + * xf86LoaderModReqSymLists(). The purpose is this is to avoid warnings about * unresolved symbols that are not required. */ @@ -262,15 +262,15 @@ XF86ModuleData cirrus_lagunaModuleData = { &lgVersRec, lgSetup, NULL }; static pointer -lgSetup(pointer module, pointer opts, int *errmaj, int *errmin) +lgSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; if (!setupDone) { setupDone = TRUE; - LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, - ramdacSymbols, ddcSymbols, i2cSymbols, - int10Symbols, NULL); + LoaderModRefSymLists(module, vgahwSymbols, fbSymbols, xaaSymbols, + ramdacSymbols, ddcSymbols, i2cSymbols, + int10Symbols, NULL); } return (pointer)1; } @@ -406,6 +406,7 @@ ClockRangePtr clockRanges; int fbPCIReg, ioPCIReg; char *s; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) { cirProbeDDC( pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index ); @@ -421,10 +422,10 @@ return FALSE; /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* * Allocate a vgaHWRec @@ -455,9 +456,9 @@ pCir->PciInfo->device, pCir->PciInfo->func); - if (xf86LoadSubModule(pScrn, "int10")) { + if ((pMod = xf86LoadSubModule(pScrn, "int10"))) { xf86Int10InfoPtr int10InfoPtr; - xf86LoaderReqSymLists(int10Symbols, NULL); + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); int10InfoPtr = xf86InitInt10(pCir->pEnt->index); @@ -656,18 +657,18 @@ return FALSE; } - if (!xf86LoadSubModule(pScrn, "ddc")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ddc"))) { LgFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ddcSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); #if LGuseI2C - if (!xf86LoadSubModule(pScrn, "i2c")) { + if (!(pMod = xf86LoadSubModule(pScrn, "i2c"))) { LgFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(i2cSymbols, NULL); + xf86LoaderModReqSymLists(pMod, i2cSymbols, NULL); #endif /* Read and print the monitor DDC information */ @@ -856,38 +857,38 @@ case 16: case 24: case 32: - if (xf86LoadSubModule(pScrn, "fb") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { LgFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); break; } /* Load XAA if needed */ if (!pCir->NoAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { LgFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } /* Load ramdac if needed */ if (pCir->HWCursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { LgFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } if (pCir->shadowFB) { - if (!xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { LgFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } return TRUE; Index: xc/programs/Xserver/hw/xfree86/drivers/cyrix/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/cyrix/Imakefile:1.11 xc/programs/Xserver/hw/xfree86/drivers/cyrix/Imakefile:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/cyrix/Imakefile:1.11 Mon May 31 20:17:00 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/cyrix/Imakefile Fri Oct 14 11:16:39 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/Imakefile,v 1.11 2004/06/01 00:17:00 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/Imakefile,v 1.12 2005/10/14 15:16:39 tsi Exp $ XCOMM XCOMM This is an Imakefile for the CYRIX driver. XCOMM @@ -56,15 +56,14 @@ OBJS = cyrix_driver.o cyrix_accel.o cyrix_bank.o cyrix_helper.o cyrix_shadow.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(XF86SRC)/i2c \ -I$(XF86SRC)/xaa -I$(XF86SRC)/rac -I$(XF86SRC)/shadowfb \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/ddc -I$(XF86SRC)/ramdac \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(XTOP)/include/extensions -I$(SERVERSRC)/render \ - -I$(XF86SRC)/vbe -I$(XF86SRC)/int10 + -I$(SERVERSRC)/include -I$(SERVERSRC)/render \ + -I$(XF86SRC)/vbe -I$(XF86SRC)/int10 #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h diff -u xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h:1.4 xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h:1.4 Wed Nov 6 06:38:59 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h Sun Mar 27 21:51:06 2005 @@ -37,7 +37,7 @@ * Dirk H. Hohndel (hohndel@suse.de), * Portions: the GGI project & confidential CYRIX databooks. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h,v 1.4 2002/11/06 11:38:59 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h,v 1.5 2005/03/28 02:51:06 dawes Exp $ */ #ifndef _CYRIX_H_ #define _CYRIX_H_ @@ -167,6 +167,10 @@ extern void CYRIXsetBlitBuffers(void); extern void CYRIXsetBlitBuffersOnOldChip(void); +extern int CYRIXSetRead(ScreenPtr pScreen, int bank); +extern int CYRIXSetReadWrite(ScreenPtr pScreen, int bank); +extern int CYRIXSetWrite(ScreenPtr pScreen, int bank); + /* 32 bit access to GX registers */ #define GX_REG(a) (*(volatile CARD32*)(pCyrix->GXregisters + (a))) Index: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_bank.c diff -u xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_bank.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_bank.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_bank.c:1.3 Wed Nov 6 06:38:59 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_bank.c Sun Aug 28 13:48:00 2005 @@ -26,9 +26,7 @@ * Dirk H. Hohndel (hohndel@suse.de), * Portions: the GGI project & confidential CYRIX databooks. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_bank.c,v 1.3 2002/11/06 11:38:59 alanh Exp $ */ - -#define PSZ 8 +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_bank.c,v 1.4 2005/08/28 17:48:00 tsi Exp $ */ /* All drivers should typically include these */ #include "xf86.h" Index: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c:1.32 xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c:1.36 --- xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c:1.32 Fri Nov 26 06:48:47 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c Thu Mar 16 11:50:03 2006 @@ -50,7 +50,7 @@ * (note that most of the data books have been released by * NatSemi and are downloadable for free as pdf files) */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c,v 1.32 2004/11/26 11:48:47 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c,v 1.36 2006/03/16 16:50:03 dawes Exp $ */ #include "fb.h" #include "mibank.h" @@ -74,11 +74,11 @@ #include "cyrix.h" #define _XF86DGA_SERVER_ -#include "extensions/xf86dgastr.h" +#include <X11/extensions/xf86dgastr.h> #include "opaque.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> static const OptionInfoRec * CYRIXAvailableOptions(int chip, int busid); static void CYRIXIdentify(int flags); @@ -109,11 +109,6 @@ static void CYRIXRestorePalette(ScrnInfoPtr pScrn); static void CYRIXSavePalette(ScrnInfoPtr pScrn); -/* Misc additional routines */ -void CYRIXSetRead(int bank); -void CYRIXSetWrite(int bank); -void CYRIXSetReadWrite(int bank); - #define VERSION 4000 #define CYRIX_NAME "CYRIX" #define CYRIX_DRIVER_NAME "cyrix" @@ -207,14 +202,12 @@ NULL }; -#ifdef XFree86LOADER static const char *vbeSymbols[] = { "VBEInit", "vbeDoEDID", "vbeFree", NULL }; -#endif /* access to the MediaGX video hardware registers */ @@ -244,14 +237,15 @@ XF86ModuleData cyrixModuleData = { &cyrixVersRec, cyrixSetup, NULL }; pointer -cyrixSetup(pointer module, pointer opts, int *errmaj, int *errmin) +cyrixSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; if (!setupDone) { setupDone = TRUE; xf86AddDriver(&CYRIX, module, 0); - LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, vbeSymbols, shadowSymbols, NULL); + LoaderModRefSymLists(module, vgahwSymbols, fbSymbols, xaaSymbols, + vbeSymbols, shadowSymbols, NULL); return (pointer)TRUE; } @@ -533,10 +527,14 @@ CYRIXProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; - if (xf86LoadSubModule(pScrn, "vbe")) { + ModuleDescPtr pMod; + + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } @@ -555,6 +553,7 @@ unsigned char gcr; static int accelWidths[3]= {2,1024, 2048}; const char *s; + ModuleDescPtr pMod; /* Allocate the CYRIXRec driverPrivate */ if (!CYRIXGetRec(pScrn)) return FALSE; @@ -584,9 +583,9 @@ } /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* * Allocate a vgaHWRec @@ -936,20 +935,20 @@ } /* Load fb module */ - if (xf86LoadSubModule(pScrn, "fb") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { CYRIXFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); /* Load XAA if needed */ if (!pCyrix->NoAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { CYRIXFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); switch (pScrn->displayWidth * pScrn->bitsPerPixel / 8) { case 512: @@ -966,11 +965,11 @@ /* Load shadowfb if needed */ if (pCyrix->ShadowFB) { - if (!xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { CYRIXFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } return TRUE; Index: xc/programs/Xserver/hw/xfree86/drivers/dummy/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/dummy/Imakefile:1.4 xc/programs/Xserver/hw/xfree86/drivers/dummy/Imakefile:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/dummy/Imakefile:1.4 Fri Jun 25 11:50:32 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/dummy/Imakefile Fri Oct 14 11:16:39 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/dummy/Imakefile,v 1.4 2004/06/25 15:50:32 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/dummy/Imakefile,v 1.6 2005/10/14 15:16:39 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -53,15 +53,12 @@ OBJS = dummy_driver.o -DEFINES = -DPSZ=8 - #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/include -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb \ - -I$(SERVERSRC)/mfb -I$(XINCLUDESRC) -I$(FONTINCSRC) \ - -I$(XF86SRC)/ramdac -I$(SERVERSRC)/Xext -I$(EXTINCSRC) \ + -I$(SERVERSRC)/mfb -I$(XF86SRC)/ramdac -I$(SERVERSRC)/Xext \ -I$(SERVERSRC)/render #endif Index: xc/programs/Xserver/hw/xfree86/drivers/dummy/dummy_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/dummy/dummy_driver.c:1.9 xc/programs/Xserver/hw/xfree86/drivers/dummy/dummy_driver.c:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/dummy/dummy_driver.c:1.9 Sat Oct 23 11:29:29 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/dummy/dummy_driver.c Thu Mar 16 11:50:03 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/dummy/dummy_driver.c,v 1.9 2004/10/23 15:29:29 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/dummy/dummy_driver.c,v 1.11 2006/03/16 16:50:03 dawes Exp $ */ /* * Copyright 2002, SuSE Linux AG, Author: Egbert Eich @@ -30,7 +30,7 @@ #include "picturestr.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> /* * Driver data structures. @@ -38,12 +38,12 @@ #include "dummy.h" /* These need to be checked */ -#include "X.h" -#include "Xproto.h" +#include <X11/X.h> +#include <X11/Xproto.h> #include "scrnintstr.h" #include "servermd.h" #define _XF86DGA_SERVER_ -#include "extensions/xf86dgastr.h" +#include <X11/extensions/xf86dgastr.h> /* Mandatory functions */ static const OptionInfoRec * DUMMYAvailableOptions(int chipid, int busid); @@ -115,8 +115,8 @@ * List of symbols from other modules that this module references. This * list is used to tell the loader that it is OK for symbols here to be * unresolved providing that it hasn't been told that they haven't been - * told that they are essential via a call to xf86LoaderReqSymbols() or - * xf86LoaderReqSymLists(). The purpose is this is to avoid warnings about + * told that they are essential via a call to xf86LoaderModReqSymbols() or + * xf86LoaderModReqSymLists(). The purpose is this is to avoid warnings about * unresolved symbols that are not required. */ @@ -152,7 +152,7 @@ XF86ModuleData dummyModuleData = { &dummyVersRec, dummySetup, NULL }; static pointer -dummySetup(pointer module, pointer opts, int *errmaj, int *errmin) +dummySetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -160,11 +160,7 @@ setupDone = TRUE; xf86AddDriver(&DUMMY, module, 0); - /* - * Modules that this driver always requires can be loaded here - * by calling LoadSubModule(). - */ - + xf86LoaderModRefSymLists(module, fbSymbols, NULL); /* * The return value must be non-NULL on success even though there * is no TearDownProc. @@ -283,6 +279,7 @@ int i; int maxClock = 230000; GDevPtr device = xf86GetEntityInfo(pScrn->entityList[0])->device; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) return TRUE; @@ -430,10 +427,10 @@ /* If monitor resolution is set on the command line, use it */ xf86SetDpi(pScrn, 0, 0); - if (xf86LoadSubModule(pScrn, "fb") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { RETURN } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); return TRUE; } Index: xc/programs/Xserver/hw/xfree86/drivers/fbdev/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/fbdev/Imakefile:1.12 xc/programs/Xserver/hw/xfree86/drivers/fbdev/Imakefile:1.15 --- xc/programs/Xserver/hw/xfree86/drivers/fbdev/Imakefile:1.12 Mon May 31 20:17:00 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/fbdev/Imakefile Fri Oct 14 11:16:39 2005 @@ -1,7 +1,7 @@ XCOMM XCOMM This is an Imakefile for the fbdev driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/Imakefile,v 1.12 2004/06/01 00:17:00 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/Imakefile,v 1.15 2005/10/14 15:16:39 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -56,18 +56,16 @@ OBJS = fbdev.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/afb \ - -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa \ + -I$(SERVERSRC)/afb -I$(SERVERSRC)/fb \ -I$(XF86SRC)/fbdevhw -I$(XF86SRC)/ramdac \ -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(XF86SRC)/rac \ - -I$(SERVERSRC)/Xext -I$(XF86SRC)/xf24_32bpp\ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(SERVERSRC)/miext/shadow -I$(EXTINCSRC) -I$(SERVERSRC)/render + -I$(XF86SRC)/rac -I$(SERVERSRC)/Xext \ + -I$(SERVERSRC)/include -I$(SERVERSRC)/miext/shadow \ + -I$(SERVERSRC)/render #endif DEFINES = FbdevDefines Index: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c diff -u xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c:1.46 xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c:1.50 --- xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c:1.46 Tue Dec 7 10:59:19 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c Thu Mar 16 11:50:04 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c,v 1.46 2004/12/07 15:59:19 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c,v 1.50 2006/03/16 16:50:04 dawes Exp $ */ /* * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> @@ -158,7 +158,7 @@ "fbdevHWUnmapVidmem", /* colormap */ - "fbdevHWLoadpalette", + "fbdevHWLoadPalette", /* ScrnInfo hooks */ "fbdevHWAdjustFrame", @@ -197,15 +197,15 @@ XF86ModuleData fbdevModuleData = { &FBDevVersRec, FBDevSetup, NULL }; pointer -FBDevSetup(pointer module, pointer opts, int *errmaj, int *errmin) +FBDevSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; if (!setupDone) { setupDone = TRUE; xf86AddDriver(&FBDEV, module, 0); - LoaderRefSymLists(afbSymbols, fbSymbols, - shadowSymbols, fbdevHWSymbols, NULL); + LoaderModRefSymLists(module, afbSymbols, fbSymbols, + shadowSymbols, fbdevHWSymbols, NULL); return (pointer)1; } else { if (errmaj) *errmaj = LDR_ONCEONLY; @@ -242,7 +242,7 @@ { if (pScrn->driverPrivate != NULL) return TRUE; - + pScrn->driverPrivate = xnfcalloc(sizeof(FBDevRec), 1); return TRUE; } @@ -275,11 +275,12 @@ { int i; ScrnInfoPtr pScrn; - GDevPtr *devSections; + GDevPtr *devSections; int numDevSections; int bus,device,func; char *dev; Bool foundScreen = FALSE; + ModuleDescPtr pMod; TRACE("probe start"); @@ -287,67 +288,61 @@ if (flags & PROBE_DETECT) return FALSE; - if ((numDevSections = xf86MatchDevice(FBDEV_DRIVER_NAME, &devSections)) <= 0) + if ((numDevSections = xf86MatchDevice(FBDEV_DRIVER_NAME, &devSections)) <= 0) return FALSE; - - if (!xf86LoadDrvSubModule(drv, "fbdevhw")) + + if (!(pMod = xf86LoadDrvSubModule(drv, "fbdevhw"))) return FALSE; - - xf86LoaderReqSymLists(fbdevHWSymbols, NULL); - + + xf86LoaderModReqSymLists(pMod, fbdevHWSymbols, NULL); + for (i = 0; i < numDevSections; i++) { Bool isIsa = FALSE; Bool isPci = FALSE; dev = xf86FindOptionValue(devSections[i]->options,"fbdev"); if (devSections[i]->busID) { - if (xf86ParsePciBusString(devSections[i]->busID,&bus,&device, + if (xf86ParsePciBusString(devSections[i]->busID,&bus,&device, &func)) { if (!xf86CheckPciSlot(bus,device,func)) - continue; + continue; isPci = TRUE; } else if (xf86ParseIsaBusString(devSections[i]->busID)) isIsa = TRUE; - + } if (fbdevHWProbe(NULL,dev,NULL)) { pScrn = NULL; if (isPci) { /* XXX what about when there's no busID set? */ int entity; - + entity = xf86ClaimPciSlot(bus,device,func,drv, 0,devSections[i], TRUE); - pScrn = xf86ConfigPciEntity(pScrn,0,entity, - NULL,RES_SHARED_VGA, - NULL,NULL,NULL,NULL); - /* xf86DrvMsg() can't be called without setting these */ - pScrn->driverName = FBDEV_DRIVER_NAME; - pScrn->name = FBDEV_NAME; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "claimed PCI slot %d:%d:%d\n",bus,device,func); - + if (entity >= 0) + pScrn = xf86ConfigPciEntity(pScrn,0,entity, + NULL,RES_SHARED_VGA, + NULL,NULL,NULL,NULL); } else if (isIsa) { int entity; - + entity = xf86ClaimIsaSlot(drv, 0, devSections[i], TRUE); pScrn = xf86ConfigIsaEntity(pScrn,0,entity, NULL,RES_SHARED_VGA, NULL,NULL,NULL,NULL); } else { - int entity; + int entity; entity = xf86ClaimFbSlot(drv, 0, devSections[i], TRUE); pScrn = xf86ConfigFbEntity(pScrn,0,entity, NULL,NULL,NULL,NULL); - } if (pScrn) { foundScreen = TRUE; - + pScrn->driverVersion = VERSION; pScrn->driverName = FBDEV_DRIVER_NAME; pScrn->name = FBDEV_NAME; @@ -359,7 +354,7 @@ pScrn->EnterVT = fbdevHWEnterVT; pScrn->LeaveVT = fbdevHWLeaveVT; pScrn->ValidMode = fbdevHWValidMode; - + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "using %s\n", dev ? dev : "default device"); } @@ -378,6 +373,7 @@ const char *mod = NULL, *s; const char **syms = NULL; int type; + ModuleDescPtr pMod = NULL; if (flags & PROBE_DETECT) return FALSE; @@ -505,7 +501,7 @@ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Checking Modes against monitor...\n"); { DisplayModePtr mode, first = mode = pScrn->modes; - + if (mode != NULL) do { mode->status = xf86CheckModeForMonitor(mode, pScrn->monitor); mode = mode->next; @@ -557,43 +553,43 @@ } break; case FBDEVHW_INTERLEAVED_PLANES: - /* Not supported yet, don't know what to do with this */ - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Interleaved Planes are not supported yet by drivers/fbdev."); + /* Not supported yet, don't know what to do with this */ + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Interleaved Planes are not supported yet by drivers/fbdev."); return FALSE; case FBDEVHW_TEXT: - /* This should never happen ... - * we should check for this much much earlier ... */ - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Text mode is not supprted by drivers/fbdev.\n" - "Why do you want to run the X in TEXT mode anyway ?"); + /* This should never happen ... + * we should check for this much much earlier ... */ + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Text mode is not supprted by drivers/fbdev.\n" + "Why do you want to run the X in TEXT mode anyway ?"); return FALSE; case FBDEVHW_VGA_PLANES: - /* Not supported yet */ - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "EGA/VGA Planes are not supprted yet by drivers/fbdev."); - return FALSE; + /* Not supported yet */ + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "EGA/VGA Planes are not supprted yet by drivers/fbdev."); + return FALSE; default: - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Fbdev type (%d) not supported yet.", type); - return FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Fbdev type (%d) not supported yet.", type); + return FALSE; } - if (mod && xf86LoadSubModule(pScrn, mod) == NULL) { + if (mod && !(pMod = xf86LoadSubModule(pScrn, mod))) { FBDevFreeRec(pScrn); return FALSE; } if (mod && syms) { - xf86LoaderReqSymLists(syms, NULL); + xf86LoaderModReqSymLists(pMod, syms, NULL); } /* Load shadow if needed */ if (fPtr->shadowFB) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using \"Shadow Framebuffer\"\n"); - if (!xf86LoadSubModule(pScrn, "shadow")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadow"))) { FBDevFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } TRACE_EXIT("PreInit"); @@ -623,7 +619,7 @@ #endif if (NULL == (fPtr->fbmem = fbdevHWMapVidmem(pScrn))) { - xf86DrvMsg(scrnIndex,X_ERROR,"Map vid mem failed\n"); + xf86DrvMsg(scrnIndex,X_ERROR,"Map vid mem failed\n"); return FALSE; } fPtr->fboff = fbdevHWLinearOffset(pScrn); @@ -719,7 +715,7 @@ pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth, pScrn->bitsPerPixel); init_picture = 1; break; - default: + default: xf86DrvMsg(scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) in FBDevScreenInit\n", pScrn->bitsPerPixel); @@ -780,7 +776,7 @@ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "RENDER extension initialisation failed.\n"); - if (fPtr->shadowFB && + if (fPtr->shadowFB && (!shadowSetup(pScreen) || !shadowAdd(pScreen, NULL, fPtr->rotate ? shadowUpdateRotatePacked : shadowUpdatePacked, FBDevWindowLinear, fPtr->rotate, NULL)) ) { @@ -872,7 +868,7 @@ { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; FBDevPtr fPtr = FBDEVPTR(pScrn); - + fbdevHWRestore(pScrn); fbdevHWUnmapVidmem(pScrn); if (fPtr->shadowmem) @@ -964,8 +960,8 @@ static Bool FBDevDGAOpenFramebuffer(ScrnInfoPtr pScrn, char **DeviceName, - unsigned int *ApertureBase, unsigned int *ApertureSize, - unsigned int *ApertureOffset, unsigned int *flags) + unsigned int *ApertureBase, unsigned int *ApertureSize, + unsigned int *ApertureOffset, unsigned int *flags) { *DeviceName = NULL; /* No special device */ *ApertureBase = pScrn->memPhysBase; Index: xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile:1.9 xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile:1.13 --- xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile:1.9 Mon May 31 20:17:00 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile Fri Dec 16 22:02:49 2005 @@ -1,9 +1,9 @@ XCOMM XCOMM This is an Imakefile for the glide driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile,v 1.9 2004/06/01 00:17:00 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile,v 1.13 2005/12/17 03:02:49 dawes Exp $ /* - * Copyright (c) 1994-2004 by The XFree86 Project, Inc. + * Copyright (c) 1994-2005 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -65,17 +65,12 @@ OBJS = glide_driver.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(GLIDE2INCDIR) -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ - -I$(XF86SRC)/xaa \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ - -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(SERVERSRC)/Xext -I$(XF86SRC)/xf8_32bpp\ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(XF86SRC)/xf24_32bpp -I$(XF86SRC)/shadowfb \ - -I$(EXTINCSRC) -I$(SERVERSRC)/render +INCLUDES = -I$(GLIDE2INCDIR) -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(XF86SRC)/ramdac \ + -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c -I$(SERVERSRC)/Xext \ + -I$(SERVERSRC)/include -I$(XF86SRC)/shadowfb -I$(SERVERSRC)/render #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c:1.28 xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c:1.32 --- xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c:1.28 Fri Jan 4 16:22:30 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c Thu Mar 16 11:50:04 2006 @@ -45,9 +45,8 @@ * Support static loading. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c,v 1.28 2002/01/04 21:22:30 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c,v 1.32 2006/03/16 16:50:04 dawes Exp $ */ -#include "xaa.h" #include "xf86Cursor.h" #include "colormapst.h" #include "xf86.h" @@ -59,7 +58,7 @@ #include "xf86DDC.h" #include "globals.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> #include "fb.h" #include "xf86cmap.h" #include "shadowfb.h" @@ -206,8 +205,8 @@ * List of symbols from other modules that this module references. This * list is used to tell the loader that it is OK for symbols here to be * unresolved providing that it hasn't been told that they haven't been - * told that they are essential via a call to xf86LoaderReqSymbols() or - * xf86LoaderReqSymLists(). The purpose is this is to avoid warnings about + * told that they are essential via a call to xf86LoaderModReqSymbols() or + * xf86LoaderModReqSymLists(). The purpose is this is to avoid warnings about * unresolved symbols that are not required. */ @@ -243,7 +242,7 @@ XF86ModuleData glideModuleData = { &glideVersRec, glideSetup, NULL }; static pointer -glideSetup(pointer module, pointer opts, int *errmaj, int *errmin) +glideSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; pointer ret; @@ -297,7 +296,7 @@ * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(fbSymbols, shadowSymbols, NULL); + LoaderModRefSymLists(module, fbSymbols, shadowSymbols, NULL); /* * The return value must be non-NULL on success even though there @@ -446,6 +445,7 @@ int i; ClockRangePtr clockRanges; int sst; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) return FALSE; @@ -628,19 +628,19 @@ xf86SetDpi(pScrn, 0, 0); /* Load fb */ - if (xf86LoadSubModule(pScrn, "fb") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { GLIDEFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); /* Load the shadow framebuffer */ - if (!xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { GLIDEFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); return TRUE; } @@ -750,7 +750,7 @@ } #if 0 - LoaderCheckUnresolved(LD_RESOLV_NOW); + LoaderCheckUnresolved(0); return FALSE; #endif Index: xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile:1.43 xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile:1.46 --- xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile:1.43 Mon Feb 28 22:48:52 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile Fri Oct 14 11:16:39 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile,v 1.43 2005/03/01 03:48:52 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile,v 1.46 2005/10/14 15:16:39 tsi Exp $ XCOMM XCOMM This is an Imakefile for the GLINT driver. XCOMM @@ -75,21 +75,15 @@ glint_shadow.o $(DRIOBJ) sx_accel.o glint_dga.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/cfb -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ - -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ - -I$(XF86SRC)/xf24_32bpp -I$(FONTINCSRC) \ - -I$(XF86SRC)/xf8_32bpp -I$(XF86SRC)/xf1bpp \ - -I$(XF86SRC)/xf4bpp -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c -I$(EXTINCSRC) $(DRIINCLUDES) \ - -I$(XF86SRC)/shadowfb -I$(XF86SRC)/fbdevhw \ - -I$(XF86SRC)/vbe \ - -I$(SERVERSRC)/render +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ + -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa \ + -I$(XF86SRC)/ramdac -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ + -I$(XF86SRC)/rac -I$(XF86SRC)/int10 -I$(XF86SRC)/xf8_32bpp \ + -I$(SERVERSRC)/include -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ + $(DRIINCLUDES) -I$(XF86SRC)/shadowfb -I$(XF86SRC)/fbdevhw \ + -I$(XF86SRC)/vbe -I$(SERVERSRC)/render #endif DEFINES = $(DRIDEFINES) -DPPC_MMIO_IS_BE -DSPARC_MMIO_IS_BE Index: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h diff -u xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h:1.59 xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h:1.60 --- xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h:1.59 Wed Apr 23 17:51:36 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h Thu Feb 2 18:09:37 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h,v 1.59 2003/04/23 21:51:36 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h,v 1.60 2006/02/02 23:09:37 alanh Exp $ */ /* * Copyright 1997-2001 by Alan Hourihane <alanh@fairlite.demon.co.uk> * @@ -57,7 +57,7 @@ typedef struct { CARD32 glintRegs[0x2000]; - CARD32 DacRegs[0x100]; + CARD32 DacRegs[0x1000]; CARD8 cmap[0x300]; } GLINTRegRec, *GLINTRegPtr; Index: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c:1.164 xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c:1.167 --- xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c:1.164 Fri Dec 10 11:07:01 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c Thu Mar 16 11:50:05 2006 @@ -28,7 +28,7 @@ * this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen, * Siemens Nixdorf Informationssysteme and Appian Graphics. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c,v 1.164 2004/12/10 16:07:01 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c,v 1.167 2006/03/16 16:50:05 dawes Exp $ */ #include "fb.h" #include "cfb8_32.h" @@ -60,11 +60,11 @@ #include "glint.h" #define _XF86DGA_SERVER_ -#include "extensions/xf86dgastr.h" +#include <X11/extensions/xf86dgastr.h> #include "globals.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> #define DEBUG 0 @@ -273,14 +273,12 @@ NULL }; -#ifdef XFree86LOADER static const char *vbeSymbols[] = { "VBEInit", "vbeDoEDID", "vbeFree", NULL }; -#endif static const char *ramdacSymbols[] = { "IBMramdac526CalculateMNPCForClock", @@ -398,21 +396,21 @@ XF86ModuleData glintModuleData = { &glintVersRec, glintSetup, NULL }; pointer -glintSetup(pointer module, pointer opts, int *errmaj, int *errmin) +glintSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; if (!setupDone) { setupDone = TRUE; xf86AddDriver(&GLINT, module, 0); - LoaderRefSymLists(fbSymbols, ddcSymbols, i2cSymbols, - xaaSymbols, xf8_32bppSymbols, - shadowSymbols, fbdevHWSymbols, GLINTint10Symbols, - vbeSymbols, ramdacSymbols, + LoaderModRefSymLists(module, fbSymbols, ddcSymbols, i2cSymbols, + xaaSymbols, xf8_32bppSymbols, + shadowSymbols, fbdevHWSymbols, GLINTint10Symbols, + vbeSymbols, ramdacSymbols, #ifdef XF86DRI - drmSymbols, driSymbols, + drmSymbols, driSymbols, #endif - NULL); + NULL); return (pointer)TRUE; } @@ -614,11 +612,14 @@ GLINTProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; - if (xf86LoadSubModule(pScrn, "vbe")) + ModuleDescPtr pMod; + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); pVbe = VBEInit(NULL,index); vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } @@ -635,6 +636,7 @@ int *usedChips = NULL; Bool foundScreen = FALSE; char *name; + ModuleDescPtr pMod; /* TRACE_ENTER("GLINTProbe"); @@ -655,10 +657,10 @@ * when no PCI cards have been found. This is for systems without * (proper) PCI support. (Michel) */ - if (!xf86LoadDrvSubModule(drv, "fbdevhw")) + if (!(pMod = xf86LoadDrvSubModule(drv, "fbdevhw"))) return FALSE; - xf86LoaderReqSymLists(fbdevHWSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbdevHWSymbols, NULL); for (i = 0; i < numDevSections; i++) { dev = xf86FindOptionValue(devSections[i]->options,"fbdev"); @@ -987,6 +989,7 @@ char *mod = NULL; const char *s; const char **syms = NULL; + ModuleDescPtr pMod = NULL; TRACE_ENTER("GLINTPreInit"); @@ -1231,13 +1234,13 @@ /* Check whether to use the FBDev stuff and fill in the rest of pScrn */ if (xf86ReturnOptValBool(pGlint->Options, OPTION_FBDEV, FALSE)) { - if (!FBDevProbed && !xf86LoadSubModule(pScrn, "fbdevhw")) + if (!FBDevProbed && !(pMod = xf86LoadSubModule(pScrn, "fbdevhw"))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "couldn't load fbdevHW module!\n"); return FALSE; } - xf86LoaderReqSymLists(fbdevHWSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbdevHWSymbols, NULL); if (!fbdevHWInit(pScrn,NULL,xf86FindOptionValue(pGlint->pEnt->device->options,"fbdev"))) { @@ -1441,10 +1444,10 @@ pGlint->Chipset != PCI_VENDOR_3DLABS_CHIP_GAMMA2 && pGlint->Chipset != PCI_VENDOR_3DLABS_CHIP_DELTA && !xf86IsPrimaryPci(pGlint->PciInfo) && !pGlint->FBDev) { - if ( xf86LoadSubModule(pScrn, "int10")){ + if ((pMod = xf86LoadSubModule(pScrn, "int10"))) { xf86Int10InfoPtr pInt; - xf86LoaderReqSymLists(GLINTint10Symbols, NULL); + xf86LoaderModReqSymLists(pMod, GLINTint10Symbols, NULL); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing int10\n"); pInt = xf86InitInt10(pGlint->pEnt->index); xf86FreeInt10(pInt); @@ -1673,10 +1676,10 @@ pGlint->FbMapSize / 1024); /* The ramdac module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "ramdac")) + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) return FALSE; - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); /* Let's check what type of DAC we have and reject if necessary */ switch (pGlint->Chipset) { @@ -2348,38 +2351,38 @@ } break; } - if (mod && xf86LoadSubModule(pScrn, mod) == NULL) { + if (mod && !(pMod = xf86LoadSubModule(pScrn, mod))) { GLINTFreeRec(pScrn); return FALSE; } if (mod && syms) { - xf86LoaderReqSymLists(syms, NULL); + xf86LoaderModReqSymLists(pMod, syms, NULL); } /* Load XAA if needed */ if (!pGlint->NoAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { GLINTFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } /* Load shadowfb if needed */ if (pGlint->ShadowFB) { - if (!xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { GLINTFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } /* Load DDC */ - if (!xf86LoadSubModule(pScrn, "ddc")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ddc"))) { GLINTFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ddcSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); /* Load I2C if needed */ if ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2) || (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V) || @@ -2387,10 +2390,10 @@ (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA4) || (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_R4) || (pGlint->Chipset == PCI_VENDOR_TI_CHIP_PERMEDIA2)) { - if (xf86LoadSubModule(pScrn, "i2c")) { + if ((pMod = xf86LoadSubModule(pScrn, "i2c"))) { I2CBusPtr pBus; - xf86LoaderReqSymLists(i2cSymbols, NULL); + xf86LoaderModReqSymLists(pMod, i2cSymbols, NULL); if ((pBus = xf86CreateI2CBusRec())) { pBus->BusName = "DDC"; pBus->scrnIndex = pScrn->scrnIndex; @@ -2886,7 +2889,7 @@ * function. If not, the visuals will need to be setup before calling * a fb ScreenInit() function and fixed up after. * - * For most PC hardware at depths >= 8, the defaults that cfb uses + * For most PC hardware at depths >= 8, the defaults that fb uses * are not appropriate. In this driver, we fixup the visuals after. */ @@ -3150,7 +3153,7 @@ #ifdef XF86DRI if (pGlint->directRenderingEnabled) { - /* Now that mi, cfb, drm and others have done their thing, + /* Now that mi, fb, drm and others have done their thing, * complete the DRI setup. */ pGlint->directRenderingEnabled = GLINTDRIFinishScreenInit(pScreen); Index: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c:1.32 xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c:1.33 --- xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c:1.32 Wed Oct 8 11:48:39 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c Fri Oct 14 11:16:39 2005 @@ -30,9 +30,9 @@ * * Permedia 2 accelerated options. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c,v 1.32 2003/10/08 15:48:39 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c,v 1.33 2005/10/14 15:16:39 tsi Exp $ */ -#include "Xarch.h" +#include <X11/Xarch.h> #include "xf86.h" #include "xf86_OSproc.h" #include "xf86_ansic.h" Index: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c diff -u xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c:1.27 xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c:1.28 --- xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c:1.27 Mon Nov 3 00:11:13 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c Fri Oct 14 11:16:39 2005 @@ -28,9 +28,9 @@ * this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen and * Siemens Nixdorf Informationssysteme */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c,v 1.27 2003/11/03 05:11:13 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c,v 1.28 2005/10/14 15:16:39 tsi Exp $ */ -#include "Xarch.h" +#include <X11/Xarch.h> #include "xf86.h" #include "xf86_OSproc.h" #include "xf86_ansic.h" Index: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c:1.27 xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c:1.28 --- xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c:1.27 Sat Oct 23 11:29:29 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c Fri Oct 14 11:16:40 2005 @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c,v 1.27 2004/10/23 15:29:29 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c,v 1.28 2005/10/14 15:16:40 tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -31,7 +31,7 @@ #include "xf86fbman.h" #include "xf86i2c.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "glint_regs.h" #include "glint.h" Index: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c:1.32 xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c:1.33 --- xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c:1.32 Mon Mar 29 11:25:16 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c Fri Oct 14 11:16:40 2005 @@ -26,9 +26,9 @@ * * Permedia 3 accelerated options. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c,v 1.32 2004/03/29 16:25:16 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c,v 1.33 2005/10/14 15:16:40 tsi Exp $ */ -#include "Xarch.h" +#include <X11/Xarch.h> #include "xf86.h" #include "xf86_OSproc.h" #include "xf86_ansic.h" Index: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c diff -u xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c:1.34 xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c:1.35 --- xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c:1.34 Mon Nov 3 00:11:14 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c Thu Mar 16 11:50:06 2006 @@ -26,7 +26,7 @@ * this work is sponsored by Appian Graphics. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c,v 1.34 2003/11/03 05:11:14 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c,v 1.35 2006/03/16 16:50:06 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -360,6 +360,9 @@ { GLINTPtr pGlint = GLINTPTR(pScrn); CARD32 LocalMemCaps; +#if defined(__alpha__) + ModuleDescPtr pMod; +#endif TRACE_ENTER("Permedia3PreInit"); @@ -421,10 +424,10 @@ pciWriteByte( pGlint->PciTag, 0xfc, 0 ); /* The card we are on should be VGA-enabled now, so run int10. */ - if (xf86LoadSubModule(pScrn, "int10")) { + if ((pMod = xf86LoadSubModule(pScrn, "int10"))) { xf86Int10InfoPtr pInt; - xf86LoaderReqSymLists(GLINTint10Symbols, NULL); + xf86LoaderModReqSymLists(pMod, GLINTint10Symbols, NULL); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing int10\n"); pInt = xf86InitInt10(pGlint->pEnt->index); xf86FreeInt10(pInt); Index: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c:1.17 xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c:1.18 --- xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c:1.17 Wed Sep 1 18:56:57 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c Fri Oct 14 11:16:40 2005 @@ -22,7 +22,7 @@ * Authors: Alan Hourihane, alanh@fairlite.demon.co.uk * Sven Luther <luther@dpt-info.u-strasbg.fr> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c,v 1.17 2004/09/01 22:56:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c,v 1.18 2005/10/14 15:16:40 tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -37,7 +37,7 @@ #include "glint.h" #include "glint_regs.h" #include "pm3_regs.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "xaa.h" #include "dixstruct.h" #include "fourcc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/i128/IBMRGB.h diff -u xc/programs/Xserver/hw/xfree86/drivers/i128/IBMRGB.h:1.1 xc/programs/Xserver/hw/xfree86/drivers/i128/IBMRGB.h:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/i128/IBMRGB.h:1.1 Wed Oct 4 19:34:58 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/i128/IBMRGB.h Mon Jan 9 09:59:53 2006 @@ -1,8 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/IBMRGB.h,v 1.1 2000/10/04 23:34:58 robin Exp $ */ - - - -/* $XConsortium: $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/IBMRGB.h,v 1.2 2006/01/09 14:59:53 dawes Exp $ */ #define IBMRGB_REF_FREQ_1 14.31818 #define IBMRGB_REF_FREQ_2 50.00000 Index: xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile:1.7 xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile:1.10 --- xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile:1.7 Mon May 31 20:17:01 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile Fri Oct 14 11:16:40 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile,v 1.7 2004/06/01 00:17:01 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile,v 1.10 2005/10/14 15:16:40 tsi Exp $ XCOMM XCOMM This is the Imakefile for the I128 driver. XCOMM @@ -56,17 +56,14 @@ OBJS = i128_driver.o i128init.o i128IBMDAC.o i128accel.o i128dga.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/fb \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi -I$(XF86SRC)/int10 \ - -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/fbdevhw \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/fb \ + -I$(SERVERSRC)/mi -I$(XF86SRC)/int10 \ + -I$(XF86SRC)/xaa -I$(XF86SRC)/rac -I$(XF86SRC)/vgahw \ -I$(XF86SRC)/ramdac -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(SERVERSRC)/Xext -I$(XF86SRC)/xf8_32bpp\ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(XF86SRC)/xf24_32bpp -I$(XF86SRC)/shadowfb -I$(EXTINCSRC) \ - -I$(XF86SRC)/vbe $(DRIINCLUDES) -I$(SERVERSRC)/render + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/include -I$(XF86SRC)/shadowfb \ + -I$(XF86SRC)/vbe $(DRIINCLUDES) -I$(SERVERSRC)/render #endif DEFINES = $(DRIDEFINES) Index: xc/programs/Xserver/hw/xfree86/drivers/i128/Ti302X.h diff -u xc/programs/Xserver/hw/xfree86/drivers/i128/Ti302X.h:1.2 xc/programs/Xserver/hw/xfree86/drivers/i128/Ti302X.h:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/i128/Ti302X.h:1.2 Sat Mar 3 17:26:11 2001 +++ xc/programs/Xserver/hw/xfree86/drivers/i128/Ti302X.h Mon Jan 9 09:59:54 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/Ti302X.h,v 1.2 2001/03/03 22:26:11 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/Ti302X.h,v 1.3 2006/01/09 14:59:54 dawes Exp $ */ /* * Copyright 1994-2000 by Robin Cutshaw <robin@XFree86.Org> * @@ -21,7 +21,6 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XConsortium: $ */ #include "compiler.h" Index: xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c:1.36 xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c:1.38 --- xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c:1.36 Thu Feb 17 21:55:07 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c Thu Mar 16 11:50:06 2006 @@ -22,7 +22,7 @@ * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c,v 1.36 2005/02/18 02:55:07 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c,v 1.38 2006/03/16 16:50:06 dawes Exp $ */ /* All drivers should typically include these */ @@ -60,7 +60,7 @@ #include "fb.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> /* driver specific includes */ #include "i128.h" @@ -166,10 +166,10 @@ * List of symbols from other modules that this module references. This * list is used to tell the loader that it is OK for symbols here to be * unresolved providing that it hasn't been told that they haven't been - * told that they are essential via a call to xf86LoaderReqSymbols() or - * xf86LoaderReqSymLists(). The purpose is this is to avoid warnings about + * told that they are essential via a call to xf86LoaderModReqSymbols() or + * xf86LoaderModReqSymLists(). The purpose is this is to avoid warnings about * unresolved symbols that are not required. These are provided to the - * LoaderRefSymLists() function in the module specific Setup() function. + * LoaderModRefSymLists() function in the module specific Setup() function. */ static const char *vgahwSymbols[] = { @@ -254,7 +254,7 @@ */ static pointer -i128Setup(pointer module, pointer opts, int *errmaj, int *errmin) +i128Setup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -273,16 +273,16 @@ * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(fbSymbols, - xaaSymbols, - ramdacSymbols, - ddcSymbols, - ddcSymbols, - i2cSymbols, - vbeSymbols, - int10Symbols, - vgahwSymbols, - NULL); + LoaderModRefSymLists(module, fbSymbols, + xaaSymbols, + ramdacSymbols, + ddcSymbols, + ddcSymbols, + i2cSymbols, + vbeSymbols, + int10Symbols, + vgahwSymbols, + NULL); /* * The return value must be non-NULL on success even though there @@ -529,6 +529,7 @@ unsigned char n, m, p, mdc, df; float mclk; xf86MonPtr mon; + ModuleDescPtr pMod; /* Check the number of entities, and fail if it isn't one. */ if (pScrn->numEntities != 1) @@ -557,10 +558,10 @@ pI128->Primary = xf86IsPrimaryPci(pI128->PciInfo); /* The vgahw module should be allocated here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* * Allocate a vgaHWRec @@ -835,8 +836,8 @@ /* Load DDC if we have the code to use it */ /* This gives us DDC1 */ if (pI128->ddc1Read || pI128->i2cInit) { - if (xf86LoadSubModule(pScrn, "ddc")) { - xf86LoaderReqSymLists(ddcSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "ddc"))) { + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); } else { /* ddc module not found, we can do without it */ pI128->ddc1Read = NULL; @@ -848,8 +849,8 @@ /* - DDC can use I2C bus */ /* Load I2C if we have the code to use it */ if (pI128->i2cInit) { - if ( xf86LoadSubModule(pScrn, "i2c") ) { - xf86LoaderReqSymLists(i2cSymbols,NULL); + if ((pMod = xf86LoadSubModule(pScrn, "i2c"))) { + xf86LoaderModReqSymLists(pMod, i2cSymbols,NULL); } else { /* i2c module not found, we can do without it */ pI128->i2cInit = NULL; @@ -1152,28 +1153,28 @@ /* Set display resolution */ xf86SetDpi(pScrn, 0, 0); - if (!xf86LoadSubModule(pScrn, "fb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { I128FreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); /* Load XAA if needed */ if (!pI128->NoAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { I128FreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } /* Load ramdac if needed */ if (pI128->HWCursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { I128FreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } I128UnmapMem(pScrn); Index: xc/programs/Xserver/hw/xfree86/drivers/i128/i128init.c diff -u xc/programs/Xserver/hw/xfree86/drivers/i128/i128init.c:1.6 xc/programs/Xserver/hw/xfree86/drivers/i128/i128init.c:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/i128/i128init.c:1.6 Tue Sep 23 22:43:23 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/i128/i128init.c Mon Jan 9 09:59:54 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128init.c,v 1.6 2003/09/24 02:43:23 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128init.c,v 1.7 2006/01/09 14:59:54 dawes Exp $ */ /* * Copyright 1995-2000 by Robin Cutshaw <robin@XFree86.Org> * Copyright 1998 by Number Nine Visual Technology, Inc. @@ -23,9 +23,6 @@ * */ -/* $XConsortium: $ */ - - #include "xf86.h" #include "xf86_ansic.h" #include "xf86PciInfo.h" Index: xc/programs/Xserver/hw/xfree86/drivers/i128/i128reg.h diff -u xc/programs/Xserver/hw/xfree86/drivers/i128/i128reg.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/i128/i128reg.h:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/i128/i128reg.h:1.3 Fri Jan 25 16:56:02 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/i128/i128reg.h Mon Jan 9 09:59:54 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128reg.h,v 1.3 2002/01/25 21:56:02 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128reg.h,v 1.4 2006/01/09 14:59:54 dawes Exp $ */ /* * Copyright 1994 by Robin Cutshaw <robin@XFree86.Org> * @@ -21,7 +21,6 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XConsortium: i128reg.h /main/4 1996/05/12 20:56:19 kaleb $ */ #ifndef I128REG_H #define I128REG_H Index: xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile:1.13 xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile:1.15 --- xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile:1.13 Mon May 31 20:17:01 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile Fri Oct 14 11:16:40 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile,v 1.13 2004/06/01 00:17:01 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile,v 1.15 2005/10/14 15:16:40 tsi Exp $ XCOMM XCOMM This is the Imakefile for the i740 driver. XCOMM @@ -57,16 +57,14 @@ OBJS = i740_driver.o i740_cursor.o i740_accel.o i740_io.o i740_dga.o i740_i2c.o i740_video.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \ - -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa -I$(XF86SRC)/ramdac \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/mi -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \ + -I$(XF86SRC)/xaa -I$(XF86SRC)/ramdac \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(SERVERSRC)/Xext -I$(XF86SRC)/vbe -I$(SERVERSRC)/fb\ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) -I$(XF86SRC)/int10 -I$(SERVERSRC)/render + -I$(SERVERSRC)/Xext -I$(XF86SRC)/vbe -I$(SERVERSRC)/fb \ + -I$(SERVERSRC)/include -I$(XF86SRC)/int10 -I$(SERVERSRC)/render #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c:1.53 xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c:1.60 --- xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c:1.53 Thu Feb 17 21:55:07 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c Thu Mar 16 11:50:07 2006 @@ -25,7 +25,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c,v 1.53 2005/02/18 02:55:07 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c,v 1.60 2006/03/16 16:50:07 dawes Exp $ */ /* * Authors: @@ -75,31 +75,12 @@ #include "micmap.h" -#define USE_FB - -#ifdef USE_FB #include "fb.h" -#else -/* Drivers using cfb need: */ - -#define PSZ 8 -#include "cfb.h" -#undef PSZ - -/* Drivers supporting bpp 16, 24 or 32 with cfb need one or more of: */ - -#include "cfb16.h" -#include "cfb24.h" -#include "cfb32.h" -#endif - -/* The driver's own header file: */ - #include "regionstr.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "vbe.h" #include "i740_dga.h" @@ -224,17 +205,8 @@ #ifdef XFree86LOADER static const char *fbSymbols[] = { -#ifdef USE_FB "fbScreenInit", "fbPictureInit", -#else - "cfbScreenInit", - "cfb16ScreenInit", - "cfb24ScreenInit", - "cfb32ScreenInit", -#endif - "cfb8_32ScreenInit", - "cfb24_32ScreenInit", NULL }; #endif @@ -253,14 +225,12 @@ NULL }; -#ifdef XFree86LOADER static const char *vbeSymbols[] = { "VBEInit", "vbeDoEDID", "vbeFree", NULL }; -#endif #if USE_DDC2 static const char *ddcSymbols[] = { @@ -299,7 +269,7 @@ XF86ModuleData i740ModuleData = {&i740VersRec, i740Setup, 0}; static pointer -i740Setup(pointer module, pointer opts, int *errmaj, int *errmin) +i740Setup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -318,12 +288,12 @@ * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, - ramdacSymbols, vbeSymbols, + LoaderModRefSymLists(module, vgahwSymbols, fbSymbols, xaaSymbols, + ramdacSymbols, vbeSymbols, #if USE_DDC2 - ddcSymbols, i2cSymbols, + ddcSymbols, i2cSymbols, #endif - NULL); + NULL); /* * The return value must be non-NULL on success even though there @@ -479,10 +449,14 @@ I740ProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; - if (xf86LoadSubModule(pScrn, "vbe")) { + ModuleDescPtr pMod; + + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } @@ -500,11 +474,9 @@ int i; MessageType from; int temp; -#ifndef USE_FB - char *mod=0, *reqSym=0; -#endif int flags24; rgb defaultWeight = {0, 0, 0}; + ModuleDescPtr pMod; if (pScrn->numEntities != 1) return FALSE; @@ -525,9 +497,9 @@ } /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) return FALSE; + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* Allocate a vgaHWRec */ if (!vgaHWGetHWRec(pScrn)) return FALSE; @@ -705,7 +677,7 @@ } } - xf86DrvMsg(pScrn->scrnIndex, from, "Steve was here! VideoRAM: %d kByte %s\n", + xf86DrvMsg(pScrn->scrnIndex, from, "VideoRAM: %d kByte %s\n", pScrn->videoRam, (pI740->HasSGRAM)?"SGRAM":"SDRAM"); pI740->FbMapSize = pScrn->videoRam*1024; @@ -795,52 +767,26 @@ xf86SetDpi(pScrn, 0, 0); -#ifdef USE_FB - if (!xf86LoadSubModule(pScrn, "fb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { I740FreeRec(pScrn); return FALSE; } - xf86LoaderReqSymbols("fbScreenInit","fbPictureInit", NULL); -#else - switch (pScrn->bitsPerPixel) { - case 8: - mod = "cfb"; - reqSym = "cfbScreenInit"; - break; - case 16: - mod = "cfb16"; - reqSym = "cfb16ScreenInit"; - break; - case 24: - mod = "cfb24"; - reqSym = "cfb24ScreenInit"; - break; - case 32: - mod = "cfb32"; - reqSym = "cfb32ScreenInit"; - break; - } - if (mod && !xf86LoadSubModule(pScrn, mod)) { - I740FreeRec(pScrn); - return FALSE; - } - xf86LoaderReqSymbols(reqSym, NULL); -#endif + xf86LoaderModReqSymbols(pMod, "fbScreenInit","fbPictureInit", NULL); if (!xf86ReturnOptValBool(pI740->Options, OPTION_NOACCEL, FALSE)) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { I740FreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } if (!xf86ReturnOptValBool(pI740->Options, OPTION_SW_CURSOR, FALSE)) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { I740FreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } /* We wont be using the VGA access after the probe */ @@ -870,10 +816,10 @@ #if USE_DDC2 /*DDC2*/ { /*PL*/ - if (xf86LoadSubModule(pScrn, "ddc")) { - xf86LoaderReqSymLists(ddcSymbols, NULL); - if ( xf86LoadSubModule(pScrn, "i2c") ) { - xf86LoaderReqSymLists(i2cSymbols,NULL); + if ((pMod = xf86LoadSubModule(pScrn, "ddc"))) { + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "i2c"))) { + xf86LoaderModReqSymLists(pMod, i2cSymbols,NULL); if (I740MapMem(pScrn)) { @@ -974,7 +920,7 @@ * in the generic VGA portion. */ if (saveFonts) - vgaHWSave(pScrn, vgaReg, VGA_SR_MODE|VGA_SR_FONTS); + vgaHWSave(pScrn, vgaReg, VGA_SR_ALL); else vgaHWSave(pScrn, vgaReg, VGA_SR_MODE); @@ -1086,7 +1032,7 @@ * restore clock-select bits. */ if (restoreFonts) - vgaHWRestore(pScrn, vgaReg, VGA_SR_FONTS|VGA_SR_MODE); + vgaHWRestore(pScrn, vgaReg, VGA_SR_ALL); else vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE); @@ -1597,12 +1543,9 @@ if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; -#ifdef USE_FB if (!miSetPixmapDepths ()) return FALSE; -#endif switch (pScrn->bitsPerPixel) { -#ifdef USE_FB case 8: case 16: case 24: @@ -1613,45 +1556,13 @@ pScrn->displayWidth,pScrn->bitsPerPixel)) return FALSE; break; -#else - case 8: - if (!cfbScreenInit(pScreen, pI740->FbBase, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth)) - return FALSE; - break; - case 16: - if (!cfb16ScreenInit(pScreen, pI740->FbBase, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth)) - return FALSE; - break; - case 24: - if (!cfb24ScreenInit(pScreen, pI740->FbBase, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth)) - return FALSE; - break; - case 32: - if (!cfb32ScreenInit(pScreen, pI740->FbBase, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth)) - return FALSE; - break; -#endif default: xf86DrvMsg(scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) in I740ScrnInit\n", pScrn->bitsPerPixel); return FALSE; } -#ifdef USE_FB fbPictureInit(pScreen,0,0); -#endif xf86SetBlackWhitePixels(pScreen); Index: xc/programs/Xserver/hw/xfree86/drivers/i740/i740_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/i740/i740_video.c:1.7 xc/programs/Xserver/hw/xfree86/drivers/i740/i740_video.c:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/i740/i740_video.c:1.7 Mon Mar 29 11:25:17 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/i740/i740_video.c Fri Oct 14 11:16:40 2005 @@ -44,7 +44,7 @@ * 12 September 2002 - Better software scaling with some averaging, giving a * nicer picture. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/i740_video.c,v 1.7 2004/03/29 16:25:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/i740_video.c,v 1.8 2005/10/14 15:16:40 tsi Exp $ */ /* @@ -62,7 +62,7 @@ #include "regionstr.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "xaa.h" #include "dixstruct.h" #include "fourcc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile:1.37 xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile:1.40 --- xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile:1.37 Mon Feb 28 22:48:52 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile Sat Jan 28 20:51:49 2006 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile,v 1.37 2005/03/01 03:48:52 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/Imakefile,v 1.40 2006/01/29 01:51:49 tsi Exp $ XCOMM XCOMM This is the Imakefile for the i810 driver. XCOMM @@ -56,12 +56,6 @@ #define I830Only NO #endif -#define I830XvSupport YES - -#ifndef I830XvSupport -#define I830XvSupport NO -#endif - #if BuildXF86DRI #if !I830Only I810DRISRCS = i810_dri.c i810_hwmc.c @@ -72,15 +66,10 @@ DRISRCS = $(I810DRISRCS) $(I830DRISRCS) DRIOBJS = $(I810DRIOBJS) $(I830DRIOBJS) DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri \ - -I$(XF86OSSRC)/linux/drm/kernel -I$(TOP)/include -I$(DRMINCLUDESDIR) + -I$(XF86OSSRC)/linux/drm/kernel -I$(DRMINCLUDESDIR) DRIDEFINES = $(GLX_DEFINES) #endif -#if I830XvSupport -I830SRCS1 = i830_video.c -I830OBJS1 = i830_video.o -#endif - #if !I830Only I810SRCS = i810_cursor.c i810_accel.c i810_memory.c i810_wmark.c i810_dga.c \ i810_video.c i810_io.c i830_modes.c @@ -88,41 +77,32 @@ i810_video.o i810_io.o i830_modes.o #endif I830SRCS = i830_driver.c i830_memory.c i830_cursor.c i830_accel.c i830_io.c \ - i830_dga.c $(I830SRCS1) $(I830SRCS2) + i830_dga.c i830_shadow.c i830_video.c I830OBJS = i830_driver.o i830_memory.o i830_cursor.o i830_accel.o i830_io.o \ - i830_dga.o $(I830OBJS1) $(I830OBJS2) + i830_dga.o i830_shadow.o i830_video.o -SRCS = i810_driver.c \ - $(I810SRCS) $(I830SRCS) $(DRISRCS) +SRCS = i810_driver.c $(I810SRCS) $(I830SRCS) $(DRISRCS) -OBJS = i810_driver.o \ - $(I810OBJS) $(I830OBJS) $(DRIOBJS) +OBJS = i810_driver.o $(I810OBJS) $(I830OBJS) $(DRIOBJS) #if I830Only CHIPDEFINES = -DI830_ONLY #endif -#if I830XvSupport -I830XVDEFINES = -DI830_XV -#endif - #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \ -I$(SERVERSRC)/miext/shadow \ - -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa -I$(XF86SRC)/ramdac \ + -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa -I$(XF86SRC)/ramdac \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(XF86SRC)/vbe -I$(XF86SRC)/int10 \ - -I$(XF86SRC)/shadowfb \ - -I$(SERVERSRC)/Xext \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) -I$(SERVERSRC)/render \ - $(DRIINCLUDES) + -I$(XF86SRC)/vbe -I$(XF86SRC)/int10 -I$(XF86SRC)/shadowfb \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/include \ + -I$(SERVERSRC)/render $(DRIINCLUDES) #endif -DEFINES = $(DRIDEFINES) $(CHIPDEFINES) $(I830XVDEFINES) +DEFINES = $(DRIDEFINES) $(CHIPDEFINES) ObjectFromSpecialSource(i830_io, i810_io, -DBUILD_FOR_I830) @@ -167,7 +147,8 @@ InstallDriverSDKNonExecFile(i830_dri.h,$(DRIVERSDKDIR)/drivers/i810) InstallDriverSDKNonExecFile(i830_driver.c,$(DRIVERSDKDIR)/drivers/i810) InstallDriverSDKNonExecFile(i830_memory.c,$(DRIVERSDKDIR)/drivers/i810) +InstallDriverSDKNonExecFile(i830_shadow.c,$(DRIVERSDKDIR)/drivers/i810) InstallDriverSDKNonExecFile(i830_video.c,$(DRIVERSDKDIR)/drivers/i810) -InstallDriverSDKNonExecFile(../../../../../../extras/Mesa/src/mesa/drivers/dri/i830/i830_3d_reg.h,$(DRIVERSDKDIR)/drivers/i810) +InstallDriverSDKNonExecFile($(MESASRCDIR)/src/mesa/drivers/dri/i830/i830_3d_reg.h,$(DRIVERSDKDIR)/drivers/i810) InstallDriverSDKObjectModule(i810,$(DRIVERSDKMODULEDIR),drivers) Index: xc/programs/Xserver/hw/xfree86/drivers/i810/common.h diff -u xc/programs/Xserver/hw/xfree86/drivers/i810/common.h:1.12 xc/programs/Xserver/hw/xfree86/drivers/i810/common.h:1.16 --- xc/programs/Xserver/hw/xfree86/drivers/i810/common.h:1.12 Sun Jan 9 15:47:19 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/common.h Fri Mar 10 07:44:20 2006 @@ -27,7 +27,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/common.h,v 1.12 2005/01/09 20:47:19 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/common.h,v 1.16 2006/03/10 12:44:20 alanh Exp $ */ /* * Authors: @@ -79,6 +79,7 @@ extern const char *I810ddcSymbols[]; extern const char *I810fbSymbols[]; extern const char *I810xaaSymbols[]; +extern const char *I810shadowFBSymbols[]; #ifdef XF86DRI extern const char *I810driSymbols[]; extern const char *I810drmSymbols[]; @@ -310,6 +311,22 @@ #define PCI_CHIP_I915_GM_BRIDGE 0x2590 #endif +#ifndef PCI_CHIP_E7221_G +#define PCI_CHIP_E7221_G 0x258A +/* Same as I915_G_BRIDGE */ +#define PCI_CHIP_E7221_G_BRIDGE 0x2580 +#endif + +#ifndef PCI_CHIP_I945_G +#define PCI_CHIP_I945_G 0x2772 +#define PCI_CHIP_I945_G_BRIDGE 0x2770 +#endif + +#ifndef PCI_CHIP_I945_GM +#define PCI_CHIP_I945_GM 0x27A2 +#define PCI_CHIP_I945_GM_BRIDGE 0x27A0 +#endif + #define IS_I810(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I810 || \ pI810->PciInfo->chipType == PCI_CHIP_I810_DC100 || \ pI810->PciInfo->chipType == PCI_CHIP_I810_E) @@ -317,11 +334,17 @@ #define IS_I830(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I830_M) #define IS_845G(pI810) (pI810->PciInfo->chipType == PCI_CHIP_845_G) #define IS_I85X(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I855_GM) +#define IS_I852(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I855_GM && (pI810->variant == I852_GM || pI810->variant == I852_GME)) +#define IS_I855(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I855_GM && (pI810->variant == I855_GM || pI810->variant == I855_GME)) #define IS_I865G(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I865_G) -#define IS_I915G(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I915_G) + +#define IS_I915G(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I915_G || pI810->PciInfo->chipType == PCI_CHIP_E7221_G) #define IS_I915GM(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I915_GM) +#define IS_I945G(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I945_G) +#define IS_I945GM(pI810) (pI810->PciInfo->chipType == PCI_CHIP_I945_GM) +#define IS_I9XX(pI810) (IS_I915G(pI810) || IS_I915GM(pI810) || IS_I945G(pI810) || IS_I945GM(pI810)) -#define IS_MOBILE(pI810) (IS_I830(pI810) || IS_I85X(pI810) || IS_I915GM(pI810)) +#define IS_MOBILE(pI810) (IS_I830(pI810) || IS_I85X(pI810) || IS_I915GM(pI810) || IS_I945GM(pI810)) #define GTT_PAGE_SIZE KB(4) #define ROUND_TO(x, y) (((x) + (y) - 1) / (y) * (y)) Index: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man diff -u xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man:1.9 xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man:1.9 Mon Jan 31 21:25:07 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man Fri Mar 10 07:44:20 2006 @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man,v 1.9 2005/02/01 02:25:07 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.man,v 1.11 2006/03/10 12:44:20 alanh Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH I810 __drivermansuffix__ __vendorversion__ @@ -162,21 +162,19 @@ different refresh rate than the primary. Default: 60Hz. .TP -.BI "Option \*qCheckLid\*q \*q" boolean \*q -On mobile platforms it's desirable to monitor the lid status and switch -the outputs accordingly when the lid is opened or closed. By default this -option is on, but may incur a very minor performance penalty as we need -to poll a register on the card to check for this activity. It can be -turned off using this option. This only works with the 830M, 852GM and 855GM -systems. +.BI "Option \*qCheckDevices\*q \*q" boolean \*q +On mobile platforms it's desirable to monitor the device status and switch +the outputs accordingly. For example, when the lid is opened or closed, or +when using hotkeys without ACPI support. By default this option is on for +mobile platforms and is not available on desktop systems. Default: enabled. .TP -.BI "Option \*qFlipPrimary\*q \*q" boolean \*q -When using a dual pipe system, it may be preferable to switch the primary -screen to the alternate pipe to display on the other monitor connection. -NOTE: Using this option may cause text mode to be restored incorrectly, -and thus should be used with caution. -Default: disabled. +.BI "Option \*qFixedPipe\*q \*q" anystr \*q +When using a dual pipe system, it may be preferable to fix the primary pipe +such that if you boot up on an external screen you may want the internal +flat panel to be the primary. Using this option will allow this. +Options are A or B. +Default: disabled (uses current pipe as primary). .TP .BI "Option \*qDisplayInfo\*q \*q" boolean \*q It has been found that a certain BIOS call can lockup the Xserver because @@ -190,6 +188,17 @@ the machine has booted, but unfortunately it doesn't always work and is extremely dependent upon the Video BIOS. Default: disabled +.TP +.BI "Option \*qRotate\*q \*qCW\*q" +.TP +.BI "Option \*qRotate\*q \*qCCW\*q" +Rotate the desktop 90 degrees clockwise or counterclockwise. This option +forces the ShadowFB option on, and disables acceleration. +Default: no rotation. +.TP +.BI "Option \*qShadowFB\*q \*q" boolean \*q +Enable or disable use of the shadow framebuffer layer. This option +disables acceleration. Default: off. .SH "SEE ALSO" XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__) Index: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c:1.113 xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c:1.125 --- xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c:1.113 Thu Feb 17 21:55:08 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c Thu Mar 16 11:50:08 2006 @@ -72,7 +72,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.113 2005/02/18 02:55:08 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.125 2006/03/16 16:50:08 dawes Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: @@ -121,7 +121,7 @@ #include "fb.h" #include "regionstr.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "vbe.h" #include "i810.h" @@ -176,7 +176,10 @@ {PCI_CHIP_I855_GM, "852GM/855GM"}, {PCI_CHIP_I865_G, "865G"}, {PCI_CHIP_I915_G, "915G"}, + {PCI_CHIP_E7221_G, "E7221 (i915)"}, {PCI_CHIP_I915_GM, "915GM"}, + {PCI_CHIP_I945_G, "945G"}, + {PCI_CHIP_I945_GM, "945GM"}, {-1, NULL} }; @@ -192,7 +195,10 @@ {PCI_CHIP_I855_GM, PCI_CHIP_I855_GM, RES_SHARED_VGA}, {PCI_CHIP_I865_G, PCI_CHIP_I865_G, RES_SHARED_VGA}, {PCI_CHIP_I915_G, PCI_CHIP_I915_G, RES_SHARED_VGA}, + {PCI_CHIP_E7221_G, PCI_CHIP_E7221_G, RES_SHARED_VGA}, {PCI_CHIP_I915_GM, PCI_CHIP_I915_GM, RES_SHARED_VGA}, + {PCI_CHIP_I945_G, PCI_CHIP_I945_G, RES_SHARED_VGA}, + {PCI_CHIP_I945_GM, PCI_CHIP_I945_GM, RES_SHARED_VGA}, {-1, -1, RES_UNDEFINED } }; @@ -253,19 +259,17 @@ const char *I810vbeSymbols[] = { "VBEFreeModeInfo", "VBEFreeVBEInfo", + "VBEGetDisplayStart", "VBEGetModeInfo", - "VBEGetModePool", "VBEGetVBEInfo", "VBEGetVBEMode", "VBEInit", - "VBEPrintModes", "VBESaveRestore", "VBESetDisplayStart", "VBESetGetDACPaletteFormat", "VBESetGetLogicalScanlineLength", "VBESetGetPaletteData", "VBESetModeNames", - "VBESetModeParameters", "VBESetVBEMode", "VBEValidateModes", "vbeDoEDID", @@ -289,6 +293,7 @@ const char *I810int10Symbols[] = { "xf86ExecX86int10", + "xf86FreeInt10", "xf86InitInt10", "xf86Int10AllocPages", "xf86int10Addr", @@ -351,25 +356,22 @@ "DRICreatePCIBusID", NULL }; +#endif -#ifdef XF86DRI - -static const char *driShadowFBSymbols[] = { +const char *I810shadowFBSymbols[] = { "ShadowFBInit", NULL }; +#ifdef XF86DRI const char *I810shadowSymbols[] = { "shadowInit", "shadowSetup", "shadowAdd", NULL }; - #endif -#endif /* I830_ONLY */ - #ifndef I810_DEBUG int I810_DEBUG = (0 /* | DEBUG_ALWAYS_SYNC */ @@ -415,7 +417,7 @@ XF86ModuleData i810ModuleData = { &i810VersRec, i810Setup, 0 }; static pointer -i810Setup(pointer module, pointer opts, int *errmaj, int *errmin) +i810Setup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = 0; @@ -429,16 +431,16 @@ * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(I810vgahwSymbols, - I810fbSymbols, I810xaaSymbols, I810ramdacSymbols, + LoaderModRefSymLists(module, I810vgahwSymbols, + I810fbSymbols, I810xaaSymbols, I810ramdacSymbols, #ifdef XF86DRI - I810drmSymbols, - I810driSymbols, - I810shadowSymbols, - driShadowFBSymbols, -#endif - I810vbeSymbols, vbeOptionalSymbols, - I810ddcSymbols, I810int10Symbols, NULL); + I810drmSymbols, + I810driSymbols, + I810shadowSymbols, +#endif + I810shadowFBSymbols, + I810vbeSymbols, vbeOptionalSymbols, + I810ddcSymbols, I810int10Symbols, NULL); /* * The return value must be non-NULL on success even though there @@ -609,7 +611,10 @@ case PCI_CHIP_I830_M: case PCI_CHIP_I855_GM: case PCI_CHIP_I915_G: + case PCI_CHIP_E7221_G: case PCI_CHIP_I915_GM: + case PCI_CHIP_I945_G: + case PCI_CHIP_I945_GM: xf86SetEntitySharable(usedChips[i]); /* Allocate an entity private if necessary */ @@ -665,11 +670,14 @@ I810ProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; + ModuleDescPtr pMod; - if (xf86LoadSubModule(pScrn, "vbe")) { + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, I810vbeSymbols, NULL); pVbe = VBEInit(NULL, index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } @@ -679,18 +687,26 @@ vbeInfoPtr pVbe; xf86MonPtr MonInfo = NULL; I810Ptr pI810 = I810PTR(pScrn); + ModuleDescPtr pMod, pDDCMod; /* Honour Option "noDDC" */ if (xf86ReturnOptValBool(pI810->Options, OPTION_NO_DDC, FALSE)) { return MonInfo; } - if (xf86LoadSubModule(pScrn, "vbe") && (pVbe = VBEInit(NULL, index))) { - xf86LoaderReqSymLists(I810vbeSymbols, NULL); - MonInfo = vbeDoEDID(pVbe, NULL); - xf86PrintEDID(MonInfo); - xf86SetDDCproperties(pScrn, MonInfo); - vbeFree(pVbe); + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, I810vbeSymbols, NULL); + if ((pVbe = VBEInit(NULL, index))) { + if ((pDDCMod = xf86LoadSubModule(pScrn, "ddc"))) { + xf86LoaderModReqSymLists(pDDCMod, I810ddcSymbols, NULL); + MonInfo = vbeDoEDID(pVbe, pDDCMod); + xf86PrintEDID(MonInfo); + xf86SetDDCproperties(pScrn, MonInfo); + xf86UnloadSubModule(pDDCMod); + } + vbeFree(pVbe); + } + xf86UnloadSubModule(pMod); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "this driver cannot do DDC without VBE\n"); @@ -718,6 +734,7 @@ rgb defaultWeight = { 0, 0, 0 }; int mem; Bool enable; + ModuleDescPtr pMod; if (pScrn->numEntities != 1) return FALSE; @@ -742,10 +759,10 @@ } /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(I810vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, I810vgahwSymbols, NULL); /* Allocate a vgaHWRec */ if (!vgaHWGetHWRec(pScrn)) @@ -1070,29 +1087,29 @@ xf86SetDpi(pScrn, 0, 0); - if (!xf86LoadSubModule(pScrn, "fb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { I810FreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(I810fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, I810fbSymbols, NULL); if (xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE)) pI810->noAccel = TRUE; if (!pI810->noAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { I810FreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(I810xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, I810xaaSymbols, NULL); } if (!xf86ReturnOptValBool(pI810->Options, OPTION_SW_CURSOR, FALSE)) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { I810FreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(I810ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, I810ramdacSymbols, NULL); } if (xf86GetOptValInteger @@ -1128,13 +1145,13 @@ pI810->allowPageFlip = enable; if (pI810->allowPageFlip == enable) { - if (!xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { pI810->allowPageFlip = 0; xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't load shadowfb module:\n"); } else { - xf86LoaderReqSymLists(driShadowFBSymbols, NULL); + xf86LoaderModReqSymLists(pMod, I810shadowFBSymbols, NULL); } } @@ -1167,8 +1184,8 @@ #ifdef XF86DRI /* Load the dri module if requested. */ if (xf86ReturnOptValBool(pI810->Options, OPTION_DRI, FALSE)) { - if (xf86LoadSubModule(pScrn, "dri")) { - xf86LoaderReqSymLists(I810driSymbols, I810drmSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "dri"))) { + xf86LoaderModReqSymLists(pMod, I810driSymbols, I810drmSymbols, NULL); } } #endif @@ -2148,8 +2165,8 @@ #ifdef XF86DRI /* - * Setup DRI after visuals have been established, but before cfbScreenInit - * is called. cfbScreenInit will eventually call into the drivers + * Setup DRI after visuals have been established, but before fbScreenInit + * is called. fbScreenInit will eventually call into the drivers * InitGLXVisuals call back. */ /* @@ -2291,18 +2308,16 @@ #ifdef XF86DRI if (pI810->directRenderingEnabled) { - /* Now that mi, cfb, drm and others have done their thing, + /* Now that mi, fb, drm and others have done their thing, * complete the DRI setup. */ pI810->directRenderingEnabled = I810DRIFinishScreenInit(pScreen); } -#ifdef XvMCExtension if ((pI810->directRenderingEnabled) && (pI810->numSurfaces)) { /* Initialize the hardware motion compensation code */ I810InitMC(pScreen); } #endif -#endif if (pI810->directRenderingEnabled) { xf86DrvMsg(pScrn->scrnIndex, driFrom, "Direct rendering enabled\n"); Index: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_hwmc.c diff -u xc/programs/Xserver/hw/xfree86/drivers/i810/i810_hwmc.c:1.6 xc/programs/Xserver/hw/xfree86/drivers/i810/i810_hwmc.c:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/i810/i810_hwmc.c:1.6 Fri Dec 10 11:07:02 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i810_hwmc.c Fri Oct 14 11:16:41 2005 @@ -32,7 +32,7 @@ * * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_hwmc.c,v 1.6 2004/12/10 16:07:02 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_hwmc.c,v 1.7 2005/10/14 15:16:41 tsi Exp $ */ #include "xf86.h" @@ -50,8 +50,8 @@ #include "xf86xv.h" #include "xf86xvmc.h" -#include "Xv.h" -#include "XvMC.h" +#include <X11/extensions/Xv.h> +#include <X11/extensions/XvMC.h> #include "xaa.h" #include "dixstruct.h" #include "fourcc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c:1.28 xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c:1.29 --- xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c:1.28 Mon Mar 29 11:25:17 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c Fri Oct 14 11:16:41 2005 @@ -23,7 +23,7 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c,v 1.28 2004/03/29 16:25:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c,v 1.29 2005/10/14 15:16:41 tsi Exp $ */ /* * i810_video.c: i810 Xv driver. Based on the mga Xv driver by Mark Vojkovich. @@ -46,7 +46,7 @@ #include "i810.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "xaa.h" #include "dixstruct.h" #include "fourcc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/i810/i830.h diff -u xc/programs/Xserver/hw/xfree86/drivers/i810/i830.h:1.18 xc/programs/Xserver/hw/xfree86/drivers/i810/i830.h:1.22 --- xc/programs/Xserver/hw/xfree86/drivers/i810/i830.h:1.18 Thu Mar 3 13:06:26 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830.h Fri Mar 10 07:44:20 2006 @@ -27,7 +27,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830.h,v 1.18 2005/03/03 18:06:26 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830.h,v 1.22 2006/03/10 12:44:20 alanh Exp $ */ /* * Authors: @@ -91,7 +91,7 @@ typedef struct _VESARec { /* SVGA state */ pointer state, pstate; - int statePage, stateSize, stateMode; + int statePage, stateSize, stateMode, stateRefresh; CARD32 *savedPal; int savedScanlinePitch; xf86MonPtr monitor; @@ -151,9 +151,7 @@ ScrnInfoPtr pScrn_1; ScrnInfoPtr pScrn_2; int RingRunning; -#ifdef I830_XV int XvInUse; -#endif } I830EntRec, *I830EntPtr; typedef struct _I830Rec { @@ -165,13 +163,17 @@ Bool newPipeSwitch; + Bool fakeSwitch; + + int fixedPipe; + Bool Clone; int CloneRefresh; int CloneHDisplay; int CloneVDisplay; I830EntPtr entityPrivate; - int pipe; + int pipe, origPipe; int init; unsigned int bufferOffset; /* for I830SelectBuffer */ @@ -208,10 +210,10 @@ I830MemRange Dummy; #endif -#ifdef I830_XV /* For Xvideo */ I830MemRange *OverlayMem; -#endif + I830MemRange LinearMem; + unsigned int LinearAlloc; #ifdef XF86DRI I830MemRange BackBuffer; @@ -234,6 +236,7 @@ int MonType1; int MonType2; + Bool specifiedMonitor; DGAModePtr DGAModes; int numDGAModes; @@ -275,12 +278,10 @@ Bool XvDisabled; /* Xv disabled in PreInit. */ Bool XvEnabled; /* Xv enabled for this generation. */ -#ifdef I830_XV int colorKey; XF86VideoAdaptorPtr adaptor; ScreenBlockHandlerProcPtr BlockHandler; Bool *overlayOn; -#endif Bool directRenderingDisabled; /* DRI disabled in PreInit. */ Bool directRenderingEnabled; /* DRI enabled this generation. */ @@ -297,7 +298,15 @@ drm_handle_t ring_map; #endif + /* Broken-out options. */ OptionInfoPtr Options; + int rotate; + Bool shadowFB; + + /* Support for shadowFB and rotation. */ + unsigned char *shadowPtr; + int shadowPitch; + void (*PointerMoved)(int, int, int); /* Stolen memory support */ Bool StolenOnly; @@ -320,10 +329,12 @@ /* Use BIOS call 0x5f05 to set the refresh rate. */ Bool useExtendedRefresh; - Bool checkLid; + Bool checkDevices; int monitorSwitch; int operatingDevices; int savedDevices; + int toggleDevices; + int lastDevice0, lastDevice1, lastDevice2; /* These are indexed by the display types */ Bool displayAttached[NumDisplayTypes]; @@ -343,6 +354,7 @@ Bool starting; Bool closing; Bool suspended; + Bool leaving; /* fbOffset converted to (x, y). */ int xoffset; @@ -353,7 +365,7 @@ Bool displayInfo; Bool devicePresence; - OsTimerPtr lidTimer; + OsTimerPtr devicesTimer; } I830Rec; #define I830PTR(p) ((I830Ptr)((p)->driverPrivate)) @@ -379,11 +391,9 @@ extern Bool I830DGAInit(ScreenPtr pScreen); -#ifdef I830_XV extern void I830InitVideo(ScreenPtr pScreen); extern void I830VideoSwitchModeBefore(ScrnInfoPtr pScrn, DisplayModePtr mode); extern void I830VideoSwitchModeAfter(ScrnInfoPtr pScrn, DisplayModePtr mode); -#endif #ifdef XF86DRI extern Bool I830Allocate3DMemory(ScrnInfoPtr pScrn, const int flags); @@ -424,19 +434,27 @@ extern void I830ChangeFrontbuffer(ScrnInfoPtr pScrn,int buffer); -extern DisplayModePtr i830GetModePool(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, - VbeInfoBlock *vbe, int modeTypes); -extern void i830SetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe); -extern void i830PrintModes(ScrnInfoPtr pScrn); +extern DisplayModePtr I830GetModePool(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, + VbeInfoBlock *vbe); +extern void I830SetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe); +extern void I830UnsetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe); +extern void I830PrintModes(ScrnInfoPtr pScrn); extern int I830GetBestRefresh(ScrnInfoPtr pScrn, int refresh); +extern Bool I830CheckModeSupport(ScrnInfoPtr pScrn, int x, int y, int mode); +extern void I830PointerMoved(int index, int x, int y); +extern void I830RefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox); +extern void I830RefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox); +extern void I830RefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox); +extern void I830RefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox); +extern void I830RefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox); /* * 12288 is set as the maximum, chosen because it is enough for * 1920x1440@32bpp with a 2048 pixel line pitch with some to spare. */ #define I830_MAXIMUM_VBIOS_MEM 12288 -#define I830_DEFAULT_VIDEOMEM_2D (MB(8) / 1024) -#define I830_DEFAULT_VIDEOMEM_3D (MB(32) / 1024) +#define I830_DEFAULT_VIDEOMEM_2D (MB(32) / 1024) +#define I830_DEFAULT_VIDEOMEM_3D (MB(64) / 1024) /* Flags for memory allocation function */ #define FROM_ANYWHERE 0x00000000 Index: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c diff -u xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c:1.9 xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c:1.9 Sun Jan 9 15:47:19 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c Fri Mar 10 08:07:42 2006 @@ -26,7 +26,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c,v 1.9 2005/01/09 20:47:19 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c,v 1.12 2006/03/10 13:07:42 alanh Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: @@ -82,7 +82,7 @@ DPRINTF(PFX, "I830InitHWCursor\n"); /* Initialise the HW cursor registers, leaving the cursor hidden. */ - if (IS_MOBILE(pI830) || IS_I915G(pI830)) { + if (IS_MOBILE(pI830) || IS_I9XX(pI830)) { temp = INREG(CURSOR_A_CONTROL); temp &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE | MCURSOR_MEM_TYPE_LOCAL | MCURSOR_PIPE_SELECT); @@ -108,6 +108,8 @@ temp &= ~(CURSOR_FORMAT_MASK | CURSOR_GAMMA_ENABLE | CURSOR_ENABLE | CURSOR_STRIDE_MASK); temp |= (CURSOR_FORMAT_3C); + if (pI830->CursorIsARGB) + temp |= CURSOR_GAMMA_ENABLE; /* This initialises the format and leave the cursor disabled. */ OUTREG(CURSOR_CONTROL, temp); /* Need to set address and size after disabling. */ @@ -135,8 +137,8 @@ if (!infoPtr) return FALSE; - infoPtr->MaxWidth = 64; - infoPtr->MaxHeight = 64; + infoPtr->MaxWidth = I810_CURSOR_X; + infoPtr->MaxHeight = I810_CURSOR_Y; infoPtr->Flags = (HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | HARDWARE_CURSOR_BIT_ORDER_MSBFIRST | HARDWARE_CURSOR_INVERT_MASK | @@ -304,7 +306,7 @@ } /* have to upload the base for the new position */ - if (IS_I915G(pI830) || IS_I915GM(pI830)) { + if (IS_I9XX(pI830)) { if (pI830->CursorIsARGB) OUTREG(CURSOR_A_BASE, pI830->CursorMemARGB->Physical); else @@ -335,11 +337,11 @@ pI830->CursorMemARGB->Physical, pI830->CursorMemARGB->Start); pI830->cursorOn = TRUE; - if (IS_MOBILE(pI830) || IS_I915G(pI830)) { + if (IS_MOBILE(pI830) || IS_I9XX(pI830)) { temp = INREG(CURSOR_A_CONTROL); temp &= ~(CURSOR_MODE | MCURSOR_PIPE_SELECT); if (pI830->CursorIsARGB) - temp |= CURSOR_MODE_64_ARGB_AX; + temp |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE; else temp |= CURSOR_MODE_64_4C_AX; temp |= (pI830->pipe << 28); /* Connect to correct pipe */ @@ -363,7 +365,7 @@ temp &= ~(CURSOR_FORMAT_MASK); temp |= CURSOR_ENABLE; if (pI830->CursorIsARGB) - temp |= CURSOR_FORMAT_ARGB; + temp |= CURSOR_FORMAT_ARGB | CURSOR_GAMMA_ENABLE; else temp |= CURSOR_FORMAT_3C; OUTREG(CURSOR_CONTROL, temp); @@ -383,9 +385,9 @@ DPRINTF(PFX, "I830HideCursor\n"); pI830->cursorOn = FALSE; - if (IS_MOBILE(pI830) || IS_I915G(pI830)) { + if (IS_MOBILE(pI830) || IS_I9XX(pI830)) { temp = INREG(CURSOR_A_CONTROL); - temp &= ~CURSOR_MODE; + temp &= ~(CURSOR_MODE|MCURSOR_GAMMA_ENABLE); temp |= CURSOR_MODE_DISABLE; OUTREG(CURSOR_A_CONTROL, temp); /* This is needed to flush the above change. */ @@ -402,7 +404,7 @@ } } else { temp = INREG(CURSOR_CONTROL); - temp &= ~CURSOR_ENABLE; + temp &= ~(CURSOR_ENABLE|CURSOR_GAMMA_ENABLE); OUTREG(CURSOR_CONTROL, temp); } } Index: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c diff -u xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c:1.21 xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c:1.22 --- xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c:1.21 Tue Feb 1 14:49:40 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c Thu Jun 9 05:28:02 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c,v 1.21 2005/02/01 19:49:40 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c,v 1.22 2005/06/09 09:28:02 alanh Exp $ */ /************************************************************************** Copyright 2001 VA Linux Systems Inc., Fremont, California. @@ -593,9 +593,6 @@ drmFreeVersion(version); return FALSE; } - if (version->version_minor < 2) - xf86DrvMsg(pScreen->myNum, X_WARNING, - "Resume functionality not available with DRM < 1.2\n"); pI830->drmMinor = version->version_minor; drmFreeVersion(version); } Index: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c:1.64 xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c:1.94 --- xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c:1.64 Thu Mar 3 13:06:26 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c Thu Mar 30 17:35:42 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c,v 1.64 2005/03/03 18:06:26 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c,v 1.94 2006/03/30 22:35:42 dawes Exp $ */ /************************************************************************** Copyright 2001 VA Linux Systems Inc., Fremont, California. @@ -103,12 +103,10 @@ * 18/10/2001 * - Fixed a bug in I830BIOSLeaveVT() which caused a bug when you * switched VT's - */ -/* + * * 07/2002 David Dawes * - Add Intel(R) 855GM/852GM support. - */ -/* + * * 07/2002 David Dawes * - Cleanup code formatting. * - Improve VESA mode selection, and fix refresh rate selection. @@ -128,21 +126,24 @@ * 08/2002 Keith Whitwell * - Fix DRI initialisation. * - * * 08/2002 Alan Hourihane and David Dawes * - Add XVideo support. * - * * 10/2002 David Dawes * - Add Intel(R) 865G support. * - * * 01/2004 Alan Hourihane * - Add Intel(R) 915G support. * - Add Dual Head and Clone capabilities. * - Add lid status checking * - Fix Xvideo with high-res LFP's * - Add ARGB HW cursor support + * + * 05/2005 Alan Hourihane + * - Add Intel(R) 945G support. + * + * 09/2005 Alan Hourihane + * - Add Intel(R) 945GM support. */ #ifndef PRINT_MODE_INFO @@ -160,11 +161,12 @@ #include "vgaHW.h" #include "mipointer.h" #include "micmap.h" +#include "shadowfb.h" #include "fb.h" #include "regionstr.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "vbe.h" #include "vbeModes.h" @@ -185,7 +187,10 @@ {PCI_CHIP_I855_GM, "852GM/855GM"}, {PCI_CHIP_I865_G, "865G"}, {PCI_CHIP_I915_G, "915G"}, + {PCI_CHIP_E7221_G, "E7221 (i915)"}, {PCI_CHIP_I915_GM, "915GM"}, + {PCI_CHIP_I945_G, "945G"}, + {PCI_CHIP_I945_GM, "945GM"}, {-1, NULL} }; @@ -195,7 +200,10 @@ {PCI_CHIP_I855_GM, PCI_CHIP_I855_GM, RES_SHARED_VGA}, {PCI_CHIP_I865_G, PCI_CHIP_I865_G, RES_SHARED_VGA}, {PCI_CHIP_I915_G, PCI_CHIP_I915_G, RES_SHARED_VGA}, + {PCI_CHIP_E7221_G, PCI_CHIP_E7221_G, RES_SHARED_VGA}, {PCI_CHIP_I915_GM, PCI_CHIP_I915_GM, RES_SHARED_VGA}, + {PCI_CHIP_I945_G, PCI_CHIP_I945_G, RES_SHARED_VGA}, + {PCI_CHIP_I945_GM, PCI_CHIP_I945_GM, RES_SHARED_VGA}, {-1, -1, RES_UNDEFINED} }; @@ -220,8 +228,11 @@ OPTION_MONITOR_LAYOUT, OPTION_CLONE, OPTION_CLONE_REFRESH, - OPTION_CHECKLID, - OPTION_FLIP_PRIMARY + OPTION_CHECKDEVICES, + OPTION_FIXEDPIPE, + OPTION_SHADOW_FB, + OPTION_ROTATE, + OPTION_LINEARALLOC } I830Opts; static OptionInfoRec I830BIOSOptions[] = { @@ -239,8 +250,11 @@ {OPTION_MONITOR_LAYOUT, "MonitorLayout", OPTV_ANYSTR,{0}, FALSE}, {OPTION_CLONE, "Clone", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_CLONE_REFRESH,"CloneRefresh",OPTV_INTEGER, {0}, FALSE}, - {OPTION_CHECKLID, "CheckLid", OPTV_BOOLEAN, {0}, FALSE}, - {OPTION_FLIP_PRIMARY,"FlipPrimary", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_CHECKDEVICES, "CheckDevices",OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_FIXEDPIPE, "FixedPipe", OPTV_ANYSTR, {0}, FALSE}, + {OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE}, + {OPTION_LINEARALLOC, "LinearAlloc", OPTV_INTEGER, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; /* *INDENT-ON* */ @@ -253,7 +267,7 @@ static Bool I830BIOSEnterVT(int scrnIndex, int flags); static Bool I830VESASetVBEMode(ScrnInfoPtr pScrn, int mode, VbeCRTCInfoBlock *block); -static CARD32 I830LidTimer(OsTimerPtr timer, CARD32 now, pointer arg); +static CARD32 I830CheckDevicesTimer(OsTimerPtr timer, CARD32 now, pointer arg); static Bool SetPipeAccess(ScrnInfoPtr pScrn); static Bool IsPrimary(ScrnInfoPtr pScrn); @@ -395,7 +409,115 @@ } } +static int +GetToggleList(ScrnInfoPtr pScrn, int toggle) +{ + vbeInfoPtr pVbe = I830PTR(pScrn)->pVbe; + + DPRINTF(PFX, "GetToggleList\n"); + + pVbe->pInt10->num = 0x10; + pVbe->pInt10->ax = 0x5f64; + pVbe->pInt10->bx = 0x500; + + pVbe->pInt10->bx |= toggle; + + xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn); + if (Check5fStatus(pScrn, 0x5f64, pVbe->pInt10->ax)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Toggle (%d) 0x%x\n", toggle, pVbe->pInt10->cx); + return pVbe->pInt10->cx & 0xffff; + } + + return 0; +} + +static int +GetNextDisplayDeviceList(ScrnInfoPtr pScrn, int toggle) +{ + vbeInfoPtr pVbe = I830PTR(pScrn)->pVbe; + int devices = 0; + int pipe = 0; + int i; + + DPRINTF(PFX, "GetNextDisplayDeviceList\n"); + + pVbe->pInt10->num = 0x10; + pVbe->pInt10->ax = 0x5f64; + pVbe->pInt10->bx = 0xA00; + pVbe->pInt10->bx |= toggle; + pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base); + pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base); + + xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn); + if (!Check5fStatus(pScrn, 0x5f64, pVbe->pInt10->ax)) + return 0; + + for (i=0; i<(pVbe->pInt10->cx & 0xff); i++) { + CARD32 VODA = (CARD32)((CARD32*)pVbe->memory)[i]; + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Next ACPI _DGS [%d] 0x%lx\n", + i, (unsigned long)VODA); + + /* Check if it's a custom Video Output Device Attribute */ + if (!(VODA & 0x80000000)) + continue; + + pipe = (VODA & 0x000000F0) >> 4; + + if (pipe != 0 && pipe != 1) { + pipe = 0; #if 0 + ErrorF("PIPE %d\n",pipe); +#endif + } + + switch ((VODA & 0x00000F00) >> 8) { + case 0x0: + case 0x1: /* CRT */ + devices |= PIPE_CRT << (pipe == 1 ? 8 : 0); + break; + case 0x2: /* TV/HDTV */ + devices |= PIPE_TV << (pipe == 1 ? 8 : 0); + break; + case 0x3: /* DFP */ + devices |= PIPE_DFP << (pipe == 1 ? 8 : 0); + break; + case 0x4: /* LFP */ + devices |= PIPE_LFP << (pipe == 1 ? 8 : 0); + break; + } + } + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ACPI Toggle devices 0x%x\n", devices); + + return devices; +} + +static int +GetAttachableDisplayDeviceList(ScrnInfoPtr pScrn) +{ + vbeInfoPtr pVbe = I830PTR(pScrn)->pVbe; + int i; + + DPRINTF(PFX, "GetAttachableDisplayDeviceList\n"); + + pVbe->pInt10->num = 0x10; + pVbe->pInt10->ax = 0x5f64; + pVbe->pInt10->bx = 0x900; + pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base); + pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base); + + xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn); + if (!Check5fStatus(pScrn, 0x5f64, pVbe->pInt10->ax)) + return 0; + + for (i=0; i<(pVbe->pInt10->cx & 0xff); i++) + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Attachable device 0x%lx.\n", + (unsigned long)((CARD32*)pVbe->memory)[i]); + + return pVbe->pInt10->cx & 0xffff; +} + static int BitToRefresh(int bits) { @@ -408,7 +530,7 @@ } static int -GetRefreshRate(ScrnInfoPtr pScrn, int mode, int refresh, int *availRefresh) +GetRefreshRate(ScrnInfoPtr pScrn, int mode, int *availRefresh) { vbeInfoPtr pVbe = I830PTR(pScrn)->pVbe; @@ -418,8 +540,6 @@ if (mode & 0x100) return 0; - SetPipeAccess(pScrn); - pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x5f05; pVbe->pInt10->bx = (mode & 0xff) | 0x100; @@ -432,7 +552,6 @@ } else return 0; } -#endif struct panelid { short hsize; @@ -590,6 +709,25 @@ return 0; } +#if 0 +static Bool +SetPowerStatus(ScrnInfoPtr pScrn, int mode) +{ + vbeInfoPtr pVbe = I830PTR(pScrn)->pVbe; + + pVbe->pInt10->num = 0x10; + pVbe->pInt10->ax = 0x5f64; + pVbe->pInt10->bx = 0x0800 | mode; + pVbe->pInt10->cx = 0x0000; + + xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn); + if (Check5fStatus(pScrn, 0x5f64, pVbe->pInt10->ax)) + return TRUE; + + return FALSE; +} +#endif + static Bool GetModeSupport(ScrnInfoPtr pScrn, int modePipeA, int modePipeB, int devicesPipeA, int devicesPipeB, int *maxBandwidth, @@ -602,7 +740,7 @@ /* Only 8-bit mode numbers are supported. */ if ((modePipeA & 0x100) || (modePipeB & 0x100)) - return 0; + return FALSE; pVbe->pInt10->num = 0x10; pVbe->pInt10->ax = 0x5f28; @@ -626,6 +764,7 @@ return FALSE; } +#if 0 static int GetLFPCompMode(ScrnInfoPtr pScrn) { @@ -644,7 +783,6 @@ return -1; } -#if 0 static Bool SetLFPCompMode(ScrnInfoPtr pScrn, int compMode) { @@ -697,15 +835,112 @@ pVbe->pInt10->bx = 0x100; xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn); - if (Check5fStatus(pScrn, 0x5f64, pVbe->pInt10->ax)) + if (Check5fStatus(pScrn, 0x5f64, pVbe->pInt10->ax)) { return pVbe->pInt10->cx & 0xffff; - else - return -1; + } else { + if (pI830->PciInfo->chipType == PCI_CHIP_E7221_G) /* FIXED CONFIG */ + return PIPE_CRT; + else + return -1; + } +} + +static int +GetBIOSPipe(ScrnInfoPtr pScrn) +{ + I830Ptr pI830 = I830PTR(pScrn); + vbeInfoPtr pVbe = pI830->pVbe; + int pipe; + + DPRINTF(PFX, "GetBIOSPipe:\n"); + + /* single pipe machines should always return Pipe A */ + if (pI830->availablePipes == 1) return 0; + + pVbe->pInt10->num = 0x10; + pVbe->pInt10->ax = 0x5f1c; + pVbe->pInt10->bx = 0x100; + + xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn); + if (Check5fStatus(pScrn, 0x5f1c, pVbe->pInt10->ax)) { + if (pI830->newPipeSwitch) { + pipe = ((pVbe->pInt10->bx & 0x0001)); + } else { + pipe = ((pVbe->pInt10->cx & 0x0100) >> 8); + } + return pipe; + } + + /* failed, assume pipe A */ + return 0; } -/* This is needed for SetDisplayDevices to work correctly on I915G - * and possibly later Video BIOS builds around 3272 (but not sure here). - * So enable for all chipsets now as it has no bad side effects, apart +static Bool +SetBIOSPipe(ScrnInfoPtr pScrn, int pipe) +{ + I830Ptr pI830 = I830PTR(pScrn); + vbeInfoPtr pVbe = pI830->pVbe; + + DPRINTF(PFX, "SetBIOSPipe: pipe 0x%x\n", pipe); + + /* single pipe machines should always return TRUE */ + if (pI830->availablePipes == 1) return TRUE; + + pVbe->pInt10->num = 0x10; + pVbe->pInt10->ax = 0x5f1c; + if (pI830->newPipeSwitch) { + pVbe->pInt10->bx = pipe; + pVbe->pInt10->cx = 0; + } else { + pVbe->pInt10->bx = 0x0; + pVbe->pInt10->cx = pipe << 8; + } + + xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn); + if (Check5fStatus(pScrn, 0x5f1c, pVbe->pInt10->ax)) { + return TRUE; + } + + return FALSE; +} + +static Bool +SetPipeAccess(ScrnInfoPtr pScrn) +{ + I830Ptr pI830 = I830PTR(pScrn); + + /* Don't try messing with the pipe, unless we're dual head */ + if (xf86IsEntityShared(pScrn->entityList[0]) || pI830->Clone || pI830->origPipe != pI830->pipe) { + if (!SetBIOSPipe(pScrn, pI830->pipe)) + return FALSE; + } + + return TRUE; +} + +static Bool +I830Set640x480(ScrnInfoPtr pScrn) +{ + I830Ptr pI830 = I830PTR(pScrn); + int m = 0x30; /* 640x480 8bpp */ + + switch (pScrn->depth) { + case 15: + m = 0x40; + break; + case 16: + m = 0x41; + break; + case 24: + m = 0x50; + break; + } + m |= (1 << 15) | (1 << 14); + return VBESetVBEMode(pI830->pVbe, m, NULL); +} + +/* This is needed for SetDisplayDevices to work correctly on I915G. + * Enable for all chipsets now as it has no bad side effects, apart * from slightly longer startup time. */ #define I915G_WORKAROUND @@ -716,35 +951,28 @@ I830Ptr pI830 = I830PTR(pScrn); vbeInfoPtr pVbe = pI830->pVbe; CARD32 temp; + int singlepipe = 0; #ifdef I915G_WORKAROUND - int getmode; - int mode; - switch (pScrn->depth) { - case 8: - mode = 0x30; - break; - case 15: - mode = 0x40; - break; - case 16: - mode = 0x41; - break; - case 24: - mode = 0x50; - break; - default: - mode = 0x30; - break; - } - mode |= (1 << 15) | (1 << 14); + int getmode1; + Bool setmode = FALSE; #endif DPRINTF(PFX, "SetDisplayDevices: devices 0x%x\n", devices); + if (!pI830->specifiedMonitor) + return TRUE; + #ifdef I915G_WORKAROUND - if (pI830->bios_version >= 3272) { - VBEGetVBEMode(pVbe, &getmode); - I830VESASetVBEMode(pScrn, mode, NULL); + if (pI830->preinit) + setmode = TRUE; + if (pI830->leaving) + setmode = FALSE; + if (pI830->closing) + setmode = FALSE; + + if (setmode) { + VBEGetVBEMode(pVbe, &getmode1); + I830Set640x480(pScrn); } #endif @@ -756,40 +984,134 @@ xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn); if (Check5fStatus(pScrn, 0x5f64, pVbe->pInt10->ax)) { #ifdef I915G_WORKAROUND - if (pI830->bios_version >= 3272) - I830VESASetVBEMode(pScrn, getmode, NULL); + if (setmode) { + VBESetVBEMode(pI830->pVbe, getmode1 | 1<<15, NULL); + } #endif + pI830->pipeEnabled[0] = (devices & 0xff) ? TRUE : FALSE; + pI830->pipeEnabled[1] = (devices & 0xff00) ? TRUE : FALSE; + return TRUE; } #ifdef I915G_WORKAROUND - if (pI830->bios_version >= 3272) - I830VESASetVBEMode(pScrn, getmode, NULL); + if (setmode) + VBESetVBEMode(pI830->pVbe, getmode1 | 1<<15, NULL); #endif - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "SetDisplayDevices call failed, writing config directly to SWF0.\n"); - temp = INREG(SWF0); - OUTREG(SWF0, (temp & ~(0xffff)) | (devices & 0xffff)); + if (devices & 0xff) { + pVbe->pInt10->num = 0x10; + pVbe->pInt10->ax = 0x5f64; + pVbe->pInt10->bx = 0x1; + pVbe->pInt10->cx = devices & 0xff; - /* Now try to program the registers directly if the BIOS failed. - * This currently only turns on the CRT, but should be made to handle - * SDVO, TV, LFP etc. etc. - */ + xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn); + if (Check5fStatus(pScrn, 0x5f64, pVbe->pInt10->ax)) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Successfully set display devices to 0x%x.\n",devices & 0xff); + singlepipe = devices & 0xff00; /* set alternate */ + } else { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Failed to set display devices to 0x%x.\n",devices & 0xff); + singlepipe = devices; + } + } else + singlepipe = devices; + + if (singlepipe == devices && devices & 0xff00) { + pVbe->pInt10->num = 0x10; + pVbe->pInt10->ax = 0x5f64; + pVbe->pInt10->bx = 0x1; + pVbe->pInt10->cx = devices & 0xff00; + + xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn); + if (Check5fStatus(pScrn, 0x5f64, pVbe->pInt10->ax)) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Successfully set display devices to 0x%x.\n",devices & 0xff00); + singlepipe = devices & 0xff; /* set alternate */ + } else { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Failed to set display devices to 0x%x.\n",devices & 0xff00); + singlepipe = devices; + } + } + + /* LVDS doesn't exist on these */ + if (IS_I830(pI830) || IS_845G(pI830) || IS_I865G(pI830)) + singlepipe &= ~(PIPE_LFP | (PIPE_LFP<<8)); + + if (pI830->availablePipes == 1) + singlepipe &= 0xFF; + + /* Disable LVDS */ + if (singlepipe & PIPE_LFP) { + /* LFP on PipeA is unlikely! */ + OUTREG(0x61200, INREG(0x61200) & ~0x80000000); + OUTREG(0x61204, INREG(0x61204) & ~0x00000001); + while ((INREG(0x61200) & 0x80000000) || (INREG(0x61204) & 1)); + /* Fix up LVDS */ + OUTREG(LVDS, (INREG(LVDS) & ~1<<30) | 0x80000300); + /* Enable LVDS */ + OUTREG(0x61200, INREG(0x61200) | 0x80000000); + OUTREG(0x61204, INREG(0x61204) | 0x00000001); + while (!(INREG(0x61200) & 0x80000000) && !(INREG(0x61204) & 1)); + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Enabling LVDS directly. Pipe A.\n"); + } else + if (singlepipe & (PIPE_LFP << 8)) { + OUTREG(0x61200, INREG(0x61200) & ~0x80000000); + OUTREG(0x61204, INREG(0x61204) & ~0x00000001); + while ((INREG(0x61200) & 0x80000000) || (INREG(0x61204) & 1)); + /* Fix up LVDS */ + OUTREG(LVDS, (INREG(LVDS) | 1<<30) | 0x80000300); + /* Enable LVDS */ + OUTREG(0x61200, INREG(0x61200) | 0x80000000); + OUTREG(0x61204, INREG(0x61204) | 0x00000001); + while (!(INREG(0x61200) & 0x80000000) && !(INREG(0x61204) & 1)); + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Enabling LVDS directly. Pipe B.\n"); + } + else if (!(IS_I830(pI830) || IS_845G(pI830) || IS_I865G(pI830))) { + if (!(devices & (PIPE_LFP | PIPE_LFP<<8))) { + OUTREG(0x61200, INREG(0x61200) & ~0x80000000); + OUTREG(0x61204, INREG(0x61204) & ~0x00000001); + while ((INREG(0x61200) & 0x80000000) || (INREG(0x61204) & 1)); + /* Fix up LVDS */ + OUTREG(LVDS, (INREG(LVDS) | 1<<30) & ~0x80000300); + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Disabling LVDS directly.\n"); + } + } + + /* Now try to program the registers directly if the BIOS failed. */ temp = INREG(ADPA); - temp &= ~0xc0000c00; + temp &= ~(ADPA_DAC_ENABLE | ADPA_PIPE_SELECT_MASK); + temp &= ~(ADPA_VSYNC_CNTL_DISABLE | ADPA_HSYNC_CNTL_DISABLE); /* Turn on ADPA */ - if (devices & PIPE_CRT) { + if (singlepipe & PIPE_CRT) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "BIOS call failed, turning ADPA on directly. Pipe A.\n"); - temp |= 0x80000000; - } - if ((devices >> 8) & PIPE_CRT) { + "Enabling ADPA directly. Pipe A.\n"); + temp |= ADPA_DAC_ENABLE | ADPA_PIPE_A_SELECT; + OUTREG(ADPA, temp); + } else + if (singlepipe & (PIPE_CRT << 8)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "BIOS call failed, turning ADPA on directly. Pipe B.\n"); - temp |= 0xC0000000; + "Enabling ADPA directly. Pipe B.\n"); + temp |= ADPA_DAC_ENABLE | ADPA_PIPE_B_SELECT; + OUTREG(ADPA, temp); + } + else { + if (!(devices & (PIPE_CRT | PIPE_CRT<<8))) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Disabling ADPA directly.\n"); + temp |= ADPA_VSYNC_CNTL_DISABLE | ADPA_HSYNC_CNTL_DISABLE; + OUTREG(ADPA, temp); + } } - OUTREG(ADPA, temp); + + xf86DrvMsg(pScrn->scrnIndex, X_WARNING,"Writing config directly to SWF0.\n"); + temp = INREG(SWF0); + OUTREG(SWF0, (temp & ~(0xffff)) | (devices & 0xffff)); if (GetDisplayDevices(pScrn) != devices) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, @@ -798,6 +1120,9 @@ return FALSE; } + pI830->pipeEnabled[0] = (devices & 0xff) ? TRUE : FALSE; + pI830->pipeEnabled[1] = (devices & 0xff00) ? TRUE : FALSE; + return TRUE; } @@ -1085,7 +1410,7 @@ * The GTT varying according the the FbMapSize and the popup is 4KB */ range = (pI830->FbMapSize / (1024*1024)) + 4; - if (IS_I85X(pI830) || IS_I865G(pI830) || IS_I915G(pI830) || IS_I915GM(pI830)) { + if (IS_I85X(pI830) || IS_I865G(pI830) || IS_I9XX(pI830)) { switch (gmch_ctrl & I830_GMCH_GMS_MASK) { case I855_GMCH_GMS_STOLEN_1M: memsize = MB(1) - KB(range); @@ -1103,11 +1428,11 @@ memsize = MB(32) - KB(range); break; case I915G_GMCH_GMS_STOLEN_48M: - if (IS_I915G(pI830) || IS_I915GM(pI830)) + if (IS_I9XX(pI830)) memsize = MB(48) - KB(range); break; case I915G_GMCH_GMS_STOLEN_64M: - if (IS_I915G(pI830) || IS_I915GM(pI830)) + if (IS_I9XX(pI830)) memsize = MB(64) - KB(range); break; } @@ -1144,7 +1469,7 @@ int mmioFlags; I830Ptr pI830 = I830PTR(pScrn); -#if !defined(__alpha__) +#ifndef __alpha__ mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT; #else mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT | VIDMEM_SPARSE; @@ -1314,12 +1639,12 @@ * Original implementation by Christian Zietz in a stand-alone tool. */ static CARD32 -TweakMemorySize(ScrnInfoPtr pScrn, CARD32 newsize) +TweakMemorySize(ScrnInfoPtr pScrn, CARD32 newsize, Bool preinit) { #define SIZE 0x10000 #define _855_IDOFFSET (-23) #define _845_IDOFFSET (-19) - + const char *MAGICstring = "Total time for VGA POST:"; const int len = strlen(MAGICstring); I830Ptr pI830 = I830PTR(pScrn); @@ -1329,11 +1654,13 @@ CARD32 oldpermission; CARD32 ret = 0; int i,j = 0; - PCITAG tag =pciTag(0,0,0); - int reg = (IS_845G(pI830) || IS_I865G(pI830)) ? _845_DRAM_RW_CONTROL : _855_DRAM_RW_CONTROL; + int reg = (IS_845G(pI830) || IS_I865G(pI830)) ? _845_DRAM_RW_CONTROL + : _855_DRAM_RW_CONTROL; - if(!pI830->PciInfo - || !(IS_845G(pI830) || IS_I85X(pI830) || IS_I865G(pI830))) + PCITAG tag =pciTag(0,0,0); + + if(!pI830->PciInfo + || !(IS_845G(pI830) || IS_I85X(pI830) || IS_I865G(pI830))) return 0; if (!pI830->pVbe) @@ -1343,8 +1670,7 @@ pI830->pVbe->pInt10->BIOSseg << 4); if (!pI830->BIOSMemSizeLoc) { - - if (!pI830->preinit) + if (!preinit) return 0; /* Search for MAGIC string */ @@ -1360,30 +1686,32 @@ if (j < len) return 0; pI830->BIOSMemSizeLoc = (i - j + 1 + (IS_845G(pI830) - ? _845_IDOFFSET : _855_IDOFFSET)); + ? _845_IDOFFSET : _855_IDOFFSET)); } - + position = biosAddr + pI830->BIOSMemSizeLoc; oldsize = *(CARD32 *)position; - ret = oldsize - 0x21000; + ret = oldsize - 0x21000; + /* verify that register really contains current size */ - if (pI830->preinit && ((ret >> 16) != pI830->vbeInfo->TotalMemory)) + if (preinit && ((ret >> 16) != pI830->vbeInfo->TotalMemory)) return 0; oldpermission = pciReadLong(tag, reg); pciWriteLong(tag, reg, DRAM_WRITE | (oldpermission & 0xffff)); - + *(CARD32 *)position = newsize + 0x21000; - if (pI830->preinit) { + + if (preinit) { /* reinitialize VBE for new size */ VBEFreeVBEInfo(pI830->vbeInfo); vbeFree(pI830->pVbe); pI830->pVbe = VBEInit(NULL, pI830->pEnt->index); pI830->vbeInfo = VBEGetVBEInfo(pI830->pVbe); - + /* verify that change was successful */ - if (pI830->vbeInfo->TotalMemory != (newsize >> 16)) { + if (pI830->vbeInfo->TotalMemory != (newsize >> 16)){ ret = 0; *(CARD32 *)position = oldsize; } else { @@ -1407,7 +1735,7 @@ DPRINTF(PFX, "RestoreBIOSMemSize\n"); - if (TweakMemorySize(pScrn, pI830->saveBIOSMemSize)) + if (TweakMemorySize(pScrn, pI830->saveBIOSMemSize,FALSE)) return; if (!pI830->overrideBIOSMemSize) @@ -1471,49 +1799,180 @@ } } -/* - * Use the native method instead of the vgahw method. So far this is - * only used for 8-bit mode. - * - * XXX Look into using the 10-bit gamma correction mode for 15/16/24 bit, - * and see if a DirectColor visual can be offered. - */ +static CARD32 val8[256]; + static void I830LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual) { I830Ptr pI830; - int i, index; + int i,j, index; unsigned char r, g, b; CARD32 val, temp; + int palreg; + int dspreg, dspbase; DPRINTF(PFX, "I830LoadPalette: numColors: %d\n", numColors); pI830 = I830PTR(pScrn); if (pI830->pipe == 0) { - /* It seems that an initial read is needed. */ - temp = INREG(PALETTE_A); - for (i = 0; i < numColors; i++) { - index = indices[i]; - r = colors[index].red; - g = colors[index].green; - b = colors[index].blue; + palreg = PALETTE_A; + dspreg = DSPACNTR; + dspbase = DSPABASE; + } else { + palreg = PALETTE_B; + dspreg = DSPBCNTR; + dspbase = DSPBBASE; + } + + /* To ensure gamma is enabled we need to turn off and on the plane */ + temp = INREG(dspreg); + OUTREG(dspreg, temp & ~(1<<31)); + OUTREG(dspbase, INREG(dspbase)); + OUTREG(dspreg, temp | DISPPLANE_GAMMA_ENABLE); + OUTREG(dspbase, INREG(dspbase)); + + /* It seems that an initial read is needed. */ + temp = INREG(palreg); + + switch(pScrn->depth) { + case 15: + for (i = 0; i < numColors; i++) { + index = indices[i]; + r = colors[index].red; + g = colors[index].green; + b = colors[index].blue; val = (r << 16) | (g << 8) | b; - OUTREG(PALETTE_A + index * 4, val); + for (j = 0; j < 8; j++) { + OUTREG(palreg + index * 32 + (j * 4), val); + } } - } - if (pI830->pipe == 1) { - /* It seems that an initial read is needed. */ - temp = INREG(PALETTE_B); + break; + case 16: for (i = 0; i < numColors; i++) { + index = indices[i]; + r = colors[index / 2].red; + g = colors[index].green; + b = colors[index / 2].blue; + + val = (r << 16) | (g << 8) | b; + OUTREG(palreg + index * 16, val); + OUTREG(palreg + index * 16 + 4, val); + OUTREG(palreg + index * 16 + 8, val); + OUTREG(palreg + index * 16 + 12, val); + + if (index <= 31) { + r = colors[index].red; + g = colors[(index * 2) + 1].green; + b = colors[index].blue; + + val = (r << 16) | (g << 8) | b; + OUTREG(palreg + index * 32, val); + OUTREG(palreg + index * 32 + 4, val); + OUTREG(palreg + index * 32 + 8, val); + OUTREG(palreg + index * 32 + 12, val); + } + } + break; + default: +#if 1 + /* Dual head 8bpp modes seem to squish the primary's cmap - reload */ + if (IsPrimary(pScrn) && xf86IsEntityShared(pScrn->entityList[0]) && + pScrn->depth == 8) { + for(i = 0; i < numColors; i++) { + index = indices[i]; + r = colors[index].red; + g = colors[index].green; + b = colors[index].blue; + val8[index] = (r << 16) | (g << 8) | b; + } + } +#endif + for(i = 0; i < numColors; i++) { index = indices[i]; r = colors[index].red; g = colors[index].green; b = colors[index].blue; val = (r << 16) | (g << 8) | b; - OUTREG(PALETTE_B + index * 4, val); + OUTREG(palreg + index * 4, val); +#if 1 + /* Dual head 8bpp modes seem to squish the primary's cmap - reload */ + if (!IsPrimary(pScrn) && xf86IsEntityShared(pScrn->entityList[0]) && + pScrn->depth == 8) { + if (palreg == PALETTE_A) + OUTREG(PALETTE_B + index * 4, val8[index]); + else + OUTREG(PALETTE_A + index * 4, val8[index]); + } +#endif + } + break; + } +} + +static int +I830UseDDC(ScrnInfoPtr pScrn) +{ + xf86MonPtr DDC = (xf86MonPtr)(pScrn->monitor->DDC); + struct detailed_monitor_section* detMon; + struct monitor_ranges *mon_range = NULL; + int i; + + if (!DDC) return 0; + + /* Now change the hsync/vrefresh values of the current monitor to + * match those of DDC */ + for (i = 0; i < 4; i++) { + detMon = &DDC->det_mon[i]; + if(detMon->type == DS_RANGES) + mon_range = &detMon->section.ranges; + } + + if (!mon_range || mon_range->min_h == 0 || mon_range->max_h == 0 || + mon_range->min_v == 0 || mon_range->max_v == 0) + return 0; /* bad ddc */ + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using detected DDC timings\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\tHorizSync %d-%d\n", + mon_range->min_h, mon_range->max_h); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\tVertRefresh %d-%d\n", + mon_range->min_v, mon_range->max_v); +#define DDC_SYNC_TOLERANCE SYNC_TOLERANCE + if (pScrn->monitor->nHsync > 0) { + for (i = 0; i < pScrn->monitor->nHsync; i++) { + if ((1.0 - DDC_SYNC_TOLERANCE) * mon_range->min_h > + pScrn->monitor->hsync[i].lo || + (1.0 + DDC_SYNC_TOLERANCE) * mon_range->max_h < + pScrn->monitor->hsync[i].hi) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "config file hsync range %g-%gkHz not within DDC " + "hsync range %d-%dkHz\n", + pScrn->monitor->hsync[i].lo, pScrn->monitor->hsync[i].hi, + mon_range->min_h, mon_range->max_h); + } + pScrn->monitor->hsync[i].lo = mon_range->min_h; + pScrn->monitor->hsync[i].hi = mon_range->max_h; + } + } + + if (pScrn->monitor->nVrefresh > 0) { + for (i=0; i<pScrn->monitor->nVrefresh; i++) { + if ((1.0 - DDC_SYNC_TOLERANCE) * mon_range->min_v > + pScrn->monitor->vrefresh[i].lo || + (1.0 + DDC_SYNC_TOLERANCE) * mon_range->max_v < + pScrn->monitor->vrefresh[i].hi) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "config file vrefresh range %g-%gHz not within DDC " + "vrefresh range %d-%dHz\n", + pScrn->monitor->vrefresh[i].lo, pScrn->monitor->vrefresh[i].hi, + mon_range->min_v, mon_range->max_v); + } + pScrn->monitor->vrefresh[i].lo = mon_range->min_v; + pScrn->monitor->vrefresh[i].hi = mon_range->max_v; } } + + return mon_range->max_clock; } static void @@ -1521,6 +1980,8 @@ { I830Ptr pI830 = I830PTR(pScrn); + if (IsPrimary(pScrn)) + pI830->entityPrivate->pScrn_1 = NULL; if (IsPrimary(pScrn) && pI830->LpRing) { xfree(pI830->LpRing); pI830->LpRing = NULL; @@ -1553,77 +2014,6 @@ I830BIOSFreeRec(pScrn); } -static int -GetBIOSPipe(ScrnInfoPtr pScrn) -{ - I830Ptr pI830 = I830PTR(pScrn); - vbeInfoPtr pVbe = pI830->pVbe; - int pipe; - - DPRINTF(PFX, "GetBIOSPipe:\n"); - - /* single pipe machines should always return Pipe A */ - if (pI830->availablePipes == 1) return 0; - - pVbe->pInt10->num = 0x10; - pVbe->pInt10->ax = 0x5f1c; - pVbe->pInt10->bx = 0x100; - - xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn); - if (Check5fStatus(pScrn, 0x5f1c, pVbe->pInt10->ax)) { - if (pI830->newPipeSwitch) { - pipe = ((pVbe->pInt10->bx & 0x0001)); - } else { - pipe = ((pVbe->pInt10->cx & 0x0100) >> 8); - } - return pipe; - } - - return -1; -} - -static Bool -SetBIOSPipe(ScrnInfoPtr pScrn, int pipe) -{ - I830Ptr pI830 = I830PTR(pScrn); - vbeInfoPtr pVbe = pI830->pVbe; - - DPRINTF(PFX, "SetBIOSPipe: pipe 0x%x\n", pipe); - - /* single pipe machines should always return TRUE */ - if (pI830->availablePipes == 1) return TRUE; - - pVbe->pInt10->num = 0x10; - pVbe->pInt10->ax = 0x5f1c; - if (pI830->newPipeSwitch) { - pVbe->pInt10->bx = pipe; - pVbe->pInt10->cx = 0; - } else { - pVbe->pInt10->bx = 0x0; - pVbe->pInt10->cx = pipe << 8; - } - - xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn); - if (Check5fStatus(pScrn, 0x5f1c, pVbe->pInt10->ax)) - return TRUE; - - return FALSE; -} - -static Bool -SetPipeAccess(ScrnInfoPtr pScrn) -{ - I830Ptr pI830 = I830PTR(pScrn); - - /* Don't try messing with the pipe, unless we're dual head */ - if (xf86IsEntityShared(pScrn->entityList[0]) || pI830->Clone) { - if (!SetBIOSPipe(pScrn, pI830->pipe)) - return FALSE; - } - - return TRUE; -} - static Bool IsPrimary(ScrnInfoPtr pScrn) { @@ -1650,8 +2040,10 @@ int flags24; int defmon = 0; int i, n; + int DDCclock = 0; char *s; - pointer pDDCModule, pVBEModule; + DisplayModePtr p, pMon; + ModuleDescPtr pMod; Bool enable; const char *chipname; unsigned int ver; @@ -1661,14 +2053,14 @@ return FALSE; /* Load int10 module */ - if (!xf86LoadSubModule(pScrn, "int10")) + if (!(pMod = xf86LoadSubModule(pScrn, "int10"))) return FALSE; - xf86LoaderReqSymLists(I810int10Symbols, NULL); + xf86LoaderModReqSymLists(pMod, I810int10Symbols, NULL); /* Load vbe module */ - if (!(pVBEModule = xf86LoadSubModule(pScrn, "vbe"))) + if (!(pMod = xf86LoadVBEModule(pScrn))) return FALSE; - xf86LoaderReqSymLists(I810vbeSymbols, NULL); + xf86LoaderModReqSymLists(pMod, I810vbeSymbols, NULL); pEnt = xf86GetEntityInfo(pScrn->entityList[0]); @@ -1678,9 +2070,9 @@ } /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(I810vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, I810vgahwSymbols, NULL); /* Allocate a vgaHWRec */ if (!vgaHWGetHWRec(pScrn)) @@ -1801,9 +2193,18 @@ case PCI_CHIP_I915_G: chipname = "915G"; break; + case PCI_CHIP_E7221_G: + chipname = "E7221 (i915)"; + break; case PCI_CHIP_I915_GM: chipname = "915GM"; break; + case PCI_CHIP_I945_G: + chipname = "945G"; + break; + case PCI_CHIP_I945_GM: + chipname = "945GM"; + break; default: chipname = "unknown chipset"; break; @@ -1841,8 +2242,8 @@ pI830->LinearAddr = pI830->pEnt->device->MemBase; from = X_CONFIG; } else { - if (IS_I915G(pI830) || IS_I915GM(pI830)) { - pI830->LinearAddr = pI830->PciInfo->memBase[2] & 0xF0000000; + if (IS_I9XX(pI830)) { + pI830->LinearAddr = pI830->PciInfo->memBase[2] & 0xFF000000; from = X_PROBED; } else if (pI830->PciInfo->memBase[1] != 0) { /* XXX Check mask. */ @@ -1863,7 +2264,7 @@ pI830->MMIOAddr = pI830->pEnt->device->IOBase; from = X_CONFIG; } else { - if (IS_I915G(pI830) || IS_I915GM(pI830)) { + if (IS_I9XX(pI830)) { pI830->MMIOAddr = pI830->PciInfo->memBase[0] & 0xFFF80000; from = X_PROBED; } else if (pI830->PciInfo->memBase[1]) { @@ -1908,11 +2309,14 @@ pI830->FbMapSize = 0x4000000; /* 64MB - has this been tested ?? */ } } else { - if (IS_I915G(pI830) || IS_I915GM(pI830)) { + if (IS_I9XX(pI830)) { if (pI830->PciInfo->memBase[2] & 0x08000000) pI830->FbMapSize = 0x8000000; /* 128MB aperture */ else pI830->FbMapSize = 0x10000000; /* 256MB aperture */ + + if (pI830->PciInfo->chipType == PCI_CHIP_E7221_G) + pI830->FbMapSize = 0x8000000; /* 128MB aperture */ } else /* 128MB aperture for later chips */ pI830->FbMapSize = 0x8000000; @@ -1935,7 +2339,10 @@ } } - if (IS_MOBILE(pI830) || IS_I915G(pI830)) + if (pI830->PciInfo->chipType == PCI_CHIP_E7221_G) + pI830->availablePipes = 1; + else + if (IS_MOBILE(pI830) || IS_I9XX(pI830)) pI830->availablePipes = 2; else pI830->availablePipes = 1; @@ -2010,8 +2417,26 @@ } #endif + pI830->LinearAlloc = 0; + if (xf86GetOptValInteger(pI830->Options, OPTION_LINEARALLOC, + &(pI830->LinearAlloc))) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Allocating %dKbytes of memory\n", + pI830->LinearAlloc); + } + + pI830->fixedPipe = -1; + if ((s = xf86GetOptValString(pI830->Options, OPTION_FIXEDPIPE)) && + IsPrimary(pScrn)) { + + if (strstr(s, "A") || strstr(s, "a") || strstr(s, "0")) + pI830->fixedPipe = 0; + else if (strstr(s, "B") || strstr(s, "b") || strstr(s, "1")) + pI830->fixedPipe = 1; + } + pI830->MonType1 = PIPE_NONE; pI830->MonType2 = PIPE_NONE; + pI830->specifiedMonitor = FALSE; if ((s = xf86GetOptValString(pI830->Options, OPTION_MONITOR_LAYOUT)) && IsPrimary(pScrn)) { @@ -2091,6 +2516,8 @@ "Monitor 1 and 2 cannot be type NONE\n"); return FALSE; } + + pI830->specifiedMonitor = TRUE; } if (xf86ReturnOptValBool(pI830->Options, OPTION_CLONE, FALSE)) { @@ -2107,22 +2534,24 @@ return FALSE; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Enabling Clone Mode\n"); - pI830->CloneRefresh = 60; /* default to 60Hz */ - if (xf86GetOptValInteger(pI830->Options, OPTION_CLONE_REFRESH, + pI830->Clone = TRUE; + } + + pI830->CloneRefresh = 60; /* default to 60Hz */ + if (xf86GetOptValInteger(pI830->Options, OPTION_CLONE_REFRESH, &(pI830->CloneRefresh))) { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Clone Monitor Refresh Rate %d\n", + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Clone Monitor Refresh Rate %d\n", pI830->CloneRefresh); - } - /* See above i830refreshes on why 120Hz is commented out */ - if (pI830->CloneRefresh < 60 || pI830->CloneRefresh > 85 /* 120 */) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Bad Clone Refresh Rate\n"); - PreInitCleanup(pScrn); - return FALSE; - } - pI830->Clone = TRUE; } - if ((pI830->entityPrivate && IsPrimary(pScrn)) || pI830->Clone) { + /* See above i830refreshes on why 120Hz is commented out */ + if (pI830->CloneRefresh < 60 || pI830->CloneRefresh > 85 /* 120 */) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Bad Clone Refresh Rate\n"); + PreInitCleanup(pScrn); + return FALSE; + } + + if ((pI830->entityPrivate && IsPrimary(pScrn)) || pI830->Clone) { if ((!xf86GetOptValString(pI830->Options, OPTION_MONITOR_LAYOUT))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "You must have a MonitorLayout " "defined for use in a DualHead or Clone setup.\n"); @@ -2138,26 +2567,57 @@ } } + xf86GetOptValBool(pI830->Options, OPTION_SHADOW_FB, &pI830->shadowFB); + if (pI830->shadowFB) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: shadow FB enabled\n"); + } + + if ((s = xf86GetOptValString(pI830->Options, OPTION_ROTATE))) { + if(!xf86NameCmp(s, "CW")) { + /* accel is disabled below for shadowFB */ + pI830->shadowFB = TRUE; + pI830->rotate = 1; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Rotating screen clockwise - acceleration disabled\n"); + } else if(!xf86NameCmp(s, "CCW")) { + pI830->shadowFB = TRUE; + pI830->rotate = -1; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen" + "counter clockwise - acceleration disabled\n"); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid" + "value for Option \"Rotate\"\n", s); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Valid options are \"CW\" or \"CCW\"\n"); + } + } + + if (pI830->shadowFB && !pI830->noAccel) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "HW acceleration not supported with \"shadowFB\".\n"); + pI830->noAccel = TRUE; + } + /* * Let's setup the mobile systems to check the lid status */ if (IS_MOBILE(pI830)) { - pI830->checkLid = TRUE; + pI830->checkDevices = TRUE; - if (!xf86ReturnOptValBool(pI830->Options, OPTION_CHECKLID, TRUE)) { - pI830->checkLid = FALSE; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Checking Lid status disabled\n"); + if (!xf86ReturnOptValBool(pI830->Options, OPTION_CHECKDEVICES, TRUE)) { + pI830->checkDevices = FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Monitoring connected displays disabled\n"); } else if (pI830->entityPrivate && !IsPrimary(pScrn) && - !I830PTR(pI830->entityPrivate->pScrn_1)->checkLid) { + !I830PTR(pI830->entityPrivate->pScrn_1)->checkDevices) { /* If checklid is off, on the primary head, then * turn it off on the secondary*/ - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Checking Lid status disabled\n"); - pI830->checkLid = FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Monitoring connected displays disabled\n"); + pI830->checkDevices = FALSE; } else - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Checking Lid status enabled\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Monitoring connected displays enabled\n"); } else - pI830->checkLid = FALSE; + pI830->checkDevices = FALSE; /* * The "VideoRam" config file parameter specifies the total amount of @@ -2268,14 +2728,13 @@ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "BIOS now sees %ld kB VideoRAM\n", pI830->BIOSMemorySize / 1024); - } else - if ((pI830->saveBIOSMemSize = - TweakMemorySize(pScrn, pI830->newBIOSMemSize)) != 0) - pI830->overrideBIOSMemSize = TRUE; + } else if ((pI830->saveBIOSMemSize + = TweakMemorySize(pScrn, pI830->newBIOSMemSize,TRUE)) != 0) + pI830->overrideBIOSMemSize = TRUE; else { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "BIOS view of memory size can't be changed " - "(this is not an error).\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "BIOS view of memory size can't be changed " + "(this is not an error).\n"); } } } @@ -2285,6 +2744,7 @@ pI830->StolenMemory.Size / 1024); xf86DrvMsg(pScrn->scrnIndex, from, "VideoRAM: %d kByte\n", pScrn->videoRam); + pI830->TotalVideoRam = KB(pScrn->videoRam); /* @@ -2307,7 +2767,6 @@ pI830->XvDisabled = !xf86ReturnOptValBool(pI830->Options, OPTION_XVIDEO, TRUE); -#ifdef I830_XV if (xf86GetOptValInteger(pI830->Options, OPTION_VIDEO_KEY, &(pI830->colorKey))) { from = X_CONFIG; @@ -2323,7 +2782,6 @@ } xf86DrvMsg(pScrn->scrnIndex, from, "video overlay key set to 0x%x\n", pI830->colorKey); -#endif pI830->allowPageFlip = FALSE; enable = xf86ReturnOptValBool(pI830->Options, OPTION_PAGEFLIP, FALSE); @@ -2355,13 +2813,16 @@ v[2] = (ver & 0x0000ff00) >> 8; v[3] = (ver & 0x000000ff) >> 0; v[4] = 0; - + pI830->bios_version = atoi(v); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "BIOS Build: %d\n",pI830->bios_version); - /* BIOS build 3062 changed the pipe switching functionality */ + if (IS_I9XX(pI830)) + pI830->newPipeSwitch = TRUE; + else if (pI830->availablePipes == 2 && pI830->bios_version >= 3062) { + /* BIOS build 3062 changed the pipe switching functionality */ pI830->newPipeSwitch = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using new Pipe switch code\n"); } else @@ -2395,38 +2856,52 @@ pI830->savedDevices = GetDisplayDevices(pScrn); if (IsPrimary(pScrn)) { - pI830->pipe = GetBIOSPipe(pScrn); + pI830->pipe = pI830->origPipe = GetBIOSPipe(pScrn); - if (xf86ReturnOptValBool(pI830->Options, OPTION_FLIP_PRIMARY, FALSE)) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Primary flipping enabled\n"); - pI830->pipe = !pI830->pipe; + /* Override */ + if (pI830->fixedPipe != -1) { + if (xf86IsEntityShared(pScrn->entityList[0]) || pI830->Clone) { + pI830->pipe = pI830->fixedPipe; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Fixed Pipe setting primary to pipe %s.\n", + pI830->fixedPipe ? "B" : "A"); + } } - + /* If the monitors aren't setup, read from the current config */ - if (pI830->MonType1 == PIPE_NONE) + if (pI830->MonType1 == PIPE_NONE && pI830->MonType2 == PIPE_NONE) { pI830->MonType1 = pI830->savedDevices & 0xff; - if (pI830->MonType2 == PIPE_NONE) pI830->MonType2 = (pI830->savedDevices & 0xff00) >> 8; + } else { + /* Here, we've switched pipes from our primary */ + if (pI830->MonType1 == PIPE_NONE && pI830->pipe == 0) + pI830->pipe = 1; + if (pI830->MonType2 == PIPE_NONE && pI830->pipe == 1) + pI830->pipe = 0; + } pI830->operatingDevices = (pI830->MonType2 << 8) | pI830->MonType1; if (!xf86IsEntityShared(pScrn->entityList[0]) && !pI830->Clone) { - /* If we're not dual head or clone, turn off the second head, + /* If we're not dual head or clone, turn off the second head, * if monitorlayout is also specified. */ if (pI830->pipe == 0) pI830->operatingDevices = pI830->MonType1; else pI830->operatingDevices = pI830->MonType2 << 8; - - if (pI830->operatingDevices & 0xFF00) - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Primary Pipe is %s, switching off second monitor (0x%x)\n", - pI830->pipe ? "B" : "A", pI830->operatingDevices); } + + if (pI830->pipe != pI830->origPipe) + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Primary Pipe has been switched from original pipe (%s to %s)\n", + pI830->origPipe ? "B" : "A", pI830->pipe ? "B" : "A"); } else { I830Ptr pI8301 = I830PTR(pI830Ent->pScrn_1); pI830->operatingDevices = pI8301->operatingDevices; + pI830->pipe = !pI8301->pipe; + pI830->MonType1 = pI8301->MonType1; + pI830->MonType2 = pI8301->MonType2; } /* Buggy BIOS 3066 is known to cause this, so turn this off */ @@ -2454,26 +2929,25 @@ return FALSE; } - if (!SetDisplayDevices(pScrn, pI830->operatingDevices)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + if (IsPrimary(pScrn)) { + if (!SetDisplayDevices(pScrn, pI830->operatingDevices)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to switch to monitor configuration (0x%x)\n", pI830->operatingDevices); - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Please check the devices specified in your MonitorLayout\n"); - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "is configured correctly.\n"); - PreInitCleanup(pScrn); - return FALSE; + PreInitCleanup(pScrn); + return FALSE; + } } PrintDisplayDeviceInfo(pScrn); if (xf86IsEntityShared(pScrn->entityList[0])) { if (!IsPrimary(pScrn)) { - I830Ptr pI8301 = I830PTR(pI830Ent->pScrn_1); - pI830Ent->pScrn_2 = pScrn; - pI830->pipe = !pI8301->pipe; /* This could be made to work with a little more fiddling */ pI830->directRenderingDisabled = TRUE; @@ -2512,14 +2986,13 @@ } /* Check if the HW cursor needs physical address. */ - if (IS_MOBILE(pI830) || IS_I915G(pI830)) + if (IS_MOBILE(pI830) || IS_I9XX(pI830)) pI830->CursorNeedsPhysical = TRUE; else pI830->CursorNeedsPhysical = FALSE; - /* Force ring buffer to be in low memory for the 845G and later. */ - if (IS_845G(pI830) || IS_I85X(pI830) || IS_I865G(pI830) || IS_I915G(pI830) || IS_I915GM(pI830)) - pI830->NeedRingBufferLow = TRUE; + /* Force ring buffer to be in low memory for all chipsets */ + pI830->NeedRingBufferLow = TRUE; /* * XXX If we knew the pre-initialised GTT format for certain, we could @@ -2559,26 +3032,21 @@ SetPipeAccess(pScrn); - if ((pDDCModule = xf86LoadSubModule(pScrn, "ddc")) == NULL) { - PreInitCleanup(pScrn); - return FALSE; - } - - /* Check we are on pipe B and have an LFP connected, before trying to + /* Check we have an LFP connected, before trying to * read PanelID information. */ - if ((pI830->pipe == 1) && (pI830->operatingDevices & (PIPE_LFP << 8))) { + if ( (pI830->pipe == 1 && pI830->operatingDevices & (PIPE_LFP << 8)) || + (pI830->pipe == 0 && pI830->operatingDevices & PIPE_LFP) ) vbeDoPanelID(pI830->pVbe); - } - /* If we managed to get PanelID, then try EDID too, and if we get that - * it'll override the PanelID information above */ - if (!pI830->vesa->monitor && - (pI830->vesa->monitor = vbeDoEDID(pI830->pVbe, pDDCModule)) != NULL) { + pMod = xf86LoadSubModule(pScrn, "ddc"); + + pI830->vesa->monitor = vbeDoEDID(pI830->pVbe, pMod); + + if ((pScrn->monitor->DDC = pI830->vesa->monitor) != NULL) { xf86PrintEDID(pI830->vesa->monitor); - } - if ((pScrn->monitor->DDC = pI830->vesa->monitor) != NULL) xf86SetDDCproperties(pScrn, pI830->vesa->monitor); - xf86UnloadSubModule(pDDCModule); + } + xf86UnloadSubModule(pMod); /* XXX Move this to a header. */ #define VIDEO_BIOS_SCRATCH 0x18 @@ -2667,6 +3135,9 @@ pI830->pipeDisplaySize[n].y2, 60); + } else { + xf86SetMonitorParameters(pScrn, pScrn->monitor, 0, 0, 0); + xf86AddEDIDModes(pScrn, pScrn->monitor, 0); } /* By now, we should have had some monitor settings, but if not, we @@ -2694,13 +3165,13 @@ defmon |= 2; } + DDCclock = I830UseDDC(pScrn); + /* * Note: VBE modes (> 0x7f) won't work with Intel's extended BIOS - * functions. For that reason it's important to set only - * V_MODETYPE_VGA in the flags. + * functions. */ - pScrn->modePool = i830GetModePool(pScrn, pI830->pVbe, pI830->vbeInfo, - V_MODETYPE_VGA); + pScrn->modePool = I830GetModePool(pScrn, pI830->pVbe, pI830->vbeInfo); if (!pScrn->modePool) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -2749,15 +3220,63 @@ return FALSE; } - xf86PruneDriverModes(pScrn); + /* Only use this if we've got DDC available */ + if (DDCclock > 0) { + p = pScrn->modes; + if (p == NULL) + return FALSE; + do { + int Clock = 100000000; /* incredible value */ - pScrn->currentMode = pScrn->modes; + if (p->status == MODE_OK) { + for (pMon = pScrn->monitor->Modes; pMon != NULL; pMon = pMon->next) { + if ((pMon->HDisplay != p->HDisplay) || + (pMon->VDisplay != p->VDisplay) || + (pMon->Flags & (V_INTERLACE | V_DBLSCAN | V_CLKDIV2))) + continue; + + /* Find lowest supported Clock for this resolution */ + if (Clock > pMon->Clock) + Clock = pMon->Clock; + } + + if (DDCclock < 2550 && Clock / 1000.0 > DDCclock) { + ErrorF("(%s,%s) mode clock %gMHz exceeds DDC maximum %dMHz\n", + p->name, pScrn->monitor->id, + Clock/1000.0, DDCclock); + p->status = MODE_BAD; + } + } + p = p->next; + } while (p != NULL && p != pScrn->modes); + } + + xf86PruneDriverModes(pScrn); if (pScrn->modes == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n"); PreInitCleanup(pScrn); return FALSE; } + + /* Now we check the VESA BIOS's displayWidth and reset if necessary */ + p = pScrn->modes; + do { + VbeModeInfoData *data = (VbeModeInfoData *) p->Private; + VbeModeInfoBlock *modeInfo; + + /* Get BytesPerScanline so we can reset displayWidth */ + if ((modeInfo = VBEGetModeInfo(pI830->pVbe, data->mode))) { + if (pScrn->displayWidth < modeInfo->BytesPerScanline / pI830->cpp) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Correcting stride (%d -> %d)\n", pScrn->displayWidth, modeInfo->BytesPerScanline); + pScrn->displayWidth = modeInfo->BytesPerScanline / pI830->cpp; + } + } + p = p->next; + } while (p != NULL && p != pScrn->modes); + + pScrn->currentMode = pScrn->modes; + #ifndef USE_PITCHES #define USE_PITCHES 1 #endif @@ -2767,7 +3286,7 @@ * If DRI is potentially usable, check if there is enough memory available * for it, and if there's also enough to allow tiling to be enabled. */ -#if defined(XF86DRI) +#ifdef XF86DRI if (IsPrimary(pScrn) && !pI830->directRenderingDisabled) { int savedDisplayWidth = pScrn->displayWidth; int memNeeded = 0; @@ -2782,13 +3301,11 @@ 0 }; -#ifdef I830_XV /* * Set this so that the overlay allocation is factored in when * appropriate. */ pI830->XvEnabled = !pI830->XvDisabled; -#endif for (i = 0; pitches[i] != 0; i++) { #if USE_PITCHES @@ -2879,7 +3396,7 @@ #endif SetPipeAccess(pScrn); - i830PrintModes(pScrn); + I830PrintModes(pScrn); if (!pI830->vesa->useDefaultRefresh) { /* @@ -2890,13 +3407,11 @@ * if there are no non-CRT devices attached. */ SetPipeAccess(pScrn); - i830SetModeParameters(pScrn, pI830->pVbe); + I830SetModeParameters(pScrn, pI830->pVbe); } /* PreInit shouldn't leave any state changes, so restore this. */ - pI830->preinit = FALSE; /* temporarily do this */ RestoreBIOSMemSize(pScrn); - pI830->preinit = TRUE; /* now put it back */ /* Don't need MMIO access anymore. */ if (pI830->swfSaved) { @@ -2908,32 +3423,27 @@ xf86SetDpi(pScrn, 0, 0); /* Load the required sub modules */ - if (!xf86LoadSubModule(pScrn, "fb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { PreInitCleanup(pScrn); return FALSE; } - xf86LoaderReqSymLists(I810fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, I810fbSymbols, NULL); if (!pI830->noAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { PreInitCleanup(pScrn); return FALSE; } - xf86LoaderReqSymLists(I810xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, I810xaaSymbols, NULL); } if (!pI830->SWCursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { PreInitCleanup(pScrn); return FALSE; } - xf86LoaderReqSymLists(I810ramdacSymbols, NULL); - } - - if (!SetDisplayDevices(pScrn, pI830->savedDevices)) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Failed to switch to saved display devices, continuing.\n"); + xf86LoaderModReqSymLists(pMod, I810ramdacSymbols, NULL); } I830UnmapMMIO(pScrn); @@ -2943,8 +3453,19 @@ xf86SetOperatingState(resVgaIo, pI830->pEnt->index, ResUnusedOpr); xf86SetOperatingState(resVgaMem, pI830->pEnt->index, ResDisableOpr); + if (pI830->shadowFB) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { + I830BIOSFreeRec(pScrn); + vbeFree(pI830->pVbe); + return FALSE; + } + xf86LoaderModReqSymLists(pMod, I810shadowFBSymbols, NULL); + } + VBEFreeVBEInfo(pI830->vbeInfo); + pI830->vbeInfo = NULL; vbeFree(pI830->pVbe); + pI830->pVbe = NULL; /* Use the VBE mode restore workaround by default. */ pI830->vbeRestoreWorkaround = TRUE; @@ -2956,21 +3477,21 @@ xf86DrvMsg(pScrn->scrnIndex, from, "VBE Restore workaround: %s.\n", pI830->vbeRestoreWorkaround ? "enabled" : "disabled"); -#if defined(XF86DRI) +#ifdef XF86DRI /* Load the dri module if requested. */ if (xf86ReturnOptValBool(pI830->Options, OPTION_DRI, FALSE) && !pI830->directRenderingDisabled) { - if (xf86LoadSubModule(pScrn, "dri")) { - xf86LoaderReqSymLists(I810driSymbols, I810drmSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "dri"))) { + xf86LoaderModReqSymLists(pMod, I810driSymbols, I810drmSymbols, NULL); } } if (!pI830->directRenderingDisabled) { - if (!xf86LoadSubModule(pScrn, "shadow")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadow"))) { PreInitCleanup(pScrn); return FALSE; } - xf86LoaderReqSymLists(I810shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, I810shadowSymbols, NULL); } #endif @@ -3163,12 +3684,16 @@ DPRINTF(PFX, "SaveHWState\n"); - SetPipeAccess(pScrn); + if (IsPrimary(pScrn) && pI830->pipe != pI830->origPipe) + SetBIOSPipe(pScrn, pI830->origPipe); + else + SetPipeAccess(pScrn); pVesa = pI830->vesa; /* Make sure we save at least this information in case of failure. */ VBEGetVBEMode(pVbe, &pVesa->stateMode); + pVesa->stateRefresh = GetRefreshRate(pScrn, pVesa->stateMode, NULL); modeInfo = VBEGetModeInfo(pVbe, pVesa->stateMode); pVesa->savedScanlinePitch = 0; if (modeInfo) { @@ -3234,6 +3759,11 @@ DPRINTF(PFX, "RestoreHWState\n"); + if (IsPrimary(pScrn) && pI830->pipe != pI830->origPipe) + SetBIOSPipe(pScrn, pI830->origPipe); + else + SetPipeAccess(pScrn); + pVesa = pI830->vesa; /* @@ -3241,26 +3771,8 @@ * Temporarily program a 640x480 mode before switching back to * text mode. */ - if (pVesa->useDefaultRefresh) { - int mode = 0; - - switch (pScrn->depth) { - case 8: - mode = 0x30; - break; - case 15: - mode = 0x40; - break; - case 16: - mode = 0x41; - break; - case 24: - mode = 0x50; - break; - } - mode |= (1 << 15) | (1 << 14); - I830VESASetVBEMode(pScrn, mode, NULL); - } + if (pVesa->useDefaultRefresh) + I830Set640x480(pScrn); if (pVesa->state && pVesa->stateSize) { CARD16 imr = INREG16(IMR); @@ -3293,6 +3805,9 @@ "Setting the original video mode instead of restoring\n\t" "the saved state\n"); I830VESASetVBEMode(pScrn, pVesa->stateMode, NULL); + if (!pVesa->useDefaultRefresh && pI830->useExtendedRefresh) { + SetRefreshRate(pScrn, pVesa->stateMode, pVesa->stateRefresh); + } } if (pVesa->savedScanlinePitch) VBESetLogicalScanline(pVbe, pVesa->savedScanlinePitch); @@ -3304,13 +3819,10 @@ vgaHWRestore(pScrn, vgaReg, VGA_SR_FONTS); vgaHWLock(hwp); + return TRUE; } -#ifndef USE_VBE -#define USE_VBE 1 -#endif - static void I830SetCloneVBERefresh(ScrnInfoPtr pScrn, int mode, VbeCRTCInfoBlock * block, int refresh) { I830Ptr pI830 = I830PTR(pScrn); @@ -3346,8 +3858,7 @@ #endif if (clock) block->PixelClock = clock; - block->RefreshRate = ((double)(block->PixelClock) / - (double)(p->HTotal * p->VTotal)) * 100; + block->RefreshRate = RefreshRate; return; } } @@ -3357,62 +3868,139 @@ I830VESASetVBEMode(ScrnInfoPtr pScrn, int mode, VbeCRTCInfoBlock * block) { I830Ptr pI830 = I830PTR(pScrn); + Bool ret = FALSE; + int Mon; DPRINTF(PFX, "Setting mode 0x%.8x\n", mode); - if (pI830->Clone && !pI830->preinit) { + if (pI830->Clone && pI830->CloneHDisplay && pI830->CloneVDisplay && + !pI830->preinit && !pI830->closing) { VbeCRTCInfoBlock newblock; - int Mon; + int newmode = mode; - if (pI830->pipe == 0) + if (pI830->pipe == 1) Mon = pI830->MonType1; else Mon = pI830->MonType2; SetBIOSPipe(pScrn, !pI830->pipe); - /* The reason for this code is if we've not got a CRT on this pipe, then - * make sure we're using a 60Hz refresh */ - if (pI830->useExtendedRefresh && !pI830->vesa->useDefaultRefresh && - (mode & (1 << 11)) && block) { - /* we'll call 5F05 to set the refresh later.... */ - if (Mon != PIPE_CRT) - VBESetVBEMode(pI830->pVbe, mode, NULL); - else - VBESetVBEMode(pI830->pVbe, mode, block); - } else { - if (Mon != PIPE_CRT) - /* Set clone head to 60Hz because we ain't got a CRT on it */ - I830SetCloneVBERefresh(pScrn, mode, &newblock, 6000); - else - /* Set clone head to specified clone refresh rate */ - I830SetCloneVBERefresh(pScrn, mode, &newblock, pI830->CloneRefresh * 100); - if (newblock.RefreshRate == 0) + /* Now recheck refresh operations we can use */ + pI830->useExtendedRefresh = FALSE; + pI830->vesa->useDefaultRefresh = FALSE; + + if (Mon != PIPE_CRT) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "A non-CRT device is attached to Clone pipe %c.\n" + "\tNo refresh rate overrides will be attempted (0x%x).\n", + PIPE_NAME(!pI830->pipe), newmode); + pI830->vesa->useDefaultRefresh = TRUE; + } + /* + * Some desktop platforms might not have 0x5f05, so useExtendedRefresh + * would need to be set to FALSE for those cases. + */ + if (!pI830->vesa->useDefaultRefresh) + pI830->useExtendedRefresh = TRUE; + + newmode |= 1 << 11; + if (pI830->vesa->useDefaultRefresh) + newmode &= ~(1 << 11); + + if (!SetRefreshRate(pScrn, newmode, 60)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "BIOS call 0x5f05 not supported on Clone Head, " + "setting refresh with VBE 3 method.\n"); + pI830->useExtendedRefresh = FALSE; + } + + if (!pI830->vesa->useDefaultRefresh) { + I830SetCloneVBERefresh(pScrn, newmode, &newblock, pI830->CloneRefresh * 100); + + if (!VBESetVBEMode(pI830->pVbe, newmode, &newblock)) { + if (!VBESetVBEMode(pI830->pVbe, (newmode & ~(1 << 11)), NULL)) + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Failed to set mode for Clone head.\n"); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Setting refresh on clone head with VBE 3 method.\n"); + pI830->useExtendedRefresh = FALSE; + } + } else { + if (!VBESetVBEMode(pI830->pVbe, (newmode & ~(1 << 11)), NULL)) + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Failed to set mode for Clone head.\n"); + } + + if (pI830->useExtendedRefresh && !pI830->vesa->useDefaultRefresh) { + if (!SetRefreshRate(pScrn, newmode, pI830->CloneRefresh)) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Failed to setup clone head mode resolution and refresh.\n"); + "Failed to set refresh rate to %dHz on Clone head.\n", + pI830->CloneRefresh); else - VBESetVBEMode(pI830->pVbe, mode, &newblock); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Set refresh rate to %dHz on Clone head.\n", + pI830->CloneRefresh); } + + SetPipeAccess(pScrn); } - SetPipeAccess(pScrn); + if (pI830->pipe == 0) + Mon = pI830->MonType1; + else + Mon = pI830->MonType2; -#if USE_VBE - return VBESetVBEMode(pI830->pVbe, mode, block); -#else - { - vbeInfoPtr pVbe = pI830->pVbe; - pVbe->pInt10->num = 0x10; - pVbe->pInt10->ax = 0x80 | (mode & 0x7f); - xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn); - pVbe->pInt10->ax = 0x0f00; - xf86ExecX86int10_wrapper(pVbe->pInt10, pScrn); - if ((pVbe->pInt10->ax & 0x7f) == (mode & 0x7f)) - return TRUE; - else - return FALSE; + /* Now recheck refresh operations we can use */ + pI830->useExtendedRefresh = FALSE; + pI830->vesa->useDefaultRefresh = FALSE; + + if (Mon != PIPE_CRT) + pI830->vesa->useDefaultRefresh = TRUE; + + mode |= 1 << 11; + if (pI830->vesa->useDefaultRefresh) + mode &= ~(1 << 11); + /* + * Some desktop platforms might not have 0x5f05, so useExtendedRefresh + * would need to be set to FALSE for those cases. + */ + if (!pI830->vesa->useDefaultRefresh) + pI830->useExtendedRefresh = TRUE; + + if (!SetRefreshRate(pScrn, mode, 60)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "BIOS call 0x5f05 not supported, " + "setting refresh with VBE 3 method.\n"); + pI830->useExtendedRefresh = FALSE; } -#endif + + if (!pI830->vesa->useDefaultRefresh && block) { + ret = VBESetVBEMode(pI830->pVbe, mode, block); + if (!ret) + ret = VBESetVBEMode(pI830->pVbe, (mode & ~(1 << 11)), NULL); + else { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Setting refresh with VBE 3 method.\n"); + pI830->useExtendedRefresh = FALSE; + } + } else { + ret = VBESetVBEMode(pI830->pVbe, (mode & ~(1 << 11)), NULL); + } + + /* Might as well bail now if we've failed */ + if (!ret) return FALSE; + + if (pI830->useExtendedRefresh && !pI830->vesa->useDefaultRefresh && block) { + if (!SetRefreshRate(pScrn, mode, block->RefreshRate / 100)) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Failed to set refresh rate to %dHz.\n", + block->RefreshRate / 100); + pI830->useExtendedRefresh = FALSE; + } + } + + return ret; } static Bool @@ -3441,21 +4029,6 @@ } #endif - /* - * Do this early to find out if we can support it or not.... - * Test if the extendedRefresh BIOS function is supported. - */ - if (pI830->useExtendedRefresh && !pI830->vesa->useDefaultRefresh && - (mode & (1 << 11)) && data && data->data && data->block) { - SetPipeAccess(pScrn); - if (!SetRefreshRate(pScrn, mode, 60)) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "BIOS call 0x5f05 not supported, " - "setting refresh with VBE 3 method.\n"); - pI830->useExtendedRefresh = FALSE; - } - } - if (pI830->Clone) { pI830->CloneHDisplay = pMode->HDisplay; pI830->CloneVDisplay = pMode->VDisplay; @@ -3470,23 +4043,16 @@ /* XXX Add macros for the various mode parameter bits. */ +#if 0 if (pI830->vesa->useDefaultRefresh) mode &= ~(1 << 11); +#endif + + SetPipeAccess(pScrn); if (I830VESASetVBEMode(pScrn, mode, data->block) == FALSE) { - if ((data->block && (mode & (1 << 11))) && - I830VESASetVBEMode(pScrn, (mode & ~(1 << 11)), NULL) == TRUE) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Set VBE Mode rejected this modeline.\n\t" - "Trying standard mode instead!\n"); - DPRINTF(PFX, "OOPS!\n"); - xfree(data->block); - data->block = NULL; - data->mode &= ~(1 << 11); - } else { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Set VBE Mode failed!\n"); - return FALSE; - } + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Set VBE Mode failed!\n"); + return FALSE; } /* @@ -3512,49 +4078,6 @@ VBESetGetDACPaletteFormat(pVbe, 8); } - /* - * When it's OK to set better than default refresh rates, set them here. - */ - if (pI830->Clone) { - int Mon; - if (pI830->pipe == 0) - Mon = pI830->MonType1; - else - Mon = pI830->MonType2; - SetBIOSPipe(pScrn, !pI830->pipe); - if (pI830->CloneRefresh && (Mon == PIPE_CRT)) { - if (pI830->useExtendedRefresh && !pI830->vesa->useDefaultRefresh && - (mode & (1 << 11)) && data && data->data && data->block) { - refresh = SetRefreshRate(pScrn, mode, pI830->CloneRefresh); - if (!refresh) - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Failed to set refresh rate to %dHz on Clone head.\n", - pI830->CloneRefresh); - else - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Set refresh rate to %dHz on Clone head.\n", - pI830->CloneRefresh); - } else - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Will use VBE3 method to set refresh on Clone head.\n"); - } else { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Not attempting to override default refresh on non-CRT clone head\n"); - } - } - - if (pI830->useExtendedRefresh && !pI830->vesa->useDefaultRefresh && - (mode & (1 << 11)) && data && data->data && data->block) { - SetPipeAccess(pScrn); - refresh = SetRefreshRate(pScrn, mode, data->block->RefreshRate / 100); - if (!refresh) { - refresh = 60; - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Failed to set refresh rate to %dHz.\n", - data->block->RefreshRate / 100); - } - } - /* XXX Fix plane A with pipe A, and plane B with pipe B. */ planeA = INREG(DSPACNTR); planeB = INREG(DSPBCNTR); @@ -3570,36 +4093,18 @@ pI830->planeEnabled[1] ? "enabled" : "disabled", planeB & DISPPLANE_SEL_PIPE_MASK ? "Pipe B" : "Pipe A"); - if (xf86IsEntityShared(pScrn->entityList[0]) || pI830->Clone) { + if (pI830->operatingDevices & 0xff) { pI830->planeEnabled[0] = 1; - pI830->pipeEnabled[0] = 1; - pI830->planeEnabled[1] = 1; - pI830->pipeEnabled[1] = 1; + } else { + pI830->planeEnabled[0] = 0; } - /* - * Sometimes it seems that no display planes are enabled at this point. - * For mobile platforms pick the plane(s) connected to enabled pipes. - * For others choose plane A. - */ - if (!pI830->planeEnabled[0] && !pI830->planeEnabled[1]) { - if (pI830->availablePipes == 2) { - if ((pI830->pipeEnabled[0] && - ((planeA & DISPPLANE_SEL_PIPE_MASK) == DISPPLANE_SEL_PIPE_A)) || - (pI830->pipeEnabled[1] && - ((planeA & DISPPLANE_SEL_PIPE_MASK) == DISPPLANE_SEL_PIPE_B))) { - pI830->planeEnabled[0] = TRUE; - } - if ((pI830->pipeEnabled[0] && - ((planeB & DISPPLANE_SEL_PIPE_MASK) == DISPPLANE_SEL_PIPE_A)) || - (pI830->pipeEnabled[1] && - ((planeB & DISPPLANE_SEL_PIPE_MASK) == DISPPLANE_SEL_PIPE_B))) { - pI830->planeEnabled[1] = TRUE; - } - } else { - pI830->planeEnabled[0] = TRUE; - } + if (pI830->operatingDevices & 0xff00) { + pI830->planeEnabled[1] = 1; + } else { + pI830->planeEnabled[1] = 0; } + if (pI830->planeEnabled[0]) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Enabling plane A.\n"); planeA |= DISPLAY_PLANE_ENABLE; @@ -3638,13 +4143,15 @@ */ temp = INREG(PIPEACONF); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PIPEACONF is 0x%08lx\n", - (unsigned long)temp); + (unsigned long)temp); if (pI830->availablePipes == 2) { temp = INREG(PIPEBCONF); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PIPEBCONF is 0x%08lx\n", - (unsigned long)temp); + (unsigned long)temp); } + + if (xf86IsEntityShared(pScrn->entityList[0])) { /* Clean this up !! */ if (IsPrimary(pScrn)) { @@ -3823,6 +4330,7 @@ } } +#if 0 { int ret; @@ -3832,6 +4340,7 @@ "LFP compensation mode: 0x%x\n", ret); } } +#endif #if MODESWITCH_RESET_STATE ResetState(pScrn, TRUE); @@ -4091,6 +4600,8 @@ VisualPtr visual; I830EntPtr pI830Ent = NULL; I830Ptr pI8301 = NULL; + int width, height, displayWidth; + unsigned char *fbbase; #ifdef XF86DRI Bool driDisabled; #endif @@ -4153,30 +4664,25 @@ * If we're changing the BIOS's view of the video memory size, do that * first, then re-initialise the VBE information. */ + if (pI830->pVbe) + vbeFree(pI830->pVbe); pI830->pVbe = VBEInit(NULL, pI830->pEnt->index); - if (!TweakMemorySize(pScrn, pI830->newBIOSMemSize)) + if (!TweakMemorySize(pScrn, pI830->newBIOSMemSize,FALSE)) SetBIOSMemSize(pScrn, pI830->newBIOSMemSize); if (!pI830->pVbe) return FALSE; + if (pI830->vbeInfo) + VBEFreeVBEInfo(pI830->vbeInfo); pI830->vbeInfo = VBEGetVBEInfo(pI830->pVbe); miClearVisualTypes(); - if (!xf86SetDefaultVisual(pScrn, -1)) - return FALSE; - if (pScrn->bitsPerPixel > 8) { - if (!miSetVisualTypes(pScrn->depth, TrueColorMask, - pScrn->rgbBits, TrueColor)) - return FALSE; - } else { - if (!miSetVisualTypes(pScrn->depth, + if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; - } if (!miSetPixmapDepths()) return FALSE; -#ifdef I830_XV pI830->XvEnabled = !pI830->XvDisabled; if (pI830->XvEnabled) { if (!IsPrimary(pScrn)) { @@ -4191,9 +4697,6 @@ pI830->XvEnabled = FALSE; } } -#else - pI830->XvEnabled = FALSE; -#endif if (IsPrimary(pScrn)) { I830ResetAllocations(pScrn, 0); @@ -4220,7 +4723,6 @@ } } -#ifdef I830_XV if (pI830->XvEnabled) { if (pI830->noAccel) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Disabling Xv because it " @@ -4234,7 +4736,6 @@ pI830->XvEnabled = FALSE; } } -#endif InitRegisterRec(pScrn); @@ -4251,7 +4752,7 @@ */ if (pI830->directRenderingEnabled) { - if (pI830->noAccel || pI830->SWCursor || pI830->StolenOnly) { + if (pI830->noAccel || pI830->SWCursor || (pI830->StolenOnly && IsPrimary(pScrn))) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "DRI is disabled because it " "needs HW cursor, 2D accel and AGPGART.\n"); pI830->directRenderingEnabled = FALSE; @@ -4329,10 +4830,26 @@ return FALSE; DPRINTF(PFX, "assert( if(!fbScreenInit(pScreen, ...) )\n"); - if (!fbScreenInit(pScreen, pI830->FbBase + pScrn->fbOffset, - pScrn->virtualX, pScrn->virtualY, + if (pI830->rotate) { + height = pScrn->virtualX; + width = pScrn->virtualY; + } else { + width = pScrn->virtualX; + height = pScrn->virtualY; + } + if (pI830->shadowFB) { + pI830->shadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width); + pI830->shadowPtr = xalloc(pI830->shadowPitch * height); + displayWidth = pI830->shadowPitch / (pScrn->bitsPerPixel >> 3); + fbbase = pI830->shadowPtr; + } else { + pI830->shadowPtr = NULL; + fbbase = pI830->FbBase; + displayWidth = pScrn->displayWidth; + } + if (!fbScreenInit(pScreen, fbbase + pScrn->fbOffset, width, height, pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth, pScrn->bitsPerPixel)) + displayWidth, pScrn->bitsPerPixel)) return FALSE; if (pScrn->bitsPerPixel > 8) { @@ -4354,7 +4871,8 @@ xf86SetBlackWhitePixels(pScreen); - I830DGAInit(pScreen); + if (!pI830->shadowFB) + I830DGAInit(pScreen); DPRINTF(PFX, "assert( if(!xf86InitFBManager(pScreen, &(pI830->FbMemBox))) )\n"); @@ -4364,6 +4882,11 @@ "Failed to init memory manager\n"); return FALSE; } + + if (pI830->LinearAlloc && xf86InitFBManagerLinear(pScreen, pI830->LinearMem.Offset / pI830->cpp, pI830->LinearMem.Size / pI830->cpp)) + xf86DrvMsg(scrnIndex, X_INFO, + "Using %ld bytes of offscreen memory for linear (offset=0x%lx)\n", pI830->LinearMem.Size, pI830->LinearMem.Offset); + } else { if (!xf86InitFBManager(pScreen, &(pI8301->FbMemBox2))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -4392,23 +4915,47 @@ } else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing SW Cursor!\n"); + if (pI830->shadowFB) { + RefreshAreaFuncPtr refreshArea = I830RefreshArea; + if (pI830->rotate) { + if (!pI830->PointerMoved) { + pI830->PointerMoved = pScrn->PointerMoved; + pScrn->PointerMoved = I830PointerMoved; + } + switch (pScrn->bitsPerPixel) { + case 8: + refreshArea = I830RefreshArea8; + break; + case 16: + refreshArea = I830RefreshArea16; + break; + case 24: + refreshArea = I830RefreshArea24; + break; + case 32: + refreshArea = I830RefreshArea32; + break; + } + } + ShadowFBInit(pScreen, refreshArea); + } + DPRINTF(PFX, "assert( if(!miCreateDefColormap(pScreen)) )\n"); if (!miCreateDefColormap(pScreen)) return FALSE; DPRINTF(PFX, "assert( if(!xf86HandleColormaps(pScreen, ...)) )\n"); if (!xf86HandleColormaps(pScreen, 256, 8, I830LoadPalette, 0, - CMAP_RELOAD_ON_MODE_SWITCH)) { + CMAP_RELOAD_ON_MODE_SWITCH | + CMAP_PALETTED_TRUECOLOR)) { return FALSE; } xf86DPMSInit(pScreen, I830DisplayPowerManagementSet, 0); -#ifdef I830_XV /* Init video */ if (pI830->XvEnabled) I830InitVideo(pScreen); -#endif #ifdef XF86DRI if (pI830->directRenderingEnabled) { @@ -4436,9 +4983,6 @@ pI830->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = I830BIOSCloseScreen; - if (pI830->checkLid) - pI830->lidTimer = TimerSet(NULL, 0, 1000, I830LidTimer, pScrn); - if (serverGeneration == 1) xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); @@ -4458,6 +5002,7 @@ ScrnInfoPtr pScrn; I830Ptr pI830; vbeInfoPtr pVbe; + unsigned long Start; pScrn = xf86Screens[scrnIndex]; pI830 = I830PTR(pScrn); @@ -4466,43 +5011,36 @@ DPRINTF(PFX, "I830BIOSAdjustFrame: y = %d (+ %d), x = %d (+ %d)\n", x, pI830->xoffset, y, pI830->yoffset); - /* The i830M just happens to have some problems programming offsets via - * this VESA BIOS call. Especially in dual head configurations which - * have high resolutions which cause the DSP{A,B}BASE registers to be - * programmed incorrectly. Thus, it warrants bypassing the BIOS for i830M - * and hitting the DSP{A,B}BASE registers directly. - * - * We could probably do this for other platforms too, but we don't - * know what else the Video BIOS may do when calling it. It seems safe - * though for i830M during testing...... - * - * Also note, calling the Video BIOS version first and then fixing the - * registers fail on i830M and eventually cause a lockup of the hardware - * in my testing. + /* Sync the engine before adjust frame */ + if (pI830->AccelInfoRec && pI830->AccelInfoRec->NeedToSync) { + (*pI830->AccelInfoRec->Sync)(pScrn); + pI830->AccelInfoRec->NeedToSync = FALSE; + } + + if (IsPrimary(pScrn)) + Start = pI830->FrontBuffer.Start; + else { + I830Ptr pI8301 = I830PTR(pI830->entityPrivate->pScrn_1); + Start = pI8301->FrontBuffer2.Start; + } + + /* Sigh... + * It seems that there are quite a few Video BIOS' that get this wrong. + * So, we'll bypass the VBE call and hit the hardware directly. */ if (pI830->Clone) { - if (!IS_I830(pI830)) { - SetBIOSPipe(pScrn, !pI830->pipe); - VBESetDisplayStart(pVbe, x + pI830->xoffset, y + pI830->yoffset, TRUE); + if (!pI830->pipe == 0) { + OUTREG(DSPABASE, Start + ((y * pScrn->displayWidth + x) * pI830->cpp)); } else { - if (!pI830->pipe == 0) { - OUTREG(DSPABASE, pScrn->fbOffset + ((y * pScrn->displayWidth + x) * pI830->cpp)); - } else { - OUTREG(DSPBBASE, pScrn->fbOffset + ((y * pScrn->displayWidth + x) * pI830->cpp)); - } + OUTREG(DSPBBASE, Start + ((y * pScrn->displayWidth + x) * pI830->cpp)); } } - if (!IS_I830(pI830)) { - SetPipeAccess(pScrn); - VBESetDisplayStart(pVbe, x + pI830->xoffset, y + pI830->yoffset, TRUE); + if (pI830->pipe == 0) { + OUTREG(DSPABASE, Start + ((y * pScrn->displayWidth + x) * pI830->cpp)); } else { - if (pI830->pipe == 0) { - OUTREG(DSPABASE, pScrn->fbOffset + ((y * pScrn->displayWidth + x) * pI830->cpp)); - } else { - OUTREG(DSPBBASE, pScrn->fbOffset + ((y * pScrn->displayWidth + x) * pI830->cpp)); - } + OUTREG(DSPBBASE, Start + ((y * pScrn->displayWidth + x) * pI830->cpp)); } } @@ -4550,12 +5088,27 @@ DPRINTF(PFX, "Leave VT\n"); + pI830->leaving = TRUE; + + if (pI830->devicesTimer) + TimerCancel(pI830->devicesTimer); + pI830->devicesTimer = NULL; + + /* Give the video overlay code a chance to shutdown. */ + I830VideoSwitchModeBefore(pScrn, NULL); + + if (pI830->Clone) { + /* Ensure we don't try and setup modes on a clone head */ + pI830->CloneHDisplay = 0; + pI830->CloneVDisplay = 0; + } + if (!IsPrimary(pScrn)) { I830Ptr pI8301 = I830PTR(pI830->entityPrivate->pScrn_1); if (!pI8301->GttBound) { return; } - } + } #ifdef XF86DRI if (pI830->directRenderingOpen) { @@ -4572,7 +5125,22 @@ SaveHWOperatingState(pScrn); #endif + if (pI830->CursorInfoRec && pI830->CursorInfoRec->HideCursor) + pI830->CursorInfoRec->HideCursor(pScrn); + ResetState(pScrn, TRUE); + + if (IsPrimary(pScrn)) { + if (!SetDisplayDevices(pScrn, pI830->savedDevices)) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Failed to switch back to original display devices (0x%x)\n", + pI830->savedDevices); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Successfully set original devices\n"); + } + } + RestoreHWState(pScrn); RestoreBIOSMemSize(pScrn); if (IsPrimary(pScrn)) @@ -4580,14 +5148,15 @@ if (pI830->AccelInfoRec) pI830->AccelInfoRec->NeedToSync = FALSE; + /* DO IT AGAIN! AS IT SEEMS THAT SOME LFPs FLICKER OTHERWISE */ if (IsPrimary(pScrn)) { if (!SetDisplayDevices(pScrn, pI830->savedDevices)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Failed to switch back to original display devices (0x%x)\n", + "Failed to switch back to original display devices (0x%x) (2)\n", pI830->savedDevices); } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Successfully set original devices\n"); + "Successfully set original devices (2)\n"); } } } @@ -4596,12 +5165,10 @@ I830DetectMonitorChange(ScrnInfoPtr pScrn) { I830Ptr pI830 = I830PTR(pScrn); - pointer pDDCModule; + pointer pDDCModule = NULL; DisplayModePtr p, pMon; - xf86MonPtr DDC; - struct detailed_monitor_section* detMon; - int i, memsize; - struct monitor_ranges *mon_range = NULL; + int memsize; + int DDCclock = 0; int displayWidth = pScrn->displayWidth; int curHDisplay = pScrn->currentMode->HDisplay; int curVDisplay = pScrn->currentMode->VDisplay; @@ -4611,79 +5178,29 @@ SetPipeAccess(pScrn); /* Re-read EDID */ - if ((pDDCModule = xf86LoadSubModule(pScrn, "ddc")) == NULL) - return FALSE; + pDDCModule = xf86LoadSubModule(pScrn, "ddc"); if (pI830->vesa->monitor) xfree(pI830->vesa->monitor); - if ((pI830->vesa->monitor = vbeDoEDID(pI830->pVbe, pDDCModule)) != NULL) + pI830->vesa->monitor = vbeDoEDID(pI830->pVbe, pDDCModule); + if ((pScrn->monitor->DDC = pI830->vesa->monitor) != NULL) { xf86PrintEDID(pI830->vesa->monitor); - xf86UnloadSubModule(pDDCModule); - if ((pScrn->monitor->DDC = pI830->vesa->monitor) != NULL) xf86SetDDCproperties(pScrn, pI830->vesa->monitor); - else + } + xf86UnloadSubModule(pDDCModule); + if (!pScrn->monitor->DDC) /* No DDC, so get out of here, and continue to use the current settings */ return FALSE; - DDC = (xf86MonPtr)(pScrn->monitor->DDC); - - /* Now change the hsync/vrefresh values of the current monitor to - * match those of DDC */ - for (i = 0; i < 4; i++) { - detMon = &DDC->det_mon[i]; - if(detMon->type == DS_RANGES) - mon_range = &detMon->section.ranges; - } - - if (!mon_range || mon_range->min_h == 0 || mon_range->max_h == 0 || - mon_range->min_v == 0 || mon_range->max_v == 0) - return FALSE; /* bad ddc */ - - if (mon_range) { -#define DDC_SYNC_TOLERANCE SYNC_TOLERANCE - if (pScrn->monitor->nHsync > 0) { - for (i = 0; i < pScrn->monitor->nHsync; i++) { - if ((1.0 - DDC_SYNC_TOLERANCE) * mon_range->min_h > - pScrn->monitor->hsync[i].lo || - (1.0 + DDC_SYNC_TOLERANCE) * mon_range->max_h < - pScrn->monitor->hsync[i].hi) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "config file hsync range %g-%gkHz not within DDC " - "hsync range %d-%dkHz\n", - pScrn->monitor->hsync[i].lo, pScrn->monitor->hsync[i].hi, - mon_range->min_h, mon_range->max_h); - } - pScrn->monitor->hsync[i].lo = mon_range->min_h; - pScrn->monitor->hsync[i].hi = mon_range->max_h; - } - } - - if (pScrn->monitor->nVrefresh > 0) { - for (i=0; i<pScrn->monitor->nVrefresh; i++) { - if ((1.0 - DDC_SYNC_TOLERANCE) * mon_range->min_v > - pScrn->monitor->vrefresh[i].lo || - (1.0 + DDC_SYNC_TOLERANCE) * mon_range->max_v < - pScrn->monitor->vrefresh[i].hi) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "config file vrefresh range %g-%gHz not within DDC " - "vrefresh range %d-%dHz\n", - pScrn->monitor->vrefresh[i].lo, pScrn->monitor->vrefresh[i].hi, - mon_range->min_v, mon_range->max_v); - } - pScrn->monitor->vrefresh[i].lo = mon_range->min_v; - pScrn->monitor->vrefresh[i].hi = mon_range->max_v; - } - } - } /* if (mon_range) */ + if (!(DDCclock = I830UseDDC(pScrn))) + return FALSE; /* Revalidate the modes */ /* * Note: VBE modes (> 0x7f) won't work with Intel's extended BIOS - * functions. For that reason it's important to set only - * V_MODETYPE_VGA in the flags. + * functions. */ - pScrn->modePool = i830GetModePool(pScrn, pI830->pVbe, pI830->vbeInfo, - V_MODETYPE_VGA); + pScrn->modePool = I830GetModePool(pScrn, pI830->pVbe, pI830->vbeInfo); if (!pScrn->modePool) { /* This is bad, which would cause the Xserver to exit, maybe @@ -4708,39 +5225,43 @@ pScrn->display->virtualY, memsize, LOOKUP_BEST_REFRESH); - p = pScrn->modes; - if (p == NULL) - return FALSE; - do { - int Clock = 100000000; /* incredible value */ + if (DDCclock > 0) { + p = pScrn->modes; + if (p == NULL) + return FALSE; + do { + int Clock = 100000000; /* incredible value */ - for (pMon = pScrn->monitor->Modes; pMon != NULL; pMon = pMon->next) { - if ((pMon->HDisplay != p->HDisplay) || - (pMon->VDisplay != p->VDisplay) || - (pMon->Flags & (V_INTERLACE | V_DBLSCAN | V_CLKDIV2))) - continue; - - /* Find lowest supported Clock for this resolution */ - if (Clock > pMon->Clock) - Clock = pMon->Clock; - } + if (p->status == MODE_OK) { + for (pMon = pScrn->monitor->Modes; pMon != NULL; pMon = pMon->next) { + if ((pMon->HDisplay != p->HDisplay) || + (pMon->VDisplay != p->VDisplay) || + (pMon->Flags & (V_INTERLACE | V_DBLSCAN | V_CLKDIV2))) + continue; + + /* Find lowest supported Clock for this resolution */ + if (Clock > pMon->Clock) + Clock = pMon->Clock; + } - if (mon_range->max_clock < 2550 && - Clock / 1000.0 > mon_range->max_clock) { -#if 0 - ErrorF("(%s,%s) mode clock %gMHz exceeds DDC maximum %dMHz\n", + if (DDCclock < 2550 && Clock / 1000.0 > DDCclock) { + ErrorF("(%s,%s) mode clock %gMHz exceeds DDC maximum %dMHz\n", p->name, pScrn->monitor->id, - Clock/1000.0, mon_range->max_clock); -#endif - p->status = MODE_BAD; - } - p = p->next; - } while (p != NULL && p != pScrn->modes); + Clock/1000.0, DDCclock); + p->status = MODE_BAD; + } + } + p = p->next; + } while (p != NULL && p != pScrn->modes); + } pScrn->displayWidth = displayWidth; /* restore old displayWidth */ xf86PruneDriverModes(pScrn); - i830PrintModes(pScrn); + I830PrintModes(pScrn); + + if (!pI830->vesa->useDefaultRefresh) + I830SetModeParameters(pScrn, pI830->pVbe); /* Now check if the previously used mode is o.k. for the current monitor. * This allows VT switching to continue happily when not disconnecting @@ -4786,6 +5307,32 @@ return TRUE; } + +Bool +I830CheckModeSupport(ScrnInfoPtr pScrn, int x, int y, int mode) +{ + I830Ptr pI830 = I830PTR(pScrn); + Bool ret = TRUE; + + if (pI830->Clone) { + if (pI830->pipeDisplaySize[0].x2 != 0) { + if (x > pI830->pipeDisplaySize[0].x2 || + y > pI830->pipeDisplaySize[0].y2) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Bad Clone Mode removing\n"); + return FALSE; + } + } + if (pI830->pipeDisplaySize[1].x2 != 0) { + if (x > pI830->pipeDisplaySize[1].x2 || + y > pI830->pipeDisplaySize[1].y2) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Bad Clone Mode removing\n"); + return FALSE; + } + } + } + + return ret; +} /* * This gets called when gaining control of the VT, and from ScreenInit(). @@ -4798,19 +5345,34 @@ DPRINTF(PFX, "Enter VT\n"); + /* + * Only save state once per server generation since that's what most + * drivers do. Could change this to save state at each VT enter. + */ + if (pI830->SaveGeneration != serverGeneration) { + pI830->SaveGeneration = serverGeneration; + SaveHWState(pScrn); + } + + pI830->leaving = FALSE; + if (IsPrimary(pScrn)) { /* * This is needed for restoring from ACPI modes (especially S3) * so that we warmboot the Video BIOS. Some platforms have problems, * warm booting when we don't need to, so check that we can call - * the Video BIOS with our display devices, and only when that fails, + * the Video BIOS with our saved devices, and only when that fails, * we'll warm boot it. */ - if (!SetDisplayDevices(pScrn, pI830->operatingDevices)) { - xf86Int10InfoPtr pInt = xf86InitInt10(pI830->pEnt->index); + /* Check Pipe conf registers or possibly HTOTAL/VTOTAL for 0x00000000)*/ + CARD32 temp = pI830->pipe ? INREG(PIPEBCONF) : INREG(PIPEACONF); + if (!I830Set640x480(pScrn) || !(temp & 0x80000000)) { + xf86Int10InfoPtr pInt; xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "SetDisplayDevices failed, re-trying.\n"); + "Detected resume, re-POSTing.\n"); + + pInt = xf86InitInt10(pI830->pEnt->index); /* Now perform our warm boot */ if (pInt) { @@ -4822,35 +5384,27 @@ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Re-POSTing via int10 failed, trying to continue.\n"); } - - /* Finally, re-setup the display devices */ - if (!SetDisplayDevices(pScrn, pI830->operatingDevices)) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + } + + /* Finally, re-setup the display devices */ + if (!SetDisplayDevices(pScrn, pI830->operatingDevices)) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to switch to configured display devices\n"); - return FALSE; - } + return FALSE; } } - /* Setup for checking lid status */ - pI830->monitorSwitch = INREG(SWF0) & 0x0000FFFF; + /* Setup for device monitoring status */ + pI830->monitorSwitch = pI830->toggleDevices = INREG(SWF0) & 0x0000FFFF; if (IsPrimary(pScrn)) if (!I830BindGARTMemory(pScrn)) return FALSE; CheckInheritedState(pScrn); - if (!TweakMemorySize(pScrn, pI830->newBIOSMemSize)) + if (!TweakMemorySize(pScrn, pI830->newBIOSMemSize,FALSE)) SetBIOSMemSize(pScrn, pI830->newBIOSMemSize); - /* - * Only save state once per server generation since that's what most - * drivers do. Could change this to save state at each VT enter. - */ - if (pI830->SaveGeneration != serverGeneration) { - pI830->SaveGeneration = serverGeneration; - SaveHWState(pScrn); - } ResetState(pScrn, FALSE); SetHWOperatingState(pScrn); @@ -4867,9 +5421,7 @@ if (!I830VESASetMode(pScrn, pScrn->currentMode)) return FALSE; -#ifdef I830_XV I830VideoSwitchModeAfter(pScrn, pScrn->currentMode); -#endif ResetState(pScrn, TRUE); SetHWOperatingState(pScrn); @@ -4883,9 +5435,7 @@ #ifdef XF86DRI if (pI830->directRenderingEnabled) { if (!pI830->starting) { - /* gdg DRM driver 1.2 supports resume */ - if (pI830->drmMinor >= 2) - I830DRIResume(screenInfo.screens[scrnIndex]); + I830DRIResume(screenInfo.screens[scrnIndex]); I830EmitInvarientState(pScrn); I830RefreshRing(pScrn); @@ -4899,6 +5449,9 @@ } #endif + if (pI830->checkDevices) + pI830->devicesTimer = TimerSet(NULL, 0, 1000, I830CheckDevicesTimer, pScrn); + return TRUE; } @@ -4906,22 +5459,15 @@ I830BIOSSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) { - int _head; - int _tail; ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; I830Ptr pI830 = I830PTR(pScrn); int ret = TRUE; DPRINTF(PFX, "I830BIOSSwitchMode: mode == %p\n", mode); - /* Stops head pointer freezes for 845G */ - if (!pI830->noAccel && (1 || IS_845G(pI830))) { - do { - _head = INREG(LP_RING + RING_HEAD) & I830_HEAD_MASK; - _tail = INREG(LP_RING + RING_TAIL) & I830_TAIL_MASK; - DELAY(1000); - } while (_head != _tail); - } + /* Sync the engine before mode switch */ + if (!pI830->noAccel && pI830->AccelInfoRec) + (*pI830->AccelInfoRec->Sync)(pScrn); #ifndef BINDUNBIND #define BINDUNBIND 0 @@ -4930,16 +5476,12 @@ if (IsPrimary(pScrn)) I830UnbindGARTMemory(pScrn); #endif -#ifdef I830_XV /* Give the video overlay code a chance to see the new mode. */ I830VideoSwitchModeBefore(pScrn, mode); -#endif if (!I830VESASetMode(pScrn, mode)) ret = FALSE; -#ifdef I830_XV /* Give the video overlay code a chance to see the new mode. */ I830VideoSwitchModeAfter(pScrn, mode); -#endif #if BINDUNBIND if (IsPrimary(pScrn)) I830BindGARTMemory(pScrn); @@ -4955,30 +5497,27 @@ I830Ptr pI830 = I830PTR(pScrn); Bool on = xf86IsUnblank(mode); CARD32 temp, ctrl, base; - int i; DPRINTF(PFX, "I830BIOSSaveScreen: %d, on is %s\n", mode, BOOLTOSTRING(on)); if (pScrn->vtSema) { - for (i = 0; i < pI830->availablePipes; i++) { - if (i == 0) { - ctrl = DSPACNTR; - base = DSPABASE; - } else { - ctrl = DSPBCNTR; - base = DSPBADDR; - } - if (pI830->planeEnabled[i]) { - temp = INREG(ctrl); - if (on) - temp |= DISPLAY_PLANE_ENABLE; - else - temp &= ~DISPLAY_PLANE_ENABLE; - OUTREG(ctrl, temp); - /* Flush changes */ - temp = INREG(base); - OUTREG(base, temp); - } + if (pI830->pipe == 0) { + ctrl = DSPACNTR; + base = DSPABASE; + } else { + ctrl = DSPBCNTR; + base = DSPBADDR; + } + if (pI830->planeEnabled[pI830->pipe]) { + temp = INREG(ctrl); + if (on) + temp |= DISPLAY_PLANE_ENABLE; + else + temp &= ~DISPLAY_PLANE_ENABLE; + OUTREG(ctrl, temp); + /* Flush changes */ + temp = INREG(base); + OUTREG(base, temp); } if (pI830->CursorInfoRec && !pI830->SWCursor && pI830->cursorOn) { @@ -5071,6 +5610,10 @@ I830BIOSLeaveVT(scrnIndex, 0); } + if (pI830->devicesTimer) + TimerCancel(pI830->devicesTimer); + pI830->devicesTimer = NULL; + DPRINTF(PFX, "\nUnmapping memory\n"); I830UnmapMem(pScrn); vgaHWUnmapMem(pScrn); @@ -5107,9 +5650,6 @@ pI830->overlayOn = NULL; } - if (pI830->lidTimer) - TimerCancel(pI830->lidTimer); - pScrn->vtSema = FALSE; pI830->closing = FALSE; pScreen->CloseScreen = pI830->CloseScreen; @@ -5124,7 +5664,7 @@ xf86DrvMsg(scrnIndex, X_PROBED, "Removing interlaced mode \"%s\"\n", mode->name); } - return MODE_NO_INTERLACE; + return MODE_BAD; } return MODE_OK; } @@ -5183,64 +5723,331 @@ SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverReset); } break; + /* This is currently used for ACPI */ + case XF86_APM_CAPABILITY_CHANGED: +#if 0 + /* If we had status checking turned on, turn it off now */ + if (pI830->checkDevices) { + if (pI830->devicesTimer) + TimerCancel(pI830->devicesTimer); + pI830->devicesTimer = NULL; + pI830->checkDevices = FALSE; + } +#endif + if (!IsPrimary(pScrn)) + return TRUE; + + ErrorF("I830PMEvent: Capability change\n"); + + /* ACPI Toggle */ + pI830->toggleDevices = GetNextDisplayDeviceList(pScrn, 1); + if (xf86IsEntityShared(pScrn->entityList[0])) { + I830Ptr pI8302 = I830PTR(pI830->entityPrivate->pScrn_2); + pI8302->toggleDevices = pI830->toggleDevices; + } + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ACPI Toggle to 0x%x\n",pI830->toggleDevices); + + I830CheckDevicesTimer(NULL, 0, pScrn); + SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverReset); + break; default: ErrorF("I830PMEvent: received APM event %d\n", event); } return TRUE; } +static int CountBits(int a) +{ + int i; + int b = 0; + + for (i=0;i<8;i++) { + if (a & (1<<i)) + b+=1; + } + + return b; +} + static CARD32 -I830LidTimer(OsTimerPtr timer, CARD32 now, pointer arg) +I830CheckDevicesTimer(OsTimerPtr timer, CARD32 now, pointer arg) { ScrnInfoPtr pScrn = (ScrnInfoPtr) arg; I830Ptr pI830 = I830PTR(pScrn); + int cloned = 0; if (pScrn->vtSema) { /* Check for monitor lid being closed/opened and act accordingly */ - int temp = INREG(SWF0) & 0x0000FFFF; + CARD32 adjust; + CARD32 temp = INREG(SWF0) & 0x0000FFFF; + int fixup = 0; + I830Ptr pI8301; + I830Ptr pI8302 = NULL; + + if (IsPrimary(pScrn)) + pI8301 = pI830; + else + pI8301 = I830PTR(pI830->entityPrivate->pScrn_1); + + if (xf86IsEntityShared(pScrn->entityList[0])) + pI8302 = I830PTR(pI830->entityPrivate->pScrn_2); + + /* this avoids several BIOS calls if possible */ + if (pI830->monitorSwitch != temp || pI830->monitorSwitch != pI830->toggleDevices) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Hotkey switch to 0x%lx.\n", + (unsigned long)temp); + + if (pI830->AccelInfoRec && pI830->AccelInfoRec->NeedToSync) { + (*pI830->AccelInfoRec->Sync)(pScrn); + pI830->AccelInfoRec->NeedToSync = FALSE; + if (xf86IsEntityShared(pScrn->entityList[0])) + pI8302->AccelInfoRec->NeedToSync = FALSE; + } + + GetAttachableDisplayDeviceList(pScrn); + + pI8301->lastDevice0 = pI8301->lastDevice1; + pI8301->lastDevice1 = pI8301->lastDevice2; + pI8301->lastDevice2 = pI8301->monitorSwitch; + + if (temp != pI8301->lastDevice1 && + temp != pI8301->lastDevice2) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Detected three device configs.\n"); + } else + if (CountBits(temp & 0xff) > 1) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Detected cloned pipe mode (A).\n"); + if (xf86IsEntityShared(pScrn->entityList[0]) || pI830->Clone) + temp = pI8301->MonType2 << 8 | pI8301->MonType1; + } else + if (CountBits((temp & 0xff00) >> 8) > 1) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Detected cloned pipe mode (B).\n"); + if (xf86IsEntityShared(pScrn->entityList[0]) || pI830->Clone) + temp = pI8301->MonType2 << 8 | pI8301->MonType1; + } else + if (pI8301->lastDevice1 && pI8301->lastDevice2) { + if ( ((pI8301->lastDevice1 & 0xFF00) == 0) && + ((pI8301->lastDevice2 & 0x00FF) == 0) ) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Detected last devices (1).\n"); + cloned = 1; + } else if ( ((pI8301->lastDevice2 & 0xFF00) == 0) && + ((pI8301->lastDevice1 & 0x00FF) == 0) ) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Detected last devices (2).\n"); + cloned = 1; + } else + cloned = 0; + } + + if (cloned && + ((CountBits(pI8301->lastDevice1 & 0xff) > 1) || + ((CountBits((pI8301->lastDevice1 & 0xff00) >> 8) > 1))) ) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Detected duplicate (1).\n"); + cloned = 0; + } else + if (cloned && + ((CountBits(pI8301->lastDevice2 & 0xff) > 1) || + ((CountBits((pI8301->lastDevice2 & 0xff00) >> 8) > 1))) ) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Detected duplicate (2).\n"); + cloned = 0; + } + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Requested display devices 0x%lx.\n", (unsigned long)temp); + + + /* If the BIOS doesn't flip between CRT, LFP and CRT+LFP we fake + * it here as it seems some just flip between CRT and LFP. Ugh! + * + * So this pushes them onto Pipe B and clones the displays, which + * is what most BIOS' should be doing. + * + * Cloned pipe mode should only be done when running single head. + */ + if (xf86IsEntityShared(pScrn->entityList[0])) { + cloned = 0; + + /* Some BIOS' don't realize we may be in true dual head mode. + * And only display the primary output on both when switching. + * We detect this here and cycle back to both pipes. + */ + if ((pI830->lastDevice0 == temp) && + ((CountBits(pI8301->lastDevice2 & 0xff) > 1) || + ((CountBits((pI8301->lastDevice2 & 0xff00) >> 8) > 1))) ) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Detected cloned pipe mode when dual head on previous switch. (0x%x -> 0x%x)\n", (int)temp, pI8301->MonType2 << 8 | pI8301->MonType1); + temp = pI8301->MonType2 << 8 | pI8301->MonType1; + } + + } + + if (cloned) { + if (pI830->Clone) + temp = pI8301->MonType2 << 8 | pI8301->MonType1; + else if (pI8301->lastDevice1 & 0xFF) + temp = pI8301->lastDevice1 << 8 | pI8301->lastDevice2; + else + temp = pI8301->lastDevice2 << 8 | pI8301->lastDevice1; + } + + /* Jump to our next mode if we detect we've been here before */ + if (temp == pI8301->lastDevice1 || temp == pI8301->lastDevice2) { + temp = GetToggleList(pScrn, 1); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Detected duplicate devices. Toggling (0x%lx)\n", + (unsigned long)temp); + } + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Detected display change operation (0x%x, 0x%x, 0x%lx).\n", + pI8301->lastDevice1, pI8301->lastDevice2, (unsigned long)temp); + + /* So that if we close on the wrong config, we restore correctly */ + pI830->specifiedMonitor = TRUE; + + if (!xf86IsEntityShared(pScrn->entityList[0])) { + if ((temp & 0xFF00) && (temp & 0x00FF)) { + pI830->Clone = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting Clone mode\n"); + } else { + pI830->Clone = FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Clearing Clone mode\n"); + } + } + + { + /* Turn Cursor off before switching */ + Bool on = pI830->cursorOn; + if (pI830->CursorInfoRec && pI830->CursorInfoRec->HideCursor) + pI830->CursorInfoRec->HideCursor(pScrn); + pI830->cursorOn = on; + } + + /* double check the display devices are what's configured and try + * not to do it twice because of dual heads with the code above */ + if (!SetDisplayDevices(pScrn, temp)) { + if ( cloned && + ((CountBits(temp & 0xff) > 1) || + (CountBits((temp & 0xff00) >> 8) > 1)) ) { + temp = pI8301->lastDevice2 | pI8301->lastDevice1; + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Cloning failed, " + "trying dual pipe clone mode (0x%lx)\n", + (unsigned long)temp); + if (!SetDisplayDevices(pScrn, temp)) + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to switch " + "to configured display devices (0x%lx).\n", + (unsigned long)temp); + else { + pI830->Clone = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting Clone mode\n"); + } + } + } + + pI8301->monitorSwitch = temp; + pI8301->operatingDevices = temp; + pI8301->toggleDevices = temp; + + if (xf86IsEntityShared(pScrn->entityList[0])) { + pI8302->operatingDevices = pI8301->operatingDevices; + pI8302->monitorSwitch = pI8301->monitorSwitch; + pI8302->toggleDevices = pI8301->toggleDevices; + } + + fixup = 1; - if (pI830->monitorSwitch != temp) { - int conf = pI830->operatingDevices; - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Detected possible lid operation, fixing up.\n"); - if ((temp & 0x0808) == 0x0000) { - /* LFP (PIPE A or B) GOING OFF - PROBABLE LID CLOSURE */ - conf = pI830->operatingDevices & 0xF7F7; -#if 0 - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Lid is being closed.\n"); -#endif - } else { #if 0 - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Lid is being opened.\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "ACPI _DGS queried devices is 0x%x, but probed is 0x%x monitorSwitch=0x%x\n", + pI830->toggleDevices, INREG(SWF0), pI830->monitorSwitch); #endif - } + } else { + int offset = -1; + if (IsPrimary(pScrn)) + offset = pI8301->FrontBuffer.Start + ((pScrn->frameY0 * pScrn->displayWidth + pScrn->frameX0) * pI830->cpp); + else { + offset = pI8301->FrontBuffer2.Start + ((pScrn->frameY0 * pScrn->displayWidth + pScrn->frameX0) * pI830->cpp); + } + + if (pI830->pipe == 0) + adjust = INREG(DSPABASE); + else + adjust = INREG(DSPBBASE); - /* If we've defined our own monitors, then get them and set them - * up when switching in single head mode, no effect in dual heads - * NOTE: This assumes that the LCD is always on Pipe B..... */ - conf |= pI830->MonType1; - if (IsPrimary(pScrn)) { - if (!SetDisplayDevices(pScrn, conf)) - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to switch " - "to configured display devices during lid operation.\n"); + if (adjust != offset) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Fixing display offsets.\n"); + + I830BIOSAdjustFrame(pScrn->pScreen->myNum, pScrn->frameX0, pScrn->frameY0, 0); } - pI830->monitorSwitch = conf; - + } + + if (fixup) { + ScreenPtr pCursorScreen; + int x = 0, y = 0; + + + pCursorScreen = miPointerCurrentScreen(); + if (pScrn->pScreen == pCursorScreen) + miPointerPosition(&x, &y); + /* Now, when we're single head, make sure we switch pipes */ - if (!(xf86IsEntityShared(pScrn->entityList[0]) || pI830->Clone)) { - if ((temp & 0xFF00) == 0x0000) - pI830->pipe = 0; - if ((temp & 0x00FF) == 0x0000) + if (!(xf86IsEntityShared(pScrn->entityList[0]) || pI830->Clone) || cloned) { + if (temp & 0xFF00) pI830->pipe = 1; - } + else + pI830->pipe = 0; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Primary pipe is now %s.\n", pI830->pipe ? "B" : "A"); + } + I830BIOSSwitchMode(pScrn->pScreen->myNum, pScrn->currentMode, 0); I830BIOSAdjustFrame(pScrn->pScreen->myNum, pScrn->frameX0, pScrn->frameY0, 0); - - /* Everything should be o.k. now, so make sure the HW cursor is - * on the correct pipe */ - if (pI830->CursorInfoRec && !pI830->SWCursor && pI830->cursorOn) { - pI830->CursorInfoRec->ShowCursor(pScrn); - pI830->cursorOn = TRUE; + if (xf86IsEntityShared(pScrn->entityList[0])) { + ScrnInfoPtr pScrn2; + I830Ptr pI8302; + + if (IsPrimary(pScrn)) { + pScrn2 = pI830->entityPrivate->pScrn_2; + pI8302 = I830PTR(pI830->entityPrivate->pScrn_2); + } else { + pScrn2 = pI830->entityPrivate->pScrn_1; + pI8302 = I830PTR(pI830->entityPrivate->pScrn_1); + } + + I830BIOSSwitchMode(pScrn2->pScreen->myNum, pScrn2->currentMode, 0); + I830BIOSAdjustFrame(pScrn2->pScreen->myNum, pScrn2->frameX0, pScrn2->frameY0, 0); + if (pScrn2->pScreen == pCursorScreen) { + int sigstate = xf86BlockSIGIO (); + miPointerWarpCursor(pScrn2->pScreen,x,y); + + /* xf86Info.currentScreen = pScrn->pScreen; */ + xf86UnblockSIGIO (sigstate); + if (pI8302->CursorInfoRec && !pI8302->SWCursor && pI8302->cursorOn) { + pI8302->CursorInfoRec->HideCursor(pScrn); + pI8302->CursorInfoRec->ShowCursor(pScrn); + pI8302->cursorOn = TRUE; + } + } + } + + if (pScrn->pScreen == pCursorScreen) { + int sigstate = xf86BlockSIGIO (); + miPointerWarpCursor(pScrn->pScreen,x,y); + + /* xf86Info.currentScreen = pScrn->pScreen; */ + xf86UnblockSIGIO (sigstate); + if (pI830->CursorInfoRec && !pI830->SWCursor && pI830->cursorOn) { + pI830->CursorInfoRec->HideCursor(pScrn); + pI830->CursorInfoRec->ShowCursor(pScrn); + pI830->cursorOn = TRUE; + } } } } Index: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c diff -u xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c:1.13 xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c:1.17 --- xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c:1.13 Sun Jan 9 15:47:19 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c Fri Mar 10 07:44:20 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c,v 1.13 2005/01/09 20:47:19 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c,v 1.17 2006/03/10 12:44:20 alanh Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -90,7 +90,7 @@ end = pool->Free.End; start = ROUND_DOWN_TO(end - size, alignment); - needed = pool->Free.End - start; + needed = end - start; } } if (needed > pool->Free.Size) { @@ -123,10 +123,9 @@ pool->Free.Start += needed; result->End = pool->Free.Start; } else { - result->Start = ROUND_DOWN_TO(pool->Free.End - size, alignment) - - pool->Total.End; - result->End = pool->Free.End - pool->Total.End; + result->Start = ROUND_DOWN_TO(pool->Free.End - size, alignment); pool->Free.End -= needed; + result->End = result->Start + needed; } pool->Free.Size = pool->Free.End - pool->Free.Start; result->Size = result->End - result->Start; @@ -287,7 +286,6 @@ return TRUE; } -#ifdef I830_XV /* * Note, the FORCE_LOW flag is currently not used or supported. */ @@ -304,6 +302,9 @@ memset(pI830->OverlayMem, 0, sizeof(I830MemRange)); pI830->OverlayMem->Key = -1; + memset(&(pI830->LinearMem), 0, sizeof(I830MemRange)); + pI830->LinearMem.Key = -1; + if (!pI830->XvEnabled) return TRUE; @@ -342,9 +343,26 @@ alloced / 1024, pI830->OverlayMem->Start, pI830->OverlayMem->Physical); } + + /* Clear linearmem info */ + if (pI830->LinearAlloc) { + size = KB(pI830->LinearAlloc); + alloced = I830AllocVidMem(pScrn, &(pI830->LinearMem), &(pI830->StolenPool), + size, GTT_PAGE_SIZE, + FROM_ANYWHERE | ALLOCATE_AT_TOP); + if (alloced < size) { + if (!dryrun) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to allocate linear buffer space\n"); + } + } else + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, + "%sAllocated %ld kB for the linear buffer at 0x%lx\n", s, + alloced / 1024, pI830->LinearMem.Start); + } + return TRUE; } -#endif static unsigned long GetFreeSpace(ScrnInfoPtr pScrn) @@ -761,9 +779,7 @@ } } -#ifdef I830_XV AllocateOverlay(pScrn, flags); -#endif if (!pI830->NeedRingBufferLow) AllocateRingBuffer(pScrn, flags); @@ -1191,11 +1207,10 @@ FixOffset(pScrn, &(pI830->Scratch)); if (pI830->entityPrivate && pI830->entityPrivate->pScrn_2) FixOffset(pScrn, &(pI830->Scratch2)); -#ifdef I830_XV - if (pI830->XvEnabled) { + if (pI830->XvEnabled) FixOffset(pScrn, pI830->OverlayMem); - } -#endif + if (pI830->LinearAlloc) + FixOffset(pScrn, &pI830->LinearMem); #ifdef XF86DRI if (pI830->directRenderingEnabled) { FixOffset(pScrn, &(pI830->BackBuffer)); @@ -1230,13 +1245,13 @@ if (nr < 0 || nr > 7) { xf86DrvMsg(X_WARNING, pScrn->scrnIndex, - "SetFence: fence %d out of range\n", nr); + "SetFence: fence %d out of range\n",nr); return; } i830Reg->Fence[nr] = 0; - if (IS_I915G(pI830) || IS_I915GM(pI830)) + if (IS_I9XX(pI830)) fence_mask = ~I915G_FENCE_START_MASK; else fence_mask = ~I830_FENCE_START_MASK; @@ -1244,7 +1259,7 @@ if (start & fence_mask) { xf86DrvMsg(X_WARNING, pScrn->scrnIndex, "SetFence: %d: start (0x%08x) is not %s aligned\n", - nr, start, (IS_I915G(pI830) || IS_I915GM(pI830)) ? "1MB" : "512k"); + nr, start, (IS_I9XX(pI830)) ? "1MB" : "512k"); return; } @@ -1264,7 +1279,7 @@ val = (start | FENCE_X_MAJOR | FENCE_VALID); - if (IS_I915G(pI830) || IS_I915GM(pI830)) { + if (IS_I9XX(pI830)) { switch (size) { case MB(1): val |= I915G_FENCE_SIZE_1M; @@ -1325,7 +1340,7 @@ } } - if (IS_I915G(pI830) || IS_I915GM(pI830)) + if (IS_I9XX(pI830)) fence_pitch = pitch / 512; else fence_pitch = pitch / 128; @@ -1513,10 +1528,10 @@ if (pI830->entityPrivate && pI830->entityPrivate->pScrn_2) if (!BindMemRange(pScrn, &(pI830->Scratch2))) return FALSE; -#ifdef I830_XV if (!BindMemRange(pScrn, pI830->OverlayMem)) return FALSE; -#endif + if (!BindMemRange(pScrn, &pI830->LinearMem)) + return FALSE; #ifdef XF86DRI if (pI830->directRenderingEnabled) { if (!BindMemRange(pScrn, &(pI830->BackBuffer))) @@ -1585,10 +1600,10 @@ if (pI830->entityPrivate && pI830->entityPrivate->pScrn_2) if (!UnbindMemRange(pScrn, &(pI830->Scratch2))) return FALSE; -#ifdef I830_XV if (!UnbindMemRange(pScrn, pI830->OverlayMem)) return FALSE; -#endif + if (!UnbindMemRange(pScrn, &pI830->LinearMem)) + return FALSE; #ifdef XF86DRI if (pI830->directRenderingEnabled) { if (!UnbindMemRange(pScrn, &(pI830->BackBuffer))) Index: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_modes.c diff -u xc/programs/Xserver/hw/xfree86/drivers/i810/i830_modes.c:1.4 xc/programs/Xserver/hw/xfree86/drivers/i810/i830_modes.c:1.10 --- xc/programs/Xserver/hw/xfree86/drivers/i810/i830_modes.c:1.4 Thu Mar 3 13:06:27 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_modes.c Sat Jul 9 17:19:37 2005 @@ -27,7 +27,7 @@ * * Authors: David Dawes <dawes@xfree86.org> * - * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_modes.c,v 1.4 2005/03/03 18:06:27 alanh Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_modes.c,v 1.10 2005/07/09 21:19:37 alanh Exp $ */ /* * Modified by Alan Hourihane <alanh@tungstengraphics.com> @@ -342,7 +342,7 @@ m->HSync = h_freq; m->VRefresh = freq; - sprintf(modename, "%dx%d", m->HDisplay,m->VDisplay); + snprintf(modename, sizeof(modename), "%dx%d", m->HDisplay,m->VDisplay); m->name = xnfstrdup(modename); return (m); @@ -354,7 +354,7 @@ { CARD16 major, minor; VbeModeInfoBlock *mode; - DisplayModePtr pMode = NULL; + DisplayModePtr p = NULL, pMode = NULL; VbeModeInfoData *data; Bool modeOK = FALSE; ModeStatus status = MODE_OK; @@ -380,14 +380,75 @@ xf86ErrorFVerb(DEBUG_VERB, "*"); } + if (mode->XResolution && mode->YResolution && + !I830CheckModeSupport(pScrn, mode->XResolution, mode->YResolution, id)) + modeOK = FALSE; + + /* * Check if there's a valid monitor mode that this one can be matched - * up with. The actual matching is done later. + * up with from the 'specified' modes list. */ if (modeOK) { + for (p = pScrn->monitor->Modes; p != NULL; p = p->next) { + if ((p->type != 0) || + (p->HDisplay != mode->XResolution) || + (p->VDisplay != mode->YResolution) || + (p->Flags & (V_INTERLACE | V_DBLSCAN | V_CLKDIV2))) + continue; + status = xf86CheckModeForMonitor(p, pScrn->monitor); + if (status == MODE_OK) { + modeOK = TRUE; + break; + } + } + if (p) { + pMode = xnfcalloc(sizeof(DisplayModeRec), 1); + memcpy((char*)pMode,(char*)p,sizeof(DisplayModeRec)); + pMode->name = xnfstrdup(p->name); + } + } + + /* + * Now, check if there's a valid monitor mode that this one can be matched + * up with from the default modes list. i.e. VESA modes in xf86DefModes.c + */ + if (modeOK && !pMode) { + int refresh = 0, calcrefresh = 0; + DisplayModePtr newMode = NULL; + + for (p = pScrn->monitor->Modes; p != NULL; p = p->next) { + calcrefresh = (int)(((double)(p->Clock * 1000) / + (double)(p->HTotal * p->VTotal)) * 100); + if ((p->type != M_T_DEFAULT) || + (p->HDisplay != mode->XResolution) || + (p->VDisplay != mode->YResolution) || + (p->Flags & (V_INTERLACE | V_DBLSCAN | V_CLKDIV2))) + continue; + status = xf86CheckModeForMonitor(p, pScrn->monitor); + if (status == MODE_OK) { + if (calcrefresh > refresh) { + refresh = calcrefresh; + newMode = p; + } + modeOK = TRUE; + } + } + if (newMode) { + pMode = xnfcalloc(sizeof(DisplayModeRec), 1); + memcpy((char*)pMode,(char*)newMode,sizeof(DisplayModeRec)); + pMode->name = xnfstrdup(newMode->name); + } + } + + /* + * Check if there's a valid monitor mode that this one can be matched + * up with. The actual matching is done later. + */ + if (modeOK && !pMode) { float vrefresh = 0.0f; int i; - + for (i=0;i<pScrn->monitor->nVrefresh;i++) { for (vrefresh = pScrn->monitor->vrefresh[i].hi; @@ -408,9 +469,15 @@ pMode->type = M_T_BUILTIN; status = xf86CheckModeForMonitor(pMode, pScrn->monitor); - if (status == MODE_OK) - modeOK = TRUE; - else + if (status == MODE_OK) { + if (major >= 3) { + if (pMode->Clock * 1000 <= mode->MaxPixelClock) + modeOK = TRUE; + else + modeOK = FALSE; + } else + modeOK = TRUE; + } else modeOK = FALSE; pMode->status = status; } else { @@ -542,18 +609,14 @@ */ DisplayModePtr -i830GetModePool(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, - int modeTypes) +I830GetModePool(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe) { - DisplayModePtr pMode, p = NULL, modePool = NULL; - int i = 0; + DisplayModePtr pMode, p = NULL, modePool = NULL; + int i = 0; - if (modeTypes & V_MODETYPE_VBE) { - while (vbe->VideoModePtr[i] != 0xffff) { - int id = vbe->VideoModePtr[i++]; - - if ((pMode = CheckMode(pScrn, pVbe, vbe, id, modeTypes)) != NULL) { - ModeStatus status = MODE_OK; + for (i = 0; i < 0x7F; i++) { + if ((pMode = CheckMode(pScrn, pVbe, vbe, i, V_MODETYPE_VGA)) != NULL) { + ModeStatus status = MODE_OK; /* Check the mode against a specified virtual size (if any) */ if (pScrn->display->virtualX > 0 && @@ -580,38 +643,6 @@ } } } - } - if (modeTypes & V_MODETYPE_VGA) { - for (i = 0; i < 0x7F; i++) { - if ((pMode = CheckMode(pScrn, pVbe, vbe, i, modeTypes)) != NULL) { - ModeStatus status = MODE_OK; - - /* Check the mode against a specified virtual size (if any) */ - if (pScrn->display->virtualX > 0 && - pMode->HDisplay > pScrn->display->virtualX) { - status = MODE_VIRTUAL_X; - } - if (pScrn->display->virtualY > 0 && - pMode->VDisplay > pScrn->display->virtualY) { - status = MODE_VIRTUAL_Y; - } - if (status != MODE_OK) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Not using mode \"%dx%d\" (%s)\n", - pMode->HDisplay, pMode->VDisplay, - xf86ModeStatusToString(status)); - } else { - if (p == NULL) { - modePool = pMode; - } else { - p->next = pMode; - } - pMode->prev = NULL; - p = pMode; - } - } - } - } return modePool; } @@ -621,7 +652,7 @@ * VBE version 3.0 or later. */ void -i830SetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe) +I830SetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe) { DisplayModePtr pMode; VbeModeInfoData *data; @@ -631,9 +662,6 @@ int clock; data = (VbeModeInfoData*)pMode->Private; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Attempting to use %dHz refresh for mode \"%s\" (%x)\n", - (int)pMode->VRefresh, pMode->name, data->mode); data->block = xcalloc(sizeof(VbeCRTCInfoBlock), 1); data->block->HorizontalTotal = pMode->HTotal; data->block->HorizontalSyncStart = pMode->HSyncStart; @@ -646,23 +674,38 @@ data->block->PixelClock = pMode->Clock * 1000; /* XXX May not have this. */ clock = VBEGetPixelClock(pVbe, data->mode, data->block->PixelClock); + if (clock) + data->block->PixelClock = clock; #ifdef DEBUG ErrorF("Setting clock %.2fMHz, closest is %.2fMHz\n", (double)data->block->PixelClock / 1000000.0, (double)clock / 1000000.0); #endif - if (clock) - data->block->PixelClock = clock; data->mode |= (1 << 11); - data->block->RefreshRate = ((double)(data->block->PixelClock) / - (double)(pMode->HTotal * pMode->VTotal)) * 100; - data->block->RefreshRate = i830refreshes[I830GetBestRefresh(pScrn, data->block->RefreshRate / 100)] * 100; + if (pMode->VRefresh != 0) { + data->block->RefreshRate = pMode->VRefresh * 100; + } else { + data->block->RefreshRate = (int)(((double)(data->block->PixelClock)/ + (double)(pMode->HTotal * pMode->VTotal)) * 100); + } + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Attempting to use %2.2fHz refresh for mode \"%s\" (%x)\n", + (float)(((double)(data->block->PixelClock) / (double)(pMode->HTotal * pMode->VTotal))), pMode->name, data->mode); +#ifdef DEBUG + ErrorF("Video Modeline: ID: 0x%x Name: %s %i %i %i %i - " + " %i %i %i %i %.2f MHz Refresh: %.2f Hz\n", + data->mode, pMode->name, pMode->HDisplay, pMode->HSyncStart, + pMode->HSyncEnd, pMode->HTotal, pMode->VDisplay, + pMode->VSyncStart,pMode->VSyncEnd,pMode->VTotal, + (double)data->block->PixelClock/1000000.0, + (double)data->block->RefreshRate/100); +#endif pMode = pMode->next; } while (pMode != pScrn->modes); } void -i830PrintModes(ScrnInfoPtr scrp) +I830PrintModes(ScrnInfoPtr scrp) { DisplayModePtr p; float hsync, refresh = 0; Index: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_shadow.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/i810/i830_shadow.c:1.2 --- /dev/null Tue May 9 21:56:50 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_shadow.c Fri May 20 11:39:36 2005 @@ -0,0 +1,246 @@ +/* + Copyright (c) 1999,2000 The XFree86 Project Inc. + based on code written by Mark Vojkovich <markv@valinux.com> +*/ +/* Actually, this code was ported from the savage driver + * + * Helmar Spangenberg <hspangenberg@frey.de> + * + */ + +#include "xf86.h" +#include "i830.h" +#include "shadowfb.h" +#include "servermd.h" + +void +I830RefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) +{ + I830Ptr pI830 = I830PTR(pScrn); + int width, height, Bpp, FBPitch; + unsigned char *src, *dst; + + Bpp = pScrn->bitsPerPixel >> 3; + FBPitch = BitmapBytePad(pScrn->displayWidth * pScrn->bitsPerPixel); + + while(num--) { + width = (pbox->x2 - pbox->x1) * Bpp; + height = pbox->y2 - pbox->y1; + src = pI830->shadowPtr + (pbox->y1 * pI830->shadowPitch) + + (pbox->x1 * Bpp); + dst = pI830->FbBase + (pbox->y1 * FBPitch) + (pbox->x1 * Bpp); + + while(height--) { + memcpy(dst, src, width); + dst += FBPitch; + src += pI830->shadowPitch; + } + + pbox++; + } +} + + +void +I830PointerMoved(int index, int x, int y) +{ + ScrnInfoPtr pScrn = xf86Screens[index]; + I830Ptr pI830 = I830PTR(pScrn); + int newX, newY; + + if(pI830->rotate == 1) { + newX = pScrn->pScreen->height - y - 1; + newY = x; + } else { + newX = y; + newY = pScrn->pScreen->width - x - 1; + } + + (*pI830->PointerMoved)(index, newX, newY); +} + +void +I830RefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox) +{ + I830Ptr pI830 = I830PTR(pScrn); + int count, width, height, y1, y2, dstPitch, srcPitch; + CARD8 *dstPtr, *srcPtr, *src; + CARD32 *dst; + + dstPitch = pScrn->displayWidth; + srcPitch = -pI830->rotate * pI830->shadowPitch; + + while(num--) { + width = pbox->x2 - pbox->x1; + y1 = pbox->y1 & ~3; + y2 = (pbox->y2 + 3) & ~3; + height = (y2 - y1) >> 2; /* in dwords */ + + if(pI830->rotate == 1) { + dstPtr = pI830->FbBase + + (pbox->x1 * dstPitch) + pScrn->virtualX - y2; + srcPtr = pI830->shadowPtr + ((1 - y2) * srcPitch) + pbox->x1; + } else { + dstPtr = pI830->FbBase + + ((pScrn->virtualY - pbox->x2) * dstPitch) + y1; + srcPtr = pI830->shadowPtr + (y1 * srcPitch) + pbox->x2 - 1; + } + + while(width--) { + src = srcPtr; + dst = (CARD32*)dstPtr; + count = height; + while(count--) { + *(dst++) = src[0] | (src[srcPitch] << 8) | + (src[srcPitch * 2] << 16) | + (src[srcPitch * 3] << 24); + src += srcPitch * 4; + } + srcPtr += pI830->rotate; + dstPtr += dstPitch; + } + + pbox++; + } +} + + +void +I830RefreshArea16(ScrnInfoPtr pScrn, int num, BoxPtr pbox) +{ + I830Ptr pI830 = I830PTR(pScrn); + int count, width, height, y1, y2, dstPitch, srcPitch; + CARD16 *dstPtr, *srcPtr, *src; + CARD32 *dst; + + dstPitch = pScrn->displayWidth; + srcPitch = -pI830->rotate * pI830->shadowPitch >> 1; + + while(num--) { + width = pbox->x2 - pbox->x1; + y1 = pbox->y1 & ~1; + y2 = (pbox->y2 + 1) & ~1; + height = (y2 - y1) >> 1; /* in dwords */ + + if(pI830->rotate == 1) { + dstPtr = (CARD16*)pI830->FbBase + + (pbox->x1 * dstPitch) + pScrn->virtualX - y2; + srcPtr = (CARD16*)pI830->shadowPtr + + ((1 - y2) * srcPitch) + pbox->x1; + } else { + dstPtr = (CARD16*)pI830->FbBase + + ((pScrn->virtualY - pbox->x2) * dstPitch) + y1; + srcPtr = (CARD16*)pI830->shadowPtr + + (y1 * srcPitch) + pbox->x2 - 1; + } + + while(width--) { + src = srcPtr; + dst = (CARD32*)dstPtr; + count = height; + while(count--) { + *(dst++) = src[0] | (src[srcPitch] << 16); + src += srcPitch * 2; + } + srcPtr += pI830->rotate; + dstPtr += dstPitch; + } + + pbox++; + } +} + + +/* this one could be faster */ +void +I830RefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox) +{ + I830Ptr pI830 = I830PTR(pScrn); + int count, width, height, y1, y2, dstPitch, srcPitch; + CARD8 *dstPtr, *srcPtr, *src; + CARD32 *dst; + + dstPitch = BitmapBytePad(pScrn->displayWidth * 24); + srcPitch = -pI830->rotate * pI830->shadowPitch; + + while(num--) { + width = pbox->x2 - pbox->x1; + y1 = pbox->y1 & ~3; + y2 = (pbox->y2 + 3) & ~3; + height = (y2 - y1) >> 2; /* blocks of 3 dwords */ + + if(pI830->rotate == 1) { + dstPtr = pI830->FbBase + + (pbox->x1 * dstPitch) + ((pScrn->virtualX - y2) * 3); + srcPtr = pI830->shadowPtr + ((1 - y2) * srcPitch) + (pbox->x1 * 3); + } else { + dstPtr = pI830->FbBase + + ((pScrn->virtualY - pbox->x2) * dstPitch) + (y1 * 3); + srcPtr = pI830->shadowPtr + (y1 * srcPitch) + (pbox->x2 * 3) - 3; + } + + while(width--) { + src = srcPtr; + dst = (CARD32*)dstPtr; + count = height; + while(count--) { + dst[0] = src[0] | (src[1] << 8) | (src[2] << 16) | + (src[srcPitch] << 24); + dst[1] = src[srcPitch + 1] | (src[srcPitch + 2] << 8) | + (src[srcPitch * 2] << 16) | + (src[(srcPitch * 2) + 1] << 24); + dst[2] = src[(srcPitch * 2) + 2] | (src[srcPitch * 3] << 8) | + (src[(srcPitch * 3) + 1] << 16) | + (src[(srcPitch * 3) + 2] << 24); + dst += 3; + src += srcPitch * 4; + } + srcPtr += pI830->rotate * 3; + dstPtr += dstPitch; + } + + pbox++; + } +} + +void +I830RefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox) +{ + I830Ptr pI830 = I830PTR(pScrn); + int count, width, height, dstPitch, srcPitch; + CARD32 *dstPtr, *srcPtr, *src, *dst; + + dstPitch = pScrn->displayWidth; + srcPitch = -pI830->rotate * pI830->shadowPitch >> 2; + + while(num--) { + width = pbox->x2 - pbox->x1; + height = pbox->y2 - pbox->y1; + + if(pI830->rotate == 1) { + dstPtr = (CARD32*)pI830->FbBase + + (pbox->x1 * dstPitch) + pScrn->virtualX - pbox->y2; + srcPtr = (CARD32*)pI830->shadowPtr + + ((1 - pbox->y2) * srcPitch) + pbox->x1; + } else { + dstPtr = (CARD32*)pI830->FbBase + + ((pScrn->virtualY - pbox->x2) * dstPitch) + pbox->y1; + srcPtr = (CARD32*)pI830->shadowPtr + + (pbox->y1 * srcPitch) + pbox->x2 - 1; + } + + while(width--) { + src = srcPtr; + dst = dstPtr; + count = height; + while(count--) { + *(dst++) = *src; + src += srcPitch; + } + srcPtr += pI830->rotate; + dstPtr += dstPitch; + } + + pbox++; + } +} Index: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c:1.20 xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c:1.27 --- xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c:1.20 Tue Mar 1 14:56:31 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c Fri Mar 10 07:44:20 2006 @@ -24,7 +24,7 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c,v 1.20 2005/03/01 19:56:31 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c,v 1.27 2006/03/10 12:44:20 alanh Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: @@ -72,7 +72,7 @@ #include "i830.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "xaa.h" #include "dixstruct.h" #include "fourcc.h" @@ -112,9 +112,10 @@ static Atom xvBrightness, xvContrast, xvColorKey, xvPipe; static Atom xvGamma0, xvGamma1, xvGamma2, xvGamma3, xvGamma4, xvGamma5; -#define IMAGE_MAX_WIDTH 1440 -#define IMAGE_MAX_HEIGHT 1080 -#define Y_BUF_SIZE (IMAGE_MAX_WIDTH * IMAGE_MAX_HEIGHT) +#define IMAGE_MAX_WIDTH 1920 +#define IMAGE_MAX_HEIGHT 1088 +#define IMAGE_MAX_WIDTH_LEGACY 1024 +#define IMAGE_MAX_HEIGHT_LEGACY 1088 #if !VIDEO_DEBUG #define ErrorF Edummy @@ -133,13 +134,13 @@ * all modes of server exit. */ -#define OVERLAY_UPDATE \ +#define OVERLAY_UPDATE \ do { \ BEGIN_LP_RING(6); \ OUT_RING(MI_FLUSH | MI_WRITE_DIRTY_STATE); \ OUT_RING(MI_NOOP); \ if (!*pI830->overlayOn) { \ - OUT_RING(MI_NOOP); \ + OUT_RING(MI_NOOP); \ OUT_RING(MI_NOOP); \ OUT_RING(MI_OVERLAY_FLIP | MI_OVERLAY_FLIP_ON); \ ErrorF("Overlay goes from off to on\n"); \ @@ -149,7 +150,7 @@ OUT_RING(MI_NOOP); \ OUT_RING(MI_OVERLAY_FLIP | MI_OVERLAY_FLIP_CONTINUE); \ } \ - OUT_RING(pI830->OverlayMem->Physical | 1); \ + OUT_RING(pI830->OverlayMem->Physical | OFC_UPDATE); \ ADVANCE_LP_RING(); \ ErrorF("OVERLAY_UPDATE\n"); \ } while(0) @@ -157,18 +158,28 @@ #define OVERLAY_OFF \ do { \ if (*pI830->overlayOn) { \ - BEGIN_LP_RING(8); \ + int spin = 1000000; \ + BEGIN_LP_RING(12); \ OUT_RING(MI_FLUSH | MI_WRITE_DIRTY_STATE); \ OUT_RING(MI_NOOP); \ OUT_RING(MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP); \ OUT_RING(MI_NOOP); \ + OUT_RING(MI_OVERLAY_FLIP | MI_OVERLAY_FLIP_CONTINUE); \ + OUT_RING(pI830->OverlayMem->Physical | OFC_UPDATE); \ + OUT_RING(MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP); \ + OUT_RING(MI_NOOP); \ OUT_RING(MI_OVERLAY_FLIP | MI_OVERLAY_FLIP_OFF); \ - OUT_RING(pI830->OverlayMem->Physical); \ + OUT_RING(pI830->OverlayMem->Physical | OFC_UPDATE); \ OUT_RING(MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP); \ OUT_RING(MI_NOOP); \ ADVANCE_LP_RING(); \ *pI830->overlayOn = FALSE; \ ErrorF("Overlay goes from on to off\n"); \ + while (spin != 0 && (INREG(OCMD_REGISTER) & OVERLAY_ENABLE)){ \ + ErrorF("SPIN %d\n",spin); \ + spin--; \ + } \ + if (spin == 0) ErrorF("OVERLAY FAILED TO GO OFF\n"); \ ErrorF("OVERLAY_OFF\n"); \ } \ } while(0) @@ -176,6 +187,7 @@ /* * OCMD - Overlay Command Register */ +#define OCMD_REGISTER 0x30168 #define MIRROR_MODE (0x3<<17) #define MIRROR_HORIZONTAL (0x1<<17) #define MIRROR_VERTICAL (0x2<<17) @@ -207,11 +219,15 @@ #define FIELD1 (0x1<<1) #define OVERLAY_ENABLE 0x1 +#define OFC_UPDATE 0x1 + /* OCONFIG register */ #define CC_OUT_8BIT (0x1<<3) #define OVERLAY_PIPE_MASK (0x1<<18) #define OVERLAY_PIPE_A (0x0<<18) #define OVERLAY_PIPE_B (0x1<<18) +#define THREE_LINE_BUFFERS (0x1<<0) +#define TWO_LINE_BUFFERS (0x0<<0) /* DCLRKM register */ #define DEST_KEY_ENABLE (0x1<<31) @@ -250,27 +266,34 @@ {15, TrueColor}, {16, TrueColor}, {24, TrueColor} }; -#define NUM_ATTRIBUTES 10 +#define CLONE_ATTRIBUTES 1 +static XF86AttributeRec CloneAttributes[CLONE_ATTRIBUTES] = { + {XvSettable | XvGettable, 0, 1, "XV_PIPE"} +}; +#define NUM_ATTRIBUTES 3 static XF86AttributeRec Attributes[NUM_ATTRIBUTES] = { {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"}, {XvSettable | XvGettable, -128, 127, "XV_BRIGHTNESS"}, {XvSettable | XvGettable, 0, 255, "XV_CONTRAST"}, +}; + +#define GAMMA_ATTRIBUTES 6 +static XF86AttributeRec GammaAttributes[GAMMA_ATTRIBUTES] = { {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA0"}, {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA1"}, {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA2"}, {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA3"}, {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA4"}, - {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA5"}, - {XvSettable | XvGettable, 0, 1, "XV_PIPE"} + {XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA5"} }; #define NUM_IMAGES 4 static XF86ImageRec Images[NUM_IMAGES] = { - XVIMAGE_YUY2, XVIMAGE_YV12, XVIMAGE_I420, + XVIMAGE_YUY2, XVIMAGE_UYVY }; @@ -463,10 +486,10 @@ overlay->HORZ_PH = 0; overlay->INIT_PHS = 0; overlay->DWINPOS = 0; - overlay->DWINSZ = (IMAGE_MAX_HEIGHT << 16) | IMAGE_MAX_WIDTH; - overlay->SWIDTH = IMAGE_MAX_WIDTH | (IMAGE_MAX_WIDTH << 16); - overlay->SWIDTHSW = (IMAGE_MAX_WIDTH >> 3) | (IMAGE_MAX_WIDTH << 12); - overlay->SHEIGHT = IMAGE_MAX_HEIGHT | (IMAGE_MAX_HEIGHT << 15); + overlay->DWINSZ = 0; + overlay->SWIDTH = 0; + overlay->SWIDTHSW = 0; + overlay->SHEIGHT = 0; overlay->OCLRC0 = (pPriv->contrast << 18) | (pPriv->brightness & 0xff); overlay->OCLRC1 = 0x00000080; /* saturation: bypass */ overlay->AWINPOS = 0; @@ -581,6 +604,7 @@ I830Ptr pI830 = I830PTR(pScrn); XF86VideoAdaptorPtr adapt; I830PortPrivPtr pPriv; + XF86AttributePtr att; DPRINTF(PFX, "I830SetupImageVideo\n"); @@ -593,6 +617,11 @@ adapt->name = "Intel(R) Video Overlay"; adapt->nEncodings = 1; adapt->pEncodings = DummyEncoding; + /* update the DummyEncoding for these two chipsets */ + if (IS_845G(pI830) || IS_I830(pI830)) { + adapt->pEncodings->width = IMAGE_MAX_WIDTH_LEGACY; + adapt->pEncodings->height = IMAGE_MAX_HEIGHT_LEGACY; + } adapt->nFormats = NUM_FORMATS; adapt->pFormats = Formats; adapt->nPorts = 1; @@ -601,14 +630,25 @@ pPriv = (I830PortPrivPtr) (&adapt->pPortPrivates[1]); adapt->pPortPrivates[0].ptr = (pointer) (pPriv); - adapt->pAttributes = Attributes; - adapt->nImages = NUM_IMAGES; - if (IS_I915G(pI830) || IS_I915GM(pI830)) - adapt->nAttributes = 9; /* has gamma */ - else - adapt->nAttributes = 3; + adapt->nAttributes = NUM_ATTRIBUTES; if (pI830->Clone) - adapt->nAttributes += 1; + adapt->nAttributes += CLONE_ATTRIBUTES; + if (IS_I9XX(pI830)) + adapt->nAttributes += GAMMA_ATTRIBUTES; /* has gamma */ + adapt->pAttributes = xnfalloc(sizeof(XF86AttributeRec) * adapt->nAttributes); + /* Now copy the attributes */ + att = adapt->pAttributes; + memcpy((char *)att, (char*)Attributes, sizeof(XF86AttributeRec)* NUM_ATTRIBUTES); + att+=NUM_ATTRIBUTES; + if (pI830->Clone) { + memcpy((char*)att, (char*)CloneAttributes, sizeof(XF86AttributeRec) * CLONE_ATTRIBUTES); + att+=CLONE_ATTRIBUTES; + } + if (IS_I9XX(pI830)) { + memcpy((char*)att, (char*)GammaAttributes, sizeof(XF86AttributeRec) * GAMMA_ATTRIBUTES); + att+=GAMMA_ATTRIBUTES; + } + adapt->nImages = NUM_IMAGES; adapt->pImages = Images; adapt->PutVideo = NULL; adapt->PutStill = NULL; @@ -656,15 +696,15 @@ pI830->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = I830BlockHandler; + xvColorKey = MAKE_ATOM("XV_COLORKEY"); xvBrightness = MAKE_ATOM("XV_BRIGHTNESS"); xvContrast = MAKE_ATOM("XV_CONTRAST"); - xvColorKey = MAKE_ATOM("XV_COLORKEY"); - + /* Allow the pipe to be switched from pipe A to B when in clone mode */ if (pI830->Clone) xvPipe = MAKE_ATOM("XV_PIPE"); - - if (IS_I915G(pI830) || IS_I915GM(pI830)) { + + if (IS_I9XX(pI830)) { xvGamma0 = MAKE_ATOM("XV_GAMMA0"); xvGamma1 = MAKE_ATOM("XV_GAMMA1"); xvGamma2 = MAKE_ATOM("XV_GAMMA2"); @@ -695,10 +735,12 @@ if (shutdown) { if (pPriv->videoStatus & CLIENT_VIDEO_ON) { + overlay->OCMD &= ~OVERLAY_ENABLE; OVERLAY_UPDATE; - +#if 1 OVERLAY_OFF; +#endif if (pI830->entityPrivate) pI830->entityPrivate->XvInUse = -1; @@ -731,15 +773,23 @@ return BadValue; pPriv->brightness = value; overlay->OCLRC0 = (pPriv->contrast << 18) | (pPriv->brightness & 0xff); - if (pPriv->overlayOK) - OVERLAY_UPDATE; + ErrorF("BRIGHTNESS\n"); + overlay->OCMD &= ~OVERLAY_ENABLE; + OVERLAY_UPDATE; +#if 1 + OVERLAY_OFF; +#endif } else if (attribute == xvContrast) { if ((value < 0) || (value > 255)) return BadValue; pPriv->contrast = value; overlay->OCLRC0 = (pPriv->contrast << 18) | (pPriv->brightness & 0xff); - if (pPriv->overlayOK) - OVERLAY_UPDATE; + ErrorF("CONTRAST\n"); + overlay->OCMD &= ~OVERLAY_ENABLE; + OVERLAY_UPDATE; +#if 1 + OVERLAY_OFF; +#endif } else if (pI830->Clone && attribute == xvPipe) { if ((value < 0) || (value > 1)) return BadValue; @@ -752,52 +802,36 @@ overlay->OCONFIG |= OVERLAY_PIPE_A; else overlay->OCONFIG |= OVERLAY_PIPE_B; - if (pPriv->overlayOK) - OVERLAY_UPDATE; - } else if (attribute == xvGamma0 && (IS_I915G(pI830) || IS_I915GM(pI830))) { - /* Avoid video anomalies, so set gamma registers when overlay is off */ - /* We also clamp the values if they are outside the ranges */ - if (!*pI830->overlayOn) { - pPriv->gamma0 = value; - if (pPriv->gamma1 - pPriv->gamma0 > 0x7d) - pPriv->gamma1 = pPriv->gamma0 + 0x7d; - } else - return BadRequest; - } else if (attribute == xvGamma1 && (IS_I915G(pI830) || IS_I915GM(pI830))) { - if (!*pI830->overlayOn) { - pPriv->gamma1 = value; - if (pPriv->gamma1 - pPriv->gamma0 > 0x7d) - pPriv->gamma0 = pPriv->gamma1 - 0x7d; - } else - return BadRequest; - } else if (attribute == xvGamma2 && (IS_I915G(pI830) || IS_I915GM(pI830))) { - if (!*pI830->overlayOn) { - pPriv->gamma2 = value; - if (pPriv->gamma3 - pPriv->gamma2 > 0x7d) - pPriv->gamma3 = pPriv->gamma2 + 0x7d; - } else - return BadRequest; - } else if (attribute == xvGamma3 && (IS_I915G(pI830) || IS_I915GM(pI830))) { - if (!*pI830->overlayOn) { - pPriv->gamma3 = value; - if (pPriv->gamma3 - pPriv->gamma2 > 0x7d) - pPriv->gamma2 = pPriv->gamma3 - 0x7d; - } else - return BadRequest; - } else if (attribute == xvGamma4 && (IS_I915G(pI830) || IS_I915GM(pI830))) { - if (!*pI830->overlayOn) { - pPriv->gamma4 = value; - if (pPriv->gamma5 - pPriv->gamma4 > 0x7d) - pPriv->gamma5 = pPriv->gamma4 + 0x7d; - } else - return BadRequest; - } else if (attribute == xvGamma5 && (IS_I915G(pI830) || IS_I915GM(pI830))) { - if (!*pI830->overlayOn) { - pPriv->gamma5 = value; - if (pPriv->gamma5 - pPriv->gamma4 > 0x7d) - pPriv->gamma4 = pPriv->gamma5 - 0x7d; - } else - return BadRequest; + ErrorF("PIPE CHANGE\n"); + overlay->OCMD &= ~OVERLAY_ENABLE; + OVERLAY_UPDATE; +#if 1 + OVERLAY_OFF; +#endif + } else if (attribute == xvGamma0 && (IS_I9XX(pI830))) { + pPriv->gamma0 = value; + if (pPriv->gamma1 - pPriv->gamma0 > 0x7d) + pPriv->gamma1 = pPriv->gamma0 + 0x7d; + } else if (attribute == xvGamma1 && (IS_I9XX(pI830))) { + pPriv->gamma1 = value; + if (pPriv->gamma1 - pPriv->gamma0 > 0x7d) + pPriv->gamma0 = pPriv->gamma1 - 0x7d; + } else if (attribute == xvGamma2 && (IS_I9XX(pI830))) { + pPriv->gamma2 = value; + if (pPriv->gamma3 - pPriv->gamma2 > 0x7d) + pPriv->gamma3 = pPriv->gamma2 + 0x7d; + } else if (attribute == xvGamma3 && (IS_I9XX(pI830))) { + pPriv->gamma3 = value; + if (pPriv->gamma3 - pPriv->gamma2 > 0x7d) + pPriv->gamma2 = pPriv->gamma3 - 0x7d; + } else if (attribute == xvGamma4 && (IS_I9XX(pI830))) { + pPriv->gamma4 = value; + if (pPriv->gamma5 - pPriv->gamma4 > 0x7d) + pPriv->gamma5 = pPriv->gamma4 + 0x7d; + } else if (attribute == xvGamma5 && (IS_I9XX(pI830))) { + pPriv->gamma5 = value; + if (pPriv->gamma5 - pPriv->gamma4 > 0x7d) + pPriv->gamma4 = pPriv->gamma5 - 0x7d; } else if (attribute == xvColorKey) { pPriv->colorKey = value; switch (pScrn->depth) { @@ -811,8 +845,12 @@ overlay->DCLRKV = pPriv->colorKey; break; } - if (pPriv->overlayOK) - OVERLAY_UPDATE; + ErrorF("COLORKEY\n"); + overlay->OCMD &= ~OVERLAY_ENABLE; + OVERLAY_UPDATE; +#if 1 + OVERLAY_OFF; +#endif REGION_EMPTY(pScrn->pScreen, &pPriv->clip); } else return BadMatch; @@ -823,7 +861,13 @@ attribute == xvGamma2 || attribute == xvGamma3 || attribute == xvGamma4 || - attribute == xvGamma5) && (IS_I915G(pI830) || IS_I915GM(pI830))) { + attribute == xvGamma5) && (IS_I9XX(pI830))) { + ErrorF("GAMMA\n"); + overlay->OCMD &= ~OVERLAY_ENABLE; + OVERLAY_UPDATE; +#if 1 + OVERLAY_OFF; +#endif I830UpdateGamma(pScrn); } @@ -843,21 +887,21 @@ *value = pPriv->contrast; } else if (pI830->Clone && attribute == xvPipe) { *value = pPriv->pipe; - } else if (attribute == xvGamma0 && (IS_I915G(pI830) || IS_I915GM(pI830))) { + } else if (attribute == xvGamma0 && (IS_I9XX(pI830))) { *value = pPriv->gamma0; - } else if (attribute == xvGamma1 && (IS_I915G(pI830) || IS_I915GM(pI830))) { + } else if (attribute == xvGamma1 && (IS_I9XX(pI830))) { *value = pPriv->gamma1; - } else if (attribute == xvGamma2 && (IS_I915G(pI830) || IS_I915GM(pI830))) { + } else if (attribute == xvGamma2 && (IS_I9XX(pI830))) { *value = pPriv->gamma2; - } else if (attribute == xvGamma3 && (IS_I915G(pI830) || IS_I915GM(pI830))) { + } else if (attribute == xvGamma3 && (IS_I9XX(pI830))) { *value = pPriv->gamma3; - } else if (attribute == xvGamma4 && (IS_I915G(pI830) || IS_I915GM(pI830))) { + } else if (attribute == xvGamma4 && (IS_I9XX(pI830))) { *value = pPriv->gamma4; - } else if (attribute == xvGamma5 && (IS_I915G(pI830) || IS_I915GM(pI830))) { + } else if (attribute == xvGamma5 && (IS_I9XX(pI830))) { *value = pPriv->gamma5; } else if (attribute == xvColorKey) { *value = pPriv->colorKey; - } else + } else return BadMatch; return Success; @@ -1122,6 +1166,7 @@ I830OverlayRegPtr overlay = (I830OverlayRegPtr) (pI830->FbBase + pI830->OverlayMem->Start); unsigned int swidth; + unsigned int mask, shift, offsety, offsetu; ErrorF("I830DisplayVideo: %dx%d (pitch %d)\n", width, height, dstPitch); @@ -1129,63 +1174,118 @@ if (!pPriv->overlayOK) return; + if (IS_I9XX(pI830)) { + shift = 6; + mask = 0x3f; + } else { + shift = 5; + mask = 0x1f; + } + + if (pPriv->currentBuf == 0) { + offsety = pPriv->YBuf0offset; + offsetu = pPriv->UBuf0offset; + } else { + offsety = pPriv->YBuf1offset; + offsetu = pPriv->UBuf1offset; + } + #if VIDEO_DEBUG CompareOverlay(pI830, (CARD32 *) overlay, 0x100); #endif /* When in dual head with different bpp setups we need to refresh the * color key, so let's reset the video parameters and refresh here */ - I830ResetVideo(pScrn); +#if 0 + if (pI830->entityPrivate) +#endif + I830ResetVideo(pScrn); switch (id) { case FOURCC_YV12: case FOURCC_I420: - swidth = (width + 1) & ~1 & 0xfff; + swidth = width; + overlay->SWIDTH = swidth; swidth /= 2; overlay->SWIDTH |= (swidth & 0x7ff) << 16; - swidth = ((pPriv->YBuf0offset + width + 0x1f) >> 5) - - (pPriv->YBuf0offset >> 5) - 1; + swidth = ((offsety + width + mask) >> shift) - + (offsety >> shift); + + if (IS_I9XX(pI830)) + swidth <<= 1; - ErrorF("Y width is %d, swidthsw is %d\n", width, swidth); + swidth -= 1; + + ErrorF("Y width is %d, swidth is %d\n", width, swidth); overlay->SWIDTHSW = swidth << 2; - swidth = ((pPriv->UBuf0offset + (width / 2) + 0x1f) >> 5) - - (pPriv->UBuf0offset >> 5) - 1; + swidth = ((offsetu + (width / 2) + mask) >> shift) - + (offsetu >> shift); + + if (IS_I9XX(pI830)) + swidth <<= 1; + + swidth -= 1; + ErrorF("UV width is %d, swidthsw is %d\n", width / 2, swidth); overlay->SWIDTHSW |= swidth << 18; + + ErrorF("HEIGHT is %d\n",height); + + overlay->SHEIGHT = height | ((height / 2) << 16); break; case FOURCC_UYVY: case FOURCC_YUY2: default: - /* XXX Check for i845 */ - - swidth = ((width + 31) & ~31) << 1; + swidth = width; overlay->SWIDTH = swidth; - overlay->SWIDTHSW = swidth >> 3; + + ErrorF("Y width is %d\n", swidth); + + swidth = ((offsety + (width << 1) + mask) >> shift) - + (offsety >> shift); + + if (IS_I9XX(pI830)) + swidth <<= 1; + + swidth -= 1; + + ErrorF("swidthsw is %d\n", swidth); + + overlay->SWIDTHSW = swidth << 2; + + ErrorF("HEIGHT is %d\n",height); + + overlay->SHEIGHT = height; break; } - overlay->SHEIGHT = height | ((height / 2) << 16); - if (pPriv->oneLineMode) { /* change the coordinates with panel fitting active */ dstBox->y1 = (((dstBox->y1 - 1) * pPriv->scaleRatio) >> 16) + 1; dstBox->y2 = ((dstBox->y2 * pPriv->scaleRatio) >> 16) + 1; - + /* Now, alter the height, so we scale to the correct size */ - drw_h = dstBox->y2 - dstBox->y1; - if (drw_h < height) drw_h = height; + drw_h = ((drw_h * pPriv->scaleRatio) >> 16) + 1; + + /* Keep the engine happy */ + if (dstBox->y1 < 0) dstBox->y1 = 0; + if (dstBox->y2 < 0) dstBox->y2 = 0; } + overlay->DWINPOS = (dstBox->y1 << 16) | dstBox->x1; overlay->DWINSZ = ((dstBox->y2 - dstBox->y1) << 16) | (dstBox->x2 - dstBox->x1); + ErrorF("dstBox: x1: %d, y1: %d, x2: %d, y2: %d\n", dstBox->x1, dstBox->y1, + dstBox->x2, dstBox->y2); + /* buffer locations */ overlay->OBUF_0Y = pPriv->YBuf0offset; overlay->OBUF_0U = pPriv->UBuf0offset; @@ -1440,21 +1540,24 @@ drw_w, drw_h, width, height); if (pI830->entityPrivate) { - if (pI830->entityPrivate->XvInUse != -1 && - pI830->entityPrivate->XvInUse != pPriv->pipe) { -#ifdef PANORAMIX - if (!noPanoramiXExtension) { - return Success; /* faked for trying to share it */ - } else -#endif - { - return BadAlloc; - } - } + if (pI830->entityPrivate->XvInUse != -1 && + pI830->entityPrivate->XvInUse != pPriv->pipe) { + if (IsXineramaActive()) + return Success; /* faked for trying to share it */ + else + return BadAlloc; + } pI830->entityPrivate->XvInUse = pPriv->pipe; } + /* overlay limits */ + if(src_w > (drw_w * 7)) + drw_w = src_w * 7; + + if(src_h > (drw_h * 7)) + drw_h = src_h * 7; + /* Clip */ x1 = src_x; x2 = src_x + src_w; @@ -1480,14 +1583,14 @@ case FOURCC_I420: srcPitch = (width + 3) & ~3; srcPitch2 = ((width >> 1) + 3) & ~3; - dstPitch = ((width / 2) + 31) & ~31; /* of chroma */ + dstPitch = ((width / 2) + 63) & ~63; /* of chroma */ size = dstPitch * height * 3; break; case FOURCC_UYVY: case FOURCC_YUY2: default: - srcPitch = (width << 1); - dstPitch = (srcPitch + 31) & ~31; + srcPitch = width << 1; + dstPitch = (srcPitch + 63) & ~63; /* of chroma */ size = dstPitch * height; break; } @@ -1575,14 +1678,22 @@ unsigned short *w, unsigned short *h, int *pitches, int *offsets) { + I830Ptr pI830 = I830PTR(pScrn); int size, tmp; - DPRINTF(PFX, "I830QueryImageAttributes: w is %d, h is %d\n", *w, *h); + ErrorF("I830QueryImageAttributes: w is %d, h is %d\n", *w, *h); + if (IS_845G(pI830) || IS_I830(pI830)) { + if (*w > IMAGE_MAX_WIDTH_LEGACY) + *w = IMAGE_MAX_WIDTH_LEGACY; + if (*h > IMAGE_MAX_HEIGHT_LEGACY) + *h = IMAGE_MAX_HEIGHT_LEGACY; + } else { if (*w > IMAGE_MAX_WIDTH) *w = IMAGE_MAX_WIDTH; if (*h > IMAGE_MAX_HEIGHT) *h = IMAGE_MAX_HEIGHT; + } *w = (*w + 1) & ~1; if (offsets) @@ -1652,24 +1763,29 @@ pScreen->BlockHandler = I830BlockHandler; if (pPriv->videoStatus & TIMER_MASK) { +#if 1 + Time now = currentTime.milliseconds; +#else UpdateCurrentTime(); +#endif if (pPriv->videoStatus & OFF_TIMER) { - if (pPriv->offTime < currentTime.milliseconds) { + if (pPriv->offTime < now) { /* Turn off the overlay */ + ErrorF("BLOCKHANDLER\n"); overlay->OCMD &= ~OVERLAY_ENABLE; - - OVERLAY_UPDATE; - - OVERLAY_OFF; + OVERLAY_UPDATE; +#if 1 + OVERLAY_OFF; +#endif pPriv->videoStatus = FREE_TIMER; - pPriv->freeTime = currentTime.milliseconds + FREE_DELAY; + pPriv->freeTime = now + FREE_DELAY; if (pI830->entityPrivate) pI830->entityPrivate->XvInUse = -1; } } else { /* FREE_TIMER */ - if (pPriv->freeTime < currentTime.milliseconds) { + if (pPriv->freeTime < now) { if (pPriv->linear) { xf86FreeOffscreenLinear(pPriv->linear); pPriv->linear = NULL; @@ -1700,10 +1816,15 @@ OffscreenPrivPtr pPriv; I830Ptr pI830 = I830PTR(pScrn); - DPRINTF(PFX, "I830AllocateSurface\n"); + ErrorF("I830AllocateSurface\n"); - if ((w > 1024) || (h > 1024)) - return BadAlloc; + if (IS_845G(pI830) || IS_I830(pI830)) { + if ((w > IMAGE_MAX_WIDTH_LEGACY) || (h > IMAGE_MAX_HEIGHT_LEGACY)) + return BadAlloc; + } else { + if ((w > IMAGE_MAX_WIDTH) || (h > IMAGE_MAX_HEIGHT)) + return BadAlloc; + } w = (w + 1) & ~1; pitch = ((w << 1) + 15) & ~15; @@ -1759,11 +1880,12 @@ I830OverlayRegPtr overlay = (I830OverlayRegPtr) (pI830->FbBase + pI830->OverlayMem->Start); + ErrorF("StopSurface\n"); overlay->OCMD &= ~OVERLAY_ENABLE; - OVERLAY_UPDATE; - +#if 1 OVERLAY_OFF; +#endif if (pI830->entityPrivate) pI830->entityPrivate->XvInUse = -1; @@ -1821,17 +1943,13 @@ DPRINTF(PFX, "I830DisplaySurface\n"); if (pI830->entityPrivate) { - if (pI830->entityPrivate->XvInUse != -1 && - pI830->entityPrivate->XvInUse != pI830Priv->pipe) { -#ifdef PANORAMIX - if (!noPanoramiXExtension) { - return Success; /* faked for trying to share it */ - } else -#endif - { - return BadAlloc; - } - } + if (pI830->entityPrivate->XvInUse != -1 && + pI830->entityPrivate->XvInUse != pI830Priv->pipe) { + if (IsXineramaActive()) + return Success; /* faked for trying to share it */ + else + return BadAlloc; + } pI830->entityPrivate->XvInUse = pI830Priv->pipe; } @@ -1902,6 +2020,8 @@ static void I830InitOffscreenImages(ScreenPtr pScreen) { + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + I830Ptr pI830 = I830PTR(pScrn); XF86OffscreenImagePtr offscreenImages; /* need to free this someplace */ @@ -1917,8 +2037,13 @@ offscreenImages[0].stop = I830StopSurface; offscreenImages[0].setAttribute = I830SetSurfaceAttribute; offscreenImages[0].getAttribute = I830GetSurfaceAttribute; - offscreenImages[0].max_width = 1024; - offscreenImages[0].max_height = 1024; + if (IS_845G(pI830) || IS_I830(pI830)) { + offscreenImages[0].max_width = IMAGE_MAX_WIDTH_LEGACY; + offscreenImages[0].max_height = IMAGE_MAX_HEIGHT_LEGACY; + } else { + offscreenImages[0].max_width = IMAGE_MAX_WIDTH; + offscreenImages[0].max_height = IMAGE_MAX_HEIGHT; + } offscreenImages[0].num_attributes = 1; offscreenImages[0].attributes = Attributes; @@ -1947,6 +2072,8 @@ */ I830StopVideo(pScrn, pPriv, TRUE); + pPriv->overlayOK = FALSE; + pPriv->oneLineMode = FALSE; } @@ -1964,6 +2091,17 @@ if (!pPriv) return; + pPriv->overlayOK = TRUE; + + /* ensure pipe is updated on mode switch */ + if (!pI830->Clone) { + if (pPriv->pipe != pI830->pipe) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Changing XVideo pipe (%d to %d).\n", pPriv->pipe, pI830->pipe); + pPriv->pipe = pI830->pipe; + } + } + if (pPriv->pipe == 0) { if (INREG(PIPEACONF) & PIPEACONF_DOUBLE_WIDE) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, @@ -1988,12 +2126,13 @@ } } - /* Check we are on pipe B and have an LFP connected */ - if ((pPriv->pipe == 1) && (pI830->operatingDevices & (PIPE_LFP << 8))) { - size = INREG(PIPEBSRC); + /* Check we have an LFP connected */ + if ((pPriv->pipe == 1 && pI830->operatingDevices & (PIPE_LFP << 8)) || + (pPriv->pipe == 0 && pI830->operatingDevices & PIPE_LFP) ) { + size = pI830->pipe ? INREG(PIPEBSRC) : INREG(PIPEASRC); hsize = (size >> 16) & 0x7FF; vsize = size & 0x7FF; - active = INREG(VTOTAL_B) & 0x7FF; + active = pI830->pipe ? (INREG(VTOTAL_B) & 0x7FF) : (INREG(VTOTAL_A) & 0x7FF); if (vsize < active && hsize > 1024) I830SetOneLineModeRatio(pScrn); Index: xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile:1.7 xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile:1.9 --- xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile:1.7 Mon May 31 20:17:01 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile Fri Oct 14 11:16:41 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile,v 1.7 2004/06/01 00:17:01 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile,v 1.9 2005/10/14 15:16:41 tsi Exp $ /* * * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> @@ -59,18 +59,13 @@ OBJS = imstt_driver.o imstt_accel.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ - -I$(XF86SRC)/xaa \ - -I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \ - -I$(SERVERSRC)/Xext \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ - -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ - -I$(XF86SRC)/fbdevhw -I$(SERVERSRC)/render \ - -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(FONTINCSRC) \ - -I$(EXTINCSRC) +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ + -I$(XF86SRC)/xaa -I$(SERVERSRC)/Xext \ + -I$(XF86SRC)/ramdac -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ + -I$(XF86SRC)/fbdevhw -I$(SERVERSRC)/render -I$(SERVERSRC)/include #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c:1.6 xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c:1.6 Wed May 16 02:48:09 2001 +++ xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c Fri Oct 14 11:16:41 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c,v 1.6 2001/05/16 06:48:09 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c,v 1.7 2005/10/14 15:16:41 tsi Exp $ */ /* * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> @@ -25,7 +25,7 @@ */ -#include "Xarch.h" +#include <X11/Xarch.h> #include "xf86.h" #include "xf86_ansic.h" #include "compiler.h" Index: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c:1.21 xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c:1.22 --- xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c:1.21 Sat Aug 23 11:03:02 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c Thu Mar 16 11:50:09 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c,v 1.21 2003/08/23 15:03:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c,v 1.22 2006/03/16 16:50:09 dawes Exp $ */ /* * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> @@ -182,11 +182,6 @@ MODULESETUPPROTO(IMSTTSetup); -/* -pointer IMSTTSetup(pointer module, pointer opts, int *errmaj, - int *errmin); -*/ - static XF86ModuleVersionInfo IMSTTVersRec = { "imstt", MODULEVENDORSTRING, @@ -202,7 +197,7 @@ XF86ModuleData imsttModuleData = { &IMSTTVersRec, IMSTTSetup, NULL }; -pointer IMSTTSetup(pointer module, pointer opts, int *errmaj, +pointer IMSTTSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -211,7 +206,8 @@ if (!setupDone) { setupDone = TRUE; xf86AddDriver(&IMSTT, module, 0); - LoaderRefSymLists(fbSymbols, xaaSymbols, fbdevHWSymbols, NULL); + LoaderModRefSymLists(module, fbSymbols, xaaSymbols, + fbdevHWSymbols, NULL); return (pointer) 1; } else { if (errmaj) @@ -323,6 +319,7 @@ ClockRangePtr clockRanges; rgb zeros = {0, 0, 0}; Gamma gzeros = {0.0, 0.0, 0.0}; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) @@ -412,9 +409,9 @@ iptr->FBDev = TRUE; if (iptr->FBDev) { - if (!xf86LoadSubModule(pScrn, "fbdevhw")) + if (!(pMod = xf86LoadSubModule(pScrn, "fbdevhw"))) return FALSE; - xf86LoaderReqSymLists(fbdevHWSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbdevHWSymbols, NULL); if (!fbdevHWInit(pScrn, iptr->PciInfo, NULL)) return FALSE; pScrn->SwitchMode = fbdevHWSwitchMode; @@ -545,15 +542,15 @@ xf86PrintModes(pScrn); xf86SetDpi(pScrn, 0, 0); - if (!xf86LoadSubModule(pScrn, "fb")) + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) return FALSE; - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); - if (!xf86LoadSubModule(pScrn, "xaa")) + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) return FALSE; - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); IMSTTTRACE("PreInit -- END\n"); Index: xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile:1.52 xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile:1.55 --- xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile:1.52 Mon Feb 28 22:48:52 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile Fri Oct 14 11:16:41 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile,v 1.52 2005/03/01 03:48:52 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile,v 1.55 2005/10/14 15:16:41 tsi Exp $ XCOMM XCOMM This is an Imakefile for the MGA driver. XCOMM @@ -62,8 +62,7 @@ #if BuildXF86DRI DRISRCS = mga_dri.c DRIOBJS = mga_dri.o -DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri \ - -I$(TOP)/include -I$(DRMINCLUDESDIR) +DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri -I$(DRMINCLUDESDIR) DRIDEFINES = $(GLX_DEFINES) #endif @@ -116,19 +115,16 @@ OBJS = $(MGAOBJS) $(MGAHALOBJS) #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include $(MGAHALINCLUDES) +INCLUDES = -I../../include $(MGAHALINCLUDES) #else -INCLUDES = -I. $(MGAHALINCLUDES) -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/fb \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi -I$(XF86SRC)/int10 \ - -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \ +INCLUDES = $(MGAHALINCLUDES) -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(XF86SRC)/int10 \ + -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/fbdevhw \ -I$(XF86SRC)/ramdac -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(SERVERSRC)/Xext -I$(XF86SRC)/xf8_32bpp\ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(XF86SRC)/xf24_32bpp -I$(XF86SRC)/shadowfb -I$(EXTINCSRC) \ - -I$(SERVERSRC)/render \ - -I$(XF86SRC)/vbe $(DRIINCLUDES) + -I$(SERVERSRC)/Xext -I$(XF86SRC)/xf8_32bpp \ + -I$(SERVERSRC)/include -I$(XF86SRC)/shadowfb -I$(SERVERSRC)/render \ + -I$(XF86SRC)/vbe $(DRIINCLUDES) #endif DEFINES = $(MGAHALDEFINES) $(DRIDEFINES) @@ -201,8 +197,6 @@ InstallDriverSDKObjectModule(mga_hal,$(DRIVERSDKMODULEDIR),drivers) #endif -#if BuildMatroxHal MakeSubdirs($(SUBDIRS)) ForceSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) -#endif Index: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_arc.c diff -u xc/programs/Xserver/hw/xfree86/drivers/mga/mga_arc.c:1.13 xc/programs/Xserver/hw/xfree86/drivers/mga/mga_arc.c:1.14 --- xc/programs/Xserver/hw/xfree86/drivers/mga/mga_arc.c:1.13 Fri Feb 20 11:59:49 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/mga/mga_arc.c Fri Oct 14 11:16:41 2005 @@ -23,15 +23,15 @@ in this Software without prior written authorization from The Open Group. ********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_arc.c,v 1.13 2004/02/20 16:59:49 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_arc.c,v 1.14 2005/10/14 15:16:41 tsi Exp $ */ -#include "X.h" +#include <X11/X.h> #include "gcstruct.h" #include "windowstr.h" #include "pixmapstr.h" #include "regionstr.h" -#include "Xprotostr.h" +#include <X11/Xprotostr.h> #include "regionstr.h" #include "mizerarc.h" #include "mi.h" Index: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_bios.h diff -u xc/programs/Xserver/hw/xfree86/drivers/mga/mga_bios.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/mga/mga_bios.h:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/mga/mga_bios.h:1.3 Sat Jul 25 12:55:51 1998 +++ xc/programs/Xserver/hw/xfree86/drivers/mga/mga_bios.h Mon Jan 9 09:59:54 2006 @@ -1,8 +1,7 @@ -/* $XConsortium: mga_bios.h /main/2 1996/10/28 04:48:23 kaleb $ */ #ifndef MGA_BIOS_H #define MGA_BIOS_H -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_bios.h,v 1.3 1998/07/25 16:55:51 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_bios.h,v 1.4 2006/01/09 14:59:54 dawes Exp $ */ /* * MGABiosInfo - This struct describes the video BIOS info block. Index: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c diff -u xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c:1.57 xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c:1.58 --- xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c:1.57 Fri Nov 26 06:48:47 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c Tue Apr 12 18:41:28 2005 @@ -2,7 +2,7 @@ * MGA-1064, MGA-G100, MGA-G200, MGA-G400, MGA-G550 RAMDAC driver */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c,v 1.57 2004/11/26 11:48:47 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c,v 1.58 2005/04/12 22:41:28 dawes Exp $ */ /* * This is a first cut at a non-accelerated version to work with the @@ -287,9 +287,17 @@ switch(pMga->Chipset) { case PCI_CHIP_MGA1064: - pReg->DacRegs[ MGA1064_SYS_PLL_M ] = 0x04; - pReg->DacRegs[ MGA1064_SYS_PLL_N ] = 0x44; - pReg->DacRegs[ MGA1064_SYS_PLL_P ] = 0x18; + if(pMga->OverclockMem) { + /* 197 MHz */ + pReg->DacRegs[ MGA1064_SYS_PLL_M ] = 0x04; + pReg->DacRegs[ MGA1064_SYS_PLL_N ] = 0x44; + pReg->DacRegs[ MGA1064_SYS_PLL_P ] = 0x18; + } else { + /*166 MHz */ + pReg->DacRegs[ MGA1064_SYS_PLL_M ] = 0x0a; + pReg->DacRegs[ MGA1064_SYS_PLL_N ] = 0x7f; + pReg->DacRegs[ MGA1064_SYS_PLL_P ] = 0x10; + } pReg->Option = 0x5F094F21; pReg->Option2 = 0x00000000; break; Index: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c diff -u xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c:1.34 xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c:1.35 --- xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c:1.34 Fri Dec 10 11:07:02 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c Sun Aug 28 13:48:00 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.34 2004/12/10 16:07:02 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.35 2005/08/28 17:48:00 tsi Exp $ */ /* * Copyright 2000 VA Linux Systems Inc., Fremont, California. @@ -35,17 +35,9 @@ #include "xf86PciInfo.h" #include "xf86Pci.h" -#define PSZ 8 -#include "cfb.h" -#undef PSZ -#include "cfb16.h" -#include "cfb32.h" #include "miline.h" - - - #include "mga_bios.h" #include "mga_reg.h" #include "mga.h" @@ -58,10 +50,6 @@ #include "GL/glxtokens.h" #include "sarea.h" - - - - #include "GL/glxtokens.h" #include "mga_bios.h" Index: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c:1.250 xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c:1.255 --- xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c:1.250 Thu Feb 17 21:55:08 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c Thu Mar 16 11:50:09 2006 @@ -1,4 +1,3 @@ -/* $XConsortium: mga_driver.c /main/12 1996/10/28 05:13:26 kaleb $ */ /* * MGA Millennium (MGA2064W) with Ti3026 RAMDAC driver v.1.1 * @@ -45,7 +44,7 @@ * Added digital screen option for first head */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.250 2005/02/18 02:55:08 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.255 2006/03/16 16:50:09 dawes Exp $ */ /* * This is a first cut at a non-accelerated version to work with the @@ -176,17 +175,17 @@ }; static PciChipsets MGAPciChipsets[] = { - { PCI_CHIP_MGA2064, PCI_CHIP_MGA2064, (resRange*)RES_SHARED_VGA }, - { PCI_CHIP_MGA1064, PCI_CHIP_MGA1064, (resRange*)RES_SHARED_VGA }, - { PCI_CHIP_MGA2164, PCI_CHIP_MGA2164, (resRange*)RES_SHARED_VGA }, - { PCI_CHIP_MGA2164_AGP, PCI_CHIP_MGA2164_AGP,(resRange*)RES_SHARED_VGA }, - { PCI_CHIP_MGAG100, PCI_CHIP_MGAG100, (resRange*)RES_SHARED_VGA }, - { PCI_CHIP_MGAG100_PCI, PCI_CHIP_MGAG100_PCI,(resRange*)RES_SHARED_VGA }, - { PCI_CHIP_MGAG200, PCI_CHIP_MGAG200, (resRange*)RES_SHARED_VGA }, - { PCI_CHIP_MGAG200_PCI, PCI_CHIP_MGAG200_PCI,(resRange*)RES_SHARED_VGA }, - { PCI_CHIP_MGAG400, PCI_CHIP_MGAG400, (resRange*)RES_SHARED_VGA }, - { PCI_CHIP_MGAG550, PCI_CHIP_MGAG550, (resRange*)RES_SHARED_VGA }, - { -1, -1, (resRange*)RES_UNDEFINED } + { PCI_CHIP_MGA2064, PCI_CHIP_MGA2064, RES_SHARED_VGA }, + { PCI_CHIP_MGA1064, PCI_CHIP_MGA1064, RES_SHARED_VGA }, + { PCI_CHIP_MGA2164, PCI_CHIP_MGA2164, RES_SHARED_VGA }, + { PCI_CHIP_MGA2164_AGP, PCI_CHIP_MGA2164_AGP, RES_SHARED_VGA }, + { PCI_CHIP_MGAG100, PCI_CHIP_MGAG100, RES_SHARED_VGA }, + { PCI_CHIP_MGAG100_PCI, PCI_CHIP_MGAG100_PCI, RES_SHARED_VGA }, + { PCI_CHIP_MGAG200, PCI_CHIP_MGAG200, RES_SHARED_VGA }, + { PCI_CHIP_MGAG200_PCI, PCI_CHIP_MGAG200_PCI, RES_SHARED_VGA }, + { PCI_CHIP_MGAG400, PCI_CHIP_MGAG400, RES_SHARED_VGA }, + { PCI_CHIP_MGAG550, PCI_CHIP_MGAG550, RES_SHARED_VGA }, + { -1, -1, RES_UNDEFINED } }; static const OptionInfoRec MGAOptions[] = { @@ -232,8 +231,8 @@ * List of symbols from other modules that this module references. This * list is used to tell the loader that it is OK for symbols here to be * unresolved providing that it hasn't been told that they haven't been - * told that they are essential via a call to xf86LoaderReqSymbols() or - * xf86LoaderReqSymLists(). The purpose is this is to avoid warnings about + * told that they are essential via a call to xf86LoaderModReqSymbols() or + * xf86LoaderModReqSymLists(). The purpose is this is to avoid warnings about * unresolved symbols that are not required. */ @@ -354,14 +353,12 @@ NULL }; -#ifdef XFree86LOADER static const char *vbeSymbols[] = { "VBEInit", "vbeDoEDID", "vbeFree", NULL }; -#endif static const char *int10Symbols[] = { "xf86FreeInt10", @@ -401,7 +398,7 @@ "MGASetVgaMode", "MGAValidateMode", "MGAValidateVideoParameters", - "MGASetDisplayStart", + "HALSetDisplayStart", NULL }; #endif @@ -426,7 +423,7 @@ XF86ModuleData MGA_MODULE_DATA = { &mgaVersRec, mgaSetup, NULL }; static pointer -mgaSetup(pointer module, pointer opts, int *errmaj, int *errmin) +mgaSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -445,18 +442,18 @@ * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(vgahwSymbols, xaaSymbols, - xf8_32bppSymbols, ramdacSymbols, - ddcSymbols, i2cSymbols, shadowSymbols, - fbdevHWSymbols, vbeSymbols, - fbSymbols, int10Symbols, + LoaderModRefSymLists(module, vgahwSymbols, xaaSymbols, + xf8_32bppSymbols, ramdacSymbols, + ddcSymbols, i2cSymbols, shadowSymbols, + fbdevHWSymbols, vbeSymbols, + fbSymbols, int10Symbols, #ifdef XF86DRI - drmSymbols, driSymbols, + drmSymbols, driSymbols, #endif #ifdef USEMGAHAL - halSymbols, + halSymbols, #endif - NULL); + NULL); /* * The return value must be non-NULL on success even though there @@ -985,6 +982,7 @@ vgaHWPtr hwp; MGAPtr pMga; xf86MonPtr MonInfo = NULL; + ModuleDescPtr pDDCMod, pMod; hwp = VGAHWPTR(pScrn); pMga = MGAPTR(pScrn); @@ -992,8 +990,8 @@ /* Load DDC if we have the code to use it */ /* This gives us DDC1 */ if (pMga->ddc1Read || pMga->i2cInit) { - if (xf86LoadSubModule(pScrn, "ddc")) { - xf86LoaderReqSymLists(ddcSymbols, NULL); + if ((pDDCMod = xf86LoadSubModule(pScrn, "ddc"))) { + xf86LoaderModReqSymLists(pDDCMod, ddcSymbols, NULL); } else { /* ddc module not found, we can do without it */ pMga->ddc1Read = NULL; @@ -1008,8 +1006,8 @@ /* - DDC can use I2C bus */ /* Load I2C if we have the code to use it */ if (pMga->i2cInit) { - if ( xf86LoadSubModule(pScrn, "i2c") ) { - xf86LoaderReqSymLists(i2cSymbols,NULL); + if ((pMod = xf86LoadSubModule(pScrn, "i2c"))) { + xf86LoaderModReqSymLists(pMod, i2cSymbols,NULL); } else { /* i2c module not found, we can do without it */ pMga->i2cInit = NULL; @@ -1085,10 +1083,11 @@ } if (!MonInfo){ vbeInfoPtr pVbe; - if (xf86LoadSubModule(pScrn, "vbe")) { + if ((pMod = xf86LoadVBEModule(pScrn))) { pVbe = VBEInit(NULL,pMga->pEnt->index); - MonInfo = vbeDoEDID(pVbe, NULL); + MonInfo = vbeDoEDID(pVbe, pDDCMod); vbeFree(pVbe); + xf86UnloadSubModule(pMod); if (MonInfo){ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VBE DDC Monitor info: %p\n", @@ -1177,10 +1176,13 @@ MGAProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; - if (xf86LoadSubModule(pScrn, "vbe")) { + ModuleDescPtr pMod; + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } @@ -1222,6 +1224,7 @@ int flags24; MGAEntPtr pMgaEnt = NULL; Bool Default; + ModuleDescPtr pMod; #ifdef USEMGAHAL ULONG status; CARD8 MiscCtlReg; @@ -1276,10 +1279,10 @@ } /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* * Allocate a vgaHWRec @@ -1375,8 +1378,8 @@ "Hal", loadHal); from = X_CONFIG; } - if (loadHal && xf86LoadSubModule(pScrn, "mga_hal")) { - xf86LoaderReqSymLists(halSymbols, NULL); + if (loadHal && (pMod = xf86LoadSubModule(pScrn, "mga_hal"))) { + xf86LoaderModReqSymLists(pMod, halSymbols, NULL); xf86DrvMsg(pScrn->scrnIndex, from,"Matrox HAL module used\n"); pMga->HALLoaded = TRUE; } else { @@ -1535,10 +1538,10 @@ else Default = FALSE; if (xf86ReturnOptValBool(pMga->Options, OPTION_INT10, Default) && - xf86LoadSubModule(pScrn, "int10")) { + (pMod = xf86LoadSubModule(pScrn, "int10"))) { xf86Int10InfoPtr pInt; - xf86LoaderReqSymLists(int10Symbols, NULL); + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing int10\n"); pInt = xf86InitInt10(pMga->pEnt->index); if (pInt) pMga->softbooted = TRUE; @@ -1694,9 +1697,9 @@ } if (pMga->FBDev) { /* check for linux framebuffer device */ - if (!xf86LoadSubModule(pScrn, "fbdevhw")) + if (!(pMod = xf86LoadSubModule(pScrn, "fbdevhw"))) return FALSE; - xf86LoaderReqSymLists(fbdevHWSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbdevHWSymbols, NULL); if (!fbdevHWInit(pScrn, pMga->PciInfo, NULL)) return FALSE; pScrn->SwitchMode = fbdevHWSwitchMode; @@ -2398,52 +2401,52 @@ /* Load the required framebuffer */ if (pMga->Overlay8Plus24) { - if (!xf86LoadSubModule(pScrn, "xf8_32bpp")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xf8_32bpp"))) { MGAFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xf8_32bppSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xf8_32bppSymbols, NULL); } else { - if (!xf86LoadSubModule(pScrn, "fb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { MGAFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); } /* Load XAA if needed */ if (!pMga->NoAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { MGAFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } /* Load ramdac if needed */ if (pMga->HWCursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { MGAFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } /* Load shadowfb if needed */ if (pMga->ShadowFB) { - if (!xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { MGAFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } #ifdef XF86DRI /* Load the dri module if requested. */ if (xf86ReturnOptValBool(pMga->Options, OPTION_DRI, FALSE)) { - if (xf86LoadSubModule(pScrn, "dri")) { - xf86LoaderReqSymLists(driSymbols, drmSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "dri"))) { + xf86LoaderModReqSymLists(pMod, driSymbols, drmSymbols, NULL); } } #endif @@ -3241,7 +3244,7 @@ * function. If not, the visuals will need to be setup before calling * a fb ScreenInit() function and fixed up after. * - * For most PC hardware at depths >= 8, the defaults that cfb uses + * For most PC hardware at depths >= 8, the defaults that fb uses * are not appropriate. In this driver, we fixup the visuals after. */ @@ -3254,11 +3257,20 @@ /* All MGA support DirectColor and can do overlays in 32bpp */ if(pMga->Overlay8Plus24 && (pScrn->bitsPerPixel == 32)) { - if (!miSetVisualTypes(8, PseudoColorMask | GrayScaleMask, - pScrn->rgbBits, PseudoColor)) - return FALSE; - if (!miSetVisualTypes(24, TrueColorMask, pScrn->rgbBits, TrueColor)) - return FALSE; + if (pScrn->defaultVisual >= TrueColor) { + if (!miSetVisualTypes(24, TrueColorMask, + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; + if (!miSetVisualTypes(8, PseudoColorMask | GrayScaleMask, + pScrn->rgbBits, PseudoColor)) + return FALSE; + } else { + if (!miSetVisualTypes(8, PseudoColorMask | GrayScaleMask, + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; + if (!miSetVisualTypes(24, TrueColorMask, pScrn->rgbBits, TrueColor)) + return FALSE; + } } else if (pMga->SecondCrtc) { /* No DirectColor on the second head */ if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, @@ -3305,8 +3317,8 @@ #ifdef XF86DRI /* - * Setup DRI after visuals have been established, but before cfbScreenInit - * is called. cfbScreenInit will eventually call into the drivers + * Setup DRI after visuals have been established, but before fbScreenInit + * is called. fbScreenInit will eventually call into the drivers * InitGLXVisuals call back. * The DRI does not work when textured video is enabled at this time. */ @@ -3344,7 +3356,6 @@ } #endif - if (pMga->Overlay8Plus24) { ret = cfb8_32ScreenInit(pScreen, FBStart, width, height, @@ -3359,7 +3370,6 @@ if (!ret) return FALSE; - if (pScrn->bitsPerPixel > 8) { /* Fixup RGB ordering */ visual = pScreen->visuals + pScreen->numVisuals; @@ -3481,7 +3491,7 @@ #ifdef XF86DRI if (pMga->directRenderingEnabled) { - /* Now that mi, cfb, drm and others have done their thing, + /* Now that mi, fb, drm and others have done their thing, * complete the DRI setup. */ pMga->directRenderingEnabled = MGADRIFinishScreenInit(pScreen); @@ -3644,7 +3654,7 @@ MGAAdjustGranularity(pScrn,&x,&y); pMga->HALGranularityOffX = pMga->HALGranularityOffX - x; pMga->HALGranularityOffY = pMga->HALGranularityOffY - y; - MGASetDisplayStart(pMga->pBoard,x,y,0); + HALSetDisplayStart(pMga->pBoard,x,y,0); ); #endif MGA_NOT_HAL( @@ -3692,7 +3702,7 @@ #ifdef USEMGAHAL MGA_HAL( MGAAdjustGranularity(pScrn,&x,&y); - MGASetDisplayStart(pMga->pBoard,x,y,1); + HALSetDisplayStart(pMga->pBoard,x,y,1); ); #endif MGA_NOT_HAL( Index: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_esc.c diff -u xc/programs/Xserver/hw/xfree86/drivers/mga/mga_esc.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/mga/mga_esc.c:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/mga/mga_esc.c:1.3 Fri Oct 31 10:06:25 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/mga/mga_esc.c Thu Aug 25 09:27:51 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_esc.c,v 1.3 2003/10/31 15:06:25 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_esc.c,v 1.5 2005/08/25 13:27:51 tsi Exp $ */ /**************************************************************************** * mga_esc.c * @@ -38,7 +38,6 @@ #include "vbe.h" #include "fb.h" -#include "cfb8_32.h" #include "dixstruct.h" #include "mga_reg.h" @@ -134,7 +133,7 @@ static void GetVideoParameterStr(LPMGAMODEINFO pModeInfo, char *sResult) { - sprintf(sResult, "%d %d %d %d %d %d %d %d %d %d %d", + sprintf(sResult, "%ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld", pModeInfo->ulDispWidth, pModeInfo->ulDispHeight, pModeInfo->ulBpp, @@ -213,28 +212,28 @@ { case 0: ulData = INREG(ulAddr); - sprintf(sResult, "MGA[%04X] = 0x%08X", ulAddr, ulData); + sprintf(sResult, "MGA[%04lX] = 0x%08lX", ulAddr, ulData); break; case 1: ucIndex = INREG8(0x3c00); OUTREG8(0x3c00, (UCHAR)ulAddr); ulData = (ULONG)INREG8(0x3c0a); OUTREG8(0x3c00, ucIndex); - sprintf(sResult, "DAC[%02X] = 0x%02X", ulAddr, ulData); + sprintf(sResult, "DAC[%02lX] = 0x%02lX", ulAddr, ulData); break; case 2: ucIndex = INREG8(0x1fd4); OUTREG8(0x1fd4, (UCHAR)ulAddr); ulData = (ULONG)INREG8(0x1fd5); OUTREG8(0x1fd4, ucIndex); - sprintf(sResult, "CRTC[%02X] = 0x%02X", ulAddr, ulData); + sprintf(sResult, "CRTC[%02lX] = 0x%02lX", ulAddr, ulData); break; case 3: ucIndex = INREG8(0x1fde); OUTREG8(0x1fde, (UCHAR)ulAddr); ulData = (ULONG)INREG8(0x1fdf); OUTREG8(0x1fde, ucIndex); - sprintf(sResult, "CRTCEXT[%02X] = 0x%02X", ulAddr, ulData); + sprintf(sResult, "CRTCEXT[%02lX] = 0x%02lX", ulAddr, ulData); break; default: strcpy(sResult, "ERROR# 2"); Index: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_reg.h diff -u xc/programs/Xserver/hw/xfree86/drivers/mga/mga_reg.h:1.18 xc/programs/Xserver/hw/xfree86/drivers/mga/mga_reg.h:1.19 --- xc/programs/Xserver/hw/xfree86/drivers/mga/mga_reg.h:1.18 Wed Sep 26 08:59:18 2001 +++ xc/programs/Xserver/hw/xfree86/drivers/mga/mga_reg.h Mon Jan 9 09:59:54 2006 @@ -1,10 +1,4 @@ -/* $XConsortium: mgareg.h /main/2 1996/10/25 10:33:21 kaleb $ */ - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_reg.h,v 1.18 2001/09/26 12:59:18 alanh Exp $ */ - - +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_reg.h,v 1.19 2006/01/09 14:59:54 dawes Exp $ */ /* * MGA Millennium (MGA2064W) functions Index: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c diff -u xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c:1.103 xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c:1.105 --- xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c:1.103 Mon May 31 20:17:01 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c Sun Aug 28 13:48:00 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c,v 1.103 2004/06/01 00:17:01 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c,v 1.105 2005/08/28 17:48:00 tsi Exp $ */ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -69,7 +69,7 @@ #include "servermd.h" #ifdef XF86DRI -#include "cfb.h" +#include "windowstr.h" #include "GL/glxtokens.h" #endif @@ -1140,9 +1140,12 @@ CHECK_DMA_QUIESCENT(pMga, pScrn); - /* This reportedly causes a freeze for the Mystique. */ - if (!(pMga->Chipset == PCI_CHIP_MGA1064 && pMga->ChipRev < 3)) - while(MGAISBUSY()); + /* + * The freeze that can happen here with some Mystique cards appears to + * have been caused by the memory clock being set too high. + */ + + while(MGAISBUSY()); /* flush cache before a read (mga-1064g 5.1.6) */ OUTREG8(MGAREG_CRTC_INDEX, 0); if(pMga->AccelFlags & CLIPPER_ON) { Index: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c:1.36 xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c:1.37 --- xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c:1.36 Sun Apr 25 10:26:37 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c Fri Oct 14 11:16:41 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c,v 1.36 2004/04/25 14:26:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c,v 1.37 2005/10/14 15:16:41 tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -15,7 +15,7 @@ #include "mga.h" #include "mga_macros.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "xaa.h" #include "dixstruct.h" #include "fourcc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h diff -u xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h:1.6 xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h:1.6 Wed Mar 31 11:37:09 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h Mon Apr 25 20:56:44 2005 @@ -13,7 +13,7 @@ @end ***************************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h,v 1.6 2004/03/31 16:37:09 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h,v 1.7 2005/04/26 00:56:44 dawes Exp $ */ #ifndef _BINDING #define _BINDING @@ -210,6 +210,8 @@ #define MGAMODEINFO_FORCE_PITCH (1L << 5) #define MGAMODEINFO_FORCE_DISPLAYORG (1L << 6) #define MGAMODEINFO_TV (1L << 7) +#define MGAMODEINFO_FLATPANEL1 (1L << 8) +#define MGAMODEINFO_FLATPANEL2 (1L << 9) #define MGAMODEINFO_TESTONLY 0x80000000 /* Cable Type */ @@ -243,7 +245,8 @@ ULONG MGAGetBOARDHANDLESize(void); ULONG MGASetTVStandard(LPBOARDHANDLE pBoard, ULONG ulTVStandard); ULONG MGASetTVCableType(LPBOARDHANDLE pBoard, ULONG ulCableType); -ULONG MGASetDisplayStart(LPBOARDHANDLE pBoard, ULONG ulX, ULONG ulY, ULONG ulCrtc); +ULONG MGAForceFlatPanel(LPBOARDHANDLE pBoard); +ULONG HALSetDisplayStart(LPBOARDHANDLE pBoard, ULONG ulX, ULONG ulY, ULONG ulCrtc); #if defined(__cplusplus) } Index: xc/programs/Xserver/hw/xfree86/drivers/mga/util/stormdwg.c diff -u xc/programs/Xserver/hw/xfree86/drivers/mga/util/stormdwg.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/mga/util/stormdwg.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/mga/util/stormdwg.c:1.2 Sat Nov 27 22:37:42 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/mga/util/stormdwg.c Tue Feb 7 21:34:11 2006 @@ -1,8 +1,4 @@ -/* $XConsortium: dwg.c /main/2 1996/10/28 06:57:55 kaleb $ */ - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/util/stormdwg.c,v 1.2 2004/11/28 03:37:42 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/util/stormdwg.c,v 1.4 2006/02/08 02:34:11 dawes Exp $ */ #include <stdio.h> #include <stdlib.h> @@ -96,9 +92,7 @@ }; int -main(argc, argv) -int argc; -char *argv[]; +main(int argc, char *argv[]) { unsigned long val, tmp; Index: xc/programs/Xserver/hw/xfree86/drivers/neomagic/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/neomagic/Imakefile:1.16 xc/programs/Xserver/hw/xfree86/drivers/neomagic/Imakefile:1.19 --- xc/programs/Xserver/hw/xfree86/drivers/neomagic/Imakefile:1.16 Mon May 31 20:17:01 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/neomagic/Imakefile Fri Oct 14 11:16:41 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/Imakefile,v 1.16 2004/06/01 00:17:01 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/Imakefile,v 1.19 2005/10/14 15:16:41 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -55,19 +55,15 @@ OBJS = neo_driver.o neo_bank.o neo_cursor.o neo_2097.o neo_2070.o \ neo_2090.o neo_2200.o neo_i2c.o neo_shadow.o neo_dga.o neo_video.o -DEFINES = -DPSZ=8 - #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(XF86SRC)/vgafb -I$(XF86SRC)/vgahw -I$(SERVERSRC)/include \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(XF86SRC)/vgafb -I$(XF86SRC)/vgahw -I$(SERVERSRC)/include \ -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(SERVERSRC)/mfb \ - -I$(SERVERSRC)/miext/shadow \ - -I$(XINCLUDESRC) -I$(XF86SRC)/xaa -I$(FONTINCSRC) \ + -I$(SERVERSRC)/miext/shadow -I$(XF86SRC)/xaa \ -I$(XF86SRC)/ramdac -I$(XF86SRC)/rac -I$(XF86SRC)/ddc \ - -I$(XF86SRC)/i2c -I$(XF86SRC)/shadowfb -I$(XF86SRC)/xf24_32bpp \ - -I$(SERVERSRC)/Xext -I$(EXTINCSRC) \ + -I$(XF86SRC)/i2c -I$(XF86SRC)/shadowfb -I$(SERVERSRC)/Xext \ -I$(XF86SRC)/int10 -I$(XF86SRC)/vbe -I$(SERVERSRC)/render #endif Index: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo.h diff -u xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo.h:1.25 xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo.h:1.26 --- xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo.h:1.25 Mon Mar 29 11:25:17 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo.h Fri Oct 14 11:16:41 2005 @@ -22,7 +22,7 @@ CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **********************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo.h,v 1.25 2004/03/29 16:25:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo.h,v 1.26 2005/10/14 15:16:41 tsi Exp $ */ /* * The original Precision Insight driver for @@ -60,7 +60,7 @@ #include "xf86i2c.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> /* * Driver data structures. Index: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_bank.c diff -u xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_bank.c:1.4 xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_bank.c:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_bank.c:1.4 Wed Oct 30 07:52:21 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_bank.c Sun Aug 28 13:48:01 2005 @@ -22,7 +22,7 @@ CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **********************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_bank.c,v 1.4 2002/10/30 12:52:21 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_bank.c,v 1.5 2005/08/28 17:48:01 tsi Exp $ */ /* * The original Precision Insight driver for @@ -36,8 +36,6 @@ * 1998, 1999 by Egbert Eich (Egbert.Eich@Physik.TU-Darmstadt.DE) */ -#define PSZ 8 - /* All drivers should typically include these */ #include "xf86.h" #include "xf86_OSproc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c:1.79 xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c:1.82 --- xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c:1.79 Fri Feb 25 20:07:13 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c Thu Mar 16 11:50:10 2006 @@ -30,7 +30,7 @@ * Copyright 2002 Shigehiro Nomura */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c,v 1.79 2005/02/26 01:07:13 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c,v 1.82 2006/03/16 16:50:10 dawes Exp $ */ /* * The original Precision Insight driver for @@ -95,7 +95,7 @@ #include "picturestr.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> /* * Driver data structures. @@ -105,12 +105,12 @@ #include "neo_macros.h" /* These need to be checked */ -#include "X.h" -#include "Xproto.h" +#include <X11/X.h> +#include <X11/Xproto.h> #include "scrnintstr.h" #include "servermd.h" #define _XF86DGA_SERVER_ -#include "extensions/xf86dgastr.h" +#include <X11/extensions/xf86dgastr.h> /* Mandatory functions */ static const OptionInfoRec * NEOAvailableOptions(int chipid, int busid); @@ -142,7 +142,7 @@ static xf86MonPtr neo_ddc1(int scrnIndex); static Bool neoDoDDC1(ScrnInfoPtr pScrn); static Bool neoDoDDC2(ScrnInfoPtr pScrn); -static Bool neoDoDDCVBE(ScrnInfoPtr pScrn); +static Bool neoDoDDCVBE(ScrnInfoPtr pScrn, ModuleDescPtr pDDCMod); static void neoProbeDDC(ScrnInfoPtr pScrn, int index); static void NeoDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags); @@ -413,8 +413,8 @@ * List of symbols from other modules that this module references. This * list is used to tell the loader that it is OK for symbols here to be * unresolved providing that it hasn't been told that they haven't been - * told that they are essential via a call to xf86LoaderReqSymbols() or - * xf86LoaderReqSymLists(). The purpose is this is to avoid warnings about + * told that they are essential via a call to xf86LoaderModReqSymbols() or + * xf86LoaderModReqSymLists(). The purpose is this is to avoid warnings about * unresolved symbols that are not required. */ @@ -507,7 +507,7 @@ XF86ModuleData neomagicModuleData = { &neoVersRec, neoSetup, NULL }; static pointer -neoSetup(pointer module, pointer opts, int *errmaj, int *errmin) +neoSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -524,9 +524,9 @@ * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, - ramdacSymbols, shadowSymbols, - ddcSymbols, vbeSymbols, i2cSymbols, NULL); + LoaderModRefSymLists(module, vgahwSymbols, fbSymbols, xaaSymbols, + ramdacSymbols, shadowSymbols, + ddcSymbols, vbeSymbols, i2cSymbols, NULL); /* * The return value must be non-NULL on success even though there * is no TearDownProc. @@ -725,6 +725,7 @@ Bool height_480 = FALSE; Bool lcdCenterOptSet = FALSE; char *s; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) { neoProbeDDC( pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index ); @@ -732,10 +733,10 @@ } /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* * Allocate a vgaHWRec. @@ -953,10 +954,10 @@ pScrn->monitor = pScrn->confScreen->monitor; - if (xf86LoadSubModule(pScrn, "ddc")) { - xf86LoaderReqSymLists(ddcSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "ddc"))) { + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); #if 1 /* for DDC1 testing */ - if (!neoDoDDCVBE(pScrn)) + if (!neoDoDDCVBE(pScrn, pMod)) if (!neoDoDDC2(pScrn)) #endif neoDoDDC1(pScrn); @@ -1383,29 +1384,29 @@ /* If monitor resolution is set on the command line, use it */ xf86SetDpi(pScrn, 0, 0); - if (xf86LoadSubModule(pScrn, "fb") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { RETURN } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); if (!nPtr->noLinear) { - if (!xf86LoadSubModule(pScrn, "xaa")) + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) RETURN - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } if (nPtr->shadowFB) { - if (!xf86LoadSubModule(pScrn, "shadow")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadow"))) { RETURN } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } if (!nPtr->swCursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) RETURN - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } return TRUE; } @@ -3120,10 +3121,11 @@ NEOPtr nPtr = NEOPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); Bool ret = FALSE; + ModuleDescPtr pMod; VGAwGR(0x09,0x26); - if (xf86LoadSubModule(pScrn, "i2c")) { - xf86LoaderReqSymLists(i2cSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "i2c"))) { + xf86LoaderModReqSymLists(pMod, i2cSymbols, NULL); if (neo_I2CInit(pScrn)) { ret = xf86SetDDCproperties(pScrn,xf86PrintEDID(xf86DoEDID_DDC2( pScrn->scrnIndex,nPtr->I2C))); @@ -3135,21 +3137,23 @@ } static Bool -neoDoDDCVBE(ScrnInfoPtr pScrn) +neoDoDDCVBE(ScrnInfoPtr pScrn, ModuleDescPtr pDDCMod) { NEOPtr nPtr = NEOPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); vbeInfoPtr pVbe; Bool ret = FALSE; + ModuleDescPtr pMod; VGAwGR(0x09,0x26); - if (xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols, NULL); + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); if ((pVbe = VBEInit(NULL,nPtr->pEnt->index))) { - ret = xf86SetDDCproperties( - pScrn,xf86PrintEDID(vbeDoEDID(pVbe,NULL))); - vbeFree(pVbe); + ret = xf86SetDDCproperties(pScrn, + xf86PrintEDID(vbeDoEDID(pVbe, pDDCMod))); + vbeFree(pVbe); } + xf86UnloadSubModule(pMod); } VGAwGR(0x09,0x00); return ret; @@ -3202,11 +3206,14 @@ neoProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; + ModuleDescPtr pMod; - if (xf86LoadSubModule(pScrn, "vbe")) { + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); if ((pVbe = VBEInit(NULL,index))) { ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); } + xf86UnloadSubModule(pMod); } } Index: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_video.h diff -u xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_video.h:1.2 xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_video.h:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_video.h:1.2 Sun Jun 30 22:25:58 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_video.h Fri Oct 14 11:16:42 2005 @@ -22,7 +22,7 @@ CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. **********************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_video.h,v 1.2 2002/07/01 02:25:58 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_video.h,v 1.3 2005/10/14 15:16:42 tsi Exp $ */ #ifndef _NEO_VIDEO_H #define _NEO_VIDEO_H @@ -31,7 +31,7 @@ #include "vgaHW.h" #include "fourcc.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #define NEO_VIDEO_VIDEO 0 #define NEO_VIDEO_IMAGE 1 Index: xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile:1.8 xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile:1.10 --- xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile:1.8 Mon May 31 20:17:01 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile Fri Oct 14 11:16:42 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile,v 1.8 2004/06/01 00:17:01 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile,v 1.10 2005/10/14 15:16:42 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -49,22 +49,22 @@ #define IHaveModules #include <Server.tmpl> -SRCS = newport_driver.c newport_regs.c newport_cmap.c newport_shadow.c newport_cursor.c +SRCS = newport_driver.c newport_regs.c newport_cmap.c newport_shadow.c \ + newport_cursor.c -OBJS = newport_driver.o newport_regs.o newport_cmap.o newport_shadow.o newport_cursor.o +OBJS = newport_driver.o newport_regs.o newport_cmap.o newport_shadow.o \ + newport_cursor.o XF86CONFIG = XF86Config.indy #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. \ - -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb \ - -I$(XF86SRC)/shadowfb \ - -I$(XF86SRC)/xaa -I$(XF86SRC)/ramdac \ - -I$(EXTINCSRC) -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ - -I$(SERVERSRC)/include -I$(FONTINCSRC) -I$(XINCLUDESRC) + -I$(XF86SRC)/shadowfb -I$(XF86SRC)/ramdac \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ + -I$(SERVERSRC)/include #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/newport/XF86Config.indy diff -u xc/programs/Xserver/hw/xfree86/drivers/newport/XF86Config.indy:1.3 xc/programs/Xserver/hw/xfree86/drivers/newport/XF86Config.indy:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/newport/XF86Config.indy:1.3 Wed Feb 19 23:05:15 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/newport/XF86Config.indy Mon Jan 9 09:59:54 2006 @@ -1,4 +1,3 @@ -# Id: XF86Config.indy,v 1.2 2000/08/14 17:07:37 agx Exp $ # # Copyright (c) 1994-1998 by The XFree86 Project, Inc. # @@ -27,7 +26,7 @@ # dealings in this Software without prior written authorization from the # XFree86 Project. # -# $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/XF86Config.indy,v 1.3 2003/02/20 04:05:15 dawes Exp $ +# $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/XF86Config.indy,v 1.4 2006/01/09 14:59:54 dawes Exp $ # ********************************************************************** # This is a configuration file for the Indy's Newport Graphics and the Index: xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h diff -u xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h:1.10 xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h:1.10 Mon Dec 9 23:03:00 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h Mon Jan 9 09:59:54 2006 @@ -1,7 +1,4 @@ -/* - * Id: newport.h,v 1.4 2000/11/29 20:58:10 agx Exp $ - */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h,v 1.10 2002/12/10 04:03:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h,v 1.12 2006/01/09 14:59:54 dawes Exp $ */ #ifndef __NEWPORT_H__ #define __NEWPORT_H__ @@ -17,8 +14,7 @@ #include "xf86cmap.h" -/* xaa & hardware cursor */ -#include "xaa.h" +/* hardware cursor */ #include "xf86Cursor.h" /* register definitions of the Newport card */ Index: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_cmap.c diff -u xc/programs/Xserver/hw/xfree86/drivers/newport/newport_cmap.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/newport/newport_cmap.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/newport/newport_cmap.c:1.3 Mon Dec 9 23:03:00 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/newport/newport_cmap.c Mon Jan 9 09:59:54 2006 @@ -1,7 +1,4 @@ -/* - * Id: newport_cmap.c,v 1.1 2000/11/29 20:58:10 agx Exp $ - */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_cmap.c,v 1.3 2002/12/10 04:03:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_cmap.c,v 1.4 2006/01/09 14:59:54 dawes Exp $ */ #include "newport.h" Index: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c:1.26 xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c:1.29 --- xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c:1.26 Sat Aug 23 11:03:08 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c Thu Mar 16 11:50:11 2006 @@ -1,6 +1,4 @@ /* - * Id: newport_driver.c,v 1.2 2000/11/29 20:58:10 agx Exp $ - * * Driver for the SGI Indy's Newport graphics card * * This driver is based on the newport.c & newport_con.c kernel code @@ -30,7 +28,7 @@ * Project. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c,v 1.26 2003/08/23 15:03:08 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c,v 1.29 2006/03/16 16:50:11 dawes Exp $ */ /* function prototypes, common data structures & generic includes */ #include "newport.h" @@ -50,7 +48,7 @@ /* Xv Extension */ #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #define VERSION 4000 #define NEWPORT_NAME "NEWPORT" @@ -138,7 +136,7 @@ XF86ModuleData newportModuleData = { &newportVersRec, newportSetup, NULL }; static pointer -newportSetup(pointer module, pointer opts, int *errmaj, int *errmin) +newportSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -156,7 +154,8 @@ * might refer to. * */ - LoaderRefSymLists( fbSymbols, ramdacSymbols, shadowSymbols, NULL); + LoaderModRefSymLists(module, fbSymbols, ramdacSymbols, + shadowSymbols, NULL); /* @@ -285,6 +284,7 @@ NewportPtr pNewport; MessageType from; ClockRangePtr clockRanges; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) return FALSE; @@ -446,27 +446,27 @@ xf86SetDpi (pScrn, 0, 0); /* Load FB module */ - if (!xf86LoadSubModule (pScrn, "fb")) { + if (!(pMod = xf86LoadSubModule (pScrn, "fb"))) { NewportFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists( fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); /* Load ramdac modules */ if (pNewport->hwCursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { NewportFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } /* Load ShadowFB module */ - if (!xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { NewportFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); return TRUE; } Index: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_regs.c diff -u xc/programs/Xserver/hw/xfree86/drivers/newport/newport_regs.c:1.7 xc/programs/Xserver/hw/xfree86/drivers/newport/newport_regs.c:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/newport/newport_regs.c:1.7 Mon Dec 9 23:03:00 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/newport/newport_regs.c Mon Jan 9 09:59:54 2006 @@ -1,7 +1,4 @@ -/* - * Id: newport_regs.c,v 1.3 2000/11/29 20:58:10 agx Exp $ - */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_regs.c,v 1.7 2002/12/10 04:03:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_regs.c,v 1.8 2006/01/09 14:59:54 dawes Exp $ */ #include "newport.h" Index: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_regs.h diff -u xc/programs/Xserver/hw/xfree86/drivers/newport/newport_regs.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/newport/newport_regs.h:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/newport/newport_regs.h:1.3 Mon Dec 9 23:03:00 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/newport/newport_regs.h Mon Jan 9 09:59:54 2006 @@ -1,10 +1,8 @@ /* - * Id: newport_regs.h,v 1.5 2000/11/18 23:23:14 agx Exp $ - * * Register Layouts of the various newport chips * mostly as found in linux/include/asm/newport.h */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_regs.h,v 1.3 2002/12/10 04:03:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_regs.h,v 1.4 2006/01/09 14:59:54 dawes Exp $ */ typedef volatile unsigned long npireg_t; Index: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_shadow.c diff -u xc/programs/Xserver/hw/xfree86/drivers/newport/newport_shadow.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/newport/newport_shadow.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/newport/newport_shadow.c:1.3 Mon Sep 30 18:17:55 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/newport/newport_shadow.c Mon Jan 9 09:59:54 2006 @@ -1,7 +1,4 @@ -/* - * Id: newport_shadow.c,v 1.3 2000/11/29 20:58:10 agx Exp $ - */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_shadow.c,v 1.3 2002/09/30 22:17:55 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_shadow.c,v 1.4 2006/01/09 14:59:54 dawes Exp $ */ #include "newport.h" Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/Imakefile:1.9 xc/programs/Xserver/hw/xfree86/drivers/nsc/Imakefile:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/Imakefile:1.9 Mon May 31 20:17:01 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/Imakefile Fri Oct 14 11:16:42 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/Imakefile,v 1.9 2004/06/01 00:17:01 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/Imakefile,v 1.12 2005/10/14 15:16:42 tsi Exp $ XCOMM Imakefile for the National Semiconductor display driver XCOMM that is based on the durango code. XCOMM @@ -107,20 +107,15 @@ nsc_gx2_shadow.o $(I86OBJ) $(STBOBJS) $(DURANGOOBJS) #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include $(EXTINCLUDES) +INCLUDES = -I../../include $(EXTINCLUDES) #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/cfb -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ + -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ - -I$(XF86SRC)/xf24_32bpp -I$(FONTINCSRC) \ - -I$(XF86SRC)/xf8_32bpp -I$(XF86SRC)/xf1bpp \ - -I$(XF86SRC)/xf4bpp -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c -I$(EXTINCSRC) $(DRIINCLUDES) \ - -I$(XF86SRC)/shadowfb -I$(XF86SRC)/fbdevhw \ - -I$(XTOP)/include -I$(XF86SRC)/vbe -I$(SERVERSRC)/render \ + -I$(SERVERSRC)/include $(DRIINCLUDES) -I$(XF86SRC)/shadowfb \ + -I$(XF86SRC)/vbe -I$(SERVERSRC)/render \ $(EXTINCLUDES) #endif Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/durango.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/durango.c:1.5 xc/programs/Xserver/hw/xfree86/drivers/nsc/durango.c:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/durango.c:1.5 Fri Jan 24 12:16:52 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/durango.c Mon Jan 9 09:59:55 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/durango.c,v 1.5 2003/01/24 17:16:52 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/durango.c,v 1.6 2006/01/09 14:59:55 dawes Exp $ */ /* - * $Workfile: durango.c $ - * $Revision: 9 $ - * $Author: Sarma $ - * * This is the main file used to add Durango graphics support to a software * project. The main reason to have a single file include the other files * is that it centralizes the location of the compiler options. This file Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc.h diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc.h:1.6 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc.h:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc.h:1.6 Mon Nov 3 00:11:20 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc.h Mon Jan 9 09:59:55 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc.h,v 1.6 2003/11/03 05:11:20 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc.h,v 1.7 2006/01/09 14:59:55 dawes Exp $ */ /* - * $Workfile: nsc.h $ - * $Revision: 16 $ - * $Author: Sarma $ - * * File Contents: This file contains the data structures Geode driver. * * Project: Geode Xfree Frame buffer device driver. Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc.man diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc.man:1.2 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc.man:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc.man:1.2 Thu May 29 17:48:09 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc.man Sun Feb 26 20:57:12 2006 @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc.man,v 1.2 2003/05/29 21:48:09 herrb Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc.man,v 1.3 2006/02/27 01:57:12 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH NSC __drivermansuffix__ __vendorversion__ @@ -72,7 +72,7 @@ .TP .BI "Option \*qFlatPanel\*q \*q" boolean \*q This enables the FlatPanel display unit. The FlatPanel depends on the -BIOS to do the Pnale h/w initialization. +BIOS to do the Panel h/w initialization. In GX2 based platforms with TFT part Flatpanel is enabled, and on CRT part is disabled. Default: off. Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_driver.c:1.6 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_driver.c:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_driver.c:1.6 Thu Jun 10 13:26:38 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_driver.c Thu Mar 16 11:50:11 2006 @@ -1,16 +1,12 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_driver.c,v 1.6 2004/06/10 17:26:38 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_driver.c,v 1.11 2006/03/16 16:50:11 dawes Exp $ */ /* - * $Workfile: nsc_driver.c $ - * $Revision: 21 $ - * $Author: Sarma $ - * * File Contents: This is the main module configures the interfacing * with the X server. The individual modules will be * loaded based upon the options selected from the * XF86Config. This file also has modules for finding * supported modes, turning on the modes based on options. * - * Project: Nsc Xfree Frame buffer device driver. + * Project: Nsc XFree86 Frame buffer device driver. * */ @@ -145,7 +141,6 @@ #define DEBUG(x) #define NSC_TRACE 0 -#define CFB 0 #define HWVGA 1 /* Includes that are used by all drivers */ @@ -167,20 +162,7 @@ #define RC_MAX_DEPTH 24 /* Frame buffer stuff */ -#if CFB -/* - * If using cfb, cfb.h is required. Select the others for the bpp values - * the driver supports. - */ -#define PSZ 8 /* needed for cfb.h */ -#include "cfb.h" -#undef PSZ -#include "cfb16.h" -#include "cfb24.h" -#include "cfb32.h" -#else #include "fb.h" -#endif #include "shadowfb.h" @@ -194,15 +176,13 @@ #include "vbe.h" /* Check for some extensions */ -#ifdef XFreeXDGA #define _XF86_DGA_SERVER_ -#include "extensions/xf86dgastr.h" -#endif /* XFreeXDGA */ +#include <X11/extensions/xf86dgastr.h> #include "globals.h" #include "opaque.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> #define EXTERN /* Our private include file (this also includes the durango headers) */ @@ -351,21 +331,11 @@ NULL }; -#if CFB -const char *nscCfbSymbols[] = { - "cfbScreenInit", - "cfb16ScreenInit", - "cfb24ScreenInit", - "cfb32ScreenInit", - NULL -}; -#else const char *nscFbSymbols[] = { "fbScreenInit", "fbPictureInit", NULL }; -#endif const char *nscXaaSymbols[] = { "XAADestroyInfoRec", @@ -430,7 +400,7 @@ *------------------------------------------------------------------------- */ static pointer -NscSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor) +NscSetup(ModuleDescPtr Module, pointer Options, int *ErrorMajor, int *ErrorMinor) { static Bool Initialised = FALSE; @@ -440,15 +410,10 @@ /* Tell the loader about symbols from other modules that this * module might refer to. */ - LoaderRefSymLists(nscVgahwSymbols, nscVbeSymbols, -#if CFB - nscCfbSymbols, -#else - nscFbSymbols, -#endif - nscXaaSymbols, - nscInt10Symbols, nscRamdacSymbols, nscShadowSymbols, - NULL); + LoaderModRefSymLists(Module, nscVgahwSymbols, nscVbeSymbols, + nscFbSymbols, nscXaaSymbols, + nscInt10Symbols, nscRamdacSymbols, nscShadowSymbols, + NULL); return (pointer) TRUE; } /*The return value must be non-NULL on success */ Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_fourcc.h diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_fourcc.h:1.2 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_fourcc.h:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_fourcc.h:1.2 Tue Jan 14 04:34:30 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_fourcc.h Mon Jan 9 09:59:55 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_fourcc.h,v 1.2 2003/01/14 09:34:30 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_fourcc.h,v 1.3 2006/01/09 14:59:55 dawes Exp $ */ /* - * $Workfile: nsc_fourcc.h $ - * $Revision: 4 $ - * $Author: Sarma $ - * * File Contents: This file consists of main Xfree video macro definitions. * * Project: Geode Xfree Frame buffer device driver. Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galfns.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galfns.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galfns.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galfns.c:1.3 Wed Feb 5 13:38:42 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galfns.c Mon Jan 9 09:59:55 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galfns.c,v 1.3 2003/02/05 18:38:42 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galfns.c,v 1.4 2006/01/09 14:59:55 dawes Exp $ */ /* - * $Workfile: nsc_galfns.c $ - * $Revision: 7 $ - * $Author: Sarma $ - * * File Contents: This file contains the main functions of the Geode * frame buffer device drivers GAL function definitions. * Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galstub.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galstub.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galstub.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galstub.c:1.2 Tue Jan 14 04:34:31 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galstub.c Mon Jan 9 09:59:55 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galstub.c,v 1.2 2003/01/14 09:34:31 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galstub.c,v 1.3 2006/01/09 14:59:55 dawes Exp $ */ /* - * $Workfile: nsc_galstub.c $ - * $Revision: 5 $ - * $Author: Sarma $ - * * File Contents: This file contains the file inclusions of the GAL * * Project: Geode Xfree Frame buffer device driver. Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_accel.c:1.9 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_accel.c:1.10 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_accel.c:1.9 Mon Mar 29 11:25:17 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_accel.c Mon Jan 9 09:59:55 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_accel.c,v 1.9 2004/03/29 16:25:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_accel.c,v 1.10 2006/01/09 14:59:55 dawes Exp $ */ /* - * $Workfile: nsc_gx1_accel.c $ - * $Revision: 15 $ - * $Author: Sarma $ - * * File Contents: This file is consists of main Xfree * acceleration supported routines like solid fill used * here. Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_cursor.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_cursor.c:1.6 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_cursor.c:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_cursor.c:1.6 Mon Nov 3 00:11:20 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_cursor.c Mon Jan 9 09:59:55 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_cursor.c,v 1.6 2003/11/03 05:11:20 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_cursor.c,v 1.7 2006/01/09 14:59:55 dawes Exp $ */ /* - * $Workfile: nsc_gx1_cursor.c $ - * $Revision: 9 $ - * $Author: Sarma $ - * * File Contents: Xfree cursor implementation routines * for geode HWcursor init.setting cursor color,image etc * are done here. Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_dga.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_dga.c:1.5 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_dga.c:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_dga.c:1.5 Tue Dec 7 10:59:19 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_dga.c Mon Jan 9 09:59:55 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_dga.c,v 1.5 2004/12/07 15:59:19 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_dga.c,v 1.6 2006/01/09 14:59:55 dawes Exp $ */ /* - * $Workfile: nsc_gx1_dga.c $ - * $Revision: 6 $ - * $Author: Sarma $ - * * File contents: DGA(Direct Acess Graphics mode) is feature of * XFree86 that allows the program to access directly to video * memory on the graphics card.DGA supports the double Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_driver.c:1.11 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_driver.c:1.17 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_driver.c:1.11 Mon Nov 3 00:11:20 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_driver.c Thu Mar 16 11:50:11 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_driver.c,v 1.11 2003/11/03 05:11:20 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_driver.c,v 1.17 2006/03/16 16:50:11 dawes Exp $ */ /* - * $Workfile: nsc_gx1_driver.c $ - * $Revision: 25 $ - * $Author: Binesh $ - * * File Contents: This is the main module configures the interfacing * with the X server. The individual modules will be * loaded based upon the options selected from the @@ -150,7 +146,6 @@ #define DEBUG(x) #define GEODE_TRACE 0 -#define CFB 0 #define HWVGA 0 /* Includes that are used by all drivers */ @@ -170,23 +165,8 @@ #include "xf86cmap.h" /* Frame buffer stuff */ -#if CFB -/* - * If using cfb, cfb.h is required. Select the others for the bpp values - * the driver supports. - */ -#define PSZ 8 /* needed for cfb.h */ -#include "cfb.h" -#undef PSZ -#include "cfb16.h" -#include "cfb24.h" -#include "cfb32.h" - -#else #include "fb.h" -#endif - #include "shadowfb.h" /* Machine independent stuff */ @@ -199,15 +179,13 @@ #include "vbe.h" /* Check for some extensions */ -#ifdef XFreeXDGA #define _XF86_DGA_SERVER_ -#include "extensions/xf86dgastr.h" -#endif /* XFreeXDGA */ +#include <X11/extensions/xf86dgastr.h> #include "globals.h" #include "opaque.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> /* Our private include file (this also includes the durango headers) */ #include "nsc.h" @@ -308,11 +286,7 @@ extern const char *nscVbeSymbols[]; extern const char *nscInt10Symbols[]; -#if CFB -extern const char *nscCfbSymbols[]; -#else extern const char *nscFbSymbols[]; -#endif extern const char *nscXaaSymbols[]; extern const char *nscRamdacSymbols[]; extern const char *nscShadowSymbols[]; @@ -444,11 +418,14 @@ GX1ProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; + ModuleDescPtr pMod; - if (xf86LoadSubModule(pScrn, "vbe")) { + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, nscVbeSymbols, NULL); pVbe = VBEInit(NULL, index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } @@ -474,11 +451,7 @@ MessageType from; int i = 0; GeodePtr pGeode; -#if CFB - char *mod = NULL; - - char *reqSymbol = NULL; -#endif + ModuleDescPtr pMod; #if defined(STB_X) GAL_ADAPTERINFO sAdapterInfo; @@ -513,11 +486,11 @@ #if !defined(STB_X) /* If the vgahw module would be needed it would be loaded here */ - if (!xf86LoadSubModule(pScreenInfo, "vgahw")) { + if (!(pMod = xf86LoadSubModule(pScreenInfo, "vgahw"))) { return FALSE; } - xf86LoaderReqSymLists(nscVgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, nscVgahwSymbols, NULL); #endif /* STB_X */ GeodeDebug(("GX1PreInit(1)!\n")); @@ -1020,61 +993,35 @@ xf86SetDpi(pScreenInfo, 0, 0); GeodeDebug(("GX1PreInit(14)!\n")); -#if CFB - /* Load bpp-specific modules */ - mod = NULL; - - /* Load bpp-specific modules */ - switch (pScreenInfo->bitsPerPixel) { - case 8: - mod = "cfb"; - reqSymbol = "cfbScreenInit"; - break; - case 16: - mod = "cfb16"; - reqSymbol = "cfb16ScreenInit"; - break; - default: - return FALSE; - } - if (mod && xf86LoadSubModule(pScreenInfo, mod) == NULL) { - GX1FreeRec(pScreenInfo); - return FALSE; - } - - xf86LoaderReqSymbols(reqSymbol, NULL); -#else - if (xf86LoadSubModule(pScreenInfo, "fb") == NULL) { + if (!(pMod = xf86LoadSubModule(pScreenInfo, "fb"))) { GX1FreeRec(pScreenInfo); return FALSE; } - - xf86LoaderReqSymLists(nscFbSymbols, NULL); -#endif + xf86LoaderModReqSymLists(pMod, nscFbSymbols, NULL); GeodeDebug(("GX1PreInit(15)!\n")); if (pGeode->NoAccel == FALSE) { - if (!xf86LoadSubModule(pScreenInfo, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScreenInfo, "xaa"))) { GX1FreeRec(pScreenInfo); return FALSE; } - xf86LoaderReqSymLists(nscXaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, nscXaaSymbols, NULL); } GeodeDebug(("GX1PreInit(16)!\n")); if (pGeode->HWCursor == TRUE) { - if (!xf86LoadSubModule(pScreenInfo, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScreenInfo, "ramdac"))) { GX1FreeRec(pScreenInfo); return FALSE; } - xf86LoaderReqSymLists(nscRamdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, nscRamdacSymbols, NULL); } GeodeDebug(("GX1PreInit(17)!\n")); /* Load shadowfb if needed */ if (pGeode->ShadowFB) { - if (!xf86LoadSubModule(pScreenInfo, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScreenInfo, "shadowfb"))) { GX1FreeRec(pScreenInfo); return FALSE; } - xf86LoaderReqSymLists(nscShadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, nscShadowSymbols, NULL); } GeodeDebug(("GX2PreInit(18)!\n")); if (xf86RegisterResources(pGeode->pEnt->index, NULL, ResExclusive)) { @@ -2019,26 +1966,12 @@ /* Initialise the framebuffer */ switch (pScreenInfo->bitsPerPixel) { -#if CFB - case 8: - Inited = cfbScreenInit(pScreen, FBStart, width, height, - pScreenInfo->xDpi, pScreenInfo->yDpi, - displayWidth); - break; - case 16: - Inited = cfb16ScreenInit(pScreen, FBStart, width, height, - pScreenInfo->xDpi, pScreenInfo->yDpi, - displayWidth); - break; - -#else case 8: case 16: Inited = fbScreenInit(pScreen, FBStart, width, height, pScreenInfo->xDpi, pScreenInfo->yDpi, displayWidth, pScreenInfo->bitsPerPixel); break; -#endif default: xf86DrvMsg(scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) in ScreenInit\n", @@ -2071,11 +2004,8 @@ } } } -#if CFB -#else /* must be after RGB ordering fixed */ fbPictureInit(pScreen, 0, 0); -#endif GeodeDebug(("GX1ScreenInit(6)!\n")); if (!pGeode->NoAccel) { Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_shadow.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_shadow.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_shadow.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_shadow.c:1.2 Tue Jan 14 04:34:32 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_shadow.c Mon Jan 9 09:59:55 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_shadow.c,v 1.2 2003/01/14 09:34:32 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_shadow.c,v 1.3 2006/01/09 14:59:55 dawes Exp $ */ /* - * $Workfile: nsc_gx1_shadow.c $ - * $Revision: 6 $ - * $Author: Sarma $ - * * File Contents: Direct graphics display routines are implemented and * graphics rendering are all done in memory. * Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_video.c:1.12 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_video.c:1.14 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_video.c:1.12 Sun Apr 25 20:23:37 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_video.c Mon Jan 9 09:59:55 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_video.c,v 1.12 2004/04/26 00:23:37 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_video.c,v 1.14 2006/01/09 14:59:55 dawes Exp $ */ /* - * $Workfile: nsc_gx1_video.c $ - * $Revision: 11 $ - * $Author: Binesh $ - * * File Contents: This file consists of main Xfree video supported routines. * * Project: Geode Xfree Frame buffer device driver. @@ -155,7 +151,7 @@ #include "regionstr.h" #include "nsc.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "xaa.h" #include "dixstruct.h" #include "fourcc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_accel.c:1.6 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_accel.c:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_accel.c:1.6 Mon Mar 29 11:25:17 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_accel.c Mon Jan 9 09:59:56 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_accel.c,v 1.6 2004/03/29 16:25:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_accel.c,v 1.7 2006/01/09 14:59:56 dawes Exp $ */ /* - * $Workfile: nsc_gx2_accel.c $ - * $Revision: 12 $ - * $Author: Sarma $ - * * File Contents: This file is consists of main Xfree * acceleration supported routines like solid fill used * here. Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_cursor.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_cursor.c:1.6 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_cursor.c:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_cursor.c:1.6 Mon Nov 3 00:11:20 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_cursor.c Mon Jan 9 09:59:56 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_cursor.c,v 1.6 2003/11/03 05:11:20 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_cursor.c,v 1.7 2006/01/09 14:59:56 dawes Exp $ */ /* - * $Workfile: nsc_gx2_cursor.c $ - * $Revision: 9 $ - * $Author: Sarma $ - * * File Contents: Xfree cursor implementation routines * for geode HWcursor init.setting cursor color,image etc * are done here. Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_dga.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_dga.c:1.5 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_dga.c:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_dga.c:1.5 Tue Dec 7 10:59:19 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_dga.c Mon Jan 9 09:59:56 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_dga.c,v 1.5 2004/12/07 15:59:19 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_dga.c,v 1.6 2006/01/09 14:59:56 dawes Exp $ */ /* - * $Workfile: nsc_gx2_dga.c $ - * $Revision: 4 $ - * $Author: Sarma $ - * * File contents: DGA(Direct Acess Graphics mode) is feature of * XFree86 that allows the program to access directly to video * memory on the graphics card.DGA supports the double Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_driver.c:1.10 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_driver.c:1.16 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_driver.c:1.10 Mon Nov 3 00:11:20 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_driver.c Thu Mar 16 11:50:11 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_driver.c,v 1.10 2003/11/03 05:11:20 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_driver.c,v 1.16 2006/03/16 16:50:11 dawes Exp $ */ /* - * $Workfile: nsc_gx2_driver.c $ - * $Revision: 28 $ - * $Author: Sarma $ - * * File Contents: This is the main module configures the interfacing * with the X server. The individual modules will be * loaded based upon the options selected from the @@ -145,7 +141,6 @@ #define DEBUG(x) #define GEODE_TRACE 0 -#define CFB 0 /* Includes that are used by all drivers */ #include "xf86.h" @@ -168,20 +163,7 @@ #define RC_MAX_DEPTH 24 /* Frame buffer stuff */ -#if CFB -/* - * If using cfb, cfb.h is required. Select the others for the bpp values - * the driver supports. - */ -#define PSZ 8 /* needed for cfb.h */ -#include "cfb.h" -#undef PSZ -#include "cfb16.h" -#include "cfb24.h" -#include "cfb32.h" -#else #include "fb.h" -#endif #include "shadowfb.h" @@ -195,15 +177,13 @@ #include "vbe.h" /* Check for some extensions */ -#ifdef XFreeXDGA #define _XF86_DGA_SERVER_ -#include "extensions/xf86dgastr.h" -#endif /* XFreeXDGA */ +#include <X11/extensions/xf86dgastr.h> #include "globals.h" #include "opaque.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> /* Our private include file (this also includes the durango headers) */ #include "nsc.h" @@ -269,11 +249,7 @@ extern const char *nscVbeSymbols[]; extern const char *nscInt10Symbols[]; -#if CFB -extern const char *nscCfbSymbols[]; -#else extern const char *nscFbSymbols[]; -#endif extern const char *nscXaaSymbols[]; extern const char *nscRamdacSymbols[]; extern const char *nscShadowSymbols[]; @@ -444,11 +420,14 @@ GX2ProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; + ModuleDescPtr pMod; - if (xf86LoadSubModule(pScrn, "vbe")) { + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, nscVbeSymbols, NULL); pVbe = VBEInit(NULL, index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } @@ -474,10 +453,6 @@ MessageType from; int i = 0; GeodePtr pGeode; -#if CFB - char *mod = NULL; - char *reqSymbol = NULL; -#endif /* CFB */ #if defined(STB_X) GAL_ADAPTERINFO sAdapterInfo; #endif /* STB_X */ @@ -486,6 +461,7 @@ unsigned int SupportFlags; const char *s; char **modes; + ModuleDescPtr pMod; #if INT10_SUPPORT VESAPtr pVesa; @@ -512,18 +488,18 @@ return TRUE; } #if INT10_SUPPORT - if (!xf86LoadSubModule(pScreenInfo, "int10")) + if (!(pMod = xf86LoadSubModule(pScreenInfo, "int10"))) return FALSE; - xf86LoaderReqSymLists(nscInt10Symbols, NULL); + xf86LoaderModReqSymLists(pMod, nscInt10Symbols, NULL); #endif pGeode->FBVGAActive = 0; /* KFB will Knock of VGA */ #if !defined(STB_X) /* If the vgahw module would be needed it would be loaded here */ - if (!xf86LoadSubModule(pScreenInfo, "vgahw")) { + if (!(pMod = xf86LoadSubModule(pScreenInfo, "vgahw"))) { return FALSE; } - xf86LoaderReqSymLists(nscVgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, nscVgahwSymbols, NULL); #endif /* STB_X */ GeodeDebug(("GX2PreInit(1)!\n")); /* Do the durango hardware detection */ @@ -978,69 +954,37 @@ xf86SetDpi(pScreenInfo, 0, 0); GeodeDebug(("GX2PreInit(14)!\n")); -#if CFB - /* Load bpp-specific modules */ - mod = NULL; - - /* Load bpp-specific modules */ - switch (pScreenInfo->bitsPerPixel) { - case 8: - mod = "cfb"; - reqSymbol = "cfbScreenInit"; - break; - case 16: - mod = "cfb16"; - reqSymbol = "cfb16ScreenInit"; - break; - case 24: - mod = "cfb24"; - reqSymbol = "cfb24ScreenInit"; - break; - case 32: - mod = "cfb32"; - reqSymbol = "cfb32ScreenInit"; - break; - default: - return FALSE; - } - if (mod && xf86LoadSubModule(pScreenInfo, mod) == NULL) { + if (!(pMod = xf86LoadSubModule(pScreenInfo, "fb"))) { GX2FreeRec(pScreenInfo); return FALSE; } - xf86LoaderReqSymbols(reqSymbol, NULL); -#else - if (xf86LoadSubModule(pScreenInfo, "fb") == NULL) { - GX2FreeRec(pScreenInfo); - return FALSE; - } + xf86LoaderModReqSymLists(pMod, nscFbSymbols, NULL); - xf86LoaderReqSymLists(nscFbSymbols, NULL); -#endif GeodeDebug(("GX2PreInit(15)!\n")); if (pGeode->NoAccel == FALSE) { - if (!xf86LoadSubModule(pScreenInfo, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScreenInfo, "xaa"))) { GX2FreeRec(pScreenInfo); return FALSE; } - xf86LoaderReqSymLists(nscXaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, nscXaaSymbols, NULL); } GeodeDebug(("GX2PreInit(16)!\n")); if (pGeode->HWCursor == TRUE) { - if (!xf86LoadSubModule(pScreenInfo, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScreenInfo, "ramdac"))) { GX2FreeRec(pScreenInfo); return FALSE; } - xf86LoaderReqSymLists(nscRamdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, nscRamdacSymbols, NULL); } GeodeDebug(("GX2PreInit(17)!\n")); /* Load shadowfb if needed */ if (pGeode->ShadowFB) { - if (!xf86LoadSubModule(pScreenInfo, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScreenInfo, "shadowfb"))) { GX2FreeRec(pScreenInfo); return FALSE; } - xf86LoaderReqSymLists(nscShadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, nscShadowSymbols, NULL); } GeodeDebug(("GX2PreInit(18)!\n")); if (xf86RegisterResources(pGeode->pEnt->index, NULL, ResExclusive)) { @@ -1933,24 +1877,6 @@ } switch (pScreenInfo->bitsPerPixel) { -#if CFB - case 8: - Inited = cfbScreenInit(pScreen, FBStart, width, height, - pScreenInfo->xDpi, pScreenInfo->yDpi, - displayWidth); - break; - case 16: - Inited = cfb16ScreenInit(pScreen, FBStart, width, height, - pScreenInfo->xDpi, pScreenInfo->yDpi, - displayWidth); - break; - case 24: - case 32: - Inited = cfb32ScreenInit(pScreen, FBStart, width, height, - pScreenInfo->xDpi, pScreenInfo->yDpi, - displayWidth); - break; -#else case 8: case 16: case 24: @@ -1959,7 +1885,7 @@ pScreenInfo->xDpi, pScreenInfo->yDpi, displayWidth, pScreenInfo->bitsPerPixel); break; -#endif + default: xf86DrvMsg(scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) in ScreenInit\n", @@ -1991,11 +1917,9 @@ } } } -#if CFB -#else + /* must be after RGB ordering fixed */ fbPictureInit(pScreen, 0, 0); -#endif GeodeDebug(("GX2ScreenInit(6)!\n")); if (!pGeode->NoAccel) { Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_shadow.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_shadow.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_shadow.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_shadow.c:1.2 Tue Jan 14 04:34:32 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_shadow.c Mon Jan 9 09:59:56 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_shadow.c,v 1.2 2003/01/14 09:34:32 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_shadow.c,v 1.3 2006/01/09 14:59:56 dawes Exp $ */ /* - * $Workfile: nsc_gx2_shadow.c $ - * $Revision: 5 $ - * $Author: Sarma $ - * * File Contents: Direct graphics display routines are implemented and * graphics rendering are all done in memory. * Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_vga.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_vga.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_vga.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_vga.c:1.3 Mon Nov 3 00:11:21 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_vga.c Mon Jan 9 09:59:56 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_vga.c,v 1.3 2003/11/03 05:11:21 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_vga.c,v 1.4 2006/01/09 14:59:56 dawes Exp $ */ /* - * $Workfile: nsc_gx2_vga.c $ - * $Revision: 6 $ - * $Author: Sarma $ - * * This file contains routines to set modes using the VGA registers. * Since this file is for the first generation graphics unit, it interfaces * to SoftVGA registers. It works for both VSA1 and VSA2. Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_video.c:1.11 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_video.c:1.13 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_video.c:1.11 Sun Apr 25 20:23:37 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_video.c Mon Jan 9 09:59:56 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_video.c,v 1.11 2004/04/26 00:23:37 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_video.c,v 1.13 2006/01/09 14:59:56 dawes Exp $ */ /* - * $Workfile: nsc_gx2_video.c $ - * $Revision: 11 $ - * $Author: Sarma $ - * * File Contents: This file consists of main Xfree video supported routines. * * Project: Geode Xfree Frame buffer device driver. @@ -155,7 +151,7 @@ #include "regionstr.h" #include "nsc.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "xaa.h" #include "dixstruct.h" #include "fourcc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_regacc.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_regacc.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_regacc.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_regacc.c:1.2 Tue Jan 14 04:34:32 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_regacc.c Mon Jan 9 09:59:56 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_regacc.c,v 1.2 2003/01/14 09:34:32 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_regacc.c,v 1.3 2006/01/09 14:59:56 dawes Exp $ */ /* - * $Workfile: nsc_regacc.c $ - * $Revision: 4 $ - * $Author: Sarma $ - * * This is the main file used to add Durango graphics support to a software * project. The main reason to have a single file include the other files * is that it centralizes the location of the compiler options. This file Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/panel.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/nsc/panel.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/panel.c:1.3 Tue Jan 14 04:34:32 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/panel.c Mon Jan 9 09:59:56 2006 @@ -1,9 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel.c,v 1.3 2003/01/14 09:34:32 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel.c,v 1.4 2006/01/09 14:59:56 dawes Exp $ */ /* - * $Workfile: panel.c $ - * $Revision: 4 $ - * $Author: Sarma $ - * * File Contents: This file contailns the panel include files and * external pointer to the hardware. * Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/gfx/tv_fs451.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/gfx/tv_fs451.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/nsc/gfx/tv_fs451.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/gfx/tv_fs451.c:1.2 Mon Nov 3 00:11:23 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/gfx/tv_fs451.c Mon Jan 9 09:59:57 2006 @@ -1,8 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/gfx/tv_fs451.c,v 1.2 2003/11/03 05:11:23 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/gfx/tv_fs451.c,v 1.3 2006/01/09 14:59:57 dawes Exp $ */ /* - * $Workfile: tv_fs451.c $ - * $Revision: 3 $ - * * This file contains routines to control the FS451 tvout encoder. * * NSC_LIC_ALTERNATIVE_PREAMBLE Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/92xx.h diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/92xx.h:1.1 xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/92xx.h:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/92xx.h:1.1 Tue Dec 10 10:12:28 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/92xx.h Mon Jan 9 09:59:57 2006 @@ -1,8 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/92xx.h,v 1.1 2002/12/10 15:12:28 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/92xx.h,v 1.2 2006/01/09 14:59:57 dawes Exp $ */ /* - * $Workfile: 92xx.h $ - * $Revision: 9 $ - * * File Contents: This header file defines the Durango routines and * variables used to access the memory mapped regions. * Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/cen9211.h diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/cen9211.h:1.1 xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/cen9211.h:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/cen9211.h:1.1 Tue Dec 10 10:12:28 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/cen9211.h Mon Jan 9 09:59:57 2006 @@ -1,8 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/cen9211.h,v 1.1 2002/12/10 15:12:28 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/cen9211.h,v 1.2 2006/01/09 14:59:57 dawes Exp $ */ /* - * $Workfile: cen9211.h $ - * $Revision: 16 $ - * * File Contents: This header file defines the Durango routines and * variables used to access the memory mapped regions. * Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/dora9211.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/dora9211.c:1.1 xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/dora9211.c:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/dora9211.c:1.1 Tue Dec 10 10:12:28 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/dora9211.c Mon Jan 9 09:59:57 2006 @@ -1,8 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/dora9211.c,v 1.1 2002/12/10 15:12:28 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/dora9211.c,v 1.2 2006/01/09 14:59:57 dawes Exp $ */ /* - * $Workfile: dora9211.c $ - * $Revision: 19 $ - * * File Contents: This file contains the panel functions to interface * the dorado platform. * Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/dora9211.h diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/dora9211.h:1.1 xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/dora9211.h:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/dora9211.h:1.1 Tue Dec 10 10:12:28 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/dora9211.h Mon Jan 9 09:59:57 2006 @@ -1,8 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/dora9211.h,v 1.1 2002/12/10 15:12:28 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/dora9211.h,v 1.2 2006/01/09 14:59:57 dawes Exp $ */ /* - * $Workfile: dora9211.h $ - * $Revision: 12 $ - * * File Contents: This header file defines the Durango routines and * variables used to access the memory mapped regions. * Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/drac9210.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/drac9210.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/drac9210.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/drac9210.c:1.2 Tue Jan 14 04:34:35 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/drac9210.c Mon Jan 9 09:59:57 2006 @@ -1,8 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/drac9210.c,v 1.2 2003/01/14 09:34:35 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/drac9210.c,v 1.3 2006/01/09 14:59:57 dawes Exp $ */ /* - * $Workfile: drac9210.c $ - * $Revision: 5 $ - * * File Contents: This file contains the panel library files to the * platforms with 9210, and 9211 support. * Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/drac9210.h diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/drac9210.h:1.1 xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/drac9210.h:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/drac9210.h:1.1 Tue Dec 10 10:12:28 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/drac9210.h Mon Jan 9 09:59:57 2006 @@ -1,8 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/drac9210.h,v 1.1 2002/12/10 15:12:28 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/drac9210.h,v 1.2 2006/01/09 14:59:57 dawes Exp $ */ /* - * $Workfile: drac9210.h $ - * $Revision: 5 $ - * * File Contents: This file contains the panel header file and definition * for the platform with 9210 support. * Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/panel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/panel.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/panel.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/panel.c:1.3 Tue Jan 14 04:34:35 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/panel.c Mon Jan 9 09:59:57 2006 @@ -1,8 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/panel.c,v 1.3 2003/01/14 09:34:35 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/panel.c,v 1.4 2006/01/09 14:59:57 dawes Exp $ */ /* - * $Workfile: panel.c $ - * $Revision: 19 $ - * * File Contents: This file contains the file inclusions, macro definitions * for the panel. * Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/panel.h diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/panel.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/panel.h:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/panel.h:1.3 Tue Jan 14 04:34:36 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/panel.h Mon Jan 9 09:59:58 2006 @@ -1,8 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/panel.h,v 1.3 2003/01/14 09:34:36 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/panel.h,v 1.4 2006/01/09 14:59:58 dawes Exp $ */ /* - * $Workfile: panel.h $ - * $Revision: 17 $ - * * File Contents: This file contains the Geode frame buffer panel * functions prototypes and it includes panel * definitions header file. Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/platform.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/platform.c:1.4 xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/platform.c:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/platform.c:1.4 Mon Nov 3 00:11:24 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/platform.c Mon Jan 9 09:59:58 2006 @@ -1,8 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/platform.c,v 1.4 2003/11/03 05:11:24 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/platform.c,v 1.5 2006/01/09 14:59:58 dawes Exp $ */ /* - * $Workfile: platform.c $ - * $Revision: 15 $ - * * File Contents: This file contains platform dependent functions * which provide interface to that platform. * Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/pnl_bios.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/pnl_bios.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/pnl_bios.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/pnl_bios.c:1.3 Tue Jan 14 04:34:36 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/pnl_bios.c Mon Jan 9 09:59:58 2006 @@ -1,8 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/pnl_bios.c,v 1.3 2003/01/14 09:34:36 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/pnl_bios.c,v 1.4 2006/01/09 14:59:58 dawes Exp $ */ /* - * $Workfile: pnl_bios.c $ - * $Revision: 6 $ - * * File Contents: This file panel functions which query for the BIOS for current FP * Paramters. * Index: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/pnl_init.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/pnl_init.c:1.1 xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/pnl_init.c:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/pnl_init.c:1.1 Tue Dec 10 10:12:28 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/pnl_init.c Mon Jan 9 09:59:58 2006 @@ -1,8 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/pnl_init.c,v 1.1 2002/12/10 15:12:28 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/panel/pnl_init.c,v 1.2 2006/01/09 14:59:58 dawes Exp $ */ /* - * $Workfile: pnl_init.c $ - * $Revision: 28 $ - * * File Contents: This file contains the Geode frame buffer panel * intialization functions. * Index: xc/programs/Xserver/hw/xfree86/drivers/nv/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/nv/Imakefile:1.23 xc/programs/Xserver/hw/xfree86/drivers/nv/Imakefile:1.24 --- xc/programs/Xserver/hw/xfree86/drivers/nv/Imakefile:1.23 Mon May 31 20:17:02 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nv/Imakefile Fri Oct 14 11:16:42 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/Imakefile,v 1.23 2004/06/01 00:17:02 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/Imakefile,v 1.24 2005/10/14 15:16:42 tsi Exp $ XCOMM XCOMM This is an Imakefile for the NVIDIA driver. XCOMM @@ -66,17 +66,16 @@ OBJS = $(N_OBJS) $(R_OBJS) #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/fbdevhw \ -I$(XF86SRC)/ramdac -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ -I$(SERVERSRC)/Xext -I$(XF86SRC)/int10 \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(XF86SRC)/shadowfb -I$(EXTINCSRC) -I$(SERVERSRC)/fb \ - -I$(SERVERSRC)/render -I$(XF86SRC)/vbe + -I$(SERVERSRC)/include -I$(XF86SRC)/shadowfb -I$(SERVERSRC)/fb \ + -I$(SERVERSRC)/render -I$(XF86SRC)/vbe #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/nv/nv.man diff -u xc/programs/Xserver/hw/xfree86/drivers/nv/nv.man:1.26 xc/programs/Xserver/hw/xfree86/drivers/nv/nv.man:1.29 --- xc/programs/Xserver/hw/xfree86/drivers/nv/nv.man:1.26 Fri Oct 15 16:32:21 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nv/nv.man Fri Jan 20 20:17:59 2006 @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv.man,v 1.26 2004/10/15 20:32:21 mvojkovi Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv.man,v 1.29 2006/01/21 01:17:59 mvojkovi Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH NV __drivermansuffix__ __vendorversion__ @@ -51,7 +51,14 @@ NV17, NV18, NV25, NV28 .TP 22 .B GeForce FX, QUADRO FX -NV30, NV31, NV34, NV35, NV36, NV37, NV38, NV40, NV41, NV43, NV44, NV45 +NV30, NV31, NV34, NV35, NV36, NV37, NV38 +.TP 22 +.B GeForce 6XXX +NV40, NV41, NV43, NV44, NV45, C51 +.TP 22 +.B GeForce 7XXX +G70, G71, G72, G73 + .SH CONFIGURATION DETAILS Please refer to XF86Config(__filemansuffix__) for general configuration details. This section only covers configuration details specific to this Index: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_dac.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nv/nv_dac.c:1.44 xc/programs/Xserver/hw/xfree86/drivers/nv/nv_dac.c:1.45 --- xc/programs/Xserver/hw/xfree86/drivers/nv/nv_dac.c:1.44 Wed Dec 8 19:21:04 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nv/nv_dac.c Fri Jul 8 20:53:00 2005 @@ -37,7 +37,7 @@ |* *| \***************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_dac.c,v 1.44 2004/12/09 00:21:04 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_dac.c,v 1.45 2005/07/09 00:53:00 mvojkovi Exp $ */ #include "nv_include.h" @@ -312,7 +312,7 @@ /* can't read this reliably on NV11 */ if((pNv->Chipset & 0x0ff0) == 0x0110) - nvReg->crtcOwner = ((pNv->Chipset & 0x0fff) == 0x0112) ? 3 : 0; + nvReg->crtcOwner = pNv->CRTCnumber; } #define DEPTH_SHIFT(val, w) ((val << (8 - w)) | (val >> ((w << 1) - 8))) Index: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c:1.132 xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c:1.143 --- xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c:1.132 Thu Feb 17 21:55:09 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c Thu Mar 16 11:50:11 2006 @@ -1,4 +1,3 @@ -/* $XConsortium: nv_driver.c /main/3 1996/10/28 05:13:37 kaleb $ */ /* * Copyright 1996-1997 David J. McKay * @@ -24,7 +23,7 @@ /* Hacked together from mga driver and 3.3.4 NVIDIA driver by Jarno Paananen <jpaana@s2.org> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c,v 1.132 2005/02/18 02:55:09 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c,v 1.143 2006/03/16 16:50:11 dawes Exp $ */ #include "nv_include.h" @@ -82,6 +81,8 @@ 0 }; +/* Known cards as of 2006/01/12 */ + static SymTabRec NVKnownChipsets[] = { { 0x12D20018, "RIVA 128" }, @@ -126,7 +127,7 @@ #else { 0x10DE0179, "GeForce4 440 Go 64M" }, #endif - { 0x10DE017A, "Quadro4 NVS" }, + { 0x10DE017A, "Quadro NVS" }, { 0x10DE017C, "Quadro4 500 GoGL" }, { 0x10DE017D, "GeForce4 410 Go 16M" }, @@ -140,7 +141,7 @@ #if defined(__powerpc__) { 0x10DE0189, "GeForce4 MX with AGP8X (Mac)" }, #endif - { 0x10DE018A, "Quadro4 280 NVS" }, + { 0x10DE018A, "Quadro4 NVS 280 SD" }, { 0x10DE018B, "Quadro4 380 XGL" }, { 0x10DE018C, "Quadro NVS 50 PCI" }, { 0x10DE018D, "GeForce4 448 Go" }, @@ -154,7 +155,6 @@ { 0x10DE0250, "GeForce4 Ti 4600" }, { 0x10DE0251, "GeForce4 Ti 4400" }, - { 0x10DE0252, "0x0252" }, { 0x10DE0253, "GeForce4 Ti 4200" }, { 0x10DE0258, "Quadro4 900 XGL" }, { 0x10DE0259, "Quadro4 750 XGL" }, @@ -175,21 +175,15 @@ { 0x10DE0311, "GeForce FX 5600 Ultra" }, { 0x10DE0312, "GeForce FX 5600" }, - { 0x10DE0313, "0x0313"}, - { 0x10DE0314, "GeForce FX 5600SE" }, - { 0x10DE0316, "0x0316" }, - { 0x10DE0317, "0x0317" }, + { 0x10DE0314, "GeForce FX 5600XT" }, { 0x10DE031A, "GeForce FX Go5600" }, { 0x10DE031B, "GeForce FX Go5650" }, { 0x10DE031C, "Quadro FX Go700" }, - { 0x10DE031D, "0x031D" }, - { 0x10DE031E, "0x031E" }, - { 0x10DE031F, "0x031F" }, { 0x10DE0320, "GeForce FX 5200" }, { 0x10DE0321, "GeForce FX 5200 Ultra" }, { 0x10DE0322, "GeForce FX 5200" }, - { 0x10DE0323, "GeForce FX 5200SE" }, + { 0x10DE0323, "GeForce FX 5200LE" }, { 0x10DE0324, "GeForce FX Go5200" }, { 0x10DE0325, "GeForce FX Go5250" }, { 0x10DE0326, "GeForce FX 5500" }, @@ -197,93 +191,114 @@ { 0x10DE0328, "GeForce FX Go5200 32M/64M" }, #if defined(__powerpc__) { 0x10DE0329, "GeForce FX 5200 (Mac)" }, -#else - { 0x10DE0329, "0x0329" }, #endif - { 0x10DE032A, "Quadro NVS 280 PCI" }, + { 0x10DE032A, "Quadro NVS 55/280 PCI" }, { 0x10DE032B, "Quadro FX 500/600 PCI" }, { 0x10DE032C, "GeForce FX Go53xx Series" }, { 0x10DE032D, "GeForce FX Go5100" }, - { 0x10DE032F, "0x032F" }, { 0x10DE0330, "GeForce FX 5900 Ultra" }, { 0x10DE0331, "GeForce FX 5900" }, { 0x10DE0332, "GeForce FX 5900XT" }, { 0x10DE0333, "GeForce FX 5950 Ultra" }, - { 0x10DE033F, "Quadro FX 700" }, { 0x10DE0334, "GeForce FX 5900ZT" }, { 0x10DE0338, "Quadro FX 3000" }, + { 0x10DE033F, "Quadro FX 700" }, { 0x10DE0341, "GeForce FX 5700 Ultra" }, { 0x10DE0342, "GeForce FX 5700" }, { 0x10DE0343, "GeForce FX 5700LE" }, { 0x10DE0344, "GeForce FX 5700VE" }, - { 0x10DE0345, "0x0345" }, { 0x10DE0347, "GeForce FX Go5700" }, { 0x10DE0348, "GeForce FX Go5700" }, - { 0x10DE0349, "0x0349" }, - { 0x10DE034B, "0x034B" }, { 0x10DE034C, "Quadro FX Go1000" }, { 0x10DE034E, "Quadro FX 1100" }, - { 0x10DE034F, "0x034F" }, { 0x10DE0040, "GeForce 6800 Ultra" }, { 0x10DE0041, "GeForce 6800" }, { 0x10DE0042, "GeForce 6800 LE" }, - { 0x10DE0043, "0x0043" }, + { 0x10DE0043, "GeForce 6800 XE" }, { 0x10DE0045, "GeForce 6800 GT" }, - { 0x10DE0049, "0x0049" }, + { 0x10DE0046, "GeForce 6800 GT" }, + { 0x10DE0047, "GeForce 6800 GS" }, + { 0x10DE0048, "GeForce 6800 XT" }, { 0x10DE004E, "Quadro FX 4000" }, - { 0x10DE00C0, "0x00C0" }, + { 0x10DE00C0, "GeForce 6800 GS" }, { 0x10DE00C1, "GeForce 6800" }, { 0x10DE00C2, "GeForce 6800 LE" }, + { 0x10DE00C3, "GeForce 6800 XT" }, { 0x10DE00C8, "GeForce Go 6800" }, { 0x10DE00C9, "GeForce Go 6800 Ultra" }, { 0x10DE00CC, "Quadro FX Go1400" }, - { 0x10DE00CD, "0x00CD" }, + { 0x10DE00CD, "Quadro FX 3450/4000 SDI" }, { 0x10DE00CE, "Quadro FX 1400" }, { 0x10DE0140, "GeForce 6600 GT" }, { 0x10DE0141, "GeForce 6600" }, - { 0x10DE0142, "0x0142" }, - { 0x10DE0143, "0x0143" }, + { 0x10DE0142, "GeForce 6600 LE" }, + { 0x10DE0143, "GeForce 6600 VE" }, { 0x10DE0144, "GeForce Go 6600" }, { 0x10DE0145, "GeForce 6610 XL" }, { 0x10DE0146, "GeForce Go 6600 TE/6200 TE" }, - { 0x10DE0147, "0x0147" }, + { 0x10DE0147, "GeForce 6700 XL" }, { 0x10DE0148, "GeForce Go 6600" }, - { 0x10DE0149, "0x0149" }, - { 0x10DE014B, "0x014B" }, - { 0x10DE014C, "0x014C" }, - { 0x10DE014D, "0x014D" }, + { 0x10DE0149, "GeForce Go 6600 GT" }, { 0x10DE014E, "Quadro FX 540" }, { 0x10DE014F, "GeForce 6200" }, - { 0x10DE0160, "0x0160" }, + { 0x10DE0160, "GeForce 6500" }, { 0x10DE0161, "GeForce 6200 TurboCache(TM)" }, - { 0x10DE0162, "0x0162" }, - { 0x10DE0163, "0x0163" }, + { 0x10DE0162, "GeForce 6200SE TurboCache(TM)" }, + { 0x10DE0163, "GeForce 6200 LE" }, { 0x10DE0164, "GeForce Go 6200" }, - { 0x10DE0165, "0x0163" }, - { 0x10DE0166, "GeForce Go 6250" }, + { 0x10DE0165, "Quadro NVS 285" }, + { 0x10DE0166, "GeForce Go 6400" }, { 0x10DE0167, "GeForce Go 6200" }, - { 0x10DE0168, "GeForce Go 6250" }, - { 0x10DE0169, "0x0169" }, - { 0x10DE016B, "0x016B" }, - { 0x10DE016C, "0x016C" }, - { 0x10DE016D, "0x016D" }, - { 0x10DE016E, "0x016E" }, + { 0x10DE0168, "GeForce Go 6400" }, + { 0x10DE0169, "GeForce 6250" }, - { 0x10DE0210, "0x0210" }, { 0x10DE0211, "GeForce 6800" }, { 0x10DE0212, "GeForce 6800 LE" }, { 0x10DE0215, "GeForce 6800 GT" }, + { 0x10DE0218, "GeForce 6800 XT" }, - { 0x10DE0220, "0x0220" }, - { 0x10DE0221, "0x0221" }, - { 0x10DE0222, "0x0222" }, - { 0x10DE0228, "0x0228" }, + { 0x10DE0221, "GeForce 6200" }, + + { 0x10DE0090, "GeForce 7800 GTX" }, + { 0x10DE0091, "GeForce 7800 GTX" }, + { 0x10DE0092, "GeForce 7800 GT" }, + { 0x10DE0093, "GeForce 7800 GS" }, + { 0x10DE0095, "GeForce 7800 SLI" }, + { 0x10DE0098, "GeForce Go 7800" }, + { 0x10DE0099, "GeForce Go 7800 GTX" }, + { 0x10DE009D, "Quadro FX 4500" }, + + { 0x10DE01D1, "GeForce 7300 LE" }, + { 0x10DE01D6, "GeForce Go 7200" }, + { 0x10DE01D7, "GeForce Go 7300" }, + { 0x10DE01D8, "GeForce Go 7400" }, + { 0x10DE01DA, "Quadro NVS 110M" }, + { 0x10DE01DB, "Quadro NVS 120M" }, + { 0x10DE01DC, "Quadro FX 350M" }, + { 0x10DE01DE, "Quadro FX 350" }, + { 0x10DE01DF, "GeForce 7300 GS" }, + + { 0x10DE0398, "GeForce Go 7600" }, + { 0x10DE0399, "GeForce Go 7600 GT"}, + { 0x10DE039A, "Quadro NVS 300M" }, + { 0x10DE039C, "Quadro FX 550M" }, + + { 0x10DE0298, "GeForce Go 7900 GS" }, + { 0x10DE0299, "GeForce Go 7900 GTX" }, + { 0x10DE029A, "Quadro FX 2500M" }, + { 0x10DE029B, "Quadro FX 1500M" }, + + { 0x10DE0240, "GeForce 6150" }, + { 0x10DE0241, "GeForce 6150 LE" }, + { 0x10DE0242, "GeForce 6100" }, + { 0x10DE0244, "GeForce Go 6150" }, + { 0x10DE0247, "GeForce Go 6100" }, {-1, NULL} }; @@ -293,8 +308,8 @@ * List of symbols from other modules that this module references. This * list is used to tell the loader that it is OK for symbols here to be * unresolved providing that it hasn't been told that they haven't been - * told that they are essential via a call to xf86LoaderReqSymbols() or - * xf86LoaderReqSymLists(). The purpose is this is to avoid warnings about + * told that they are essential via a call to xf86LoaderModReqSymbols() or + * xf86LoaderModReqSymLists(). The purpose is this is to avoid warnings about * unresolved symbols that are not required. */ @@ -343,14 +358,12 @@ NULL }; -#ifdef XFree86LOADER static const char *vbeSymbols[] = { "VBEInit", "vbeFree", "vbeDoEDID", NULL }; -#endif static const char *i2cSymbols[] = { "xf86CreateI2CBusRec", @@ -491,7 +504,7 @@ #ifdef XFree86LOADER static pointer -nvSetup(pointer module, pointer opts, int *errmaj, int *errmin) +nvSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -510,10 +523,10 @@ * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(vgahwSymbols, xaaSymbols, fbSymbols, - ramdacSymbols, shadowSymbols, rivaSymbols, - i2cSymbols, ddcSymbols, vbeSymbols, - fbdevHWSymbols, int10Symbols, NULL); + LoaderModRefSymLists(module, vgahwSymbols, xaaSymbols, fbSymbols, + ramdacSymbols, shadowSymbols, rivaSymbols, + i2cSymbols, ddcSymbols, vbeSymbols, + fbdevHWSymbols, int10Symbols, NULL); /* * The return value must be non-NULL on success even though there @@ -623,6 +636,7 @@ int numDevSections; int numUsed; Bool foundScreen = FALSE; + ModuleDescPtr pMod; if ((numDevSections = xf86MatchDevice(NV_DRIVER_NAME, &devSections)) <= 0) @@ -676,12 +690,13 @@ case 0x0120: case 0x0140: case 0x0160: - case 0x0130: case 0x01D0: case 0x0090: case 0x0210: case 0x0220: - case 0x0230: + case 0x0240: + case 0x0290: + case 0x0390: NVChipsets[numUsed].token = pciid; NVChipsets[numUsed].name = "Unknown NVIDIA chip"; NVPciChipsets[numUsed].numChipset = pciid; @@ -717,10 +732,10 @@ pPci = xf86GetPciInfoForEntity(usedChips[i]); if(pPci->vendor == PCI_VENDOR_NVIDIA_SGS) { - if (!xf86LoadDrvSubModule(drv, "riva128")) { + if (!(pMod = xf86LoadDrvSubModule(drv, "riva128"))) { continue; } - xf86LoaderReqSymLists(rivaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, rivaSymbols, NULL); if(RivaGetScrnInfoRec(NVPciChipsets, usedChips[i])) foundScreen = TRUE; } else { @@ -917,11 +932,14 @@ nvProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; + ModuleDescPtr pMod; - if (xf86LoadSubModule(pScrn, "vbe")) { + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } @@ -929,13 +947,14 @@ Bool NVI2CInit(ScrnInfoPtr pScrn) { char *mod = "i2c"; + ModuleDescPtr pMod; - if (xf86LoadSubModule(pScrn, mod)) { - xf86LoaderReqSymLists(i2cSymbols,NULL); + if ((pMod = xf86LoadSubModule(pScrn, mod))) { + xf86LoaderModReqSymLists(pMod, i2cSymbols,NULL); mod = "ddc"; - if(xf86LoadSubModule(pScrn, mod)) { - xf86LoaderReqSymLists(ddcSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, mod))) { + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); return NVDACi2cInit(pScrn); } } @@ -955,6 +974,7 @@ int i, max_width, max_height; ClockRangePtr clockRanges; const char *s; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) { nvProbeDDC( pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index ); @@ -997,8 +1017,8 @@ pNv->Primary = xf86IsPrimaryPci(pNv->PciInfo); /* Initialize the card through int10 interface if needed */ - if (xf86LoadSubModule(pScrn, "int10")) { - xf86LoaderReqSymLists(int10Symbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "int10"))) { + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); #if !defined(__alpha__) && !defined(__powerpc__) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing int10\n"); pNv->pInt = xf86InitInt10(pNv->pEnt->index); @@ -1126,12 +1146,12 @@ } /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) { + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) { xf86FreeInt10(pNv->pInt); return FALSE; } - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* * Allocate a vgaHWRec @@ -1196,12 +1216,12 @@ } if (pNv->FBDev) { /* check for linux framebuffer device */ - if (!xf86LoadSubModule(pScrn, "fbdevhw")) { + if (!(pMod = xf86LoadSubModule(pScrn, "fbdevhw"))) { xf86FreeInt10(pNv->pInt); return FALSE; } - xf86LoaderReqSymLists(fbdevHWSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbdevHWSymbols, NULL); if (!fbdevHWInit(pScrn, pNv->PciInfo, NULL)) { xf86FreeInt10(pNv->pInt); return FALSE; @@ -1354,24 +1374,25 @@ case 0x0280: /* GeForce4 Ti (8x AGP) */ pNv->Architecture = NV_ARCH_20; break; - case 0x0300: /* GeForceFX 5800 */ - case 0x0310: /* GeForceFX 5600 */ - case 0x0320: /* GeForceFX 5200 */ - case 0x0330: /* GeForceFX 5900 */ - case 0x0340: /* GeForceFX 5700 */ + case 0x0300: /* GeForce FX 5800 */ + case 0x0310: /* GeForce FX 5600 */ + case 0x0320: /* GeForce FX 5200 */ + case 0x0330: /* GeForce FX 5900 */ + case 0x0340: /* GeForce FX 5700 */ pNv->Architecture = NV_ARCH_30; break; - case 0x0040: - case 0x00C0: - case 0x0120: - case 0x0130: - case 0x0140: - case 0x0160: - case 0x01D0: - case 0x0090: - case 0x0210: - case 0x0220: - case 0x0230: + case 0x0040: /* GeForce 6800 */ + case 0x00C0: /* GeForce 6800 */ + case 0x0120: /* GeForce 6800 */ + case 0x0140: /* GeForce 6600 */ + case 0x0160: /* GeForce 6200 */ + case 0x01D0: /* GeForce 7200, 7300, 7400 */ + case 0x0090: /* GeForce 7800 */ + case 0x0210: /* GeForce 6800 */ + case 0x0220: /* GeForce 6200 */ + case 0x0290: /* GeForce 7900 */ + case 0x0390: /* GeForce 7600 */ + case 0x0240: /* GeForce 6100 */ pNv->Architecture = NV_ARCH_40; break; default: @@ -1408,9 +1429,13 @@ } } - pNv->FbUsableSize = pNv->FbMapSize - (128 * 1024); + if(pNv->Architecture >= NV_ARCH_40) + pNv->FbUsableSize = pNv->FbMapSize - (560 * 1024); + else + pNv->FbUsableSize = pNv->FbMapSize - (128 * 1024); pNv->ScratchBufferSize = (pNv->Architecture < NV_ARCH_10) ? 8192 : 16384; pNv->ScratchBufferStart = pNv->FbUsableSize - pNv->ScratchBufferSize; + pNv->CursorStart = pNv->FbUsableSize + (32 * 1024); /* * Setup the ClockRanges, which describe what clock ranges are available, @@ -1508,42 +1533,42 @@ * section. */ - if (xf86LoadSubModule(pScrn, "fb") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); /* Load XAA if needed */ if (!pNv->NoAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } /* Load ramdac if needed */ if (pNv->HWCursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } /* Load shadowfb if needed */ if (pNv->ShadowFB) { - if (!xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } pNv->CurrentLayout.bitsPerPixel = pScrn->bitsPerPixel; @@ -1702,8 +1727,6 @@ static void NVBacklightEnable(NVPtr pNv, Bool on) { - CARD32 fpcontrol = pNv->PRAMDAC[0x0848/4] & 0xCfffffCC; - /* This is done differently on each laptop. Here we define the ones we know for sure. */ @@ -1722,14 +1745,24 @@ } pNv->PMC[0x10F0/4] = tmp_pmc; pNv->PCRTC0[0x081C/4] = tmp_pcrt; - } + } #endif - /* cut the TMDS output */ - if(on) fpcontrol |= pNv->fpSyncs; - else fpcontrol |= 0x20000022; + if(pNv->LVDS) { + if(pNv->twoHeads && ((pNv->Chipset & 0x0ff0) != 0x0110)) { + pNv->PMC[0x130C/4] = on ? 3 : 7; + } + } else { + CARD32 fpcontrol; - pNv->PRAMDAC[0x0848/4] = fpcontrol; + fpcontrol = pNv->PRAMDAC[0x0848/4] & 0xCfffffCC; + + /* cut the TMDS output */ + if(on) fpcontrol |= pNv->fpSyncs; + else fpcontrol |= 0x20000022; + + pNv->PRAMDAC[0x0848/4] = fpcontrol; + } } static void @@ -1853,7 +1886,7 @@ * function. If not, the visuals will need to be setup before calling * a fb ScreenInit() function and fixed up after. * - * For most PC hardware at depths >= 8, the defaults that cfb uses + * For most PC hardware at depths >= 8, the defaults that fb uses * are not appropriate. In this driver, we fixup the visuals after. */ Index: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_hw.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nv/nv_hw.c:1.15 xc/programs/Xserver/hw/xfree86/drivers/nv/nv_hw.c:1.20 --- xc/programs/Xserver/hw/xfree86/drivers/nv/nv_hw.c:1.15 Thu Feb 3 18:16:50 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/nv/nv_hw.c Fri Jan 20 20:17:59 2006 @@ -36,7 +36,7 @@ |* those rights set forth herein. *| |* *| \***************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_hw.c,v 1.15 2005/02/03 23:16:50 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_hw.c,v 1.20 2006/01/21 01:17:59 mvojkovi Exp $ */ #include "nv_local.h" #include "compiler.h" @@ -140,16 +140,23 @@ if(pNv->Architecture >= NV_ARCH_40) { pll = pNv->PMC[0x4020/4]; - P = (pll >> 16) & 0x03; + P = (pll >> 16) & 0x07; pll = pNv->PMC[0x4024/4]; M = pll & 0xFF; N = (pll >> 8) & 0xFF; - MB = (pll >> 16) & 0xFF; - NB = (pll >> 24) & 0xFF; + if(((pNv->Chipset & 0xfff0) == 0x0290) || + ((pNv->Chipset & 0xfff0) == 0x0390)) + { + MB = 1; + NB = 1; + } else { + MB = (pll >> 16) & 0xFF; + NB = (pll >> 24) & 0xFF; + } *MClk = ((N * NB * pNv->CrystalFreqKHz) / (M * MB)) >> P; pll = pNv->PMC[0x4000/4]; - P = (pll >> 16) & 0x03; + P = (pll >> 16) & 0x07; pll = pNv->PMC[0x4004/4]; M = pll & 0xFF; N = (pll >> 8) & 0xFF; @@ -871,6 +878,10 @@ case NV_ARCH_20: case NV_ARCH_30: default: + if((pNv->Chipset & 0xfff0) == 0x0240) { + state->arbitration0 = 256; + state->arbitration1 = 0x0480; + } else if(((pNv->Chipset & 0xffff) == 0x01A0) || ((pNv->Chipset & 0xffff) == 0x01f0)) { @@ -915,6 +926,7 @@ RIVA_HW_STATE *state ) { + CARD32 tmp; int i; pNv->PMC[0x0140/4] = 0x00000000; @@ -928,16 +940,29 @@ if(pNv->Architecture == NV_ARCH_04) { pNv->PFB[0x0200/4] = state->config; - } else if ((pNv->Chipset & 0xfff0) == 0x0090) { - for(i = 0; i < 15; i++) { - pNv->PFB[(0x0600 + (i * 0x10))/4] = 0; - pNv->PFB[(0x0604 + (i * 0x10))/4] = pNv->FbMapSize - 1; - } - } else { + } else + if((pNv->Architecture < NV_ARCH_40) || + ((pNv->Chipset & 0xfff0) == 0x0040)) + { for(i = 0; i < 8; i++) { pNv->PFB[(0x0240 + (i * 0x10))/4] = 0; pNv->PFB[(0x0244 + (i * 0x10))/4] = pNv->FbMapSize - 1; } + } else { + int regions = 12; + + if(((pNv->Chipset & 0xfff0) == 0x0090) || + ((pNv->Chipset & 0xfff0) == 0x01D0) || + ((pNv->Chipset & 0xfff0) == 0x0290) || + ((pNv->Chipset & 0xfff0) == 0x0390)) + { + regions = 15; + } + + for(i = 0; i < regions; i++) { + pNv->PFB[(0x0600 + (i * 0x10))/4] = 0; + pNv->PFB[(0x0604 + (i * 0x10))/4] = pNv->FbMapSize - 1; + } } if(pNv->Architecture >= NV_ARCH_40) { @@ -1156,6 +1181,10 @@ pNv->PGRAPH[0x0090/4] = 0x00008000; pNv->PGRAPH[0x0610/4] = 0x00be3c5f; + tmp = pNv->REGS[0x1540/4] & 0xff; + for(i = 0; tmp && !(tmp & 1); tmp >>= 1, i++); + pNv->PGRAPH[0x5000/4] = i; + if((pNv->Chipset & 0xfff0) == 0x0040) { pNv->PGRAPH[0x09b0/4] = 0x83280fff; pNv->PGRAPH[0x09b4/4] = 0x000000a0; @@ -1172,11 +1201,13 @@ pNv->PFB[0x033C/4] &= 0xffff7fff; break; case 0x00C0: + case 0x0120: pNv->PGRAPH[0x0828/4] = 0x007596ff; pNv->PGRAPH[0x082C/4] = 0x00000108; break; case 0x0160: case 0x01D0: + case 0x0240: pNv->PMC[0x1700/4] = pNv->PFB[0x020C/4]; pNv->PMC[0x1704/4] = 0; pNv->PMC[0x1708/4] = 0; @@ -1190,12 +1221,13 @@ pNv->PGRAPH[0x082C/4] = 0x00000108; break; case 0x0220: - case 0x0230: pNv->PGRAPH[0x0860/4] = 0; pNv->PGRAPH[0x0864/4] = 0; pNv->PRAMDAC[0x0608/4] |= 0x00100000; break; case 0x0090: + case 0x0290: + case 0x0390: pNv->PRAMDAC[0x0608/4] |= 0x00100000; pNv->PGRAPH[0x0828/4] = 0x07830610; pNv->PGRAPH[0x082C/4] = 0x0000016A; @@ -1243,12 +1275,34 @@ } } - if((pNv->Chipset & 0xfff0) == 0x0090) { - for(i = 0; i < 60; i++) - pNv->PGRAPH[(0x0D00/4) + i] = pNv->PFB[(0x0600/4) + i]; - } else { - for(i = 0; i < 32; i++) + if((pNv->Architecture < NV_ARCH_40) || + ((pNv->Chipset & 0xfff0) == 0x0040)) + { + for(i = 0; i < 32; i++) { pNv->PGRAPH[(0x0900/4) + i] = pNv->PFB[(0x0240/4) + i]; + pNv->PGRAPH[(0x6900/4) + i] = pNv->PFB[(0x0240/4) + i]; + } + } else { + if(((pNv->Chipset & 0xfff0) == 0x0090) || + ((pNv->Chipset & 0xfff0) == 0x01D0) || + ((pNv->Chipset & 0xfff0) == 0x0290) || + ((pNv->Chipset & 0xfff0) == 0x0390)) + { + for(i = 0; i < 60; i++) { + pNv->PGRAPH[(0x0D00/4) + i] = pNv->PFB[(0x0600/4) + i]; + pNv->PGRAPH[(0x6900/4) + i] = pNv->PFB[(0x0600/4) + i]; + } + } else { + for(i = 0; i < 48; i++) { + pNv->PGRAPH[(0x0900/4) + i] = pNv->PFB[(0x0600/4) + i]; + if(((pNv->Chipset & 0xfff0) != 0x0160) && + ((pNv->Chipset & 0xfff0) != 0x0220) && + ((pNv->Chipset & 0xfff0) != 0x0240)) + { + pNv->PGRAPH[(0x6900/4) + i] = pNv->PFB[(0x0600/4) + i]; + } + } + } } if(pNv->Architecture >= NV_ARCH_40) { @@ -1263,7 +1317,11 @@ pNv->PGRAPH[0x0864/4] = pNv->FbMapSize - 1; pNv->PGRAPH[0x0868/4] = pNv->FbMapSize - 1; } else { - if((pNv->Chipset & 0xfff0) == 0x0090) { + if(((pNv->Chipset & 0xfff0) == 0x0090) || + ((pNv->Chipset & 0xfff0) == 0x01D0) || + ((pNv->Chipset & 0xfff0) == 0x0290) || + ((pNv->Chipset & 0xfff0) == 0x0390)) + { pNv->PGRAPH[0x0DF0/4] = pNv->PFB[0x0200/4]; pNv->PGRAPH[0x0DF4/4] = pNv->PFB[0x0204/4]; } else { Index: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_include.h diff -u xc/programs/Xserver/hw/xfree86/drivers/nv/nv_include.h:1.11 xc/programs/Xserver/hw/xfree86/drivers/nv/nv_include.h:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/nv/nv_include.h:1.11 Thu Dec 6 19:09:56 2001 +++ xc/programs/Xserver/hw/xfree86/drivers/nv/nv_include.h Fri Oct 14 11:16:42 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_include.h,v 1.11 2001/12/07 00:09:56 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_include.h,v 1.12 2005/10/14 15:16:42 tsi Exp $ */ #ifndef __NV_INCLUDE_H__ #define __NV_INCLUDE_H__ @@ -43,7 +43,7 @@ #include "fbdevhw.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "vgaHW.h" Index: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_setup.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nv/nv_setup.c:1.44 xc/programs/Xserver/hw/xfree86/drivers/nv/nv_setup.c:1.49 --- xc/programs/Xserver/hw/xfree86/drivers/nv/nv_setup.c:1.44 Wed Dec 8 19:21:05 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nv/nv_setup.c Wed Sep 28 13:43:27 2005 @@ -37,7 +37,7 @@ |* *| \***************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_setup.c,v 1.44 2004/12/09 00:21:05 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_setup.c,v 1.49 2005/09/28 17:43:27 mvojkovi Exp $ */ #include "nv_include.h" @@ -302,6 +302,9 @@ pNv->RamAmountKBytes = (pNv->PFB[0x020C/4] & 0xFFF00000) >> 10; } + if(pNv->RamAmountKBytes > 256*1024) + pNv->RamAmountKBytes = 256*1024; + pNv->CrystalFreqKHz = (pNv->PEXTDEV[0x0000/4] & (1 << 6)) ? 14318 : 13500; if(pNv->twoHeads && (implementation != 0x0110)) @@ -310,7 +313,6 @@ pNv->CrystalFreqKHz = 27000; } - pNv->CursorStart = (pNv->RamAmountKBytes - 96) * 1024; pNv->CURSOR = NULL; /* can't set this here */ pNv->MinVClockFreqKHz = 12000; pNv->MaxVClockFreqKHz = pNv->twoStagePLL ? 400000 : 350000; @@ -408,6 +410,7 @@ case 0x0186: case 0x0187: case 0x018D: + case 0x0228: case 0x0286: case 0x028C: case 0x0316: @@ -431,11 +434,17 @@ case 0x034C: case 0x0160: case 0x0166: + case 0x0169: + case 0x016B: + case 0x016C: + case 0x016D: case 0x00C8: case 0x00CC: case 0x0144: case 0x0146: case 0x0148: + case 0x0098: + case 0x0099: mobile = TRUE; break; default: @@ -680,5 +689,14 @@ if(!pNv->FlatPanel || (pScrn->depth != 24) || !pNv->twoHeads) pNv->FPDither = FALSE; + + pNv->LVDS = FALSE; + if(pNv->FlatPanel && pNv->twoHeads) { + pNv->PRAMDAC0[0x08B0/4] = 0x00010004; + if(pNv->PRAMDAC0[0x08B4/4] & 1) + pNv->LVDS = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Panel is %s\n", + pNv->LVDS ? "LVDS" : "TMDS"); + } } Index: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h diff -u xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h:1.50 xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h:1.51 --- xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h:1.50 Wed Dec 8 19:21:05 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h Sat Apr 16 19:57:26 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h,v 1.50 2004/12/09 00:21:05 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h,v 1.51 2005/04/16 23:57:26 mvojkovi Exp $ */ #ifndef __NV_STRUCT_H__ #define __NV_STRUCT_H__ @@ -161,6 +161,7 @@ CARD32 fpSyncs; Bool usePanelTweak; int PanelTweak; + Bool LVDS; CARD32 dmaPut; CARD32 dmaCurrent; Index: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nv/nv_video.c:1.24 xc/programs/Xserver/hw/xfree86/drivers/nv/nv_video.c:1.25 --- xc/programs/Xserver/hw/xfree86/drivers/nv/nv_video.c:1.24 Mon Mar 29 11:25:18 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nv/nv_video.c Fri Oct 14 11:16:43 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_video.c,v 1.24 2004/03/29 16:25:18 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_video.c,v 1.25 2005/10/14 15:16:43 tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -11,7 +11,7 @@ #include "regionstr.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "xaa.h" #include "dixstruct.h" #include "fourcc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/nv/riva_driver.c:1.7 xc/programs/Xserver/hw/xfree86/drivers/nv/riva_driver.c:1.9 --- xc/programs/Xserver/hw/xfree86/drivers/nv/riva_driver.c:1.7 Fri Nov 26 06:48:48 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/nv/riva_driver.c Thu Mar 16 11:50:12 2006 @@ -23,7 +23,7 @@ /* Hacked together from mga driver and 3.3.4 NVIDIA driver by Jarno Paananen <jpaana@s2.org> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_driver.c,v 1.7 2004/11/26 11:48:48 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_driver.c,v 1.9 2006/03/16 16:50:12 dawes Exp $ */ #include "riva_include.h" @@ -61,8 +61,8 @@ * List of symbols from other modules that this module references. This * list is used to tell the loader that it is OK for symbols here to be * unresolved providing that it hasn't been told that they haven't been - * told that they are essential via a call to xf86LoaderReqSymbols() or - * xf86LoaderReqSymLists(). The purpose is this is to avoid warnings about + * told that they are essential via a call to xf86LoaderModReqSymbols() or + * xf86LoaderModReqSymLists(). The purpose is this is to avoid warnings about * unresolved symbols that are not required. */ @@ -111,14 +111,12 @@ NULL }; -#ifdef XFree86LOADER static const char *vbeSymbols[] = { "VBEInit", "vbeFree", "vbeDoEDID", NULL }; -#endif static const char *i2cSymbols[] = { "xf86CreateI2CBusRec", @@ -161,7 +159,6 @@ NULL }; - #ifdef XFree86LOADER static MODULESETUPPROTO(rivaSetup); @@ -242,7 +239,7 @@ #ifdef XFree86LOADER static pointer -rivaSetup(pointer module, pointer opts, int *errmaj, int *errmin) +rivaSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -251,10 +248,10 @@ if (!setupDone) { setupDone = TRUE; - LoaderRefSymLists(vgahwSymbols, xaaSymbols, fbSymbols, - ramdacSymbols, shadowSymbols, - i2cSymbols, ddcSymbols, vbeSymbols, - fbdevHWSymbols, int10Symbols, NULL); + LoaderModRefSymLists(module, vgahwSymbols, xaaSymbols, fbSymbols, + ramdacSymbols, shadowSymbols, + i2cSymbols, ddcSymbols, vbeSymbols, + fbdevHWSymbols, int10Symbols, NULL); } return (pointer)1; } @@ -438,11 +435,14 @@ rivaProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; + ModuleDescPtr pMod; - if (xf86LoadSubModule(pScrn, "vbe")) { + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } @@ -450,13 +450,14 @@ Bool RivaI2CInit(ScrnInfoPtr pScrn) { char *mod = "i2c"; + ModuleDescPtr pMod; - if (xf86LoadSubModule(pScrn, mod)) { - xf86LoaderReqSymLists(i2cSymbols,NULL); + if ((pMod = xf86LoadSubModule(pScrn, mod))) { + xf86LoaderModReqSymLists(pMod, i2cSymbols,NULL); mod = "ddc"; - if(xf86LoadSubModule(pScrn, mod)) { - xf86LoaderReqSymLists(ddcSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, mod))) { + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); return RivaDACi2cInit(pScrn); } } @@ -476,6 +477,7 @@ int i; ClockRangePtr clockRanges; const char *s; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) { rivaProbeDDC( pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index ); @@ -518,8 +520,8 @@ pRiva->Primary = xf86IsPrimaryPci(pRiva->PciInfo); /* Initialize the card through int10 interface if needed */ - if (xf86LoadSubModule(pScrn, "int10")) { - xf86LoaderReqSymLists(int10Symbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "int10"))) { + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); #if !defined(__alpha__) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing int10\n"); pRiva->pInt = xf86InitInt10(pRiva->pEnt->index); @@ -599,12 +601,12 @@ } /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) { + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) { xf86FreeInt10(pRiva->pInt); return FALSE; } - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* * Allocate a vgaHWRec @@ -667,12 +669,12 @@ } if (pRiva->FBDev) { /* check for linux framebuffer device */ - if (!xf86LoadSubModule(pScrn, "fbdevhw")) { + if (!(pMod = xf86LoadSubModule(pScrn, "fbdevhw"))) { xf86FreeInt10(pRiva->pInt); return FALSE; } - xf86LoaderReqSymLists(fbdevHWSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbdevHWSymbols, NULL); if (!fbdevHWInit(pScrn, pRiva->PciInfo, NULL)) { xf86FreeInt10(pRiva->pInt); return FALSE; @@ -889,42 +891,42 @@ * section. */ - if (xf86LoadSubModule(pScrn, "fb") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { xf86FreeInt10(pRiva->pInt); RivaFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); /* Load XAA if needed */ if (!pRiva->NoAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { xf86FreeInt10(pRiva->pInt); RivaFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } /* Load ramdac if needed */ if (pRiva->HWCursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { xf86FreeInt10(pRiva->pInt); RivaFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } /* Load shadowfb if needed */ if (pRiva->ShadowFB) { - if (!xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { xf86FreeInt10(pRiva->pInt); RivaFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } pRiva->CurrentLayout.bitsPerPixel = pScrn->bitsPerPixel; @@ -1173,7 +1175,7 @@ * function. If not, the visuals will need to be setup before calling * a fb ScreenInit() function and fixed up after. * - * For most PC hardware at depths >= 8, the defaults that cfb uses + * For most PC hardware at depths >= 8, the defaults that fb uses * are not appropriate. In this driver, we fixup the visuals after. */ Index: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_include.h diff -u xc/programs/Xserver/hw/xfree86/drivers/nv/riva_include.h:1.1 xc/programs/Xserver/hw/xfree86/drivers/nv/riva_include.h:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/nv/riva_include.h:1.1 Thu Jul 31 16:24:31 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/nv/riva_include.h Fri Oct 14 11:16:43 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_include.h,v 1.1 2003/07/31 20:24:31 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_include.h,v 1.2 2005/10/14 15:16:43 tsi Exp $ */ #ifndef __RIVA_INCLUDE_H__ #define __RIVA_INCLUDE_H__ @@ -43,7 +43,7 @@ #include "fbdevhw.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "vgaHW.h" Index: xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile:1.23 xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile:1.25 --- xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile:1.23 Mon May 31 20:17:02 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile Fri Oct 14 11:16:43 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile,v 1.23 2004/06/01 00:17:02 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile,v 1.25 2005/10/14 15:16:43 tsi Exp $ XCOMM XCOMM This is an Imakefile for the Rendition driver. @@ -60,17 +60,16 @@ hwcursor.o vloaduc.o accel.o rendition_shadow.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(SERVERSRC)/fb \ - -I$(SERVERSRC)/mi -I$(SERVERSRC)/cfb\ +INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c -I$(XF86SRC)/vgahw \ -I$(XF86SRC)/rac -I$(XF86SRC)/int10 -I$(XF86SRC)/vbe \ - -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(FONTINCSRC) -I$(XINCLUDESRC) \ + -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/include -I$(XF86SRC)/xaa \ -I$(XF86SRC)/ramdac -I$(SERVERSRC)/Xext \ -I$(XF86SRC)/shadowfb -I$(XF86SRC)/rac -I$(XF86SRC)/loader \ - -I$(SERVERSRC)/render -I$(EXTINCSRC) + -I$(SERVERSRC)/render #endif XCOMM Index: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c diff -u xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c:1.60 xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c:1.63 --- xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c:1.60 Fri Mar 19 12:00:16 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c Thu Mar 16 11:50:12 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c,v 1.60 2004/03/19 17:00:16 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c,v 1.63 2006/03/16 16:50:12 dawes Exp $ */ /* * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. * @@ -189,14 +189,6 @@ NULL }; -#ifdef XFree86LOADER -static const char *miscfbSymbols[]={ - "xf1bppScreenInit", - "xf4bppScreenInit", - NULL -}; -#endif - static const char *fbSymbols[]={ "fbScreenInit", "fbPictureInit", @@ -240,7 +232,7 @@ { &renditionVersionRec, renditionSetup, NULL }; static pointer -renditionSetup(pointer Module, pointer Options, int *ErrorMajor, +renditionSetup(ModuleDescPtr Module, pointer Options, int *ErrorMajor, int *ErrorMinor) { static Bool Initialised=FALSE; @@ -248,9 +240,9 @@ if (!Initialised) { Initialised=TRUE; xf86AddDriver(&RENDITION, Module, 0); - LoaderRefSymLists(vgahwSymbols, ramdacSymbols, miscfbSymbols, - fbSymbols, xaaSymbols, ddcSymbols, int10Symbols, - shadowfbSymbols, vbeSymbols, NULL); + LoaderModRefSymLists(Module, vgahwSymbols, ramdacSymbols, fbSymbols, + xaaSymbols, ddcSymbols, int10Symbols, + shadowfbSymbols, vbeSymbols, NULL); return (pointer)TRUE; } @@ -487,6 +479,7 @@ renditionPtr pRendition; char *in_string; vgaHWPtr pvgaHW; + ModuleDescPtr pMod; #ifdef DEBUG ErrorF("Rendition: renditionPreInit() called\n"); @@ -517,10 +510,10 @@ pScreenInfo->monitor=pScreenInfo->confScreen->monitor; /* Initialize the card through int10 interface if needed */ - if (xf86LoadSubModule(pScreenInfo, "int10")){ + if ((pMod = xf86LoadSubModule(pScreenInfo, "int10"))){ xf86Int10InfoPtr pInt=NULL; - xf86LoaderReqSymLists(int10Symbols, NULL); + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, "Initializing int10\n"); pInt = xf86InitInt10(pRendition->pEnt->index); @@ -596,10 +589,10 @@ /* Load fb */ - if (!xf86LoadSubModule(pScreenInfo, "fb")) + if (!(pMod = xf86LoadSubModule(pScreenInfo, "fb"))) return FALSE; - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); /* determine colour weights */ pScreenInfo->rgbBits=8; @@ -645,10 +638,10 @@ renditionClockRange.clockIndex = -1; } - if (!xf86LoadSubModule(pScreenInfo, "vgahw")){ + if (!(pMod = xf86LoadSubModule(pScreenInfo, "vgahw"))){ return FALSE; } - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); if (!vgaHWGetHWRec(pScreenInfo)) return FALSE; @@ -730,12 +723,12 @@ if (xf86ReturnOptValBool(pRendition->Options, OPTION_SHADOW_FB,1)|| pRendition->board.rotate) { - if (!xf86LoadSubModule(pScreenInfo, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScreenInfo, "shadowfb"))) { xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, "Oops, \"ShadowFB\" module loading failed, disabling ShadowFB!\n"); } else{ - xf86LoaderReqSymLists(shadowfbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowfbSymbols, NULL); pRendition->board.shadowfb=TRUE; xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, "Using \"Shadow Framebuffer\"\n"); @@ -751,21 +744,21 @@ /* Load Ramdac module if needed */ if (!xf86ReturnOptValBool(pRendition->Options, OPTION_SW_CURSOR,0) && !pRendition->board.rotate){ - if (!xf86LoadSubModule(pScreenInfo, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScreenInfo, "ramdac"))) { return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } #if 0 /* Load DDC module if needed */ if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NO_DDC,0)){ - if (!xf86LoadSubModule(pScreenInfo, "ddc")) { + if (!(pMod = xf86LoadSubModule(pScreenInfo, "ddc"))) { xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, ("Loading of DDC library failed, skipping DDC-probe\n")); } else { - xf86LoaderReqSymLists(ddcSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); pScreenInfo->monitor->DDC = renditionDDC(pScreenInfo); } } @@ -776,13 +769,13 @@ #else /* Load DDC module if needed */ if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NO_DDC,0)){ - if (!xf86LoadSubModule(pScreenInfo, "ddc")) { + if (!(pMod = xf86LoadSubModule(pScreenInfo, "ddc"))) { xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, ("Loading of DDC library failed, skipping DDC-probe\n")); } else { xf86MonPtr mon; - xf86LoaderReqSymLists(ddcSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); mon = renditionProbeDDC(pScreenInfo, pRendition->pEnt->index); xf86PrintEDID(mon); xf86SetDDCproperties(pScreenInfo, mon); @@ -884,8 +877,8 @@ if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NOACCEL,0) && !pRendition->board.shadowfb) { /* Load XAA if needed */ - if (xf86LoadSubModule(pScreenInfo, "xaa")) { - xf86LoaderReqSymLists(xaaSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScreenInfo, "xaa"))) { + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); renditionMapMem(pScreenInfo); RENDITIONAccelPreInit (pScreenInfo); renditionUnmapMem(pScreenInfo); @@ -1463,13 +1456,14 @@ { vbeInfoPtr pVbe; xf86MonPtr mon = NULL; + ModuleDescPtr pMod; - if (xf86LoadSubModule(pScreenInfo, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols, NULL); - + if ((pMod = xf86LoadVBEModule(pScreenInfo))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); pVbe = VBEInit(NULL,index); mon = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } return mon; } Index: xc/programs/Xserver/hw/xfree86/drivers/rendition/vloaduc.c diff -u xc/programs/Xserver/hw/xfree86/drivers/rendition/vloaduc.c:1.14 xc/programs/Xserver/hw/xfree86/drivers/rendition/vloaduc.c:1.15 --- xc/programs/Xserver/hw/xfree86/drivers/rendition/vloaduc.c:1.14 Thu Nov 6 13:38:04 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/rendition/vloaduc.c Mon Aug 29 10:29:11 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vloaduc.c,v 1.14 2003/11/06 18:38:04 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vloaduc.c,v 1.15 2005/08/29 14:29:11 tsi Exp $ */ /* * includes */ @@ -15,8 +15,7 @@ * defines */ -#ifdef X_LITTLE_ENDIAN - +#if X_BYTE_ORDER == X_LITTLE_ENDIAN /* maybe swap word */ #define SW32(x) lswapl(x) #define SW16(x) lswaps(x) Index: xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h diff -u xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h:1.10 xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h:1.10 Thu Apr 4 09:05:45 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h Fri Oct 14 11:16:43 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h,v 1.10 2002/04/04 14:05:45 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h,v 1.11 2005/10/14 15:16:43 tsi Exp $ */ #ifndef _VTYPES_H_ #define _VTYPES_H_ @@ -8,7 +8,7 @@ * includes */ -#include "Xmd.h" +#include <X11/Xmd.h> #include "xf86Pci.h" Index: xc/programs/Xserver/hw/xfree86/drivers/s3/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/s3/Imakefile:1.13 xc/programs/Xserver/hw/xfree86/drivers/s3/Imakefile:1.17 --- xc/programs/Xserver/hw/xfree86/drivers/s3/Imakefile:1.13 Mon May 31 20:17:02 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/s3/Imakefile Fri Oct 14 11:16:43 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/Imakefile,v 1.13 2004/06/01 00:17:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/Imakefile,v 1.17 2005/10/14 15:16:43 tsi Exp $ */ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -58,20 +58,14 @@ s3_Ti.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/mfb \ - -I$(XF86SRC)/xaa -I$(SERVERSRC)/cfb \ - -I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \ - -I$(XF86SRC)/xf24_32bpp -I$(SERVERSRC)/Xext \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(XF86SRC)/xaa \ + -I$(SERVERSRC)/Xext -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ - -I$(XF86SRC)/fbdevhw -I$(XF86SRC)/ddc \ - -I$(XF86SRC)/i2c -I$(XF86SRC)/vbe \ - -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(FONTINCSRC) \ - -I$(EXTINCSRC) -I$(SERVERSRC)/render + -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ + -I$(SERVERSRC)/include -I$(SERVERSRC)/render #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/s3/newmmio.h diff -u xc/programs/Xserver/hw/xfree86/drivers/s3/newmmio.h:1.7 xc/programs/Xserver/hw/xfree86/drivers/s3/newmmio.h:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/s3/newmmio.h:1.7 Fri Feb 13 18:58:42 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/s3/newmmio.h Fri Oct 14 11:16:43 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/newmmio.h,v 1.7 2004/02/13 23:58:42 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/newmmio.h,v 1.8 2005/10/14 15:16:43 tsi Exp $ */ /* * @@ -52,7 +52,7 @@ #ifndef _NEWMMIO_H_ #define _NEWMMIO_H_ -#include <Xmd.h> +#include <X11/Xmd.h> #define int16 CARD16 Index: xc/programs/Xserver/hw/xfree86/drivers/s3/s3.h diff -u xc/programs/Xserver/hw/xfree86/drivers/s3/s3.h:1.19 xc/programs/Xserver/hw/xfree86/drivers/s3/s3.h:1.22 --- xc/programs/Xserver/hw/xfree86/drivers/s3/s3.h:1.19 Fri Nov 26 07:08:49 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/s3/s3.h Fri Oct 14 11:16:43 2005 @@ -24,7 +24,7 @@ * * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3.h,v 1.19 2004/11/26 12:08:49 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3.h,v 1.22 2005/10/14 15:16:43 tsi Exp $ */ #ifndef _S3_H @@ -35,12 +35,11 @@ #include "xf86PciInfo.h" #include "xf86RamDac.h" #include "xaa.h" -#include "vbe.h" #include "xf86_ansic.h" #include "vgaHW.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "fourcc.h" @@ -60,15 +59,15 @@ typedef struct { - unsigned char brightness; - unsigned char contrast; - FBAreaPtr area; - RegionRec clip; - CARD32 colorKey; - CARD32 videoStatus; - Time offTime; - Time freeTime; - int lastPort; + unsigned char brightness; + unsigned char contrast; + FBAreaPtr area; + RegionRec clip; + CARD32 colorKey; + CARD32 videoStatus; + Time offTime; + Time freeTime; + int lastPort; } S3PortPrivRec, *S3PortPrivPtr; @@ -83,17 +82,17 @@ typedef struct _S3Rec { - pciVideoPtr PciInfo; - PCITAG PciTag; - EntityInfoPtr pEnt; - unsigned long IOAddress; - unsigned long FBAddress; - unsigned char * FBBase; - unsigned char * MMIOBase; - unsigned long videoRam; - OptionInfoPtr Options; - unsigned int Flags; - Bool NoAccel; + pciVideoPtr PciInfo; + PCITAG PciTag; + EntityInfoPtr pEnt; + unsigned long IOAddress; + unsigned long FBAddress; + unsigned char * FBBase; + unsigned char * MMIOBase; + unsigned long videoRam; + OptionInfoPtr Options; + unsigned int Flags; + Bool NoAccel; Bool SWCursor; Bool SlowDRAMRefresh; Bool SlowDRAM; @@ -103,12 +102,10 @@ Bool PCIRetry; Bool ColorExpandBug; - XAAInfoRecPtr pXAA; + XAAInfoRecPtr pXAA; xf86CursorInfoPtr pCurs; - xf86Int10InfoPtr pInt10; - vbeInfoPtr pVBE; - XF86VideoAdaptorPtr adaptor; - S3PortPrivPtr portPrivate; + XF86VideoAdaptorPtr adaptor; + S3PortPrivPtr portPrivate; DGAModePtr DGAModes; int numDGAModes; @@ -126,7 +123,7 @@ int mclk, MaxClock; int pixMuxShift; - int Chipset, ChipRev; + int Chipset, ChipRev; int RefClock; int s3ScissB, s3ScissR; @@ -150,7 +147,7 @@ int *indicies, LOCO *colors, VisualPtr pVisual); - Bool (*CloseScreen)(int, ScreenPtr); + Bool (*CloseScreen)(int, ScreenPtr); unsigned char *imageBuffer; int imageWidth; @@ -167,7 +164,7 @@ #define VERSION_MINOR 3 #define PATCHLEVEL 5 #define S3_VERSION ((VERSION_MAJOR << 24) | \ - (VERSION_MINOR << 16) | PATCHLEVEL) + (VERSION_MINOR << 16) | PATCHLEVEL) @@ -229,9 +226,9 @@ */ #define S3_964_SERIES() ((pS3->Chipset == PCI_CHIP_964_0) || \ - (pS3->Chipset == PCI_CHIP_964_1)) + (pS3->Chipset == PCI_CHIP_964_1)) #define S3_TRIO_SERIES() ((pS3->Chipset == PCI_CHIP_TRIO) || \ - (pS3->Chipset == PCI_CHIP_AURORA64VP) || \ + (pS3->Chipset == PCI_CHIP_AURORA64VP) || \ (pS3->Chipset == PCI_CHIP_TRIO64UVP) || \ (pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX)) Index: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c:1.27 xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c:1.30 --- xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c:1.27 Tue Mar 15 16:39:20 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c Thu Mar 16 11:50:12 2006 @@ -34,7 +34,7 @@ * * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c,v 1.27 2005/03/15 21:39:20 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c,v 1.30 2006/03/16 16:50:12 dawes Exp $ */ #include "xf86.h" @@ -47,6 +47,7 @@ #include "xf86fbman.h" #include "xf86cmap.h" #include "xf86RAC.h" +#include "xf86int10.h" #include "compiler.h" #include "xaa.h" #include "mipointer.h" @@ -104,8 +105,8 @@ Bool S3SaveScreen(ScreenPtr pScreen, int mode); static void S3FreeScreen(int scrnIndex, int flags); static void S3GenericLoadPalette(ScrnInfoPtr pScrn, int numColors, - int *indicies, LOCO *colors, - VisualPtr pVisual); + int *indicies, LOCO *colors, + VisualPtr pVisual); static void S3Restore(ScrnInfoPtr pScrn); void S3BankZero(ScrnInfoPtr pScrn); void S3Regdump(ScrnInfoPtr pScrn); @@ -130,9 +131,9 @@ { PCI_CHIP_964_0, "964-0"}, { PCI_CHIP_964_1, "964-1"}, { PCI_CHIP_968, "968" }, - { PCI_CHIP_TRIO, "Trio32/64" }, + { PCI_CHIP_TRIO, "Trio32/64" }, { PCI_CHIP_AURORA64VP, "Aurora64V+" }, - { PCI_CHIP_TRIO64UVP, "Trio64UV+" }, + { PCI_CHIP_TRIO64UVP, "Trio64UV+" }, { PCI_CHIP_TRIO64V2_DXGX, "Trio64V2/DX/GX" }, { -1, NULL } }; @@ -141,12 +142,12 @@ static PciChipsets S3PciChipsets[] = { { PCI_CHIP_964_0, PCI_CHIP_964_0, RES_SHARED_VGA }, { PCI_CHIP_964_1, PCI_CHIP_964_1, RES_SHARED_VGA }, - { PCI_CHIP_968, PCI_CHIP_968, RES_SHARED_VGA }, - { PCI_CHIP_TRIO, PCI_CHIP_TRIO, RES_SHARED_VGA }, - { PCI_CHIP_AURORA64VP, PCI_CHIP_AURORA64VP, RES_SHARED_VGA }, - { PCI_CHIP_TRIO64UVP, PCI_CHIP_TRIO64UVP, RES_SHARED_VGA }, - { PCI_CHIP_TRIO64V2_DXGX, PCI_CHIP_TRIO64V2_DXGX, RES_SHARED_VGA }, - { -1, -1, RES_UNDEFINED } + { PCI_CHIP_968, PCI_CHIP_968, RES_SHARED_VGA }, + { PCI_CHIP_TRIO, PCI_CHIP_TRIO, RES_SHARED_VGA }, + { PCI_CHIP_AURORA64VP, PCI_CHIP_AURORA64VP, RES_SHARED_VGA }, + { PCI_CHIP_TRIO64UVP, PCI_CHIP_TRIO64UVP, RES_SHARED_VGA }, + { PCI_CHIP_TRIO64V2_DXGX, PCI_CHIP_TRIO64V2_DXGX, RES_SHARED_VGA }, + { -1, -1, RES_UNDEFINED } }; typedef enum { @@ -182,36 +183,26 @@ }; static const char *vgaHWSymbols[] = { - "vgaHWGetHWRec", - "vgaHWFreeHWRec", - "vgaHWGetIOBase", - "vgaHWSave", - "vgaHWProtect", - "vgaHWRestore", - "vgaHWMapMem", - "vgaHWUnmapMem", - "vgaHWSaveScreen", - "vgaHWLock", + "vgaHWGetHWRec", + "vgaHWFreeHWRec", + "vgaHWGetIOBase", + "vgaHWSave", + "vgaHWProtect", + "vgaHWRestore", + "vgaHWMapMem", + "vgaHWUnmapMem", + "vgaHWSaveScreen", + "vgaHWLock", "vgaHWInit", "vgaHWDPMSSet", "vgaHWHBlankKGA", - NULL -}; - -static const char *vbeSymbols[] = { - "VBEInit", - "vbeDoEDID", - "vbeFree", - NULL + NULL }; static const char *int10Symbols[] = { - "xf86ExecX86int10", - "xf86FreeInt10", - "xf86InitInt10", - "xf86Int10AllocPages", - "xf86Int10FreePages", - NULL + "xf86FreeInt10", + "xf86InitInt10", + NULL }; static const char *ramdacSymbols[] = { @@ -242,71 +233,70 @@ MODULESETUPPROTO(S3Setup); static XF86ModuleVersionInfo S3VersRec = { - "s3", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XF86_VERSION_CURRENT, - VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL, - ABI_CLASS_VIDEODRV, - ABI_VIDEODRV_VERSION, - MOD_CLASS_VIDEODRV, - {0, 0, 0, 0} + "s3", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL, + ABI_CLASS_VIDEODRV, + ABI_VIDEODRV_VERSION, + MOD_CLASS_VIDEODRV, + {0, 0, 0, 0} }; XF86ModuleData s3ModuleData = { &S3VersRec, S3Setup, NULL }; -pointer S3Setup (pointer module, pointer opts, int *errmaj, int *errmin) +pointer S3Setup (ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; - if (!setupDone) { - setupDone = TRUE; - xf86AddDriver(&S3, module, 0); - LoaderRefSymLists(vgaHWSymbols, - vbeSymbols, int10Symbols, ramdacSymbols, - fbSymbols, xaaSymbols, - NULL); - return (pointer) 1; - } else { - if (errmaj) - *errmaj = LDR_ONCEONLY; - return NULL; - } -} + if (!setupDone) { + setupDone = TRUE; + xf86AddDriver(&S3, module, 0); + LoaderModRefSymLists(module, vgaHWSymbols, int10Symbols, + ramdacSymbols, fbSymbols, xaaSymbols, + NULL); + return (pointer) 1; + } else { + if (errmaj) + *errmaj = LDR_ONCEONLY; + return NULL; + } +} #endif /* XFree86LOADER */ static Bool S3GetRec(ScrnInfoPtr pScrn) -{ - if (pScrn->driverPrivate) - return TRUE; - - pScrn->driverPrivate = xnfcalloc(sizeof(S3Rec), 1); - - return TRUE; +{ + if (pScrn->driverPrivate) + return TRUE; + + pScrn->driverPrivate = xnfcalloc(sizeof(S3Rec), 1); + + return TRUE; } - + static void S3FreeRec(ScrnInfoPtr pScrn) { - if (!pScrn->driverPrivate) - return; + if (!pScrn->driverPrivate) + return; - xfree(pScrn->driverPrivate); - pScrn->driverPrivate = NULL; + xfree(pScrn->driverPrivate); + pScrn->driverPrivate = NULL; } static const OptionInfoRec * S3AvailableOptions(int chipid, int busid) { - return S3Options; + return S3Options; } - + static void S3Identify(int flags) { - xf86PrintChipsets("S3", "driver (version " DRIVER_VERSION " for S3 chipset", - S3Chipsets); + xf86PrintChipsets("S3", "driver (version " DRIVER_VERSION " for S3 chipset", + S3Chipsets); } static Bool S3Probe(DriverPtr drv, int flags) @@ -317,7 +307,7 @@ /* sanity check */ if ((numDevSections = xf86MatchDevice("s3", &devSections)) <= 0) - return FALSE; + return FALSE; /* XXX do ISA later... some day in the distant future... */ numUsed = xf86MatchPciInstances("s3", PCI_VENDOR_S3, @@ -337,25 +327,25 @@ pScrn->driverVersion = VERSION_MAJOR; pScrn->driverName = DRIVER_NAME; - pScrn->name = "s3"; - pScrn->Probe = S3Probe; - pScrn->PreInit = S3PreInit; - pScrn->ScreenInit = S3ScreenInit; - pScrn->SwitchMode = S3SwitchMode; - pScrn->AdjustFrame = S3AdjustFrame; - pScrn->EnterVT = S3EnterVT; - pScrn->LeaveVT = S3LeaveVT; + pScrn->name = "s3"; + pScrn->Probe = S3Probe; + pScrn->PreInit = S3PreInit; + pScrn->ScreenInit = S3ScreenInit; + pScrn->SwitchMode = S3SwitchMode; + pScrn->AdjustFrame = S3AdjustFrame; + pScrn->EnterVT = S3EnterVT; + pScrn->LeaveVT = S3LeaveVT; pScrn->FreeScreen = S3FreeScreen; foundScreen = TRUE; - xf86ConfigActivePciEntity(pScrn, usedChips[i], S3PciChipsets, - NULL, NULL, NULL, NULL, NULL); - } - - xfree(usedChips); - - return foundScreen; + xf86ConfigActivePciEntity(pScrn, usedChips[i], S3PciChipsets, + NULL, NULL, NULL, NULL, NULL); + } + + xfree(usedChips); + + return foundScreen; } static Bool S3PreInit(ScrnInfoPtr pScrn, int flags) @@ -368,71 +358,72 @@ Gamma gzeros = {0.0, 0.0, 0.0}; int i, vgaCRIndex, vgaCRReg; unsigned char tmp; + ModuleDescPtr pMod; + + if (flags & PROBE_DETECT) + return FALSE; + + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) + return FALSE; + + xf86LoaderModReqSymLists(pMod, vgaHWSymbols, NULL); + + if (!vgaHWGetHWRec(pScrn)) + return FALSE; + + hwp = VGAHWPTR(pScrn); + vgaHWGetIOBase(hwp); - if (flags & PROBE_DETECT) - return FALSE; - - if (!xf86LoadSubModule(pScrn, "vgahw")) - return FALSE; - - xf86LoaderReqSymLists(vgaHWSymbols, NULL); - - if (!vgaHWGetHWRec(pScrn)) - return FALSE; - - hwp = VGAHWPTR(pScrn); - vgaHWGetIOBase(hwp); - - pScrn->monitor = pScrn->confScreen->monitor; - - if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | Support32bppFb)) - return FALSE; - - switch (pScrn->depth) { - case 8: - case 15: - case 16: - case 24: - /* OK */ - break; - default: - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Given depth (%d) is not supported by this driver\n", - pScrn->depth); - return FALSE; - } - - xf86PrintDepthBpp(pScrn); - - if (pScrn->depth > 8) { - if (!xf86SetWeight(pScrn, zeros, zeros)) - return FALSE; - } - - if (!xf86SetDefaultVisual(pScrn, -1)) - return FALSE; - - pScrn->progClock = TRUE; - - if (!S3GetRec(pScrn)) - return FALSE; + pScrn->monitor = pScrn->confScreen->monitor; + + if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | Support32bppFb)) + return FALSE; + + switch (pScrn->depth) { + case 8: + case 15: + case 16: + case 24: + /* OK */ + break; + default: + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Given depth (%d) is not supported by this driver\n", + pScrn->depth); + return FALSE; + } + + xf86PrintDepthBpp(pScrn); + + if (pScrn->depth > 8) { + if (!xf86SetWeight(pScrn, zeros, zeros)) + return FALSE; + } + + if (!xf86SetDefaultVisual(pScrn, -1)) + return FALSE; + + pScrn->progClock = TRUE; + + if (!S3GetRec(pScrn)) + return FALSE; pS3 = S3PTR(pScrn); pS3->s3Bpp = (pScrn->bitsPerPixel >> 3); - xf86CollectOptions(pScrn, NULL); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, S3Options); - - if (xf86ReturnOptValBool(S3Options, OPTION_NOACCEL, FALSE)) { - pS3->NoAccel = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - acceleration disabled\n"); - } else - pS3->NoAccel = FALSE; + xf86CollectOptions(pScrn, NULL); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, S3Options); + + if (xf86ReturnOptValBool(S3Options, OPTION_NOACCEL, FALSE)) { + pS3->NoAccel = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - acceleration disabled\n"); + } else + pS3->NoAccel = FALSE; if (xf86ReturnOptValBool(S3Options, OPTION_SWCURS, FALSE)) { pS3->SWCursor = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: SWCursor - using software cursor\n"); - } else + } else pS3->SWCursor = FALSE; if (xf86ReturnOptValBool(S3Options, OPTION_SLOW_DRAM_REFRESH, FALSE)) { pS3->SlowDRAMRefresh = TRUE; @@ -455,63 +446,61 @@ } else pS3->SlowVRAM = FALSE; - if (pScrn->numEntities > 1) { - S3FreeRec(pScrn); - return FALSE; - } - - pEnt = xf86GetEntityInfo(pScrn->entityList[0]); - if (pEnt->resources) { - xfree(pEnt); - S3FreeRec(pScrn); - return FALSE; - } - - if (xf86LoadSubModule(pScrn, "int10")) { - xf86LoaderReqSymLists(int10Symbols, NULL); - pS3->pInt10 = xf86InitInt10(pEnt->index); - } - - if (xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols, NULL); - pS3->pVBE = VBEInit(pS3->pInt10, pEnt->index); + if (pScrn->numEntities > 1) { + S3FreeRec(pScrn); + return FALSE; } - + + pEnt = xf86GetEntityInfo(pScrn->entityList[0]); + if (pEnt->resources) { + xfree(pEnt); + S3FreeRec(pScrn); + return FALSE; + } + + if ((pMod = xf86LoadSubModule(pScrn, "int10"))) { + xf86Int10InfoPtr pInt10; + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); + pInt10 = xf86InitInt10(pEnt->index); + if (pInt10) + xf86FreeInt10(pInt10); + } + if (!xf86SetGamma(pScrn, gzeros)) return FALSE; - pS3->PciInfo = xf86GetPciInfoForEntity(pEnt->index); - xf86RegisterResources(pEnt->index, NULL, ResNone); + pS3->PciInfo = xf86GetPciInfoForEntity(pEnt->index); + xf86RegisterResources(pEnt->index, NULL, ResNone); /* don't disable PIO funcs */ - xf86SetOperatingState(resVgaMemShared, pEnt->index, ResDisableOpr); + xf86SetOperatingState(resVgaMemShared, pEnt->index, ResDisableOpr); - if (pEnt->device->chipset && *pEnt->device->chipset) { - pScrn->chipset = pEnt->device->chipset; - pS3->Chipset = xf86StringToToken(S3Chipsets, pScrn->chipset); - } else if (pEnt->device->chipID >= 0) { - pS3->Chipset = pEnt->device->chipID; - pScrn->chipset = (char *)xf86TokenToString(S3Chipsets, - pS3->Chipset); - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n", - pS3->Chipset); - } else { - pS3->Chipset = pS3->PciInfo->chipType; - pScrn->chipset = (char *)xf86TokenToString(S3Chipsets, - pS3->Chipset); - } - if (pEnt->device->chipRev >= 0) { - pS3->ChipRev = pEnt->device->chipRev; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n", - pS3->ChipRev); - } else - pS3->ChipRev = pS3->PciInfo->chipRev; - - xfree(pEnt); - - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Chipset: \"%s\"\n", pScrn->chipset); - - pS3->PciTag = pciTag(pS3->PciInfo->bus, pS3->PciInfo->device, - pS3->PciInfo->func); + if (pEnt->device->chipset && *pEnt->device->chipset) { + pScrn->chipset = pEnt->device->chipset; + pS3->Chipset = xf86StringToToken(S3Chipsets, pScrn->chipset); + } else if (pEnt->device->chipID >= 0) { + pS3->Chipset = pEnt->device->chipID; + pScrn->chipset = (char *)xf86TokenToString(S3Chipsets, + pS3->Chipset); + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n", + pS3->Chipset); + } else { + pS3->Chipset = pS3->PciInfo->chipType; + pScrn->chipset = (char *)xf86TokenToString(S3Chipsets, + pS3->Chipset); + } + if (pEnt->device->chipRev >= 0) { + pS3->ChipRev = pEnt->device->chipRev; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n", + pS3->ChipRev); + } else + pS3->ChipRev = pS3->PciInfo->chipRev; + + xfree(pEnt); + + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Chipset: \"%s\"\n", pScrn->chipset); + + pS3->PciTag = pciTag(pS3->PciInfo->bus, pS3->PciInfo->device, + pS3->PciInfo->func); switch (pS3->Chipset) { case PCI_CHIP_964_0: @@ -575,7 +564,7 @@ { outb (0x3d4, 0x86); outb (0x3d5, 0x80); - + outb (0x3d4, 0x90); outb (0x3d5, 0x00); } @@ -612,9 +601,9 @@ "videoRam = %d Kb\n", pScrn->videoRam); } - if (!xf86LoadSubModule(pScrn, "ramdac")) + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) return FALSE; - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); pScrn->rgbBits = 8; /* set default */ @@ -666,7 +655,7 @@ pS3->MaxClock = 50000; break; } - pScrn->rgbBits = 6; + pScrn->rgbBits = 6; pS3->LoadPalette = S3GenericLoadPalette; } @@ -696,41 +685,42 @@ clockRanges->clockIndex = -1; clockRanges->interlaceAllowed = TRUE; /* not yet */ clockRanges->doubleScanAllowed = TRUE; /* not yet */ - - i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, - pScrn->display->modes, clockRanges, - pS3->NoAccel ? NULL : s3AccelLinePitches, + + i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, + pScrn->display->modes, clockRanges, + pS3->NoAccel ? NULL : s3AccelLinePitches, 256, 2048, pScrn->bitsPerPixel, 128, 2048, pScrn->display->virtualX, pScrn->display->virtualY, pScrn->videoRam * 1024, - LOOKUP_BEST_REFRESH); + LOOKUP_BEST_REFRESH); + + if (i == -1) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "no valid modes left\n"); + S3FreeRec(pScrn); + return FALSE; + } + + xf86PruneDriverModes(pScrn); + + if (i == 0 || pScrn->modes == NULL) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "no valid modes found\n"); + S3FreeRec(pScrn); + return FALSE; + } + + xf86SetCrtcForModes(pScrn, 0); + pScrn->currentMode = pScrn->modes; + xf86PrintModes(pScrn); + xf86SetDpi(pScrn, 0, 0); - if (i == -1) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "no valid modes left\n"); - S3FreeRec(pScrn); - return FALSE; - } - - xf86PruneDriverModes(pScrn); - - if (i == 0 || pScrn->modes == NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "no valid modes found\n"); - S3FreeRec(pScrn); - return FALSE; - } - - xf86SetCrtcForModes(pScrn, 0); - pScrn->currentMode = pScrn->modes; - xf86PrintModes(pScrn); - xf86SetDpi(pScrn, 0, 0); - - xf86LoadSubModule(pScrn, "fb"); - xf86LoaderReqSymLists(fbSymbols, NULL); + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) + return FALSE; + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); - if (!xf86LoadSubModule(pScrn, "xaa")) + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) return FALSE; - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); return TRUE; } @@ -759,51 +749,51 @@ S3Regdump(pScrn); #endif pScrn->vtSema = TRUE; - + S3SaveScreen(pScreen, SCREEN_SAVER_ON); - miClearVisualTypes(); - if (pScrn->bitsPerPixel > 8) { - if (!miSetVisualTypes(pScrn->depth, TrueColorMask, - pScrn->rgbBits, pScrn->defaultVisual)) - return FALSE; - } else { - if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), - pScrn->rgbBits, pScrn->defaultVisual)) - return FALSE; - } - - miSetPixmapDepths (); - - if (!fbScreenInit(pScreen, pS3->FBBase, pScrn->virtualX, - pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth, pScrn->bitsPerPixel)) - return FALSE; - - xf86SetBlackWhitePixels(pScreen); - - if (pScrn->bitsPerPixel > 8) { - VisualPtr pVis; - - pVis = pScreen->visuals + pScreen->numVisuals; - while (--pVis >= pScreen->visuals) { - if ((pVis->class | DynamicClass) == DirectColor) { - pVis->offsetRed = pScrn->offset.red; - pVis->offsetGreen = pScrn->offset.green; - pVis->offsetBlue = pScrn->offset.blue; - pVis->redMask = pScrn->mask.red; - pVis->greenMask = pScrn->mask.green; - pVis->blueMask = pScrn->mask.blue; - } - } - } + miClearVisualTypes(); + if (pScrn->bitsPerPixel > 8) { + if (!miSetVisualTypes(pScrn->depth, TrueColorMask, + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; + } else { + if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; + } + + miSetPixmapDepths (); + + if (!fbScreenInit(pScreen, pS3->FBBase, pScrn->virtualX, + pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth, pScrn->bitsPerPixel)) + return FALSE; + + xf86SetBlackWhitePixels(pScreen); + + if (pScrn->bitsPerPixel > 8) { + VisualPtr pVis; + + pVis = pScreen->visuals + pScreen->numVisuals; + while (--pVis >= pScreen->visuals) { + if ((pVis->class | DynamicClass) == DirectColor) { + pVis->offsetRed = pScrn->offset.red; + pVis->offsetGreen = pScrn->offset.green; + pVis->offsetBlue = pScrn->offset.blue; + pVis->redMask = pScrn->mask.red; + pVis->greenMask = pScrn->mask.green; + pVis->blueMask = pScrn->mask.blue; + } + } + } fbPictureInit (pScreen, 0, 0); S3DGAInit(pScreen); - miInitializeBackingStore(pScreen); - xf86SetBackingStore(pScreen); + miInitializeBackingStore(pScreen); + xf86SetBackingStore(pScreen); if (!pS3->NoAccel) { if (pS3->S3NewMMIO) { @@ -827,7 +817,7 @@ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Acceleration disabled by option\n"); } - miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); + miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); /* hw cursor setup */ if (pS3->CursorInit) { @@ -843,19 +833,19 @@ - if (!miCreateDefColormap(pScreen)) - return FALSE; + if (!miCreateDefColormap(pScreen)) + return FALSE; - if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits, + if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits, pS3->LoadPalette, NULL, - CMAP_RELOAD_ON_MODE_SWITCH)) - return FALSE; + CMAP_RELOAD_ON_MODE_SWITCH)) + return FALSE; vgaHWBlankScreen(pScrn, FALSE); - pScreen->SaveScreen = S3SaveScreen; - pS3->CloseScreen = pScreen->CloseScreen; - pScreen->CloseScreen = S3CloseScreen; + pScreen->SaveScreen = S3SaveScreen; + pS3->CloseScreen = pScreen->CloseScreen; + pScreen->CloseScreen = S3CloseScreen; xf86DPMSInit(pScreen, S3DisplayPowerManagementSet, 0); @@ -866,9 +856,9 @@ #if 0 S3InitVideo(pScreen); #endif - - return TRUE; -} + + return TRUE; +} @@ -878,7 +868,7 @@ S3Ptr pS3 = S3PTR(pScrn); S3RegPtr save = &pS3->SavedRegs; vgaHWPtr hwp = VGAHWPTR(pScrn); - vgaRegPtr pVga = &hwp->SavedReg; + vgaRegPtr pVga = &hwp->SavedReg; int vgaCRIndex = pS3->vgaCRIndex, vgaCRReg = pS3->vgaCRReg; int i; unsigned char cr5c = 0; @@ -934,7 +924,7 @@ } if (pS3->RamDac->RamDacType == TI3025_RAMDAC) - save->s3syssave[0x0c + 16] = cr5c; + save->s3syssave[0x0c + 16] = cr5c; for(i=32; i<46; i++) { outb(vgaCRIndex, 0x40 + i); @@ -951,58 +941,58 @@ static void S3FreeScreen(int scrnIndex, int flags) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - - vgaHWFreeHWRec(pScrn); - - S3FreeRec(pScrn); + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + + vgaHWFreeHWRec(pScrn); + + S3FreeRec(pScrn); } Bool S3CloseScreen(int scrnIndex, ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - S3Ptr pS3 = S3PTR(pScrn); - vgaHWPtr hwp = VGAHWPTR(pScrn); + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + S3Ptr pS3 = S3PTR(pScrn); + vgaHWPtr hwp = VGAHWPTR(pScrn); - if (pScrn->vtSema) { - vgaHWUnlock(hwp); + if (pScrn->vtSema) { + vgaHWUnlock(hwp); S3Restore(pScrn); - vgaHWLock(hwp); - S3UnmapMem(pScrn); - } + vgaHWLock(hwp); + S3UnmapMem(pScrn); + } if (pS3->DGAModes) xfree(pS3->DGAModes); pS3->DGAModes = NULL; - pScrn->vtSema = FALSE; - pScreen->CloseScreen = pS3->CloseScreen; - - return (*pScreen->CloseScreen)(scrnIndex, pScreen); + pScrn->vtSema = FALSE; + pScreen->CloseScreen = pS3->CloseScreen; + + return (*pScreen->CloseScreen)(scrnIndex, pScreen); } Bool S3SwitchMode(int scrnIndex, DisplayModePtr mode, int flags) -{ +{ return S3ModeInit(xf86Screens[scrnIndex], mode); } static void S3GenericLoadPalette(ScrnInfoPtr pScrn, int numColors, - int *indicies, LOCO *colors, - VisualPtr pVisual) -{ - int i, index; - - for (i=0; i<numColors; i++) { - index = indicies[i]; - outb(0x3c8, index); - outb(0x3c9, colors[index].red); - outb(0x3c9, colors[index].green); - outb(0x3c9, colors[index].blue); - } + int *indicies, LOCO *colors, + VisualPtr pVisual) +{ + int i, index; + + for (i=0; i<numColors; i++) { + index = indicies[i]; + outb(0x3c8, index); + outb(0x3c9, colors[index].red); + outb(0x3c9, colors[index].green); + outb(0x3c9, colors[index].blue); + } } @@ -1057,9 +1047,9 @@ if (pS3->Chipset == PCI_CHIP_968) shift = 1; /* XXX IBMRGB */ - else if (pS3->Chipset == PCI_CHIP_TRIO || - pS3->Chipset == PCI_CHIP_TRIO64UVP || - pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX) + else if (pS3->Chipset == PCI_CHIP_TRIO || + pS3->Chipset == PCI_CHIP_TRIO64UVP || + pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX) shift = -(pS3->s3Bpp >> 1); return shift; @@ -1069,12 +1059,12 @@ { S3Ptr pS3 = S3PTR(pScrn); S3RegPtr new = &pS3->ModeRegs; - vgaHWPtr hwp = VGAHWPTR(pScrn); - vgaRegPtr pVga = &hwp->ModeReg; - int vgaCRIndex = pS3->vgaCRIndex, vgaCRReg = pS3->vgaCRReg; + vgaHWPtr hwp = VGAHWPTR(pScrn); + vgaRegPtr pVga = &hwp->ModeReg; + int vgaCRIndex = pS3->vgaCRIndex, vgaCRReg = pS3->vgaCRReg; int vgaIOBase = hwp->IOBase; int interlacedived = mode->Flags & V_INTERLACE ? 1 : 0; - CARD32 HBlankEnd; + CARD32 HBlankEnd; int r, n, m; unsigned char tmp; @@ -1090,7 +1080,7 @@ if (mode->HTotal == mode->CrtcHTotal) { if (pS3->pixMuxShift > 0) { /* XXX hack */ -/* mode->Flags |= V_PIXMUX; */ +/* mode->Flags |= V_PIXMUX; */ mode->CrtcHTotal >>= pS3->pixMuxShift; mode->CrtcHDisplay >>= pS3->pixMuxShift; @@ -1100,7 +1090,7 @@ mode->CrtcHBlankStart >>= pS3->pixMuxShift; mode->CrtcHBlankEnd >>= pS3->pixMuxShift; } else if (pS3->pixMuxShift < 0) { -/* mode->Flags |= V_PIXMUX; */ +/* mode->Flags |= V_PIXMUX; */ mode->CrtcHTotal <<= -pS3->pixMuxShift; mode->CrtcHDisplay <<= -pS3->pixMuxShift; @@ -1198,7 +1188,7 @@ (pS3->Chipset == PCI_CHIP_964_1)) new->cr33 = 0x20; outb(vgaCRReg, new->cr33); - + new->cr34 = 0x10; outb(vgaCRIndex, 0x34); outb(vgaCRReg, new->cr34); @@ -1523,7 +1513,7 @@ pScrn->AdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); - vgaHWProtect(pScrn, FALSE); + vgaHWProtect(pScrn, FALSE); if (pScrn->displayWidth == 1024) outw(ADVFUNC_CNTL, 0x0007); @@ -1537,7 +1527,7 @@ inw(SUBSYS_STAT); - outw(0xbee8, 0x5000 | 0x0004 | 0x000c); + outw(0xbee8, 0x5000 | 0x0004 | 0x000c); outb(0x3c6, 0xff); @@ -1569,7 +1559,7 @@ outb(vgaCRIndex, 0x6f); #if 0 - if (((pScrn->bitsPerPixel == 16) || + if (((pScrn->bitsPerPixel == 16) || (pScrn->bitsPerPixel == 24)) && (pS3->S3NewMMIO)) S3InitStreams(pScrn, mode); #endif @@ -1579,24 +1569,24 @@ static Bool S3EnterVT(int scrnIndex, int flags) -{ - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - vgaHWPtr hwp = VGAHWPTR(pScrn); - - vgaHWUnlock(hwp); - if (!S3ModeInit(pScrn, pScrn->currentMode)) - return FALSE; - - return TRUE; -} +{ + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + vgaHWPtr hwp = VGAHWPTR(pScrn); + + vgaHWUnlock(hwp); + if (!S3ModeInit(pScrn, pScrn->currentMode)) + return FALSE; + + return TRUE; +} static void S3Restore(ScrnInfoPtr pScrn) { - S3Ptr pS3 = S3PTR(pScrn); - S3RegPtr restore = &pS3->SavedRegs; - vgaHWPtr hwp = VGAHWPTR(pScrn); - int vgaCRIndex = pS3->vgaCRIndex, vgaCRReg = pS3->vgaCRReg; + S3Ptr pS3 = S3PTR(pScrn); + S3RegPtr restore = &pS3->SavedRegs; + vgaHWPtr hwp = VGAHWPTR(pScrn); + int vgaCRIndex = pS3->vgaCRIndex, vgaCRReg = pS3->vgaCRReg; int i; vgaHWProtect(pScrn, TRUE); @@ -1654,7 +1644,7 @@ for(i=4; i<8; i++) outb(vgaCRReg, restore->color_stack[i]); - vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_ALL); + vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_ALL); outb(0x3c2, restore->clock); @@ -1665,22 +1655,22 @@ static void S3LeaveVT(int scrnIndex, int flags) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - vgaHWPtr hwp = VGAHWPTR(pScrn); + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + vgaHWPtr hwp = VGAHWPTR(pScrn); - S3Restore(pScrn); - vgaHWLock(hwp); + S3Restore(pScrn); + vgaHWLock(hwp); - return; -} + return; +} static void S3AdjustFrame(int scrnIndex, int x, int y, int flags) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - S3Ptr pS3 = S3PTR(pScrn); + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + S3Ptr pS3 = S3PTR(pScrn); S3RegPtr regs = &pS3->ModeRegs; - int vgaCRIndex = pS3->vgaCRIndex, vgaCRReg = pS3->vgaCRReg; + int vgaCRIndex = pS3->vgaCRIndex, vgaCRReg = pS3->vgaCRReg; int base, orig_base; unsigned char tmp; @@ -1721,8 +1711,8 @@ void S3Regdump(ScrnInfoPtr pScrn) { - S3Ptr pS3 = S3PTR(pScrn); - int vgaCRIndex = pS3->vgaCRIndex, vgaCRReg = pS3->vgaCRReg; + S3Ptr pS3 = S3PTR(pScrn); + int vgaCRIndex = pS3->vgaCRIndex, vgaCRReg = pS3->vgaCRReg; #if 1 outb(vgaCRIndex, 0x31); @@ -1771,7 +1761,7 @@ ErrorF("cr5d = 0x%x\n", inb(vgaCRReg)); outb(vgaCRIndex, 0x5e); ErrorF("cr5e = 0x%x\n", inb(vgaCRReg)); - + outb(vgaCRIndex, 0x60); ErrorF("cr60 = 0x%x\n", inb(vgaCRReg)); outb(vgaCRIndex, 0x61); @@ -1817,9 +1807,9 @@ void S3BankZero(ScrnInfoPtr pScrn) { - S3Ptr pS3 = S3PTR(pScrn); + S3Ptr pS3 = S3PTR(pScrn); unsigned char tmp; - int vgaCRIndex = pS3->vgaCRIndex, vgaCRReg = pS3->vgaCRReg; + int vgaCRIndex = pS3->vgaCRIndex, vgaCRReg = pS3->vgaCRReg; outb(vgaCRIndex, 0x35); tmp = inb(vgaCRReg) & 0xf0; Index: xc/programs/Xserver/hw/xfree86/drivers/s3virge/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/s3virge/Imakefile:1.24 xc/programs/Xserver/hw/xfree86/drivers/s3virge/Imakefile:1.26 --- xc/programs/Xserver/hw/xfree86/drivers/s3virge/Imakefile:1.24 Thu Mar 18 02:06:47 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/s3virge/Imakefile Fri Oct 14 11:16:43 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/Imakefile,v 1.24 2004/03/18 07:06:47 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/Imakefile,v 1.26 2005/10/14 15:16:43 tsi Exp $ /* * * Copyright 1995-1998 The XFree86 Project, Inc. @@ -60,19 +60,14 @@ DEFINES = -DPSZ=8 #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa \ - -I$(SERVERSRC)/fb \ - -I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \ - -I$(XF86SRC)/xf24_32bpp -I$(SERVERSRC)/Xext \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/mi -I$(XF86SRC)/xaa -I$(SERVERSRC)/fb \ + -I$(SERVERSRC)/Xext -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ - -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(FONTINCSRC) \ - -I$(EXTINCSRC) -I$(XF86SRC)/vbe -I$(XF86SRC)/shadowfb \ + -I$(SERVERSRC)/include -I$(XF86SRC)/vbe -I$(XF86SRC)/shadowfb \ -I$(SERVERSRC)/render #endif Index: xc/programs/Xserver/hw/xfree86/drivers/s3virge/newmmio.h diff -u xc/programs/Xserver/hw/xfree86/drivers/s3virge/newmmio.h:1.6 xc/programs/Xserver/hw/xfree86/drivers/s3virge/newmmio.h:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/s3virge/newmmio.h:1.6 Fri Feb 13 18:58:43 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/s3virge/newmmio.h Fri Oct 14 11:16:43 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/newmmio.h,v 1.6 2004/02/13 23:58:43 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/newmmio.h,v 1.7 2005/10/14 15:16:43 tsi Exp $ */ /* * Copyright (C) 1994-1999 The XFree86 Project, Inc. @@ -72,9 +72,7 @@ #define S3_NEWMMIO_REGSIZE 0x10000 /* 64KB */ #define S3V_MMIO_REGSIZE 0x8000 /* 32KB */ - -/* #include <Xmd.h> */ - +#include <X11/Xmd.h> #define int16 CARD16 #define int32 CARD32 Index: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h diff -u xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h:1.33 xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h:1.35 --- xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h:1.33 Mon Mar 29 11:25:18 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h Fri Oct 14 11:16:43 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h,v 1.33 2004/03/29 16:25:18 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h,v 1.35 2005/10/14 15:16:43 tsi Exp $ */ /* * Copyright (C) 1994-1999 The XFree86 Project, Inc. @@ -78,19 +78,6 @@ /* All drivers using the mi colormap manipulation need this */ #include "micmap.h" -/* Drivers using cfb need this */ - -#define PSZ 8 -#include "cfb.h" -#undef PSZ - -/* Drivers supporting bpp 16, 24 or 32 with cfb need these */ - -#include "cfb16.h" -#include "cfb24.h" -#include "cfb32.h" -#include "cfb24_32.h" - /* fb support */ #include "fb.h" @@ -103,7 +90,7 @@ #include "vbe.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "fourcc.h" #ifndef _S3V_VGAHWMMIO_H Index: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_accel.c:1.27 xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_accel.c:1.29 --- xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_accel.c:1.27 Mon Mar 29 11:25:18 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_accel.c Wed Mar 1 16:01:55 2006 @@ -1,7 +1,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_accel.c,v 1.27 2004/03/29 16:25:18 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_accel.c,v 1.29 2006/03/01 21:01:55 dawes Exp $ */ /* - * Copyright (C) 1994-1999 The XFree86 Project, Inc. + * Copyright (C) 1994-2006 The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -72,6 +72,7 @@ unsigned int, int); static void S3VSubsequentScreenToScreenCopy(ScrnInfoPtr, int, int, int, int, int, int); +#ifndef __alpha__ static void S3VSetupForCPUToScreenColorExpand(ScrnInfoPtr, int, int, int, unsigned int); static void S3VSubsequentCPUToScreenColorExpand(ScrnInfoPtr, int, int, int, @@ -79,16 +80,10 @@ static void S3VSetupForImageWrite(ScrnInfoPtr, int, unsigned int, int, int, int); static void S3VSubsequentImageWriteRect(ScrnInfoPtr, int, int, int, int, int); +#endif static void S3VSubsequentSolidHorVertLine(ScrnInfoPtr, int, int, int, int); static void S3VSubsequentSolidHorVertLinePlaneMask(ScrnInfoPtr, int, int, int, int); -#if 0 -static void S3VSubsequentSolidBresenhamLine(ScrnInfoPtr, int, int, int, - int, int, int, int); -static void S3VPolylinesThinSolidWrapper(DrawablePtr, GCPtr, int, int, - DDXPointPtr); -static void S3VPolySegmentThinSolidWrapper(DrawablePtr, GCPtr, int, xSegment*); -#endif static void S3VNopAllCmdSets(ScrnInfoPtr pScrn); @@ -193,26 +188,6 @@ infoPtr->SetupForImageWrite = S3VSetupForImageWrite; infoPtr->SubsequentImageWriteRect = S3VSubsequentImageWriteRect; - /* on alpha, I see corruption in the xscreensaver program "hypercube" - as the line acceleration is just stubs, it loses us nothing to - disable it on alphas */ - - /* Lines */ -#if 0 - /* Bresenham lines are broken when passed through fb to xaa - so I pulled all the line functions. This shouldn't hurt us - a whole lot, since the Subsequent..Bresen stuff doesn't have - any hardware accel yet anyway... And xaa will do horiz/vert - lines with the rect fill (like we are doing here) anyway. - KJB 9/11/00 - */ - infoPtr->SetupForSolidLine = S3VSetupForSolidFill; - infoPtr->SubsequentSolidHorVertLine = S3VSubsequentSolidHorVertLine; - infoPtr->SubsequentSolidBresenhamLine = S3VSubsequentSolidBresenhamLine; - infoPtr->PolySegmentThinSolid = S3VPolySegmentThinSolidWrapper; - infoPtr->PolylinesThinSolid = S3VPolylinesThinSolidWrapper; -#endif - #endif /* !__alpha__ */ /* And these are screen parameters used to setup the GE */ @@ -785,6 +760,7 @@ \*********************************/ +#ifndef __alpha__ static void S3VSetupForCPUToScreenColorExpand( ScrnInfoPtr pScrn, @@ -888,6 +864,7 @@ WAITCMD(); OUTREG(RDEST_XY, (x << 16) | y); } +#endif /* !__alpha__ */ /***********\ @@ -895,45 +872,6 @@ \***********/ -#if 0 /* Some line funcs are disabled at the moment */ - -static void -S3VPolylinesThinSolidWrapper( - DrawablePtr pDraw, - GCPtr pGC, - int mode, - int npt, - DDXPointPtr pPts -){ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - S3VPtr ps3v = S3VPTR(infoRec->pScrn); - ps3v->CurrentGC = pGC; - /* fb support */ - ps3v->CurrentDrawable = pDraw; - if(infoRec->NeedToSync) - S3VAccelSync(infoRec->pScrn); - XAAPolyLines(pDraw, pGC, mode, npt, pPts); -} - -static void -S3VPolySegmentThinSolidWrapper( - DrawablePtr pDraw, - GCPtr pGC, - int nseg, - xSegment *pSeg -){ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - S3VPtr ps3v = S3VPTR(infoRec->pScrn); - ps3v->CurrentGC = pGC; - /* fb support */ - ps3v->CurrentDrawable = pDraw; - if(infoRec->NeedToSync) - S3VAccelSync(infoRec->pScrn); - XAAPolySegment(pDraw, pGC, nseg, pSeg); -} - -#endif - static void S3VSubsequentSolidHorVertLine( ScrnInfoPtr pScrn, @@ -983,89 +921,6 @@ } -#if 0 /* Line funcs are disabled at the moment */ - -static void (*LineFuncs[3])() = { - cfbBresS, - cfb16BresS, - cfb24BresS -}; - -static void -S3VSubsequentSolidBresenhamLine( - ScrnInfoPtr pScrn, - int x, int y, - int dmaj, int dmin, - int e, int len, int octant -){ - S3VPtr ps3v = S3VPTR(pScrn); - cfbPrivGCPtr devPriv; - int Bpp = pScrn->bitsPerPixel >> 3; - - if( ps3v->UseFB ) - { -#if 1 - /* -void -fbBres (DrawablePtr pDrawable, - GCPtr pGC, - int dashOffset, - int signdx, - int signdy, - int axis, - int x1, - int y1, - int e, - int e1, - int e3, - int len) - - from cfb, e3 = e2-e1. - for the cfb call e2 = dmin - dmaj - e1 = dmin - e3 = e2-e1 = dmin-dmaj-dmin - */ - - - fbBres(ps3v->CurrentDrawable, ps3v->CurrentGC, 0, - (octant & XDECREASING) ? -1 : 1, - (octant & YDECREASING) ? -1 : 1, - (octant & YMAJOR) ? Y_AXIS : X_AXIS, - /* x, y, dmin + e, dmin, dmin-dmaj, len); */ - x, y, dmin + e, dmin, -dmaj, len); -#endif -#if 0 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV, - "Bresenham dmaj=%i, -dmaj=%i, -1*dmaj=%i.\n", - dmaj, -dmaj, -1*dmaj ); -#endif - - } - else - { - devPriv = cfbGetGCPrivate(ps3v->CurrentGC); - - /* you could trap for lines you could do here and accelerate them */ - - /* - * void - * cfbBresS(rop, and, xor, addrl, nlwidth, signdx, signdy, axis, - * x1, y1, e, e1, e2, len) - */ - - (*LineFuncs[Bpp - 1]) - (devPriv->rop, devPriv->and, devPriv->xor, - (unsigned long*)ps3v->FBBase, - (pScrn->displayWidth * Bpp) >> LOG2_BYTES_PER_SCANLINE_PAD, - (octant & XDECREASING) ? -1 : 1, - (octant & YDECREASING) ? -1 : 1, - (octant & YMAJOR) ? Y_AXIS : X_AXIS, - x, y, dmin + e, dmin, dmin - dmaj, len); - } /*if(fb)*/ -} - -#endif - void S3VWaitFifoGX2(S3VPtr ps3v, int slots ) Index: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c:1.96 xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c:1.100 --- xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c:1.96 Sun Jan 16 22:07:42 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c Thu Mar 16 11:50:13 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c,v 1.96 2005/01/17 03:07:42 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c,v 1.100 2006/03/16 16:50:13 dawes Exp $ */ /* * Copyright (C) 1994-1999 The XFree86 Project, Inc. @@ -71,13 +71,13 @@ */ - /* Most xf86 commons are already in s3v.h */ +/* Most xf86 commons are already in s3v.h */ #include "s3v.h" #include "globals.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> #ifndef USE_INT10 #define USE_INT10 0 @@ -234,7 +234,6 @@ OPTION_HWCURSOR, OPTION_SHADOW_FB, OPTION_ROTATE, - OPTION_FB_DRAW, OPTION_MX_CR3A_FIX, OPTION_XVIDEO } S3VOpts; @@ -265,7 +264,6 @@ { OPTION_SWCURSOR, "SWCursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE }, - { OPTION_FB_DRAW, "UseFB", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_MX_CR3A_FIX, "mxcr3afix", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_XVIDEO, "XVideo", OPTV_BOOLEAN, {0}, FALSE }, {-1, NULL, OPTV_NONE, {0}, FALSE} @@ -367,19 +365,6 @@ #endif #ifdef XFree86LOADER -static const char *cfbSymbols[] = { - "cfbScreenInit", - "cfb16ScreenInit", - "cfb24ScreenInit", - "cfb24_32ScreenInit", - "cfb32ScreenInit", - "cfBresS", - "cfb16BresS", - "cfb24BresS", - "cfb32BresS", - NULL -}; - static MODULESETUPPROTO(s3virgeSetup); static XF86ModuleVersionInfo S3VVersRec = @@ -405,7 +390,7 @@ XF86ModuleData s3virgeModuleData = { &S3VVersRec, s3virgeSetup, NULL }; static pointer -s3virgeSetup(pointer module, pointer opts, int *errmaj, int *errmin) +s3virgeSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -422,13 +407,13 @@ * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(vgahwSymbols, cfbSymbols, xaaSymbols, - ramdacSymbols, ddcSymbols, i2cSymbols, + LoaderModRefSymLists(module, vgahwSymbols, xaaSymbols, + ramdacSymbols, ddcSymbols, i2cSymbols, #if USE_INT10 - int10Symbols, + int10Symbols, #endif - vbeSymbols, shadowSymbols, - fbSymbols, NULL); + vbeSymbols, shadowSymbols, + fbSymbols, NULL); /* * The return value must be non-NULL on success even though there @@ -601,9 +586,8 @@ int i; double real; ClockRangePtr clockRanges; - char *mod = NULL; - const char *reqSym = NULL; char *s; + ModuleDescPtr pMod; unsigned char config1, config2, m, n, n1, n2, cr66 = 0; int mclk; @@ -633,10 +617,10 @@ /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* * Allocate a vgaHWRec @@ -895,18 +879,6 @@ ps3v->hwcursor = FALSE; } - if (xf86IsOptionSet(ps3v->Options, OPTION_FB_DRAW)) - { - if (xf86GetOptValBool(ps3v->Options, OPTION_FB_DRAW ,&ps3v->UseFB)) - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using %s.\n", - ps3v->UseFB ? "fb (not cfb)" : "cfb (not fb)"); - } - else - { - ps3v->UseFB = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, "Using fb.\n"); - } - if (xf86IsOptionSet(ps3v->Options, OPTION_MX_CR3A_FIX)) { if (xf86GetOptValBool(ps3v->Options, OPTION_MX_CR3A_FIX ,&ps3v->mx_cr3a_fix)) @@ -938,9 +910,9 @@ } #if USE_INT10 - if (xf86LoadSubModule(pScrn, "int10")) { + if ((pMod = xf86LoadSubModule(pScrn, "int10"))) { xf86Int10InfoPtr pInt; - xf86LoaderReqSymLists(int10Symbols, NULL); + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); #if 1 xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n"); pInt = xf86InitInt10(pEnt->index); @@ -948,9 +920,9 @@ #endif } #endif - if (xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols, NULL); - ps3v->pVbe = VBEInit(NULL,pEnt->index); + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); + ps3v->pVbe = VBEInit(NULL, pEnt->index); } ps3v->PciInfo = xf86GetPciInfoForEntity(pEnt->index); @@ -987,6 +959,13 @@ } xfree(pEnt); +#define VBECLEAN do { \ + if (ps3v->pVbe) { \ + vbeFree(ps3v->pVbe); \ + ps3v->pVbe = NULL; \ + } \ + } while (0) + /* * This shouldn't happen because such problems should be caught in * S3VProbe(), but check it just in case. @@ -994,15 +973,13 @@ if (pScrn->chipset == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ChipID 0x%04X is not recognised\n", ps3v->Chipset); - vbeFree(ps3v->pVbe); - ps3v->pVbe = NULL; + VBECLEAN; return FALSE; } if (ps3v->Chipset < 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Chipset \"%s\" is not recognised\n", pScrn->chipset); - vbeFree(ps3v->pVbe); - ps3v->pVbe = NULL; + VBECLEAN; return FALSE; } @@ -1059,22 +1036,19 @@ VGAOUT8(vgaCRIndex, 0x37); /* for register CR37 (CONFG_REG2),*/ config2 = VGAIN8(vgaCRReg); /* get amount of off-screen ram */ - if (xf86LoadSubModule(pScrn, "ddc")) { + if ((pMod = xf86LoadSubModule(pScrn, "ddc"))) { xf86MonPtr pMon = NULL; - xf86LoaderReqSymLists(ddcSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); if ((ps3v->pVbe) - && ((pMon = xf86PrintEDID(vbeDoEDID(ps3v->pVbe, NULL))) != NULL)) + && ((pMon = xf86PrintEDID(vbeDoEDID(ps3v->pVbe, pMod))) != NULL)) xf86SetDDCproperties(pScrn,pMon); else if (!S3Vddc1(pScrn->scrnIndex)) { S3Vddc2(pScrn->scrnIndex); } } - if (ps3v->pVbe) { - vbeFree(ps3v->pVbe); - ps3v->pVbe = NULL; - } - + VBECLEAN; + /* * If the driver can do gamma correction, it should call xf86SetGamma() * here. (from MGA, no ViRGE gamma support yet, but needed for @@ -1526,72 +1500,37 @@ } /* Load bpp-specific modules */ - if( ps3v->UseFB ) - { - if( xf86LoadSubModule(pScrn, "fb") == NULL ) - { - S3VFreeRec(pScrn); - return FALSE; - } - xf86LoaderReqSymLists(fbSymbols, NULL); - } - else + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { - switch (pScrn->bitsPerPixel) { - case 8: - mod = "cfb"; - reqSym = "cfbScreenInit"; - break; - case 16: - mod = "cfb16"; - reqSym = "cfb16ScreenInit"; - break; - case 24: - if (pix24bpp == 24) { - mod = "cfb24"; - reqSym = "cfb24ScreenInit"; - } else { - mod = "xf24_32bpp"; - reqSym = "cfb24_32ScreenInit"; - } - break; - case 32: - mod = "cfb32"; - reqSym = "cfb32ScreenInit"; - break; - } - if (mod && xf86LoadSubModule(pScrn, mod) == NULL) { - S3VFreeRec(pScrn); - return FALSE; - } - - xf86LoaderReqSymbols(reqSym, NULL); - } + S3VFreeRec(pScrn); + return FALSE; + } + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); /* Load XAA if needed */ if (!ps3v->NoAccel || ps3v->hwcursor ) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { S3VFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } /* Load ramdac if needed */ if (ps3v->hwcursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { S3VFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } if (ps3v->shadowFB) { - if (!xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { S3VFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } /* Setup WAITFIFO() for accel and ModeInit() */ @@ -2558,7 +2497,7 @@ * function. If not, the visuals will need to be setup before calling * a fb ScreenInit() function and fixed up after. * - * For most PC hardware at depths >= 8, the defaults that cfb uses + * For most PC hardware at depths >= 8, the defaults that fb uses * are not appropriate. In this driver, we fixup the visuals after. */ @@ -2616,8 +2555,7 @@ } /* must be after RGB ordering fixed */ - if (ps3v->UseFB) - fbPictureInit (pScreen, 0, 0); + fbPictureInit (pScreen, 0, 0); /* Initialize acceleration layer */ if (!ps3v->NoAccel) { @@ -2750,70 +2688,22 @@ * pScreen fields. */ - if( ps3v->UseFB ) + switch (pScrn->bitsPerPixel) { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using FB\n"); - - switch (pScrn->bitsPerPixel) - { - case 8: - case 16: - case 24: - ret = fbScreenInit(pScreen, FBStart, pScrn->virtualX, - pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, - displayWidth, pScrn->bitsPerPixel); - break; - default: - xf86DrvMsg(scrnIndex, X_ERROR, - "Internal error: invalid bpp (%d) in S3VScreenInit\n", - pScrn->bitsPerPixel); - ret = FALSE; - break; - } + case 8: + case 16: + case 24: + ret = fbScreenInit(pScreen, FBStart, pScrn->virtualX, + pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, + displayWidth, pScrn->bitsPerPixel); + break; + default: + xf86DrvMsg(scrnIndex, X_ERROR, + "Internal error: invalid bpp (%d) in S3VScreenInit\n", + pScrn->bitsPerPixel); + ret = FALSE; + break; } - else - { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using CFB\n"); - switch (pScrn->bitsPerPixel) { - case 8: - ret = cfbScreenInit(pScreen, FBStart, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); - break; - case 16: - ret = cfb16ScreenInit(pScreen, FBStart, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); - break; - case 24: - if (pix24bpp ==24) { - ret = cfb24ScreenInit(pScreen, FBStart, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); - } else { - ret = cfb24_32ScreenInit(pScreen, FBStart, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); - } - break; - case 32: - ret = cfb32ScreenInit(pScreen, FBStart, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); - break; - default: - xf86DrvMsg(scrnIndex, X_ERROR, - "Internal error: invalid bpp (%d) in S3VScreenInit\n", - pScrn->bitsPerPixel); - ret = FALSE; - break; - } /*switch*/ - } /*if(fb)*/ return ret; } @@ -4011,9 +3901,10 @@ { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; S3VPtr ps3v = S3VPTR(pScrn); + ModuleDescPtr pMod; - if ( xf86LoadSubModule(pScrn, "i2c") ) { - xf86LoaderReqSymLists(i2cSymbols,NULL); + if ((pMod = xf86LoadSubModule(pScrn, "i2c"))) { + xf86LoaderModReqSymLists(pMod, i2cSymbols,NULL); if (S3V_I2CInit(pScrn)) { CARD32 tmp = (INREG(DDC_REG)); OUTREG(DDC_REG,(tmp | 0x13)); @@ -4030,10 +3921,14 @@ S3VProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; - if (xf86LoadSubModule(pScrn, "vbe")) { + ModuleDescPtr pMod; + + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } Index: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.man diff -u xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.man:1.4 xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.man:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.man:1.4 Wed Feb 12 22:21:33 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.man Sun Aug 28 13:48:02 2005 @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.man,v 1.4 2003/02/13 03:21:33 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.man,v 1.5 2005/08/28 17:48:02 tsi Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH s3virge __drivermansuffix__ __vendorversion__ @@ -156,12 +156,6 @@ operations the video driver can accelerate with hardware. Default: acceleration is enabled. .TP -.B "Option \*qUseFB\*q" -There are two framebuffer rendering methods. fb and cfb. Both are -available in the driver. fb is the newer and default method. To switch -back to cfb use this option with no, off or other negative parameter. -Default: on. -.TP .BR "Option \*qfifo_aggressive " | " fifo_moderate " | " fifo_conservative\*q" alter the settings for the threshold at which the pixel FIFO takes over the internal Index: xc/programs/Xserver/hw/xfree86/drivers/savage/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/savage/Imakefile:1.10 xc/programs/Xserver/hw/xfree86/drivers/savage/Imakefile:1.15 --- xc/programs/Xserver/hw/xfree86/drivers/savage/Imakefile:1.10 Thu Mar 18 02:06:48 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/savage/Imakefile Fri Oct 14 11:16:44 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/Imakefile,v 1.10 2004/03/18 07:06:48 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/Imakefile,v 1.15 2005/10/14 15:16:44 tsi Exp $ /* * * Copyright 1995-1998 The XFree86 Project, Inc. @@ -71,21 +71,15 @@ savage_vbe.o \ savage_video.o -DEFINES = -DPSZ=8 - #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ - -I$(XF86SRC)/xaa \ - -I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \ - -I$(XF86SRC)/xf24_32bpp -I$(SERVERSRC)/Xext \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(XF86SRC)/xaa \ + -I$(SERVERSRC)/Xext -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ -I$(XF86SRC)/rac -I$(XF86SRC)/int10 -I$(SERVERSRC)/render \ - -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(FONTINCSRC) \ - -I$(EXTINCSRC) -I$(XF86SRC)/vbe -I$(XF86SRC)/shadowfb + -I$(SERVERSRC)/include -I$(XF86SRC)/vbe -I$(XF86SRC)/shadowfb #endif #if MakeHasPosixVariableSubstitutions @@ -117,7 +111,6 @@ InstallDriverSDKNonExecFile(savage_regs.h,$(DRIVERSDKDIR)/drivers/savage) InstallDriverSDKNonExecFile(savage_shadow.c,$(DRIVERSDKDIR)/drivers/savage) InstallDriverSDKNonExecFile(savage_vbe.c,$(DRIVERSDKDIR)/drivers/savage) -InstallDriverSDKNonExecFile(savage_vbe.h,$(DRIVERSDKDIR)/drivers/savage) InstallDriverSDKNonExecFile(savage_video.c,$(DRIVERSDKDIR)/drivers/savage) InstallDriverSDKObjectModule(savage,$(DRIVERSDKMODULEDIR),drivers) Index: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c:1.25 xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c:1.26 --- xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c:1.25 Mon Mar 29 11:25:18 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c Fri Oct 14 11:16:44 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c,v 1.25 2004/03/29 16:25:18 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c,v 1.26 2005/10/14 15:16:44 tsi Exp $ */ /* * @@ -15,7 +15,7 @@ * */ -#include "Xarch.h" +#include <X11/Xarch.h> #include "xaarop.h" #include "miline.h" Index: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c:1.53 xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c:1.57 --- xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c:1.53 Fri Nov 26 08:45:03 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c Thu Mar 16 11:50:13 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c,v 1.53 2004/11/26 13:45:03 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c,v 1.57 2006/03/16 16:50:13 dawes Exp $ */ /* * vim: sw=4 ts=8 ai ic: * @@ -17,7 +17,7 @@ #include "globals.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> #include "xf86xv.h" @@ -253,15 +253,12 @@ static const char *vbeSymbols[] = { "VBEInit", "vbeDoEDID", -#if 0 "vbeFree", -#endif NULL }; #ifdef XFree86LOADER static const char *vbeOptSymbols[] = { - "vbeModeInit", "VBESetVBEMode", "VBEGetVBEInfo", "VBEFreeVBEInfo", @@ -336,7 +333,7 @@ XF86ModuleData savageModuleData = { &SavageVersRec, SavageSetup, NULL }; -static pointer SavageSetup(pointer module, pointer opts, int *errmaj, +static pointer SavageSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -344,9 +341,10 @@ if (!setupDone) { setupDone = TRUE; xf86AddDriver(&SAVAGE, module, 0); - LoaderRefSymLists(vgaHWSymbols, fbSymbols, ramdacSymbols, - xaaSymbols, shadowSymbols, vbeSymbols, vbeOptSymbols, - int10Symbols, i2cSymbols, ddcSymbols, NULL); + LoaderModRefSymLists(module, vgaHWSymbols, fbSymbols, ramdacSymbols, + xaaSymbols, shadowSymbols, vbeSymbols, + vbeOptSymbols, int10Symbols, i2cSymbols, + ddcSymbols, NULL); return (pointer) 1; } else { if (errmaj) @@ -593,12 +591,15 @@ static void SavageFreeRec(ScrnInfoPtr pScrn) { + SavagePtr psav; + TRACE(( "SavageFreeRec(%x)\n", pScrn->driverPrivate )); - if (!pScrn->driverPrivate) + if (!(psav = pScrn->driverPrivate)) return; + vbeFree(psav->pVbe); + SavageUnmapMem(pScrn, 1); xfree(pScrn->driverPrivate); pScrn->driverPrivate = NULL; - SavageUnmapMem(pScrn, 1); } @@ -696,7 +697,8 @@ int mclk; vgaHWPtr hwp; int vgaCRIndex, vgaCRReg; - pointer ddc; + ModuleDescPtr ddc; + ModuleDescPtr pMod; TRACE(("SavagePreInit(%d)\n", flags)); @@ -707,10 +709,10 @@ return TRUE; } - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgaHWSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgaHWSymbols, NULL); if (!vgaHWGetHWRec(pScrn)) return FALSE; @@ -948,13 +950,13 @@ } psav->EntityIndex = pEnt->index; - if (xf86LoadSubModule(pScrn, "int10")) { - xf86LoaderReqSymLists(int10Symbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "int10"))) { + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); psav->pInt10 = xf86InitInt10(pEnt->index); } - if (xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols, NULL); + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); psav->pVbe = VBEInit(psav->pInt10, pEnt->index); } @@ -1011,7 +1013,6 @@ if (!SavageMapMMIO(pScrn)) { SavageFreeRec(pScrn); - vbeFree(psav->pVbe); return FALSE; } @@ -1041,7 +1042,6 @@ Gamma zeros = {0.0, 0.0, 0.0}; if (!xf86SetGamma(pScrn, zeros)) { - vbeFree(psav->pVbe); SavageFreeRec(pScrn); return FALSE; } @@ -1221,7 +1221,7 @@ xf86MonPtr pMon = NULL; #endif - xf86LoaderReqSymLists(ddcSymbols, NULL); + xf86LoaderModReqSymLists(ddc, ddcSymbols, NULL); #if 0 /* * On many machines, the attempt to read DDC information via VBE puts the @@ -1234,8 +1234,8 @@ else #endif if (!SavageDDC1(pScrn->scrnIndex)) { - if ( xf86LoadSubModule(pScrn, "i2c") ) { - xf86LoaderReqSymLists(i2cSymbols,NULL); + if ((pMod = xf86LoadSubModule(pScrn, "i2c"))) { + xf86LoaderModReqSymLists(pMod, i2cSymbols, NULL); if (SavageI2CInit(pScrn)) { unsigned char tmp; @@ -1383,7 +1383,6 @@ if (i == -1) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86ValidateModes failure\n"); SavageFreeRec(pScrn); - vbeFree(psav->pVbe); return FALSE; } @@ -1392,7 +1391,6 @@ if (i == 0 || pScrn->modes == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); SavageFreeRec(pScrn); - vbeFree(psav->pVbe); return FALSE; } @@ -1443,39 +1441,35 @@ xf86PrintModes(pScrn); xf86SetDpi(pScrn, 0, 0); - if (xf86LoadSubModule(pScrn, "fb") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { SavageFreeRec(pScrn); - vbeFree(psav->pVbe); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); - if( !psav->NoAccel ) { - if( !xf86LoadSubModule(pScrn, "xaa") ) { + if (!psav->NoAccel ) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { SavageFreeRec(pScrn); - vbeFree(psav->pVbe); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL ); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL ); } if (psav->hwcursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { SavageFreeRec(pScrn); - vbeFree(psav->pVbe); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } if (psav->shadowFB) { - if (!xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { SavageFreeRec(pScrn); - vbeFree(psav->pVbe); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } vbeFree(psav->pVbe); @@ -3259,10 +3253,13 @@ SavageProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; - if (xf86LoadSubModule(pScrn, "vbe")) { + ModuleDescPtr pMod; + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } Index: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c diff -u xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c:1.15 xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c:1.19 --- xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c:1.15 Wed Sep 1 19:57:57 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c Sat Aug 20 11:18:15 2005 @@ -1,21 +1,31 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c,v 1.15 2004/09/01 23:57:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c,v 1.19 2005/08/20 15:18:15 tsi Exp $ */ #include "savage_driver.h" -#include "savage_vbe.h" -#if X_BYTE_ORDER == X_LITTLE_ENDIAN -#define B_O16(x) (x) -#define B_O32(x) (x) -#else -#define B_O16(x) ((((x) & 0xff) << 8) | (((x) & 0xff) >> 8)) -#define B_O32(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) \ - | (((x) & 0xff0000) >> 8) | (((x) & 0xff000000) >> 24)) -#endif +#define VBE_ATTR_MODE_SUPPORTED (1 << 0) +#define VBE_ATTR_TTY (1 << 2) +#define VBE_ATTR_COLOR (1 << 3) +#define VBE_ATTR_GRAPHICS (1 << 4) +#define VBE_ATTR_NOT_VGA (1 << 5) +#define VBE_ATTR_NOT_WINDOWED (1 << 6) +#define VBE_ATTR_LINEAR (1 << 7) + +#define VBE_WIN_RELOCATABLE (1 << 0) +#define VBE_WIN_READABLE (1 << 1) +#define VBE_WIN_WRITEABLE (1 << 2) + +#define VBE_MODEL_TEXT 0 +#define VBE_MODEL_CGA 1 +#define VBE_MODEL_HERCULES 2 +#define VBE_MODEL_PLANAR 3 +#define VBE_MODEL_PACKED 4 +#define VBE_MODEL_256 5 +#define VBE_MODEL_RGB 6 +#define VBE_MODEL_YUV 7 + #define L_ADD(x) (B_O32(x) & 0xffff) + ((B_O32(x) >> 12) & 0xffff00) -Bool vbeModeInit( vbeInfoPtr, int ); static int SavageGetDevice( SavagePtr psav ); -/*static int SavageGetTVType( SavagePtr psav );*/ static void SavageClearVM86Regs( xf86Int10InfoPtr pInt ) @@ -111,15 +121,6 @@ ErrorF("Set video mode failed\n"); } } -#ifdef XFree86LOADER - else - { - if( !vbeModeInit( psav->pVbe, n ) ) - { - ErrorF("Set video mode failed\n"); - } - } -#endif } @@ -180,8 +181,8 @@ int nModes = SavageGetBIOSModes( psav, iDepth, NULL ); SavageModeTablePtr pTable; - pTable = (SavageModeTablePtr) - xcalloc( 1, sizeof(SavageModeTableRec) + + pTable = (SavageModeTablePtr) + xcalloc( 1, sizeof(SavageModeTableRec) + (nModes-1) * sizeof(SavageModeEntry) ); if( pTable ) { pTable->NumModes = nModes; @@ -193,17 +194,16 @@ unsigned short -SavageGetBIOSModes( +SavageGetBIOSModes( SavagePtr psav, int iDepth, SavageModeEntryPtr s3vModeTable ) { unsigned short iModeCount = 0; unsigned short int *mode_list; - pointer vbeLinear = NULL; + unsigned char *vbeLinear = NULL; vbeControllerInfoPtr vbe = NULL; int vbeReal; - struct vbe_mode_info_block * vmib; if( !psav->pVbe ) return 0; @@ -215,19 +215,19 @@ ErrorF( "Cannot allocate scratch page in real mode memory." ); return 0; } - vmib = (struct vbe_mode_info_block *) vbeLinear; - + for ( mode_list = xf86int10Addr( psav->pInt10, L_ADD(vbe->VideoModePtr) ); *mode_list != 0xffff; mode_list++ ) { + int mode = B_O16(*mode_list); /* * This is a HACK to work around what I believe is a BUG in the * Toshiba Satellite BIOSes in 08/2000 and 09/2000. The BIOS * table for 1024x600 says it has six refresh rates, when in fact - * it only has 3. When I ask for rate #4, the BIOS goes into an + * it only has 3. When I ask for rate #4, the BIOS goes into an * infinite loop until the user interrupts it, usually by pressing * Ctrl-Alt-F1. For now, we'll just punt everything with a VESA * number greater than or equal to 0200. @@ -235,25 +235,25 @@ * This also prevents some strange and unusual results seen with * the later ProSavage/PM133 BIOSes directly from S3/VIA. */ - if( *mode_list >= 0x0200 ) + if( mode >= 0x0200 ) continue; SavageClearVM86Regs( psav->pInt10 ); psav->pInt10->ax = 0x4f01; - psav->pInt10->cx = *mode_list; + psav->pInt10->cx = mode; psav->pInt10->es = SEG_ADDR(vbeReal); psav->pInt10->di = SEG_OFF(vbeReal); psav->pInt10->num = 0x10; xf86ExecX86int10( psav->pInt10 ); - if( - (vmib->bits_per_pixel == iDepth) && + if( + (vbeLinear[25] == iDepth) && ( - (vmib->memory_model == VBE_MODEL_256) || - (vmib->memory_model == VBE_MODEL_PACKED) || - (vmib->memory_model == VBE_MODEL_RGB) + (vbeLinear[27] == VBE_MODEL_256) || + (vbeLinear[27] == VBE_MODEL_PACKED) || + (vbeLinear[27] == VBE_MODEL_RGB) ) ) { @@ -265,15 +265,15 @@ if( s3vModeTable ) { - int iRefresh = 0; + int iRefresh = 0; + + s3vModeTable->Width = B_O16(vbeLinear[18]); + s3vModeTable->Height = B_O16(vbeLinear[20]); + s3vModeTable->VesaMode = mode; - s3vModeTable->Width = vmib->x_resolution; - s3vModeTable->Height = vmib->y_resolution; - s3vModeTable->VesaMode = *mode_list; - /* Query the refresh rates at this mode. */ - psav->pInt10->cx = *mode_list; + psav->pInt10->cx = mode; psav->pInt10->dx = 0; do @@ -283,7 +283,7 @@ if( s3vModeTable->RefreshRate ) { s3vModeTable->RefreshRate = (unsigned char *) - xrealloc( + xrealloc( s3vModeTable->RefreshRate, (iRefresh+8) * sizeof(unsigned char) ); @@ -291,7 +291,7 @@ else { s3vModeTable->RefreshRate = (unsigned char *) - xcalloc( + xcalloc( sizeof(unsigned char), (iRefresh+8) ); @@ -309,7 +309,7 @@ s3vModeTable->RefreshCount = iRefresh; - s3vModeTable++; + s3vModeTable++; } } } Index: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.h diff -u xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.h:removed --- xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.h:1.3 Tue May 14 16:19:52 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.h Tue May 9 21:56:55 2006 @@ -1,113 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.h,v 1.3 2002/05/14 20:19:52 alanh Exp $ */ - -/* -This file was originally part of the Linux Real-Mode Interface, or LRMI. -There is nothing LRMI-specific here; this is all good, general VBE info. - -Copyright (C) 1996 by Josh Vanderhoof - -You are free to distribute and modify this file, as long as you -do not remove this copyright notice and clearly label modified -versions as being modified. - -This software has NO WARRANTY. Use it at your own risk. -*/ - -#ifndef _SAVAGEVBE_H -#define _SAVAGEVBE_H - -/* structures for vbe 2.0 */ - -#ifndef __GNUC__ -#define __attribute__(a) -#endif - -struct vbe_info_block - { - char vbe_signature[4]; - short vbe_version; - unsigned short oem_string_off; - unsigned short oem_string_seg; - int capabilities; - unsigned short video_mode_list_off; - unsigned short video_mode_list_seg; - short total_memory; - short oem_software_rev; - unsigned short oem_vendor_name_off; - unsigned short oem_vendor_name_seg; - unsigned short oem_product_name_off; - unsigned short oem_product_name_seg; - unsigned short oem_product_rev_off; - unsigned short oem_product_rev_seg; - char reserved[222]; - char oem_data[256]; - } __attribute__ ((packed)); - -#define VBE_ATTR_MODE_SUPPORTED (1 << 0) -#define VBE_ATTR_TTY (1 << 2) -#define VBE_ATTR_COLOR (1 << 3) -#define VBE_ATTR_GRAPHICS (1 << 4) -#define VBE_ATTR_NOT_VGA (1 << 5) -#define VBE_ATTR_NOT_WINDOWED (1 << 6) -#define VBE_ATTR_LINEAR (1 << 7) - -#define VBE_WIN_RELOCATABLE (1 << 0) -#define VBE_WIN_READABLE (1 << 1) -#define VBE_WIN_WRITEABLE (1 << 2) - -#define VBE_MODEL_TEXT 0 -#define VBE_MODEL_CGA 1 -#define VBE_MODEL_HERCULES 2 -#define VBE_MODEL_PLANAR 3 -#define VBE_MODEL_PACKED 4 -#define VBE_MODEL_256 5 -#define VBE_MODEL_RGB 6 -#define VBE_MODEL_YUV 7 - -struct vbe_mode_info_block - { - unsigned short mode_attributes; - unsigned char win_a_attributes; - unsigned char win_b_attributes; - unsigned short win_granularity; - unsigned short win_size; - unsigned short win_a_segment; - unsigned short win_b_segment; - unsigned short win_func_ptr_off; - unsigned short win_func_ptr_seg; - unsigned short bytes_per_scanline; - unsigned short x_resolution; - unsigned short y_resolution; - unsigned char x_char_size; - unsigned char y_char_size; - unsigned char number_of_planes; - unsigned char bits_per_pixel; - unsigned char number_of_banks; - unsigned char memory_model; - unsigned char bank_size; - unsigned char number_of_image_pages; - unsigned char res1; - unsigned char red_mask_size; - unsigned char red_field_position; - unsigned char green_mask_size; - unsigned char green_field_position; - unsigned char blue_mask_size; - unsigned char blue_field_position; - unsigned char rsvd_mask_size; - unsigned char rsvd_field_position; - unsigned char direct_color_mode_info; - unsigned int phys_base_ptr; - unsigned int offscreen_mem_offset; - unsigned short offscreen_mem_size; - unsigned char res2[206]; - } __attribute__ ((packed)); - -struct vbe_palette_entry - { - unsigned char blue; - unsigned char green; - unsigned char red; - unsigned char align; - } __attribute__ ((packed)); - -#endif Index: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c:1.20 xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c:1.21 --- xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c:1.20 Sun Jan 16 22:07:43 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c Fri Oct 14 11:16:44 2005 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c,v 1.20 2005/01/17 03:07:43 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c,v 1.21 2005/10/14 15:16:44 tsi Exp $ */ -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "dix.h" #include "dixstruct.h" #include "fourcc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/CALLMAP diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/CALLMAP:1.1 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/CALLMAP:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/CALLMAP:1.1 Tue Nov 28 15:59:18 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/CALLMAP Mon Jan 9 09:59:58 2006 @@ -17,6 +17,4 @@ ChipWriteMode vgaHWRestoreMMIO -Header: \\Mercury\Projects\archives\XFree86 4.0\CALLMAP.-arc 1.1 13 Jul 2000 18:16:58 Frido $ - -$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/CALLMAP,v 1.1 2000/11/28 20:59:18 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/CALLMAP,v 1.2 2006/01/09 14:59:58 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Imakefile:1.5 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Imakefile:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Imakefile:1.5 Mon May 31 20:17:02 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Imakefile Thu Mar 9 12:37:07 2006 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Imakefile,v 1.5 2004/06/01 00:17:02 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Imakefile,v 1.8 2006/03/09 17:37:07 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -50,25 +50,21 @@ #include <Server.tmpl> SRCS = smi_driver.c smi_accel.c smi_dac.c smi_hwcurs.c smi_dga.c smi_i2c.c \ - smi_shadow.c smi_video.c + smi_shadow.c smi_video.c smi_501.c OBJS = smi_driver.o smi_accel.o smi_dac.o smi_hwcurs.o smi_dga.o smi_i2c.o \ - smi_shadow.o smi_video.o - -DEFINES = -DPSZ=8 + smi_shadow.o smi_video.o smi_501.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/fbdevhw \ - -I$(XF86SRC)/ramdac -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(SERVERSRC)/Xext -I$(XF86SRC)/int10 \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(XF86SRC)/shadowfb -I$(EXTINCSRC) -I$(SERVERSRC)/fb \ - -I$(SERVERSRC)/render -I$(XF86SRC)/vbe +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/mi -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \ + -I$(XF86SRC)/vgahw \ + -I$(XF86SRC)/ramdac -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ + -I$(SERVERSRC)/Xext -I$(XF86SRC)/int10 \ + -I$(SERVERSRC)/include -I$(XF86SRC)/shadowfb -I$(SERVERSRC)/fb \ + -I$(SERVERSRC)/render -I$(XF86SRC)/vbe #endif #if MakeHasPosixVariableSubstitutions @@ -97,8 +93,10 @@ InstallDriverSDKNonExecFile(smi_i2c.c,$(DRIVERSDKDIR)/drivers/siliconmotion) InstallDriverSDKNonExecFile(smi_shadow.c,$(DRIVERSDKDIR)/drivers/siliconmotion) InstallDriverSDKNonExecFile(smi_video.c,$(DRIVERSDKDIR)/drivers/siliconmotion) +InstallDriverSDKNonExecFile(smi_501.c,$(DRIVERSDKDIR)/drivers/siliconmotion) InstallDriverSDKNonExecFile(regsmi.h,$(DRIVERSDKDIR)/drivers/siliconmotion) InstallDriverSDKNonExecFile(smi.h,$(DRIVERSDKDIR)/drivers/siliconmotion) InstallDriverSDKNonExecFile(smi_video.h,$(DRIVERSDKDIR)/drivers/siliconmotion) +InstallDriverSDKNonExecFile(smi_501.h,$(DRIVERSDKDIR)/drivers/siliconmotion) InstallDriverSDKObjectModule(siliconmotion,$(DRIVERSDKMODULEDIR),drivers) Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README:1.3 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README:1.3 Thu Feb 15 13:20:33 2001 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README Mon Jan 9 09:59:58 2006 @@ -71,6 +71,4 @@ - "ShowCache" Enable or disable viewing offscreen cache memory. A development debug option. Default: off. -Header: //Mercury/Projects/archives/XFree86/4.0/README.-arc 1.2 14 Sep 2000 12:28:36 Frido $ - -$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README,v 1.3 2001/02/15 18:20:33 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README,v 1.4 2006/01/09 14:59:58 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt:1.7 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt:1.7 Thu Dec 20 16:35:37 2001 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt Mon Jan 9 09:59:58 2006 @@ -226,6 +226,4 @@ mode might still show lock-ups and/or garbage. Please report any problems to frido@siliconmotion.com. -Header: //Mercury/Projects/archives/XFree86/4.0/Release.txt-arc 1.33 13 Dec 2000 09:52:48 Frido $ - -$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt,v 1.7 2001/12/20 21:35:37 eich Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt,v 1.8 2006/01/09 14:59:58 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/regsmi.h diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/regsmi.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/regsmi.h:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/regsmi.h:1.3 Wed Oct 8 07:13:01 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/regsmi.h Thu Mar 9 12:37:07 2006 @@ -1,5 +1,3 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/regsmi.h-arc 1.11 14 Sep 2000 11:17:30 Frido $ */ - /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. Copyright (C) 2000 Silicon Motion, Inc. All Rights Reserved. @@ -26,7 +24,7 @@ sale, use or other dealings in this Software without prior written authorization from the XFree86 Project and SIlicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/regsmi.h,v 1.3 2003/10/08 11:13:01 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/regsmi.h,v 1.5 2006/03/09 17:37:07 tsi Exp $ */ #ifndef _REGSMI_H #define _REGSMI_H @@ -36,17 +34,19 @@ #define SMI_COUGAR_SERIES(chip) ((chip & 0xF0F0) == 0x0030) #define SMI_LYNXEM_SERIES(chip) ((chip & 0xFFF0) == 0x0710) #define SMI_LYNXM_SERIES(chip) ((chip & 0xFF00) == 0x0700) +#define SMI_MSOC_SERIES(chip) ((chip & 0xFF00) == 0x0500) /* Chip tags */ #define PCI_SMI_VENDOR_ID PCI_VENDOR_SMI -#define SMI_UNKNOWN 0 -#define SMI_LYNX PCI_CHIP_SMI910 -#define SMI_LYNXE PCI_CHIP_SMI810 -#define SMI_LYNX3D PCI_CHIP_SMI820 -#define SMI_LYNXEM PCI_CHIP_SMI710 +#define SMI_UNKNOWN 0 +#define SMI_LYNX PCI_CHIP_SMI910 +#define SMI_LYNXE PCI_CHIP_SMI810 +#define SMI_LYNX3D PCI_CHIP_SMI820 +#define SMI_LYNXEM PCI_CHIP_SMI710 #define SMI_LYNXEMplus PCI_CHIP_SMI712 -#define SMI_LYNX3DM PCI_CHIP_SMI720 -#define SMI_COUGAR3DR PCI_CHIP_SMI731 +#define SMI_LYNX3DM PCI_CHIP_SMI720 +#define SMI_COUGAR3DR PCI_CHIP_SMI731 +#define SMI_MSOC PCI_CHIP_SMI501 /* I/O Functions */ static __inline__ CARD8 @@ -105,159 +105,309 @@ } } -#define OUT_SEQ(pSmi, index, data) \ - VGAOUT8_INDEX((pSmi), VGA_SEQ_INDEX, VGA_SEQ_DATA, (index), (data)) +#define OUT_SEQ(pSmi, index, data) \ + VGAOUT8_INDEX((pSmi), VGA_SEQ_INDEX, VGA_SEQ_DATA, (index), (data)) #define IN_SEQ(pSmi, index) \ - VGAIN8_INDEX((pSmi), VGA_SEQ_INDEX, VGA_SEQ_DATA, (index)) + VGAIN8_INDEX((pSmi), VGA_SEQ_INDEX, VGA_SEQ_DATA, (index)) -#define WRITE_DPR(pSmi, dpr, data) MMIO_OUT32(pSmi->DPRBase, dpr, data); DEBUG((VERBLEV, "DPR%02X = %08X\n", dpr, data)) +#define WRITE_DPR(pSmi, dpr, data) \ + MMIO_OUT32(pSmi->DPRBase, dpr, data); \ + DEBUG((VERBLEV, "DPR%02X = %08X\n", dpr, data)) #define READ_DPR(pSmi, dpr) MMIO_IN32(pSmi->DPRBase, dpr) -#define WRITE_VPR(pSmi, vpr, data) MMIO_OUT32(pSmi->VPRBase, vpr, data); DEBUG((VERBLEV, "VPR%02X = %08X\n", vpr, data)) + +#define WRITE_VPR(pSmi, vpr, data) \ + MMIO_OUT32(pSmi->VPRBase, vpr, data); \ + DEBUG((VERBLEV, "VPR%02X = %08X\n", vpr, data)) #define READ_VPR(pSmi, vpr) MMIO_IN32(pSmi->VPRBase, vpr) -#define WRITE_CPR(pSmi, cpr, data) MMIO_OUT32(pSmi->CPRBase, cpr, data); DEBUG((VERBLEV, "CPR%02X = %08X\n", cpr, data)) + +#define WRITE_CPR(pSmi, cpr, data) \ + MMIO_OUT32(pSmi->CPRBase, cpr, data); \ + DEBUG((VERBLEV, "CPR%02X = %08X\n", cpr, data)) #define READ_CPR(pSmi, cpr) MMIO_IN32(pSmi->CPRBase, cpr) -#define WRITE_FPR(pSmi, fpr, data) MMIO_OUT32(pSmi->FPRBase, fpr, data); DEBUG((VERBLEV, "FPR%02X = %08X\n", fpr, data)) + +#define WRITE_FPR(pSmi, fpr, data) \ + MMIO_OUT32(pSmi->FPRBase, fpr, data); \ + DEBUG((VERBLEV, "FPR%02X = %08X\n", fpr, data)) #define READ_FPR(pSmi, fpr) MMIO_IN32(pSmi->FPRBase, fpr) +#define WRITE_DCR(pSmi, dcr, data) \ + MMIO_OUT32(pSmi->DCRBase, dcr, data); \ + DEBUG((VERBLEV, "DCR%02X = %08X\n", dcr, data)) +#define READ_DCR(pSmi, dcr) MMIO_IN32(pSmi->DCRBase, dcr) + +#define WRITE_SCR(pSmi, scr, data) \ + MMIO_OUT32(pSmi->SCRBase, scr, data); \ + DEBUG((VERBLEV, "SCR%02X = %08X\n", scr, data)) +#define READ_SCR(pSmi, scr) MMIO_IN32(pSmi->SCRBase, scr) + /* 2D Engine commands */ -#define SMI_TRANSPARENT_SRC 0x00000100 +#define SMI_TRANSPARENT_SRC 0x00000100 #define SMI_TRANSPARENT_DEST 0x00000300 -#define SMI_OPAQUE_PXL 0x00000000 -#define SMI_TRANSPARENT_PXL 0x00000400 +#define SMI_OPAQUE_PXL 0x00000000 +#define SMI_TRANSPARENT_PXL 0x00000400 -#define SMI_MONO_PACK_8 0x00001000 -#define SMI_MONO_PACK_16 0x00002000 -#define SMI_MONO_PACK_32 0x00003000 - -#define SMI_ROP2_SRC 0x00008000 -#define SMI_ROP2_PAT 0x0000C000 -#define SMI_ROP3 0x00000000 - -#define SMI_BITBLT 0x00000000 -#define SMI_RECT_FILL 0x00010000 -#define SMI_TRAPEZOID_FILL 0x00030000 -#define SMI_SHORT_STROKE 0x00060000 -#define SMI_BRESENHAM_LINE 0x00070000 -#define SMI_HOSTBLT_WRITE 0x00080000 -#define SMI_HOSTBLT_READ 0x00090000 -#define SMI_ROTATE_BLT 0x000B0000 +#define SMI_MONO_PACK_8 0x00001000 +#define SMI_MONO_PACK_16 0x00002000 +#define SMI_MONO_PACK_32 0x00003000 + +#define SMI_ROP2_SRC 0x00008000 +#define SMI_ROP2_PAT 0x0000C000 +#define SMI_ROP3 0x00000000 + +#define SMI_BITBLT 0x00000000 +#define SMI_RECT_FILL 0x00010000 +#define SMI_TRAPEZOID_FILL 0x00030000 +#define SMI_SHORT_STROKE 0x00060000 +#define SMI_BRESENHAM_LINE 0x00070000 +#define SMI_HOSTBLT_WRITE 0x00080000 +#define SMI_HOSTBLT_READ 0x00090000 +#define SMI_ROTATE_BLT 0x000B0000 -#define SMI_SRC_COLOR 0x00000000 -#define SMI_SRC_MONOCHROME 0x00400000 +#define SMI_SRC_COLOR 0x00000000 +#define SMI_SRC_MONOCHROME 0x00400000 #define SMI_GRAPHICS_STRETCH 0x00800000 -#define SMI_ROTATE_CW 0x01000000 -#define SMI_ROTATE_CCW 0x02000000 +#define SMI_ROTATE_CW 0x01000000 +#define SMI_ROTATE_CCW 0x02000000 -#define SMI_MAJOR_X 0x00000000 -#define SMI_MAJOR_Y 0x04000000 +#define SMI_MAJOR_X 0x00000000 +#define SMI_MAJOR_Y 0x04000000 -#define SMI_LEFT_TO_RIGHT 0x00000000 -#define SMI_RIGHT_TO_LEFT 0x08000000 +#define SMI_LEFT_TO_RIGHT 0x00000000 +#define SMI_RIGHT_TO_LEFT 0x08000000 -#define SMI_COLOR_PATTERN 0x40000000 -#define SMI_MONO_PATTERN 0x00000000 +#define SMI_COLOR_PATTERN 0x40000000 +#define SMI_MONO_PATTERN 0x00000000 -#define SMI_QUICK_START 0x10000000 -#define SMI_START_ENGINE 0x80000000 +#define SMI_QUICK_START 0x10000000 +#define SMI_START_ENGINE 0x80000000 #define MAXLOOP 0x100000 /* timeout value for engine waits */ -#define ENGINE_IDLE() \ - ((VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x16) & 0x08) == 0) -#define FIFO_EMPTY() \ - ((VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x16) & 0x10) != 0) +#define ENGINE_IDLE() \ + ((pSmi->Chipset != SMI_MSOC) ? \ + ((VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x16) & 0x08) == 0) : \ + ((READ_SCR(pSmi, SCR00) & 0x00080000) == 0)) + +#define FIFO_EMPTY() \ + ((pSmi->Chipset != SMI_MSOC) ? \ + ((VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x16) & 0x10) != 0) : \ + ((READ_SCR(pSmi, SCR00) & 0x00100000) != 0)) /* Wait until "v" queue entries are free */ -#define WaitQueue(v) \ - do \ - { \ - if (pSmi->NoPCIRetry) \ - { \ - int loop = MAXLOOP; mem_barrier(); \ - while (!FIFO_EMPTY()) \ - if (loop-- == 0) break; \ - if (loop <= 0) SMI_GEReset(pScrn, 1, __LINE__, __FILE__); \ - } \ +#define WaitQueue(v) \ + do \ + { \ + if (pSmi->NoPCIRetry) \ + { \ + int loop = MAXLOOP; mem_barrier(); \ + while (!FIFO_EMPTY()) \ + if (loop-- == 0) break; \ + if (loop <= 0) \ + SMI_GEReset(pScrn, 1, __LINE__, __FILE__); \ + } \ } while (0) /* Wait until GP is idle */ -#define WaitIdle() \ - do \ - { \ - int loop = MAXLOOP; mem_barrier(); \ - while (!ENGINE_IDLE()) \ - if (loop-- == 0) break; \ - if (loop <= 0) SMI_GEReset(pScrn, 1, __LINE__, __FILE__); \ - } \ +#define WaitIdle() \ + do \ + { \ + int loop = MAXLOOP; mem_barrier(); \ + while (!ENGINE_IDLE()) \ + if (loop-- == 0) break; \ + if (loop <= 0) \ + SMI_GEReset(pScrn, 1, __LINE__, __FILE__); \ + } \ while (0) /* Wait until GP is idle and queue is empty */ -#define WaitIdleEmpty() \ - do \ - { \ - WaitQueue(MAXFIFO); \ - WaitIdle(); \ - } \ +#define WaitIdleEmpty() \ + do \ + { \ + WaitQueue(MAXFIFO); \ + WaitIdle(); \ + } \ while (0) -#define RGB8_PSEUDO (-1) -#define RGB16_565 0 -#define RGB16_555 1 -#define RGB32_888 2 +#define RGB8_PSEUDO (-1) +#define RGB16_565 0 +#define RGB16_555 1 +#define RGB32_888 2 /* register defines so we're not hardcoding numbers */ -#define FPR00 0x0000 +#define FPR00 0x0000 /* video window formats - I=indexed, P=packed */ -#define FPR00_FMT_8I 0x0 -#define FPR00_FMT_15P 0x1 -#define FPR00_FMT_16P 0x2 -#define FPR00_FMT_32P 0x3 -#define FPR00_FMT_24P 0x4 -#define FPR00_FMT_8P 0x5 -#define FPR00_FMT_YUV422 0x6 -#define FPR00_FMT_YUV420 0x7 +#define FPR00_FMT_8I 0x0 +#define FPR00_FMT_15P 0x1 +#define FPR00_FMT_16P 0x2 +#define FPR00_FMT_32P 0x3 +#define FPR00_FMT_24P 0x4 +#define FPR00_FMT_8P 0x5 +#define FPR00_FMT_YUV422 0x6 +#define FPR00_FMT_YUV420 0x7 /* possible bit definitions for FPR00 - VWI = Video Window 1 */ -#define FPR00_VWIENABLE 0x00000008 -#define FPR00_VWITILE 0x00000010 -#define FPR00_VWIFILTER2 0x00000020 -#define FPR00_VWIFILTER4 0x00000040 -#define FPR00_VWIKEYENABLE 0x00000080 -#define FPR00_VWIGDF_SHIFT 16 -#define FPR00_VWIGDENABLE 0x00080000 -#define FPR00_VWIGDTILE 0x00100000 - -#define FPR00_MASKBITS 0x0000FFFF - -#define FPR04 0x0004 -#define FPR08 0x0008 -#define FPR0C 0x000C -#define FPR10 0x0010 -#define FPR14 0x0014 -#define FPR18 0x0018 -#define FPR1C 0x001C -#define FPR20 0x0020 -#define FPR24 0x0024 -#define FPR58 0x0058 -#define FPR5C 0x005C -#define FPR68 0x0068 -#define FPRB0 0x00B0 -#define FPRB4 0x00B4 -#define FPRC4 0x00C4 -#define FPRCC 0x00CC - -#define FPR158 0x0158 -#define FPR158_MASK_MAXBITS 0x07FF -#define FPR158_MASK_BOUNDARY 0x0800 -#define FPR15C 0x015C -#define FPR15C_MASK_HWCCOLORS 0x0000FFFF -#define FPR15C_MASK_HWCADDREN 0xFFFF0000 -#define FPR15C_MASK_HWCENABLE 0x80000000 +#define FPR00_VWIENABLE 0x00000008 +#define FPR00_VWITILE 0x00000010 +#define FPR00_VWIFILTER2 0x00000020 +#define FPR00_VWIFILTER4 0x00000040 +#define FPR00_VWIKEYENABLE 0x00000080 +#define FPR00_VWIGDF_SHIFT 16 +#define FPR00_VWIGDENABLE 0x00080000 +#define FPR00_VWIGDTILE 0x00100000 + +#define FPR00_MASKBITS 0x0000FFFF + +#define FPR04 0x0004 +#define FPR08 0x0008 +#define FPR0C 0x000C +#define FPR10 0x0010 +#define FPR14 0x0014 +#define FPR18 0x0018 +#define FPR1C 0x001C +#define FPR20 0x0020 +#define FPR24 0x0024 +#define FPR58 0x0058 +#define FPR5C 0x005C +#define FPR68 0x0068 +#define FPRB0 0x00B0 +#define FPRB4 0x00B4 +#define FPRC4 0x00C4 +#define FPRCC 0x00CC + +#define FPR158 0x0158 +#define FPR158_MASK_MAXBITS 0x07FF +#define FPR158_MASK_BOUNDARY 0x0800 +#define FPR15C 0x015C +#define FPR15C_MASK_HWCCOLORS 0x0000FFFF +#define FPR15C_MASK_HWCADDREN 0xFFFF0000 +#define FPR15C_MASK_HWCENABLE 0x80000000 + +/* SM501 System Configuration Registers */ +#define SCR00 0x0000 +#define SCR04 0x0004 +#define SCR08 0x0008 +#define SCR0C 0x000C +#define SCR10 0x0010 +#define SCR10_LOCAL_MEM_SIZE 0x0000E000 +#define SCR10_LOCAL_MEM_SIZE_SHIFT 13 +#define SCR14 0x0014 +#define SCR18 0x0018 +#define SCR1C 0x001C +#define SCR20 0x0020 +#define SCR24 0x0024 +#define SCR28 0x0028 +#define SCR2C 0x002C +#define SCR30 0x0030 +#define SCR34 0x0034 +#define SCR38 0x0038 +#define SCR3C 0x003C +#define SCR40 0x0040 +#define SCR44 0x0044 +#define SCR48 0x0048 +#define SCR4C 0x004C +#define SCR50 0x0050 +#define SCR54 0x0054 +#define SCR58 0x0058 +#define SCR5C 0x005C +#define SCR60 0x0060 +#define SCR64 0x0064 +#define SCR68 0x0068 +#define SCR6C 0x006C + +/* SM501 Panel Graphics Control */ +#define DCR00 0x0000 +#define DCR04 0x0004 +#define DCR08 0x0008 +#define DCR0C 0x000C +#define DCR10 0x0010 +#define DCR14 0x0014 +#define DCR18 0x0018 +#define DCR1C 0x001C +#define DCR20 0x0020 +#define DCR24 0x0024 +#define DCR28 0x0028 +#define DCR2c 0x002c +#define DCR30 0x0030 +#define DCR34 0x0034 + +/* SM 501 Video Control */ +#define DCR40 0x0040 +#define DCR44 0x0044 +#define DCR48 0x0048 +#define DCR4C 0x004C +#define DCR50 0x0050 +#define DCR54 0x0054 +#define DCR58 0x0058 +#define DCR5C 0x005C +#define DCR60 0x0060 +#define DCR64 0x0064 +#define DCR68 0x0068 + +/* SM501 Video Alpha Control */ +#define DCR80 0x0080 +#define DCR84 0x0084 +#define DCR88 0x0088 +#define DCR8C 0x008C +#define DCR90 0x0090 +#define DCR94 0x0094 +#define DCR98 0x0098 +#define DCR9C 0x009C +#define DCRA0 0x00A0 +#define DCRA4 0x00A4 + +/* SM501 Panel Cursor Control */ +#define DCRF0 0x00F0 +#define DCRF4 0x00F4 +#define DCRF8 0x00F8 +#define DCRFC 0x00FC + +/* SM 501 Alpha Control */ +#define DCR100 0x0100 +#define DCR104 0x0104 +#define DCR108 0x0108 +#define DCR10C 0x010C +#define DCR110 0x0110 +#define DCR114 0x0114 +#define DCR118 0x0118 + +/* SM 501 CRT Graphics Control */ +#define DCR200 0x0200 +#define DCR200_CRT_BLANK 0x00000400 +#define DCR200_CRT_GRAPHICS_PLN_FMT 0x00000003 +#define CRT_GRAPHICS_PLN_FMT_8 0x00 +#define CRT_GRAPHICS_PLN_FMT_16 0x01 +#define CRT_GRAPHICS_PLN_FMT_32 0x10 +#define DCR204 0x0204 +#define DCR208 0x0208 +#define DCR20C 0x020C +#define DCR210 0x0210 +#define DCR214 0x0214 +#define DCR218 0x0218 +#define DCR21C 0x021C +#define DCR220 0x0220 +#define DCR224 0x0224 + +/* SM 501 CRT Cursor Control */ +#define DCR230 0x0230 +#define DCR234 0x0234 +#define DCR238 0x0238 +#define DCR23C 0x023C + +/* SM 501 Palette Ram */ +#define DCR400 0x0400 /* Panel */ +#define DCR800 0x0800 /* Video */ +#define DCRC00 0x0C00 /* CRT */ + +/* HWCursor definitons for Panel AND CRT */ +#define SMI501_MASK_HWCENABLE 0x80000000 +#define SMI501_MASK_MAXBITS 0x000007FF +#define SMI501_MASK_BOUNDARY 0x00000800 +#define SMI501_HWCFBADDR_MASK 0x0CFFFFFF /* panel sizes returned by the bios */ @@ -268,5 +418,4 @@ #define PANEL_1600x1200 0x04 #define PANEL_1400x1050 0x0A - #endif /* _REGSMI_H */ Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.man diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.man:1.5 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.man:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.man:1.5 Wed Oct 8 07:13:01 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.man Mon Jan 9 09:59:58 2006 @@ -1,5 +1,4 @@ -.\" Header: //Mercury/Projects/archives/XFree86/4.0/siliconmotion.cpp-arc 1.4 29 Nov 2000 14:12:56 Frido $ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.man,v 1.5 2003/10/08 11:13:01 eich Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.man,v 1.6 2006/01/09 14:59:58 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH siliconmotion __drivermansuffix__ __vendorversion__ Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h:1.14 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h:1.18 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h:1.14 Wed Oct 8 07:13:01 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h Thu Mar 9 12:37:08 2006 @@ -1,5 +1,3 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi.h-arc 1.51 29 Nov 2000 17:45:16 Frido $ */ - /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. Copyright (C) 2000 Silicon Motion, Inc. All Rights Reserved. @@ -26,13 +24,11 @@ sale, use or other dealings in this Software without prior written authorization from the XFree86 Project and Silicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h,v 1.14 2003/10/08 11:13:01 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h,v 1.18 2006/03/09 17:37:08 tsi Exp $ */ #ifndef _SMI_H #define _SMI_H -#define USE_FB - #include "xf86.h" #include "xf86_OSproc.h" #include "xf86_ansic.h" @@ -46,16 +42,7 @@ #include "mipointer.h" #include "micmap.h" -#ifdef USE_FB #include "fb.h" -#else - -#define PSZ 8 -#include "cfb.h" -#undef PSZ -#include "cfb16.h" -#include "cfb24.h" -#endif #include "xaa.h" #include "xf86cmap.h" @@ -65,7 +52,7 @@ #include "vbe.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> /******************************************************************************/ /* D E F I N I T I O N S */ @@ -94,12 +81,12 @@ CARD8 CR90[16], CR9F_2; CARD8 CRA0[14]; CARD8 smiDACMask, smiDacRegs[256][3]; - /* CZ 2.11.2001: for gamma correction */ - CARD8 CCR66; - /* end CZ */ + /* CZ 2.11.2001: for gamma correction */ + CARD8 CCR66; + /* end CZ */ CARD8 smiFont[8192]; CARD32 DPR10, DPR1C, DPR20, DPR24, DPR28, DPR2C, DPR30, DPR3C, DPR40, - DPR44; + DPR44; CARD32 VPR00, VPR0C, VPR10; CARD32 CPR00; CARD32 FPR00_, FPR0C_, FPR10_; @@ -146,7 +133,12 @@ CARD8 * DPRBase; /* Base of DPR registers */ CARD8 * VPRBase; /* Base of VPR registers */ CARD8 * CPRBase; /* Base of CPR registers */ - CARD8 * FPRBase; /* Base of FPR registers - for 0730 chipset */ + CARD8 * FPRBase; /* Base of FPR registers - + for 0730 chipset */ + CARD8 * DCRBase; /* Base of DCR registers - + for 501 chipset */ + CARD8 * SCRBase; /* Base of SCR registers - + for 501 chipset */ CARD8 * DataPortBase; /* Base of data port */ int DataPortSize; /* Size of data port */ CARD8 * IOBase; /* Base of MMIO VGA ports */ @@ -157,7 +149,7 @@ CARD32 FBCursorOffset; /* Cursor storage location */ CARD32 FBReserved; /* Reserved memory in frame buffer */ - + Bool PrimaryVidMapped; /* Flag indicating if vgaHWMapMem was used successfully for @@ -183,7 +175,7 @@ Bool ShowCache; /* Debugging option */ Bool useBIOS; /* Use BIOS for mode sets */ Bool zoomOnLCD; /* Zoom on LCD */ - + CloseScreenProcPtr CloseScreen; /* Pointer used to save wrapped CloseScreen function */ XAAInfoRecPtr AccelInfoRec; /* XAA info Rec */ @@ -261,20 +253,23 @@ /******************************************************************************/ #if SMI_DEBUG -# define VERBLEV 1 -# define ENTER_PROC(PROCNAME) xf86ErrorFVerb(VERBLEV, "ENTER\t" PROCNAME \ - "(%d)\n", __LINE__); xf86Break1() -# define DEBUG_PROC(PROCNAME) xf86ErrorFVerb(VERBLEV, "DEBUG\t" PROCNAME \ - "(%d)\n", __LINE__); xf86Break2() -# define LEAVE_PROC(PROCNAME) xf86ErrorFVerb(VERBLEV, "LEAVE\t" PROCNAME \ - "(%d)\n", __LINE__); xf86Break1() -# define DEBUG(arg) xf86ErrorFVerb arg +# define VERBLEV 1 +# define ENTER_PROC(PROCNAME) \ + xf86ErrorFVerb(VERBLEV, "ENTER\t" PROCNAME "(%d)\n", __LINE__);\ + xf86Break1() +# define DEBUG_PROC(PROCNAME) \ + xf86ErrorFVerb(VERBLEV, "DEBUG\t" PROCNAME "(%d)\n", __LINE__);\ + xf86Break2() +# define LEAVE_PROC(PROCNAME) \ + xf86ErrorFVerb(VERBLEV, "LEAVE\t" PROCNAME "(%d)\n", __LINE__);\ + xf86Break1() +# define DEBUG(arg) xf86ErrorFVerb arg #else -# define VERBLEV 4 -# define ENTER_PROC(PROCNAME) -# define DEBUG_PROC(PROCNAME) -# define LEAVE_PROC(PROCNAME) -# define DEBUG(arg) +# define VERBLEV 4 +# define ENTER_PROC(PROCNAME) +# define DEBUG_PROC(PROCNAME) +# define LEAVE_PROC(PROCNAME) +# define DEBUG(arg) #endif /* Some Silicon Motion structs & registers */ @@ -326,9 +321,9 @@ /******************************************************************************/ /* smi_dac.c */ -void SMI_CommonCalcClock(int scrnIndex, long freq, int min_m, int min_n1, - int max_n1, int min_n2, int max_n2, long freq_min, - long freq_max, unsigned char * mdiv, +void SMI_CommonCalcClock(int scrnIndex, long freq, int min_m, int min_n1, + int max_n1, int min_n2, int max_n2, long freq_min, + long freq_max, unsigned char * mdiv, unsigned char * ndiv); /* smi_i2c */ Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_501.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_501.c:1.1 --- /dev/null Tue May 9 21:56:55 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_501.c Thu Mar 9 12:37:08 2006 @@ -0,0 +1,926 @@ +/* +Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. +Copyright (C) 2000 Silicon Motion, 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, FIT- +NESS 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 names of The XFree86 Project and +Silicon Motion 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 or Silicon Motion. +*/ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_501.c,v 1.1 2006/03/09 17:37:08 tsi Exp $ */ + +#include "xf86Resources.h" +#include "xf86RAC.h" +#include "xf86DDC.h" +#include "xf86int10.h" +#include "vbe.h" +#include "shadowfb.h" + +#include "smi.h" +#include "smi_501.h" + +#include "globals.h" +#define DPMS_SERVER +#include <X11/extensions/dpms.h> + +/* + * Forward definitions for the functions that make up the driver. + */ + +static VOID panelPowerSequence(SMIPtr pSmi, panel_state_t on_off, INT vsync_delay); +static VOID setDPMS(SMIPtr pSmi, DPMS_t state); +static VOID setPower(SMIPtr pSmi, ULONG nGates, ULONG Clock); + +/* + * Add comment here about this module. + */ + +/* Mode table. */ +static mode_table_t mode_table[] = +{ + /*---------------------------------------------------------------------------------------- + * H. H. H. H. H. V. V. V. V. V. Pixel H. V. + * tot. disp. sync sync sync tot. disp. sync sync sinc clock freq. freq. + * end start wdth polarity end start hght polarity + *---------------------------------------------------------------------------------------*/ + + /* 640 x 480 */ + { 800, 640, 656, 96, NEGATIVE, 525, 480, 490, 2, NEGATIVE, 25175000, 31469, 60 }, + { 832, 640, 664, 40, NEGATIVE, 520, 480, 489, 3, NEGATIVE, 31500000, 37861, 72 }, + { 840, 640, 656, 64, NEGATIVE, 500, 480, 481, 3, NEGATIVE, 31500000, 37500, 75 }, + { 832, 640, 696, 56, NEGATIVE, 509, 480, 481, 3, NEGATIVE, 36000000, 43269, 85 }, + + /* 800 x 600 */ + { 1024, 800, 824, 72, POSITIVE, 625, 600, 601, 2, POSITIVE, 36000000, 35156, 56 }, + { 1056, 800, 840, 128, POSITIVE, 628, 600, 601, 4, POSITIVE, 40000000, 37879, 60 }, + { 1040, 800, 856, 120, POSITIVE, 666, 600, 637, 6, POSITIVE, 50000000, 48077, 72 }, + { 1056, 800, 816, 80, POSITIVE, 625, 600, 601, 3, POSITIVE, 49500000, 46875, 75 }, + { 1048, 800, 832, 64, POSITIVE, 631, 600, 601, 3, POSITIVE, 56250000, 53674, 85 }, + + /* 1024 x 768*/ + { 1344, 1024, 1048, 136, NEGATIVE, 806, 768, 771, 6, NEGATIVE, 65000000, 48363, 60 }, + { 1328, 1024, 1048, 136, NEGATIVE, 806, 768, 771, 6, NEGATIVE, 75000000, 56476, 70 }, + { 1312, 1024, 1040, 96, POSITIVE, 800, 768, 769, 3, POSITIVE, 78750000, 60023, 75 }, + { 1376, 1024, 1072, 96, POSITIVE, 808, 768, 769, 3, POSITIVE, 94500000, 68677, 85 }, + + /* End of table. */ + { 0, 0, 0, 0, NEGATIVE, 0, 0, 0, 0, NEGATIVE, 0, 0, 0 }, +}; + +/********************************************************************** + * regRead32 + * Read the value of the 32-bit register specified by nOffset + **********************************************************************/ +static ULONG regRead32(SMIPtr pSmi, ULONG nOffset) +{ + ULONG result; + result = READ_SCR(pSmi, nOffset); + /* ErrorF("READ_SCR %8X from register %8X\n", result, nOffset); */ + return (result); +} + +/********************************************************************** + * regWrite32 + * Write the 32-bit value, nData, to the 32-bit register specified by + * nOffset + **********************************************************************/ +static void regWrite32(SMIPtr pSmi, ULONG nOffset, ULONG nData) +{ + /* ErrorF("MMIOWriting %8X to register %8X\n", nData, nOffset); */ + WRITE_SCR(pSmi, nOffset, nData); +} + +/* Perform a rounded division. */ +static LONG roundDiv(LONG num, LONG denom) +{ + /* n / d + 1 / 2 = (2n + d) / 2d */ + return (2 * num + denom) / (2 * denom); +} + +/* Finds clock closest to the requested. */ +static LONG findClock(LONG requested_clock, clock_select_t *clock, display_t display) +{ + LONG mclk; + INT divider, shift; + LONG best_diff = 999999999; + + /* Try 288MHz and 336MHz clocks. */ + for (mclk = 288000000; mclk <= 336000000; mclk += 48000000) + { + /* For CRT, try dividers 1 and 3, for panel, try divider 5 as well. */ + for (divider = 1; divider <= (display == PANEL ? 5 : 3); + divider += 2) + { + /* Try all 8 shift values. */ + for (shift = 0; shift < 8; shift++) + { + /* Calculate difference with requested clock. */ + LONG diff = roundDiv(mclk, divider << shift) - requested_clock; + if (diff < 0) + { + diff = -diff; + } + + /* If the difference is less than the current, use it. */ + if (diff < best_diff) + { + /* Store best difference. */ + best_diff = diff; + + /* Store clock values. */ + clock->mclk = mclk; + clock->divider = divider; + clock->shift = shift; + } + } + } + } + + /* Return best clock. */ + return clock->mclk / (clock->divider << clock->shift); +} + +/* Finds the requested mode in the mode table. */ +static mode_table_t *findMode(mode_table_t *mode_table, INT width, INT height, + INT refresh_rate) +{ + /* Walk the entire mode table. */ + while (mode_table->pixel_clock != 0) + { + /* If this mode matches the requested mode, return it! */ + if ((mode_table->horizontal_display_end == width) + && (mode_table->vertical_display_end == height) + && (mode_table->vertical_frequency == refresh_rate)) + { + return(mode_table); + } + + /* Next entry in the mode table. */ + mode_table++; + } + + /* No mode found. */ + return(NULL); +} + +/* Converts the VESA timing into Voyager timing. */ +static void adjustMode(mode_table_t *vesaMode, mode_table_t *mode, display_t display) +{ + LONG blank_width, sync_start, sync_width; + clock_select_t clock; + + /* Calculate the VESA line and screen frequencies. */ + vesaMode->horizontal_frequency = roundDiv(vesaMode->pixel_clock, + vesaMode->horizontal_total); + vesaMode->vertical_frequency = roundDiv(vesaMode->horizontal_frequency, + vesaMode->vertical_total); + + /* Calculate the sync percentages of the VESA mode. */ + blank_width = vesaMode->horizontal_total + - vesaMode->horizontal_display_end; + sync_start = roundDiv((vesaMode->horizontal_sync_start - + vesaMode->horizontal_display_end) * 100, blank_width); + sync_width = roundDiv(vesaMode->horizontal_sync_width * 100, blank_width); + + /* Copy VESA mode into Voyager mode. */ + *mode = *vesaMode; + + /* Find the best pixel clock. */ + mode->pixel_clock = findClock(vesaMode->pixel_clock * 2, &clock, display) / 2; + + /* Calculate the horizontal total based on the pixel clock and VESA line + * frequency. + */ + mode->horizontal_total = roundDiv(mode->pixel_clock, + vesaMode->horizontal_frequency); + + /* Calculate the sync start and width based on the VESA percentages. */ + blank_width = mode->horizontal_total - mode->horizontal_display_end; + mode->horizontal_sync_start = mode->horizontal_display_end + + roundDiv(blank_width * sync_start, 100); + mode->horizontal_sync_width = roundDiv(blank_width * sync_width, 100); + + /* Calculate the line and screen frequencies. */ + mode->horizontal_frequency = roundDiv(mode->pixel_clock, + mode->horizontal_total); + mode->vertical_frequency = roundDiv(mode->horizontal_frequency, + mode->vertical_total); +} + +/* Fill the register structure. */ +static void setModeRegisters(reg_table_t *register_table, mode_table_t *mode, + display_t display, INT bpp, INT fbPitch) +{ + clock_select_t clock; + memset(&clock, 0, sizeof(clock)); + + /* Calculate the clock register values. */ + findClock(mode->pixel_clock * 2, &clock, display); + + if (display == PANEL) + { + /* Set clock value for panel. */ + register_table->clock + = (clock.mclk == 288000000 + ? FIELD_SET(0, CURRENT_POWER_CLOCK, P2XCLK_SELECT, 288) + : FIELD_SET(0, CURRENT_POWER_CLOCK, P2XCLK_SELECT, 336)) + | (clock.divider == 1 + ? FIELD_SET(0, CURRENT_POWER_CLOCK, P2XCLK_DIVIDER, 1) + : (clock.divider == 3 + ? FIELD_SET(0, CURRENT_POWER_CLOCK, P2XCLK_DIVIDER, 3) + : FIELD_SET(0, CURRENT_POWER_CLOCK, P2XCLK_DIVIDER, 5))) + | FIELD_VALUE(0, CURRENT_POWER_CLOCK, P2XCLK_SHIFT, clock.shift); + + /* Set control register value. */ + register_table->control + = (mode->vertical_sync_polarity == POSITIVE + ? FIELD_SET(0, PANEL_DISPLAY_CTRL, VSYNC_PHASE, ACTIVE_HIGH) + : FIELD_SET(0, PANEL_DISPLAY_CTRL, VSYNC_PHASE, ACTIVE_LOW)) + | (mode->horizontal_sync_polarity == POSITIVE + ? FIELD_SET(0, PANEL_DISPLAY_CTRL, HSYNC_PHASE, ACTIVE_HIGH) + : FIELD_SET(0, PANEL_DISPLAY_CTRL, HSYNC_PHASE, ACTIVE_LOW)) + | FIELD_SET(0, PANEL_DISPLAY_CTRL, TIMING, ENABLE) + | FIELD_SET(0, PANEL_DISPLAY_CTRL, PLANE, ENABLE) + | (bpp == 8 + ? FIELD_SET(0, PANEL_DISPLAY_CTRL, FORMAT, 8) + : (bpp == 16 + ? FIELD_SET(0, PANEL_DISPLAY_CTRL, FORMAT, 16) + : FIELD_SET(0, PANEL_DISPLAY_CTRL, FORMAT, 32))); + + + + + /* Set timing registers. */ + register_table->horizontal_total + = FIELD_VALUE(0, PANEL_HORIZONTAL_TOTAL, TOTAL, + mode->horizontal_total - 1) + | FIELD_VALUE(0, PANEL_HORIZONTAL_TOTAL, DISPLAY_END, + mode->horizontal_display_end - 1); + + register_table->horizontal_sync + = FIELD_VALUE(0, PANEL_HORIZONTAL_SYNC, WIDTH, + mode->horizontal_sync_width) + | FIELD_VALUE(0, PANEL_HORIZONTAL_SYNC, START, + mode->horizontal_sync_start - 1); + + register_table->vertical_total + = FIELD_VALUE(0, PANEL_VERTICAL_TOTAL, TOTAL, + mode->vertical_total - 1) + | FIELD_VALUE(0, PANEL_VERTICAL_TOTAL, DISPLAY_END, + mode->vertical_display_end - 1); + + register_table->vertical_sync + = FIELD_VALUE(0, PANEL_VERTICAL_SYNC, HEIGHT, + mode->vertical_sync_height) + | FIELD_VALUE(0, PANEL_VERTICAL_SYNC, START, + mode->vertical_sync_start - 1); + } + else + { + /* Set clock value for CRT. */ + register_table->clock + = (clock.mclk == 288000000 + ? FIELD_SET(0, CURRENT_POWER_CLOCK, V2XCLK_SELECT, 288) + : FIELD_SET(0, CURRENT_POWER_CLOCK, V2XCLK_SELECT, 336)) + | (clock.divider == 1 + ? FIELD_SET(0, CURRENT_POWER_CLOCK, V2XCLK_DIVIDER, 1) + : FIELD_SET(0, CURRENT_POWER_CLOCK, V2XCLK_DIVIDER, 3)) + | FIELD_VALUE(0, CURRENT_POWER_CLOCK, V2XCLK_SHIFT, clock.shift); + + /* Set control register value.*/ + register_table->control + = (mode->vertical_sync_polarity == POSITIVE + ? FIELD_SET(0, CRT_DISPLAY_CTRL, VSYNC_PHASE, ACTIVE_HIGH) + : FIELD_SET(0, CRT_DISPLAY_CTRL, VSYNC_PHASE, ACTIVE_LOW)) + | (mode->horizontal_sync_polarity == POSITIVE + ? FIELD_SET(0, CRT_DISPLAY_CTRL, HSYNC_PHASE, ACTIVE_HIGH) + : FIELD_SET(0, CRT_DISPLAY_CTRL, HSYNC_PHASE, ACTIVE_LOW)) + | FIELD_SET(0, CRT_DISPLAY_CTRL, SELECT, CRT) + | FIELD_SET(0, CRT_DISPLAY_CTRL, TIMING, ENABLE) + | FIELD_SET(0, CRT_DISPLAY_CTRL, PLANE, ENABLE) + | (bpp == 8 + ? FIELD_SET(0, CRT_DISPLAY_CTRL, FORMAT, 8) + : (bpp == 16 + ? FIELD_SET(0, CRT_DISPLAY_CTRL, FORMAT, 16) + : FIELD_SET(0, CRT_DISPLAY_CTRL, FORMAT, 32))); + + /* Set timing registers. */ + register_table->horizontal_total + = FIELD_VALUE(0, CRT_HORIZONTAL_TOTAL, TOTAL, + mode->horizontal_total - 1) + | FIELD_VALUE(0, CRT_HORIZONTAL_TOTAL, DISPLAY_END, + mode->horizontal_display_end - 1); + + register_table->horizontal_sync + = FIELD_VALUE(0, CRT_HORIZONTAL_SYNC, WIDTH, + mode->horizontal_sync_width) + | FIELD_VALUE(0, CRT_HORIZONTAL_SYNC, START, + mode->horizontal_sync_start - 1); + + register_table->vertical_total + = FIELD_VALUE(0, CRT_VERTICAL_TOTAL, TOTAL, + mode->vertical_total - 1) + | FIELD_VALUE(0, CRT_VERTICAL_TOTAL, DISPLAY_END, + mode->vertical_display_end - 1); + register_table->vertical_sync + = FIELD_VALUE(0, CRT_VERTICAL_SYNC, HEIGHT, + mode->vertical_sync_height) + | FIELD_VALUE(0, CRT_VERTICAL_SYNC, START, + mode->vertical_sync_start - 1); + } + + /* Set up framebuffer pitch, from passed in value */ + register_table->fb_width = mode->horizontal_display_end * (bpp / 8); + register_table->fb_width = fbPitch; + + /* Calculate frame buffer width and height. */ + register_table->width = mode->horizontal_display_end; + register_table->height = mode->vertical_display_end; + + /* Save display type. */ + register_table->display = display; +} + +/* Program the mode with the registers specified. */ +static void programMode(SMIPtr pSmi, reg_table_t *register_table) +{ + DWORD value, gate, clock; + DWORD palette_ram; + DWORD fb_size, offset; + + /* Get current power configuration. */ + gate = regRead32(pSmi, CURRENT_POWER_GATE); + gate |= 0x08; /* Enable power to 2D engine */ + gate = FIELD_SET(gate, CURRENT_POWER_GATE, CSC, ENABLE); + gate = FIELD_SET(gate, CURRENT_POWER_GATE, ZVPORT, ENABLE); + gate = FIELD_SET(gate, CURRENT_POWER_GATE, GPIO_PWM_I2C, ENABLE); + + clock = regRead32(pSmi, CURRENT_POWER_CLOCK); + + clock = FIELD_SET(clock, CURRENT_POWER_CLOCK, MCLK_SELECT, 336); + clock = FIELD_SET(clock, CURRENT_POWER_CLOCK, MCLK_DIVIDER, 3); + clock = FIELD_SET(clock, CURRENT_POWER_CLOCK, MCLK_SHIFT, 0); + clock = FIELD_SET(clock, CURRENT_POWER_CLOCK, M2XCLK_SELECT, 336); + clock = FIELD_SET(clock, CURRENT_POWER_CLOCK, M2XCLK_DIVIDER, 1); + clock = FIELD_SET(clock, CURRENT_POWER_CLOCK, M2XCLK_SHIFT, 1); + + /* Program panel. */ + if (register_table->display == PANEL) + { + /* Program clock, enable display controller. */ + gate = FIELD_SET(gate, CURRENT_POWER_GATE, DISPLAY, ENABLE); + clock &= FIELD_CLEAR(CURRENT_POWER_CLOCK, P2XCLK_SELECT) + & FIELD_CLEAR(CURRENT_POWER_CLOCK, P2XCLK_DIVIDER) + & FIELD_CLEAR(CURRENT_POWER_CLOCK, P2XCLK_SHIFT); + setPower(pSmi, gate, clock | register_table->clock); + + /* Calculate frame buffer address. */ + value = 0; + fb_size = register_table->fb_width * register_table->height; + if (FIELD_GET(regRead32(pSmi, CRT_DISPLAY_CTRL), + CRT_DISPLAY_CTRL, + PLANE) == CRT_DISPLAY_CTRL_PLANE_ENABLE) + { + value = FIELD_GET(regRead32(pSmi, CRT_FB_ADDRESS), + CRT_FB_ADDRESS, + ADDRESS); + if (fb_size < value) + { + value = 0; + } + else + { + value += FIELD_GET(regRead32(pSmi, CRT_FB_WIDTH), + CRT_FB_WIDTH, + OFFSET) + * (FIELD_GET(regRead32(pSmi, CRT_VERTICAL_TOTAL), + CRT_VERTICAL_TOTAL, + DISPLAY_END) + 1); + } + } + + /* Program panel registers. */ + regWrite32(pSmi, PANEL_FB_ADDRESS, + FIELD_SET(0, PANEL_FB_ADDRESS, STATUS, PENDING) | + FIELD_SET(0, PANEL_FB_ADDRESS, EXT, LOCAL) | + FIELD_VALUE(0, PANEL_FB_ADDRESS, ADDRESS, value) ); + + regWrite32(pSmi, PANEL_FB_WIDTH, + FIELD_VALUE(0, PANEL_FB_WIDTH, WIDTH, + register_table->fb_width) | + FIELD_VALUE(0, PANEL_FB_WIDTH, OFFSET, + register_table->fb_width) ); + + regWrite32(pSmi, PANEL_WINDOW_WIDTH, + FIELD_VALUE(0, PANEL_WINDOW_WIDTH, WIDTH, + register_table->width) | + FIELD_VALUE(0, PANEL_WINDOW_WIDTH, X, 0) ); + + regWrite32(pSmi, PANEL_WINDOW_HEIGHT, + FIELD_VALUE(0, PANEL_WINDOW_HEIGHT, HEIGHT, + register_table->height) | + FIELD_VALUE(0, PANEL_WINDOW_HEIGHT, Y, 0) ); + + regWrite32(pSmi, PANEL_PLANE_TL, + FIELD_VALUE(0, PANEL_PLANE_TL, TOP, 0) | + FIELD_VALUE(0, PANEL_PLANE_TL, LEFT, 0) ); + + regWrite32(pSmi, PANEL_PLANE_BR, + FIELD_VALUE(0, PANEL_PLANE_BR, BOTTOM, + register_table->height - 1) | + FIELD_VALUE(0, PANEL_PLANE_BR, RIGHT, + register_table->width - 1) ); + + regWrite32(pSmi, PANEL_HORIZONTAL_TOTAL, + register_table->horizontal_total); + regWrite32(pSmi, PANEL_HORIZONTAL_SYNC, + register_table->horizontal_sync); + regWrite32(pSmi, PANEL_VERTICAL_TOTAL, + register_table->vertical_total); + regWrite32(pSmi, PANEL_VERTICAL_SYNC, + register_table->vertical_sync); + + /* Program panel display control register. */ + value = regRead32(pSmi, PANEL_DISPLAY_CTRL) + & FIELD_CLEAR(PANEL_DISPLAY_CTRL, VSYNC_PHASE) + & FIELD_CLEAR(PANEL_DISPLAY_CTRL, HSYNC_PHASE) + & FIELD_CLEAR(PANEL_DISPLAY_CTRL, TIMING) + & FIELD_CLEAR(PANEL_DISPLAY_CTRL, PLANE) + & FIELD_CLEAR(PANEL_DISPLAY_CTRL, FORMAT); + + regWrite32(pSmi, PANEL_DISPLAY_CTRL, + value | register_table->control); + + /* Palette RAM. */ + palette_ram = PANEL_PALETTE_RAM; + + /* Turn on panel. */ + panelPowerSequence(pSmi, PANEL_ON, 4); + } + + /* Program CRT. */ + else + { + /* Program clock, enable display controller. */ + gate = FIELD_SET(gate, CURRENT_POWER_GATE, DISPLAY, ENABLE); + clock &= FIELD_CLEAR(CURRENT_POWER_CLOCK, V2XCLK_SELECT) + & FIELD_CLEAR(CURRENT_POWER_CLOCK, V2XCLK_DIVIDER) + & FIELD_CLEAR(CURRENT_POWER_CLOCK, V2XCLK_SHIFT); + + setPower(pSmi, gate, clock | register_table->clock); + + /* Turn on DAC. */ + regWrite32(pSmi, MISC_CTRL, FIELD_SET(regRead32(pSmi, MISC_CTRL), + MISC_CTRL, + DAC_POWER, + ENABLE)); + + /* Calculate frame buffer address. */ + value = 0; + fb_size = register_table->fb_width * register_table->height; + if (FIELD_GET(regRead32(pSmi, PANEL_DISPLAY_CTRL), + PANEL_DISPLAY_CTRL, + PLANE) == PANEL_DISPLAY_CTRL_PLANE_ENABLE) + { + value = FIELD_GET(regRead32(pSmi, PANEL_FB_ADDRESS), + PANEL_FB_ADDRESS, + ADDRESS); + if (fb_size < value) + { + value = 0; + } + else + { + value += FIELD_GET(regRead32(pSmi, PANEL_FB_WIDTH), + PANEL_FB_WIDTH, + OFFSET) + * FIELD_GET(regRead32(pSmi, PANEL_WINDOW_HEIGHT), + PANEL_WINDOW_HEIGHT, + HEIGHT); + } + } + + /* Program CRT registers. */ + regWrite32(pSmi, CRT_FB_ADDRESS, + FIELD_SET(0, CRT_FB_ADDRESS, STATUS, PENDING) | + FIELD_SET(0, CRT_FB_ADDRESS, EXT, LOCAL) | + FIELD_VALUE(0, CRT_FB_ADDRESS, ADDRESS, value) ); + + regWrite32(pSmi, CRT_FB_WIDTH, + FIELD_VALUE(0, CRT_FB_WIDTH, WIDTH, + register_table->fb_width) | + FIELD_VALUE(0, CRT_FB_WIDTH, OFFSET, + register_table->fb_width) ); + + regWrite32(pSmi, CRT_HORIZONTAL_TOTAL, + register_table->horizontal_total); + regWrite32(pSmi, CRT_HORIZONTAL_SYNC, + register_table->horizontal_sync); + regWrite32(pSmi, CRT_VERTICAL_TOTAL, + register_table->vertical_total); + regWrite32(pSmi, CRT_VERTICAL_SYNC, + register_table->vertical_sync); + + /* Program CRT display control register. */ + value = regRead32(pSmi, CRT_DISPLAY_CTRL) + & FIELD_CLEAR(CRT_DISPLAY_CTRL, VSYNC_PHASE) + & FIELD_CLEAR(CRT_DISPLAY_CTRL, HSYNC_PHASE) + & FIELD_CLEAR(CRT_DISPLAY_CTRL, SELECT) + & FIELD_CLEAR(CRT_DISPLAY_CTRL, TIMING) + & FIELD_CLEAR(CRT_DISPLAY_CTRL, PLANE) + & FIELD_CLEAR(CRT_DISPLAY_CTRL, FORMAT); + + regWrite32(pSmi, CRT_DISPLAY_CTRL, + value | register_table->control); + + /* Palette RAM. */ + palette_ram = CRT_PALETTE_RAM; + + /* Turn on CRT. */ + setDPMS(pSmi, DPMS_ON); + } + + /* In case of 8-bpp, fill palette. */ + if (FIELD_GET(register_table->control, + PANEL_DISPLAY_CTRL, + FORMAT) == PANEL_DISPLAY_CTRL_FORMAT_8) + { + /* Start with RGB = 0,0,0. */ + BYTE red = 0, green = 0, blue = 0; + DWORD gray = 0; + for (offset = 0; offset < 256 * 4; offset += 4) + { + /* Store current RGB value. */ + /* ERROR!!!!! IGX RGB should be a function, maybe RGB16? + regWrite32(pSmi, (palette_ram + offset), + (gray ? (RGB((gray + 50) / 100, + (gray + 50) / 100, + (gray + 50) / 100)) + : (RGB(red, green, blue)))); + */ + + if (gray) + { + /* Walk through grays (40 in total). */ + gray += 654; + } + + else + { + /* Walk through colors (6 per base color). */ + if (blue != 255) + { + blue += 51; + } + else if (green != 255) + { + blue = 0; + green += 51; + } + else if (red != 255) + { + green = blue = 0; + red += 51; + } + else + { + gray = 1; + } + } + } + } + + /* For 16- and 32-bpp, fill palette with gamma values. */ + else + { + /* Start with RGB = 0,0,0. */ + value = 0x000000; + for (offset = 0; offset < 256 * 4; offset += 4) + { + regWrite32(pSmi, palette_ram + offset, value); + + /* Advance RGB by 1,1,1. */ + value += 0x010101; + } + } +} + +static VOID SetMode(SMIPtr pSmi, ULONG nWidth, ULONG nHeight, FLONG fMode, ULONG nHertz, display_t display, INT fbPitch, INT bpp) +{ + mode_table_t mode; + pmode_table_t vesaMode; + reg_table_t register_table; + + /* Locate the mode */ + vesaMode = findMode(mode_table, nWidth, nHeight, nHertz); + + if (vesaMode != NULL) + { + /* Convert VESA timing into Voyager timing */ + adjustMode(vesaMode, &mode, display); + + /* Fill the register structure */ + setModeRegisters(®ister_table, &mode, display, bpp, fbPitch); + + /* Program the registers */ + programMode(pSmi, ®ister_table); + } +} + +VOID panelSetMode(SMIPtr pSmi, ULONG nWidth, ULONG nHeight, FLONG fMode, ULONG nHertz, INT fbPitch, INT bpp) +{ + SetMode(pSmi, nWidth, nHeight, fMode, 60 /* was nHertz */, PANEL, fbPitch, bpp); +} + +VOID crtSetMode(SMIPtr pSmi, ULONG nWidth, ULONG nHeight, FLONG fMode, ULONG nHertz, INT fbPitch, INT bpp) +{ + SetMode(pSmi, nWidth, nHeight, fMode, nHertz, CRT, fbPitch, bpp); +} + +/* + * + * + * From POWER.C + * + * + */ + +/* Program new power mode. */ +static VOID setPower(SMIPtr pSmi, ULONG nGates, ULONG Clock) +{ + ULONG gate_reg, clock_reg; + ULONG control_value; + + /* Get current power mode. */ + control_value = FIELD_GET(regRead32(pSmi, POWER_MODE_CTRL), + POWER_MODE_CTRL, + MODE); + + switch (control_value) + { + case POWER_MODE_CTRL_MODE_MODE0: + + /* Switch from mode 0 to mode 1. */ + gate_reg = POWER_MODE1_GATE; + clock_reg = POWER_MODE1_CLOCK; + control_value = FIELD_SET(control_value, + POWER_MODE_CTRL, MODE, MODE1); + break; + + case POWER_MODE_CTRL_MODE_MODE1: + case POWER_MODE_CTRL_MODE_SLEEP: + + /* Switch from mode 1 or sleep to mode 0. */ + gate_reg = POWER_MODE0_GATE; + clock_reg = POWER_MODE0_CLOCK; + control_value = FIELD_SET(control_value, POWER_MODE_CTRL, MODE, MODE0); + break; + + default: + /* Invalid mode */ + return; + } + + /* Program new power mode. */ + regWrite32(pSmi, gate_reg, nGates); + regWrite32(pSmi, clock_reg, Clock); + regWrite32(pSmi, POWER_MODE_CTRL, control_value); + + /* When returning from sleep, wait until finished. */ + /* IGX -- comment out for now, gets us in an infinite loop! + while (FIELD_GET(regRead32(pSmi, POWER_MODE_CTRL), + POWER_MODE_CTRL, + SLEEP_STATUS) == POWER_MODE_CTRL_SLEEP_STATUS_ACTIVE) ; + */ +} + +/* Set DPMS state. */ +static VOID setDPMS(SMIPtr pSmi, DPMS_t state) +{ + ULONG value; + + value = regRead32(pSmi, SYSTEM_CTRL); + switch (state) + { + case DPMS_ON: + value = FIELD_SET(value, SYSTEM_CTRL, DPMS, VPHP); + break; + + case DPMS_STANDBY: + value = FIELD_SET(value, SYSTEM_CTRL, DPMS, VPHN); + break; + + case DPMS_SUSPEND: + value = FIELD_SET(value, SYSTEM_CTRL, DPMS, VNHP); + break; + + case DPMS_OFF: + value = FIELD_SET(value, SYSTEM_CTRL, DPMS, VNHN); + break; + } + + regWrite32(pSmi, SYSTEM_CTRL, value); +} + +/* Panel Code */ + +/********************************************************************** + * + * panelWaitVSync + * + * Purpose + * Wait for the specified number of panel Vsyncs + * + * Parameters + * [in] + * vsync_count - Number of Vsyncs to wait + * + * [out] + * None + * + * Returns + * Nothing + * + **********************************************************************/ +static VOID panelWaitVSync(SMIPtr pSmi, INT vsync_count) +{ + ULONG status; + ULONG timeout; + + while (vsync_count-- > 0) + { + /* Wait for end of vsync */ + timeout = 0; + do + { + status = FIELD_GET(regRead32(pSmi, CMD_INTPR_STATUS), + CMD_INTPR_STATUS, + PANEL_SYNC); + if (++timeout == VSYNCTIMEOUT) + break; + } + while (status == CMD_INTPR_STATUS_PANEL_SYNC_ACTIVE); + + /* Wait for start of vsync */ + timeout = 0; + do + { + status = FIELD_GET(regRead32(pSmi, CMD_INTPR_STATUS), + CMD_INTPR_STATUS, + PANEL_SYNC); + if (++timeout == VSYNCTIMEOUT) + break; + } + while (status == CMD_INTPR_STATUS_PANEL_SYNC_INACTIVE); + } +} + +/********************************************************************** + * + * panelPowerSequence + * + * Purpose + * Turn the panel On/Off + * + * Parameters + * [in] + * on_off - Turn panel On/Off. Can be: + * PANEL_ON + * PANEL_OFF + * vsync_delay - Number of Vsyncs to wait after each signal is + * turned on/off + * + * [out] + * None + * + * Returns + * Nothing + * + **********************************************************************/ +static VOID panelPowerSequence(SMIPtr pSmi, panel_state_t on_off, INT vsync_delay) +{ + ULONG panelControl = regRead32(pSmi, PANEL_DISPLAY_CTRL); + + if (on_off == PANEL_ON) + { + /* Turn on FPVDDEN. */ + panelControl = FIELD_SET(panelControl, + PANEL_DISPLAY_CTRL, FPVDDEN, HIGH); + regWrite32(pSmi, PANEL_DISPLAY_CTRL, panelControl); + panelWaitVSync(pSmi, vsync_delay); + + /* Turn on FPDATA. */ + panelControl = FIELD_SET(panelControl, + PANEL_DISPLAY_CTRL, DATA, ENABLE); + regWrite32(pSmi, PANEL_DISPLAY_CTRL, panelControl); + panelWaitVSync(pSmi, vsync_delay); + + /* Turn on FPVBIAS. */ + panelControl = FIELD_SET(panelControl, + PANEL_DISPLAY_CTRL, VBIASEN, HIGH); + regWrite32(pSmi, PANEL_DISPLAY_CTRL, panelControl); + panelWaitVSync(pSmi, vsync_delay); + + /* Turn on FPEN. */ + panelControl = FIELD_SET(panelControl, + PANEL_DISPLAY_CTRL, FPEN, HIGH); + regWrite32(pSmi, PANEL_DISPLAY_CTRL, panelControl); + } + + else + { + /* Turn off FPEN. */ + panelControl = FIELD_SET(panelControl, + PANEL_DISPLAY_CTRL, FPEN, LOW); + regWrite32(pSmi, PANEL_DISPLAY_CTRL, panelControl); + panelWaitVSync(pSmi, vsync_delay); + + /* Turn off FPVBIASEN. */ + panelControl = FIELD_SET(panelControl, + PANEL_DISPLAY_CTRL, VBIASEN, LOW); + regWrite32(pSmi, PANEL_DISPLAY_CTRL, panelControl); + panelWaitVSync(pSmi, vsync_delay); + + /* Turn off FPDATA. */ + panelControl = FIELD_SET(panelControl, + PANEL_DISPLAY_CTRL, DATA, DISABLE); + regWrite32(pSmi, PANEL_DISPLAY_CTRL, panelControl); + panelWaitVSync(pSmi, vsync_delay); + + /* Turn off FPVDDEN. */ + panelControl = FIELD_SET(panelControl, + PANEL_DISPLAY_CTRL, FPVDDEN, LOW); + regWrite32(pSmi, PANEL_DISPLAY_CTRL, panelControl); + } +} + +/********************************************************************** + * + * panelUseCRT + * + * Purpose + * Enable/disable routing of panel output to CRT monitor + * + * Parameters + * [in] + * bEnable - TRUE enables routing of panel output to CRT monitor + * FALSE disables routing of panel output to CRT monitor + * + * [out] + * None + * + * Returns + * Nothing + * + **********************************************************************/ +VOID panelUseCRT(SMIPtr pSmi, BOOL bEnable) +{ + ULONG panel_ctrl = 0; + ULONG crt_ctrl = 0; + + panel_ctrl = regRead32(pSmi, PANEL_DISPLAY_CTRL); + crt_ctrl = regRead32(pSmi, CRT_DISPLAY_CTRL); + + if (bEnable) + { + /* Enable panel graphics plane */ + panel_ctrl = FIELD_SET(panel_ctrl, PANEL_DISPLAY_CTRL, PLANE, ENABLE); + + /* Disable CRT graphics plane */ + crt_ctrl = FIELD_SET(crt_ctrl, CRT_DISPLAY_CTRL, PLANE, DISABLE); + + /* Route panel data to CRT monitor */ + crt_ctrl = FIELD_SET(crt_ctrl, CRT_DISPLAY_CTRL, SELECT, PANEL); + } + else + { + /* Disable panel graphics plane */ + panel_ctrl = FIELD_SET(panel_ctrl, PANEL_DISPLAY_CTRL, PLANE, DISABLE); + + /* Enable CRT graphics plane */ + crt_ctrl = FIELD_SET(crt_ctrl, CRT_DISPLAY_CTRL, PLANE, ENABLE); + + /* Do not route panel data to CRT monitor */ + crt_ctrl = FIELD_SET(crt_ctrl, CRT_DISPLAY_CTRL, SELECT, CRT); + } + + regWrite32(pSmi, PANEL_DISPLAY_CTRL, panel_ctrl); + regWrite32(pSmi, CRT_DISPLAY_CTRL, crt_ctrl); +} Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_501.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_501.h:1.1 --- /dev/null Tue May 9 21:56:55 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_501.h Thu Mar 9 12:37:08 2006 @@ -0,0 +1,1223 @@ +/* +Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. +Copyright (C) 2000 Silicon Motion, 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, FIT- +NESS 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 names of the XFree86 Project and +Silicon Motion 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 and Silicon Motion. +*/ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_501.h,v 1.1 2006/03/09 17:37:08 tsi Exp $ */ + +#ifndef _SMI_501_H +#define _SMI_501_H + + +/******************************************************************************/ +/* D E F I N I T I O N S */ +/******************************************************************************/ + +#define INT int +#define LONG int +#define DWORD unsigned int +#define ULONG unsigned int +#define FLONG unsigned int +#define VOID void +#define PUCHAR unsigned char * +#define UCHAR unsigned char + +#define USE_CRYSTAL_12 0 /* Use PLL with 12MHz crystal instead of test clock. */ +#define USE_CRYSTAL_24 1 /* Use PLL with 24MHz crystal instead of test clock. */ + +/* Power constants to use with setDPMS function. */ +typedef enum _DPMS_t +{ + DPMS_ON, + DPMS_STANDBY, + DPMS_SUSPEND, + DPMS_OFF +} +DPMS_t; + +/* Display type constants to use with setMode function and others. */ +typedef enum _display_t +{ + PANEL = 0, + CRT = 1 +} +display_t; + +/* Type of LCD display */ +typedef enum _lcd_display_t +{ + LCD_TFT = 0, + LCD_STN_8 = 2, + LCD_STN_12 = 3 +} +lcd_display_t; + +/* Polarity constants. */ +typedef enum _polarity_t +{ + POSITIVE, + NEGATIVE +} +polarity_t; + +/* RGB color structure. */ +typedef struct { + UCHAR cBlue; + UCHAR cGreen; + UCHAR cRed; + UCHAR cFiller; +} RGB; + +/* Format of mode table record */ +typedef struct _mode_table_t +{ + /* Horizontal timing */ + INT horizontal_total; + INT horizontal_display_end; + INT horizontal_sync_start; + INT horizontal_sync_width; + polarity_t horizontal_sync_polarity; + + /* Vertical timing. */ + INT vertical_total; + INT vertical_display_end; + INT vertical_sync_start; + INT vertical_sync_height; + polarity_t vertical_sync_polarity; + + /* Refresh timing. */ + LONG pixel_clock; + LONG horizontal_frequency; + LONG vertical_frequency; +} +mode_table_t, *pmode_table_t; + +/* Clock value structure. */ +typedef struct clock_select_t +{ + LONG mclk; + INT divider; + INT shift; +} +clock_select_t, *pclock_select_t; + +/* Registers necessary to set mode. */ +typedef struct _reg_table_t +{ + DWORD clock; + DWORD control; + DWORD fb_width; + DWORD horizontal_total; + DWORD horizontal_sync; + DWORD vertical_total; + DWORD vertical_sync; + DWORD width; + DWORD height; + display_t display; +} +reg_table_t, *preg_table_t; + +/* Structure used to initialize CRT hardware module */ +typedef struct +{ + ULONG mask; /* Holds flags indicating which register bitfields to init */ + ULONG fifo_level; /* FIFO request level */ + ULONG tvp; /* TV clock phase select */ + ULONG cp; /* CRT clock phase select */ + ULONG blank; /* CRT data blanking */ + ULONG format; /* CRT graphics plane format */ +} init_crt, *pinit_crt; + +/* Structure used to initialize CRT cursor hardware module */ +typedef struct +{ + ULONG mask; /* Holds flags indicating which register bitfields to init */ +} init_crt_hwc, *pinit_crt_hwc; + +/* Panel On/Off constants to use with panelPowerSequence. */ +typedef enum _panel_state_t +{ + PANEL_OFF, + PANEL_ON +} +panel_state_t; + +/******************************************************************************/ +/* M A C R O S */ +/******************************************************************************/ +/* Direct register access macro */ +#define REG_READ8(r) (*(volatile PUCHAR) &g_pRegisters[r]) +#define REG_READ16(r) (*(volatile PUSHORT) &g_pRegisters[r]) +#define REG_READ32(r) (*(volatile PULONG) &g_pRegisters[r]) +#define REG_WRITE8(r,v) {*(volatile PUCHAR) &g_pRegisters[r] = (v);} +#define REG_WRITE16(r,v) {*(volatile PUSHORT) &g_pRegisters[r] = (v);} +#define REG_WRITE32(r,v) {*(volatile PULONG) &g_pRegisters[r] = (v);} + +/* Internal macros */ +#define _F_START(f) (0 ? f) +#define _F_END(f) (1 ? f) +#define _F_SIZE(f) (1 + _F_END(f) - _F_START(f)) +#define _F_MASK(f) (((1 << _F_SIZE(f)) - 1) << _F_START(f)) +#define _F_NORMALIZE(v, f) (((v) & _F_MASK(f)) >> _F_START(f)) +#define _F_DENORMALIZE(v, f) (((v) << _F_START(f)) & _F_MASK(f)) + +/* Global macros */ +#define FIELD_GET(x, reg, field) \ +( \ + _F_NORMALIZE((x), reg ## _ ## field) \ +) + +#define FIELD_SET(x, reg, field, value) \ +( \ + (x & ~_F_MASK(reg ## _ ## field)) \ + | _F_DENORMALIZE(reg ## _ ## field ## _ ## value, reg ## _ ## field) \ +) + +#define FIELD_VALUE(x, reg, field, value) \ +( \ + (x & ~_F_MASK(reg ## _ ## field)) \ + | _F_DENORMALIZE(value, reg ## _ ## field) \ +) + +#define FIELD_CLEAR(reg, field) \ +( \ + ~ _F_MASK(reg ## _ ## field) \ +) + +/* Field Macros */ +#define FIELD_START(field) (0 ? field) +#define FIELD_END(field) (1 ? field) +#define FIELD_SIZE(field) (1 + FIELD_END(field) - FIELD_START(field)) +#define FIELD_MASK(field) (((1 << (FIELD_SIZE(field)-1)) | ((1 << (FIELD_SIZE(field)-1)) - 1)) << FIELD_START(field)) +#define FIELD_NORMALIZE(reg, field) (((reg) & FIELD_MASK(field)) >> FIELD_START(field)) +#define FIELD_DENORMALIZE(field, value) (((value) << FIELD_START(field)) & FIELD_MASK(field)) + +#define FIELD_INIT(reg, field, value) FIELD_DENORMALIZE(reg ## _ ## field, \ + reg ## _ ## field ## _ ## value) +#define FIELD_INIT_VAL(reg, field, value) \ + (FIELD_DENORMALIZE(reg ## _ ## field, value)) +#define FIELD_VAL_SET(x, r, f, v) x = x & ~FIELD_MASK(r ## _ ## f) \ + +/******************************************************************************/ +/* F U N C T I O N P R O T O T Y P E S */ +/******************************************************************************/ + +/* Init flags and values used in init_crt structure */ +#define DISP_CRT_TVP 0x00000100 /* TV clock phase select */ +#define DISP_CRT_TVP_HIGH 0x00000000 +#define DISP_CRT_TVP_LOW 0x00008000 + +#define DISP_CRT_CP 0x00000200 /* CRT clock phase select */ +#define DISP_CRT_CP_HIGH 0x00000000 +#define DISP_CRT_CP_LOW 0x00004000 + +#define DISP_CRT_BLANK 0x00000400 /* CRT data blanking */ +#define DISP_CRT_BLANK_OFF 0x00000000 +#define DISP_CRT_BLANK_ON 0x00000400 + +#define DISP_CRT_FORMAT 0x00000800 /* CRT graphics plane format */ +#define DISP_CRT_FORMAT_8 0x00000000 +#define DISP_CRT_FORMAT_16 0x00000001 +#define DISP_CRT_FORMAT_32 0x00000002 + +#define DISP_MODE_8_BPP 0 /* 8 bits per pixel i8RGB */ +#define DISP_MODE_16_BPP 1 /* 16 bits per pixel RGB565 */ +#define DISP_MODE_32_BPP 2 /* 32 bits per pixel RGB888 */ +#define DISP_MODE_YUV 3 /* 16 bits per pixel YUV422 */ +#define DISP_MODE_ALPHA_8 4 /* 8 bits per pixel a4i4RGB */ +#define DISP_MODE_ALPHA_16 5 /* 16 bits per pixel a4RGB444 */ + +#define DISP_PAN_LEFT 0 /* Pan left */ +#define DISP_PAN_RIGHT 1 /* Pan right */ +#define DISP_PAN_UP 2 /* Pan upwards */ +#define DISP_PAN_DOWN 3 /* Pan downwards */ + +#define DISP_DPMS_QUERY -1 /* Query DPMS value */ +#define DISP_DPMS_ON 0 /* DPMS on */ +#define DISP_DPMS_STANDBY 1 /* DPMS standby */ +#define DISP_DPMS_SUSPEND 2 /* DPMS suspend */ +#define DISP_DPMS_OFF 3 /* DPMS off */ + +#define DISP_DELAY_DEFAULT 0 /* Default delay */ + +#define DISP_HVTOTAL_UNKNOWN -1 /* Used in panelSetTiming, crtSetTiming if */ + /* nHTotal, nVTotal not specified by user */ +#define DISP_HVTOTAL_SCALEFACTOR 1.25 /* Used in panelSetTiming, crtSetTiming if */ + /* nHTotal, nVTotal not specified by user */ + +#define VGX_SIGNAL_PANEL_VSYNC 100 /* Panel VSYNC */ +#define VGX_SIGNAL_PANEL_PAN 101 /* Panel auto panning complete */ +#define VGX_SIGNAL_CRT_VSYNC 102 /* CRT VSYNC */ + +#define VSYNCTIMEOUT 10000 + +#define ALPHA_MODE_PER_PIXEL 0 /* Use per-pixel alpha values */ +#define ALPHA_MODE_ALPHA 1 /* Use alpha value specified in Alpha bitfield */ +#define ALPHA_COLOR_LUT_SIZE 16 /* Number of colors in alpha/video alpha palette */ + +#define HWC_ON_SCREEN 0 /* Cursor is within screen top/left boundary */ +#define HWC_OFF_SCREEN 1 /* Cursor is outside screen top/left boundary */ +#define HWC_NUM_COLORS 3 /* Number of cursor colors */ + +#define RGB565_R_MASK 0xF8 /* Mask for red color */ +#define RGB565_G_MASK 0xFC /* Mask for green color */ +#define RGB565_B_MASK 0xF8 /* Mask for blue color */ + +#define RGB565_R_SHIFT 8 /* Number of bits to shift for red color */ +#define RGB565_G_SHIFT 3 /* Number of bits to shift for green color */ +#define RGB565_B_SHIFT 3 /* Number of bits to shift for blue color */ + +#define RGB16(r, g, b) \ +( \ + (unsigned short) ((((r) & RGB565_R_MASK) << RGB565_R_SHIFT) | \ + (((g) & RGB565_G_MASK) << RGB565_G_SHIFT) | \ + (((b) & RGB565_B_MASK) >> RGB565_B_SHIFT)) \ +) + +/* Initialize the panel hardware module */ + +/* Initialize the CRT hardware module */ +VOID crtInit(pinit_crt init); +/* Enable CRT gamma control (RGB 5:6:5 and RGB 8:8:8 modes only) */ +VOID crtSetMode(SMIPtr pSmi, ULONG nWidth, ULONG nHeight, FLONG fMode, ULONG nHertz, INT fbPitch, INT bpp); +/* Get and/or set CRT DPMS.*/ +ULONG crtDPMS(LONG nDPMS); +/* Set CRT frame buffer pointer. */ +VOID crtSetTiming(ULONG nHDisplay, ULONG nHTotal, ULONG nHSyncStart, + ULONG nHSyncEnd, ULONG nVDisplay, ULONG nVTotal, + ULONG nVSyncStart, ULONG nVSyncEnd, ULONG nPixelClock, + ULONG nHPolarity, ULONG nVPolarity); +/* Get CRT LUT palette. */ +VOID crtHwcInit(pinit_crt_hwc init); +/* Enable CRT hardware cursor */ +VOID crtHwcEnable(VOID); +/* Disable CRT hardware cursor */ +VOID crtHwcDisable(VOID); +/* Set CRT pointer shape and/or colors. */ +VOID crtPointerShape(PUCHAR pShape, INT nWidth, INT nHeight, INT nHotX, + INT nHotY, RGB rgbColor[3]); +/* Set CRT cursor on-screen position. */ +VOID crtPointerPosition(INT nX, INT nY, INT nTopSelect, INT nLeftSelect); +/* Set CRT cursor on-screen position. */ +VOID crtHwcSetPosition(INT nX, INT nY, INT nTopSelect, INT nLeftSelect); +/* Set CRT cursor colors */ +VOID crtHwcSetColors(RGB rgbColor[HWC_NUM_COLORS]); + +/* Route Panel data to CRT for Simultaneous mode */ +VOID panelUseCRT(SMIPtr pSmi, BOOL bEnable); +/* Enable panel gamma control (RGB 5:6:5 and RGB 8:8:8 modes only) */ +VOID panelSetMode(SMIPtr pSmi, ULONG nWidth, ULONG nHeight, FLONG fMode, ULONG nHertz, INT fbPitch, INT bpp); + +/* REGISTER DEFINITIONS */ + +/* regSC.h */ +#define SYSTEM_CTRL 0x000000 +#define SYSTEM_CTRL_DPMS 31:30 +#define SYSTEM_CTRL_DPMS_VPHP 0 +#define SYSTEM_CTRL_DPMS_VPHN 1 +#define SYSTEM_CTRL_DPMS_VNHP 2 +#define SYSTEM_CTRL_DPMS_VNHN 3 +#define SYSTEM_CTRL_PCI_BURST 29:29 +#define SYSTEM_CTRL_PCI_BURST_DISABLE 0 +#define SYSTEM_CTRL_PCI_BURST_ENABLE 1 +#define SYSTEM_CTRL_CSC_STATUS 28:28 +#define SYSTEM_CTRL_CSC_STATUS_IDLE 0 +#define SYSTEM_CTRL_CSC_STATUS_BUSY 1 +#define SYSTEM_CTRL_PCI_MASTER 25:25 +#define SYSTEM_CTRL_PCI_MASTER_STOP 0 +#define SYSTEM_CTRL_PCI_MASTER_START 1 +#define SYSTEM_CTRL_LATENCY_TIMER 24:24 +#define SYSTEM_CTRL_LATENCY_TIMER_ENABLE 0 +#define SYSTEM_CTRL_LATENCY_TIMER_DISABLE 1 +#define SYSTEM_CTRL_PANEL_STATUS 23:23 +#define SYSTEM_CTRL_PANEL_STATUS_CURRENT 0 +#define SYSTEM_CTRL_PANEL_STATUS_PENDING 1 +#define SYSTEM_CTRL_VIDEO_STATUS 22:22 +#define SYSTEM_CTRL_VIDEO_STATUS_CURRENT 0 +#define SYSTEM_CTRL_VIDEO_STATUS_PENDING 1 +#define SYSTEM_CTRL_DE_FIFO 20:20 +#define SYSTEM_CTRL_DE_FIFO_NOT_EMPTY 0 +#define SYSTEM_CTRL_DE_FIFO_EMPTY 1 +#define SYSTEM_CTRL_DE_STATUS 19:19 +#define SYSTEM_CTRL_DE_STATUS_IDLE 0 +#define SYSTEM_CTRL_DE_STATUS_BUSY 1 +#define SYSTEM_CTRL_CRT_STATUS 17:17 +#define SYSTEM_CTRL_CRT_STATUS_CURRENT 0 +#define SYSTEM_CTRL_CRT_STATUS_PENDING 1 +#define SYSTEM_CTRL_ZVPORT 16:16 +#define SYSTEM_CTRL_ZVPORT_0 0 +#define SYSTEM_CTRL_ZVPORT_1 1 +#define SYSTEM_CTRL_PCI_BURST_READ 15:15 +#define SYSTEM_CTRL_PCI_BURST_READ_DISABLE 0 +#define SYSTEM_CTRL_PCI_BURST_READ_ENABLE 1 +#define SYSTEM_CTRL_DE_ABORT 13:12 +#define SYSTEM_CTRL_DE_ABORT_NORMAL 0 +#define SYSTEM_CTRL_DE_ABORT_2D_ABORT 3 +#define SYSTEM_CTRL_PCI_SUBSYS_LOCK 11:11 +#define SYSTEM_CTRL_PCI_SUBSYS_LOCK_DISABLE 0 +#define SYSTEM_CTRL_PCI_SUBSYS_LOCK_ENABLE 1 +#define SYSTEM_CTRL_PCI_RETRY 7:7 +#define SYSTEM_CTRL_PCI_RETRY_ENABLE 0 +#define SYSTEM_CTRL_PCI_RETRY_DISABLE 1 +#define SYSTEM_CTRL_PCI_CLOCK_RUN 6:6 +#define SYSTEM_CTRL_PCI_CLOCK_RUN_DISABLE 0 +#define SYSTEM_CTRL_PCI_CLOCK_RUN_ENABLE 1 +#define SYSTEM_CTRL_PCI_SLAVE_BURST_READ_SIZE 5:4 +#define SYSTEM_CTRL_PCI_SLAVE_BURST_READ_SIZE_1 0 +#define SYSTEM_CTRL_PCI_SLAVE_BURST_READ_SIZE_2 1 +#define SYSTEM_CTRL_PCI_SLAVE_BURST_READ_SIZE_4 2 +#define SYSTEM_CTRL_PCI_SLAVE_BURST_READ_SIZE_8 3 +#define SYSTEM_CTRL_CRT_TRISTATE 2:2 +#define SYSTEM_CTRL_CRT_TRISTATE_DISABLE 0 +#define SYSTEM_CTRL_CRT_TRISTATE_ENABLE 1 +#define SYSTEM_CTRL_INTMEM_TRISTATE 1:1 +#define SYSTEM_CTRL_INTMEM_TRISTATE_DISABLE 0 +#define SYSTEM_CTRL_INTMEM_TRISTATE_ENABLE 1 +#define SYSTEM_CTRL_PANEL_TRISTATE 0:0 +#define SYSTEM_CTRL_PANEL_TRISTATE_DISABLE 0 +#define SYSTEM_CTRL_PANEL_TRISTATE_ENABLE 1 + +#define CURRENT_POWER_CLOCK 0x00003C +#define CURRENT_POWER_CLOCK_P2XCLK_SELECT 29:29 +#define CURRENT_POWER_CLOCK_P2XCLK_SELECT_288 0 +#define CURRENT_POWER_CLOCK_P2XCLK_SELECT_336 1 +#define CURRENT_POWER_CLOCK_P2XCLK_DIVIDER 28:27 +#define CURRENT_POWER_CLOCK_P2XCLK_DIVIDER_1 0 +#define CURRENT_POWER_CLOCK_P2XCLK_DIVIDER_3 1 +#define CURRENT_POWER_CLOCK_P2XCLK_DIVIDER_5 2 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT 26:24 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_0 0 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_1 1 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_2 2 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_3 3 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_4 4 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_5 5 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_6 6 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_7 7 +#define CURRENT_POWER_CLOCK_V2XCLK_SELECT 20:20 +#define CURRENT_POWER_CLOCK_V2XCLK_SELECT_288 0 +#define CURRENT_POWER_CLOCK_V2XCLK_SELECT_336 1 +#define CURRENT_POWER_CLOCK_V2XCLK_DIVIDER 19:19 +#define CURRENT_POWER_CLOCK_V2XCLK_DIVIDER_1 0 +#define CURRENT_POWER_CLOCK_V2XCLK_DIVIDER_3 1 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT 18:16 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_0 0 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_1 1 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_2 2 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_3 3 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_4 4 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_5 5 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_6 6 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_7 7 +#define CURRENT_POWER_CLOCK_MCLK_SELECT 12:12 +#define CURRENT_POWER_CLOCK_MCLK_SELECT_288 0 +#define CURRENT_POWER_CLOCK_MCLK_SELECT_336 1 +#define CURRENT_POWER_CLOCK_MCLK_DIVIDER 11:11 +#define CURRENT_POWER_CLOCK_MCLK_DIVIDER_1 0 +#define CURRENT_POWER_CLOCK_MCLK_DIVIDER_3 1 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT 10:8 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_0 0 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_1 1 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_2 2 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_3 3 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_4 4 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_5 5 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_6 6 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_7 7 +#define CURRENT_POWER_CLOCK_M2XCLK_SELECT 4:4 +#define CURRENT_POWER_CLOCK_M2XCLK_SELECT_288 0 +#define CURRENT_POWER_CLOCK_M2XCLK_SELECT_336 1 +#define CURRENT_POWER_CLOCK_M2XCLK_DIVIDER 3:3 +#define CURRENT_POWER_CLOCK_M2XCLK_DIVIDER_1 0 +#define CURRENT_POWER_CLOCK_M2XCLK_DIVIDER_3 1 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT 2:0 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_0 0 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_1 1 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_2 2 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_3 3 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_4 4 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_5 5 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_6 6 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_7 7 + +#define CURRENT_POWER_GATE 0x000038 +#define CURRENT_POWER_GATE_AC97_I2S 18:18 +#define CURRENT_POWER_GATE_AC97_I2S_DISABLE 0 +#define CURRENT_POWER_GATE_AC97_I2S_ENABLE 1 +#define CURRENT_POWER_GATE_8051 17:17 +#define CURRENT_POWER_GATE_8051_DISABLE 0 +#define CURRENT_POWER_GATE_8051_ENABLE 1 +#define CURRENT_POWER_GATE_PLL 16:16 +#define CURRENT_POWER_GATE_PLL_DISABLE 0 +#define CURRENT_POWER_GATE_PLL_ENABLE 1 +#define CURRENT_POWER_GATE_OSCILLATOR 15:15 +#define CURRENT_POWER_GATE_OSCILLATOR_DISABLE 0 +#define CURRENT_POWER_GATE_OSCILLATOR_ENABLE 1 +#define CURRENT_POWER_GATE_PLL_RECOVERY 14:13 +#define CURRENT_POWER_GATE_PLL_RECOVERY_32 0 +#define CURRENT_POWER_GATE_PLL_RECOVERY_64 1 +#define CURRENT_POWER_GATE_PLL_RECOVERY_96 2 +#define CURRENT_POWER_GATE_PLL_RECOVERY_128 3 +#define CURRENT_POWER_GATE_USB_SLAVE 12:12 +#define CURRENT_POWER_GATE_USB_SLAVE_DISABLE 0 +#define CURRENT_POWER_GATE_USB_SLAVE_ENABLE 1 +#define CURRENT_POWER_GATE_USB_HOST 11:11 +#define CURRENT_POWER_GATE_USB_HOST_DISABLE 0 +#define CURRENT_POWER_GATE_USB_HOST_ENABLE 1 +#define CURRENT_POWER_GATE_SSP0_SSP1 10:10 +#define CURRENT_POWER_GATE_SSP0_SSP1_DISABLE 0 +#define CURRENT_POWER_GATE_SSP0_SSP1_ENABLE 1 +#define CURRENT_POWER_GATE_UART1 8:8 +#define CURRENT_POWER_GATE_UART1_DISABLE 0 +#define CURRENT_POWER_GATE_UART1_ENABLE 1 +#define CURRENT_POWER_GATE_UART0 7:7 +#define CURRENT_POWER_GATE_UART0_DISABLE 0 +#define CURRENT_POWER_GATE_UART0_ENABLE 1 +#define CURRENT_POWER_GATE_GPIO_PWM_I2C 6:6 +#define CURRENT_POWER_GATE_GPIO_PWM_I2C_DISABLE 0 +#define CURRENT_POWER_GATE_GPIO_PWM_I2C_ENABLE 1 +#define CURRENT_POWER_GATE_ZVPORT 5:5 +#define CURRENT_POWER_GATE_ZVPORT_DISABLE 0 +#define CURRENT_POWER_GATE_ZVPORT_ENABLE 1 +#define CURRENT_POWER_GATE_CSC 4:4 +#define CURRENT_POWER_GATE_CSC_DISABLE 0 +#define CURRENT_POWER_GATE_CSC_ENABLE 1 +#define CURRENT_POWER_GATE_2D 3:3 +#define CURRENT_POWER_GATE_2D_DISABLE 0 +#define CURRENT_POWER_GATE_2D_ENABLE 1 +#define CURRENT_POWER_GATE_DISPLAY 2:2 +#define CURRENT_POWER_GATE_DISPLAY_DISABLE 0 +#define CURRENT_POWER_GATE_DISPLAY_ENABLE 1 +#define CURRENT_POWER_GATE_INTMEM 1:1 +#define CURRENT_POWER_GATE_INTMEM_DISABLE 0 +#define CURRENT_POWER_GATE_INTMEM_ENABLE 1 +#define CURRENT_POWER_GATE_HOST 0:0 +#define CURRENT_POWER_GATE_HOST_DISABLE 0 +#define CURRENT_POWER_GATE_HOST_ENABLE 1 + +#define CURRENT_POWER_CLOCK 0x00003C +#define CURRENT_POWER_CLOCK_P2XCLK_SELECT 29:29 +#define CURRENT_POWER_CLOCK_P2XCLK_SELECT_288 0 +#define CURRENT_POWER_CLOCK_P2XCLK_SELECT_336 1 +#define CURRENT_POWER_CLOCK_P2XCLK_DIVIDER 28:27 +#define CURRENT_POWER_CLOCK_P2XCLK_DIVIDER_1 0 +#define CURRENT_POWER_CLOCK_P2XCLK_DIVIDER_3 1 +#define CURRENT_POWER_CLOCK_P2XCLK_DIVIDER_5 2 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT 26:24 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_0 0 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_1 1 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_2 2 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_3 3 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_4 4 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_5 5 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_6 6 +#define CURRENT_POWER_CLOCK_P2XCLK_SHIFT_7 7 +#define CURRENT_POWER_CLOCK_V2XCLK_SELECT 20:20 +#define CURRENT_POWER_CLOCK_V2XCLK_SELECT_288 0 +#define CURRENT_POWER_CLOCK_V2XCLK_SELECT_336 1 +#define CURRENT_POWER_CLOCK_V2XCLK_DIVIDER 19:19 +#define CURRENT_POWER_CLOCK_V2XCLK_DIVIDER_1 0 +#define CURRENT_POWER_CLOCK_V2XCLK_DIVIDER_3 1 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT 18:16 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_0 0 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_1 1 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_2 2 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_3 3 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_4 4 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_5 5 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_6 6 +#define CURRENT_POWER_CLOCK_V2XCLK_SHIFT_7 7 +#define CURRENT_POWER_CLOCK_MCLK_SELECT 12:12 +#define CURRENT_POWER_CLOCK_MCLK_SELECT_288 0 +#define CURRENT_POWER_CLOCK_MCLK_SELECT_336 1 +#define CURRENT_POWER_CLOCK_MCLK_DIVIDER 11:11 +#define CURRENT_POWER_CLOCK_MCLK_DIVIDER_1 0 +#define CURRENT_POWER_CLOCK_MCLK_DIVIDER_3 1 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT 10:8 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_0 0 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_1 1 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_2 2 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_3 3 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_4 4 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_5 5 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_6 6 +#define CURRENT_POWER_CLOCK_MCLK_SHIFT_7 7 +#define CURRENT_POWER_CLOCK_M2XCLK_SELECT 4:4 +#define CURRENT_POWER_CLOCK_M2XCLK_SELECT_288 0 +#define CURRENT_POWER_CLOCK_M2XCLK_SELECT_336 1 +#define CURRENT_POWER_CLOCK_M2XCLK_DIVIDER 3:3 +#define CURRENT_POWER_CLOCK_M2XCLK_DIVIDER_1 0 +#define CURRENT_POWER_CLOCK_M2XCLK_DIVIDER_3 1 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT 2:0 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_0 0 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_1 1 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_2 2 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_3 3 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_4 4 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_5 5 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_6 6 +#define CURRENT_POWER_CLOCK_M2XCLK_SHIFT_7 7 + +#define POWER_MODE0_GATE 0x000040 +#define POWER_MODE0_GATE_AC97_I2S 18:18 +#define POWER_MODE0_GATE_AC97_I2S_DISABLE 0 +#define POWER_MODE0_GATE_AC97_I2S_ENABLE 1 +#define POWER_MODE0_GATE_8051 17:17 +#define POWER_MODE0_GATE_8051_DISABLE 0 +#define POWER_MODE0_GATE_8051_ENABLE 1 +#define POWER_MODE0_GATE_USB_SLAVE 12:12 +#define POWER_MODE0_GATE_USB_SLAVE_DISABLE 0 +#define POWER_MODE0_GATE_USB_SLAVE_ENABLE 1 +#define POWER_MODE0_GATE_USB_HOST 11:11 +#define POWER_MODE0_GATE_USB_HOST_DISABLE 0 +#define POWER_MODE0_GATE_USB_HOST_ENABLE 1 +#define POWER_MODE0_GATE_SSP0_SSP1 10:10 +#define POWER_MODE0_GATE_SSP0_SSP1_DISABLE 0 +#define POWER_MODE0_GATE_SSP0_SSP1_ENABLE 1 +#define POWER_MODE0_GATE_UART1 8:8 +#define POWER_MODE0_GATE_UART1_DISABLE 0 +#define POWER_MODE0_GATE_UART1_ENABLE 1 +#define POWER_MODE0_GATE_UART0 7:7 +#define POWER_MODE0_GATE_UART0_DISABLE 0 +#define POWER_MODE0_GATE_UART0_ENABLE 1 +#define POWER_MODE0_GATE_GPIO_PWM_I2C 6:6 +#define POWER_MODE0_GATE_GPIO_PWM_I2C_DISABLE 0 +#define POWER_MODE0_GATE_GPIO_PWM_I2C_ENABLE 1 +#define POWER_MODE0_GATE_ZVPORT 5:5 +#define POWER_MODE0_GATE_ZVPORT_DISABLE 0 +#define POWER_MODE0_GATE_ZVPORT_ENABLE 1 +#define POWER_MODE0_GATE_CSC 4:4 +#define POWER_MODE0_GATE_CSC_DISABLE 0 +#define POWER_MODE0_GATE_CSC_ENABLE 1 +#define POWER_MODE0_GATE_2D 3:3 +#define POWER_MODE0_GATE_2D_DISABLE 0 +#define POWER_MODE0_GATE_2D_ENABLE 1 +#define POWER_MODE0_GATE_DISPLAY 2:2 +#define POWER_MODE0_GATE_DISPLAY_DISABLE 0 +#define POWER_MODE0_GATE_DISPLAY_ENABLE 1 +#define POWER_MODE0_GATE_INTMEM 1:1 +#define POWER_MODE0_GATE_INTMEM_DISABLE 0 +#define POWER_MODE0_GATE_INTMEM_ENABLE 1 +#define POWER_MODE0_GATE_HOST 0:0 +#define POWER_MODE0_GATE_HOST_DISABLE 0 +#define POWER_MODE0_GATE_HOST_ENABLE 1 + +#define POWER_MODE0_CLOCK 0x000044 +#define POWER_MODE0_CLOCK_P2XCLK_SELECT 29:29 +#define POWER_MODE0_CLOCK_P2XCLK_SELECT_288 0 +#define POWER_MODE0_CLOCK_P2XCLK_SELECT_336 1 +#define POWER_MODE0_CLOCK_P2XCLK_DIVIDER 28:27 +#define POWER_MODE0_CLOCK_P2XCLK_DIVIDER_1 0 +#define POWER_MODE0_CLOCK_P2XCLK_DIVIDER_3 1 +#define POWER_MODE0_CLOCK_P2XCLK_DIVIDER_5 2 +#define POWER_MODE0_CLOCK_P2XCLK_SHIFT 26:24 +#define POWER_MODE0_CLOCK_P2XCLK_SHIFT_0 0 +#define POWER_MODE0_CLOCK_P2XCLK_SHIFT_1 1 +#define POWER_MODE0_CLOCK_P2XCLK_SHIFT_2 2 +#define POWER_MODE0_CLOCK_P2XCLK_SHIFT_3 3 +#define POWER_MODE0_CLOCK_P2XCLK_SHIFT_4 4 +#define POWER_MODE0_CLOCK_P2XCLK_SHIFT_5 5 +#define POWER_MODE0_CLOCK_P2XCLK_SHIFT_6 6 +#define POWER_MODE0_CLOCK_P2XCLK_SHIFT_7 7 +#define POWER_MODE0_CLOCK_V2XCLK_SELECT 20:20 +#define POWER_MODE0_CLOCK_V2XCLK_SELECT_288 0 +#define POWER_MODE0_CLOCK_V2XCLK_SELECT_336 1 +#define POWER_MODE0_CLOCK_V2XCLK_DIVIDER 19:19 +#define POWER_MODE0_CLOCK_V2XCLK_DIVIDER_1 0 +#define POWER_MODE0_CLOCK_V2XCLK_DIVIDER_3 1 +#define POWER_MODE0_CLOCK_V2XCLK_SHIFT 18:16 +#define POWER_MODE0_CLOCK_V2XCLK_SHIFT_0 0 +#define POWER_MODE0_CLOCK_V2XCLK_SHIFT_1 1 +#define POWER_MODE0_CLOCK_V2XCLK_SHIFT_2 2 +#define POWER_MODE0_CLOCK_V2XCLK_SHIFT_3 3 +#define POWER_MODE0_CLOCK_V2XCLK_SHIFT_4 4 +#define POWER_MODE0_CLOCK_V2XCLK_SHIFT_5 5 +#define POWER_MODE0_CLOCK_V2XCLK_SHIFT_6 6 +#define POWER_MODE0_CLOCK_V2XCLK_SHIFT_7 7 +#define POWER_MODE0_CLOCK_MCLK_SELECT 12:12 +#define POWER_MODE0_CLOCK_MCLK_SELECT_288 0 +#define POWER_MODE0_CLOCK_MCLK_SELECT_336 1 +#define POWER_MODE0_CLOCK_MCLK_DIVIDER 11:11 +#define POWER_MODE0_CLOCK_MCLK_DIVIDER_1 0 +#define POWER_MODE0_CLOCK_MCLK_DIVIDER_3 1 +#define POWER_MODE0_CLOCK_MCLK_SHIFT 10:8 +#define POWER_MODE0_CLOCK_MCLK_SHIFT_0 0 +#define POWER_MODE0_CLOCK_MCLK_SHIFT_1 1 +#define POWER_MODE0_CLOCK_MCLK_SHIFT_2 2 +#define POWER_MODE0_CLOCK_MCLK_SHIFT_3 3 +#define POWER_MODE0_CLOCK_MCLK_SHIFT_4 4 +#define POWER_MODE0_CLOCK_MCLK_SHIFT_5 5 +#define POWER_MODE0_CLOCK_MCLK_SHIFT_6 6 +#define POWER_MODE0_CLOCK_MCLK_SHIFT_7 7 +#define POWER_MODE0_CLOCK_M2XCLK_SELECT 4:4 +#define POWER_MODE0_CLOCK_M2XCLK_SELECT_288 0 +#define POWER_MODE0_CLOCK_M2XCLK_SELECT_336 1 +#define POWER_MODE0_CLOCK_M2XCLK_DIVIDER 3:3 +#define POWER_MODE0_CLOCK_M2XCLK_DIVIDER_1 0 +#define POWER_MODE0_CLOCK_M2XCLK_DIVIDER_3 1 +#define POWER_MODE0_CLOCK_M2XCLK_SHIFT 2:0 +#define POWER_MODE0_CLOCK_M2XCLK_SHIFT_0 0 +#define POWER_MODE0_CLOCK_M2XCLK_SHIFT_1 1 +#define POWER_MODE0_CLOCK_M2XCLK_SHIFT_2 2 +#define POWER_MODE0_CLOCK_M2XCLK_SHIFT_3 3 +#define POWER_MODE0_CLOCK_M2XCLK_SHIFT_4 4 +#define POWER_MODE0_CLOCK_M2XCLK_SHIFT_5 5 +#define POWER_MODE0_CLOCK_M2XCLK_SHIFT_6 6 +#define POWER_MODE0_CLOCK_M2XCLK_SHIFT_7 7 + +#define POWER_MODE1_GATE 0x000048 +#define POWER_MODE1_GATE_AC97_I2S 18:18 +#define POWER_MODE1_GATE_AC97_I2S_DISABLE 0 +#define POWER_MODE1_GATE_AC97_I2S_ENABLE 1 +#define POWER_MODE1_GATE_8051 17:17 +#define POWER_MODE1_GATE_8051_DISABLE 0 +#define POWER_MODE1_GATE_8051_ENABLE 1 +#define POWER_MODE1_GATE_USB_SLAVE 12:12 +#define POWER_MODE1_GATE_USB_SLAVE_DISABLE 0 +#define POWER_MODE1_GATE_USB_SLAVE_ENABLE 1 +#define POWER_MODE1_GATE_USB_HOST 11:11 +#define POWER_MODE1_GATE_USB_HOST_DISABLE 0 +#define POWER_MODE1_GATE_USB_HOST_ENABLE 1 +#define POWER_MODE1_GATE_SSP0_SSP1 10:10 +#define POWER_MODE1_GATE_SSP0_SSP1_DISABLE 0 +#define POWER_MODE1_GATE_SSP0_SSP1_ENABLE 1 +#define POWER_MODE1_GATE_UART1 8:8 +#define POWER_MODE1_GATE_UART1_DISABLE 0 +#define POWER_MODE1_GATE_UART1_ENABLE 1 +#define POWER_MODE1_GATE_UART0 7:7 +#define POWER_MODE1_GATE_UART0_DISABLE 0 +#define POWER_MODE1_GATE_UART0_ENABLE 1 +#define POWER_MODE1_GATE_GPIO_PWM_I2C 6:6 +#define POWER_MODE1_GATE_GPIO_PWM_I2C_DISABLE 0 +#define POWER_MODE1_GATE_GPIO_PWM_I2C_ENABLE 1 +#define POWER_MODE1_GATE_ZVPORT 5:5 +#define POWER_MODE1_GATE_ZVPORT_DISABLE 0 +#define POWER_MODE1_GATE_ZVPORT_ENABLE 1 +#define POWER_MODE1_GATE_CSC 4:4 +#define POWER_MODE1_GATE_CSC_DISABLE 0 +#define POWER_MODE1_GATE_CSC_ENABLE 1 +#define POWER_MODE1_GATE_2D 3:3 +#define POWER_MODE1_GATE_2D_DISABLE 0 +#define POWER_MODE1_GATE_2D_ENABLE 1 +#define POWER_MODE1_GATE_DISPLAY 2:2 +#define POWER_MODE1_GATE_DISPLAY_DISABLE 0 +#define POWER_MODE1_GATE_DISPLAY_ENABLE 1 +#define POWER_MODE1_GATE_INTMEM 1:1 +#define POWER_MODE1_GATE_INTMEM_DISABLE 0 +#define POWER_MODE1_GATE_INTMEM_ENABLE 1 +#define POWER_MODE1_GATE_HOST 0:0 +#define POWER_MODE1_GATE_HOST_DISABLE 0 +#define POWER_MODE1_GATE_HOST_ENABLE 1 + +#define POWER_MODE1_CLOCK 0x00004C +#define POWER_MODE1_CLOCK_P2XCLK_SELECT 29:29 +#define POWER_MODE1_CLOCK_P2XCLK_SELECT_288 0 +#define POWER_MODE1_CLOCK_P2XCLK_SELECT_336 1 +#define POWER_MODE1_CLOCK_P2XCLK_DIVIDER 28:27 +#define POWER_MODE1_CLOCK_P2XCLK_DIVIDER_1 0 +#define POWER_MODE1_CLOCK_P2XCLK_DIVIDER_3 1 +#define POWER_MODE1_CLOCK_P2XCLK_DIVIDER_5 2 +#define POWER_MODE1_CLOCK_P2XCLK_SHIFT 26:24 +#define POWER_MODE1_CLOCK_P2XCLK_SHIFT_0 0 +#define POWER_MODE1_CLOCK_P2XCLK_SHIFT_1 1 +#define POWER_MODE1_CLOCK_P2XCLK_SHIFT_2 2 +#define POWER_MODE1_CLOCK_P2XCLK_SHIFT_3 3 +#define POWER_MODE1_CLOCK_P2XCLK_SHIFT_4 4 +#define POWER_MODE1_CLOCK_P2XCLK_SHIFT_5 5 +#define POWER_MODE1_CLOCK_P2XCLK_SHIFT_6 6 +#define POWER_MODE1_CLOCK_P2XCLK_SHIFT_7 7 +#define POWER_MODE1_CLOCK_V2XCLK_SELECT 20:20 +#define POWER_MODE1_CLOCK_V2XCLK_SELECT_288 0 +#define POWER_MODE1_CLOCK_V2XCLK_SELECT_336 1 +#define POWER_MODE1_CLOCK_V2XCLK_DIVIDER 19:19 +#define POWER_MODE1_CLOCK_V2XCLK_DIVIDER_1 0 +#define POWER_MODE1_CLOCK_V2XCLK_DIVIDER_3 1 +#define POWER_MODE1_CLOCK_V2XCLK_SHIFT 18:16 +#define POWER_MODE1_CLOCK_V2XCLK_SHIFT_0 0 +#define POWER_MODE1_CLOCK_V2XCLK_SHIFT_1 1 +#define POWER_MODE1_CLOCK_V2XCLK_SHIFT_2 2 +#define POWER_MODE1_CLOCK_V2XCLK_SHIFT_3 3 +#define POWER_MODE1_CLOCK_V2XCLK_SHIFT_4 4 +#define POWER_MODE1_CLOCK_V2XCLK_SHIFT_5 5 +#define POWER_MODE1_CLOCK_V2XCLK_SHIFT_6 6 +#define POWER_MODE1_CLOCK_V2XCLK_SHIFT_7 7 +#define POWER_MODE1_CLOCK_MCLK_SELECT 12:12 +#define POWER_MODE1_CLOCK_MCLK_SELECT_288 0 +#define POWER_MODE1_CLOCK_MCLK_SELECT_336 1 +#define POWER_MODE1_CLOCK_MCLK_DIVIDER 11:11 +#define POWER_MODE1_CLOCK_MCLK_DIVIDER_1 0 +#define POWER_MODE1_CLOCK_MCLK_DIVIDER_3 1 +#define POWER_MODE1_CLOCK_MCLK_SHIFT 10:8 +#define POWER_MODE1_CLOCK_MCLK_SHIFT_0 0 +#define POWER_MODE1_CLOCK_MCLK_SHIFT_1 1 +#define POWER_MODE1_CLOCK_MCLK_SHIFT_2 2 +#define POWER_MODE1_CLOCK_MCLK_SHIFT_3 3 +#define POWER_MODE1_CLOCK_MCLK_SHIFT_4 4 +#define POWER_MODE1_CLOCK_MCLK_SHIFT_5 5 +#define POWER_MODE1_CLOCK_MCLK_SHIFT_6 6 +#define POWER_MODE1_CLOCK_MCLK_SHIFT_7 7 +#define POWER_MODE1_CLOCK_M2XCLK_SELECT 4:4 +#define POWER_MODE1_CLOCK_M2XCLK_SELECT_288 0 +#define POWER_MODE1_CLOCK_M2XCLK_SELECT_336 1 +#define POWER_MODE1_CLOCK_M2XCLK_DIVIDER 3:3 +#define POWER_MODE1_CLOCK_M2XCLK_DIVIDER_1 0 +#define POWER_MODE1_CLOCK_M2XCLK_DIVIDER_3 1 +#define POWER_MODE1_CLOCK_M2XCLK_SHIFT 2:0 +#define POWER_MODE1_CLOCK_M2XCLK_SHIFT_0 0 +#define POWER_MODE1_CLOCK_M2XCLK_SHIFT_1 1 +#define POWER_MODE1_CLOCK_M2XCLK_SHIFT_2 2 +#define POWER_MODE1_CLOCK_M2XCLK_SHIFT_3 3 +#define POWER_MODE1_CLOCK_M2XCLK_SHIFT_4 4 +#define POWER_MODE1_CLOCK_M2XCLK_SHIFT_5 5 +#define POWER_MODE1_CLOCK_M2XCLK_SHIFT_6 6 +#define POWER_MODE1_CLOCK_M2XCLK_SHIFT_7 7 + +#define POWER_SLEEP_GATE 0x000050 +#define POWER_SLEEP_GATE_PLL_RECOVERY_CLOCK 22:19 +#define POWER_SLEEP_GATE_PLL_RECOVERY_CLOCK_4096 0 +#define POWER_SLEEP_GATE_PLL_RECOVERY_CLOCK_2048 1 +#define POWER_SLEEP_GATE_PLL_RECOVERY_CLOCK_1024 2 +#define POWER_SLEEP_GATE_PLL_RECOVERY_CLOCK_512 3 +#define POWER_SLEEP_GATE_PLL_RECOVERY_CLOCK_256 4 +#define POWER_SLEEP_GATE_PLL_RECOVERY_CLOCK_128 5 +#define POWER_SLEEP_GATE_PLL_RECOVERY_CLOCK_64 6 +#define POWER_SLEEP_GATE_PLL_RECOVERY_CLOCK_32 7 +#define POWER_SLEEP_GATE_PLL_RECOVERY_CLOCK_16 8 +#define POWER_SLEEP_GATE_PLL_RECOVERY_CLOCK_8 9 +#define POWER_SLEEP_GATE_PLL_RECOVERY_CLOCK_4 10 +#define POWER_SLEEP_GATE_PLL_RECOVERY_CLOCK_2 11 +#define POWER_SLEEP_GATE_PLL_RECOVERY 14:13 +#define POWER_SLEEP_GATE_PLL_RECOVERY_32 0 +#define POWER_SLEEP_GATE_PLL_RECOVERY_64 1 +#define POWER_SLEEP_GATE_PLL_RECOVERY_96 2 +#define POWER_SLEEP_GATE_PLL_RECOVERY_128 3 + +#define POWER_MODE_CTRL 0x000054 +#define POWER_MODE_CTRL_SLEEP_STATUS 2:2 +#define POWER_MODE_CTRL_SLEEP_STATUS_INACTIVE 0 +#define POWER_MODE_CTRL_SLEEP_STATUS_ACTIVE 1 +#define POWER_MODE_CTRL_MODE 1:0 +#define POWER_MODE_CTRL_MODE_MODE0 0 +#define POWER_MODE_CTRL_MODE_MODE1 1 +#define POWER_MODE_CTRL_MODE_SLEEP 2 + +#define MISC_CTRL 0x000004 +#define MISC_CTRL_PCI_PAD 31:30 +#define MISC_CTRL_PCI_PAD_24MA 0 +#define MISC_CTRL_PCI_PAD_12MA 1 +#define MISC_CTRL_PCI_PAD_8MA 2 +#define MISC_CTRL_48_SELECT 29:28 +#define MISC_CTRL_48_SELECT_CRYSTAL 0 +#define MISC_CTRL_48_SELECT_CPU_96 2 +#define MISC_CTRL_48_SELECT_CPU_48 3 +#define MISC_CTRL_UART1_SELECT 27:27 +#define MISC_CTRL_UART1_SELECT_UART 0 +#define MISC_CTRL_UART1_SELECT_SSP 1 +#define MISC_CTRL_8051_LATCH 26:26 +#define MISC_CTRL_8051_LATCH_DISABLE 0 +#define MISC_CTRL_8051_LATCH_ENABLE 1 +#define MISC_CTRL_FPDATA 25:25 +#define MISC_CTRL_FPDATA_18 0 +#define MISC_CTRL_FPDATA_24 1 +#define MISC_CTRL_CRYSTAL 24:24 +#define MISC_CTRL_CRYSTAL_24 0 +#define MISC_CTRL_CRYSTAL_12 1 +#define MISC_CTRL_DRAM_REFRESH 22:21 +#define MISC_CTRL_DRAM_REFRESH_8 0 +#define MISC_CTRL_DRAM_REFRESH_16 1 +#define MISC_CTRL_DRAM_REFRESH_32 2 +#define MISC_CTRL_DRAM_REFRESH_64 3 +#define MISC_CTRL_BUS_HOLD 20:18 +#define MISC_CTRL_BUS_HOLD_FIFO_EMPTY 0 +#define MISC_CTRL_BUS_HOLD_8 1 +#define MISC_CTRL_BUS_HOLD_16 2 +#define MISC_CTRL_BUS_HOLD_24 3 +#define MISC_CTRL_BUS_HOLD_32 4 +#define MISC_CTRL_HITACHI_READY 17:17 +#define MISC_CTRL_HITACHI_READY_NEGATIVE 0 +#define MISC_CTRL_HITACHI_READY_POSITIVE 1 +#define MISC_CTRL_INTERRUPT 16:16 +#define MISC_CTRL_INTERRUPT_NORMAL 0 +#define MISC_CTRL_INTERRUPT_INVERT 1 +#define MISC_CTRL_PLL_CLOCK_COUNT 15:15 +#define MISC_CTRL_PLL_CLOCK_COUNT_DISABLE 0 +#define MISC_CTRL_PLL_CLOCK_COUNT_ENABLE 1 +#define MISC_CTRL_DAC_BAND_GAP 14:13 +#define MISC_CTRL_DAC_POWER 12:12 +#define MISC_CTRL_DAC_POWER_ENABLE 0 +#define MISC_CTRL_DAC_POWER_DISABLE 1 +#define MISC_CTRL_USB_SLAVE_CONTROLLER 11:11 +#define MISC_CTRL_USB_SLAVE_CONTROLLER_CPU 0 +#define MISC_CTRL_USB_SLAVE_CONTROLLER_8051 1 +#define MISC_CTRL_BURST_LENGTH 10:10 +#define MISC_CTRL_BURST_LENGTH_8 0 +#define MISC_CTRL_BURST_LENGTH_1 1 +#define MISC_CTRL_USB_SELECT 9:9 +#define MISC_CTRL_USB_SELECT_MASTER 0 +#define MISC_CTRL_USB_SELECT_SLAVE 1 +#define MISC_CTRL_LOOPBACK 8:8 +#define MISC_CTRL_LOOPBACK_NORMAL 0 +#define MISC_CTRL_LOOPBACK_USB_HOST 1 +#define MISC_CTRL_CLOCK_DIVIDER_RESET 7:7 +#define MISC_CTRL_CLOCK_DIVIDER_RESET_ENABLE 0 +#define MISC_CTRL_CLOCK_DIVIDER_RESET_DISABLE 1 +#define MISC_CTRL_TEST_MODE 6:5 +#define MISC_CTRL_TEST_MODE_NORMAL 0 +#define MISC_CTRL_TEST_MODE_DEBUGGING 1 +#define MISC_CTRL_TEST_MODE_NAND 2 +#define MISC_CTRL_TEST_MODE_MEMORY 3 +#define MISC_CTRL_NEC_MMIO 4:4 +#define MISC_CTRL_NEC_MMIO_30 0 +#define MISC_CTRL_NEC_MMIO_62 1 +#define MISC_CTRL_CLOCK 3:3 +#define MISC_CTRL_CLOCK_PLL 0 +#define MISC_CTRL_CLOCK_TEST 1 +#define MISC_CTRL_HOST_BUS 2:0 +#define MISC_CTRL_HOST_BUS_HITACHI 0 +#define MISC_CTRL_HOST_BUS_PCI 1 +#define MISC_CTRL_HOST_BUS_XSCALE 2 +#define MISC_CTRL_HOST_BUS_STRONGARM 4 +#define MISC_CTRL_HOST_BUS_NEC 6 + +#define CMD_INTPR_STATUS 0x000024 +#define CMD_INTPR_STATUS_2D_MEMORY_FIFO 20:20 +#define CMD_INTPR_STATUS_2D_MEMORY_FIFO_NOT_EMPTY 0 +#define CMD_INTPR_STATUS_2D_MEMORY_FIFO_EMPTY 1 +#define CMD_INTPR_STATUS_COMMAND_FIFO 19:19 +#define CMD_INTPR_STATUS_COMMAND_FIFO_NOT_EMPTY 0 +#define CMD_INTPR_STATUS_COMMAND_FIFO_EMPTY 1 +#define CMD_INTPR_STATUS_CSC_STATUS 18:18 +#define CMD_INTPR_STATUS_CSC_STATUS_IDLE 0 +#define CMD_INTPR_STATUS_CSC_STATUS_BUSY 1 +#define CMD_INTPR_STATUS_MEMORY_DMA 17:17 +#define CMD_INTPR_STATUS_MEMORY_DMA_IDLE 0 +#define CMD_INTPR_STATUS_MEMORY_DMA_BUSY 1 +#define CMD_INTPR_STATUS_CRT_STATUS 16:16 +#define CMD_INTPR_STATUS_CRT_STATUS_CURRENT 0 +#define CMD_INTPR_STATUS_CRT_STATUS_PENDING 1 +#define CMD_INTPR_STATUS_CURRENT_FIELD 15:15 +#define CMD_INTPR_STATUS_CURRENT_FIELD_ODD 0 +#define CMD_INTPR_STATUS_CURRENT_FIELD_EVEN 1 +#define CMD_INTPR_STATUS_VIDEO_STATUS 14:14 +#define CMD_INTPR_STATUS_VIDEO_STATUS_CURRENT 0 +#define CMD_INTPR_STATUS_VIDEO_STATUS_PENDING 1 +#define CMD_INTPR_STATUS_PANEL_STATUS 13:13 +#define CMD_INTPR_STATUS_PANEL_STATUS_CURRENT 0 +#define CMD_INTPR_STATUS_PANEL_STATUS_PENDING 1 +#define CMD_INTPR_STATUS_CRT_SYNC 12:12 +#define CMD_INTPR_STATUS_CRT_SYNC_INACTIVE 0 +#define CMD_INTPR_STATUS_CRT_SYNC_ACTIVE 1 +#define CMD_INTPR_STATUS_PANEL_SYNC 11:11 +#define CMD_INTPR_STATUS_PANEL_SYNC_INACTIVE 0 +#define CMD_INTPR_STATUS_PANEL_SYNC_ACTIVE 1 +#define CMD_INTPR_STATUS_2D_SETUP 2:2 +#define CMD_INTPR_STATUS_2D_SETUP_IDLE 0 +#define CMD_INTPR_STATUS_2D_SETUP_BUSY 1 +#define CMD_INTPR_STATUS_2D_FIFO 1:1 +#define CMD_INTPR_STATUS_2D_FIFO_NOT_EMPTY 0 +#define CMD_INTPR_STATUS_2D_FIFO_EMPTY 1 +#define CMD_INTPR_STATUS_2D_ENGINE 0:0 +#define CMD_INTPR_STATUS_2D_ENGINE_IDLE 0 +#define CMD_INTPR_STATUS_2D_ENGINE_BUSY 1 + +/* regDC.h */ + +/* Panel Graphics Control */ +#define PANEL_DISPLAY_CTRL 0x080000 +#define PANEL_DISPLAY_CTRL_FPEN 27:27 +#define PANEL_DISPLAY_CTRL_FPEN_LOW 0 +#define PANEL_DISPLAY_CTRL_FPEN_HIGH 1 +#define PANEL_DISPLAY_CTRL_VBIASEN 26:26 +#define PANEL_DISPLAY_CTRL_VBIASEN_LOW 0 +#define PANEL_DISPLAY_CTRL_VBIASEN_HIGH 1 +#define PANEL_DISPLAY_CTRL_DATA 25:25 +#define PANEL_DISPLAY_CTRL_DATA_DISABLE 0 +#define PANEL_DISPLAY_CTRL_DATA_ENABLE 1 +#define PANEL_DISPLAY_CTRL_FPVDDEN 24:24 +#define PANEL_DISPLAY_CTRL_FPVDDEN_LOW 0 +#define PANEL_DISPLAY_CTRL_FPVDDEN_HIGH 1 +#define PANEL_DISPLAY_CTRL_PATTERN 23:23 +#define PANEL_DISPLAY_CTRL_PATTERN_4 0 +#define PANEL_DISPLAY_CTRL_PATTERN_8 1 +#define PANEL_DISPLAY_CTRL_TFT 22:21 +#define PANEL_DISPLAY_CTRL_TFT_24 0 +#define PANEL_DISPLAY_CTRL_TFT_9 1 +#define PANEL_DISPLAY_CTRL_TFT_12 2 +#define PANEL_DISPLAY_CTRL_DITHER 20:20 +#define PANEL_DISPLAY_CTRL_DITHER_DISABLE 0 +#define PANEL_DISPLAY_CTRL_DITHER_ENABLE 1 +#define PANEL_DISPLAY_CTRL_LCD 19:18 +#define PANEL_DISPLAY_CTRL_LCD_TFT 0 +#define PANEL_DISPLAY_CTRL_LCD_STN_8 2 +#define PANEL_DISPLAY_CTRL_LCD_STN_12 3 +#define PANEL_DISPLAY_CTRL_FIFO 17:16 +#define PANEL_DISPLAY_CTRL_FIFO_1 0 +#define PANEL_DISPLAY_CTRL_FIFO_3 1 +#define PANEL_DISPLAY_CTRL_FIFO_7 2 +#define PANEL_DISPLAY_CTRL_FIFO_11 3 +#define PANEL_DISPLAY_CTRL_CLOCK_PHASE 14:14 +#define PANEL_DISPLAY_CTRL_CLOCK_PHASE_ACTIVE_HIGH 0 +#define PANEL_DISPLAY_CTRL_CLOCK_PHASE_ACTIVE_LOW 1 +#define PANEL_DISPLAY_CTRL_VSYNC_PHASE 13:13 +#define PANEL_DISPLAY_CTRL_VSYNC_PHASE_ACTIVE_HIGH 0 +#define PANEL_DISPLAY_CTRL_VSYNC_PHASE_ACTIVE_LOW 1 +#define PANEL_DISPLAY_CTRL_HSYNC_PHASE 12:12 +#define PANEL_DISPLAY_CTRL_HSYNC_PHASE_ACTIVE_HIGH 0 +#define PANEL_DISPLAY_CTRL_HSYNC_PHASE_ACTIVE_LOW 1 +#define PANEL_DISPLAY_CTRL_COLOR_KEY 9:9 +#define PANEL_DISPLAY_CTRL_COLOR_KEY_DISABLE 0 +#define PANEL_DISPLAY_CTRL_COLOR_KEY_ENABLE 1 +#define PANEL_DISPLAY_CTRL_TIMING 8:8 +#define PANEL_DISPLAY_CTRL_TIMING_DISABLE 0 +#define PANEL_DISPLAY_CTRL_TIMING_ENABLE 1 +#define PANEL_DISPLAY_CTRL_VERTICAL_PAN_DIR 7:7 +#define PANEL_DISPLAY_CTRL_VERTICAL_PAN_DIR_DOWN 0 +#define PANEL_DISPLAY_CTRL_VERTICAL_PAN_DIR_UP 1 +#define PANEL_DISPLAY_CTRL_VERTICAL_PAN 6:6 +#define PANEL_DISPLAY_CTRL_VERTICAL_PAN_DISABLE 0 +#define PANEL_DISPLAY_CTRL_VERTICAL_PAN_ENABLE 1 +#define PANEL_DISPLAY_CTRL_HORIZONTAL_PAN_DIR 5:5 +#define PANEL_DISPLAY_CTRL_HORIZONTAL_PAN_DIR_RIGHT 0 +#define PANEL_DISPLAY_CTRL_HORIZONTAL_PAN_DIR_LEFT 1 +#define PANEL_DISPLAY_CTRL_HORIZONTAL_PAN 4:4 +#define PANEL_DISPLAY_CTRL_HORIZONTAL_PAN_DISABLE 0 +#define PANEL_DISPLAY_CTRL_HORIZONTAL_PAN_ENABLE 1 +#define PANEL_DISPLAY_CTRL_GAMMA 3:3 +#define PANEL_DISPLAY_CTRL_GAMMA_DISABLE 0 +#define PANEL_DISPLAY_CTRL_GAMMA_ENABLE 1 +#define PANEL_DISPLAY_CTRL_PLANE 2:2 +#define PANEL_DISPLAY_CTRL_PLANE_DISABLE 0 +#define PANEL_DISPLAY_CTRL_PLANE_ENABLE 1 +#define PANEL_DISPLAY_CTRL_FORMAT 1:0 +#define PANEL_DISPLAY_CTRL_FORMAT_8 0 +#define PANEL_DISPLAY_CTRL_FORMAT_16 1 +#define PANEL_DISPLAY_CTRL_FORMAT_32 2 + +#define PANEL_PAN_CTRL 0x080004 +#define PANEL_PAN_CTRL_VERTICAL_PAN 31:24 +#define PANEL_PAN_CTRL_VERTICAL_VSYNC 21:16 +#define PANEL_PAN_CTRL_HORIZONTAL_PAN 15:8 +#define PANEL_PAN_CTRL_HORIZONTAL_VSYNC 5:0 + +#define PANEL_COLOR_KEY 0x080008 +#define PANEL_COLOR_KEY_MASK 31:16 +#define PANEL_COLOR_KEY_VALUE 15:0 + +#define PANEL_FB_ADDRESS 0x08000C +#define PANEL_FB_ADDRESS_STATUS 31:31 +#define PANEL_FB_ADDRESS_STATUS_CURRENT 0 +#define PANEL_FB_ADDRESS_STATUS_PENDING 1 +#define PANEL_FB_ADDRESS_EXT 27:27 +#define PANEL_FB_ADDRESS_EXT_LOCAL 0 +#define PANEL_FB_ADDRESS_EXT_EXTERNAL 1 +#define PANEL_FB_ADDRESS_CS 26:26 +#define PANEL_FB_ADDRESS_CS_0 0 +#define PANEL_FB_ADDRESS_CS_1 1 +#define PANEL_FB_ADDRESS_ADDRESS 25:0 + +#define PANEL_FB_WIDTH 0x080010 +#define PANEL_FB_WIDTH_WIDTH 29:16 +#define PANEL_FB_WIDTH_OFFSET 13:0 + +#define PANEL_WINDOW_WIDTH 0x080014 +#define PANEL_WINDOW_WIDTH_WIDTH 27:16 +#define PANEL_WINDOW_WIDTH_X 11:0 + +#define PANEL_WINDOW_HEIGHT 0x080018 +#define PANEL_WINDOW_HEIGHT_HEIGHT 27:16 +#define PANEL_WINDOW_HEIGHT_Y 11:0 + +#define PANEL_PLANE_TL 0x08001C +#define PANEL_PLANE_TL_TOP 26:16 +#define PANEL_PLANE_TL_LEFT 10:0 + +#define PANEL_PLANE_BR 0x080020 +#define PANEL_PLANE_BR_BOTTOM 26:16 +#define PANEL_PLANE_BR_RIGHT 10:0 + +#define PANEL_HORIZONTAL_TOTAL 0x080024 +#define PANEL_HORIZONTAL_TOTAL_TOTAL 27:16 +#define PANEL_HORIZONTAL_TOTAL_DISPLAY_END 11:0 + +#define PANEL_HORIZONTAL_SYNC 0x080028 +#define PANEL_HORIZONTAL_SYNC_WIDTH 23:16 +#define PANEL_HORIZONTAL_SYNC_START 11:0 + +#define PANEL_VERTICAL_TOTAL 0x08002C +#define PANEL_VERTICAL_TOTAL_TOTAL 26:16 +#define PANEL_VERTICAL_TOTAL_DISPLAY_END 10:0 + +#define PANEL_VERTICAL_SYNC 0x080030 +#define PANEL_VERTICAL_SYNC_HEIGHT 21:16 +#define PANEL_VERTICAL_SYNC_START 10:0 + +#define PANEL_CURRENT_LINE 0x080034 +#define PANEL_CURRENT_LINE_LINE 10:0 + +/* CRT Graphics Control */ + +#define CRT_DISPLAY_CTRL 0x080200 +#define CRT_DISPLAY_CTRL_FIFO 17:16 +#define CRT_DISPLAY_CTRL_FIFO_1 0 +#define CRT_DISPLAY_CTRL_FIFO_3 1 +#define CRT_DISPLAY_CTRL_FIFO_7 2 +#define CRT_DISPLAY_CTRL_FIFO_11 3 +#define CRT_DISPLAY_CTRL_TV_PHASE 15:15 +#define CRT_DISPLAY_CTRL_TV_PHASE_ACTIVE_HIGH 0 +#define CRT_DISPLAY_CTRL_TV_PHASE_ACTIVE_LOW 1 +#define CRT_DISPLAY_CTRL_CLOCK_PHASE 14:14 +#define CRT_DISPLAY_CTRL_CLOCK_PHASE_ACTIVE_HIGH 0 +#define CRT_DISPLAY_CTRL_CLOCK_PHASE_ACTIVE_LOW 1 +#define CRT_DISPLAY_CTRL_VSYNC_PHASE 13:13 +#define CRT_DISPLAY_CTRL_VSYNC_PHASE_ACTIVE_HIGH 0 +#define CRT_DISPLAY_CTRL_VSYNC_PHASE_ACTIVE_LOW 1 +#define CRT_DISPLAY_CTRL_HSYNC_PHASE 12:12 +#define CRT_DISPLAY_CTRL_HSYNC_PHASE_ACTIVE_HIGH 0 +#define CRT_DISPLAY_CTRL_HSYNC_PHASE_ACTIVE_LOW 1 +#define CRT_DISPLAY_CTRL_BLANK 10:10 +#define CRT_DISPLAY_CTRL_BLANK_OFF 0 +#define CRT_DISPLAY_CTRL_BLANK_ON 1 +#define CRT_DISPLAY_CTRL_SELECT 9:9 +#define CRT_DISPLAY_CTRL_SELECT_PANEL 0 +#define CRT_DISPLAY_CTRL_SELECT_CRT 1 +#define CRT_DISPLAY_CTRL_TIMING 8:8 +#define CRT_DISPLAY_CTRL_TIMING_DISABLE 0 +#define CRT_DISPLAY_CTRL_TIMING_ENABLE 1 +#define CRT_DISPLAY_CTRL_PIXEL 7:4 +#define CRT_DISPLAY_CTRL_GAMMA 3:3 +#define CRT_DISPLAY_CTRL_GAMMA_DISABLE 0 +#define CRT_DISPLAY_CTRL_GAMMA_ENABLE 1 +#define CRT_DISPLAY_CTRL_PLANE 2:2 +#define CRT_DISPLAY_CTRL_PLANE_DISABLE 0 +#define CRT_DISPLAY_CTRL_PLANE_ENABLE 1 +#define CRT_DISPLAY_CTRL_FORMAT 1:0 +#define CRT_DISPLAY_CTRL_FORMAT_8 0 +#define CRT_DISPLAY_CTRL_FORMAT_16 1 +#define CRT_DISPLAY_CTRL_FORMAT_32 2 + +#define CRT_FB_ADDRESS 0x080204 +#define CRT_FB_ADDRESS_STATUS 31:31 +#define CRT_FB_ADDRESS_STATUS_CURRENT 0 +#define CRT_FB_ADDRESS_STATUS_PENDING 1 +#define CRT_FB_ADDRESS_EXT 27:27 +#define CRT_FB_ADDRESS_EXT_LOCAL 0 +#define CRT_FB_ADDRESS_EXT_EXTERNAL 1 +#define CRT_FB_ADDRESS_CS 26:26 +#define CRT_FB_ADDRESS_CS_0 0 +#define CRT_FB_ADDRESS_CS_1 1 +#define CRT_FB_ADDRESS_ADDRESS 25:0 + +#define CRT_FB_WIDTH 0x080208 +#define CRT_FB_WIDTH_WIDTH 29:16 +#define CRT_FB_WIDTH_OFFSET 13:0 + +#define CRT_HORIZONTAL_TOTAL 0x08020C +#define CRT_HORIZONTAL_TOTAL_TOTAL 27:16 +#define CRT_HORIZONTAL_TOTAL_DISPLAY_END 11:0 + +#define CRT_HORIZONTAL_SYNC 0x080210 +#define CRT_HORIZONTAL_SYNC_WIDTH 23:16 +#define CRT_HORIZONTAL_SYNC_START 11:0 + +#define CRT_VERTICAL_TOTAL 0x080214 +#define CRT_VERTICAL_TOTAL_TOTAL 26:16 +#define CRT_VERTICAL_TOTAL_DISPLAY_END 10:0 + +#define CRT_VERTICAL_SYNC 0x080218 +#define CRT_VERTICAL_SYNC_HEIGHT 21:16 +#define CRT_VERTICAL_SYNC_START 10:0 + +#define CRT_SIGNATURE_ANALYZER 0x08021C +#define CRT_SIGNATURE_ANALYZER_STATUS 31:16 +#define CRT_SIGNATURE_ANALYZER_ENABLE 3:3 +#define CRT_SIGNATURE_ANALYZER_ENABLE_DISABLE 0 +#define CRT_SIGNATURE_ANALYZER_ENABLE_ENABLE 1 +#define CRT_SIGNATURE_ANALYZER_RESET 2:2 +#define CRT_SIGNATURE_ANALYZER_RESET_NORMAL 0 +#define CRT_SIGNATURE_ANALYZER_RESET_RESET 1 +#define CRT_SIGNATURE_ANALYZER_SOURCE 1:0 +#define CRT_SIGNATURE_ANALYZER_SOURCE_RED 0 +#define CRT_SIGNATURE_ANALYZER_SOURCE_GREEN 1 +#define CRT_SIGNATURE_ANALYZER_SOURCE_BLUE 2 + +#define CRT_CURRENT_LINE 0x080220 +#define CRT_CURRENT_LINE_LINE 10:0 + +#define CRT_MONITOR_DETECT 0x080224 +#define CRT_MONITOR_DETECT_ENABLE 24:24 +#define CRT_MONITOR_DETECT_ENABLE_DISABLE 0 +#define CRT_MONITOR_DETECT_ENABLE_ENABLE 1 +#define CRT_MONITOR_DETECT_RED 23:16 +#define CRT_MONITOR_DETECT_GREEN 15:8 +#define CRT_MONITOR_DETECT_BLUE 7:0 + +/* CRT Cursor Control */ + +#define CRT_HWC_ADDRESS 0x080230 +#define CRT_HWC_ADDRESS_ENABLE 31:31 +#define CRT_HWC_ADDRESS_ENABLE_DISABLE 0 +#define CRT_HWC_ADDRESS_ENABLE_ENABLE 1 +#define CRT_HWC_ADDRESS_EXT 27:27 +#define CRT_HWC_ADDRESS_EXT_LOCAL 0 +#define CRT_HWC_ADDRESS_EXT_EXTERNAL 1 +#define CRT_HWC_ADDRESS_CS 26:26 +#define CRT_HWC_ADDRESS_CS_0 0 +#define CRT_HWC_ADDRESS_CS_1 1 +#define CRT_HWC_ADDRESS_ADDRESS 25:0 + +#define CRT_HWC_LOCATION 0x080234 +#define CRT_HWC_LOCATION_TOP 27:27 +#define CRT_HWC_LOCATION_TOP_INSIDE 0 +#define CRT_HWC_LOCATION_TOP_OUTSIDE 1 +#define CRT_HWC_LOCATION_Y 26:16 +#define CRT_HWC_LOCATION_LEFT 11:11 +#define CRT_HWC_LOCATION_LEFT_INSIDE 0 +#define CRT_HWC_LOCATION_LEFT_OUTSIDE 1 +#define CRT_HWC_LOCATION_X 10:0 + +#define CRT_HWC_COLOR_12 0x080238 +#define CRT_HWC_COLOR_12_2_RGB565 31:16 +#define CRT_HWC_COLOR_12_1_RGB565 15:0 + +#define CRT_HWC_COLOR_3 0x08023C +#define CRT_HWC_COLOR_3_RGB565 15:0 + +#define CRT_HWC_COLOR_01 0x080238 +#define CRT_HWC_COLOR_01_1_RED 31:27 +#define CRT_HWC_COLOR_01_1_GREEN 26:21 +#define CRT_HWC_COLOR_01_1_BLUE 20:16 +#define CRT_HWC_COLOR_01_0_RED 15:11 +#define CRT_HWC_COLOR_01_0_GREEN 10:5 +#define CRT_HWC_COLOR_01_0_BLUE 4:0 + +#define CRT_HWC_COLOR_2 0x08023C +#define CRT_HWC_COLOR_2_RED 15:11 +#define CRT_HWC_COLOR_2_GREEN 10:5 +#define CRT_HWC_COLOR_2_BLUE 4:0 + +#define CRT_PALETTE_RAM 0x080400 +#define PANEL_PALETTE_RAM 0x080800 +#define VIDEO_PALETTE_RAM 0x080C00 + +#endif /*_SMI_H*/ Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c:1.9 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c:1.13 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c:1.9 Wed Oct 8 07:13:01 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c Thu Mar 9 12:37:08 2006 @@ -1,5 +1,3 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_accel.c-arc 1.16 03 Jan 2001 13:29:06 Frido $ */ - /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. Copyright (C) 2000 Silicon Motion, Inc. All Rights Reserved. @@ -26,7 +24,7 @@ sale, use or other dealings in this Software without prior written authorization from the XFree86 Project and silicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c,v 1.9 2003/10/08 11:13:01 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c,v 1.13 2006/03/09 17:37:08 tsi Exp $ */ #include "smi.h" @@ -118,7 +116,11 @@ /* Color Expansion Fills */ infoPtr->CPUToScreenColorExpandFillFlags = ROP_NEEDS_SOURCE | NO_PLANEMASK +#if X_BYTE_ORDER == X_BIG_ENDIAN + | BIT_ORDER_IN_BYTE_LSBFIRST +#else | BIT_ORDER_IN_BYTE_MSBFIRST +#endif | LEFT_EDGE_CLIPPING | CPU_TRANSFER_PAD_DWORD | SCANLINE_PAD_DWORD; @@ -241,7 +243,7 @@ SMI_GEReset(ScrnInfoPtr pScrn, int from_timeout, int line, char *file) { SMIPtr pSmi = SMIPTR(pScrn); - CARD8 tmp; + CARD8 tmp = 0; ENTER_PROC("SMI_GEReset"); @@ -257,12 +259,25 @@ WaitIdleEmpty(); } - tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x15); - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x15, tmp | 0x30); + if (pSmi->Chipset == SMI_MSOC) + { + CARD32 itmp = READ_SCR(pSmi, SCR00) & ~0x3000; + WRITE_SCR(pSmi, SCR00, (itmp | 0x3000)); + WRITE_SCR(pSmi, SCR00, itmp); + } + else + { + tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x15); + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x15, tmp | 0x30); + } WaitIdleEmpty(); - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x15, tmp); + if (pSmi->Chipset != SMI_MSOC) + { + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x15, tmp); + } + SMI_EngineReset(pScrn); LEAVE_PROC("SMI_GEReset"); @@ -475,6 +490,9 @@ ENTER_PROC("SMI_SubsequentSolidFillRect"); DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", x, y, w, h)); + if (x < 0) x = 0; + if (y < 0) y = 0; + if (pScrn->bitsPerPixel == 24) { x *= 3; @@ -860,7 +878,7 @@ } } WRITE_DPR(pSmi, 0x00, 0); - WRITE_DPR(pSmi, 0x04, (x << 16) | (y * 0xFFFF)); + WRITE_DPR(pSmi, 0x04, (x << 16) | (y & 0xFFFF)); WRITE_DPR(pSmi, 0x08, (w << 16) | (h & 0xFFFF)); WRITE_DPR(pSmi, 0x0C, pSmi->AccelCmd); @@ -901,6 +919,12 @@ } } + if (pSmi->Chipset == SMI_MSOC) + { + bottom++; + right++; + } + pSmi->ScissorsLeft = (top << 16) | (left & 0xFFFF) | 0x2000; pSmi->ScissorsRight = (bottom << 16) | (right & 0xFFFF); Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dac.c diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dac.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dac.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dac.c:1.2 Fri Nov 30 07:11:59 2001 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dac.c Mon Jan 9 09:59:58 2006 @@ -1,5 +1,3 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_dac.c-arc 1.8 27 Nov 2000 15:47:08 Frido $ */ - /* Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved. Copyright (C) 2000 Silicon Motion, Inc. All Rights Reserved. @@ -26,7 +24,7 @@ sale, use or other dealings in this Software without prior written authorization from the XFree86 Project and Silicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dac.c,v 1.2 2001/11/30 12:11:59 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dac.c,v 1.3 2006/01/09 14:59:58 dawes Exp $ */ #include "smi.h" Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dga.c diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dga.c:1.4 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dga.c:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dga.c:1.4 Tue Dec 7 10:59:20 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dga.c Mon Jan 9 09:59:58 2006 @@ -1,5 +1,3 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_dga.c-arc 1.5 27 Nov 2000 15:47:18 Frido $ */ - /* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. Copyright (C) 2000 Silicon Motion, Inc. All Rights Reserved. @@ -26,7 +24,7 @@ sale, use or other dealings in this Software without prior written authorization from the XFree86 Project and Silicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dga.c,v 1.4 2004/12/07 15:59:20 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_dga.c,v 1.5 2006/01/09 14:59:58 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c:1.38 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c:1.44 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c:1.38 Tue Oct 26 18:26:37 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c Thu Mar 16 11:50:13 2006 @@ -1,5 +1,3 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_driver.c-arc 1.42 03 Jan 2001 13:52:16 Frido $ */ - /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. Copyright (C) 2000 Silicon Motion, Inc. All Rights Reserved. @@ -26,7 +24,7 @@ sale, use or other dealings in this Software without prior written authorization from The XFree86 Project or Silicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c,v 1.38 2004/10/26 22:26:37 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c,v 1.44 2006/03/16 16:50:13 dawes Exp $ */ #include "xf86Resources.h" #include "xf86RAC.h" @@ -36,10 +34,11 @@ #include "shadowfb.h" #include "smi.h" +#include "smi_501.h" #include "globals.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> /* * Internals @@ -81,6 +80,7 @@ static void SMI_FreeScreen(int ScrnIndex, int flags); static void SMI_ProbeDDC(ScrnInfoPtr pScrn, int index); +static Bool SMI_MSOCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode); #define SILICONMOTION_NAME "Silicon Motion" #define SILICONMOTION_DRIVER_NAME "siliconmotion" @@ -121,6 +121,7 @@ { PCI_CHIP_SMI712, "LynxEM+" }, { PCI_CHIP_SMI720, "Lynx3DM" }, { PCI_CHIP_SMI731, "Cougar3DR" }, + { PCI_CHIP_SMI501, "MSOC" }, { -1, NULL } }; @@ -134,6 +135,7 @@ { PCI_CHIP_SMI712, PCI_CHIP_SMI712, RES_SHARED_VGA }, { PCI_CHIP_SMI720, PCI_CHIP_SMI720, RES_SHARED_VGA }, { PCI_CHIP_SMI731, PCI_CHIP_SMI731, RES_SHARED_VGA }, + { PCI_CHIP_SMI501, PCI_CHIP_SMI501, RES_SHARED_VGA }, { -1, -1, RES_UNDEFINED } }; @@ -280,17 +282,8 @@ static const char *fbSymbols[] = { -#ifdef USE_FB "fbPictureInit", "fbScreenInit", -#else - "cfbScreenInit", - "cfb16ScreenInit", - "cfb24ScreenInit", - "cfb32ScreenInit", - "cfb16BresS", - "cfb24BresS", -#endif NULL }; @@ -327,7 +320,7 @@ }; static pointer -siliconmotionSetup(pointer module, pointer opts, int *errmaj, int *errmin) +siliconmotionSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -345,9 +338,10 @@ * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, ramdacSymbols, - ddcSymbols, i2cSymbols, int10Symbols, vbeSymbols, - shadowSymbols, NULL); + LoaderModRefSymLists(module, vgahwSymbols, fbSymbols, + xaaSymbols, ramdacSymbols, ddcSymbols, + i2cSymbols, int10Symbols, vbeSymbols, + shadowSymbols, NULL); /* * The return value must be non-NULL on success even though there @@ -504,17 +498,15 @@ int i; double real; ClockRangePtr clockRanges; -#ifndef USE_FB - char *mod = NULL; - const char *reqSym = NULL; -#endif char *s; - unsigned char config, m, n, shift; + unsigned char config = 0, m, n, shift; int mclk; vgaHWPtr hwp; int vgaCRIndex, vgaIOBase; vbeInfoPtr pVbe = NULL; - + int chipType; + ModuleDescPtr pMod; + ENTER_PROC("SMI_PreInit"); if (flags & PROBE_DETECT) @@ -524,6 +516,18 @@ return(TRUE); } + /* Allocate the SMIRec driverPrivate */ + if (!SMI_GetRec(pScrn)) + { + LEAVE_PROC("SMI_PreInit"); + return(FALSE); + } + pSmi = SMIPTR(pScrn); + + pEnt = xf86GetEntityInfo(pScrn->entityList[0]); + pSmi->PciInfo = xf86GetPciInfoForEntity(pEnt->index); + chipType = pSmi->PciInfo->chipType; + /* Ignoring the Type list for now. It might be needed when multiple cards * are supported. */ @@ -534,13 +538,13 @@ } /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) { LEAVE_PROC("SMI_PreInit"); return(FALSE); } - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* * Allocate a vgaHWRec @@ -551,14 +555,6 @@ return(FALSE); } - /* Allocate the SMIRec driverPrivate */ - if (!SMI_GetRec(pScrn)) - { - LEAVE_PROC("SMI_PreInit"); - return(FALSE); - } - pSmi = SMIPTR(pScrn); - /* Set pScrn->monitor */ pScrn->monitor = pScrn->confScreen->monitor; @@ -566,10 +562,23 @@ * The first thing we should figure out is the depth, bpp, etc. * We support only 24bpp layouts, so indicate that. */ - if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb)) + if (chipType == SMI_MSOC) { - LEAVE_PROC("SMI_PreInit"); - return(FALSE); + if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support32bppFb | + SupportConvert24to32 | + PreferConvert24to32)) + { + LEAVE_PROC("SMI_PreInit"); + return(FALSE); + } + } + else + { + if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb)) + { + LEAVE_PROC("SMI_PreInit"); + return(FALSE); + } } /* Check that the returned depth is one we support */ @@ -631,7 +640,10 @@ /* Set the bits per RGB for 8bpp mode */ if (pScrn->depth == 8) { - pScrn->rgbBits = 6; + if (chipType == SMI_MSOC) + pScrn->rgbBits = 8; + else + pScrn->rgbBits = 6; } /* Process the options */ @@ -792,7 +804,7 @@ /* Disable the RandR extension, it messes up the internal rotation stuff */ xf86DisableRandR(); } - + if (xf86GetOptValInteger(pSmi->Options, OPTION_VIDEOKEY, &pSmi->videoKey)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: Video key set to " @@ -850,6 +862,7 @@ } /* Find the PCI slot for this screen */ + xfree(pEnt); pEnt = xf86GetEntityInfo(pScrn->entityList[0]); if ((pEnt->location.type != BUS_PCI) || (pEnt->resources)) { @@ -859,18 +872,20 @@ return(FALSE); } - if (xf86LoadSubModule(pScrn,"int10")) { - xf86LoaderReqSymLists(int10Symbols,NULL); - pSmi->pInt10 = xf86InitInt10(pEnt->index); - } - - if (pSmi->pInt10 && xf86LoadSubModule(pScrn, "vbe")) + if (chipType != SMI_MSOC) { - xf86LoaderReqSymLists(vbeSymbols, NULL); - pVbe = VBEInit(pSmi->pInt10, pEnt->index); + if ((pMod = xf86LoadSubModule(pScrn,"int10"))) { + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); + pSmi->pInt10 = xf86InitInt10(pEnt->index); + } + + if (pSmi->pInt10 && (pMod = xf86LoadVBEModule(pScrn))) + { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); + pVbe = VBEInit(pSmi->pInt10, pEnt->index); + } } - pSmi->PciInfo = xf86GetPciInfoForEntity(pEnt->index); xf86RegisterResources(pEnt->index, NULL, ResExclusive); /* xf86SetOperatingState(resVgaIo, pEnt->index, ResUnusedOpr); */ /* xf86SetOperatingState(resVgaMem, pEnt->index, ResDisableOpr); */ @@ -937,74 +952,79 @@ pSmi->PciInfo->func); SMI_MapMem(pScrn); - SMI_DisableVideo(pScrn); - hwp = VGAHWPTR(pScrn); - vgaIOBase = hwp->IOBase; - vgaCRIndex = vgaIOBase + VGA_CRTC_INDEX_OFFSET; - pSmi->PIOBase = hwp->PIOOffset; + if (chipType != SMI_MSOC) + { + SMI_DisableVideo(pScrn); - xf86ErrorFVerb(VERBLEV, "\tSMI_PreInit vgaCRIndex=%x, vgaIOBase=%x, " - "MMIOBase=%p\n", vgaCRIndex, vgaIOBase, hwp->MMIOBase); + hwp = VGAHWPTR(pScrn); + vgaIOBase = hwp->IOBase; + vgaCRIndex = vgaIOBase + VGA_CRTC_INDEX_OFFSET; + pSmi->PIOBase = hwp->PIOOffset; - /* Next go on to detect amount of installed ram */ - config = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x71); + xf86ErrorFVerb(VERBLEV, "\tSMI_PreInit vgaCRIndex=%x, vgaIOBase=%x, " + "MMIOBase=%p\n", vgaCRIndex, vgaIOBase, hwp->MMIOBase); - if (xf86LoadSubModule(pScrn, "i2c")) - { - xf86LoaderReqSymLists(i2cSymbols, NULL); - SMI_I2CInit(pScrn); - } - if (xf86LoadSubModule(pScrn, "ddc")) - { - xf86MonPtr pMon = NULL; + /* Next go on to detect amount of installed ram */ + config = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x71); - xf86LoaderReqSymLists(ddcSymbols, NULL); -#if 1 /* PDR#579 */ - if (pVbe) + if ((pMod = xf86LoadSubModule(pScrn, "i2c"))) + { + xf86LoaderModReqSymLists(pMod, i2cSymbols, NULL); + SMI_I2CInit(pScrn); + } + if ((pMod = xf86LoadSubModule(pScrn, "ddc"))) { - pMon = vbeDoEDID(pVbe, NULL); - if (pMon != NULL) + xf86MonPtr pMon = NULL; + + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); +#if 1 /* PDR#579 */ + if (pVbe) { - if ( (pMon->rawData[0] == 0x00) - && (pMon->rawData[1] == 0xFF) - && (pMon->rawData[2] == 0xFF) - && (pMon->rawData[3] == 0xFF) - && (pMon->rawData[4] == 0xFF) - && (pMon->rawData[5] == 0xFF) - && (pMon->rawData[6] == 0xFF) - && (pMon->rawData[7] == 0x00) - ) + pMon = vbeDoEDID(pVbe, pMod); + if (pMon != NULL) { - pMon = xf86PrintEDID(pMon); - if (pMon != NULL) + if ( (pMon->rawData[0] == 0x00) + && (pMon->rawData[1] == 0xFF) + && (pMon->rawData[2] == 0xFF) + && (pMon->rawData[3] == 0xFF) + && (pMon->rawData[4] == 0xFF) + && (pMon->rawData[5] == 0xFF) + && (pMon->rawData[6] == 0xFF) + && (pMon->rawData[7] == 0x00) + ) { - xf86SetDDCproperties(pScrn, pMon); + pMon = xf86PrintEDID(pMon); + if (pMon != NULL) + { + xf86SetDDCproperties(pScrn, pMon); + } } } } - } #else - if ( (pVbe) - && ((pMon = xf86PrintEDID(vbeDoEDID(pVbe, NULL))) != NULL) - ) - { - xf86SetDDCproperties(pScrn, pMon); - } + if ( (pVbe) + && ((pMon = xf86PrintEDID(vbeDoEDID(pVbe, pMod))) != NULL) + ) + { + xf86SetDDCproperties(pScrn, pMon); + } #endif - else if (!SMI_ddc1(pScrn->scrnIndex)) - { - if (pSmi->I2C) + else if (!SMI_ddc1(pScrn->scrnIndex)) { - xf86SetDDCproperties(pScrn, - xf86PrintEDID(xf86DoEDID_DDC2(pScrn->scrnIndex, - pSmi->I2C))); + if (pSmi->I2C) + { + xf86SetDDCproperties(pScrn, + xf86PrintEDID(xf86DoEDID_DDC2(pScrn->scrnIndex, + pSmi->I2C))); + } } } + + vbeFree(pVbe); + xf86FreeInt10(pSmi->pInt10); } - vbeFree(pVbe); - xf86FreeInt10(pSmi->pInt10); pSmi->pInt10 = NULL; /* @@ -1058,7 +1078,18 @@ /* per instructions from Silicon Motion engineers */ pSmi->videoRAMKBytes = 16 * 1024; break; - } + } + + case SMI_MSOC: + { + static int mem_table[] = + {4, 8, 16, 32, 64, 2}; + int memval = READ_SCR(pSmi, SCR10); + memval &= SCR10_LOCAL_MEM_SIZE; + memval >>= SCR10_LOCAL_MEM_SIZE_SHIFT; + pSmi->videoRAMKBytes = mem_table[memval] * 1024; + break; + } } pSmi->videoRAMBytes = pSmi->videoRAMKBytes * 1024; pScrn->videoRam = pSmi->videoRAMKBytes; @@ -1083,7 +1114,9 @@ pScrn->clock[3] = pScrn->clock[2]; } - if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR)) + if ((pSmi->Chipset == SMI_LYNX3DM) || + (pSmi->Chipset == SMI_COUGAR3DR) || + (pSmi->Chipset == SMI_MSOC)) { if (pScrn->clock[0] <= 0) pScrn->clock[0] = 200000; if (pScrn->clock[1] <= 0) pScrn->clock[1] = 200000; @@ -1101,6 +1134,10 @@ /* Now set RAMDAC limits */ switch (pSmi->Chipset) { + case SMI_MSOC: + pSmi->minClock = 20000; + pSmi->maxClock = 270000; + break; default: pSmi->minClock = 20000; pSmi->maxClock = 135000; @@ -1109,33 +1146,34 @@ xf86ErrorFVerb(VERBLEV, "\tSMI_PreInit minClock=%d, maxClock=%d\n", pSmi->minClock, pSmi->maxClock); - /* Detect current MCLK and print it for user */ - m = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6A); - n = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6B); - switch (n >> 6) + if (pSmi->Chipset != SMI_MSOC) { - default: - shift = 1; - break; + /* Detect current MCLK and print it for user */ + m = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6A); + n = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6B); + switch (n >> 6) + { + default: + shift = 1; + break; - case 1: - shift = 4; - break; + case 1: + shift = 4; + break; - case 2: - shift = 2; - break; + case 2: + shift = 2; + break; + } + n &= 0x3F; + mclk = ((1431818 * m) / n / shift + 50) / 100; + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected current MCLK value of " + "%1.3f MHz\n", mclk / 1000.0); } - n &= 0x3F; - mclk = ((1431818 * m) / n / shift + 50) / 100; - xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected current MCLK value of " - "%1.3f MHz\n", mclk / 1000.0); SMI_EnableVideo(pScrn); SMI_UnmapMem(pScrn); - pScrn->virtualX = pScrn->display->virtualX; - /* * Setup the ClockRanges, which describe what clock ranges are available, * and what sort of modes they can be used for. @@ -1147,7 +1185,7 @@ clockRanges->clockIndex = -1; clockRanges->interlaceAllowed = FALSE; clockRanges->doubleScanAllowed = FALSE; - + i = xf86ValidateModes( pScrn, /* Screen pointer */ pScrn->monitor->Modes, /* Available monitor modes */ @@ -1183,7 +1221,9 @@ LEAVE_PROC("SMI_PreInit"); return(FALSE); } - xf86SetCrtcForModes(pScrn, 0); + + if (pSmi->Chipset != SMI_MSOC) + xf86SetCrtcForModes(pScrn, 0); /* Set the current mode to the first in the list */ pScrn->currentMode = pScrn->modes; @@ -1194,77 +1234,48 @@ /* Set display resolution */ xf86SetDpi(pScrn, 0, 0); -#ifdef USE_FB - if ((xf86LoadSubModule(pScrn, "fb") == NULL)) + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { SMI_FreeRec(pScrn); LEAVE_PROC("SMI_PreInit"); return(FALSE); } - xf86LoaderReqSymLists(fbSymbols, NULL); -#else - /* Load bpp-specific modules */ - switch (pScrn->bitsPerPixel) - { - case 8: - mod = "cfb"; - reqSym = "cfbScreenInit"; - break; - - case 16: - mod = "cfb16"; - reqSym = "cfb16ScreenInit"; - break; + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); - case 24: - mod = "cfb24"; - reqSym = "cfb24ScreenInit"; - break; - } - - if (mod && (xf86LoadSubModule(pScrn, mod) == NULL)) - { - SMI_FreeRec(pScrn); - LEAVE_PROC("SMI_PreInit"); - return(FALSE); - } - - xf86LoaderReqSymbols(reqSym, NULL); -#endif /* Load XAA if needed */ if (!pSmi->NoAccel || pSmi->hwcursor) { - if (!xf86LoadSubModule(pScrn, "xaa")) + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { SMI_FreeRec(pScrn); LEAVE_PROC("SMI_PreInit"); return(FALSE); } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } /* Load ramdac if needed */ if (pSmi->hwcursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { SMI_FreeRec(pScrn); LEAVE_PROC("SMI_PreInit"); return(FALSE); } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } if (pSmi->shadowFB) { - if (!xf86LoadSubModule(pScrn, "shadowfb")) + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { SMI_FreeRec(pScrn); LEAVE_PROC("SMI_PreInit"); return(FALSE); } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } LEAVE_PROC("SMI_PreInit"); @@ -1422,84 +1433,87 @@ ENTER_PROC("SMI_Save"); - /* Save the standard VGA registers */ - vgaHWSave(pScrn, vgaSavePtr, VGA_SR_ALL); - save->smiDACMask = VGAIN8(pSmi, VGA_DAC_MASK); - VGAOUT8(pSmi, VGA_DAC_READ_ADDR, 0); - for (i = 0; i < 256; i++) - { - save->smiDacRegs[i][0] = VGAIN8(pSmi, VGA_DAC_DATA); - save->smiDacRegs[i][1] = VGAIN8(pSmi, VGA_DAC_DATA); - save->smiDacRegs[i][2] = VGAIN8(pSmi, VGA_DAC_DATA); - } - for (i = 0, offset = 2; i < 8192; i++, offset += 8) - { - save->smiFont[i] = *(pSmi->FBBase + offset); - } - - /* Now we save all the extended registers we need. */ - save->SR17 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x17); - save->SR18 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18); - save->SR21 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21); - save->SR31 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31); - save->SR32 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x32); - save->SR6A = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6A); - save->SR6B = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6B); - save->SR81 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81); - save->SRA0 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0xA0); - - if (SMI_LYNXM_SERIES(pSmi->Chipset)) + if (pSmi->Chipset != SMI_MSOC) { - /* Save primary registers */ - save->CR90[14] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E); - VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E, - save->CR90[14] & ~0x20); - - for (i = 0; i < 16; i++) + /* Save the standard VGA registers */ + vgaHWSave(pScrn, vgaSavePtr, VGA_SR_ALL); + save->smiDACMask = VGAIN8(pSmi, VGA_DAC_MASK); + VGAOUT8(pSmi, VGA_DAC_READ_ADDR, 0); + for (i = 0; i < 256; i++) { - save->CR90[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x90 + i); + save->smiDacRegs[i][0] = VGAIN8(pSmi, VGA_DAC_DATA); + save->smiDacRegs[i][1] = VGAIN8(pSmi, VGA_DAC_DATA); + save->smiDacRegs[i][2] = VGAIN8(pSmi, VGA_DAC_DATA); } - save->CR33 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33); - save->CR3A = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x3A); - for (i = 0; i < 14; i++) + for (i = 0, offset = 2; i < 8192; i++, offset += 8) { - save->CR40[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i); + save->smiFont[i] = *(pSmi->FBBase + offset); } - /* Save secondary registers */ - VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E, save->CR90[14] | 0x20); - save->CR33_2 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33); - for (i = 0; i < 14; i++) - { - save->CR40_2[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, - 0x40 + i); - } - save->CR9F_2 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9F); + /* Now we save all the extended registers we need. */ + save->SR17 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x17); + save->SR18 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18); + save->SR21 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21); + save->SR31 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31); + save->SR32 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x32); + save->SR6A = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6A); + save->SR6B = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x6B); + save->SR81 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81); + save->SRA0 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0xA0); - /* Save common registers */ - for (i = 0; i < 14; i++) + if (SMI_LYNXM_SERIES(pSmi->Chipset)) { - save->CRA0[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0xA0 + i); - } + /* Save primary registers */ + save->CR90[14] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E); + VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E, + save->CR90[14] & ~0x20); - /* PDR#1069 */ - VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E, save->CR90[14]); - } - else - { - save->CR33 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33); - save->CR3A = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x3A); - for (i = 0; i < 14; i++) + for (i = 0; i < 16; i++) + { + save->CR90[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x90 + i); + } + save->CR33 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33); + save->CR3A = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x3A); + for (i = 0; i < 14; i++) + { + save->CR40[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i); + } + + /* Save secondary registers */ + VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E, save->CR90[14] | 0x20); + save->CR33_2 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33); + for (i = 0; i < 14; i++) + { + save->CR40_2[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, + 0x40 + i); + } + save->CR9F_2 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9F); + + /* Save common registers */ + for (i = 0; i < 14; i++) + { + save->CRA0[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0xA0 + i); + } + + /* PDR#1069 */ + VGAOUT8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x9E, save->CR90[14]); + } + else { - save->CR40[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i); + save->CR33 = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x33); + save->CR3A = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x3A); + for (i = 0; i < 14; i++) + { + save->CR40[i] = VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRData, 0x40 + i); + } } - } - /* CZ 2.11.2001: for gamma correction (TODO: other chipsets?) */ - if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR)) { - save->CCR66 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x66); + /* CZ 2.11.2001: for gamma correction (TODO: other chipsets?) */ + if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR)) { + save->CCR66 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x66); + } + /* end CZ */ } - /* end CZ */ save->DPR10 = READ_DPR(pSmi, 0x10); save->DPR1C = READ_DPR(pSmi, 0x1C); @@ -1518,29 +1532,32 @@ if (pSmi->Chipset == SMI_COUGAR3DR) { - save->FPR00_ = READ_FPR(pSmi, FPR00); + save->FPR00_ = READ_FPR(pSmi, FPR00); save->FPR0C_ = READ_FPR(pSmi, FPR0C); save->FPR10_ = READ_FPR(pSmi, FPR10); } save->CPR00 = READ_CPR(pSmi, 0x00); - if (!pSmi->ModeStructInit) + if (pSmi->Chipset != SMI_MSOC) { - /* XXX Should check the return value of vgaHWCopyReg() */ - vgaHWCopyReg(&hwp->ModeReg, vgaSavePtr); - memcpy(&pSmi->ModeReg, save, sizeof(SMIRegRec)); - pSmi->ModeStructInit = TRUE; - } + if (!pSmi->ModeStructInit) + { + /* XXX Should check the return value of vgaHWCopyReg() */ + vgaHWCopyReg(&hwp->ModeReg, vgaSavePtr); + memcpy(&pSmi->ModeReg, save, sizeof(SMIRegRec)); + pSmi->ModeStructInit = TRUE; + } - if (pSmi->useBIOS && (pSmi->pInt10 != NULL)) - { - pSmi->pInt10->num = 0x10; - pSmi->pInt10->ax = 0x0F00; - xf86ExecX86int10(pSmi->pInt10); - save->mode = pSmi->pInt10->ax & 0x007F; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Current mode 0x%02X.\n", - save->mode); + if (pSmi->useBIOS && (pSmi->pInt10 != NULL)) + { + pSmi->pInt10->num = 0x10; + pSmi->pInt10->ax = 0x0F00; + xf86ExecX86int10(pSmi->pInt10); + save->mode = pSmi->pInt10->ax & 0x007F; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Current mode 0x%02X.\n", + save->mode); + } } if (xf86GetVerbosity() > 1) @@ -1687,9 +1704,9 @@ /* Restore the standard VGA registers */ if (xf86IsPrimaryPci(pSmi->PciInfo)) { - vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_CMAP + vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_CMAP | VGA_SR_FONTS); - } + } if (restore->modeInit) vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_ALL); @@ -1768,6 +1785,7 @@ break; case SMI_COUGAR3DR: + case SMI_MSOC: memBase = pSmi->PciInfo->memBase[1]; pSmi->MapSize = 0x200000; break; @@ -1847,6 +1865,17 @@ pSmi->DataPortBase = pSmi->MapBase + 0x100000; pSmi->DataPortSize = 0x100000; break; + + case SMI_MSOC: + pSmi->DPRBase = pSmi->MapBase + 0x100000; + pSmi->VPRBase = pSmi->MapBase + 0x000000; + pSmi->CPRBase = pSmi->MapBase + 0x090000; + pSmi->DCRBase = pSmi->MapBase + 0x080000; + pSmi->SCRBase = pSmi->MapBase + 0x000000; + pSmi->IOBase = 0; + pSmi->DataPortBase = pSmi->MapBase + 0x110000; + pSmi->DataPortSize = 0x010000; + break; } xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV, "Physical MMIO at 0x%08lX\n", (unsigned long)memBase); @@ -1894,21 +1923,30 @@ /* Set up offset to hwcursor memory area. It's a 1K chunk at the end of * the frame buffer. Also set up the reserved memory space. */ - pSmi->FBCursorOffset = pSmi->videoRAMBytes - 1024; - if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x30) & 0x01)/* #1074 */ + if (pSmi->Chipset == SMI_MSOC) { - CARD32 fifoOffset = 0; - fifoOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x46) - << 3; - fifoOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x47) - << 11; - fifoOffset |= (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x49) - & 0x1C) << 17; - pSmi->FBReserved = fifoOffset; /* PDR#1074 */ + /* Due to a HW issue with an early rev of Voyager, need 2048 bytes */ + pSmi->FBCursorOffset = pSmi->videoRAMBytes - 2048; + pSmi->FBReserved = pSmi->videoRAMBytes - 4096; } else { - pSmi->FBReserved = pSmi->videoRAMBytes - 2048; + pSmi->FBCursorOffset = pSmi->videoRAMBytes - 1024; + if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x30) & 0x01)/* #1074 */ + { + CARD32 fifoOffset = 0; + fifoOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x46) + << 3; + fifoOffset |= VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x47) + << 11; + fifoOffset |= (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x49) + & 0x1C) << 17; + pSmi->FBReserved = fifoOffset; /* PDR#1074 */ + } + else + { + pSmi->FBReserved = pSmi->videoRAMBytes - 2048; + } } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Cursor Offset: %08lX Reserved: %08lX\n", @@ -1933,33 +1971,33 @@ pSmi->lcdWidth = 640; pSmi->lcdHeight = 480; break; - + case PANEL_800x600: pSmi->lcdWidth = 800; pSmi->lcdHeight = 600; break; - + case PANEL_1024x768: pSmi->lcdWidth = 1024; pSmi->lcdHeight = 768; break; - + case PANEL_1280x1024: pSmi->lcdWidth = 1280; pSmi->lcdHeight = 1024; break; - + case PANEL_1600x1200: pSmi->lcdWidth = 1600; pSmi->lcdHeight = 1200; break; - + case PANEL_1400x1050: pSmi->lcdWidth = 1400; pSmi->lcdHeight = 1050; break; } - + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Detected panel size via BIOS: %d x %d\n", pSmi->lcdWidth, pSmi->lcdHeight); } @@ -1970,13 +2008,13 @@ pSmi->lcdHeight = pScrn->virtualY; } } - else + else { /* int10 support isn't setup on the second call to this function, so if this is the second call, don't do detection again */ if (pSmi->lcd == 0) { - /* If we get here, int10 support is not loaded or not working */ + /* If we get here, int10 support is not loaded or not working */ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No BIOS support for 730 panel detection!\n"); pSmi->lcdWidth = pScrn->virtualX; pSmi->lcdHeight = pScrn->virtualY; @@ -1986,10 +2024,18 @@ /* Set this to indicate that we've done the detection */ pSmi->lcd = 1; } - else /* panel size detection for hardware other than 730 */ + else if (pSmi->Chipset == SMI_MSOC) + { + pSmi->lcd = 1; + /* Hardcode panel size for now, we can add options for it later */ + /* Not that it seems to make any difference at all */ + pSmi->lcdWidth = 1024; + pSmi->lcdHeight = 768; + } + else /* panel size detection for hardware other than 730 or 501 */ { pSmi->lcd = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31) & 0x01; - + if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x30) & 0x01) { pSmi->lcd <<= 1; @@ -2000,12 +2046,12 @@ pSmi->lcdWidth = 640; pSmi->lcdHeight = 480; break; - + case 0x04: pSmi->lcdWidth = 800; pSmi->lcdHeight = 600; break; - + case 0x08: if (VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x74) & 0x02) { @@ -2018,7 +2064,7 @@ pSmi->lcdHeight = 768; } break; - + case 0x0C: pSmi->lcdWidth = 1280; pSmi->lcdHeight = 1024; @@ -2030,24 +2076,27 @@ (pSmi->lcd == 0) ? "OFF" : (pSmi->lcd == 1) ? "TFT" : "DSTN", pSmi->lcdWidth, pSmi->lcdHeight); - /* Assign hwp->MemBase & IOBase here */ - hwp = VGAHWPTR(pScrn); - if (pSmi->IOBase != NULL) + if (pSmi->Chipset != SMI_MSOC) { - vgaHWSetMmioFuncs(hwp, pSmi->MapBase, pSmi->IOBase - pSmi->MapBase); - } - vgaHWGetIOBase(hwp); + /* Assign hwp->MemBase & IOBase here */ + hwp = VGAHWPTR(pScrn); + if (pSmi->IOBase != NULL) + { + vgaHWSetMmioFuncs(hwp, pSmi->MapBase, pSmi->IOBase - pSmi->MapBase); + } + vgaHWGetIOBase(hwp); - /* Map the VGA memory when the primary video */ - if (xf86IsPrimaryPci(pSmi->PciInfo)) - { - hwp->MapSize = 0x10000; - if (!vgaHWMapMem(pScrn)) + /* Map the VGA memory when the primary video */ + if (xf86IsPrimaryPci(pSmi->PciInfo)) { - LEAVE_PROC("SMI_MapMem"); - return(FALSE); + hwp->MapSize = 0x10000; + if (!vgaHWMapMem(pScrn)) + { + LEAVE_PROC("SMI_MapMem"); + return(FALSE); + } + pSmi->PrimaryVidMapped = TRUE; } - pSmi->PrimaryVidMapped = TRUE; } LEAVE_PROC("SMI_MapMem"); @@ -2092,7 +2141,7 @@ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; SMIPtr pSmi = SMIPTR(pScrn); EntityInfoPtr pEnt; - + ENTER_PROC("SMI_ScreenInit"); /* Map MMIO regs and framebuffer */ @@ -2103,14 +2152,14 @@ } pEnt = xf86GetEntityInfo(pScrn->entityList[0]); - - if (!pSmi->pInt10) { + + if (!pSmi->pInt10 && (pSmi->Chipset != SMI_MSOC)) { pSmi->pInt10 = xf86InitInt10(pEnt->index); } /* Save the chip/graphics state */ SMI_Save(pScrn); - + /* Zero the frame buffer, #258 */ memset(pSmi->FBBase, 0, pSmi->videoRAMBytes); @@ -2129,7 +2178,7 @@ * will need to be setup before calling a fb ScreenInit() function and fixed * up after. * - * For most PC hardware at depths >= 8, the defaults that cfb uses are not + * For most PC hardware at depths >= 8, the defaults that fb uses are not * appropriate. In this driver, we fixup the visuals after. */ @@ -2145,30 +2194,20 @@ * support TrueColor and not DirectColor. To deal with this, call * miSetVisualTypes with the appropriate visual mask. */ -#ifndef USE_FB - if (pScrn->bitsPerPixel > 8) + if (!miSetVisualTypes(pScrn->depth, + miGetDefaultVisualMask(pScrn->depth), + pScrn->rgbBits, + pScrn->defaultVisual)) { - if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, - pScrn->defaultVisual)) - { - LEAVE_PROC("SMI_ScreenInit"); - return(FALSE); - } + LEAVE_PROC("SMI_ScreenInit"); + return(FALSE); } - else -#endif + + if (!miSetPixmapDepths()) { - if (!miSetVisualTypes(pScrn->depth, - miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, - pScrn->defaultVisual)) - { - LEAVE_PROC("SMI_ScreenInit"); - return(FALSE); - } + LEAVE_PROC("SMI_ScreenInit"); + return FALSE; } -#ifdef USE_FB - if (!miSetPixmapDepths ()) return FALSE; -#endif if (!SMI_InternalScreenInit(scrnIndex, pScreen)) { @@ -2197,17 +2236,15 @@ } } -#ifdef USE_FB /* must be after RGB ordering fixed */ fbPictureInit(pScreen, 0, 0); -#endif - + /* CZ 18.06.2001: moved here from smi_accel.c to have offscreen framebuffer in NoAccel mode */ { int numLines, maxLines; BoxRec AvailFBArea; - + maxLines = pSmi->FBReserved / (pSmi->width * pSmi->Bpp); if (pSmi->rotate) { numLines = maxLines; @@ -2223,7 +2260,7 @@ numLines = maxLines; #endif } - + AvailFBArea.x1 = 0; AvailFBArea.y1 = 0; AvailFBArea.x2 = pSmi->width; @@ -2235,8 +2272,7 @@ xf86InitFBManager(pScreen, &AvailFBArea); } /* end CZ */ - - + /* Initialize acceleration layer */ if (!pSmi->NoAccel) { if (!SMI_AccelInit(pScreen)) { @@ -2244,12 +2280,12 @@ return(FALSE); } } - + miInitializeBackingStore(pScreen); - + /* hardware cursor needs to wrap this layer */ SMI_DGAInit(pScreen); - + /* Initialise cursor functions */ miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); @@ -2300,8 +2336,8 @@ /* Initialize colormap layer. Must follow initialization of the default * colormap. And SetGamma call, else it will load palette with solid white. */ - /* CZ 2.11.2001: CMAP_PALETTED_TRUECOLOR for gamma correction */ - if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits, SMI_LoadPalette, NULL, + /* CZ 2.11.2001: CMAP_PALETTED_TRUECOLOR for gamma correction */ + if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits, SMI_LoadPalette, NULL, CMAP_RELOAD_ON_MODE_SWITCH | CMAP_PALETTED_TRUECOLOR)) { LEAVE_PROC("SMI_ScreenInit"); @@ -2324,7 +2360,7 @@ { xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); } - + LEAVE_PROC("SMI_ScreenInit"); return(TRUE); } @@ -2384,6 +2420,11 @@ { WRITE_FPR(pSmi, FPR0C, (pSmi->FBOffset = pSmi->FBReserved) >> 3); } + if (pSmi->Chipset == SMI_MSOC) + { + WRITE_DCR(pSmi, DCR0C, pSmi->FBOffset); + WRITE_DCR(pSmi, DCR204, pSmi->FBOffset); + } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Shadow: width=%d height=%d " @@ -2406,36 +2447,30 @@ pSmi->FBBase, width, height, displayWidth)); switch (pScrn->bitsPerPixel) { -#ifdef USE_FB case 8: case 16: case 24: + case 32: ret = fbScreenInit(pScreen, pSmi->FBBase, width, height, xDpi, yDpi, displayWidth,pScrn->bitsPerPixel); break; -#else - case 8: - ret = cfbScreenInit(pScreen, pSmi->FBBase, width, height, xDpi, - yDpi, displayWidth); - break; - case 16: - ret = cfb16ScreenInit(pScreen, pSmi->FBBase, width, height, xDpi, - yDpi, displayWidth); - break; - - case 24: - ret = cfb24ScreenInit(pScreen, pSmi->FBBase, width, height, xDpi, - yDpi, displayWidth); - break; -#endif default: xf86DrvMsg(scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) " "in SMI_InternalScreenInit\n", pScrn->bitsPerPixel); LEAVE_PROC("SMI_InternalScreenInit"); return(FALSE); } - + + if ((pSmi->Chipset == SMI_MSOC) && (pScrn->bitsPerPixel == 8)) + { + /* Initialize Palette entries 0 & 1, they don't seem to be hit */ + WRITE_DCR(pSmi, DCR400 + 0, 0x00000000); + WRITE_DCR(pSmi, DCR400 + 4, 0x00FFFFFF); + WRITE_DCR(pSmi, DCR800 + 0, 0x00000000); + WRITE_DCR(pSmi, DCR800 + 4, 0x00FFFFFF); + } + LEAVE_PROC("SMI_InternalScreenInit"); return(ret); } @@ -2449,7 +2484,7 @@ float refresh; ENTER_PROC("SMI_ValidMode"); - refresh = (mode->VRefresh > 0) ? mode->VRefresh + refresh = (mode->VRefresh > 0) ? mode->VRefresh : mode->Clock * 1000.0 / mode->VTotal / mode->HTotal; xf86DrvMsg(scrnIndex, X_INFO, "Mode: %dx%d %d-bpp, %fHz\n", mode->HDisplay, mode->VDisplay, pScrn->bitsPerPixel, refresh); @@ -2458,7 +2493,7 @@ { int mem; - if (pScrn->bitsPerPixel == 24) + if (pScrn->bitsPerPixel > 16) { LEAVE_PROC("SMI_ValidMode"); return(MODE_BAD); @@ -2502,7 +2537,7 @@ } #if 1 /* PDR#944 */ - if (pSmi->rotate) + if (pSmi->rotate && (pSmi->Chipset != SMI_MSOC)) { if ( (mode->HDisplay != pSmi->lcdWidth) || (mode->VDisplay != pSmi->lcdHeight) @@ -2531,9 +2566,35 @@ /* Store values to current mode register structs */ SMIRegPtr new = &pSmi->ModeReg; vgaRegPtr vganew = &hwp->ModeReg; - + ENTER_PROC("SMI_ModeInit"); + if (pSmi->Chipset == SMI_MSOC) + { + pSmi->Bpp = pScrn->bitsPerPixel / 8; + if (pSmi->rotate) + { + pSmi->width = pScrn->virtualY; + pSmi->height = pScrn->virtualX; + } + else + { + pSmi->width = pScrn->virtualX; + pSmi->height = pScrn->virtualY; + } + pSmi->Stride = (pScrn->virtualX * pSmi->Bpp + 15) & ~15; + + /* Set mode on Voyager */ + SMI_MSOCSetMode(pScrn, mode); + + /* Adjust the viewport */ + SMI_AdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + + SMI_PrintRegs(pScrn); + LEAVE_PROC("SMI_ModeInit"); + return TRUE; + } + hwp->Flags |= VGA_FIX_SYNC_PULSES; if(!vgaHWInit(pScrn, mode)) { @@ -2910,7 +2971,7 @@ vgaRegPtr vgaSavePtr = &hwp->SavedReg; SMIRegPtr SMISavePtr = &pSmi->SavedReg; Bool ret; - + ENTER_PROC("SMI_CloseScreen"); if (pScrn->vtSema) @@ -3008,7 +3069,7 @@ } #endif } - else + else if (pSmi->Chipset != SMI_MSOC) { Base = (Base + 7) & ~7; #if 1 /* PDR#1058 */ @@ -3019,7 +3080,15 @@ #endif } - WRITE_VPR(pSmi, 0x0C, Base >> 3); + if (pSmi->Chipset == SMI_MSOC) + { + WRITE_DCR(pSmi, DCR0C, Base); + WRITE_DCR(pSmi, DCR204, Base); + } + else + { + WRITE_VPR(pSmi, 0x0C, Base >> 3); + } if(pSmi->Chipset == SMI_COUGAR3DR) { WRITE_FPR(pSmi, FPR0C, Base >> 3); @@ -3051,7 +3120,7 @@ ENTER_PROC("SMI_LoadPalette"); /* Enable both the CRT and LCD DAC RAM paths, so both palettes are updated */ - if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR)) + if ((pSmi->Chipset == SMI_LYNX3DM) || (pSmi->Chipset == SMI_COUGAR3DR)) { CARD8 ccr66; @@ -3064,10 +3133,24 @@ { DEBUG((VERBLEV, "pal[%d] = %d %d %d\n", indicies[i], colors[indicies[i]].red, colors[indicies[i]].green, colors[indicies[i]].blue)); - VGAOUT8(pSmi, VGA_DAC_WRITE_ADDR, indicies[i]); - VGAOUT8(pSmi, VGA_DAC_DATA, colors[indicies[i]].red); - VGAOUT8(pSmi, VGA_DAC_DATA, colors[indicies[i]].green); - VGAOUT8(pSmi, VGA_DAC_DATA, colors[indicies[i]].blue); + if (pSmi->Chipset == SMI_MSOC) + { + int iRGB = (colors[indicies[i]].red << 16) | + (colors[indicies[i]].green << 8) | + (colors[indicies[i]].blue ); + + /* CRT palette */ + WRITE_DCR(pSmi, DCR400 + (4*indicies[i]), iRGB); + /* Panel palette */ + WRITE_DCR(pSmi, DCR800 + (4*indicies[i]), iRGB); + } + else + { + VGAOUT8(pSmi, VGA_DAC_WRITE_ADDR, indicies[i]); + VGAOUT8(pSmi, VGA_DAC_DATA, colors[indicies[i]].red); + VGAOUT8(pSmi, VGA_DAC_DATA, colors[indicies[i]].green); + VGAOUT8(pSmi, VGA_DAC_DATA, colors[indicies[i]].blue); + } } LEAVE_PROC("SMI_LoadPalette"); @@ -3077,12 +3160,20 @@ SMI_DisableVideo(ScrnInfoPtr pScrn) { SMIPtr pSmi = SMIPTR(pScrn); - CARD8 tmp; + CARD32 tmp; - if (!(tmp = VGAIN8(pSmi, VGA_DAC_MASK))) - return; - pSmi->DACmask = tmp; - VGAOUT8(pSmi, VGA_DAC_MASK, 0); + if (pSmi->Chipset == SMI_MSOC) + { + tmp = READ_DCR(pSmi, DCR200) | DCR200_CRT_BLANK; + WRITE_DCR(pSmi, DCR200, tmp); + } + else + { + if (!(tmp = VGAIN8(pSmi, VGA_DAC_MASK))) + return; + pSmi->DACmask = tmp; + VGAOUT8(pSmi, VGA_DAC_MASK, 0); + } } static void @@ -3090,10 +3181,17 @@ { SMIPtr pSmi = SMIPTR(pScrn); - VGAOUT8(pSmi, VGA_DAC_MASK, pSmi->DACmask); + if (pSmi->Chipset == SMI_MSOC) + { + CARD32 tmp = READ_DCR(pSmi, DCR200) & ~DCR200_CRT_BLANK; + WRITE_DCR(pSmi, DCR200, tmp); + } + else + { + VGAOUT8(pSmi, VGA_DAC_MASK, pSmi->DACmask); + } } - void SMI_EnableMmio(ScrnInfoPtr pScrn) { @@ -3103,6 +3201,9 @@ ENTER_PROC("SMI_EnableMmio"); + if (pSmi->Chipset == SMI_MSOC) + return; + /* * Enable chipset (seen on uninitialized secondary cards) might not be * needed once we use the VGA softbooter @@ -3132,6 +3233,9 @@ ENTER_PROC("SMI_DisableMmio"); + if (pSmi->Chipset == SMI_MSOC) + return; + vgaHWSetStdFuncs(hwp); /* Disable 2D/3D Engine and Video Processor */ @@ -3159,53 +3263,56 @@ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV, "START register dump ------------------\n"); - xf86ErrorFVerb(VERBLEV, "MISCELLANEOUS OUTPUT\n %02X\n", - VGAIN8(pSmi, VGA_MISC_OUT_R)); - - xf86ErrorFVerb(VERBLEV, "\nSEQUENCER\n" - " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF"); - for (i = 0x00; i <= 0xAF; i++) + if (pSmi->Chipset != SMI_MSOC) { - if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i); - if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " "); - xf86ErrorFVerb(VERBLEV, "%02X ", - VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, i)); - } + xf86ErrorFVerb(VERBLEV, "MISCELLANEOUS OUTPUT\n %02X\n", + VGAIN8(pSmi, VGA_MISC_OUT_R)); - xf86ErrorFVerb(VERBLEV, "\n\nCRT CONTROLLER\n" - " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF"); - for (i = 0x00; i <= 0xAD; i++) - { - if (i == 0x20) i = 0x30; - if (i == 0x50) i = 0x90; - if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i); - if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " "); - xf86ErrorFVerb(VERBLEV, "%02X ", - VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRReg, i)); - } + xf86ErrorFVerb(VERBLEV, "\nSEQUENCER\n" + " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF"); + for (i = 0x00; i <= 0xAF; i++) + { + if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i); + if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " "); + xf86ErrorFVerb(VERBLEV, "%02X ", + VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, i)); + } - xf86ErrorFVerb(VERBLEV, "\n\nGRAPHICS CONTROLLER\n" - " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF"); - for (i = 0x00; i <= 0x08; i++) - { - if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i); - if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " "); - xf86ErrorFVerb(VERBLEV, "%02X ", - VGAIN8_INDEX(pSmi, VGA_GRAPH_INDEX, VGA_GRAPH_DATA, i)); - } + xf86ErrorFVerb(VERBLEV, "\n\nCRT CONTROLLER\n" + " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF"); + for (i = 0x00; i <= 0xAD; i++) + { + if (i == 0x20) i = 0x30; + if (i == 0x50) i = 0x90; + if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i); + if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " "); + xf86ErrorFVerb(VERBLEV, "%02X ", + VGAIN8_INDEX(pSmi, vgaCRIndex, vgaCRReg, i)); + } - xf86ErrorFVerb(VERBLEV, "\n\nATTRIBUTE 0CONTROLLER\n" - " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF"); - for (i = 0x00; i <= 0x14; i++) - { + xf86ErrorFVerb(VERBLEV, "\n\nGRAPHICS CONTROLLER\n" + " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF"); + for (i = 0x00; i <= 0x08; i++) + { + if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i); + if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " "); + xf86ErrorFVerb(VERBLEV, "%02X ", + VGAIN8_INDEX(pSmi, VGA_GRAPH_INDEX, VGA_GRAPH_DATA, i)); + } + + xf86ErrorFVerb(VERBLEV, "\n\nATTRIBUTE 0CONTROLLER\n" + " x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF"); + for (i = 0x00; i <= 0x14; i++) + { + (void) VGAIN8(pSmi, vgaStatus); + if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i); + if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " "); + xf86ErrorFVerb(VERBLEV, "%02X ", + VGAIN8_INDEX(pSmi, VGA_ATTR_INDEX, VGA_ATTR_DATA_R, i)); + } (void) VGAIN8(pSmi, vgaStatus); - if ((i & 0xF) == 0x0) xf86ErrorFVerb(VERBLEV, "\n%02X|", i); - if ((i & 0x3) == 0x0) xf86ErrorFVerb(VERBLEV, " "); - xf86ErrorFVerb(VERBLEV, "%02X ", - VGAIN8_INDEX(pSmi, VGA_ATTR_INDEX, VGA_ATTR_DATA_R, i)); + VGAOUT8(pSmi, VGA_ATTR_INDEX, 0x20); } - (void) VGAIN8(pSmi, vgaStatus); - VGAOUT8(pSmi, VGA_ATTR_INDEX, 0x20); xf86ErrorFVerb(VERBLEV, "\n\nDPR x0 x4 x8 xC"); for (i = 0x00; i <= 0x44; i += 4) @@ -3396,11 +3503,15 @@ SMI_ProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; - if (xf86LoadSubModule(pScrn, "vbe")) + ModuleDescPtr pMod; + + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); pVbe = VBEInit(NULL, index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } @@ -3449,3 +3560,22 @@ LEAVE_PROC("SMI_ddc1"); return(success); } + +static Bool +SMI_MSOCSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) +{ + SMIPtr pSmi = SMIPTR(pScrn); + + ENTER_PROC("SMI_MSOCSetMode"); + + mode->VRefresh = 60; + + panelSetMode(pSmi, mode->HDisplay, mode->VDisplay, 0, mode->VRefresh, pSmi->Stride, pScrn->depth); + crtSetMode(pSmi, mode->HDisplay, mode->VDisplay, 0, mode->VRefresh, pSmi->Stride, pScrn->depth); + + panelUseCRT(pSmi, TRUE); /* Enable both outputs simultaneously */ + + LEAVE_PROC("SMI_MSOCSetMode"); + + return TRUE; +} Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_hwcurs.c diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_hwcurs.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_hwcurs.c:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_hwcurs.c:1.3 Wed Oct 8 07:13:01 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_hwcurs.c Thu Mar 9 12:37:08 2006 @@ -1,5 +1,3 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_hwcurs.c-arc 1.12 27 Nov 2000 15:47:48 Frido $ */ - /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. Copyright (C) 2000 Silicon Motion, Inc. All Rights Reserved. @@ -26,422 +24,720 @@ sale, use or other dealings in this Software without prior written authorization from the XFree86 Project and Silicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_hwcurs.c,v 1.3 2003/10/08 11:13:01 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_hwcurs.c,v 1.5 2006/03/09 17:37:08 tsi Exp $ */ #include "cursorstr.h" #include "smi.h" -#define MAX_CURSOR 32 +#define MAX_CURSOR 32 +#define MAX_CURSOR_501 64 +#define SMI_CURSOR_SIZE 1024 +#define SMI501_CURSOR_SIZE 2048 + +static unsigned short +InterleaveBytes(unsigned char source, unsigned char mask) +{ + unsigned char ibit; + unsigned short usWord = 0; + unsigned char ucBitMask = 0x01; + + /* + * This function will interleave the bits in the source and mask bytes + * to create a word that looks like this: + * + * [M7 M6 M5 M4 M3 M2 M1 M0] [S7 S6 S5 S4 S3 S2 S1 S0] + * + * Results in: + * + * [M7 S7 M6 S6 M5 S5 M4 S4 M3 S3 M2 S2 M1 S1 M0 S0] + */ + + for (ibit = 0; ibit < 8; ibit++) + { + usWord |= (source & ucBitMask) << ibit; + usWord |= (mask & ucBitMask) << (ibit + 1); + ucBitMask <<= 1; + } + + return usWord; +} static unsigned char * SMI_RealizeCursor(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) { - SMIPtr pSmi = SMIPTR(infoPtr->pScrn); - CursorBitsPtr bits = pCurs->bits; - unsigned char * ram; - unsigned char * psource = bits->source; - unsigned char * pmask = bits->mask; - int x, y, srcwidth, i; - - ENTER_PROC("SMI_RealizeCursor"); - - /* Allocate memory */ - ram = (unsigned char *) xcalloc(1, 1024); - if (ram == NULL) - { - LEAVE_PROC("SMI_RealizeCursor"); - return(NULL); - } - - /* Calculate cursor information */ - srcwidth = ((bits->width + 31) / 8) & ~3; - i = 0; - - switch (pSmi->rotate) - { - default: - /* Copy cursor image */ - for (y = 0; y < min(MAX_CURSOR, bits->height); y++) - { - for (x = 0; x < min(MAX_CURSOR / 8, srcwidth); x++) - { - unsigned char mask = byte_reversed[*pmask++]; - unsigned char source = byte_reversed[*psource++] & mask; - - ram[i++] = ~mask; - ram[i++] = source; - if (i & 4) i += 4; - } - - pmask += srcwidth - x; - psource += srcwidth - x; - - /* Fill remaining part of line with no shape */ - for (; x < MAX_CURSOR / 8; x++) - { - ram[i++] = 0xFF; - ram[i++] = 0x00; - if (i & 4) i += 4; - } - } - - /* Fill remaining part of memory with no shape */ - for (; y < MAX_CURSOR; y++) - { - for (x = 0; x < MAX_CURSOR / 8; x++) - { - ram[i++] = 0xFF; - ram[i++] = 0x00; - if (i & 4) i += 4; - } - } - break; - - case SMI_ROTATE_CW: - /* Initialize cursor memory */ - for (i = 0; i < 1024;) - { - ram[i++] = 0xFF; - ram[i++] = 0x00; - if (i & 4) i += 4; - } - - /* Rotate cursor image */ - for (y = 0; y < min(MAX_CURSOR, bits->height); y++) - { - unsigned char bitmask = 0x01 << (y & 7); - int index = ((MAX_CURSOR - y - 1) / 8) * 2; - if (index & 4) index += 4; - - for (x = 0; x < min(MAX_CURSOR / 8, srcwidth); x++) - { - unsigned char mask = *pmask++; - unsigned char source = *psource++ & mask; - - i = index + (x * 8) * 16; - if (mask || (source & mask)) - { - unsigned char bit; - for (bit = 0x01; bit; bit <<= 1) - { - if (mask & bit) - { - ram[i + 0] &= ~bitmask; - } - - if (source & bit) - { - ram[i + 1] |= bitmask; - } - - i += 16; - } - } - } - - pmask += srcwidth - x; - psource += srcwidth - x; - } - break; - - case SMI_ROTATE_CCW: - /* Initialize cursor memory */ - for (i = 0; i < 1024;) - { - ram[i++] = 0xFF; - ram[i++] = 0x00; - if (i & 4) i += 4; - } - - /* Rotate cursor image */ - for (y = 0; y < min(MAX_CURSOR, bits->height); y++) - { - unsigned char bitmask = 0x80 >> (y & 7); - int index = (y >> 3) * 2; - if (index & 4) index += 4; - - for (x = 0; x < min(MAX_CURSOR / 8, srcwidth); x++) - { - unsigned char mask = *pmask++; - unsigned char source = *psource++ & mask; - - i = index + (MAX_CURSOR - x * 8 - 1) * 16; - if (mask || (source & mask)) - { - unsigned char bit; - for (bit = 0x01; bit; bit <<= 1) - { - if (mask & bit) - { - ram[i + 0] &= ~bitmask; - } - - if (source & bit) - { - ram[i + 1] |= bitmask; - } - - i -= 16; - } - } - } - - pmask += srcwidth - x; - psource += srcwidth - x; - } - break; - } + SMIPtr pSmi = SMIPTR(infoPtr->pScrn); + CursorBitsPtr bits = pCurs->bits; + unsigned char * ram; + unsigned char * psource = bits->source; + unsigned char * pmask = bits->mask; + int x, y, srcwidth, i; + + ENTER_PROC("SMI_RealizeCursor"); + + /* Allocate memory */ + ram = (unsigned char *) xcalloc(1, 1024); + if (ram == NULL) + { + LEAVE_PROC("SMI_RealizeCursor"); + return(NULL); + } + + /* Calculate cursor information */ + srcwidth = ((bits->width + 31) / 8) & ~3; + i = 0; + + switch (pSmi->rotate) + { + default: + /* Copy cursor image */ + for (y = 0; y < min(MAX_CURSOR, bits->height); y++) + { + for (x = 0; x < min(MAX_CURSOR / 8, srcwidth); x++) + { + unsigned char mask = byte_reversed[*pmask++]; + unsigned char source = byte_reversed[*psource++] & mask; + + ram[i++] = ~mask; + ram[i++] = source; + if (i & 4) i += 4; + } + + pmask += srcwidth - x; + psource += srcwidth - x; + + /* Fill remaining part of line with no shape */ + for (; x < MAX_CURSOR / 8; x++) + { + ram[i++] = 0xFF; + ram[i++] = 0x00; + if (i & 4) i += 4; + } + } + + /* Fill remaining part of memory with no shape */ + for (; y < MAX_CURSOR; y++) + { + for (x = 0; x < MAX_CURSOR / 8; x++) + { + ram[i++] = 0xFF; + ram[i++] = 0x00; + if (i & 4) i += 4; + } + } + break; - LEAVE_PROC("SMI_RealizeCursor"); - return(ram); + case SMI_ROTATE_CW: + /* Initialize cursor memory */ + for (i = 0; i < 1024;) + { + ram[i++] = 0xFF; + ram[i++] = 0x00; + if (i & 4) i += 4; + } + + /* Rotate cursor image */ + for (y = 0; y < min(MAX_CURSOR, bits->height); y++) + { + unsigned char bitmask = 0x01 << (y & 7); + int index = ((MAX_CURSOR - y - 1) / 8) * 2; + if (index & 4) index += 4; + + for (x = 0; x < min(MAX_CURSOR / 8, srcwidth); x++) + { + unsigned char mask = *pmask++; + unsigned char source = *psource++ & mask; + + i = index + (x * 8) * 16; + if (mask || (source & mask)) + { + unsigned char bit; + for (bit = 0x01; bit; bit <<= 1) + { + if (mask & bit) + { + ram[i + 0] &= ~bitmask; + } + + if (source & bit) + { + ram[i + 1] |= bitmask; + } + + i += 16; + } + } + } + + pmask += srcwidth - x; + psource += srcwidth - x; + } + break; + + case SMI_ROTATE_CCW: + /* Initialize cursor memory */ + for (i = 0; i < 1024;) + { + ram[i++] = 0xFF; + ram[i++] = 0x00; + if (i & 4) i += 4; + } + + /* Rotate cursor image */ + for (y = 0; y < min(MAX_CURSOR, bits->height); y++) + { + unsigned char bitmask = 0x80 >> (y & 7); + int index = (y >> 3) * 2; + if (index & 4) index += 4; + + for (x = 0; x < min(MAX_CURSOR / 8, srcwidth); x++) + { + unsigned char mask = *pmask++; + unsigned char source = *psource++ & mask; + + i = index + (MAX_CURSOR - x * 8 - 1) * 16; + if (mask || (source & mask)) + { + unsigned char bit; + for (bit = 0x01; bit; bit <<= 1) + { + if (mask & bit) + { + ram[i + 0] &= ~bitmask; + } + + if (source & bit) + { + ram[i + 1] |= bitmask; + } + + i -= 16; + } + } + } + + pmask += srcwidth - x; + psource += srcwidth - x; + } + break; + } + + LEAVE_PROC("SMI_RealizeCursor"); + return(ram); } +/* 501-specific cursor rotation routine (from the Windows CE driver) */ static void -SMI_LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src) +SMI501_RotateCursorShape(xf86CursorInfoPtr infoPtr, int angle, + unsigned char *pByte) { - SMIPtr pSmi = SMIPTR(pScrn); - CARD8 tmp; + BYTE *pCursor; + unsigned long ulBase, ulIndex; + BYTE src[256], dst[256]; /* 128 = 8 x 32 */ + BYTE jMask, j, bitMask; + int x, y, cx = 32, cy = 32; - ENTER_PROC("SMI_LoadCursorImage"); + pCursor = pByte; - /* Load storage location. */ - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x80, - pSmi->FBCursorOffset / 2048); - tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81) & 0x80; - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, - tmp | ((pSmi->FBCursorOffset / 2048) >> 8)); + memset(src, 0x00, sizeof(src)); + memset(dst, 0x00, sizeof(dst)); - /* Program FPR copy when on the 730 */ - if (pSmi->Chipset == SMI_COUGAR3DR) + /* Save the original pointer shape into local memory shapeRow[] */ + for (y=0; y<cy; y++) { - CARD32 fpr15c; + for (x=0; x<cx/4; x++) + src[y*8+x] = pByte[x]; + pByte+=16; + } - /* put address in upper word, and disable the cursor */ - fpr15c = READ_FPR(pSmi, FPR15C) & FPR15C_MASK_HWCCOLORS; - fpr15c |= (pSmi->FBCursorOffset / 2048) << 16; - WRITE_FPR(pSmi, FPR15C, fpr15c); + switch (angle) + { + case SMI_ROTATE_CCW: + + for (y = 0; y < cy; y++) + { + jMask = 0x02 << ((y&3)*2); + for (x = 0; x < cx; x++) + { + j = src[y*8 + x/4]; + bitMask = 0x02 << ((x&3)*2); + + ulBase = (31 - x) * 8; + ulIndex = (ulBase + y / 4); + + if (j & bitMask) + dst[ulIndex] |= jMask; + if (j & (bitMask>>1)) + dst[ulIndex] |= (jMask >> 1); + } + } + break; + + case SMI_ROTATE_CW: + + for (y = 0; y < cy; y++) + { + jMask = 0x80 >> ((y&3)*2); + + /* Write available bits into shapeRow */ + for (x = 0; x < cx; x++) + { + j = src[y*8 + x/4]; + bitMask = 0x02 << ((x&3)*2); + + ulBase = x * 8; + ulIndex = (ulBase + (31 - y) / 4); + + if (j & bitMask) + dst[ulIndex] |= jMask; + if (j & (bitMask>>1)) + dst[ulIndex] |= (jMask >> 1); + } + } + break; + + default: + return; } - /* Copy cursor image to framebuffer storage */ - memcpy(pSmi->FBBase + pSmi->FBCursorOffset, src, 1024); + for (y=0; y<cy; y++) + { + for (x=0; x<cx/4; x++) + pCursor[x] = dst[y*8+x]; + pCursor+=16; + } +} + +static unsigned char * +SMI_501_RealizeCursor(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) +{ + SMIPtr pSmi = SMIPTR(infoPtr->pScrn); + CursorBitsPtr bits = pCurs->bits; + unsigned char * ram; + unsigned short * usram; + unsigned char * psource = bits->source; + unsigned char * pmask = bits->mask; + int x, y, srcwidth, i; + + ENTER_PROC("SMI_501_RealizeCursor"); + + /* Allocate memory */ + ram = (unsigned char *) xcalloc(1, SMI501_CURSOR_SIZE); + + usram = (unsigned short *)ram; - LEAVE_PROC("SMI_LoadCursorImage"); + if (ram == NULL) + { + LEAVE_PROC("SMI_501_RealizeCursor"); + return(NULL); + } + + /* Calculate cursor information */ + srcwidth = ((bits->width + 31) / 8) & ~3; + + i = 0; + + /* Copy cursor image */ + for (y = 0; y < min(MAX_CURSOR_501, bits->height); y++) + { + for (x = 0; x < min(MAX_CURSOR_501 / 8, srcwidth); x++) + { + unsigned char mask = *pmask++; + unsigned char source = *psource++ & mask; + + usram[i++] = InterleaveBytes(source, mask); + } + + pmask += srcwidth - x; + psource += srcwidth - x; + + /* Fill remaining part of line with no shape */ + for (; x < MAX_CURSOR_501 / 8; x++) + { + usram[i++] = 0x0000; + } + } + + /* Fill remaining part of memory with no shape */ + for (; y < MAX_CURSOR_501; y++) + { + for (x = 0; x < MAX_CURSOR_501 / 8; x++) + { + usram[i++] = 0x0000; + } + } + + SMI501_RotateCursorShape(infoPtr, pSmi->rotate, ram); + + LEAVE_PROC("SMI_501_RealizeCursor"); + return(ram); +} + +static void +SMI_LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src) +{ + SMIPtr pSmi = SMIPTR(pScrn); + CARD8 tmp; + + ENTER_PROC("SMI_LoadCursorImage"); + + if (pSmi->Chipset == SMI_MSOC) + { + /* Write address, disabling the HW cursor */ + WRITE_DCR(pSmi, DCRF0, pSmi->FBCursorOffset); /* Panel */ + WRITE_DCR(pSmi, DCR230, pSmi->FBCursorOffset); /* CRT */ + } + else + { + /* Load storage location. */ + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x80, + pSmi->FBCursorOffset / 2048); + tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81) & 0x80; + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, + tmp | ((pSmi->FBCursorOffset / 2048) >> 8)); + + /* Program FPR copy when on the 730 */ + if (pSmi->Chipset == SMI_COUGAR3DR) + { + CARD32 fpr15c; + + /* put address in upper word, and disable the cursor */ + fpr15c = READ_FPR(pSmi, FPR15C) & FPR15C_MASK_HWCCOLORS; + fpr15c |= (pSmi->FBCursorOffset / 2048) << 16; + WRITE_FPR(pSmi, FPR15C, fpr15c); + } + } + + /* Copy cursor image to framebuffer storage */ + memcpy(pSmi->FBBase + pSmi->FBCursorOffset, src, 1024); + + LEAVE_PROC("SMI_LoadCursorImage"); } static void SMI_ShowCursor(ScrnInfoPtr pScrn) { - SMIPtr pSmi = SMIPTR(pScrn); - char tmp; + SMIPtr pSmi = SMIPTR(pScrn); + char tmp; - ENTER_PROC("SMI_ShowCursor"); + ENTER_PROC("SMI_ShowCursor"); + + if (pSmi->Chipset == SMI_MSOC) + { + CARD32 uiPanelTmp, uiCrtTmp; - /* Show cursor */ - tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81); - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, tmp | 0x80); + uiPanelTmp = READ_DCR(pSmi, DCRF0); + uiCrtTmp = READ_DCR(pSmi, DCR230); + uiPanelTmp |= SMI501_MASK_HWCENABLE; + uiCrtTmp |= SMI501_MASK_HWCENABLE; + WRITE_DCR(pSmi, DCRF0, uiPanelTmp); + WRITE_DCR(pSmi, DCR230, uiCrtTmp); - /* Program FPR copy when on the 730 */ - if (pSmi->Chipset == SMI_COUGAR3DR) + } + else { - CARD32 fpr15c; + tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81); + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, tmp | 0x80); + + /* Program FPR copy when on the 730 */ + if (pSmi->Chipset == SMI_COUGAR3DR) + { + CARD32 fpr15c; - /* turn on the top bit */ - fpr15c = READ_FPR(pSmi, FPR15C); - fpr15c |= FPR15C_MASK_HWCENABLE; - WRITE_FPR(pSmi, FPR15C, fpr15c); + /* turn on the top bit */ + fpr15c = READ_FPR(pSmi, FPR15C); + fpr15c |= FPR15C_MASK_HWCENABLE; + WRITE_FPR(pSmi, FPR15C, fpr15c); + } } - LEAVE_PROC("SMI_ShowCursor"); + LEAVE_PROC("SMI_ShowCursor"); } static void SMI_HideCursor(ScrnInfoPtr pScrn) { - SMIPtr pSmi = SMIPTR(pScrn); - char tmp; + SMIPtr pSmi = SMIPTR(pScrn); + char tmp; - ENTER_PROC("SMI_HideCursor"); + ENTER_PROC("SMI_HideCursor"); - /* Hide cursor */ - tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81); - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, tmp & ~0x80); + if (pSmi->Chipset == SMI_MSOC) + { + CARD32 uiPanelTmp, uiCrtTmp; - /* Program FPR copy when on the 730 */ - if (pSmi->Chipset == SMI_COUGAR3DR) + uiPanelTmp = READ_DCR(pSmi, DCRF0); + uiCrtTmp = READ_DCR(pSmi, DCR230); + uiPanelTmp &= ~SMI501_MASK_HWCENABLE; + uiCrtTmp &= ~SMI501_MASK_HWCENABLE; + WRITE_DCR(pSmi, DCRF0, uiPanelTmp); + WRITE_DCR(pSmi, DCR230, uiCrtTmp); + } + else { - CARD32 fpr15c; + tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81); + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x81, tmp & ~0x80); + + /* Program FPR copy when on the 730 */ + if (pSmi->Chipset == SMI_COUGAR3DR) + { + CARD32 fpr15c; - /* turn off the top bit */ - fpr15c = READ_FPR(pSmi, FPR15C); - fpr15c &= ~FPR15C_MASK_HWCENABLE; - WRITE_FPR(pSmi, FPR15C, fpr15c); + /* turn off the top bit */ + fpr15c = READ_FPR(pSmi, FPR15C); + fpr15c &= ~FPR15C_MASK_HWCENABLE; + WRITE_FPR(pSmi, FPR15C, fpr15c); + } } - LEAVE_PROC("SMI_HideCursor"); + LEAVE_PROC("SMI_HideCursor"); } static void SMI_SetCursorPosition(ScrnInfoPtr pScrn, int x, int y) { - SMIPtr pSmi = SMIPTR(pScrn); - int xoff, yoff; + SMIPtr pSmi = SMIPTR(pScrn); + int xoff, yoff; - ENTER_PROC("SMI_SetCursorPosition"); + ENTER_PROC("SMI_SetCursorPosition"); - /* Calculate coordinates for rotation */ - switch (pSmi->rotate) - { - default: - xoff = x; - yoff = y; - break; - - case SMI_ROTATE_CW: - xoff = pSmi->ShadowHeight - y - MAX_CURSOR; - yoff = x; - break; - - case SMI_ROTATE_CCW: - xoff = y; - yoff = pSmi->ShadowWidth - x - MAX_CURSOR; - break; - } - - /* Program coordinates */ - if (xoff >= 0) - { - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x88, xoff & 0xFF); - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x89, - (xoff >> 8) & 0x07); - } - else - { - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x88, - (-xoff) & (MAX_CURSOR - 1)); - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x89, 0x08); - } - - if (yoff >= 0) - { - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8A, yoff & 0xFF); - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8B, - (yoff >> 8) & 0x07); - } - else - { - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8A, - (-yoff) & (MAX_CURSOR - 1)); - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8B, 0x08); - } + /* Calculate coordinates for rotation */ + switch (pSmi->rotate) + { + default: + xoff = x; + yoff = y; + break; + + case SMI_ROTATE_CW: + xoff = pSmi->ShadowHeight - y - MAX_CURSOR; + yoff = x; + break; + + case SMI_ROTATE_CCW: + xoff = y; + yoff = pSmi->ShadowWidth - x - MAX_CURSOR; + break; + } - /* Program FPR copy when on the 730 */ - if (pSmi->Chipset == SMI_COUGAR3DR) + if (pSmi->Chipset == SMI_MSOC) { - CARD32 fpr158; + CARD32 hwcLocVal; if (xoff >= 0) { - fpr158 = (xoff & FPR158_MASK_MAXBITS)<<16; + hwcLocVal = (xoff & SMI501_MASK_MAXBITS); } else { - fpr158 = (((-xoff) & FPR158_MASK_MAXBITS) | FPR158_MASK_BOUNDARY)<<16; + hwcLocVal = ((-xoff) & SMI501_MASK_MAXBITS) | SMI501_MASK_BOUNDARY; } if (yoff >= 0) { - fpr158 |= (yoff & FPR158_MASK_MAXBITS); + hwcLocVal |= (yoff & SMI501_MASK_MAXBITS)<<16; } else { - fpr158 |= (((-yoff) & FPR158_MASK_MAXBITS) | FPR158_MASK_BOUNDARY); + hwcLocVal |= + (((-yoff) & SMI501_MASK_MAXBITS) | SMI501_MASK_BOUNDARY)<<16; } /* Program combined coordinates */ - WRITE_FPR(pSmi, FPR158, fpr158); + WRITE_DCR(pSmi, DCRF4, hwcLocVal); /* Panel HWC Location */ + WRITE_DCR(pSmi, DCR234, hwcLocVal); /* CRT HWC Location */ + } + else + { + /* Program coordinates */ + if (xoff >= 0) + { + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x88, xoff & 0xFF); + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x89, + (xoff >> 8) & 0x07); + } + else + { + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x88, + (-xoff) & (MAX_CURSOR - 1)); + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x89, 0x08); + } + + if (yoff >= 0) + { + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8A, yoff & 0xFF); + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8B, + (yoff >> 8) & 0x07); + } + else + { + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8A, + (-yoff) & (MAX_CURSOR - 1)); + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8B, 0x08); + } + /* Program FPR copy when on the 730 */ + if (pSmi->Chipset == SMI_COUGAR3DR) + { + CARD32 fpr158; + + if (xoff >= 0) + { + fpr158 = (xoff & FPR158_MASK_MAXBITS)<<16; + } + else + { + fpr158 = (((-xoff) & FPR158_MASK_MAXBITS) | FPR158_MASK_BOUNDARY)<<16; + } + + if (yoff >= 0) + { + fpr158 |= (yoff & FPR158_MASK_MAXBITS); + } + else + { + fpr158 |= (((-yoff) & FPR158_MASK_MAXBITS) | FPR158_MASK_BOUNDARY); + } + + /* Program combined coordinates */ + WRITE_FPR(pSmi, FPR158, fpr158); + } } - LEAVE_PROC("SMI_SetCursorPosition"); + LEAVE_PROC("SMI_SetCursorPosition"); } static void SMI_SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) { - SMIPtr pSmi = SMIPTR(pScrn); - unsigned char packedFG, packedBG; + SMIPtr pSmi = SMIPTR(pScrn); + unsigned char packedFG, packedBG; - ENTER_PROC("SMI_SetCursorColors"); + ENTER_PROC("SMI_SetCursorColors"); - /* Pack the true color into 8 bit */ - packedFG = (fg & 0xE00000) >> 16 - | (fg & 0x00E000) >> 11 - | (fg & 0x0000C0) >> 6 - ; - packedBG = (bg & 0xE00000) >> 16 - | (bg & 0x00E000) >> 11 - | (bg & 0x0000C0) >> 6 - ; - - /* Program the colors */ - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8C, packedFG); - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8D, packedBG); - - /* Program FPR copy when on the 730 */ - if (pSmi->Chipset == SMI_COUGAR3DR) + if (pSmi->Chipset == SMI_MSOC) { - CARD32 fpr15c; + /* + * For the SMI501 HWCursor, there are 4 possible colors, one of which + * is transparent: M,S: 0,0 = Transparent + * 0,1 = color 1 + * 1,0 = color 2 + * 1,1 = color 3 + * To simplify implementation, we use color2 == bg and color3 == fg + * Color 1 is don't care, so we set it to color 2's value + */ + unsigned int packedFGBG; + + /* Pack the true color components into 16 bit RGB -- 5:6:5 */ + packedFGBG = (bg & 0xF80000) >> 8 + | (bg & 0x00FC00) >> 5 + | (bg & 0x0000F8) >> 3 + ; + + packedFGBG |= (bg & 0xF80000) << 8 + | (bg & 0x00FC00) << 11 + | (bg & 0x0000F8) << 13 + ; + + WRITE_DCR(pSmi, DCRF8, packedFGBG); /* Panel HWC Color 1,2 */ + WRITE_DCR(pSmi, DCR238, packedFGBG); /* CRT HWC Color 1,2 */ + + packedFGBG = (fg & 0xF80000) >> 8 + | (fg & 0x00FC00) >> 5 + | (fg & 0x0000F8) >> 3 + ; + WRITE_DCR(pSmi, DCRFC, packedFGBG); /* Panel HWC Color 3 */ + WRITE_DCR(pSmi, DCR23C, packedFGBG); /* CRT HWC Color 3 */ + } + else + { + /* Pack the true color into 8 bit */ + packedFG = (fg & 0xE00000) >> 16 + | (fg & 0x00E000) >> 11 + | (fg & 0x0000C0) >> 6 + ; + packedBG = (bg & 0xE00000) >> 16 + | (bg & 0x00E000) >> 11 + | (bg & 0x0000C0) >> 6 + ; + + /* Program the colors */ + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8C, packedFG); + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x8D, packedBG); - fpr15c = READ_FPR(pSmi, FPR15C) & FPR15C_MASK_HWCADDREN; - fpr15c |= packedFG; - fpr15c |= packedBG<<8; - WRITE_FPR(pSmi, FPR15C, fpr15c); + /* Program FPR copy when on the 730 */ + if (pSmi->Chipset == SMI_COUGAR3DR) + { + CARD32 fpr15c; + + fpr15c = READ_FPR(pSmi, FPR15C) & FPR15C_MASK_HWCADDREN; + fpr15c |= packedFG; + fpr15c |= packedBG<<8; + WRITE_FPR(pSmi, FPR15C, fpr15c); + } } - LEAVE_PROC("SMI_SetCursorColors"); + LEAVE_PROC("SMI_SetCursorColors"); } Bool SMI_HWCursorInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - SMIPtr pSmi = SMIPTR(pScrn); - xf86CursorInfoPtr infoPtr; - Bool ret; - - ENTER_PROC("SMI_HWCursorInit"); - - /* Create cursor infor record */ - infoPtr = xf86CreateCursorInfoRec(); - if (infoPtr == NULL) - { - LEAVE_PROC("SMI_HWCursorInit"); - return(FALSE); - } + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + SMIPtr pSmi = SMIPTR(pScrn); + xf86CursorInfoPtr infoPtr; + Bool ret; + + ENTER_PROC("SMI_HWCursorInit"); + + /* Create cursor infor record */ + infoPtr = xf86CreateCursorInfoRec(); + if (infoPtr == NULL) + { + LEAVE_PROC("SMI_HWCursorInit"); + return(FALSE); + } pSmi->CursorInfoRec = infoPtr; - /* Fill in the information */ - infoPtr->MaxWidth = MAX_CURSOR; - infoPtr->MaxHeight = MAX_CURSOR; - infoPtr->Flags = HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 - | HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK - | HARDWARE_CURSOR_AND_SOURCE_WITH_MASK - | HARDWARE_CURSOR_BIT_ORDER_MSBFIRST - | HARDWARE_CURSOR_TRUECOLOR_AT_8BPP - | HARDWARE_CURSOR_INVERT_MASK; + /* Fill in the information */ + if (pSmi->Chipset == SMI_MSOC) + { + infoPtr->MaxWidth = MAX_CURSOR_501; + infoPtr->MaxHeight = MAX_CURSOR_501; + infoPtr->Flags = HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 + | HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK + | HARDWARE_CURSOR_TRUECOLOR_AT_8BPP; + } + else + { + infoPtr->MaxWidth = MAX_CURSOR; + infoPtr->MaxHeight = MAX_CURSOR; + infoPtr->Flags = HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 + | HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK + | HARDWARE_CURSOR_AND_SOURCE_WITH_MASK + | HARDWARE_CURSOR_BIT_ORDER_MSBFIRST + | HARDWARE_CURSOR_TRUECOLOR_AT_8BPP + | HARDWARE_CURSOR_INVERT_MASK; + } infoPtr->SetCursorColors = SMI_SetCursorColors; infoPtr->SetCursorPosition = SMI_SetCursorPosition; infoPtr->LoadCursorImage = SMI_LoadCursorImage; infoPtr->HideCursor = SMI_HideCursor; infoPtr->ShowCursor = SMI_ShowCursor; - infoPtr->RealizeCursor = SMI_RealizeCursor; + if (pSmi->Chipset == SMI_MSOC) + { + infoPtr->RealizeCursor = SMI_501_RealizeCursor; + } + else + { + infoPtr->RealizeCursor = SMI_RealizeCursor; + } infoPtr->UseHWCursor = NULL; - /* Proceed with cursor initialization */ + /* Proceed with cursor initialization */ ret = xf86InitCursor(pScreen, infoPtr); - LEAVE_PROC("SMI_HWCursorInit"); - return(ret); + LEAVE_PROC("SMI_HWCursorInit"); + return(ret); } Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_i2c.c diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_i2c.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_i2c.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_i2c.c:1.2 Thu Dec 20 16:35:39 2001 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_i2c.c Mon Jan 9 09:59:58 2006 @@ -1,5 +1,3 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_i2c.c-arc 1.10 27 Nov 2000 15:47:58 Frido $ */ - /* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. Copyright (C) 2000 Silicon Motion, Inc. All Rights Reserved. @@ -26,7 +24,7 @@ sale, use or other dealings in this Software without prior written authorization from the XFree86 Project and Silicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_i2c.c,v 1.2 2001/12/20 21:35:39 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_i2c.c,v 1.3 2006/01/09 14:59:58 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_shadow.c diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_shadow.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_shadow.c:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_shadow.c:1.3 Wed Oct 8 07:13:01 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_shadow.c Thu Mar 9 12:37:08 2006 @@ -1,5 +1,3 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_shadow.c-arc 1.10 30 Nov 2000 11:40:38 Frido $ */ - /* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. Copyright (C) 2000 Silicon Motion, Inc. All Rights Reserved. @@ -26,7 +24,7 @@ sale, use or other dealings in this Software without prior written authorization from the XFree86 Project and Silicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_shadow.c,v 1.3 2003/10/08 11:13:01 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_shadow.c,v 1.5 2006/03/09 17:37:08 tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -39,146 +37,311 @@ #include "smi.h" +#define ROTBLTWIDTH 16 + /******************************************************************************\ |* SMI_RefreshArea |*============================================================================= |* -|* PARAMETERS: pScrn Pointer to ScrnInfo structure. -|* num Number of boxes to refresh. -|* pbox Pointer to an array of boxes to refresh. +|* PARAMETERS: pScrn Pointer to ScrnInfo structure. +|* num Number of boxes to refresh. +|* pbox Pointer to an array of boxes to refresh. |* -|* DESCRIPTION: Refresh a portion of the shadow buffer to the visual screen -|* buffer. This is mainly used for rotation purposes. -|* y -|* RETURNS: Nothing. +|* DESCRIPTION: Refresh a portion of the shadow buffer to the visual screen +|* buffer. This is mainly used for rotation purposes. +|* y +|* RETURNS: Nothing. |* \******************************************************************************/ void SMI_RefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { - SMIPtr pSmi = SMIPTR(pScrn); - int width, height, srcX, srcY, destX, destY; + SMIPtr pSmi = SMIPTR(pScrn); + int width, height, srcX, srcY, destX, destY; + int leftoverwidth; + + ENTER_PROC("SMI_RefreshArea"); - ENTER_PROC("SMI_RefreshArea"); + /* #671 */ + if (pSmi->polyLines) + { + pSmi->polyLines = FALSE; + return; + } + + if (pSmi->rotate) + { + /* IF we need to do rotation, setup the hardware here. */ + WaitIdleEmpty(); + WRITE_DPR(pSmi, 0x10, pSmi->ShadowPitch); + WRITE_DPR(pSmi, 0x3C, pSmi->ShadowPitch); + + if (SMI_MSOC != pSmi->Chipset) + { + WRITE_DPR(pSmi, 0x44, pSmi->FBOffset >> 3); + } + else + { + WRITE_DPR(pSmi, 0x44, pSmi->FBOffset); + } + } - /* #671 */ - if (pSmi->polyLines) - { - pSmi->polyLines = FALSE; - return; - } - - if (pSmi->rotate) - { - /* IF we need to do rotation, setup the hardware here. */ - WaitIdleEmpty(); - WRITE_DPR(pSmi, 0x10, pSmi->ShadowPitch); - WRITE_DPR(pSmi, 0x3C, pSmi->ShadowPitch); - WRITE_DPR(pSmi, 0x44, pSmi->FBOffset >> 3); - } - - /* #672 */ - if (pSmi->ClipTurnedOn) - { - WaitQueue(1); - WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft); - pSmi->ClipTurnedOn = FALSE; - } - - while (num--) - { - /* Get coordinates of the box to refresh. */ - srcX = pbox->x1; - srcY = pbox->y1; - width = pbox->x2 - srcX; - height = pbox->y2 - srcY; - - DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", srcX, srcY, width, height)); - - if ((width > 0) && (height > 0)) - { - switch (pSmi->rotate) - { - case SMI_ROTATE_CW: - /* 90 degrees CW rotation. Calculate destination - coordinates: - - *---+ - | | +-----* - | | | | destX = shadowHeight - srcY - 1 - | | --> | | destY = srcX - | | | | - | | +-----+ - +---+ - */ - destX = pSmi->ShadowHeight - srcY - 1; - destY = srcX; - - WaitQueue(4); - WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); - WRITE_DPR(pSmi, 0x04, (destX << 16) + destY); - WRITE_DPR(pSmi, 0x08, (width << 16) + height); - WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT | - SMI_ROTATE_CW | SMI_START_ENGINE); - break; - - case SMI_ROTATE_CCW: - /* 90 degrees CCW rotatation. Calculate destination - coordinates: - - *---+ - | | +-----+ - | | | | destX = srcY - | | --> | | destY = shadowWidth - srcX - 1 - | | | | - | | *-----+ - +---+ - */ - destX = srcY; - destY = pSmi->ShadowWidth - srcX - 1; - - WaitQueue(4); - WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); - WRITE_DPR(pSmi, 0x04, (destX << 16) + destY); - WRITE_DPR(pSmi, 0x08, (width << 16) + height); - WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT | - SMI_ROTATE_CCW | SMI_START_ENGINE); - break; - - default: - /* No rotation, perform a normal copy. */ - if (pScrn->bitsPerPixel == 24) - { - srcX *= 3; - width *= 3; - - if (pSmi->Chipset == SMI_LYNX) - { - srcY *= 3; - } - } - - WaitQueue(4); - WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); - WRITE_DPR(pSmi, 0x04, (srcX << 16) + srcY); - WRITE_DPR(pSmi, 0x08, (width << 16) + height); - WRITE_DPR(pSmi, 0x0C, SMI_BITBLT + SMI_START_ENGINE + 0xCC); - break; - } - } - - pbox++; - } - - if (pSmi->rotate) - { - /* If we did a rotation, we need to restore the hardware state here. */ - WaitIdleEmpty(); - WRITE_DPR(pSmi, 0x10, (pSmi->Stride << 16) | pSmi->Stride); - WRITE_DPR(pSmi, 0x3C, (pSmi->Stride << 16) | pSmi->Stride); - WRITE_DPR(pSmi, 0x44, 0); - } + /* #672 */ + if (pSmi->ClipTurnedOn) + { + WaitQueue(1); + WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft); + pSmi->ClipTurnedOn = FALSE; + } + + while (num--) + { + /* Get coordinates of the box to refresh. */ + srcX = pbox->x1; + srcY = pbox->y1; + width = pbox->x2 - srcX; + height = pbox->y2 - srcY; + + DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", srcX, srcY, width, height)); + + if ((width > 0) && (height > 0)) + { + switch (pSmi->rotate) + { + case SMI_ROTATE_CW: + /* 90 degrees CW rotation. Calculate destination + coordinates: + + *---+ + | | +-----* + | | | | destX = shadowHeight - srcY - 1 + | | --> | | destY = srcX + | | | | + | | +-----+ + +---+ + */ + if (SMI_MSOC == pSmi->Chipset) + { + if (srcX < 0 || srcY < 0) + { + if (srcX < 0) + { + width += srcX; + srcX = 0; + } + if (srcY < 0) + { + height += srcY; + srcY = 0; + } + + if (width < 0 || height < 0) + { + /* Perform no operation if width or height is negative */ + break; + } + } + + /* Adjust source coordinates to be 32-byte aligned for 501 HW */ + width += srcX % (32/(pScrn->bitsPerPixel/8)); + srcX -= srcX % (32/(pScrn->bitsPerPixel/8)); + + destX = pSmi->ShadowHeight - srcY - 1; + destY = srcX; + + /* 501 has some wierdness where it won't clip correctly + * at the bottom of the screen. Need to do this in SW. */ + if ((srcX + width) > pSmi->width) + { + width -= ((srcX+width) - pSmi->width); + if (width <= 0) + break; + } + if ((srcY + height) > pSmi->height) + { + height -= ((srcY + height) - pSmi->height); + if (height <= 0) + break; + } + + + leftoverwidth = width; + + /* 501 Hardware cannot handle rotblits > 32 bytes */ + while (leftoverwidth > ROTBLTWIDTH) + { + + WaitQueue(4); + WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); + WRITE_DPR(pSmi, 0x04, (destX << 16) + destY); + WRITE_DPR(pSmi, 0x08, (ROTBLTWIDTH << 16) + height); + WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT | + SMI_ROTATE_CW | SMI_START_ENGINE); + + leftoverwidth -= ROTBLTWIDTH; + srcX += ROTBLTWIDTH; + destY = srcX; + } + + WaitQueue(4); + WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); + WRITE_DPR(pSmi, 0x04, (destX << 16) + destY); + WRITE_DPR(pSmi, 0x08, (leftoverwidth << 16) + height); + WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT | + SMI_ROTATE_CW | SMI_START_ENGINE); + } + else /* NOT SMOC 501 chipset */ + { + destX = pSmi->ShadowHeight - srcY - 1; + destY = srcX; + + WaitQueue(4); + WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); + WRITE_DPR(pSmi, 0x04, (destX << 16) + destY); + WRITE_DPR(pSmi, 0x08, (width << 16) + height); + WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT | + SMI_ROTATE_CW | SMI_START_ENGINE); + } + break; + + case SMI_ROTATE_CCW: + /* 90 degrees CCW rotatation. Calculate destination + coordinates: + + *---+ + | | +-----+ + | | | | destX = srcY + | | --> | | destY = shadowWidth - srcX - 1 + | | | | + | | *-----+ + +---+ + */ + + if (SMI_MSOC == pSmi->Chipset) + { + if (srcX < 0 || srcY < 0) + { + if (srcX < 0) + { + width += srcX; + srcX = 0; + } + if (srcY < 0) + { + height += srcY; + srcY = 0; + } + + if (width < 0 || height < 0) + { + /* Punt on blits with a negative width or height*/ + break; + } + } + + + /* Adjust source coordinates to be 32-byte aligned for 501 HW */ + width += srcX % (32/(pScrn->bitsPerPixel/8)); + srcX -= srcX % (32/(pScrn->bitsPerPixel/8)); + + destX = srcY; + destY = pSmi->ShadowWidth - srcX - 1; + + /* 501 has some wierdness where it won't clip correctly + * at the bottom of the screen. Need to do this in SW. */ + if ((srcX + width) > pSmi->width) + { + width -= ((srcX+width) - pSmi->width); + if (width <= 0) + break; + } + if ((srcY + height) > pSmi->height) + { + height -= ((srcY + height) - pSmi->height); + if (height <= 0) + break; + } + leftoverwidth = width; + + /* 501 Hardware cannot handle rotblits > 32 bytes */ + while (leftoverwidth > ROTBLTWIDTH) + { + WaitQueue(4); + WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); + WRITE_DPR(pSmi, 0x04, (destX << 16) + destY); + WRITE_DPR(pSmi, 0x08, (ROTBLTWIDTH << 16) + height); + WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT | + SMI_ROTATE_CCW | SMI_START_ENGINE); + + leftoverwidth -= ROTBLTWIDTH; + srcX += ROTBLTWIDTH; + destY = pSmi->ShadowWidth - srcX - 1; + + if (destY < 0) + { + destY = 0; + height-= 1; + } + } + + if (leftoverwidth > 0) + { + WaitQueue(4); + WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); + WRITE_DPR(pSmi, 0x04, (destX << 16) + destY); + WRITE_DPR(pSmi, 0x08, (leftoverwidth << 16) + height); + WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT | + SMI_ROTATE_CCW | SMI_START_ENGINE); + } + } + else + { + destX = srcY; + destY = pSmi->ShadowWidth - srcX - 1; + + WaitQueue(4); + WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); + WRITE_DPR(pSmi, 0x04, (destX << 16) + destY); + WRITE_DPR(pSmi, 0x08, (width << 16) + height); + WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT | + SMI_ROTATE_CCW | SMI_START_ENGINE); + } + break; + + default: + /* No rotation, perform a normal copy. */ + if (pScrn->bitsPerPixel == 24) + { + srcX *= 3; + width *= 3; + + if (pSmi->Chipset == SMI_LYNX) + { + srcY *= 3; + } + } + + WaitQueue(4); + WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); + WRITE_DPR(pSmi, 0x04, (srcX << 16) + srcY); + WRITE_DPR(pSmi, 0x08, (width << 16) + height); + WRITE_DPR(pSmi, 0x0C, SMI_BITBLT + SMI_START_ENGINE + 0xCC); + break; + } + } + + pbox++; + } + + if (pSmi->rotate) + { + /* If we did a rotation, we need to restore the hardware state here. */ + WaitIdleEmpty(); + WRITE_DPR(pSmi, 0x10, (pSmi->Stride << 16) | pSmi->Stride); + WRITE_DPR(pSmi, 0x3C, (pSmi->Stride << 16) | pSmi->Stride); + WRITE_DPR(pSmi, 0x44, 0); + } - LEAVE_PROC("SMI_RefreshArea"); + LEAVE_PROC("SMI_RefreshArea"); } /* Custom version for the 730 series (Cougar3DR). @@ -186,168 +349,168 @@ void SMI_RefreshArea730(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { - SMIPtr pSmi = SMIPTR(pScrn); - int width, height, srcX, srcY, destX, destY; - int maxPixels, tempWidth; - - ENTER_PROC("SMI_RefreshArea730"); - - /* #671 */ - if (pSmi->polyLines) - { - pSmi->polyLines = FALSE; - return; - } - - if (pSmi->rotate) - { - /* IF we need to do rotation, setup the hardware here. */ - WaitIdleEmpty(); - WRITE_DPR(pSmi, 0x10, pSmi->ShadowPitch); - WRITE_DPR(pSmi, 0x3C, pSmi->ShadowPitch); - WRITE_DPR(pSmi, 0x44, pSmi->FBOffset >> 3); - } - - /* #672 */ - if (pSmi->ClipTurnedOn) - { - WaitQueue(1); - WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft); - pSmi->ClipTurnedOn = FALSE; - } - - /* SM731 cannot rotate-blt more than a certain number of pixels - (based on a calculation from the Windows driver source */ - maxPixels = 1280 / pScrn->bitsPerPixel; - - while (num--) - { - /* Get coordinates of the box to refresh. */ - srcX = pbox->x1; - srcY = pbox->y1; - width = pbox->x2 - srcX; - height = pbox->y2 - srcY; - - DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", srcX, srcY, width, height)); - - if ((width > 0) && (height > 0)) - { - switch (pSmi->rotate) - { - case SMI_ROTATE_CW: - /* 90 degrees CW rotation. Calculate destination - coordinates: - - *---+ - | | +-----* - | | | | destX = shadowHeight - srcY - 1 - | | --> | | destY = srcX - | | | | - | | +-----+ - +---+ - */ - destX = pSmi->ShadowHeight - srcY - 1; - destY = srcX; - - for (tempWidth=width; tempWidth>0;) - { - if (width>maxPixels) - width = maxPixels; - WaitQueue(4); - WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); - WRITE_DPR(pSmi, 0x04, (destX << 16) + destY); - WRITE_DPR(pSmi, 0x08, (width << 16) + height); - WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT | - SMI_ROTATE_CW | SMI_START_ENGINE); - destY += maxPixels; - srcX += maxPixels; - tempWidth -= maxPixels; - width = tempWidth; - } - - break; - - case SMI_ROTATE_CCW: - /* 90 degrees CCW rotatation. Calculate destination - coordinates: - - *---+ - | | +-----+ - | | | | destX = srcY - | | --> | | destY = shadowWidth - srcX - 1 - | | | | - | | *-----+ - +---+ - */ - destX = srcY; - destY = pSmi->ShadowWidth - srcX - 1; - - for (tempWidth=width; tempWidth>0;) - { - if (width>maxPixels) - width = maxPixels; - WaitQueue(4); - WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); - WRITE_DPR(pSmi, 0x04, (destX << 16) + destY); - WRITE_DPR(pSmi, 0x08, (width << 16) + height); - WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT | - SMI_ROTATE_CCW | SMI_START_ENGINE); - destY -= maxPixels; - srcX += maxPixels; - tempWidth -= maxPixels; - width = tempWidth; - } - - break; - - default: - /* No rotation, perform a normal copy. */ - if (pScrn->bitsPerPixel == 24) - { - srcX *= 3; - width *= 3; - - if (pSmi->Chipset == SMI_LYNX) - { - srcY *= 3; - } - } - - WaitQueue(4); - WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); - WRITE_DPR(pSmi, 0x04, (srcX << 16) + srcY); - WRITE_DPR(pSmi, 0x08, (width << 16) + height); - WRITE_DPR(pSmi, 0x0C, SMI_BITBLT + SMI_START_ENGINE + 0xCC); - break; - } - } - - pbox++; - } - - if (pSmi->rotate) - { - /* If we did a rotation, we need to restore the hardware state here. */ - WaitIdleEmpty(); - WRITE_DPR(pSmi, 0x10, (pSmi->Stride << 16) | pSmi->Stride); - WRITE_DPR(pSmi, 0x3C, (pSmi->Stride << 16) | pSmi->Stride); - WRITE_DPR(pSmi, 0x44, 0); - } + SMIPtr pSmi = SMIPTR(pScrn); + int width, height, srcX, srcY, destX, destY; + int maxPixels, tempWidth; + + ENTER_PROC("SMI_RefreshArea730"); + + /* #671 */ + if (pSmi->polyLines) + { + pSmi->polyLines = FALSE; + return; + } + + if (pSmi->rotate) + { + /* IF we need to do rotation, setup the hardware here. */ + WaitIdleEmpty(); + WRITE_DPR(pSmi, 0x10, pSmi->ShadowPitch); + WRITE_DPR(pSmi, 0x3C, pSmi->ShadowPitch); + WRITE_DPR(pSmi, 0x44, pSmi->FBOffset >> 3); + } + + /* #672 */ + if (pSmi->ClipTurnedOn) + { + WaitQueue(1); + WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft); + pSmi->ClipTurnedOn = FALSE; + } + + /* SM731 cannot rotate-blt more than a certain number of pixels + (based on a calculation from the Windows driver source */ + maxPixels = 1280 / pScrn->bitsPerPixel; + + while (num--) + { + /* Get coordinates of the box to refresh. */ + srcX = pbox->x1; + srcY = pbox->y1; + width = pbox->x2 - srcX; + height = pbox->y2 - srcY; + + DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", srcX, srcY, width, height)); + + if ((width > 0) && (height > 0)) + { + switch (pSmi->rotate) + { + case SMI_ROTATE_CW: + /* 90 degrees CW rotation. Calculate destination + coordinates: + + *---+ + | | +-----* + | | | | destX = shadowHeight - srcY - 1 + | | --> | | destY = srcX + | | | | + | | +-----+ + +---+ + */ + destX = pSmi->ShadowHeight - srcY - 1; + destY = srcX; + + for (tempWidth=width; tempWidth>0;) + { + if (width>maxPixels) + width = maxPixels; + WaitQueue(4); + WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); + WRITE_DPR(pSmi, 0x04, (destX << 16) + destY); + WRITE_DPR(pSmi, 0x08, (width << 16) + height); + WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT | + SMI_ROTATE_CW | SMI_START_ENGINE); + destY += maxPixels; + srcX += maxPixels; + tempWidth -= maxPixels; + width = tempWidth; + } + + break; + + case SMI_ROTATE_CCW: + /* 90 degrees CCW rotatation. Calculate destination + coordinates: + + *---+ + | | +-----+ + | | | | destX = srcY + | | --> | | destY = shadowWidth - srcX - 1 + | | | | + | | *-----+ + +---+ + */ + destX = srcY; + destY = pSmi->ShadowWidth - srcX - 1; + + for (tempWidth=width; tempWidth>0;) + { + if (width>maxPixels) + width = maxPixels; + WaitQueue(4); + WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); + WRITE_DPR(pSmi, 0x04, (destX << 16) + destY); + WRITE_DPR(pSmi, 0x08, (width << 16) + height); + WRITE_DPR(pSmi, 0x0C, 0xCC | SMI_ROTATE_BLT | + SMI_ROTATE_CCW | SMI_START_ENGINE); + destY -= maxPixels; + srcX += maxPixels; + tempWidth -= maxPixels; + width = tempWidth; + } + + break; + + default: + /* No rotation, perform a normal copy. */ + if (pScrn->bitsPerPixel == 24) + { + srcX *= 3; + width *= 3; + + if (pSmi->Chipset == SMI_LYNX) + { + srcY *= 3; + } + } + + WaitQueue(4); + WRITE_DPR(pSmi, 0x00, (srcX << 16) + srcY); + WRITE_DPR(pSmi, 0x04, (srcX << 16) + srcY); + WRITE_DPR(pSmi, 0x08, (width << 16) + height); + WRITE_DPR(pSmi, 0x0C, SMI_BITBLT + SMI_START_ENGINE + 0xCC); + break; + } + } + + pbox++; + } + + if (pSmi->rotate) + { + /* If we did a rotation, we need to restore the hardware state here. */ + WaitIdleEmpty(); + WRITE_DPR(pSmi, 0x10, (pSmi->Stride << 16) | pSmi->Stride); + WRITE_DPR(pSmi, 0x3C, (pSmi->Stride << 16) | pSmi->Stride); + WRITE_DPR(pSmi, 0x44, 0); + } - LEAVE_PROC("SMI_RefreshArea730"); + LEAVE_PROC("SMI_RefreshArea730"); } /******************************************************************************\ |* SMI_PointerMoved |*============================================================================= |* -|* PARAMETERS: index Index of current screen. -|* x X location of pointer. -|* y Y location of pointer. +|* PARAMETERS: index Index of current screen. +|* x X location of pointer. +|* y Y location of pointer. |* -|* DESCRIPTION: Adjust the pointer location if we are in rotation mode. +|* DESCRIPTION: Adjust the pointer location if we are in rotation mode. |* -|* RETURNS: Nothing. +|* RETURNS: Nothing. |* \******************************************************************************/ void SMI_PointerMoved(int index, int x, int y) @@ -356,27 +519,27 @@ SMIPtr pSmi = SMIPTR(pScrn); int newX, newY; - switch (pSmi->rotate) - { - case SMI_ROTATE_CW: - /* 90 degrees CW rotation. */ - newX = pScrn->pScreen->height - y - 1; - newY = x; - break; - - case SMI_ROTATE_CCW: - /* 90 degrees CCW rotation. */ - newX = y; - newY = pScrn->pScreen->width - x - 1; - break; - - default: - /* No rotation. */ - newX = x; - newY = y; - break; + switch (pSmi->rotate) + { + case SMI_ROTATE_CW: + /* 90 degrees CW rotation. */ + newX = pScrn->pScreen->height - y - 1; + newY = x; + break; + + case SMI_ROTATE_CCW: + /* 90 degrees CCW rotation. */ + newX = y; + newY = pScrn->pScreen->width - x - 1; + break; + + default: + /* No rotation. */ + newX = x; + newY = y; + break; } - /* Pass adjusted pointer coordinates original PointerMoved function. */ + /* Pass adjusted pointer coordinates original PointerMoved function. */ (*pSmi->PointerMoved)(index, newX, newY); } Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c:1.14 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c:1.17 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c:1.14 Mon Dec 8 11:03:58 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c Thu Mar 9 12:37:08 2006 @@ -1,4 +1,3 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_video.c.-arc 1.14 30 Nov 2000 16:51:40 Frido $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. Copyright (C) 2000 Silicon Motion, Inc. All Rights Reserved. @@ -41,7 +40,7 @@ Date: 2.11.2001 */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c,v 1.14 2003/12/08 16:03:58 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c,v 1.17 2006/03/09 17:37:08 tsi Exp $ */ #include "smi.h" #include "smi_video.h" @@ -53,10 +52,10 @@ XV_INTERLACED = 0: only one field of an interlaced video signal is displayed: -> half vertical resolution, but no comb like artifacts from - moving vertical edges + moving vertical edges XV_INTERLACED = 1: both fields of an interlaced video signal are displayed: -> full vertical resolution, but comb like artifacts from - moving vertical edges + moving vertical edges The default value can be set with the driver option Interlaced @@ -70,21 +69,21 @@ #undef CLAMP #undef ENTRIES -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) #define ABS(n) (((n) < 0) ? -(n) : (n)) #define CLAMP(v, min, max) (((v) < (min)) ? (min) : MIN(v, max)) #define ENTRIES(array) (sizeof(array) / sizeof((array)[0])) -#define nElems(x) (sizeof(x) / sizeof(x[0])) +#define nElems(x) (sizeof(x) / sizeof(x[0])) -#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) +#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) #if SMI_USE_VIDEO #include "dixstruct.h" static int SMI_AddEncoding(XF86VideoEncodingPtr enc, int i, - int norm, int input, int channel); + int norm, int input, int channel); static void SMI_BuildEncodings(SMI_PortPtr p); static XF86VideoAdaptorPtr SMI_SetupVideo(ScreenPtr pScreen); @@ -92,38 +91,41 @@ #if SMI_USE_CAPTURE static int SMI_PutVideo(ScrnInfoPtr pScrn, - short vid_x, short vid_y, short drw_x, short drw_y, - short vid_w, short vid_h, short drw_w, short drw_h, - RegionPtr clipBoxes, pointer data); + short vid_x, short vid_y, short drw_x, short drw_y, + short vid_w, short vid_h, short drw_w, short drw_h, + RegionPtr clipBoxes, pointer data); #endif static void SMI_StopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown); static int SMI_SetPortAttribute(ScrnInfoPtr pScrn, Atom attribute, - INT32 value, pointer data); + INT32 value, pointer data); static int SMI_GetPortAttribute(ScrnInfoPtr pScrn, Atom attribute, - INT32 *value, pointer data); + INT32 *value, pointer data); static void SMI_QueryBestSize(ScrnInfoPtr pScrn, Bool motion, - short vid_w, short vid_h, short drw_w, short drw_h, - unsigned int *p_w, unsigned int *p_h, pointer data); + short vid_w, short vid_h, short drw_w, short drw_h, + unsigned int *p_w, unsigned int *p_h, pointer data); static int SMI_PutImage(ScrnInfoPtr pScrn, - short src_x, short src_y, short drw_x, short drw_y, - short src_w, short src_h, short drw_w, short drw_h, - int id, unsigned char *buf, short width, short height, Bool sync, - RegionPtr clipBoxes, pointer data); + short src_x, short src_y, short drw_x, short drw_y, + short src_w, short src_h, short drw_w, short drw_h, + int id, unsigned char *buf, short width, short height, Bool sync, + RegionPtr clipBoxes, pointer data); static int SMI_QueryImageAttributes(ScrnInfoPtr pScrn, - int id, unsigned short *width, unsigned short *height, - int *picthes, int *offsets); + int id, unsigned short *width, unsigned short *height, + int *picthes, int *offsets); static Bool SMI_ClipVideo(ScrnInfoPtr pScrn, BoxPtr dst, - INT32 *x1, INT32 *y1, INT32 *x2, INT32 *y2, - RegionPtr reg, INT32 width, INT32 height); + INT32 *x1, INT32 *y1, INT32 *x2, INT32 *y2, + RegionPtr reg, INT32 width, INT32 height); static void SMI_DisplayVideo(ScrnInfoPtr pScrn, int id, int offset, - short width, short height, int pitch, int x1, int y1, int x2, int y2, - BoxPtr dstBox, short vid_w, short vid_h, short drw_w, short drw_h); + short width, short height, int pitch, int x1, int y1, int x2, int y2, + BoxPtr dstBox, short vid_w, short vid_h, short drw_w, short drw_h); +static void SMI_DisplayVideo0501(ScrnInfoPtr pScrn, int id, int offset, + short width, short height, int pitch, int x1, int y1, int x2, int y2, + BoxPtr dstBox, short vid_w, short vid_h, short drw_w, short drw_h); static void SMI_DisplayVideo0730(ScrnInfoPtr pScrn, int id, int offset, - short width, short height, int pitch, int x1, int y1, int x2, int y2, - BoxPtr dstBox, short vid_w, short vid_h, short drw_w, short drw_h); + short width, short height, int pitch, int x1, int y1, int x2, int y2, + BoxPtr dstBox, short vid_w, short vid_h, short drw_w, short drw_h); static void SMI_BlockHandler(int i, pointer blockData, pointer pTimeout, - pointer pReadMask); + pointer pReadMask); #if 0 static void SMI_WaitForSync(ScrnInfoPtr pScrn); #endif @@ -132,16 +134,16 @@ static void SMI_InitOffscreenImages(ScreenPtr pScreen); static FBAreaPtr SMI_AllocateMemory(ScrnInfoPtr pScrn, FBAreaPtr area, - int numLines); + int numLines); static int SMI_AllocSurface(ScrnInfoPtr pScrn, - int id, unsigned short width, unsigned short height, - XF86SurfacePtr surface); + int id, unsigned short width, unsigned short height, + XF86SurfacePtr surface); static int SMI_FreeSurface(XF86SurfacePtr surface); static int SMI_DisplaySurface(XF86SurfacePtr surface, - short vid_x, short vid_y, short drw_x, short drw_y, - short vid_w, short vid_h, short drw_w, short drw_h, - RegionPtr clipBoxes); + short vid_x, short vid_y, short drw_x, short drw_y, + short vid_w, short vid_h, short drw_w, short drw_h, + RegionPtr clipBoxes); static int SMI_StopSurface(XF86SurfacePtr surface); static int SMI_GetSurfaceAttribute(ScrnInfoPtr pScrn, Atom attr, INT32 *value); static int SMI_SetSurfaceAttribute(ScrnInfoPtr pScrn, Atom attr, INT32 value); @@ -151,9 +153,6 @@ static int SetAttrSAA7111(ScrnInfoPtr pScrn, int i, int value); static void SetKeyReg(SMIPtr pSmi, int reg, int value); -#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,0,0) -static Bool RegionsEqual(RegionPtr A, RegionPtr B); -#endif /** * Atoms */ @@ -165,9 +164,9 @@ /******************************************************************************\ -** ** +** ** ** C A P A B I L I T I E S ** -** ** +** ** \******************************************************************************/ @@ -232,9 +231,9 @@ static XF86VideoFormatRec SMI_VideoFormats[] = { - { 15, TrueColor }, /* depth, class */ - { 16, TrueColor }, /* depth, class */ - { 24, TrueColor }, /* depth, class */ + { 15, TrueColor }, /* depth, class */ + { 16, TrueColor }, /* depth, class */ + { 24, TrueColor }, /* depth, class */ }; @@ -275,88 +274,137 @@ /**************************************************************************/ static XF86ImageRec SMI_VideoImages[] = { - XVIMAGE_YUY2, - XVIMAGE_YV12, - XVIMAGE_I420, - { - FOURCC_RV15, /* id */ - XvRGB, /* type */ - LSBFirst, /* byte_order */ - { 'R', 'V' ,'1', '5', - 0x00, '5', 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 }, /* guid */ - 16, /* bits_per_pixel */ - XvPacked, /* format */ - 1, /* num_planes */ - 15, /* depth */ - 0x001F, 0x03E0, 0x7C00, /* red_mask, green, blue */ - 0, 0, 0, /* y_sample_bits, u, v */ - 0, 0, 0, /* horz_y_period, u, v */ - 0, 0, 0, /* vert_y_period, u, v */ - { 'R', 'V', 'B' }, /* component_order */ - XvTopToBottom /* scaline_order */ - }, - { - FOURCC_RV16, /* id */ - XvRGB, /* type */ - LSBFirst, /* byte_order */ - { 'R', 'V' ,'1', '6', - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 }, /* guid */ - 16, /* bits_per_pixel */ - XvPacked, /* format */ - 1, /* num_planes */ - 16, /* depth */ - 0x001F, 0x07E0, 0xF800, /* red_mask, green, blue */ - 0, 0, 0, /* y_sample_bits, u, v */ - 0, 0, 0, /* horz_y_period, u, v */ - 0, 0, 0, /* vert_y_period, u, v */ - { 'R', 'V', 'B' }, /* component_order */ - XvTopToBottom /* scaline_order */ - }, - { - FOURCC_RV24, /* id */ - XvRGB, /* type */ - LSBFirst, /* byte_order */ - { 'R', 'V' ,'2', '4', - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 }, /* guid */ - 24, /* bits_per_pixel */ - XvPacked, /* format */ - 1, /* num_planes */ - 24, /* depth */ - 0x0000FF, 0x00FF00, 0xFF0000, /* red_mask, green, blue */ - 0, 0, 0, /* y_sample_bits, u, v */ - 0, 0, 0, /* horz_y_period, u, v */ - 0, 0, 0, /* vert_y_period, u, v */ - { 'R', 'V', 'B' }, /* component_order */ - XvTopToBottom /* scaline_order */ - }, - { - FOURCC_RV32, /* id */ - XvRGB, /* type */ - LSBFirst, /* byte_order */ - { 'R', 'V' ,'3', '2', - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 }, /* guid */ - 32, /* bits_per_pixel */ - XvPacked, /* format */ - 1, /* num_planes */ - 24, /* depth */ - 0x0000FF, 0x00FF00, 0xFF0000, /* red_mask, green, blue */ - 0, 0, 0, /* y_sample_bits, u, v */ - 0, 0, 0, /* horz_y_period, u, v */ - 0, 0, 0, /* vert_y_period, u, v */ - { 'R', 'V', 'B' }, /* component_order */ - XvTopToBottom /* scaline_order */ - }, + XVIMAGE_YUY2, + XVIMAGE_YV12, + XVIMAGE_I420, + { + FOURCC_RV15, /* id */ + XvRGB, /* type */ + LSBFirst, /* byte_order */ + { 'R', 'V' ,'1', '5', + 0x00, '5', 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }, /* guid */ + 16, /* bits_per_pixel */ + XvPacked, /* format */ + 1, /* num_planes */ + 15, /* depth */ + 0x001F, 0x03E0, 0x7C00, /* red_mask, green, blue */ + 0, 0, 0, /* y_sample_bits, u, v */ + 0, 0, 0, /* horz_y_period, u, v */ + 0, 0, 0, /* vert_y_period, u, v */ + { 'R', 'V', 'B' }, /* component_order */ + XvTopToBottom /* scaline_order */ + }, + { + FOURCC_RV16, /* id */ + XvRGB, /* type */ + LSBFirst, /* byte_order */ + { 'R', 'V' ,'1', '6', + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }, /* guid */ + 16, /* bits_per_pixel */ + XvPacked, /* format */ + 1, /* num_planes */ + 16, /* depth */ + 0x001F, 0x07E0, 0xF800, /* red_mask, green, blue */ + 0, 0, 0, /* y_sample_bits, u, v */ + 0, 0, 0, /* horz_y_period, u, v */ + 0, 0, 0, /* vert_y_period, u, v */ + { 'R', 'V', 'B' }, /* component_order */ + XvTopToBottom /* scaline_order */ + }, + { + FOURCC_RV24, /* id */ + XvRGB, /* type */ + LSBFirst, /* byte_order */ + { 'R', 'V' ,'2', '4', + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }, /* guid */ + 24, /* bits_per_pixel */ + XvPacked, /* format */ + 1, /* num_planes */ + 24, /* depth */ + 0x0000FF, 0x00FF00, 0xFF0000, /* red_mask, green, blue */ + 0, 0, 0, /* y_sample_bits, u, v */ + 0, 0, 0, /* horz_y_period, u, v */ + 0, 0, 0, /* vert_y_period, u, v */ + { 'R', 'V', 'B' }, /* component_order */ + XvTopToBottom /* scaline_order */ + }, + { + FOURCC_RV32, /* id */ + XvRGB, /* type */ + LSBFirst, /* byte_order */ + { 'R', 'V' ,'3', '2', + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }, /* guid */ + 32, /* bits_per_pixel */ + XvPacked, /* format */ + 1, /* num_planes */ + 24, /* depth */ + 0x0000FF, 0x00FF00, 0xFF0000, /* red_mask, green, blue */ + 0, 0, 0, /* y_sample_bits, u, v */ + 0, 0, 0, /* horz_y_period, u, v */ + 0, 0, 0, /* vert_y_period, u, v */ + { 'R', 'V', 'B' }, /* component_order */ + XvTopToBottom /* scaline_order */ + }, +}; + +/**************************************************************************/ +static XF86ImageRec SMI501_VideoImages[] = +{ + XVIMAGE_YUY2, + XVIMAGE_YV12, + XVIMAGE_I420, + { + FOURCC_RV16, /* id */ + XvRGB, /* type */ + LSBFirst, /* byte_order */ + { 'R', 'V' ,'1', '6', + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }, /* guid */ + 16, /* bits_per_pixel */ + XvPacked, /* format */ + 1, /* num_planes */ + 16, /* depth */ + 0x001F, 0x07E0, 0xF800, /* red_mask, green, blue */ + 0, 0, 0, /* y_sample_bits, u, v */ + 0, 0, 0, /* horz_y_period, u, v */ + 0, 0, 0, /* vert_y_period, u, v */ + { 'R', 'V', 'B' }, /* component_order */ + XvTopToBottom /* scaline_order */ + }, + { + FOURCC_RV32, /* id */ + XvRGB, /* type */ + LSBFirst, /* byte_order */ + { 'R', 'V' ,'3', '2', + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }, /* guid */ + 32, /* bits_per_pixel */ + XvPacked, /* format */ + 1, /* num_planes */ + 24, /* depth */ + 0x0000FF, 0x00FF00, 0xFF0000, /* red_mask, green, blue */ + 0, 0, 0, /* y_sample_bits, u, v */ + 0, 0, 0, /* horz_y_period, u, v */ + 0, 0, 0, /* vert_y_period, u, v */ + { 'R', 'V', 'B' }, /* component_order */ + XvTopToBottom /* scaline_order */ + }, }; + + + /**************************************************************************/ /** @@ -394,7 +442,7 @@ #if 0 static I2CByte SAA7110InitData[] = { - /* Configuration */ + /* Configuration */ 0x00, 0x4C, 0x01, 0x3C, 0x02, 0x00, 0x03, 0xEF, 0x04, 0xBD, 0x05, 0xE2, 0x06, 0x00, 0x07, 0x00, 0x08, 0xF8, 0x09, 0xF8, 0x0A, 0x60, 0x0B, 0x60, @@ -408,10 +456,10 @@ 0x2E, 0x83, 0x2F, 0x03, 0x30, 0x40, 0x31, 0x35, 0x32, 0x02, 0x33, 0x8C, 0x34, 0x03, - /* NTSC */ + /* NTSC */ 0x11, 0x2B, 0x0F, 0xD9, - /* RCA input connector */ + /* RCA input connector */ 0x06, 0x00, 0x0E, 0x18, 0x20, 0xD9, 0x21, 0x16, 0x22, 0x40, 0x2C, 0x03, @@ -421,9 +469,9 @@ static I2CByte SAA7111InitData[] = { 0x11, 0x1D, /* 0D D0=1: automatic colour killer off - D1=0: DMSD data to YUV output - D2=1: output enable H/V sync on - D3=1: output enable YUV data on */ + D1=0: DMSD data to YUV output + D2=1: output enable H/V sync on + D3=1: output enable YUV data on */ 0x02, 0xC0, /* Mode 0 */ 0x03, 0x23, /* automatic gain */ 0x04, 0x00, /* */ @@ -431,23 +479,23 @@ 0x06, 108, /* hor sync begin */ 0x07, 108, /* hor sync stop */ 0x08, 0x88, /* sync control: - D1-0=00: VNOI = normal mode - D2=0: PLL closed - D3=1: VTR mode - D7=1: automatic field detection */ + D1-0=00: VNOI = normal mode + D2=0: PLL closed + D3=1: VTR mode + D7=1: automatic field detection */ 0x09, 0x41, /* 4A luminance control */ 0x0A, 0x80, /* brightness = 128 (CCIR level) */ 0x0B, 0x40, /* contrast = 1.0 */ 0x0C, 0x40, /* crominance = 1.0 (CCIR level) */ 0x0D, 0x00, /* hue = 0 */ 0x0E, 0x01, /* chroma bandwidth = nominal - fast colour time constant = nominal - chrom comp filter on - colour standard PAL BGHI, NTSC M */ + fast colour time constant = nominal + chrom comp filter on + colour standard PAL BGHI, NTSC M */ 0x10, 0x48, /* luminance delay compensation = 0 - VRLN = 1 - fine pos of hs = 0 - output format = YUV 422 */ + VRLN = 1 + fine pos of hs = 0 + output format = YUV 422 */ 0x12, 0x00, /* 20 D5=1: VPO in tristate */ 0x13, 0x00, 0x15, 0x00, @@ -457,64 +505,13 @@ }; -/**************************************************************************/ - -/* To allow this ddx to work on 4_3_0 and above, we need to include this */ -#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,0,0) -static Bool -RegionsEqual( - RegionPtr A, - RegionPtr B -) -{ - int *dataA, *dataB; - int num; - - ENTER_PROC("RegionsEqual"); - - num = REGION_NUM_RECTS(A); - if (num != REGION_NUM_RECTS(B)) - { - LEAVE_PROC("RegionsEqual"); - return(FALSE); - } - - if ( (A->extents.x1 != B->extents.x1) - || (A->extents.y1 != B->extents.y1) - || (A->extents.x2 != B->extents.x2) - || (A->extents.y2 != B->extents.y2) - ) - { - LEAVE_PROC("RegionsEqual"); - return(FALSE); - } - - dataA = (int*) REGION_RECTS(A); - dataB = (int*) REGION_RECTS(B); - - while (num--) - { - if ((dataA[0] != dataB[0]) || (dataA[1] != dataB[1])) - { - return(FALSE); - } - dataA += 2; - dataB += 2; - } - - LEAVE_PROC("RegionsEqual"); - return(TRUE); -} -#endif - - /** * generates XF86VideoEncoding[i] with video norm norm, video input format * input and video input channel channel */ static int SMI_AddEncoding(XF86VideoEncodingPtr enc, int i, - int norm, int input, int channel) + int norm, int input, int channel) { char* norm_string; char* input_string; @@ -526,12 +523,12 @@ input_string = VideoInputs[input].name; sprintf(channel_string, "%d", channel); enc[i].id = i; - enc[i].name = xalloc(strlen(norm_string) + - strlen(input_string) + - strlen(channel_string)+3); + enc[i].name = xalloc(strlen(norm_string) + + strlen(input_string) + + strlen(channel_string)+3); if (NULL == enc[i].name) { - LEAVE_PROC("SMI_AddEncoding"); - return -1; + LEAVE_PROC("SMI_AddEncoding"); + return -1; } enc[i].width = VideoNorms[norm].Wa; enc[i].height = VideoNorms[norm].Ha; @@ -557,47 +554,47 @@ /* allocate memory for encoding array */ p->enc = xalloc(sizeof(XF86VideoEncodingRec) * N_ENCODINGS); if (NULL == p->enc) - goto fail; + goto fail; memset(p->enc,0,sizeof(XF86VideoEncodingRec) * N_ENCODINGS); /* allocate memory for video norm array */ p->norm = xalloc(sizeof(int) * N_ENCODINGS); if (NULL == p->norm) - goto fail; + goto fail; memset(p->norm,0,sizeof(int) * N_ENCODINGS); /* allocate memory for video input format array */ p->input = xalloc(sizeof(int) * N_ENCODINGS); if (NULL == p->input) - goto fail; + goto fail; memset(p->input,0,sizeof(int) * N_ENCODINGS); /* allocate memory for video channel number array */ p->channel = xalloc(sizeof(int) * N_ENCODINGS); if (NULL == p->channel) - goto fail; + goto fail; memset(p->channel,0,sizeof(int) * N_ENCODINGS); /* fill arrays */ p->nenc = 0; for (ch = 0; ch < N_COMPOSITE_CHANNELS; ch++) { - for (n = 0; n < N_VIDEO_NORMS; n++) { - SMI_AddEncoding(p->enc, p->nenc, n, COMPOSITE, ch); - p->norm[p->nenc] = n; - p->input[p->nenc] = COMPOSITE; - p->channel[p->nenc] = ch; - p->nenc++; - } + for (n = 0; n < N_VIDEO_NORMS; n++) { + SMI_AddEncoding(p->enc, p->nenc, n, COMPOSITE, ch); + p->norm[p->nenc] = n; + p->input[p->nenc] = COMPOSITE; + p->channel[p->nenc] = ch; + p->nenc++; + } } for (ch = 0; ch < N_SVIDEO_CHANNELS; ch++) { - for (n = 0; n < N_VIDEO_NORMS; n++) { - SMI_AddEncoding(p->enc, p->nenc, n, SVIDEO, ch); - p->norm[p->nenc] = n; - p->input[p->nenc] = SVIDEO; - p->channel[p->nenc] = ch; - p->nenc++; - } + for (n = 0; n < N_VIDEO_NORMS; n++) { + SMI_AddEncoding(p->enc, p->nenc, n, SVIDEO, ch); + p->norm[p->nenc] = n; + p->input[p->nenc] = SVIDEO; + p->channel[p->nenc] = ch; + p->nenc++; + } } LEAVE_PROC("SMI_BuildEncodings"); return; - + fail: if (p->input) xfree(p->input); p->input = NULL; @@ -690,7 +687,7 @@ Scale(int i, int value, int min, int max) { return min + (value - SMI_VideoAttributes[i].min_value) * (max - min) / - (SMI_VideoAttributes[i].max_value - SMI_VideoAttributes[i].min_value); + (SMI_VideoAttributes[i].max_value - SMI_VideoAttributes[i].min_value); } #endif /** @@ -703,24 +700,24 @@ SMI_PortPtr pPort = (SMI_PortPtr) pSmi->ptrAdaptor->pPortPrivates[0].ptr; if (i < XV_ENCODING || i > XV_HUE) - return BadMatch; - + return BadMatch; + /* clamps value to attribute range */ value = CLAMP(value, SMI_VideoAttributes[i].min_value, - SMI_VideoAttributes[i].max_value); + SMI_VideoAttributes[i].max_value); if (i == XV_BRIGHTNESS) { - int my_value = (value <= 128? value + 128 : value - 128); - SetKeyReg(pSmi, 0x5C, 0xEDEDED | (my_value << 24)); + int my_value = (value <= 128? value + 128 : value - 128); + SetKeyReg(pSmi, 0x5C, 0xEDEDED | (my_value << 24)); } else if (pPort->I2CDev.SlaveAddr == SAA7110) { - return SetAttrSAA7110(pScrn, i, value); + return SetAttrSAA7110(pScrn, i, value); } else if (pPort->I2CDev.SlaveAddr == SAA7111) { - return SetAttrSAA7111(pScrn, i, value); + return SetAttrSAA7111(pScrn, i, value); } #if 0 else { - return XvBadAlloc; + return XvBadAlloc; } #endif @@ -750,82 +747,82 @@ SMI_PortPtr pPort = (SMI_PortPtr) pSmi->ptrAdaptor->pPortPrivates[0].ptr; if (i == XV_ENCODING) { - int norm; - int input; - int channel; - norm = pPort->norm[value]; - input = pPort->input[value]; - channel = pPort->channel[value]; - - DEBUG((VERBLEV, "SetAttribute XV_ENCODING: %d. norm=%d input=%d channel=%d\n", - value, norm, input, channel)); - - /* set video norm */ - if (!xf86I2CWriteVec(&(pPort->I2CDev), SAA7111VideoStd[norm], - ENTRIES(SAA7111VideoStd[norm]) / 2)) { - return XvBadAlloc; - } - /* set video input format and channel */ - if (input == COMPOSITE) { - if (!xf86I2CWriteVec(&(pPort->I2CDev), - SAA7111CompositeChannelSelect[channel], - ENTRIES(SAA7111CompositeChannelSelect[channel]) / 2)) { - return XvBadAlloc; - } - } - else { - if (!xf86I2CWriteVec(&(pPort->I2CDev), - SAA7111SVideoChannelSelect[channel], - ENTRIES(SAA7111SVideoChannelSelect[channel]) / 2)) { - return XvBadAlloc; - } - } + int norm; + int input; + int channel; + norm = pPort->norm[value]; + input = pPort->input[value]; + channel = pPort->channel[value]; + + DEBUG((VERBLEV, "SetAttribute XV_ENCODING: %d. norm=%d input=%d channel=%d\n", + value, norm, input, channel)); + + /* set video norm */ + if (!xf86I2CWriteVec(&(pPort->I2CDev), SAA7111VideoStd[norm], + ENTRIES(SAA7111VideoStd[norm]) / 2)) { + return XvBadAlloc; + } + /* set video input format and channel */ + if (input == COMPOSITE) { + if (!xf86I2CWriteVec(&(pPort->I2CDev), + SAA7111CompositeChannelSelect[channel], + ENTRIES(SAA7111CompositeChannelSelect[channel]) / 2)) { + return XvBadAlloc; + } + } + else { + if (!xf86I2CWriteVec(&(pPort->I2CDev), + SAA7111SVideoChannelSelect[channel], + ENTRIES(SAA7111SVideoChannelSelect[channel]) / 2)) { + return XvBadAlloc; + } + } } else if (i >= XV_CAPTURE_BRIGHTNESS && i <= XV_HUE) { - int slave_adr = 0; + int slave_adr = 0; + + switch (i) { - switch (i) { + case XV_CAPTURE_BRIGHTNESS: + DEBUG((VERBLEV, "SetAttribute XV_BRIGHTNESS: %d\n", value)); + slave_adr = 0x0a; + break; + + case XV_CONTRAST: + DEBUG((VERBLEV, "SetAttribute XV_CONTRAST: %d\n", value)); + slave_adr = 0x0b; + break; - case XV_CAPTURE_BRIGHTNESS: - DEBUG((VERBLEV, "SetAttribute XV_BRIGHTNESS: %d\n", value)); - slave_adr = 0x0a; - break; - - case XV_CONTRAST: - DEBUG((VERBLEV, "SetAttribute XV_CONTRAST: %d\n", value)); - slave_adr = 0x0b; - break; - - case XV_SATURATION: - DEBUG((VERBLEV, "SetAttribute XV_SATURATION: %d\n", value)); - slave_adr = 0x0c; - break; - - case XV_HUE: - DEBUG((VERBLEV, "SetAttribute XV_HUE: %d\n", value)); - slave_adr = 0x0d; - break; - - default: - return XvBadAlloc; - } - if (!xf86I2CWriteByte(&(pPort->I2CDev), slave_adr, (value & 0xff))) - return XvBadAlloc; + case XV_SATURATION: + DEBUG((VERBLEV, "SetAttribute XV_SATURATION: %d\n", value)); + slave_adr = 0x0c; + break; + + case XV_HUE: + DEBUG((VERBLEV, "SetAttribute XV_HUE: %d\n", value)); + slave_adr = 0x0d; + break; + + default: + return XvBadAlloc; + } + if (!xf86I2CWriteByte(&(pPort->I2CDev), slave_adr, (value & 0xff))) + return XvBadAlloc; } else { - return BadMatch; + return BadMatch; } /* debug: show registers */ { - I2CByte i2c_bytes[32]; - int i; - xf86I2CReadBytes(&(pPort->I2CDev), 0, i2c_bytes, 32); - DEBUG((VERBLEV, "SAA7111 Registers\n")); - for (i=0; i<32; i++) { - DEBUG((VERBLEV, "%02X=%02X ", i, i2c_bytes[i])); - if ((i&7) == 7) DEBUG((VERBLEV, "\n")); - } + I2CByte i2c_bytes[32]; + int i; + xf86I2CReadBytes(&(pPort->I2CDev), 0, i2c_bytes, 32); + DEBUG((VERBLEV, "SAA7111 Registers\n")); + for (i=0; i<32; i++) { + DEBUG((VERBLEV, "%02X=%02X ", i, i2c_bytes[i])); + if ((i&7) == 7) DEBUG((VERBLEV, "\n")); + } } return Success; @@ -833,45 +830,45 @@ /******************************************************************************\ -** ** -** V I D E O M A N A G E M E N T ** -** ** +** ** +** V I D E O M A N A G E M E N T ** +** ** \******************************************************************************/ static XF86VideoAdaptorPtr SMI_SetupVideo( - ScreenPtr pScreen + ScreenPtr pScreen ) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - SMIPtr pSmi = SMIPTR(pScrn); - SMI_PortPtr smiPortPtr; - XF86VideoAdaptorPtr ptrAdaptor; + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + SMIPtr pSmi = SMIPTR(pScrn); + SMI_PortPtr smiPortPtr; + XF86VideoAdaptorPtr ptrAdaptor; - ENTER_PROC("SMI_SetupVideo"); + ENTER_PROC("SMI_SetupVideo"); - ptrAdaptor = xcalloc(1, sizeof(XF86VideoAdaptorRec) + - sizeof(DevUnion) + sizeof(SMI_PortRec)); - if (ptrAdaptor == NULL) - { - LEAVE_PROC("SMI_SetupVideo"); - return(NULL); - } + ptrAdaptor = xcalloc(1, sizeof(XF86VideoAdaptorRec) + + sizeof(DevUnion) + sizeof(SMI_PortRec)); + if (ptrAdaptor == NULL) + { + LEAVE_PROC("SMI_SetupVideo"); + return(NULL); + } - ptrAdaptor->type = XvInputMask + ptrAdaptor->type = XvInputMask #if SMI_USE_CAPTURE - | XvOutputMask - | XvVideoMask + | XvOutputMask + | XvVideoMask #endif - | XvImageMask - | XvWindowMask - ; - - ptrAdaptor->flags = VIDEO_OVERLAID_IMAGES - | VIDEO_CLIP_TO_VIEWPORT - ; + | XvImageMask + | XvWindowMask + ; + + ptrAdaptor->flags = VIDEO_OVERLAID_IMAGES + | VIDEO_CLIP_TO_VIEWPORT + ; - ptrAdaptor->name = "Silicon Motion Lynx Series Video Engine"; + ptrAdaptor->name = "Silicon Motion Lynx Series Video Engine"; ptrAdaptor->nPorts = 1; ptrAdaptor->pPortPrivates = (DevUnion*) &ptrAdaptor[1]; @@ -884,46 +881,54 @@ ptrAdaptor->pEncodings = smiPortPtr->enc; #if 0 /* aaa whats this? */ - for (i = 0; i < nElems(SMI_VideoEncodings); i++) - { - SMI_VideoEncodings[i].width = pSmi->lcdWidth; - SMI_VideoEncodings[i].height = pSmi->lcdHeight; - } + for (i = 0; i < nElems(SMI_VideoEncodings); i++) + { + SMI_VideoEncodings[i].width = pSmi->lcdWidth; + SMI_VideoEncodings[i].height = pSmi->lcdHeight; + } #endif - ptrAdaptor->nFormats = nElems(SMI_VideoFormats); - ptrAdaptor->pFormats = SMI_VideoFormats; + ptrAdaptor->nFormats = nElems(SMI_VideoFormats); + ptrAdaptor->pFormats = SMI_VideoFormats; - ptrAdaptor->nAttributes = nElems(SMI_VideoAttributes); - ptrAdaptor->pAttributes = SMI_VideoAttributes; + ptrAdaptor->nAttributes = nElems(SMI_VideoAttributes); + ptrAdaptor->pAttributes = SMI_VideoAttributes; - ptrAdaptor->nImages = nElems(SMI_VideoImages); - ptrAdaptor->pImages = SMI_VideoImages; + if (pSmi->Chipset != SMI_MSOC) + { + ptrAdaptor->nImages = nElems(SMI_VideoImages); + ptrAdaptor->pImages = SMI_VideoImages; + } + else + { + ptrAdaptor->nImages = nElems(SMI501_VideoImages); + ptrAdaptor->pImages = SMI501_VideoImages; + } #if SMI_USE_CAPTURE - if (pSmi->Chipset == SMI_COUGAR3DR) - ptrAdaptor->PutVideo = NULL; - else - ptrAdaptor->PutVideo = SMI_PutVideo; - ptrAdaptor->PutStill = NULL; + if ((pSmi->Chipset == SMI_COUGAR3DR) || (pSmi->Chipset == SMI_MSOC)) + ptrAdaptor->PutVideo = NULL; + else + ptrAdaptor->PutVideo = SMI_PutVideo; + ptrAdaptor->PutStill = NULL; ptrAdaptor->GetVideo = NULL; - ptrAdaptor->GetStill = NULL; + ptrAdaptor->GetStill = NULL; #else - ptrAdaptor->PutVideo = NULL; - ptrAdaptor->PutStill = NULL; - ptrAdaptor->GetVideo = NULL; - ptrAdaptor->GetStill = NULL; + ptrAdaptor->PutVideo = NULL; + ptrAdaptor->PutStill = NULL; + ptrAdaptor->GetVideo = NULL; + ptrAdaptor->GetStill = NULL; #endif - ptrAdaptor->StopVideo = SMI_StopVideo; - ptrAdaptor->SetPortAttribute = SMI_SetPortAttribute; - ptrAdaptor->GetPortAttribute = SMI_GetPortAttribute; - ptrAdaptor->QueryBestSize = SMI_QueryBestSize; - ptrAdaptor->PutImage = SMI_PutImage; - ptrAdaptor->QueryImageAttributes = SMI_QueryImageAttributes; + ptrAdaptor->StopVideo = SMI_StopVideo; + ptrAdaptor->SetPortAttribute = SMI_SetPortAttribute; + ptrAdaptor->GetPortAttribute = SMI_GetPortAttribute; + ptrAdaptor->QueryBestSize = SMI_QueryBestSize; + ptrAdaptor->PutImage = SMI_PutImage; + ptrAdaptor->QueryImageAttributes = SMI_QueryImageAttributes; smiPortPtr->Attribute[XV_COLORKEY] = pSmi->videoKey; smiPortPtr->Attribute[XV_INTERLACED] = pSmi->interlaced; - smiPortPtr->videoStatus = 0; + smiPortPtr->videoStatus = 0; #if 0 /* aaa does not work ? */ @@ -939,41 +944,40 @@ smiPortPtr->I2CDev.SlaveAddr = SAA7111; smiPortPtr->I2CDev.pI2CBus = pSmi->I2C; - - if (xf86I2CDevInit(&(smiPortPtr->I2CDev))) + if ((pSmi->Chipset != SMI_MSOC) && (xf86I2CDevInit(&(smiPortPtr->I2CDev)))) { - - if (xf86I2CWriteVec(&(smiPortPtr->I2CDev), SAA7111InitData, - ENTRIES(SAA7111InitData) / 2)) { - xvEncoding = MAKE_ATOM(XV_ENCODING_NAME); - xvHue = MAKE_ATOM(XV_HUE_NAME); - xvSaturation = MAKE_ATOM(XV_SATURATION_NAME); - xvContrast = MAKE_ATOM(XV_CONTRAST_NAME); - - xvInterlaced = MAKE_ATOM(XV_INTERLACED_NAME); - DEBUG((VERBLEV, "SAA7111 intialized\n")); - - } else { - xf86DestroyI2CDevRec(&(smiPortPtr->I2CDev),FALSE); - smiPortPtr->I2CDev.SlaveAddr = 0; - } + + if (xf86I2CWriteVec(&(smiPortPtr->I2CDev), SAA7111InitData, + ENTRIES(SAA7111InitData) / 2)) { + xvEncoding = MAKE_ATOM(XV_ENCODING_NAME); + xvHue = MAKE_ATOM(XV_HUE_NAME); + xvSaturation = MAKE_ATOM(XV_SATURATION_NAME); + xvContrast = MAKE_ATOM(XV_CONTRAST_NAME); + + xvInterlaced = MAKE_ATOM(XV_INTERLACED_NAME); + DEBUG((VERBLEV, "SAA7111 intialized\n")); + + } else { + xf86DestroyI2CDevRec(&(smiPortPtr->I2CDev),FALSE); + smiPortPtr->I2CDev.SlaveAddr = 0; + } } else - smiPortPtr->I2CDev.SlaveAddr = 0; - + smiPortPtr->I2CDev.SlaveAddr = 0; + #if defined(REGION_NULL) REGION_NULL(pScreen, &smiPortPtr->clip); #else REGION_INIT(pScreen, &smiPortPtr->clip, NullBox, 0); #endif - + pSmi->ptrAdaptor = ptrAdaptor; pSmi->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = SMI_BlockHandler; - + xvColorKey = MAKE_ATOM(XV_COLORKEY_NAME); xvBrightness = MAKE_ATOM(XV_BRIGHTNESS_NAME); xvCapBrightness = MAKE_ATOM(XV_CAPTURE_BRIGHTNESS_NAME); - + SMI_ResetVideo(pScrn); LEAVE_PROC("SMI_SetupVideo"); return(ptrAdaptor); @@ -982,14 +986,14 @@ static void SMI_ResetVideo( - ScrnInfoPtr pScrn + ScrnInfoPtr pScrn ) { - SMIPtr pSmi = SMIPTR(pScrn); + SMIPtr pSmi = SMIPTR(pScrn); SMI_PortPtr pPort = (SMI_PortPtr) pSmi->ptrAdaptor->pPortPrivates[0].ptr; - int r, g, b; + int r, g, b; - ENTER_PROC("SMI_ResetVideo"); + ENTER_PROC("SMI_ResetVideo"); SetAttr(pScrn, XV_ENCODING, 0); /* Encoding = pal-composite-0 */ SetAttr(pScrn, XV_BRIGHTNESS, 128); /* Brightness = 128 (CCIR level) */ @@ -998,68 +1002,68 @@ SetAttr(pScrn, XV_SATURATION, 64); /* Color saturation = 64 (CCIR level) */ SetAttr(pScrn, XV_HUE, 0); /* Hue = 0 */ - switch (pScrn->depth) - { - case 8: + switch (pScrn->depth) + { + case 8: SetKeyReg(pSmi, FPR04, pPort->Attribute[XV_COLORKEY] & 0x00FF); - SetKeyReg(pSmi, FPR08, 0); - break; + SetKeyReg(pSmi, FPR08, 0); + break; - case 15: - case 16: - SetKeyReg(pSmi, FPR04, pPort->Attribute[XV_COLORKEY] & 0xFFFF); - SetKeyReg(pSmi, FPR08, 0); - break; + case 15: + case 16: + SetKeyReg(pSmi, FPR04, pPort->Attribute[XV_COLORKEY] & 0xFFFF); + SetKeyReg(pSmi, FPR08, 0); + break; - default: + default: r = (pPort->Attribute[XV_COLORKEY] & pScrn->mask.red) >> pScrn->offset.red; g = (pPort->Attribute[XV_COLORKEY] & pScrn->mask.green) >> pScrn->offset.green; b = (pPort->Attribute[XV_COLORKEY] & pScrn->mask.blue) >> pScrn->offset.blue; - SetKeyReg(pSmi, FPR04, ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3)); - SetKeyReg(pSmi, FPR08, 0); - break; - } + SetKeyReg(pSmi, FPR04, ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3)); + SetKeyReg(pSmi, FPR08, 0); + break; + } - SetKeyReg(pSmi, FPR5C, 0xEDEDED | (pPort->Attribute[XV_BRIGHTNESS] << 24)); + SetKeyReg(pSmi, FPR5C, 0xEDEDED | (pPort->Attribute[XV_BRIGHTNESS] << 24)); - LEAVE_PROC("SMI_ResetVideo"); + LEAVE_PROC("SMI_ResetVideo"); } #if SMI_USE_CAPTURE static int SMI_PutVideo( - ScrnInfoPtr pScrn, - short vid_x, - short vid_y, - short drw_x, - short drw_y, - short vid_w, - short vid_h, - short drw_w, - short drw_h, - RegionPtr clipBoxes, - pointer data + ScrnInfoPtr pScrn, + short vid_x, + short vid_y, + short drw_x, + short drw_y, + short vid_w, + short vid_h, + short drw_w, + short drw_h, + RegionPtr clipBoxes, + pointer data ) { SMI_PortPtr pPort = (SMI_PortPtr) data; - SMIPtr pSmi = SMIPTR(pScrn); - CARD32 vid_pitch, vid_address; - CARD32 vpr00, cpr00; - int xscale, yscale; - BoxRec dstBox; - INT32 x1, y1, x2, y2; + SMIPtr pSmi = SMIPTR(pScrn); + CARD32 vid_pitch, vid_address; + CARD32 vpr00, cpr00; + int xscale, yscale; + BoxRec dstBox; + INT32 x1, y1, x2, y2; int norm; - int areaHeight, width, height, fbPitch; - int top, left; + int areaHeight, width, height, fbPitch; + int top, left; ENTER_PROC("SMI_PutVideo"); DEBUG((VERBLEV, "Interlaced Video %d\n", pPort->Attribute[XV_INTERLACED])); if (!pPort->Attribute[XV_INTERLACED]) { - /* no interlace: lines will be doubled */ - vid_h /= 2; + /* no interlace: lines will be doubled */ + vid_h /= 2; } /* field start aaa*/ @@ -1070,45 +1074,45 @@ vid_x &= ~1; DEBUG((VERBLEV, "vid_x=%d vid_y=%d drw_x=%d drw_y=%d " - "vid_w=%d vid_h=%d drw_w=%d drw_h=%d\n", - vid_x, vid_y, drw_x, drw_y, vid_w, vid_h, drw_w, drw_h)); + "vid_w=%d vid_h=%d drw_w=%d drw_h=%d\n", + vid_x, vid_y, drw_x, drw_y, vid_w, vid_h, drw_w, drw_h)); - x1 = vid_x; - y1 = vid_y; - x2 = vid_x + vid_w; - y2 = vid_y + vid_h; - - width = vid_w; - height = vid_h; - - dstBox.x1 = drw_x; - dstBox.y1 = drw_y; - dstBox.x2 = drw_x + drw_w; - dstBox.y2 = drw_y + drw_h; + x1 = vid_x; + y1 = vid_y; + x2 = vid_x + vid_w; + y2 = vid_y + vid_h; + + width = vid_w; + height = vid_h; + + dstBox.x1 = drw_x; + dstBox.y1 = drw_y; + dstBox.x2 = drw_x + drw_w; + dstBox.y2 = drw_y + drw_h; #if 1 - if (!SMI_ClipVideo(pScrn, &dstBox, &x1, &y1, &x2, &y2, clipBoxes, width, - height)) + if (!SMI_ClipVideo(pScrn, &dstBox, &x1, &y1, &x2, &y2, clipBoxes, width, + height)) #else if (!xf86XVClipVideoHelper(&dstBox, &x1, &y1, &x2, &y2, clipBoxes, width, height)) #endif - { + { LEAVE_PROC("SMI_PutVideo"); - return(Success); - } + return(Success); + } DEBUG((VERBLEV, "Clip: x1=%d y1=%d x2=%d y2=%d\n", x1 >> 16, y1 >> 16, x2 >> 16, y2 >> 16)); - dstBox.x1 -= pScrn->frameX0; - dstBox.y1 -= pScrn->frameY0; - dstBox.x2 -= pScrn->frameX0; - dstBox.y2 -= pScrn->frameY0; + dstBox.x1 -= pScrn->frameX0; + dstBox.y1 -= pScrn->frameY0; + dstBox.x2 -= pScrn->frameX0; + dstBox.y2 -= pScrn->frameY0; - vid_pitch = (vid_w * 2 + 7) & ~7; + vid_pitch = (vid_w * 2 + 7) & ~7; - vpr00 = READ_VPR(pSmi, 0x00) & ~0x0FF000FF; - cpr00 = READ_CPR(pSmi, 0x00) & ~0x000FFF00; + vpr00 = READ_VPR(pSmi, 0x00) & ~0x0FF000FF; + cpr00 = READ_CPR(pSmi, 0x00) & ~0x000FFF00; /* vpr00: Bit 2..0 = 6: Video Window I Format = YUV4:2:2 @@ -1123,26 +1127,26 @@ Bit 21 = 0: Vertical Interpolation = s. below Bit 22 = 0: Flicker Reduction for TV Modes = disabled Bit 23 = 0: Fixed Vertical Interpolation = disabled - Bit 24 = 1: Select Video Window I Source Addr = + Bit 24 = 1: Select Video Window I Source Addr = Bit 25 = 0: Enable V0FIFO to fetch 8-Bit color data = disabled Bit 26 = 0: Bit 27 = 1: Color Key for Window II = disabled Bit 31..28 = reserved */ if (pPort->Attribute[XV_INTERLACED]) { - /* - Bit 21 = 0: Vertical Interpolation = disabled - Bit 24 = 0: Select Video Window I Source Addr = 0 - */ - vpr00 |= 0x0010000E; + /* + Bit 21 = 0: Vertical Interpolation = disabled + Bit 24 = 0: Select Video Window I Source Addr = 0 + */ + vpr00 |= 0x0010000E; } else { - /* - Bit 21 = 10: Vertical Interpolation = enabled - Bit 24 = 1: Select Video Window I Source Addr = 1 - 1= Video window I source addr = capture port buffer ? - */ - vpr00 |= 0x0130000E; + /* + Bit 21 = 10: Vertical Interpolation = enabled + Bit 24 = 1: Select Video Window I Source Addr = 1 + 1= Video window I source addr = capture port buffer ? + */ + vpr00 |= 0x0130000E; } /* cpr00: @@ -1160,327 +1164,327 @@ Bit 24 = 1: Field Detection Method VSYNC edge = rising */ if (pPort->Attribute[XV_INTERLACED]) { - /* - Bit 9 = 1: Double Buffer Enable = enabled - Bit 10 = 1: Interlace Data Capture = enabled - Bit 13..11 = 0: Frame Skip Enable = no skip - */ - cpr00 |= 0x01000601; + /* + Bit 9 = 1: Double Buffer Enable = enabled + Bit 10 = 1: Interlace Data Capture = enabled + Bit 13..11 = 0: Frame Skip Enable = no skip + */ + cpr00 |= 0x01000601; } else { - /* - Bit 9 = 0: Double Buffer Enable = disabled - Bit 10 = 0: Interlace Data Capture = disabled - Bit 13..11 = 010: Frame Skip Enable = skip every other frame - */ - cpr00 |= 0x01000801; - } - - if (pSmi->ByteSwap) - cpr00 |= 0x00004000; - - fbPitch = pSmi->Stride; - if (pSmi->Bpp != 3) - { - fbPitch *= pSmi->Bpp; - } - - if (vid_w <= drw_w) - { - xscale = (256 * vid_w / drw_w) & 0xFF; - } - else if (vid_w / 2 <= drw_w) - { - xscale = (128 * vid_w / drw_w) & 0xFF; - width /= 2; - vid_pitch /= 2; - cpr00 |= 0x00010000; - } - else if (vid_w / 4 <= drw_w) - { - xscale = (64 * vid_w / drw_w) & 0xFF; - width /= 4; - vid_pitch /= 4; - cpr00 |= 0x00020000; - } - else - { - xscale = 0; - width /= 4; - vid_pitch /= 4; - cpr00 |= 0x00020000; - } - - if (vid_h <= drw_h) - { - yscale = (256 * vid_h / drw_h) & 0xFF; - } - else if (vid_h / 2 <= drw_h) - { - yscale = (128 * vid_h / drw_h) & 0xFF; - height /= 2; - cpr00 |= 0x00040000; - } - else if (vid_h / 4 <= drw_h) - { - yscale = (64 * vid_h / drw_h) & 0xFF; - height /= 4; - cpr00 |= 0x00080000; - } - else - { - yscale = 0; - height /= 4; - cpr00 |= 0x00080000; - } - - do - { - areaHeight = (vid_pitch * height + fbPitch - 1) / fbPitch; - DEBUG((VERBLEV, "SMI_AllocateMemory: vid_pitch=%d height=%d fbPitch=%d areaHeight=%d\n", - vid_pitch, height, fbPitch, areaHeight)); + /* + Bit 9 = 0: Double Buffer Enable = disabled + Bit 10 = 0: Interlace Data Capture = disabled + Bit 13..11 = 010: Frame Skip Enable = skip every other frame + */ + cpr00 |= 0x01000801; + } + + if (pSmi->ByteSwap) + cpr00 |= 0x00004000; + + fbPitch = pSmi->Stride; + if (pSmi->Bpp != 3) + { + fbPitch *= pSmi->Bpp; + } + + if (vid_w <= drw_w) + { + xscale = (256 * vid_w / drw_w) & 0xFF; + } + else if (vid_w / 2 <= drw_w) + { + xscale = (128 * vid_w / drw_w) & 0xFF; + width /= 2; + vid_pitch /= 2; + cpr00 |= 0x00010000; + } + else if (vid_w / 4 <= drw_w) + { + xscale = (64 * vid_w / drw_w) & 0xFF; + width /= 4; + vid_pitch /= 4; + cpr00 |= 0x00020000; + } + else + { + xscale = 0; + width /= 4; + vid_pitch /= 4; + cpr00 |= 0x00020000; + } + + if (vid_h <= drw_h) + { + yscale = (256 * vid_h / drw_h) & 0xFF; + } + else if (vid_h / 2 <= drw_h) + { + yscale = (128 * vid_h / drw_h) & 0xFF; + height /= 2; + cpr00 |= 0x00040000; + } + else if (vid_h / 4 <= drw_h) + { + yscale = (64 * vid_h / drw_h) & 0xFF; + height /= 4; + cpr00 |= 0x00080000; + } + else + { + yscale = 0; + height /= 4; + cpr00 |= 0x00080000; + } + + do + { + areaHeight = (vid_pitch * height + fbPitch - 1) / fbPitch; + DEBUG((VERBLEV, "SMI_AllocateMemory: vid_pitch=%d height=%d fbPitch=%d areaHeight=%d\n", + vid_pitch, height, fbPitch, areaHeight)); pPort->area = SMI_AllocateMemory(pScrn, pPort->area, areaHeight); if (pPort->area == NULL) - { - if ((cpr00 & 0x000C0000) == 0) - { - /* height -> 1/2 height */ - yscale = (128 * vid_h / drw_h) & 0xFF; - height = vid_h / 2; - cpr00 |= 0x00040000; - } - else if (cpr00 & 0x00040000) - { - /* 1/2 height -> 1/4 height */ - yscale = (64 * vid_h / drw_h) & 0xFF; - height = vid_h / 4; - cpr00 ^= 0x000C0000; - } - else - { - /* 1/4 height */ - if ((cpr00 & 0x00030000) == 0) - { - /* width -> 1/2 width */ - xscale = (128 * vid_w / drw_w) & 0xFF; - width = vid_w / 2; - cpr00 |= 0x00010000; - } - else if (cpr00 & 0x00010000) - { - /* 1/2 width -> 1/4 width */ - xscale = (64 * vid_w / drw_w) & 0xFF; - width = vid_w / 4; - cpr00 ^= 0x00030000; - } - else - { - DEBUG((VERBLEV, "allocate error\n")); + { + if ((cpr00 & 0x000C0000) == 0) + { + /* height -> 1/2 height */ + yscale = (128 * vid_h / drw_h) & 0xFF; + height = vid_h / 2; + cpr00 |= 0x00040000; + } + else if (cpr00 & 0x00040000) + { + /* 1/2 height -> 1/4 height */ + yscale = (64 * vid_h / drw_h) & 0xFF; + height = vid_h / 4; + cpr00 ^= 0x000C0000; + } + else + { + /* 1/4 height */ + if ((cpr00 & 0x00030000) == 0) + { + /* width -> 1/2 width */ + xscale = (128 * vid_w / drw_w) & 0xFF; + width = vid_w / 2; + cpr00 |= 0x00010000; + } + else if (cpr00 & 0x00010000) + { + /* 1/2 width -> 1/4 width */ + xscale = (64 * vid_w / drw_w) & 0xFF; + width = vid_w / 4; + cpr00 ^= 0x00030000; + } + else + { + DEBUG((VERBLEV, "allocate error\n")); LEAVE_PROC("SMI_PutVideo"); - return(BadAlloc); - } - } - } - } + return(BadAlloc); + } + } + } + } while (pPort->area == NULL); DEBUG((VERBLEV, "xscale==%d yscale=%d width=%d height=%d\n", - xscale, yscale, width, height)); + xscale, yscale, width, height)); /* aaa whats this ----------------------v ? vid_address = (pPort->area->box.y1 * fbPitch) + ((y1 >> 16) * vid_pitch);*/ vid_address = (pPort->area->box.y1 * fbPitch); DEBUG((VERBLEV, "test RegionsEqual\n")); -#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,0,0) - if (!RegionsEqual(&pPort->clip, clipBoxes)) -#else if (!REGION_EQUAL(pScrn->pScreen, &pPort->clip, clipBoxes)) -#endif { - DEBUG((VERBLEV, "RegionCopy\n")); + DEBUG((VERBLEV, "RegionCopy\n")); REGION_COPY(pScrn->pScreen, &pPort->clip, clipBoxes); - DEBUG((VERBLEV, "FillKey\n")); - xf86XVFillKeyHelper(pScrn->pScreen, pPort->Attribute[XV_COLORKEY], clipBoxes); + DEBUG((VERBLEV, "FillKey\n")); + xf86XVFillKeyHelper(pScrn->pScreen, pPort->Attribute[XV_COLORKEY], clipBoxes); - } + } - left = x1 >> 16; - top = y1 >> 16; - width = (x2 - x1) >> 16; - height = (y2 - y1) >> 16; + left = x1 >> 16; + top = y1 >> 16; + width = (x2 - x1) >> 16; + height = (y2 - y1) >> 16; - OUT_SEQ(pSmi, 0x21, IN_SEQ(pSmi, 0x21) & ~0x04); - WRITE_VPR(pSmi, 0x54, READ_VPR(pSmi, 0x54) | 0x00200000); + OUT_SEQ(pSmi, 0x21, IN_SEQ(pSmi, 0x21) & ~0x04); + WRITE_VPR(pSmi, 0x54, READ_VPR(pSmi, 0x54) | 0x00200000); #if 0 - SMI_WaitForSync(pScrn); + SMI_WaitForSync(pScrn); #endif /* Video Window I Left and Top Boundaries */ - WRITE_VPR(pSmi, 0x14, dstBox.x1 + (dstBox.y1 << 16)); + WRITE_VPR(pSmi, 0x14, dstBox.x1 + (dstBox.y1 << 16)); /* Video Window I Right and Bottom Boundaries */ - WRITE_VPR(pSmi, 0x18, dstBox.x2 + (dstBox.y2 << 16)); + WRITE_VPR(pSmi, 0x18, dstBox.x2 + (dstBox.y2 << 16)); /* Video Window I Source Width and Offset */ - WRITE_VPR(pSmi, 0x20, (vid_pitch / 8) + ((vid_pitch / 8) << 16)); + WRITE_VPR(pSmi, 0x20, (vid_pitch / 8) + ((vid_pitch / 8) << 16)); /* Video Window I Stretch Factor */ - WRITE_VPR(pSmi, 0x24, (xscale << 8) + yscale); + WRITE_VPR(pSmi, 0x24, (xscale << 8) + yscale); if (pPort->Attribute[XV_INTERLACED]) { - /* Video Window II Left and Top Boundaries */ - WRITE_VPR(pSmi, 0x28, dstBox.x1 + (dstBox.y1 << 16)); - /* Video Window II Right and Bottom Boundaries */ - WRITE_VPR(pSmi, 0x2C, dstBox.x2 + (dstBox.y2 << 16)); - /* Video Window II Source Width and Offset */ - WRITE_VPR(pSmi, 0x34, (vid_pitch / 8) + ((vid_pitch / 8) << 16)); - /* Video Window II Stretch Factor */ - WRITE_VPR(pSmi, 0x38, (xscale << 8) + yscale); - - /* Video Window I Source Start Address */ - WRITE_VPR(pSmi, 0x1C, vid_address / 8); - /* Video Window II Source Start Address */ - WRITE_VPR(pSmi, 0x30, vid_address / 8); - - /* Video Window I Source Start Address */ - WRITE_VPR(pSmi, 0x48, vid_address / 8); - /* Video Window II Source Start Address */ - WRITE_VPR(pSmi, 0x4C, vid_address / 8 + vid_pitch / 8); - - /* Video Source Clipping Control */ - WRITE_CPR(pSmi, 0x04, left + ((top/2) << 16)); - /* Video Source Capture Size Control */ - WRITE_CPR(pSmi, 0x08, width + ((height/2) << 16)); - /* Capture Port Buffer I Source Start Address */ - WRITE_CPR(pSmi, 0x0C, vid_address / 8); - /* Capture Port Buffer II Source Start Address */ - WRITE_CPR(pSmi, 0x10, vid_address / 8 + vid_pitch / 8); - /* Capture Port Source Offset Address */ - WRITE_CPR(pSmi, 0x14, 2*(vid_pitch / 8) + ((2*(vid_pitch / 8)) << 16)); + /* Video Window II Left and Top Boundaries */ + WRITE_VPR(pSmi, 0x28, dstBox.x1 + (dstBox.y1 << 16)); + /* Video Window II Right and Bottom Boundaries */ + WRITE_VPR(pSmi, 0x2C, dstBox.x2 + (dstBox.y2 << 16)); + /* Video Window II Source Width and Offset */ + WRITE_VPR(pSmi, 0x34, (vid_pitch / 8) + ((vid_pitch / 8) << 16)); + /* Video Window II Stretch Factor */ + WRITE_VPR(pSmi, 0x38, (xscale << 8) + yscale); + + /* Video Window I Source Start Address */ + WRITE_VPR(pSmi, 0x1C, vid_address / 8); + /* Video Window II Source Start Address */ + WRITE_VPR(pSmi, 0x30, vid_address / 8); + + /* Video Window I Source Start Address */ + WRITE_VPR(pSmi, 0x48, vid_address / 8); + /* Video Window II Source Start Address */ + WRITE_VPR(pSmi, 0x4C, vid_address / 8 + vid_pitch / 8); + + /* Video Source Clipping Control */ + WRITE_CPR(pSmi, 0x04, left + ((top/2) << 16)); + /* Video Source Capture Size Control */ + WRITE_CPR(pSmi, 0x08, width + ((height/2) << 16)); + /* Capture Port Buffer I Source Start Address */ + WRITE_CPR(pSmi, 0x0C, vid_address / 8); + /* Capture Port Buffer II Source Start Address */ + WRITE_CPR(pSmi, 0x10, vid_address / 8 + vid_pitch / 8); + /* Capture Port Source Offset Address */ + WRITE_CPR(pSmi, 0x14, 2*(vid_pitch / 8) + ((2*(vid_pitch / 8)) << 16)); } else { - /* Video Source Clipping Control */ - WRITE_CPR(pSmi, 0x04, left + (top << 16)); - /* Video Source Capture Size Control */ - WRITE_CPR(pSmi, 0x08, width + (height << 16)); - /* Capture Port Buffer I Source Start Address */ - WRITE_CPR(pSmi, 0x0C, vid_address / 8); - /* Capture Port Buffer II Source Start Address */ - WRITE_CPR(pSmi, 0x10, vid_address / 8); - /* Capture Port Source Offset Address */ - WRITE_CPR(pSmi, 0x14, (vid_pitch / 8) + ((vid_pitch / 8) << 16)); + /* Video Source Clipping Control */ + WRITE_CPR(pSmi, 0x04, left + (top << 16)); + /* Video Source Capture Size Control */ + WRITE_CPR(pSmi, 0x08, width + (height << 16)); + /* Capture Port Buffer I Source Start Address */ + WRITE_CPR(pSmi, 0x0C, vid_address / 8); + /* Capture Port Buffer II Source Start Address */ + WRITE_CPR(pSmi, 0x10, vid_address / 8); + /* Capture Port Source Offset Address */ + WRITE_CPR(pSmi, 0x14, (vid_pitch / 8) + ((vid_pitch / 8) << 16)); } - WRITE_CPR(pSmi, 0x00, cpr00); - WRITE_VPR(pSmi, 0x00, vpr00); + WRITE_CPR(pSmi, 0x00, cpr00); + WRITE_VPR(pSmi, 0x00, vpr00); pPort->videoStatus = CLIENT_VIDEO_ON; DEBUG((VERBLEV, "SMI_PutVideo success\n")); LEAVE_PROC("SMI_PutVideo"); - return(Success); + return(Success); } #endif static void SMI_StopVideo( - ScrnInfoPtr pScrn, - pointer data, - Bool shutdown -) -{ - SMI_PortPtr pPort = (SMI_PortPtr) data; - SMIPtr pSmi = SMIPTR(pScrn); - - ENTER_PROC("SMI_StopVideo"); - - REGION_EMPTY(pScrn->pScreen, &pPort->clip); - - if (shutdown) - { - if (pPort->videoStatus & CLIENT_VIDEO_ON) - { - if (pSmi->Chipset == SMI_COUGAR3DR) - { - WRITE_FPR(pSmi, FPR00, READ_FPR(pSmi, 0x00) & ~(FPR00_VWIENABLE)); - } - else - { - WRITE_VPR(pSmi, 0x00, READ_VPR(pSmi, 0x00) & ~0x01000008); - } + ScrnInfoPtr pScrn, + pointer data, + Bool shutdown +) +{ + SMI_PortPtr pPort = (SMI_PortPtr) data; + SMIPtr pSmi = SMIPTR(pScrn); + + ENTER_PROC("SMI_StopVideo"); + + REGION_EMPTY(pScrn->pScreen, &pPort->clip); + + if (shutdown) + { + if (pPort->videoStatus & CLIENT_VIDEO_ON) + { + if (pSmi->Chipset == SMI_COUGAR3DR) + { + WRITE_FPR(pSmi, FPR00, READ_FPR(pSmi, 0x00) & ~(FPR00_VWIENABLE)); + } + else if (pSmi->Chipset == SMI_MSOC) + { + WRITE_DCR(pSmi, DCR40, READ_DCR(pSmi, DCR40) & ~0x00000004); + } + else + { + WRITE_VPR(pSmi, 0x00, READ_VPR(pSmi, 0x00) & ~0x01000008); + } #if SMI_USE_CAPTURE - if (pSmi->Chipset != SMI_COUGAR3DR) - { - WRITE_CPR(pSmi, 0x00, READ_CPR(pSmi, 0x00) & ~0x00000001); - WRITE_VPR(pSmi, 0x54, READ_VPR(pSmi, 0x54) & ~0x00F00000); - } - /* #864 OUT_SEQ(pSmi, 0x21, IN_SEQ(pSmi, 0x21) | 0x04); */ + if ((pSmi->Chipset != SMI_COUGAR3DR) && (pSmi->Chipset != SMI_MSOC)) + { + WRITE_CPR(pSmi, 0x00, READ_CPR(pSmi, 0x00) & ~0x00000001); + WRITE_VPR(pSmi, 0x54, READ_VPR(pSmi, 0x54) & ~0x00F00000); + } + /* #864 OUT_SEQ(pSmi, 0x21, IN_SEQ(pSmi, 0x21) | 0x04); */ #endif - } + } if (pPort->area != NULL) - { + { xf86FreeOffscreenArea(pPort->area); pPort->area = NULL; - } + } pPort->videoStatus = 0; /* pPort->i2cDevice = 0;aaa*/ - } - else - { + } + else + { if (pPort->videoStatus & CLIENT_VIDEO_ON) - { + { pPort->videoStatus |= OFF_TIMER; pPort->offTime = currentTime.milliseconds + OFF_DELAY; - } - } + } + } - LEAVE_PROC("SMI_StopVideo"); + LEAVE_PROC("SMI_StopVideo"); } static int SMI_SetPortAttribute( - ScrnInfoPtr pScrn, - Atom attribute, - INT32 value, - pointer data + ScrnInfoPtr pScrn, + Atom attribute, + INT32 value, + pointer data ) { int res; SMI_PortPtr pPort = (SMI_PortPtr) data; - SMIPtr pSmi = SMIPTR(pScrn); + SMIPtr pSmi = SMIPTR(pScrn); - ENTER_PROC("SMI_SetPortAttribute"); + ENTER_PROC("SMI_SetPortAttribute"); if (attribute == xvColorKey) { - int r, g, b; + int r, g, b; pPort->Attribute[XV_COLORKEY] = value; - switch (pScrn->depth) - { - case 8: - SetKeyReg(pSmi, FPR04, value & 0x00FF); - break; - - case 15: - case 16: - SetKeyReg(pSmi, FPR04, value & 0xFFFF); - break; - - default: - r = (value & pScrn->mask.red) >> pScrn->offset.red; - g = (value & pScrn->mask.green) >> pScrn->offset.green; - b = (value & pScrn->mask.blue) >> pScrn->offset.blue; - SetKeyReg(pSmi, FPR04, - ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3)); - break; - } - res = Success; - } + switch (pScrn->depth) + { + case 8: + SetKeyReg(pSmi, FPR04, value & 0x00FF); + break; + + case 15: + case 16: + SetKeyReg(pSmi, FPR04, value & 0xFFFF); + break; + + default: + r = (value & pScrn->mask.red) >> pScrn->offset.red; + g = (value & pScrn->mask.green) >> pScrn->offset.green; + b = (value & pScrn->mask.blue) >> pScrn->offset.blue; + SetKeyReg(pSmi, FPR04, + ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3)); + break; + } + res = Success; + } else if (attribute == xvInterlaced) { pPort->Attribute[XV_INTERLACED] = (value != 0); - res = Success; - } + res = Success; + } else if (attribute == xvEncoding) { res = SetAttr(pScrn, XV_ENCODING, value); - } + } else if (attribute == xvBrightness) { res = SetAttr(pScrn, XV_BRIGHTNESS, value); } @@ -1498,24 +1502,24 @@ } else { res = BadMatch; - } + } - LEAVE_PROC("SMI_SetPortAttribute"); + LEAVE_PROC("SMI_SetPortAttribute"); return(res); } static int SMI_GetPortAttribute( - ScrnInfoPtr pScrn, - Atom attribute, - INT32 *value, - pointer data + ScrnInfoPtr pScrn, + Atom attribute, + INT32 *value, + pointer data ) { SMI_PortPtr pPort = (SMI_PortPtr) data; - ENTER_PROC("SMI_GetPortAttribute"); + ENTER_PROC("SMI_GetPortAttribute"); if (attribute == xvEncoding) *value = pPort->Attribute[XV_ENCODING]; else if (attribute == xvBrightness) @@ -1531,1092 +1535,1218 @@ else if (attribute == xvColorKey) *value = pPort->Attribute[XV_COLORKEY]; - else - { - LEAVE_PROC("SMI_GetPortAttribute"); - return(BadMatch); - } + else + { + LEAVE_PROC("SMI_GetPortAttribute"); + return(BadMatch); + } - LEAVE_PROC("SMI_GetPortAttribute"); - return(Success); + LEAVE_PROC("SMI_GetPortAttribute"); + return(Success); } static void SMI_QueryBestSize( - ScrnInfoPtr pScrn, - Bool motion, - short vid_w, - short vid_h, - short drw_w, - short drw_h, - unsigned int *p_w, - unsigned int *p_h, - pointer data + ScrnInfoPtr pScrn, + Bool motion, + short vid_w, + short vid_h, + short drw_w, + short drw_h, + unsigned int *p_w, + unsigned int *p_h, + pointer data ) { - SMIPtr pSmi = SMIPTR(pScrn); + SMIPtr pSmi = SMIPTR(pScrn); - ENTER_PROC("SMI_QueryBestSize"); + ENTER_PROC("SMI_QueryBestSize"); - *p_w = min(drw_w, pSmi->lcdWidth); - *p_h = min(drw_h, pSmi->lcdHeight); + *p_w = min(drw_w, pSmi->lcdWidth); + *p_h = min(drw_h, pSmi->lcdHeight); - LEAVE_PROC("SMI_QueryBestSize"); + LEAVE_PROC("SMI_QueryBestSize"); } static int SMI_PutImage( - ScrnInfoPtr pScrn, - short src_x, - short src_y, - short drw_x, - short drw_y, - short src_w, - short src_h, - short drw_w, - short drw_h, - int id, - unsigned char *buf, - short width, - short height, - Bool sync, - RegionPtr clipBoxes, - pointer data + ScrnInfoPtr pScrn, + short src_x, + short src_y, + short drw_x, + short drw_y, + short src_w, + short src_h, + short drw_w, + short drw_h, + int id, + unsigned char *buf, + short width, + short height, + Bool sync, + RegionPtr clipBoxes, + pointer data ) { - SMIPtr pSmi = SMIPTR(pScrn); + SMIPtr pSmi = SMIPTR(pScrn); SMI_PortPtr pPort = (SMI_PortPtr) pSmi->ptrAdaptor->pPortPrivates[0].ptr; - INT32 x1, y1, x2, y2; - int bpp = 0; - int fbPitch, srcPitch, srcPitch2 = 0, dstPitch, areaHeight; - BoxRec dstBox; - CARD32 offset, offset2 = 0, offset3 = 0, tmp; - int left, top, nPixels, nLines; - unsigned char *dstStart; - - ENTER_PROC("SMI_PutImage"); - - x1 = src_x; - y1 = src_y; - x2 = src_x + src_w; - y2 = src_y + src_h; - - dstBox.x1 = drw_x; - dstBox.y1 = drw_y; - dstBox.x2 = drw_x + drw_w; - dstBox.y2 = drw_y + drw_h; - - if (!SMI_ClipVideo(pScrn, &dstBox, &x1, &y1, &x2, &y2, clipBoxes, width, - height)) - { - LEAVE_PROC("SMI_PutImage"); - return(Success); - } - - dstBox.x1 -= pScrn->frameX0; - dstBox.y1 -= pScrn->frameY0; - dstBox.x2 -= pScrn->frameX0; - dstBox.y2 -= pScrn->frameY0; - - if (pSmi->Bpp == 3) - { - fbPitch = pSmi->Stride; - } - else - { - fbPitch = pSmi->Stride * pSmi->Bpp; - } - - switch (id) - { - case FOURCC_YV12: - srcPitch = (width + 3) & ~3; - offset2 = srcPitch * height; - srcPitch2 = ((width >> 1) + 3) & ~3; - offset3 = offset2 + (srcPitch2 * (height >> 1)); - dstPitch = ((width << 1) + 15) & ~15; - break; - - case FOURCC_I420: - srcPitch = (width + 3) & ~3; - offset3 = srcPitch * height; - srcPitch2 = ((width >> 1) + 3) & ~3; - offset2 = offset3 + (srcPitch2 * (height >> 1)); - dstPitch = ((width << 1) + 15) & ~15; - break; - - case FOURCC_RV24: - bpp = 3; - srcPitch = width * bpp; - dstPitch = (srcPitch + 15) & ~15; - break; - - case FOURCC_RV32: - bpp = 4; - srcPitch = width * bpp; - dstPitch = (srcPitch + 15) & ~15; - break; - - case FOURCC_YUY2: - case FOURCC_RV15: - case FOURCC_RV16: - default: - bpp = 2; - srcPitch = width * bpp; - dstPitch = (srcPitch + 15) & ~15; - break; - } + INT32 x1, y1, x2, y2; + int bpp = 0; + int fbPitch, srcPitch, srcPitch2 = 0, dstPitch, areaHeight; + BoxRec dstBox; + CARD32 offset, offset2 = 0, offset3 = 0, tmp; + int left, top, nPixels, nLines; + unsigned char *dstStart; + + ENTER_PROC("SMI_PutImage"); + + x1 = src_x; + y1 = src_y; + x2 = src_x + src_w; + y2 = src_y + src_h; + + dstBox.x1 = drw_x; + dstBox.y1 = drw_y; + dstBox.x2 = drw_x + drw_w; + dstBox.y2 = drw_y + drw_h; - areaHeight = ((dstPitch * height) + fbPitch - 1) / fbPitch; + if (!SMI_ClipVideo(pScrn, &dstBox, &x1, &y1, &x2, &y2, clipBoxes, width, + height)) + { + LEAVE_PROC("SMI_PutImage"); + return(Success); + } + + dstBox.x1 -= pScrn->frameX0; + dstBox.y1 -= pScrn->frameY0; + dstBox.x2 -= pScrn->frameX0; + dstBox.y2 -= pScrn->frameY0; + + if (pSmi->Bpp == 3) + { + fbPitch = pSmi->Stride; + } + else + { + fbPitch = pSmi->Stride * pSmi->Bpp; + } + + switch (id) + { + case FOURCC_YV12: + srcPitch = (width + 3) & ~3; + offset2 = srcPitch * height; + srcPitch2 = ((width >> 1) + 3) & ~3; + offset3 = offset2 + (srcPitch2 * (height >> 1)); + dstPitch = ((width << 1) + 15) & ~15; + break; + + case FOURCC_I420: + srcPitch = (width + 3) & ~3; + offset3 = srcPitch * height; + srcPitch2 = ((width >> 1) + 3) & ~3; + offset2 = offset3 + (srcPitch2 * (height >> 1)); + dstPitch = ((width << 1) + 15) & ~15; + break; + + case FOURCC_RV24: + bpp = 3; + srcPitch = width * bpp; + dstPitch = (srcPitch + 15) & ~15; + break; + + case FOURCC_RV32: + bpp = 4; + srcPitch = width * bpp; + dstPitch = (srcPitch + 15) & ~15; + break; + + case FOURCC_YUY2: + case FOURCC_RV15: + case FOURCC_RV16: + default: + bpp = 2; + srcPitch = width * bpp; + dstPitch = (srcPitch + 15) & ~15; + break; + } + + areaHeight = ((dstPitch * height) + fbPitch - 1) / fbPitch; pPort->area = SMI_AllocateMemory(pScrn, pPort->area, areaHeight); if (pPort->area == NULL) - { - LEAVE_PROC("SMI_PutImage"); - return(BadAlloc); - } - - top = y1 >> 16; - left = (x1 >> 16) & ~1; - nPixels = ((((x2 + 0xFFFF) >> 16) + 1) & ~1) - left; - left *= bpp; + { + LEAVE_PROC("SMI_PutImage"); + return(BadAlloc); + } + + top = y1 >> 16; + left = (x1 >> 16) & ~1; + nPixels = ((((x2 + 0xFFFF) >> 16) + 1) & ~1) - left; + left *= bpp; offset = (pPort->area->box.y1 * fbPitch) + (top * dstPitch); - dstStart = pSmi->FBBase + offset + left; + dstStart = pSmi->FBBase + offset + left; switch(id) { case FOURCC_YV12: case FOURCC_I420: - top &= ~1; - tmp = ((top >> 1) * srcPitch2) + (left >> 2); - offset2 += tmp; - offset3 += tmp; - if(id == FOURCC_I420) { - tmp = offset2; - offset2 = offset3; - offset3 = tmp; - } - nLines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top; - xf86XVCopyYUV12ToPacked(buf + (top * srcPitch) + (left >> 1), - buf + offset2, buf + offset3, dstStart, - srcPitch, srcPitch2, dstPitch, nLines, nPixels); - break; + top &= ~1; + tmp = ((top >> 1) * srcPitch2) + (left >> 2); + offset2 += tmp; + offset3 += tmp; + if(id == FOURCC_I420) { + tmp = offset2; + offset2 = offset3; + offset3 = tmp; + } + nLines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top; + xf86XVCopyYUV12ToPacked(buf + (top * srcPitch) + (left >> 1), + buf + offset2, buf + offset3, dstStart, + srcPitch, srcPitch2, dstPitch, nLines, nPixels); + break; case FOURCC_UYVY: case FOURCC_YUY2: default: - buf += (top * srcPitch) + left; - nLines = ((y2 + 0xffff) >> 16) - top; - xf86XVCopyPacked(buf, dstStart, srcPitch, dstPitch, nLines, nPixels); + buf += (top * srcPitch) + left; + nLines = ((y2 + 0xffff) >> 16) - top; + xf86XVCopyPacked(buf, dstStart, srcPitch, dstPitch, nLines, nPixels); break; } -#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,0,0) - if (!RegionsEqual(&pPort->clip, clipBoxes)) -#else - if (!REGION_EQUAL(pScrn->pScreen, &pPort->clip, clipBoxes)) -#endif - { + if ((pSmi->Chipset == SMI_MSOC) || + !REGION_EQUAL(pScrn->pScreen, &pPort->clip, clipBoxes)) + { REGION_COPY(pScrn->pScreen, &pPort->clip, clipBoxes); - xf86XVFillKeyHelper(pScrn->pScreen, pPort->Attribute[XV_COLORKEY], - clipBoxes); - } - - if (pSmi->Chipset != SMI_COUGAR3DR) - SMI_DisplayVideo(pScrn, id, offset, width, height, dstPitch, x1, y1, x2, y2, - &dstBox, src_w, src_h, drw_w, drw_h); - else - SMI_DisplayVideo0730(pScrn, id, offset, width, height, dstPitch, x1, y1, x2, y2, - &dstBox, src_w, src_h, drw_w, drw_h); + xf86XVFillKeyHelper(pScrn->pScreen, pPort->Attribute[XV_COLORKEY], + clipBoxes); + } + + if (pSmi->Chipset == SMI_COUGAR3DR) + { + SMI_DisplayVideo0730(pScrn, id, offset, width, height, dstPitch, x1, y1, x2, y2, + &dstBox, src_w, src_h, drw_w, drw_h); + } + else if (pSmi->Chipset == SMI_MSOC) + { + SMI_DisplayVideo0501(pScrn, id, offset, width, height, dstPitch, x1, y1, x2, y2, + &dstBox, src_w, src_h, drw_w, drw_h); + } + else + { + SMI_DisplayVideo(pScrn, id, offset, width, height, dstPitch, x1, y1, x2, y2, + &dstBox, src_w, src_h, drw_w, drw_h); + } pPort->videoStatus = CLIENT_VIDEO_ON; - LEAVE_PROC("SMI_PutImage"); - return(Success); - + LEAVE_PROC("SMI_PutImage"); + return(Success); + } static int SMI_QueryImageAttributes( - ScrnInfoPtr pScrn, - int id, - unsigned short *width, - unsigned short *height, - int *pitches, - int *offsets -) -{ - SMIPtr pSmi = SMIPTR(pScrn); - int size, tmp; - - ENTER_PROC("SMI_QueryImageAttributes"); - - if (*width > pSmi->lcdWidth) - { - *width = pSmi->lcdWidth; - } - if (*height > pSmi->lcdHeight) - { - *height = pSmi->lcdHeight; - } - - *width = (*width + 1) & ~1; - if (offsets != NULL) - { - offsets[0] = 0; - } - - switch (id) - { - case FOURCC_YV12: - case FOURCC_I420: - *height = (*height + 1) & ~1; - size = (*width + 3) & ~3; - if (pitches != NULL) - { - pitches[0] = size; - } - size *= *height; - if (offsets != NULL) - { - offsets[1] = size; - } - tmp = ((*width >> 1) + 3) & ~3; - if (pitches != NULL) - { - pitches[1] = pitches[2] = tmp; - } - tmp *= (*height >> 1); - size += tmp; - if (offsets != NULL) - { - offsets[2] = size; - } - size += tmp; - break; - - case FOURCC_YUY2: - case FOURCC_RV15: - case FOURCC_RV16: - default: - size = *width * 2; - if (pitches != NULL) - { - pitches[0] = size; - } - size *= *height; - break; - - case FOURCC_RV24: - size = *width * 3; - if (pitches != NULL) - { - pitches[0] = size; - } - size *= *height; - break; - - case FOURCC_RV32: - size = *width * 4; - if (pitches != NULL) - { - pitches[0] = size; - } - size *= *height; - break; - } + ScrnInfoPtr pScrn, + int id, + unsigned short *width, + unsigned short *height, + int *pitches, + int *offsets +) +{ + SMIPtr pSmi = SMIPTR(pScrn); + int size, tmp; + + ENTER_PROC("SMI_QueryImageAttributes"); + + if (*width > pSmi->lcdWidth) + { + *width = pSmi->lcdWidth; + } + if (*height > pSmi->lcdHeight) + { + *height = pSmi->lcdHeight; + } + + *width = (*width + 1) & ~1; + if (offsets != NULL) + { + offsets[0] = 0; + } + + switch (id) + { + case FOURCC_YV12: + case FOURCC_I420: + *height = (*height + 1) & ~1; + size = (*width + 3) & ~3; + if (pitches != NULL) + { + pitches[0] = size; + } + size *= *height; + if (offsets != NULL) + { + offsets[1] = size; + } + tmp = ((*width >> 1) + 3) & ~3; + if (pitches != NULL) + { + pitches[1] = pitches[2] = tmp; + } + tmp *= (*height >> 1); + size += tmp; + if (offsets != NULL) + { + offsets[2] = size; + } + size += tmp; + break; + + case FOURCC_YUY2: + case FOURCC_RV15: + case FOURCC_RV16: + default: + size = *width * 2; + if (pitches != NULL) + { + pitches[0] = size; + } + size *= *height; + break; + + case FOURCC_RV24: + size = *width * 3; + if (pitches != NULL) + { + pitches[0] = size; + } + size *= *height; + break; + + case FOURCC_RV32: + size = *width * 4; + if (pitches != NULL) + { + pitches[0] = size; + } + size *= *height; + break; + } - LEAVE_PROC("SMI_QueryImageAttributes"); - return(size); + LEAVE_PROC("SMI_QueryImageAttributes"); + return(size); } /******************************************************************************\ -** ** -** S U P P O R T F U N C T I O N S ** -** ** +** ** +** S U P P O R T F U N C T I O N S ** +** ** \******************************************************************************/ #if 0 static void SMI_WaitForSync( - ScrnInfoPtr pScrn + ScrnInfoPtr pScrn ) { - SMIPtr pSmi = SMIPTR(pScrn); - vgaHWPtr hwp = VGAHWPTR(pScrn); - int vgaIOBase = hwp->IOBase; - int vgaCRIndex = vgaIOBase + VGA_CRTC_INDEX_OFFSET; - int vgaCRData = vgaIOBase + VGA_CRTC_DATA_OFFSET; + SMIPtr pSmi = SMIPTR(pScrn); + vgaHWPtr hwp = VGAHWPTR(pScrn); + int vgaIOBase = hwp->IOBase; + int vgaCRIndex = vgaIOBase + VGA_CRTC_INDEX_OFFSET; + int vgaCRData = vgaIOBase + VGA_CRTC_DATA_OFFSET; - VerticalRetraceWait(); + VerticalRetraceWait(); } #endif static Bool SMI_ClipVideo( - ScrnInfoPtr pScrn, - BoxPtr dst, - INT32 *x1, - INT32 *y1, - INT32 *x2, - INT32 *y2, - RegionPtr reg, - INT32 width, - INT32 height + ScrnInfoPtr pScrn, + BoxPtr dst, + INT32 *x1, + INT32 *y1, + INT32 *x2, + INT32 *y2, + RegionPtr reg, + INT32 width, + INT32 height ) { ScreenPtr pScreen = pScrn->pScreen; INT32 vscale, hscale; - BoxPtr extents = REGION_EXTENTS(pScreen, reg); - int diff; + BoxPtr extents = REGION_EXTENTS(pScreen, reg); + int diff; - ENTER_PROC("SMI_ClipVideo"); + ENTER_PROC("SMI_ClipVideo"); DEBUG((VERBLEV, "ClipVideo(%d): x1=%d y1=%d x2=%d y2=%d\n", __LINE__, *x1 >> 16, *y1 >> 16, *x2 >> 16, *y2 >> 16)); - /* PDR#941 */ - extents->x1 = max(extents->x1, pScrn->frameX0); - extents->y1 = max(extents->y1, pScrn->frameY0); + /* PDR#941 */ + extents->x1 = max(extents->x1, pScrn->frameX0); + extents->y1 = max(extents->y1, pScrn->frameY0); - hscale = ((*x2 - *x1) << 16) / (dst->x2 - dst->x1); - vscale = ((*y2 - *y1) << 16) / (dst->y2 - dst->y1); + hscale = ((*x2 - *x1) << 16) / (dst->x2 - dst->x1); + vscale = ((*y2 - *y1) << 16) / (dst->y2 - dst->y1); - *x1 <<= 16; *y1 <<= 16; - *x2 <<= 16; *y2 <<= 16; + *x1 <<= 16; *y1 <<= 16; + *x2 <<= 16; *y2 <<= 16; DEBUG((VERBLEV, "ClipVideo(%d): x1=%d y1=%d x2=%d y2=%d\n", __LINE__, *x1 >> 16, *y1 >> 16, *x2 >> 16, *y2 >> 16)); - diff = extents->x1 - dst->x1; - if (diff > 0) - { - dst->x1 = extents->x1; - *x1 += diff * hscale; - } - - diff = extents->y1 - dst->y1; - if (diff > 0) - { - dst->y1 = extents->y1; - *y1 += diff * vscale; - } - - diff = dst->x2 - extents->x2; - if (diff > 0) - { - dst->x2 = extents->x2; /* PDR#687 */ - *x2 -= diff * hscale; - } - - diff = dst->y2 - extents->y2; - if (diff > 0) - { - dst->y2 = extents->y2; - *y2 -= diff * vscale; - } + diff = extents->x1 - dst->x1; + if (diff > 0) + { + dst->x1 = extents->x1; + *x1 += diff * hscale; + } + + diff = extents->y1 - dst->y1; + if (diff > 0) + { + dst->y1 = extents->y1; + *y1 += diff * vscale; + } + + diff = dst->x2 - extents->x2; + if (diff > 0) + { + dst->x2 = extents->x2; /* PDR#687 */ + *x2 -= diff * hscale; + } + + diff = dst->y2 - extents->y2; + if (diff > 0) + { + dst->y2 = extents->y2; + *y2 -= diff * vscale; + } DEBUG((VERBLEV, "ClipVideo(%d): x1=%d y1=%d x2=%d y2=%d\n", __LINE__, *x1 >> 16, *y1 >> 16, *x2 >> 16, *y2 >> 16)); - if (*x1 < 0) - { - diff = (-*x1 + hscale - 1) / hscale; - dst->x1 += diff; - *x1 += diff * hscale; - } - - if (*y1 < 0) - { - diff = (-*y1 + vscale - 1) / vscale; - dst->y1 += diff; - *y1 += diff * vscale; - } + if (*x1 < 0) + { + diff = (-*x1 + hscale - 1) / hscale; + dst->x1 += diff; + *x1 += diff * hscale; + } + + if (*y1 < 0) + { + diff = (-*y1 + vscale - 1) / vscale; + dst->y1 += diff; + *y1 += diff * vscale; + } DEBUG((VERBLEV, "ClipVideo(%d): x1=%d y1=%d x2=%d y2=%d\n", __LINE__, *x1 >> 16, *y1 >> 16, *x2 >> 16, *y2 >> 16)); #if 0 /* aaa was macht dieser code? */ - delta = *x2 - (width << 16); - if (delta > 0) - { - diff = (delta + hscale - 1) / hscale; - dst->x2 -= diff; - *x2 -= diff * hscale; - } - - delta = *y2 - (height << 16); - if (delta > 0) - { - diff = (delta + vscale - 1) / vscale; - dst->y2 -= diff; - *y2 -= diff * vscale; - } + delta = *x2 - (width << 16); + if (delta > 0) + { + diff = (delta + hscale - 1) / hscale; + dst->x2 -= diff; + *x2 -= diff * hscale; + } + + delta = *y2 - (height << 16); + if (delta > 0) + { + diff = (delta + vscale - 1) / vscale; + dst->y2 -= diff; + *y2 -= diff * vscale; + } #endif DEBUG((VERBLEV, "ClipVideo(%d): x1=%d y1=%d x2=%d y2=%d\n", __LINE__, *x1 >> 16, *y1 >> 16, *x2 >> 16, *y2 >> 16)); - if ((*x1 >= *x2) || (*y1 >= *y2)) - { - LEAVE_PROC("SMI_ClipVideo"); - return(FALSE); - } - - if ( (dst->x1 != extents->x1) || (dst->y1 != extents->y1) - || (dst->x2 != extents->x2) || (dst->y2 != extents->y2) - ) - { - RegionRec clipReg; - REGION_INIT(pScreen, &clipReg, dst, 1); - REGION_INTERSECT(pScreen, reg, reg, &clipReg); - REGION_UNINIT(pScreen, &clipReg); - } + if ((*x1 >= *x2) || (*y1 >= *y2)) + { + LEAVE_PROC("SMI_ClipVideo"); + return(FALSE); + } + + if ( (dst->x1 != extents->x1) || (dst->y1 != extents->y1) + || (dst->x2 != extents->x2) || (dst->y2 != extents->y2) + ) + { + RegionRec clipReg; + REGION_INIT(pScreen, &clipReg, dst, 1); + REGION_INTERSECT(pScreen, reg, reg, &clipReg); + REGION_UNINIT(pScreen, &clipReg); + } DEBUG((VERBLEV, "ClipVideo(%d): x1=%d y1=%d x2=%d y2=%d\n", __LINE__, *x1 >> 16, *y1 >> 16, *x2 >> 16, *y2 >> 16)); - LEAVE_PROC("SMI_ClipVideo"); - return(TRUE); + LEAVE_PROC("SMI_ClipVideo"); + return(TRUE); } static void SMI_DisplayVideo( - ScrnInfoPtr pScrn, - int id, - int offset, - short width, - short height, - int pitch, - int x1, - int y1, - int x2, - int y2, - BoxPtr dstBox, - short vid_w, - short vid_h, - short drw_w, - short drw_h -) -{ - SMIPtr pSmi = SMIPTR(pScrn); - CARD32 vpr00; - int hstretch, vstretch; - - ENTER_PROC("SMI_DisplayVideo"); - - vpr00 = READ_VPR(pSmi, 0x00) & ~0x0CB800FF; - - switch (id) - { - case FOURCC_YV12: - case FOURCC_I420: - case FOURCC_YUY2: - vpr00 |= 0x6; - break; - - case FOURCC_RV15: - vpr00 |= 0x1; - break; - - case FOURCC_RV16: - vpr00 |= 0x2; - break; - - case FOURCC_RV24: - vpr00 |= 0x4; - break; - - case FOURCC_RV32: - vpr00 |= 0x3; - break; - } - - - if (drw_w > vid_w) - { - hstretch = (2560 * vid_w / drw_w + 5) / 10; - } - else - { - hstretch = 0; - } - - if (drw_h > vid_h) - { - vstretch = (2560 * vid_h / drw_h + 5) / 10; - vpr00 |= 1 << 21; - } - else - { - vstretch = 0; - } + ScrnInfoPtr pScrn, + int id, + int offset, + short width, + short height, + int pitch, + int x1, + int y1, + int x2, + int y2, + BoxPtr dstBox, + short vid_w, + short vid_h, + short drw_w, + short drw_h +) +{ + SMIPtr pSmi = SMIPTR(pScrn); + CARD32 vpr00; + int hstretch, vstretch; + + ENTER_PROC("SMI_DisplayVideo"); + + vpr00 = READ_VPR(pSmi, 0x00) & ~0x0CB800FF; + + switch (id) + { + case FOURCC_YV12: + case FOURCC_I420: + case FOURCC_YUY2: + vpr00 |= 0x6; + break; + + case FOURCC_RV15: + vpr00 |= 0x1; + break; + + case FOURCC_RV16: + vpr00 |= 0x2; + break; + + case FOURCC_RV24: + vpr00 |= 0x4; + break; + + case FOURCC_RV32: + vpr00 |= 0x3; + break; + } + + + if (drw_w > vid_w) + { + hstretch = (2560 * vid_w / drw_w + 5) / 10; + } + else + { + hstretch = 0; + } + + if (drw_h > vid_h) + { + vstretch = (2560 * vid_h / drw_h + 5) / 10; + vpr00 |= 1 << 21; + } + else + { + vstretch = 0; + } #if 0 - SMI_WaitForSync(pScrn); + SMI_WaitForSync(pScrn); #endif - WRITE_VPR(pSmi, 0x00, vpr00 | (1 << 3) | (1 << 20)); - WRITE_VPR(pSmi, 0x14, (dstBox->x1) | (dstBox->y1 << 16)); - WRITE_VPR(pSmi, 0x18, (dstBox->x2) | (dstBox->y2 << 16)); - WRITE_VPR(pSmi, 0x1C, offset >> 3); - WRITE_VPR(pSmi, 0x20, (pitch >> 3) | ((pitch >> 3) << 16)); - WRITE_VPR(pSmi, 0x24, (hstretch << 8) | vstretch); + WRITE_VPR(pSmi, 0x00, vpr00 | (1 << 3) | (1 << 20)); + WRITE_VPR(pSmi, 0x14, (dstBox->x1) | (dstBox->y1 << 16)); + WRITE_VPR(pSmi, 0x18, (dstBox->x2) | (dstBox->y2 << 16)); + WRITE_VPR(pSmi, 0x1C, offset >> 3); + WRITE_VPR(pSmi, 0x20, (pitch >> 3) | ((pitch >> 3) << 16)); + WRITE_VPR(pSmi, 0x24, (hstretch << 8) | vstretch); - LEAVE_PROC("SMI_DisplayVideo"); + LEAVE_PROC("SMI_DisplayVideo"); +} + +static void +SMI_DisplayVideo0501( + ScrnInfoPtr pScrn, + int id, + int offset, + short width, + short height, + int pitch, + int x1, + int y1, + int x2, + int y2, + BoxPtr dstBox, + short vid_w, + short vid_h, + short drw_w, + short drw_h +) +{ + SMIPtr pSmi = SMIPTR(pScrn); + CARD32 dcr40; + int hstretch, vstretch; + + ENTER_PROC("SMI_DisplayVideo0501"); + + dcr40 = READ_DCR(pSmi, DCR40) & ~0x00003FFF; + + switch (id) + { + case FOURCC_YV12: + case FOURCC_I420: + case FOURCC_YUY2: + dcr40 |= 0x3; + break; + + case FOURCC_RV16: + dcr40 |= 0x1; + break; + + case FOURCC_RV32: + dcr40 |= 0x2; + break; + } + + + if (drw_w > vid_w) /* Horizontal Stretch */ + { + hstretch = ((40960 * vid_w / drw_w + 5) / 10); + dcr40 |= 1 << 8; + } + else /* Horizontal Shrink */ + { + hstretch = ((40960 * drw_w / vid_w + 5) / 10) | 0x8000; + } + + if (drw_h > vid_h) /* Vertical Stretch */ + { + vstretch = ((40960 * vid_h / drw_h + 5) / 10); + dcr40 |= 1 << 9; + } + else /* Vertical Shrink */ + { + vstretch = ((40960 * drw_h / vid_h + 5) / 10) | 0x8000; + } +#if 0 + SMI_WaitForSync(pScrn); +#endif + + /* Set Color Key Enable bit */ + WRITE_DCR(pSmi, DCR00, READ_DCR(pSmi, DCR00) | (1 << 9)); + + WRITE_DCR(pSmi, DCR40, dcr40 | (1 << 2)); + WRITE_DCR(pSmi, DCR50, (dstBox->x1) | (dstBox->y1 << 16)); + WRITE_DCR(pSmi, DCR54, (dstBox->x2) | (dstBox->y2 << 16)); + WRITE_DCR(pSmi, DCR44, offset); + WRITE_DCR(pSmi, DCR48, (pitch) | ((pitch) << 16)); + WRITE_DCR(pSmi, DCR4C, (offset + (pitch * height))) ; + WRITE_DCR(pSmi, DCR58, (vstretch << 16) | hstretch); + WRITE_DCR(pSmi, DCR5C, 0x00000000); + WRITE_DCR(pSmi, DCR60, 0x00EDEDED); + + /* + ErrorF("SMI 510 Video Debug Parameters\n"); + ErrorF("offset = %8X, pitch = %8X, width = %8X, height = %8X\n", offset, pitch, width, height); + ErrorF("drw_w = %8X, vid_w = %8X, drw_h = %8X, vid_h = %8X\n", drw_w, vid_w, drw_h, vid_h); + ErrorF("dstBox x1 = %8X, y1 = %8X, x2 = %8X, y2 = %8X\n", dstBox->x1, dstBox->y1, dstBox->x2, dstBox->y2); + ErrorF("DCR40 = %8X\n", READ_DCR(pSmi, DCR40)); + ErrorF("DCR50 = %8X\n", READ_DCR(pSmi, DCR50)); + ErrorF("DCR54 = %8X\n", READ_DCR(pSmi, DCR54)); + ErrorF("DCR44 = %8X\n", READ_DCR(pSmi, DCR44)); + ErrorF("DCR48 = %8X\n", READ_DCR(pSmi, DCR48)); + ErrorF("DCR4C = %8X\n", READ_DCR(pSmi, DCR4C)); + ErrorF("DCR58 = %8X\n", READ_DCR(pSmi, DCR58)); + ErrorF("DCR5C = %8X\n", READ_DCR(pSmi, DCR5C)); + */ + + LEAVE_PROC("SMI_DisplayVideo0501"); } static void SMI_DisplayVideo0730( - ScrnInfoPtr pScrn, - int id, - int offset, - short width, - short height, - int pitch, - int x1, - int y1, - int x2, - int y2, - BoxPtr dstBox, - short vid_w, - short vid_h, - short drw_w, - short drw_h -) -{ - SMIPtr pSmi = SMIPTR(pScrn); - CARD32 fpr00; - int hstretch, vstretch; - - ENTER_PROC("SMI_DisplayVideo0730"); - - fpr00 = READ_FPR(pSmi, 0x00) & ~(FPR00_MASKBITS); - - switch (id) - { - case FOURCC_YV12: - case FOURCC_I420: - case FOURCC_YUY2: - fpr00 |= FPR00_FMT_YUV422; - break; - - case FOURCC_RV15: - fpr00 |= FPR00_FMT_15P; - break; - - case FOURCC_RV16: - fpr00 |= FPR00_FMT_16P; - break; - - case FOURCC_RV24: - fpr00 |= FPR00_FMT_24P; - break; - - case FOURCC_RV32: - fpr00 |= FPR00_FMT_32P; - break; - } - - /* the formulas for calculating the stretch values do not match the - documentation, but they're the same as the ddraw driver and they work */ - if (drw_w > vid_w) - { - hstretch = (8192 * vid_w / drw_w); - } - else - { - hstretch = 0; - } - - if (drw_h > vid_h) - { - vstretch = (8192 * vid_h / drw_h); - } - else - { - vstretch = 0; - } - - - WRITE_FPR(pSmi, FPR00, fpr00 | FPR00_VWIENABLE | FPR00_VWIKEYENABLE); - WRITE_FPR(pSmi, FPR14, (dstBox->x1) | (dstBox->y1 << 16)); - WRITE_FPR(pSmi, FPR18, (dstBox->x2) | (dstBox->y2 << 16)); - WRITE_FPR(pSmi, FPR1C, offset >> 3); - WRITE_FPR(pSmi, FPR20, (pitch >> 3) | ((pitch >> 3) << 16)); - WRITE_FPR(pSmi, FPR24, (hstretch & 0xFF00) | ((vstretch & 0xFF00)>>8)); - WRITE_FPR(pSmi, FPR68, ((hstretch & 0x00FF)<<8) | (vstretch & 0x00FF)); + ScrnInfoPtr pScrn, + int id, + int offset, + short width, + short height, + int pitch, + int x1, + int y1, + int x2, + int y2, + BoxPtr dstBox, + short vid_w, + short vid_h, + short drw_w, + short drw_h +) +{ + SMIPtr pSmi = SMIPTR(pScrn); + CARD32 fpr00; + int hstretch, vstretch; + + ENTER_PROC("SMI_DisplayVideo0730"); + + fpr00 = READ_FPR(pSmi, 0x00) & ~(FPR00_MASKBITS); + + switch (id) + { + case FOURCC_YV12: + case FOURCC_I420: + case FOURCC_YUY2: + fpr00 |= FPR00_FMT_YUV422; + break; + + case FOURCC_RV15: + fpr00 |= FPR00_FMT_15P; + break; + + case FOURCC_RV16: + fpr00 |= FPR00_FMT_16P; + break; + + case FOURCC_RV24: + fpr00 |= FPR00_FMT_24P; + break; + + case FOURCC_RV32: + fpr00 |= FPR00_FMT_32P; + break; + } + + /* the formulas for calculating the stretch values do not match the + documentation, but they're the same as the ddraw driver and they work */ + if (drw_w > vid_w) + { + hstretch = (8192 * vid_w / drw_w); + } + else + { + hstretch = 0; + } + + if (drw_h > vid_h) + { + vstretch = (8192 * vid_h / drw_h); + } + else + { + vstretch = 0; + } - LEAVE_PROC("SMI_DisplayVideo0730"); + + WRITE_FPR(pSmi, FPR00, fpr00 | FPR00_VWIENABLE | FPR00_VWIKEYENABLE); + WRITE_FPR(pSmi, FPR14, (dstBox->x1) | (dstBox->y1 << 16)); + WRITE_FPR(pSmi, FPR18, (dstBox->x2) | (dstBox->y2 << 16)); + WRITE_FPR(pSmi, FPR1C, offset >> 3); + WRITE_FPR(pSmi, FPR20, (pitch >> 3) | ((pitch >> 3) << 16)); + WRITE_FPR(pSmi, FPR24, (hstretch & 0xFF00) | ((vstretch & 0xFF00)>>8)); + WRITE_FPR(pSmi, FPR68, ((hstretch & 0x00FF)<<8) | (vstretch & 0x00FF)); + + LEAVE_PROC("SMI_DisplayVideo0730"); } static void SMI_BlockHandler( - int i, - pointer blockData, - pointer pTimeout, - pointer pReadMask + int i, + pointer blockData, + pointer pTimeout, + pointer pReadMask ) { - ScreenPtr pScreen = screenInfo.screens[i]; - ScrnInfoPtr pScrn = xf86Screens[i]; - SMIPtr pSmi = SMIPTR(pScrn); + ScreenPtr pScreen = screenInfo.screens[i]; + ScrnInfoPtr pScrn = xf86Screens[i]; + SMIPtr pSmi = SMIPTR(pScrn); SMI_PortPtr pPort = (SMI_PortPtr) pSmi->ptrAdaptor->pPortPrivates[0].ptr; - pScreen->BlockHandler = pSmi->BlockHandler; - (*pScreen->BlockHandler)(i, blockData, pTimeout, pReadMask); - pScreen->BlockHandler = SMI_BlockHandler; + pScreen->BlockHandler = pSmi->BlockHandler; + (*pScreen->BlockHandler)(i, blockData, pTimeout, pReadMask); + pScreen->BlockHandler = SMI_BlockHandler; if (pPort->videoStatus & TIMER_MASK) - { - UpdateCurrentTime(); + { + UpdateCurrentTime(); if (pPort->videoStatus & OFF_TIMER) - { + { if (pPort->offTime < currentTime.milliseconds) - { - if (pSmi->Chipset == SMI_COUGAR3DR) - { - WRITE_FPR(pSmi, FPR00, READ_FPR(pSmi, 0x00) & ~(FPR00_VWIENABLE)); - } - else - { - WRITE_VPR(pSmi, 0x00, READ_VPR(pSmi, 0x00) & ~0x00000008); - } + { + if (pSmi->Chipset == SMI_COUGAR3DR) + { + WRITE_FPR(pSmi, FPR00, READ_FPR(pSmi, 0x00) & ~(FPR00_VWIENABLE)); + } + else if (pSmi->Chipset == SMI_MSOC) + { + WRITE_DCR(pSmi, DCR40, READ_DCR(pSmi, DCR40) & ~0x00000004); + } + else + { + WRITE_VPR(pSmi, 0x00, READ_VPR(pSmi, 0x00) & ~0x00000008); + } pPort->videoStatus = FREE_TIMER; pPort->freeTime = currentTime.milliseconds + FREE_DELAY; - } - } - else - { + } + } + else + { if (pPort->freeTime < currentTime.milliseconds) - { + { xf86FreeOffscreenArea(pPort->area); pPort->area = NULL; - } + } pPort->videoStatus = 0; - } - } + } + } } #if 0 static int SMI_SendI2C( - ScrnInfoPtr pScrn, - CARD8 device, - char *devName, - SMI_I2CDataPtr i2cData -) -{ - SMIPtr pSmi = SMIPTR(pScrn); - I2CDevPtr dev; - int status = Success; - - ENTER_PROC("SMI_SendI2C"); - - if (pSmi->I2C == NULL) - { - LEAVE_PROC("SMI_SendI2C"); - return(BadAlloc); - } - - dev = xf86CreateI2CDevRec(); - if (dev == NULL) - { - LEAVE_PROC("SMI_SendI2C"); - return(BadAlloc); - } - dev->DevName = devName; - dev->SlaveAddr = device; - dev->pI2CBus = pSmi->I2C; - - if (!xf86I2CDevInit(dev)) - { - status = BadAlloc; - } - else - { - while (i2cData->address != 0xFF || i2cData->data != 0xFF) /* PDR#676 */ - { - if (!xf86I2CWriteByte(dev, i2cData->address, i2cData->data)) - { - status = BadAlloc; - break; - } - i2cData++; - } - } - - xf86DestroyI2CDevRec(dev, TRUE); - LEAVE_PROC("SMI_SendI2C"); - return(status); + ScrnInfoPtr pScrn, + CARD8 device, + char *devName, + SMI_I2CDataPtr i2cData +) +{ + SMIPtr pSmi = SMIPTR(pScrn); + I2CDevPtr dev; + int status = Success; + + ENTER_PROC("SMI_SendI2C"); + + if (pSmi->I2C == NULL) + { + LEAVE_PROC("SMI_SendI2C"); + return(BadAlloc); + } + + dev = xf86CreateI2CDevRec(); + if (dev == NULL) + { + LEAVE_PROC("SMI_SendI2C"); + return(BadAlloc); + } + dev->DevName = devName; + dev->SlaveAddr = device; + dev->pI2CBus = pSmi->I2C; + + if (!xf86I2CDevInit(dev)) + { + status = BadAlloc; + } + else + { + while (i2cData->address != 0xFF || i2cData->data != 0xFF) /* PDR#676 */ + { + if (!xf86I2CWriteByte(dev, i2cData->address, i2cData->data)) + { + status = BadAlloc; + break; + } + i2cData++; + } + } + + xf86DestroyI2CDevRec(dev, TRUE); + LEAVE_PROC("SMI_SendI2C"); + return(status); } #endif /******************************************************************************\ -** ** -** O F F S C R E E N M E M O R Y M A N A G E R ** -** ** +** ** +** O F F S C R E E N M E M O R Y M A N A G E R ** +** ** \******************************************************************************/ static void SMI_InitOffscreenImages( - ScreenPtr pScreen + ScreenPtr pScreen ) { - XF86OffscreenImagePtr offscreenImages; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - SMIPtr pSmi = SMIPTR(pScrn); - SMI_PortPtr pPort = (SMI_PortPtr) pSmi->ptrAdaptor->pPortPrivates[0].ptr; - - ENTER_PROC("SMI_InitOffscreenImages"); - - offscreenImages = xalloc(sizeof(XF86OffscreenImageRec)); - if (offscreenImages == NULL) - { - LEAVE_PROC("SMI_InitOffscreenImages"); - return; - } - - offscreenImages->image = SMI_VideoImages; - offscreenImages->flags = VIDEO_OVERLAID_IMAGES - | VIDEO_CLIP_TO_VIEWPORT; - offscreenImages->alloc_surface = SMI_AllocSurface; - offscreenImages->free_surface = SMI_FreeSurface; - offscreenImages->display = SMI_DisplaySurface; - offscreenImages->stop = SMI_StopSurface; - offscreenImages->getAttribute = SMI_GetSurfaceAttribute; - offscreenImages->setAttribute = SMI_SetSurfaceAttribute; - offscreenImages->max_width = pSmi->lcdWidth; - offscreenImages->max_height = pSmi->lcdHeight; - if (!pPort->I2CDev.SlaveAddr) { - offscreenImages->num_attributes = nElems(SMI_VideoAttributes); - offscreenImages->attributes = SMI_VideoAttributes; - } else { - offscreenImages->num_attributes = - nElems(SMI_VideoAttributesSAA711x); - offscreenImages->attributes = SMI_VideoAttributesSAA711x; - } - xf86XVRegisterOffscreenImages(pScreen, offscreenImages, 1); + XF86OffscreenImagePtr offscreenImages; + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + SMIPtr pSmi = SMIPTR(pScrn); + SMI_PortPtr pPort = (SMI_PortPtr) pSmi->ptrAdaptor->pPortPrivates[0].ptr; + + ENTER_PROC("SMI_InitOffscreenImages"); + + offscreenImages = xalloc(sizeof(XF86OffscreenImageRec)); + if (offscreenImages == NULL) + { + LEAVE_PROC("SMI_InitOffscreenImages"); + return; + } - LEAVE_PROC("SMI_InitOffscreenImages"); + offscreenImages->image = SMI_VideoImages; + offscreenImages->flags = VIDEO_OVERLAID_IMAGES + | VIDEO_CLIP_TO_VIEWPORT; + offscreenImages->alloc_surface = SMI_AllocSurface; + offscreenImages->free_surface = SMI_FreeSurface; + offscreenImages->display = SMI_DisplaySurface; + offscreenImages->stop = SMI_StopSurface; + offscreenImages->getAttribute = SMI_GetSurfaceAttribute; + offscreenImages->setAttribute = SMI_SetSurfaceAttribute; + offscreenImages->max_width = pSmi->lcdWidth; + offscreenImages->max_height = pSmi->lcdHeight; + if (!pPort->I2CDev.SlaveAddr) { + offscreenImages->num_attributes = nElems(SMI_VideoAttributes); + offscreenImages->attributes = SMI_VideoAttributes; + } else { + offscreenImages->num_attributes = + nElems(SMI_VideoAttributesSAA711x); + offscreenImages->attributes = SMI_VideoAttributesSAA711x; + } + xf86XVRegisterOffscreenImages(pScreen, offscreenImages, 1); + + LEAVE_PROC("SMI_InitOffscreenImages"); } static FBAreaPtr SMI_AllocateMemory( - ScrnInfoPtr pScrn, - FBAreaPtr area, - int numLines + ScrnInfoPtr pScrn, + FBAreaPtr area, + int numLines ) { - ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; + ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; - ENTER_PROC("SMI_AllocateMemory"); + ENTER_PROC("SMI_AllocateMemory"); - if (area != NULL) - { - if ((area->box.y2 - area->box.y1) >= numLines) - { + if (area != NULL) + { + if ((area->box.y2 - area->box.y1) >= numLines) + { LEAVE_PROC("SMI_AllocateMemory (area->box.y2 - area->box.y1) >= numLines ok"); - return(area); - } + return(area); + } - if (xf86ResizeOffscreenArea(area, pScrn->displayWidth, numLines)) - { + if (xf86ResizeOffscreenArea(area, pScrn->displayWidth, numLines)) + { LEAVE_PROC("SMI_AllocateMemory xf86ResizeOffscreenArea ok"); - return(area); - } + return(area); + } - xf86FreeOffscreenArea(area); - } + xf86FreeOffscreenArea(area); + } + + area = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth, numLines, 0, + NULL, NULL, NULL); + + if (area == NULL) + { + int maxW, maxH; - area = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth, numLines, 0, - NULL, NULL, NULL); + xf86QueryLargestOffscreenArea(pScreen, &maxW, &maxH, 0, + FAVOR_WIDTH_THEN_AREA, PRIORITY_EXTREME); - if (area == NULL) - { - int maxW, maxH; - - xf86QueryLargestOffscreenArea(pScreen, &maxW, &maxH, 0, - FAVOR_WIDTH_THEN_AREA, PRIORITY_EXTREME); - - DEBUG((VERBLEV, "QueryLargestOffscreenArea maxW=%d maxH=%d displayWidth=%d numlines=%d\n", - maxW, maxH, pScrn->displayWidth, numLines)); - if ((maxW < pScrn->displayWidth) || (maxH < numLines)) - { + DEBUG((VERBLEV, "QueryLargestOffscreenArea maxW=%d maxH=%d displayWidth=%d numlines=%d\n", + maxW, maxH, pScrn->displayWidth, numLines)); + if ((maxW < pScrn->displayWidth) || (maxH < numLines)) + { LEAVE_PROC("SMI_AllocateMemory (maxW < pScrn->displayWidth) || (maxH < numLines)"); - return(NULL); - } + return(NULL); + } - xf86PurgeUnlockedOffscreenAreas(pScreen); - area = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth, numLines, - 0, NULL, NULL, NULL); - } + xf86PurgeUnlockedOffscreenAreas(pScreen); + area = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth, numLines, + 0, NULL, NULL, NULL); + } DEBUG((VERBLEV, "area = %p\n", area)); - LEAVE_PROC("SMI_AllocateMemory"); - return(area); + LEAVE_PROC("SMI_AllocateMemory"); + return(area); } static int SMI_AllocSurface( - ScrnInfoPtr pScrn, - int id, - unsigned short width, - unsigned short height, - XF86SurfacePtr surface -) -{ - SMIPtr pSmi = SMIPTR(pScrn); - int numLines, pitch, fbPitch, bpp; - SMI_OffscreenPtr ptrOffscreen; - FBAreaPtr area; - - ENTER_PROC("SMI_AllocSurface"); - - if ((width > pSmi->lcdWidth) || (height > pSmi->lcdHeight)) - { - LEAVE_PROC("SMI_AllocSurface"); - return(BadAlloc); - } - - if (pSmi->Bpp == 3) - { - fbPitch = pSmi->Stride; - } - else - { - fbPitch = pSmi->Stride * pSmi->Bpp; - } - - width = (width + 1) & ~1; - switch (id) - { - case FOURCC_YV12: - case FOURCC_I420: - case FOURCC_YUY2: - case FOURCC_RV15: - case FOURCC_RV16: - bpp = 2; - break; - - case FOURCC_RV24: - bpp = 3; - break; - - case FOURCC_RV32: - bpp = 4; - break; - - default: - LEAVE_PROC("SMI_AllocSurface"); - return(BadAlloc); - } - pitch = (width * bpp + 15) & ~15; - - numLines = ((height * pitch) + fbPitch - 1) / fbPitch; - - area = SMI_AllocateMemory(pScrn, NULL, numLines); - if (area == NULL) - { - LEAVE_PROC("SMI_AllocSurface"); - return(BadAlloc); - } - - surface->pitches = xalloc(sizeof(int)); - if (surface->pitches == NULL) - { - xf86FreeOffscreenArea(area); - LEAVE_PROC("SMI_AllocSurface"); - return(BadAlloc); - } - surface->offsets = xalloc(sizeof(int)); - if (surface->offsets == NULL) - { - xfree(surface->pitches); - xf86FreeOffscreenArea(area); - LEAVE_PROC("SMI_AllocSurface"); - return(BadAlloc); - } - - ptrOffscreen = xalloc(sizeof(SMI_OffscreenRec)); - if (ptrOffscreen == NULL) - { - xfree(surface->offsets); - xfree(surface->pitches); - xf86FreeOffscreenArea(area); - LEAVE_PROC("SMI_AllocSurface"); - return(BadAlloc); - } - - surface->pScrn = pScrn; - surface->id = id; - surface->width = width; - surface->height = height; - surface->pitches[0] = pitch; - surface->offsets[0] = area->box.y1 * fbPitch; - surface->devPrivate.ptr = (pointer) ptrOffscreen; + ScrnInfoPtr pScrn, + int id, + unsigned short width, + unsigned short height, + XF86SurfacePtr surface +) +{ + SMIPtr pSmi = SMIPTR(pScrn); + int numLines, pitch, fbPitch, bpp; + SMI_OffscreenPtr ptrOffscreen; + FBAreaPtr area; - ptrOffscreen->area = area; - ptrOffscreen->isOn = FALSE; + ENTER_PROC("SMI_AllocSurface"); + + if ((width > pSmi->lcdWidth) || (height > pSmi->lcdHeight)) + { + LEAVE_PROC("SMI_AllocSurface"); + return(BadAlloc); + } - LEAVE_PROC("SMI_AllocSurface"); - return(Success); + if (pSmi->Bpp == 3) + { + fbPitch = pSmi->Stride; + } + else + { + fbPitch = pSmi->Stride * pSmi->Bpp; + } + + width = (width + 1) & ~1; + switch (id) + { + case FOURCC_YV12: + case FOURCC_I420: + case FOURCC_YUY2: + case FOURCC_RV15: + case FOURCC_RV16: + bpp = 2; + break; + + case FOURCC_RV24: + bpp = 3; + break; + + case FOURCC_RV32: + bpp = 4; + break; + + default: + LEAVE_PROC("SMI_AllocSurface"); + return(BadAlloc); + } + pitch = (width * bpp + 15) & ~15; + + numLines = ((height * pitch) + fbPitch - 1) / fbPitch; + + area = SMI_AllocateMemory(pScrn, NULL, numLines); + if (area == NULL) + { + LEAVE_PROC("SMI_AllocSurface"); + return(BadAlloc); + } + + surface->pitches = xalloc(sizeof(int)); + if (surface->pitches == NULL) + { + xf86FreeOffscreenArea(area); + LEAVE_PROC("SMI_AllocSurface"); + return(BadAlloc); + } + surface->offsets = xalloc(sizeof(int)); + if (surface->offsets == NULL) + { + xfree(surface->pitches); + xf86FreeOffscreenArea(area); + LEAVE_PROC("SMI_AllocSurface"); + return(BadAlloc); + } + + ptrOffscreen = xalloc(sizeof(SMI_OffscreenRec)); + if (ptrOffscreen == NULL) + { + xfree(surface->offsets); + xfree(surface->pitches); + xf86FreeOffscreenArea(area); + LEAVE_PROC("SMI_AllocSurface"); + return(BadAlloc); + } + + surface->pScrn = pScrn; + surface->id = id; + surface->width = width; + surface->height = height; + surface->pitches[0] = pitch; + surface->offsets[0] = area->box.y1 * fbPitch; + surface->devPrivate.ptr = (pointer) ptrOffscreen; + + ptrOffscreen->area = area; + ptrOffscreen->isOn = FALSE; + + LEAVE_PROC("SMI_AllocSurface"); + return(Success); } static int SMI_FreeSurface( - XF86SurfacePtr surface + XF86SurfacePtr surface ) { - SMI_OffscreenPtr ptrOffscreen = (SMI_OffscreenPtr) surface->devPrivate.ptr; + SMI_OffscreenPtr ptrOffscreen = (SMI_OffscreenPtr) surface->devPrivate.ptr; - ENTER_PROC("SMI_FreeSurface"); + ENTER_PROC("SMI_FreeSurface"); - if (ptrOffscreen->isOn) - { - SMI_StopSurface(surface); - } + if (ptrOffscreen->isOn) + { + SMI_StopSurface(surface); + } - xf86FreeOffscreenArea(ptrOffscreen->area); - xfree(surface->pitches); - xfree(surface->offsets); - xfree(surface->devPrivate.ptr); + xf86FreeOffscreenArea(ptrOffscreen->area); + xfree(surface->pitches); + xfree(surface->offsets); + xfree(surface->devPrivate.ptr); - LEAVE_PROC("SMI_FreeSurface"); - return(Success); + LEAVE_PROC("SMI_FreeSurface"); + return(Success); } static int SMI_DisplaySurface( - XF86SurfacePtr surface, - short vid_x, - short vid_y, - short drw_x, - short drw_y, - short vid_w, - short vid_h, - short drw_w, - short drw_h, - RegionPtr clipBoxes + XF86SurfacePtr surface, + short vid_x, + short vid_y, + short drw_x, + short drw_y, + short vid_w, + short vid_h, + short drw_w, + short drw_h, + RegionPtr clipBoxes ) { - SMI_OffscreenPtr ptrOffscreen = (SMI_OffscreenPtr) surface->devPrivate.ptr; - SMIPtr pSmi = SMIPTR(surface->pScrn); + SMI_OffscreenPtr ptrOffscreen = (SMI_OffscreenPtr) surface->devPrivate.ptr; + SMIPtr pSmi = SMIPTR(surface->pScrn); SMI_PortPtr pPort = pSmi->ptrAdaptor->pPortPrivates[0].ptr; - INT32 x1, y1, x2, y2; - BoxRec dstBox; + INT32 x1, y1, x2, y2; + BoxRec dstBox; + + ENTER_PROC("SMI_DisplaySurface"); + + x1 = vid_x; + x2 = vid_x + vid_w; + y1 = vid_y; + y2 = vid_y + vid_h; + + dstBox.x1 = drw_x; + dstBox.x2 = drw_x + drw_w; + dstBox.y1 = drw_y; + dstBox.y2 = drw_y + drw_h; + + if (!SMI_ClipVideo(surface->pScrn, &dstBox, &x1, &y1, &x2, &y2, clipBoxes, + surface->width, surface->height)) + { + LEAVE_PROC("SMI_DisplaySurface"); + return(Success); + } - ENTER_PROC("SMI_DisplaySurface"); + dstBox.x1 -= surface->pScrn->frameX0; + dstBox.y1 -= surface->pScrn->frameY0; + dstBox.x2 -= surface->pScrn->frameX0; + dstBox.y2 -= surface->pScrn->frameY0; - x1 = vid_x; - x2 = vid_x + vid_w; - y1 = vid_y; - y2 = vid_y + vid_h; - - dstBox.x1 = drw_x; - dstBox.x2 = drw_x + drw_w; - dstBox.y1 = drw_y; - dstBox.y2 = drw_y + drw_h; - - if (!SMI_ClipVideo(surface->pScrn, &dstBox, &x1, &y1, &x2, &y2, clipBoxes, - surface->width, surface->height)) - { - LEAVE_PROC("SMI_DisplaySurface"); - return(Success); - } - - dstBox.x1 -= surface->pScrn->frameX0; - dstBox.y1 -= surface->pScrn->frameY0; - dstBox.x2 -= surface->pScrn->frameX0; - dstBox.y2 -= surface->pScrn->frameY0; - - xf86XVFillKeyHelper(surface->pScrn->pScreen, - pPort->Attribute[XV_COLORKEY], clipBoxes); - - if (pSmi->Chipset != SMI_COUGAR3DR) - { - SMI_ResetVideo(surface->pScrn); - SMI_DisplayVideo(surface->pScrn, surface->id, surface->offsets[0], - surface->width, surface->height, surface->pitches[0], x1, y1, x2, - y2, &dstBox, vid_w, vid_h, drw_w, drw_h); - } - else - { - SMI_ResetVideo(surface->pScrn); - SMI_DisplayVideo0730(surface->pScrn, surface->id, surface->offsets[0], - surface->width, surface->height, surface->pitches[0], x1, y1, x2, - y2, &dstBox, vid_w, vid_h, drw_w, drw_h); - } + xf86XVFillKeyHelper(surface->pScrn->pScreen, + pPort->Attribute[XV_COLORKEY], clipBoxes); - ptrOffscreen->isOn = TRUE; + if (pSmi->Chipset == SMI_COUGAR3DR) + { + SMI_ResetVideo(surface->pScrn); + SMI_DisplayVideo0730(surface->pScrn, surface->id, surface->offsets[0], + surface->width, surface->height, surface->pitches[0], x1, y1, x2, + y2, &dstBox, vid_w, vid_h, drw_w, drw_h); + } + else if (pSmi->Chipset == SMI_MSOC) + { + SMI_ResetVideo(surface->pScrn); + SMI_DisplayVideo0501(surface->pScrn, surface->id, surface->offsets[0], + surface->width, surface->height, surface->pitches[0], x1, y1, x2, + y2, &dstBox, vid_w, vid_h, drw_w, drw_h); + } + else + { + SMI_ResetVideo(surface->pScrn); + SMI_DisplayVideo(surface->pScrn, surface->id, surface->offsets[0], + surface->width, surface->height, surface->pitches[0], x1, y1, x2, + y2, &dstBox, vid_w, vid_h, drw_w, drw_h); + } + + ptrOffscreen->isOn = TRUE; if (pPort->videoStatus & CLIENT_VIDEO_ON) - { + { REGION_EMPTY(surface->pScrn->pScreen, &pPort->clip); - UpdateCurrentTime(); + UpdateCurrentTime(); pPort->videoStatus = FREE_TIMER; pPort->freeTime = currentTime.milliseconds + FREE_DELAY; - } + } - LEAVE_PROC("SMI_DisplaySurface"); - return(Success); + LEAVE_PROC("SMI_DisplaySurface"); + return(Success); } static int SMI_StopSurface( - XF86SurfacePtr surface + XF86SurfacePtr surface ) { - SMI_OffscreenPtr ptrOffscreen = (SMI_OffscreenPtr) surface->devPrivate.ptr; + SMI_OffscreenPtr ptrOffscreen = (SMI_OffscreenPtr) surface->devPrivate.ptr; - ENTER_PROC("SMI_StopSurface"); + ENTER_PROC("SMI_StopSurface"); - if (ptrOffscreen->isOn) - { - SMIPtr pSmi = SMIPTR(surface->pScrn); - if (pSmi->Chipset == SMI_COUGAR3DR) - { - WRITE_FPR(pSmi, FPR00, READ_FPR(pSmi, 0x00) & ~(FPR00_VWIENABLE)); - } - else - { - WRITE_VPR(pSmi, 0x00, READ_VPR(pSmi, 0x00) & ~0x00000008); - } + if (ptrOffscreen->isOn) + { + SMIPtr pSmi = SMIPTR(surface->pScrn); + if (pSmi->Chipset == SMI_COUGAR3DR) + { + WRITE_FPR(pSmi, FPR00, READ_FPR(pSmi, 0x00) & ~(FPR00_VWIENABLE)); + } + else + { + WRITE_VPR(pSmi, 0x00, READ_VPR(pSmi, 0x00) & ~0x00000008); + } - ptrOffscreen->isOn = FALSE; - } + ptrOffscreen->isOn = FALSE; + } - LEAVE_PROC("SMI_StopSurface"); - return(Success); + LEAVE_PROC("SMI_StopSurface"); + return(Success); } static int SMI_GetSurfaceAttribute( - ScrnInfoPtr pScrn, - Atom attr, - INT32 *value + ScrnInfoPtr pScrn, + Atom attr, + INT32 *value ) { - SMIPtr pSmi = SMIPTR(pScrn); + SMIPtr pSmi = SMIPTR(pScrn); - return(SMI_GetPortAttribute(pScrn, attr, value, - (pointer) pSmi->ptrAdaptor->pPortPrivates[0].ptr)); + return(SMI_GetPortAttribute(pScrn, attr, value, + (pointer) pSmi->ptrAdaptor->pPortPrivates[0].ptr)); } static int SMI_SetSurfaceAttribute( - ScrnInfoPtr pScrn, - Atom attr, - INT32 value + ScrnInfoPtr pScrn, + Atom attr, + INT32 value ) { - SMIPtr pSmi = SMIPTR(pScrn); + SMIPtr pSmi = SMIPTR(pScrn); - return(SMI_SetPortAttribute(pScrn, attr, value, - (pointer) pSmi->ptrAdaptor->pPortPrivates[0].ptr)); + return(SMI_SetPortAttribute(pScrn, attr, value, + (pointer) pSmi->ptrAdaptor->pPortPrivates[0].ptr)); } static void SetKeyReg(SMIPtr pSmi, int reg, int value) { - if (pSmi->Chipset == SMI_COUGAR3DR) - { - WRITE_FPR(pSmi, reg, value); - } - else - { - WRITE_VPR(pSmi, reg, value); - } + if (pSmi->Chipset == SMI_COUGAR3DR) + { + WRITE_FPR(pSmi, reg, value); + } + else if (pSmi->Chipset == SMI_MSOC) + { + /* We don't change the color mask, and we don't do brightness. IF + * they write to the colorkey register, we'll write the value to the + * 501 colorkey register */ + if (FPR04 == reg) /* Only act on colorkey value writes */ + { + WRITE_DCR(pSmi, DCR08, value); /* ColorKey register is DCR08 */ + } + } + else + { + WRITE_VPR(pSmi, reg, value); + } } #else /* SMI_USE_VIDEO */ Index: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.h diff -u xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.h:1.4 xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.h:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.h:1.4 Mon Sep 16 14:06:01 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.h Mon Jan 9 09:59:59 2006 @@ -1,5 +1,3 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_video.h.-arc 1.8 27 Nov 2000 15:46:06 Frido $ */ - /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. Copyright (C) 2000 Silicon Motion, Inc. All Rights Reserved. @@ -26,7 +24,7 @@ sale, use or other dealings in this Software without prior written authorization from the XFree86 Project and silicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.h,v 1.4 2002/09/16 18:06:01 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.h,v 1.5 2006/01/09 14:59:59 dawes Exp $ */ #ifndef _SMI_VIDEO_H #define _SMI_VIDEO_H Index: xc/programs/Xserver/hw/xfree86/drivers/sis/300vtbl.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/300vtbl.h:1.26 xc/programs/Xserver/hw/xfree86/drivers/sis/300vtbl.h:1.27 --- xc/programs/Xserver/hw/xfree86/drivers/sis/300vtbl.h:1.26 Sun Jun 20 20:43:21 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/300vtbl.h Mon Jan 9 09:59:59 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/300vtbl.h,v 1.26 2004/06/21 00:43:21 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/300vtbl.h,v 1.27 2006/01/09 14:59:59 dawes Exp $ */ /* * Register settings for SiS 300 series * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/310vtbl.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/310vtbl.h:1.27 xc/programs/Xserver/hw/xfree86/drivers/sis/310vtbl.h:1.28 --- xc/programs/Xserver/hw/xfree86/drivers/sis/310vtbl.h:1.27 Sun Jun 20 20:43:21 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/310vtbl.h Mon Jan 9 09:59:59 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/310vtbl.h,v 1.27 2004/06/21 00:43:21 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/310vtbl.h,v 1.28 2006/01/09 14:59:59 dawes Exp $ */ /* * Register settings for SiS 315/330 series * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile:1.36 xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile:1.39 --- xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile:1.36 Mon Feb 28 22:48:53 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile Fri Oct 14 11:16:44 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile,v 1.36 2005/03/01 03:48:53 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile,v 1.39 2005/10/14 15:16:44 tsi Exp $ XCOMM XCOMM This is an Imakefile for the SIS driver. XCOMM @@ -15,37 +15,28 @@ #if BuildXF86DRI DRISRCS = sis_dri.c DRIOBJS = sis_dri.o -DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri \ - -I$(XTOP)/include -I$(DRMINCLUDESDIR) +DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri -I$(DRMINCLUDESDIR) DRIDEFINES = $(GLX_DEFINES) #endif SRCS = sis_driver.c sis_dac.c sis_cursor.c sis_accel.c sis_setup.c\ sis300_accel.c sis310_accel.c sis_vga.c sis_vb.c\ sis_opt.c sis_dga.c sis_video.c init.c init301.c sis_shadow.c \ - sis6326_video.c \ - $(DRISRCS) + sis6326_video.c $(DRISRCS) OBJS = sis_driver.o sis_dac.o sis_cursor.o sis_accel.o sis_setup.o\ sis300_accel.o sis310_accel.o sis_vga.o sis_vb.o\ sis_opt.o sis_dga.o sis_video.o init.o init301.o sis_shadow.o \ - sis6326_video.o \ - $(DRIOBJS) + sis6326_video.o $(DRIOBJS) #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa \ - -I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \ - -I$(XF86SRC)/xf24_32bpp \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ + -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c -I$(XF86SRC)/vbe \ -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(XTOP)/include/extensions \ - -I$(SERVERSRC)/render \ - -I$(XF86SRC)/shadowfb \ + -I$(SERVERSRC)/include -I$(SERVERSRC)/render -I$(XF86SRC)/shadowfb \ $(DRIINCLUDES) #endif Index: xc/programs/Xserver/hw/xfree86/drivers/sis/init.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/init.c:1.57 xc/programs/Xserver/hw/xfree86/drivers/sis/init.c:1.58 --- xc/programs/Xserver/hw/xfree86/drivers/sis/init.c:1.57 Tue Jun 29 06:17:45 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/init.c Tue Jun 28 21:14:11 2005 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init.c,v 1.57 2004/06/29 10:17:45 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init.c,v 1.58 2005/06/29 01:14:11 dawes Exp $ */ /* * Mode initializing code (CRT1 section) for * for SiS 300/305/540/630/730 and @@ -3494,7 +3493,7 @@ SiSRegInit(SiS_Pr, BaseAddr); SiS_GetSysFlags(SiS_Pr, HwInfo); -#if defined(LINUX_XF86) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(__AMD64__)) +#if defined(LINUX_XF86) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(__amd64__) || defined(__x86_64__)) if(pScrn) SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff); else #endif Index: xc/programs/Xserver/hw/xfree86/drivers/sis/init.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/init.h:1.52 xc/programs/Xserver/hw/xfree86/drivers/sis/init.h:1.53 --- xc/programs/Xserver/hw/xfree86/drivers/sis/init.h:1.52 Fri Feb 18 20:03:23 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/init.h Mon Jan 9 09:59:59 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init.h,v 1.52 2005/02/19 01:03:23 dawes Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init.h,v 1.53 2006/01/09 14:59:59 dawes Exp $ */ /* * Data and prototypes for init.c * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c:1.80 xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c:1.81 --- xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c:1.80 Fri Feb 18 20:03:23 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c Mon Jan 9 09:59:59 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c,v 1.80 2005/02/19 01:03:23 dawes Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c,v 1.81 2006/01/09 14:59:59 dawes Exp $ */ /* * Mode initializing code (CRT2 section) * for SiS 300/305/540/630/730 and Index: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h:1.48 xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h:1.49 --- xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h:1.48 Fri Feb 18 20:03:23 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h Mon Jan 9 10:00:00 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h,v 1.48 2005/02/19 01:03:23 dawes Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h,v 1.49 2006/01/09 15:00:00 dawes Exp $ */ /* * Data and prototypes for init301.c * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h:1.36 xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h:1.37 --- xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h:1.36 Tue Jun 29 06:17:45 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h Mon Jan 9 10:00:00 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h,v 1.36 2004/06/29 10:17:45 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h,v 1.37 2006/01/09 15:00:00 dawes Exp $ */ /* * Global definitions for init.c and init301.c * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/oem300.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/oem300.h:1.18 xc/programs/Xserver/hw/xfree86/drivers/sis/oem300.h:1.19 --- xc/programs/Xserver/hw/xfree86/drivers/sis/oem300.h:1.18 Fri Feb 18 20:03:23 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/oem300.h Mon Jan 9 10:00:00 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/oem300.h,v 1.18 2005/02/19 01:03:23 dawes Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/oem300.h,v 1.19 2006/01/09 15:00:00 dawes Exp $ */ /* * OEM Data for 300 series * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/oem310.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/oem310.h:1.27 xc/programs/Xserver/hw/xfree86/drivers/sis/oem310.h:1.28 --- xc/programs/Xserver/hw/xfree86/drivers/sis/oem310.h:1.27 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/oem310.h Mon Jan 9 10:00:01 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/oem310.h,v 1.27 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/oem310.h,v 1.28 2006/01/09 15:00:01 dawes Exp $ */ /* * OEM Data for 315/330 series * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/osdef.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/osdef.h:1.11 xc/programs/Xserver/hw/xfree86/drivers/sis/osdef.h:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/sis/osdef.h:1.11 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/osdef.h Mon Jan 9 10:00:01 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/osdef.h,v 1.11 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/osdef.h,v 1.12 2006/01/09 15:00:01 dawes Exp $ */ /* * OS depending defines * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h:1.118 xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h:1.121 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h:1.118 Fri Feb 18 20:03:23 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h Fri Oct 14 11:16:44 2005 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h,v 1.118 2005/02/19 01:03:23 dawes Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h,v 1.121 2005/10/14 15:16:44 tsi Exp $ */ /* * Main global data and definitions * @@ -124,7 +123,7 @@ #define NEED_REPLIES /* ? */ #define EXTENSION_PROC_ARGS void * #include "extnsionst.h" /* required */ -#include "panoramiXproto.h" /* required */ +#include <X11/extensions/panoramiXproto.h> /* required */ #endif #endif @@ -461,7 +460,7 @@ /* Used for makeing use of the BIOS scratch area (save/restore mode number) */ #undef SIS_USE_BIOS_SCRATCH -#if (defined(i386) || defined(__i386) || defined(__i386__) || defined(__AMD64__)) +#if (defined(i386) || defined(__i386) || defined(__i386__) || defined(__amd64__)) || defined(__x86_64__) #define SIS_USE_BIOS_SCRATCH #endif @@ -842,7 +841,6 @@ vbeInfoPtr pVbe; /* For VESA mode switching */ CARD16 vesamajor; CARD16 vesaminor; - VbeInfoBlock *vbeInfo; int UseVESA; sisModeInfoPtr SISVESAModeList; xf86MonPtr monitor; @@ -1035,12 +1033,6 @@ #endif } SISRec, *SISPtr; -typedef struct _ModeInfoData { - int mode; - VbeModeInfoBlock *data; - VbeCRTCInfoBlock *block; -} ModeInfoData; - #define SDMPTR(x) ((SiSMergedDisplayModePtr)(x->currentMode->Private)) #define CDMPTR ((SiSMergedDisplayModePtr)(pSiS->CurrentLayout.mode->Private)) Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis.man diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis.man:1.16 xc/programs/Xserver/hw/xfree86/drivers/sis/sis.man:1.17 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis.man:1.16 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis.man Mon Jan 9 10:00:01 2006 @@ -1,5 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis.man,v 1.16 2004/06/21 00:43:22 twini Exp $ -.\" $XdotOrg$ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis.man,v 1.17 2006/01/09 15:00:01 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' #ifdef __servername__ Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.c:1.31 xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.c:1.32 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.c:1.31 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.c Mon Jan 9 10:00:01 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.c,v 1.31 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.c,v 1.32 2006/01/09 15:00:01 dawes Exp $ */ /* * 2D Acceleration for SiS 530, 620, 300, 540, 630, 730. * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.h:1.22 xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.h:1.23 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.h:1.22 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.h Mon Jan 9 10:00:01 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.h,v 1.22 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.h,v 1.23 2006/01/09 15:00:01 dawes Exp $ */ /* * 2D Acceleration for SiS 530, 620, 300, 540, 630, 730. * Definitions for the SIS engine communication Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis310_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis310_accel.c:1.43 xc/programs/Xserver/hw/xfree86/drivers/sis/sis310_accel.c:1.44 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis310_accel.c:1.43 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis310_accel.c Mon Jan 9 10:00:01 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis310_accel.c,v 1.43 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis310_accel.c,v 1.44 2006/01/09 15:00:01 dawes Exp $ */ /* * 2D Acceleration for SiS 315 and 330 series * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis310_accel.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis310_accel.h:1.20 xc/programs/Xserver/hw/xfree86/drivers/sis/sis310_accel.h:1.21 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis310_accel.h:1.20 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis310_accel.h Mon Jan 9 10:00:02 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis310_accel.h,v 1.20 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis310_accel.h,v 1.21 2006/01/09 15:00:02 dawes Exp $ */ /* * 2D Acceleration for SiS 315 and Xabre series * Definitions for the SIS engine communication. Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis6326_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis6326_video.c:1.21 xc/programs/Xserver/hw/xfree86/drivers/sis/sis6326_video.c:1.23 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis6326_video.c:1.21 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis6326_video.c Mon Jan 9 10:00:02 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis6326_video.c,v 1.21 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis6326_video.c,v 1.23 2006/01/09 15:00:02 dawes Exp $ */ /* * Xv driver for SiS 5597/5598, 6236 and 530/620. * @@ -44,7 +43,7 @@ #include "regionstr.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "xaa.h" #include "dixstruct.h" #include "fourcc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_accel.c:1.39 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_accel.c:1.40 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_accel.c:1.39 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_accel.c Mon Jan 9 10:00:02 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_accel.c,v 1.39 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_accel.c,v 1.40 2006/01/09 15:00:02 dawes Exp $ */ /* * 2D acceleration for SiS5597/5598 and 6326 * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_accel.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_accel.h:1.13 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_accel.h:1.14 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_accel.h:1.13 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_accel.h Mon Jan 9 10:00:02 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_accel.h,v 1.13 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_accel.h,v 1.14 2006/01/09 15:00:02 dawes Exp $ */ /* * 2D acceleration for 5597/5598 and 6326 * Definitions for the SIS engine communication Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_common.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_common.h:1.4 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_common.h:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_common.h:1.4 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_common.h Mon Jan 9 10:00:02 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_common.h,v 1.4 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_common.h,v 1.5 2006/01/09 15:00:02 dawes Exp $ */ /* * Common header definitions for SiS 2D/3D/DRM suite * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c:1.30 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c:1.31 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c:1.30 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c Mon Jan 9 10:00:02 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c,v 1.30 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c,v 1.31 2006/01/09 15:00:02 dawes Exp $ */ /* * SiS hardware cursor handling * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.h:1.18 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.h:1.19 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.h:1.18 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.h Mon Jan 9 10:00:02 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.h,v 1.18 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.h,v 1.19 2006/01/09 15:00:02 dawes Exp $ */ /* * SiS hardware cursor handling * Definitions Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dac.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dac.c:1.64 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dac.c:1.65 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dac.c:1.64 Wed Jul 7 17:20:41 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dac.c Mon Jan 9 10:00:03 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dac.c,v 1.64 2004/07/07 21:20:41 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dac.c,v 1.65 2006/01/09 15:00:03 dawes Exp $ */ /* * DAC helper functions (Save/Restore, MemClk, etc) * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dac.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dac.h:1.21 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dac.h:1.22 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dac.h:1.21 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dac.h Mon Jan 9 10:00:03 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dac.h,v 1.21 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dac.h,v 1.22 2006/01/09 15:00:03 dawes Exp $ */ /* * DAC helper functions (Save/Restore, MemClk, etc) * Definitions and prototypes Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dga.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dga.c:1.16 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dga.c:1.17 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dga.c:1.16 Tue Dec 7 10:59:20 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dga.c Mon Jan 9 10:00:04 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dga.c,v 1.16 2004/12/07 15:59:20 tsi Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dga.c,v 1.17 2006/01/09 15:00:04 dawes Exp $ */ /* * SiS DGA handling * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c:1.47 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c:1.48 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c:1.47 Fri Dec 10 11:07:02 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c Mon Jan 9 10:00:04 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c,v 1.47 2004/12/10 16:07:02 alanh Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c,v 1.48 2006/01/09 15:00:04 dawes Exp $ */ /* * DRI wrapper for 300 and 315 series * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h:1.13 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h:1.14 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h:1.13 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h Mon Jan 9 10:00:04 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h,v 1.13 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h,v 1.14 2006/01/09 15:00:04 dawes Exp $ */ /* * SiS DRI wrapper * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c:1.197 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c:1.204 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c:1.197 Fri Feb 18 20:03:23 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c Thu Mar 16 11:50:14 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c,v 1.197 2005/02/19 01:03:23 dawes Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c,v 1.204 2006/03/16 16:50:14 dawes Exp $ */ /* * SiS driver main code * @@ -62,6 +61,11 @@ #include "xf86RAC.h" #include "shadowfb.h" #include "vbe.h" +#ifndef xf86LoadVBEModule +# define xf86LoadVBEModule(_pScrn) \ + xf86LoadSubModule(_pScrn, "vbe") +#endif + #include "sis_shadow.h" @@ -76,17 +80,15 @@ #include "sis_driver.h" #define _XF86DGA_SERVER_ -#include "extensions/xf86dgastr.h" +#include <X11/extensions/xf86dgastr.h> #include "globals.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> -#if (XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,99,0,0)) || (defined(XvExtension)) #include "xf86xv.h" -#include "Xv.h" -#endif +#include <X11/extensions/Xv.h> #ifdef XF86DRI #include "dri.h" @@ -324,20 +326,20 @@ XF86ModuleData sisModuleData = { &sisVersRec, sisSetup, NULL }; pointer -sisSetup(pointer module, pointer opts, int *errmaj, int *errmin) +sisSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; if(!setupDone) { setupDone = TRUE; xf86AddDriver(&SIS, module, 0); - LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, - shadowSymbols, ramdacSymbols, - vbeSymbols, int10Symbols, + LoaderModRefSymLists(module, vgahwSymbols, fbSymbols, xaaSymbols, + shadowSymbols, ramdacSymbols, + vbeSymbols, int10Symbols, #ifdef XF86DRI - drmSymbols, driSymbols, driRefSymbols, + drmSymbols, driSymbols, driRefSymbols, #endif - NULL); + NULL); return (pointer)TRUE; } @@ -2085,6 +2087,7 @@ return; } +#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,5,99,22,0) #ifdef PANORAMIX if(!noPanoramiXExtension) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -2093,6 +2096,14 @@ return; } #endif +#else + if(IsXineramaActive()) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Xinerama active, not initializing SiS Pseudo-Xinerama\n"); + SiSnoPanoramiXExtension = TRUE; + return; + } +#endif if(SiSnoPanoramiXExtension) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -2381,6 +2392,7 @@ vbeInfoPtr pVbe; VbeInfoBlock *vbe; + ModuleDescPtr pMod, pDDCMod; static const char *ddcsstr = "CRT%d DDC monitor info: ************************************\n"; static const char *ddcestr = "End of CRT%d DDC monitor info ******************************\n"; @@ -2402,9 +2414,10 @@ #endif if(flags & PROBE_DETECT) { - if(xf86LoadSubModule(pScrn, "vbe")) { + if((pMod = xf86LoadVBEModule(pScrn))) { int index = xf86GetEntityInfo(pScrn->entityList[0])->index; + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) if((pVbe = VBEInit(NULL,index))) { #else @@ -2437,12 +2450,12 @@ } /* Load the vgahw module */ - if(!xf86LoadSubModule(pScrn, "vgahw")) { + if(!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) { SISErrorLog(pScrn, "Could not load vgahw module\n"); return FALSE; } - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* Due to the liberal license terms this is needed for * keeping the copyright notice readable and intact in @@ -2580,8 +2593,8 @@ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing display adapter through int10\n"); #endif - if(xf86LoadSubModule(pScrn, "int10")) { - xf86LoaderReqSymLists(int10Symbols, NULL); + if((pMod = xf86LoadSubModule(pScrn, "int10"))) { + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); #if !defined(__alpha__) pSiS->pInt = xf86InitInt10(pSiS->pEnt->index); #endif @@ -2608,7 +2621,7 @@ pScrn->racIoFlags = RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT; /* The ramdac module should be loaded here when needed */ - if(!xf86LoadSubModule(pScrn, "ramdac")) { + if(!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { SISErrorLog(pScrn, "Could not load ramdac module\n"); #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->ErrorAfterFirst = TRUE; @@ -2618,7 +2631,7 @@ return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); /* Set pScrn->monitor */ pScrn->monitor = pScrn->confScreen->monitor; @@ -4931,9 +4944,9 @@ didddc2 = FALSE; if((pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA)) { - if(xf86LoadSubModule(pScrn, "ddc")) { + if((pDDCMod = xf86LoadSubModule(pScrn, "ddc"))) { int crtnum = 0; - xf86LoaderReqSymLists(ddcSymbols, NULL); + xf86LoaderModReqSymLists(pDDCMod, ddcSymbols, NULL); if((pMonitor = SiSDoPrivateDDC(pScrn, &crtnum))) { didddc2 = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, ddcsstr, crtnum); @@ -4960,17 +4973,16 @@ /* Now (re-)load and initialize the DDC module */ if(!didddc2) { - if(xf86LoadSubModule(pScrn, "ddc")) { - - xf86LoaderReqSymLists(ddcSymbols, NULL); + if((pDDCMod = xf86LoadSubModule(pScrn, "ddc"))) { + xf86LoaderModReqSymLists(pDDCMod, ddcSymbols, NULL); /* Now load and initialize VBE module. */ - if(xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols, NULL); + if((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) pSiS->pVbe = VBEInit(pSiS->pInt,pSiS->pEnt->index); #else - pSiS->pVbe = VBEExtendedInit(pSiS->pInt,pSiS->pEnt->index, + pSiS->pVbe = VBEExtendedInit(pSiS->pInt, pSiS->pEnt->index, SET_BIOS_SCRATCH | RESTORE_BIOS_SCRATCH); #endif if(!pSiS->pVbe) { @@ -4983,7 +4995,7 @@ } if(pSiS->pVbe) { - if((pMonitor = vbeDoEDID(pSiS->pVbe,NULL))) { + if((pMonitor = vbeDoEDID(pSiS->pVbe,pDDCMod))) { xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VBE CRT1 DDC monitor info:\n"); xf86SetDDCproperties(pScrn, xf86PrintEDID(pMonitor)); @@ -5702,7 +5714,7 @@ case 16: case 24: case 32: - if(!xf86LoadSubModule(pScrn, "fb")) { + if(!(pMod = xf86LoadSubModule(pScrn, "fb"))) { SISErrorLog(pScrn, "Failed to load fb module"); #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->ErrorAfterFirst = TRUE; @@ -5723,12 +5735,12 @@ SISFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); /* Load XAA if needed */ if(!pSiS->NoAccel) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Accel enabled\n"); - if(!xf86LoadSubModule(pScrn, "xaa")) { + if(!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { SISErrorLog(pScrn, "Could not load xaa module\n"); #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->ErrorAfterFirst = TRUE; @@ -5738,12 +5750,12 @@ SISFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } /* Load shadowfb if needed */ if(pSiS->ShadowFB) { - if(!xf86LoadSubModule(pScrn, "shadowfb")) { + if(!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { SISErrorLog(pScrn, "Could not load shadowfb module\n"); #ifdef SISDUALHEAD if(pSiSEnt) pSiSEnt->ErrorAfterFirst = TRUE; @@ -5753,17 +5765,17 @@ SISFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } /* Load the dri and glx modules if requested. */ #ifdef XF86DRI if(pSiS->loadDRI) { if(!xf86LoaderCheckSymbol("DRIScreenInit")) { - if(xf86LoadSubModule(pScrn, "dri")) { + if((pMod = xf86LoadSubModule(pScrn, "dri"))) { if(!xf86LoaderCheckSymbol("GlxSetVisualConfigs")) { if(xf86LoadSubModule(pScrn, "glx")) { - xf86LoaderReqSymLists(driSymbols, drmSymbols, NULL); + xf86LoaderModReqSymLists(pMod, driSymbols, drmSymbols, NULL); } else { SISErrorLog(pScrn, "Failed to load glx module\n"); } @@ -5779,8 +5791,8 @@ pSiS->UseVESA = 0; if(pSiS->VESA == 1) { if(!pSiS->pVbe) { - if(xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols, NULL); + if((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) pSiS->pVbe = VBEInit(pSiS->pInt,pSiS->pEnt->index); #else @@ -5793,12 +5805,11 @@ vbe = VBEGetVBEInfo(pSiS->pVbe); pSiS->vesamajor = (unsigned)(vbe->VESAVersion >> 8); pSiS->vesaminor = vbe->VESAVersion & 0xff; - pSiS->vbeInfo = vbe; if(pSiS->VESA == 1) { SiSBuildVesaModeList(pScrn, pSiS->pVbe, vbe); - VBEFreeVBEInfo(vbe); pSiS->UseVESA = 1; } + VBEFreeVBEInfo(vbe); } else { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Could not load and initialize VBE module.%s\n", @@ -5827,12 +5838,19 @@ pSiS->SiS_SD_Flags |= SiS_SD_ISDUALHEAD; if(pSiS->SecondHead) pSiS->SiS_SD_Flags |= SiS_SD_ISDHSECONDHEAD; else pSiS->SiS_SD_Flags &= ~(SiS_SD_SUPPORTXVGAMMA1); +#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,5,99,22,0) #ifdef PANORAMIX if(!noPanoramiXExtension) { pSiS->SiS_SD_Flags |= SiS_SD_ISDHXINERAMA; pSiS->SiS_SD_Flags &= ~(SiS_SD_SUPPORTXVGAMMA1); } #endif +#else + if(IsXineramaActive()) { + pSiS->SiS_SD_Flags |= SiS_SD_ISDHXINERAMA; + pSiS->SiS_SD_Flags &= ~(SiS_SD_SUPPORTXVGAMMA1); + } +#endif } #endif @@ -7162,6 +7180,7 @@ unsigned long OnScreenSize; int height, width, displayWidth; unsigned char *FBStart; + ModuleDescPtr pMod; #ifdef SISDUALHEAD SISEntPtr pSiSEnt = NULL; #endif @@ -7178,8 +7197,8 @@ #ifdef SISDUALHEAD if((!pSiS->DualHeadMode) || (!pSiS->SecondHead)) { #endif - if(xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols, NULL); + if((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0) pSiS->pVbe = VBEInit(NULL, pSiS->pEnt->index); #else @@ -7534,7 +7553,6 @@ pSiS->ResetXv = pSiS->ResetXvGamma = NULL; -#if (XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,99,0,0)) || (defined(XvExtension)) if(!pSiS->NoXvideo) { if( (pSiS->VGAEngine == SIS_300_VGA) || (pSiS->VGAEngine == SIS_315_VGA) ) { @@ -7591,7 +7609,6 @@ } } -#endif #ifdef XF86DRI if(pSiS->loadDRI) { Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.h:1.41 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.h:1.42 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.h:1.41 Fri Feb 18 20:03:23 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.h Mon Jan 9 10:00:06 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.h,v 1.41 2005/02/19 01:03:23 dawes Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.h,v 1.42 2006/01/09 15:00:06 dawes Exp $ */ /* * Global data and definitions * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c:1.60 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c:1.61 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c:1.60 Fri Feb 18 20:03:24 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c Mon Jan 9 10:00:06 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c,v 1.60 2005/02/19 01:03:24 dawes Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c,v 1.61 2006/01/09 15:00:06 dawes Exp $ */ /* * SiS driver option evaluation * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_regs.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_regs.h:1.30 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_regs.h:1.31 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_regs.h:1.30 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_regs.h Mon Jan 9 10:00:06 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_regs.h,v 1.30 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_regs.h,v 1.31 2006/01/09 15:00:06 dawes Exp $ */ /* * Register definitions for old and 300 series * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_setup.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_setup.c:1.32 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_setup.c:1.35 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_setup.c:1.32 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_setup.c Mon Jan 9 10:00:06 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_setup.c,v 1.32 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_setup.c,v 1.35 2006/01/09 15:00:06 dawes Exp $ */ /* * Basic hardware and memory detection * @@ -37,8 +36,6 @@ #include "xf86Pci.h" #include "xf86.h" #include "fb.h" -#include "xf1bpp.h" -#include "xf4bpp.h" #include "xf86_OSproc.h" #include "xf86Resources.h" #include "xf86_ansic.h" @@ -51,11 +48,11 @@ #include "sis_dac.h" #define _XF86DGA_SERVER_ -#include "extensions/xf86dgastr.h" +#include <X11/extensions/xf86dgastr.h> #include "globals.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> static const char *dramTypeStr[] = { "Fast Page DRAM", Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_shadow.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_shadow.c:1.11 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_shadow.c:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_shadow.c:1.11 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_shadow.c Mon Jan 9 10:00:06 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_shadow.c,v 1.11 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_shadow.c,v 1.12 2006/01/09 15:00:06 dawes Exp $ */ /* * Copyright (C) 1999-2004 by The XFree86 Project, Inc. * based on code written by Mark Vojkovich Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_shadow.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_shadow.h:1.9 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_shadow.h:1.10 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_shadow.h:1.9 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_shadow.h Mon Jan 9 10:00:07 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_shadow.h,v 1.9 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_shadow.h,v 1.10 2006/01/09 15:00:07 dawes Exp $ */ /* * Copyright (C) 1999-2004 by The XFree86 Project, Inc. * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.c:1.48 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.c:1.49 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.c:1.48 Wed Jul 7 17:20:41 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.c Mon Jan 9 10:00:07 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.c,v 1.48 2004/07/07 21:20:41 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.c,v 1.49 2006/01/09 15:00:07 dawes Exp $ */ /* * Video bridge detection and configuration for 300, 315 and 330 series * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.h:1.18 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.h:1.19 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.h:1.18 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.h Mon Jan 9 10:00:07 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.h,v 1.18 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.h,v 1.19 2006/01/09 15:00:07 dawes Exp $ */ /* * Video bridge detection and configuration for 300, 315 and 330 series * Data and prototypes Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vga.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vga.c:1.48 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vga.c:1.49 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vga.c:1.48 Fri Nov 26 08:45:04 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vga.c Mon Jan 9 10:00:07 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vga.c,v 1.48 2004/11/26 13:45:04 tsi Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vga.c,v 1.49 2006/01/09 15:00:07 dawes Exp $ */ /* * Mode setup and basic video bridge detection * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c:1.54 xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c:1.56 --- xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c:1.54 Tue Jun 29 06:17:46 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c Mon Jan 9 10:00:07 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c,v 1.54 2004/06/29 10:17:46 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c,v 1.56 2006/01/09 15:00:07 dawes Exp $ */ /* * Xv driver for SiS 300, 315 and 330 series. * @@ -104,7 +103,7 @@ #include "sis.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "xaa.h" #include "dixstruct.h" #include "fourcc.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sis/vgatypes.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/vgatypes.h:1.24 xc/programs/Xserver/hw/xfree86/drivers/sis/vgatypes.h:1.25 --- xc/programs/Xserver/hw/xfree86/drivers/sis/vgatypes.h:1.24 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/vgatypes.h Mon Jan 9 10:00:08 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/vgatypes.h,v 1.24 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/vgatypes.h,v 1.25 2006/01/09 15:00:08 dawes Exp $ */ /* * General type definitions for universal mode switching modules * Index: xc/programs/Xserver/hw/xfree86/drivers/sis/vstruct.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sis/vstruct.h:1.36 xc/programs/Xserver/hw/xfree86/drivers/sis/vstruct.h:1.37 --- xc/programs/Xserver/hw/xfree86/drivers/sis/vstruct.h:1.36 Sun Jun 20 20:43:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sis/vstruct.h Mon Jan 9 10:00:08 2006 @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/vstruct.h,v 1.36 2004/06/21 00:43:22 twini Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/vstruct.h,v 1.37 2006/01/09 15:00:08 dawes Exp $ */ /* * General structure definitions for universal mode switching modules * Index: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/sunbw2/Imakefile:1.4 xc/programs/Xserver/hw/xfree86/drivers/sunbw2/Imakefile:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/sunbw2/Imakefile:1.4 Mon May 31 20:17:02 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sunbw2/Imakefile Fri Oct 14 11:16:45 2005 @@ -1,7 +1,7 @@ XCOMM XCOMM This is an Imakefile for the bw2 driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/Imakefile,v 1.4 2004/06/01 00:17:02 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/Imakefile,v 1.5 2005/10/14 15:16:45 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -56,14 +56,12 @@ OBJS = bw2_driver.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ -I$(SERVERSRC)/Xext -I$(XF86SRC)/xf1bpp \ - -I$(XF86SRC)/ramdac \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) + -I$(XF86SRC)/ramdac -I$(SERVERSRC)/include #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2.h:1.1 xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2.h:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2.h:1.1 Fri Jun 30 13:15:13 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2.h Fri Oct 14 11:16:45 2005 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2.h,v 1.1 2000/06/30 17:15:13 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2.h,v 1.2 2005/10/14 15:16:45 tsi Exp $ */ #ifndef BW2_H #define BW2_H @@ -29,7 +29,7 @@ #include "xf86_OSproc.h" #include "xf86_ansic.h" #include "xf86RamDac.h" -#include "Xmd.h" +#include <X11/Xmd.h> #include "gcstruct.h" #include "xf86sbusBus.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c:1.7 xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c:1.7 Thu Feb 17 21:55:09 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c Thu Mar 16 11:50:15 2006 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c,v 1.7 2005/02/18 02:55:09 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c,v 1.8 2006/03/16 16:50:15 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -105,7 +105,7 @@ XF86ModuleData sunbw2ModuleData = { &sunbw2VersRec, bw2Setup, NULL }; static pointer -bw2Setup(pointer module, pointer opts, int *errmaj, int *errmin) +bw2Setup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; Index: xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile:1.5 xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile:1.5 Mon May 31 20:17:02 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile Fri Oct 14 11:16:46 2005 @@ -1,7 +1,7 @@ XCOMM XCOMM This is an Imakefile for the cg14 driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile,v 1.5 2004/06/01 00:17:02 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile,v 1.6 2005/10/14 15:16:46 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -56,14 +56,12 @@ OBJS = cg14_driver.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ - -I$(XF86SRC)/ramdac \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) + -I$(XF86SRC)/ramdac -I$(SERVERSRC)/include #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h diff -u xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h:1.3 Fri May 4 15:05:45 2001 +++ xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h Fri Oct 14 11:16:46 2005 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h,v 1.3 2001/05/04 19:05:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h,v 1.5 2005/10/14 15:16:46 tsi Exp $ */ #ifndef CG14_H #define CG14_H @@ -29,16 +29,11 @@ #include "xf86_OSproc.h" #include "xf86_ansic.h" #include "xf86RamDac.h" -#include "Xmd.h" +#include <X11/Xmd.h> #include "gcstruct.h" #include "xf86sbusBus.h" /* Various offsets in virtual (ie. mmap()) spaces Linux and Solaris support. */ -#define CG14_REGS_VOFF 0x00000000 /* registers */ -#define CG14_XLUT_VOFF 0x00003000 /* X Look Up Table */ -#define CG14_CLUT1_VOFF 0x00004000 /* Color Look Up Table */ -#define CG14_CLUT2_VOFF 0x00005000 /* Color Look Up Table */ -#define CG14_CLUT3_VOFF 0x00006000 /* Color Look Up Table */ #define CG14_DIRECT_VOFF 0x10000000 #define CG14_CTLREG_VOFF 0x20000000 #define CG14_CURSOR_VOFF 0x30000000 @@ -55,7 +50,6 @@ typedef struct { unsigned int *fb; unsigned char *x32; - unsigned char *xlut; int width; int height; sbusDevicePtr psdp; Index: xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c:1.11 xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c:1.13 --- xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c:1.11 Thu Feb 17 21:55:09 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c Thu Mar 16 11:50:15 2006 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c,v 1.11 2005/02/18 02:55:09 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c,v 1.13 2006/03/16 16:50:15 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -107,7 +107,7 @@ XF86ModuleData suncg14ModuleData = { &suncg14VersRec, cg14Setup, NULL }; static pointer -cg14Setup(pointer module, pointer opts, int *errmaj, int *errmin) +cg14Setup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -432,9 +432,8 @@ (psdp->width * psdp->height)); pCg14->x32 = xf86MapSbusMem(psdp, CG14_X32_VOFF, psdp->width * psdp->height); - pCg14->xlut = xf86MapSbusMem(psdp, CG14_XLUT_VOFF, 4096); - if (!pCg14->fb || !pCg14->x32 || !pCg14->xlut) { + if (!pCg14->fb || !pCg14->x32) { if (pCg14->fb) { xf86UnmapSbusMem(psdp, pCg14->fb, 4 * (psdp->width * psdp->height)); pCg14->fb = NULL; @@ -445,11 +444,6 @@ pCg14->x32 = NULL; } - if (pCg14->xlut) { - xf86UnmapSbusMem(psdp, pCg14->xlut, 4096); - pCg14->xlut = NULL; - } - return FALSE; } @@ -606,7 +600,6 @@ pScrn->vtSema = FALSE; xf86UnmapSbusMem(psdp, pCg14->fb, psdp->width * psdp->height * 4); xf86UnmapSbusMem(psdp, pCg14->x32, psdp->width * psdp->height); - xf86UnmapSbusMem(psdp, pCg14->xlut, 4096); pScreen->CloseScreen = pCg14->CloseScreen; return (*pScreen->CloseScreen)(scrnIndex, pScreen); @@ -662,7 +655,6 @@ ioctl(pCg14->psdp->fd, CG14_SET_PIXELMODE, &bpp); memset(pCg14->fb, 0, size * 4); memset(pCg14->x32, 0, size); - memset(pCg14->xlut, 0, 0x200); } /* Index: xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile:1.5 xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile:1.5 Mon May 31 20:17:02 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile Fri Oct 14 11:16:46 2005 @@ -1,7 +1,7 @@ XCOMM XCOMM This is an Imakefile for the cg3 driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile,v 1.5 2004/06/01 00:17:02 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile,v 1.6 2005/10/14 15:16:46 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -56,14 +56,12 @@ OBJS = cg3_driver.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ - -I$(XF86SRC)/ramdac \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) + -I$(XF86SRC)/ramdac -I$(SERVERSRC)/include #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3.h diff -u xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3.h:1.1 xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3.h:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3.h:1.1 Fri Jun 30 13:15:15 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3.h Fri Oct 14 11:16:46 2005 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3.h,v 1.1 2000/06/30 17:15:15 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3.h,v 1.2 2005/10/14 15:16:46 tsi Exp $ */ #ifndef CG3_H #define CG3_H @@ -29,7 +29,7 @@ #include "xf86_OSproc.h" #include "xf86_ansic.h" #include "xf86RamDac.h" -#include "Xmd.h" +#include <X11/Xmd.h> #include "gcstruct.h" #include "xf86sbusBus.h" Index: xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c:1.9 xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c:1.10 --- xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c:1.9 Thu Feb 17 21:55:09 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c Thu Mar 16 11:50:16 2006 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c,v 1.9 2005/02/18 02:55:09 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c,v 1.10 2006/03/16 16:50:16 dawes Exp $ */ #define PSZ 8 #include "xf86.h" @@ -106,7 +106,7 @@ XF86ModuleData suncg3ModuleData = { &suncg3VersRec, cg3Setup, NULL }; static pointer -cg3Setup(pointer module, pointer opts, int *errmaj, int *errmin) +cg3Setup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; Index: xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile:1.6 xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile:1.6 Mon May 31 20:17:02 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile Fri Oct 14 11:16:46 2005 @@ -1,7 +1,7 @@ XCOMM XCOMM This is an Imakefile for the cg6 driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile,v 1.6 2004/06/01 00:17:02 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile,v 1.8 2005/10/14 15:16:46 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -52,18 +52,17 @@ #define IHaveModules #include <Server.tmpl> -SRCS = cg6_driver.c cg6_cursor.c -OBJS = cg6_driver.o cg6_cursor.o +SRCS = cg6_driver.c cg6_cursor.c cg6_accel.c +OBJS = cg6_driver.o cg6_cursor.o cg6_accel.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ - -I$(XF86SRC)/ramdac \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ + -I$(XF86SRC)/ramdac -I$(XF86SRC)/xaa \ + -I$(SERVERSRC)/include #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h diff -u xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h:1.4 xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h:1.8 --- xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h:1.4 Sun Dec 5 18:06:37 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h Fri Oct 14 11:16:46 2005 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h,v 1.4 2004/12/05 23:06:37 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h,v 1.8 2005/10/14 15:16:46 tsi Exp $ */ #ifndef CG6_H #define CG6_H @@ -29,7 +29,8 @@ #include "xf86_OSproc.h" #include "xf86_ansic.h" #include "xf86RamDac.h" -#include "Xmd.h" +#include "xaa.h" +#include <X11/Xmd.h> #include "gcstruct.h" #include "cg6_regs.h" #include "xf86sbusBus.h" @@ -42,13 +43,12 @@ #define CG6_THC_VOFF 0x70005000 #define CG6_ROM_VOFF 0x70006000 #define CG6_RAM_VOFF 0x70016000 -#define CG6_DHC_VOFF 0x80000000 typedef struct { - unsigned int fg, bg; /* FG/BG colors for stipple */ - unsigned int patalign; /* X/Y alignment of bits */ - unsigned int alu; /* Transparent/Opaque + rop */ - unsigned int bits[32]; /* The stipple bits themselves */ + unsigned int fg, bg; /* FG/BG colors for stipple */ + unsigned int patalign; /* X/Y alignment of bits */ + unsigned int alu; /* Transparent/Opaque + rop */ + unsigned int bits[32]; /* The stipple bits themselves */ } Cg6StippleRec, *Cg6StipplePtr; typedef struct { @@ -63,15 +63,22 @@ int vclipmax; int width; int height; + int maxheight; + int vidmem; sbusDevicePtr psdp; Bool HWCursor; + Bool NoAccel; CloseScreenProcPtr CloseScreen; xf86CursorInfoPtr CursorInfoRec; unsigned int CursorXY; int CursorBg, CursorFg; Bool CursorEnabled; OptionInfoPtr Options; + unsigned char *buffers[1]; + CARD32 scanline[1024]; + int words_in_scanline, scan_x, scan_y, scan_xe; + XAAInfoRecPtr pXAA; } Cg6Rec, *Cg6Ptr; extern int Cg6ScreenPrivateIndex; @@ -89,10 +96,143 @@ #define Cg6GetWindowPrivate(w) \ ((Cg6StipplePtr) (w)->devPrivates[Cg6WindowPrivateIndex].ptr) -#define Cg6SetWindowPrivate(w,p) \ -((w)->devPrivates[Cg6WindowPrivateIndex].ptr = (pointer) p) +#define Cg6SetWindowPrivate(w,p) \ +((w)->devPrivates[Cg6WindowPrivateIndex].ptr = (pointer)(p)) -extern int cg6RopTable[]; extern Bool CG6HWCursorInit(ScreenPtr pScreen); +/* rasterops */ +#define GX_ROP_CLEAR 0x0 +#define GX_ROP_INVERT 0x1 +#define GX_ROP_NOOP 0x2 +#define GX_ROP_SET 0x3 + +#define GX_ROP_00_0(rop) ((rop) << 0) +#define GX_ROP_00_1(rop) ((rop) << 2) +#define GX_ROP_01_0(rop) ((rop) << 4) +#define GX_ROP_01_1(rop) ((rop) << 6) +#define GX_ROP_10_0(rop) ((rop) << 8) +#define GX_ROP_10_1(rop) ((rop) << 10) +#define GX_ROP_11_0(rop) ((rop) << 12) +#define GX_ROP_11_1(rop) ((rop) << 14) +#define GX_PLOT_PLOT 0x00000000 +#define GX_PLOT_UNPLOT 0x00020000 +#define GX_RAST_BOOL 0x00000000 +#define GX_RAST_LINEAR 0x00040000 +#define GX_ATTR_UNSUPP 0x00400000 +#define GX_ATTR_SUPP 0x00800000 +#define GX_POLYG_OVERLAP 0x01000000 +#define GX_POLYG_NONOVERLAP 0x02000000 +#define GX_PATTERN_ZEROS 0x04000000 +#define GX_PATTERN_ONES 0x08000000 +#define GX_PATTERN_MASK 0x0c000000 +#define GX_PIXEL_ZEROS 0x10000000 +#define GX_PIXEL_ONES 0x20000000 +#define GX_PIXEL_MASK 0x30000000 +#define GX_PLANE_ZEROS 0x40000000 +#define GX_PLANE_ONES 0x80000000 +#define GX_PLANE_MASK 0xc0000000 +/* rops for bit blit / copy area + with: + Plane Mask - use plane mask reg. + Pixel Mask - use all ones. + Patt Mask - use all ones. +*/ + +#define POLY_O GX_POLYG_OVERLAP +#define POLY_N GX_POLYG_NONOVERLAP + +#define ROP_STANDARD (GX_PLANE_MASK |\ + GX_PIXEL_ONES |\ + GX_ATTR_SUPP |\ + GX_RAST_BOOL |\ + GX_PLOT_PLOT) + +/* fg = don't care bg = don't care */ + +#define ROP_BLIT(O,I) (ROP_STANDARD | \ + GX_PATTERN_ONES |\ + GX_ROP_11_1(I) |\ + GX_ROP_11_0(O) |\ + GX_ROP_10_1(I) |\ + GX_ROP_10_0(O) |\ + GX_ROP_01_1(I) |\ + GX_ROP_01_0(O) |\ + GX_ROP_00_1(I) |\ + GX_ROP_00_0(O)) + +/* fg = fgPixel bg = don't care */ + +#define ROP_FILL(O,I) (ROP_STANDARD | \ + GX_PATTERN_ONES |\ + GX_ROP_11_1(I) |\ + GX_ROP_11_0(I) |\ + GX_ROP_10_1(I) |\ + GX_ROP_10_0(I) | \ + GX_ROP_01_1(O) |\ + GX_ROP_01_0(O) |\ + GX_ROP_00_1(O) |\ + GX_ROP_00_0(O)) + +/* fg = fgPixel bg = don't care */ + +#define ROP_STIP(O,I) (ROP_STANDARD |\ + GX_ROP_11_1(I) |\ + GX_ROP_11_0(GX_ROP_NOOP) |\ + GX_ROP_10_1(I) |\ + GX_ROP_10_0(GX_ROP_NOOP) | \ + GX_ROP_01_1(O) |\ + GX_ROP_01_0(GX_ROP_NOOP) |\ + GX_ROP_00_1(O) |\ + GX_ROP_00_0(GX_ROP_NOOP)) + +/* fg = fgPixel bg = bgPixel */ + +#define ROP_OSTP(O,I) (ROP_STANDARD |\ + GX_ROP_11_1(I) |\ + GX_ROP_11_0(I) |\ + GX_ROP_10_1(I) |\ + GX_ROP_10_0(O) |\ + GX_ROP_01_1(O) |\ + GX_ROP_01_0(I) |\ + GX_ROP_00_1(O) |\ + GX_ROP_00_0(O)) + +#define GX_ROP_USE_PIXELMASK 0x30000000 + +#define GX_BLT_INPROGRESS 0x20000000 + +#define GX_INPROGRESS 0x10000000 +#define GX_FULL 0x20000000 + +/* modes */ +#define GX_INDEX(n) ((n) << 4) +#define GX_INDEX_ALL 0x00000030 +#define GX_INDEX_MOD 0x00000040 +#define GX_BDISP_0 0x00000080 +#define GX_BDISP_1 0x00000100 +#define GX_BDISP_ALL 0x00000180 +#define GX_BREAD_0 0x00000200 +#define GX_BREAD_1 0x00000400 +#define GX_BREAD_ALL 0x00000600 +#define GX_BWRITE1_ENABLE 0x00000800 +#define GX_BWRITE1_DISABLE 0x00001000 +#define GX_BWRITE1_ALL 0x00001800 +#define GX_BWRITE0_ENABLE 0x00002000 +#define GX_BWRITE0_DISABLE 0x00004000 +#define GX_BWRITE0_ALL 0x00006000 +#define GX_DRAW_RENDER 0x00008000 +#define GX_DRAW_PICK 0x00010000 +#define GX_DRAW_ALL 0x00018000 +#define GX_MODE_COLOR8 0x00020000 +#define GX_MODE_COLOR1 0x00040000 +#define GX_MODE_HRMONO 0x00060000 +#define GX_MODE_ALL 0x00060000 +#define GX_VBLANK 0x00080000 +#define GX_BLIT_NOSRC 0x00100000 +#define GX_BLIT_SRC 0x00200000 +#define GX_BLIT_ALL 0x00300000 + +int CG6AccelInit(ScrnInfoPtr); + #endif /* CG6_H */ Index: xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_accel.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_accel.c:1.1 --- /dev/null Tue May 9 21:56:57 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_accel.c Sat Apr 30 13:04:00 2005 @@ -0,0 +1,403 @@ +/* + * Sun GX and Turbo GX acceleration support + * + * Copyright (C) 2005 Michael Lorenz + * + * 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 + * MICHAEL LORENZ 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. + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_accel.c,v 1.1 2005/04/30 17:04:00 tsi Exp $ */ + +#include "cg6.h" + + +static CARD32 Cg6BlitROP[] = { + ROP_BLIT(GX_ROP_CLEAR, GX_ROP_CLEAR), /* GXclear */ + ROP_BLIT(GX_ROP_CLEAR, GX_ROP_NOOP), /* GXand */ + ROP_BLIT(GX_ROP_CLEAR, GX_ROP_INVERT), /* GXandReverse */ + ROP_BLIT(GX_ROP_CLEAR, GX_ROP_SET), /* GXcopy */ + ROP_BLIT(GX_ROP_NOOP, GX_ROP_CLEAR), /* GXandInverted */ + ROP_BLIT(GX_ROP_NOOP, GX_ROP_NOOP), /* GXnoop */ + ROP_BLIT(GX_ROP_NOOP, GX_ROP_INVERT), /* GXxor */ + ROP_BLIT(GX_ROP_NOOP, GX_ROP_SET), /* GXor */ + ROP_BLIT(GX_ROP_INVERT, GX_ROP_CLEAR), /* GXnor */ + ROP_BLIT(GX_ROP_INVERT, GX_ROP_NOOP), /* GXequiv */ + ROP_BLIT(GX_ROP_INVERT, GX_ROP_INVERT), /* GXinvert */ + ROP_BLIT(GX_ROP_INVERT, GX_ROP_SET), /* GXorReverse */ + ROP_BLIT(GX_ROP_SET, GX_ROP_CLEAR), /* GXcopyInverted */ + ROP_BLIT(GX_ROP_SET, GX_ROP_NOOP), /* GXorInverted */ + ROP_BLIT(GX_ROP_SET, GX_ROP_INVERT), /* GXnand */ + ROP_BLIT(GX_ROP_SET, GX_ROP_SET), /* GXset */ +}; + +static CARD32 Cg6DrawROP[] = { + ROP_FILL(GX_ROP_CLEAR, GX_ROP_CLEAR), /* GXclear */ + ROP_FILL(GX_ROP_CLEAR, GX_ROP_NOOP), /* GXand */ + ROP_FILL(GX_ROP_CLEAR, GX_ROP_INVERT), /* GXandReverse */ + ROP_FILL(GX_ROP_CLEAR, GX_ROP_SET), /* GXcopy */ + ROP_FILL(GX_ROP_NOOP, GX_ROP_CLEAR), /* GXandInverted */ + ROP_FILL(GX_ROP_NOOP, GX_ROP_NOOP), /* GXnoop */ + ROP_FILL(GX_ROP_NOOP, GX_ROP_INVERT), /* GXxor */ + ROP_FILL(GX_ROP_NOOP, GX_ROP_SET), /* GXor */ + ROP_FILL(GX_ROP_INVERT, GX_ROP_CLEAR), /* GXnor */ + ROP_FILL(GX_ROP_INVERT, GX_ROP_NOOP), /* GXequiv */ + ROP_FILL(GX_ROP_INVERT, GX_ROP_INVERT), /* GXinvert */ + ROP_FILL(GX_ROP_INVERT, GX_ROP_SET), /* GXorReverse */ + ROP_FILL(GX_ROP_SET, GX_ROP_CLEAR), /* GXcopyInverted */ + ROP_FILL(GX_ROP_SET, GX_ROP_NOOP), /* GXorInverted */ + ROP_FILL(GX_ROP_SET, GX_ROP_INVERT), /* GXnand */ + ROP_FILL(GX_ROP_SET, GX_ROP_SET), /* GXset */ +}; + +static CARD32 Cg6StippleROP[16]={ + ROP_STIP(GX_ROP_CLEAR, GX_ROP_CLEAR), /* GXclear */ + ROP_STIP(GX_ROP_CLEAR, GX_ROP_NOOP), /* GXand */ + ROP_STIP(GX_ROP_CLEAR, GX_ROP_INVERT), /* GXandReverse */ + ROP_STIP(GX_ROP_CLEAR, GX_ROP_SET), /* GXcopy */ + ROP_STIP(GX_ROP_NOOP, GX_ROP_CLEAR), /* GXandInverted */ + ROP_STIP(GX_ROP_NOOP, GX_ROP_NOOP), /* GXnoop */ + ROP_STIP(GX_ROP_NOOP, GX_ROP_INVERT), /* GXxor */ + ROP_STIP(GX_ROP_NOOP, GX_ROP_SET), /* GXor */ + ROP_STIP(GX_ROP_INVERT, GX_ROP_CLEAR), /* GXnor */ + ROP_STIP(GX_ROP_INVERT, GX_ROP_NOOP), /* GXequiv */ + ROP_STIP(GX_ROP_INVERT, GX_ROP_INVERT), /* GXinvert */ + ROP_STIP(GX_ROP_INVERT, GX_ROP_SET), /* GXorReverse */ + ROP_STIP(GX_ROP_SET, GX_ROP_CLEAR), /* GXcopyInverted */ + ROP_STIP(GX_ROP_SET, GX_ROP_NOOP), /* GXorInverted */ + ROP_STIP(GX_ROP_SET, GX_ROP_INVERT), /* GXnand */ + ROP_STIP(GX_ROP_SET, GX_ROP_SET), /* GXset */ +}; + +static CARD32 Cg6OpaqueStippleROP[16]={ + ROP_OSTP(GX_ROP_CLEAR, GX_ROP_CLEAR), /* GXclear */ + ROP_OSTP(GX_ROP_CLEAR, GX_ROP_NOOP), /* GXand */ + ROP_OSTP(GX_ROP_CLEAR, GX_ROP_INVERT), /* GXandReverse */ + ROP_OSTP(GX_ROP_CLEAR, GX_ROP_SET), /* GXcopy */ + ROP_OSTP(GX_ROP_NOOP, GX_ROP_CLEAR), /* GXandInverted */ + ROP_OSTP(GX_ROP_NOOP, GX_ROP_NOOP), /* GXnoop */ + ROP_OSTP(GX_ROP_NOOP, GX_ROP_INVERT), /* GXxor */ + ROP_OSTP(GX_ROP_NOOP, GX_ROP_SET), /* GXor */ + ROP_OSTP(GX_ROP_INVERT, GX_ROP_CLEAR), /* GXnor */ + ROP_OSTP(GX_ROP_INVERT, GX_ROP_NOOP), /* GXequiv */ + ROP_OSTP(GX_ROP_INVERT, GX_ROP_INVERT), /* GXinvert */ + ROP_OSTP(GX_ROP_INVERT, GX_ROP_SET), /* GXorReverse */ + ROP_OSTP(GX_ROP_SET, GX_ROP_CLEAR), /* GXcopyInverted */ + ROP_OSTP(GX_ROP_SET, GX_ROP_NOOP), /* GXorInverted */ + ROP_OSTP(GX_ROP_SET, GX_ROP_INVERT), /* GXnand */ + ROP_OSTP(GX_ROP_SET, GX_ROP_SET), /* GXset */ +}; + +/* wait until the engine is idle */ +static void +Cg6Sync(ScrnInfoPtr pScrn) +{ + Cg6Ptr pCg6 = GET_CG6_FROM_SCRN(pScrn); + + while (pCg6->fbc->s & GX_INPROGRESS); +} + +/* wait until the blitter is idle */ +static void +Cg6SyncBlt(ScrnInfoPtr pScrn) +{ + Cg6Ptr pCg6 = GET_CG6_FROM_SCRN(pScrn); + + while (pCg6->fbc->blit & GX_BLT_INPROGRESS); +} + +/* wait until the blitter is idle */ +static void +Cg6SyncDraw(ScrnInfoPtr pScrn) +{ + Cg6Ptr pCg6 = GET_CG6_FROM_SCRN(pScrn); + + while (pCg6->fbc->draw & GX_FULL); +} + +static void +unClip(Cg6Ptr pCg6) +{ + pCg6->fbc->clipminx = 0; + pCg6->fbc->clipminy = 0; + pCg6->fbc->clipmaxx = pCg6->width - 1; + pCg6->fbc->clipmaxy = pCg6->maxheight - 1; +} + +static void +Cg6InitEngine(Cg6Ptr pCg6) +{ + unClip(pCg6); + pCg6->fbc->mode = GX_BLIT_SRC | GX_MODE_COLOR8 | GX_DRAW_RENDER | + GX_BWRITE0_ENABLE | GX_BWRITE1_DISABLE | GX_BREAD_0 | GX_BDISP_0; + + pCg6->fbc->fg = 0xff; + pCg6->fbc->bg = 0x00; + pCg6->fbc->pixelm = ~0; + pCg6->fbc->s = 0; + pCg6->fbc->clip = 0; + pCg6->fbc->offx = 0; + pCg6->fbc->offy = 0; +} + +static void +Cg6SetupForScreenToScreenCopy +( + ScrnInfoPtr pScrn, + int xdir, + int ydir, + int rop, + unsigned int planemask, + int TransparencyColour +) +{ + Cg6Ptr pCg6 = GET_CG6_FROM_SCRN(pScrn); + + Cg6Sync(pScrn); + unClip(pCg6); + pCg6->fbc->mode = GX_BLIT_SRC | GX_MODE_COLOR8 | GX_DRAW_RENDER | + GX_BWRITE0_ENABLE | GX_BWRITE1_DISABLE | GX_BREAD_0 | GX_BDISP_0; + + pCg6->fbc->incx = 0; + pCg6->fbc->incy = 0; + pCg6->fbc->fg = 0xff; + pCg6->fbc->bg = 0x00; + pCg6->fbc->pixelm = ~0; + pCg6->fbc->s = 0; + pCg6->fbc->alu = Cg6BlitROP[rop]; + pCg6->fbc->pm = planemask; + pCg6->fbc->clip = 0; +} + +static void +Cg6SubsequentScreenToScreenCopy +( + ScrnInfoPtr pScrn, + int xSrc, + int ySrc, + int xDst, + int yDst, + int w, + int h +) +{ + Cg6Ptr pCg6 = GET_CG6_FROM_SCRN(pScrn); + + pCg6->fbc->x0 = xSrc; + pCg6->fbc->y0 = ySrc; + pCg6->fbc->x1 = xSrc + w - 1; + pCg6->fbc->y1 = ySrc + h - 1; + pCg6->fbc->x2 = xDst; + pCg6->fbc->y2 = yDst; + pCg6->fbc->x3 = xDst + w - 1; + pCg6->fbc->y3 = yDst + h - 1; + Cg6SyncBlt(pScrn); +} + +static void +Cg6SetupForSolidFill +( + ScrnInfoPtr pScrn, + int colour, + int rop, + unsigned int planemask +) +{ + Cg6Ptr pCg6 = GET_CG6_FROM_SCRN(pScrn); + + Cg6Sync(pScrn); + unClip(pCg6); + pCg6->fbc->mode = GX_BLIT_SRC | GX_MODE_COLOR8 | GX_DRAW_RENDER | + GX_BWRITE0_ENABLE | GX_BWRITE1_DISABLE | GX_BREAD_0 | GX_BDISP_0; + + pCg6->fbc->incx = 0; + pCg6->fbc->incy = 0; + pCg6->fbc->fg = colour; + pCg6->fbc->bg = 0x00; + pCg6->fbc->pixelm = ~0; + pCg6->fbc->s = 0; + pCg6->fbc->alu = Cg6DrawROP[rop]; + pCg6->fbc->pm = planemask; + pCg6->fbc->clip = 0; +} + +static void +Cg6SubsequentSolidFillRect +( + ScrnInfoPtr pScrn, + int x, + int y, + int w, + int h +) +{ + Cg6Ptr pCg6 = GET_CG6_FROM_SCRN(pScrn); + + pCg6->fbc->arecty = y; + pCg6->fbc->arectx = x; + pCg6->fbc->arecty = y + h - 1; + pCg6->fbc->arectx = x + w - 1; + Cg6SyncDraw(pScrn); +} + +static void +Cg6SetupForCPUToScreenColorExpandFill +( + ScrnInfoPtr pScrn, + int fg, + int bg, + int rop, + unsigned int planemask +) +{ + Cg6Ptr pCg6 = GET_CG6_FROM_SCRN(pScrn); + + Cg6Sync(pScrn); + pCg6->fbc->mode = GX_BLIT_NOSRC | GX_MODE_COLOR1; + unClip(pCg6); + + if (bg == -1) { + pCg6->fbc->alu = Cg6StippleROP[rop] | GX_PATTERN_ONES; + pCg6->fbc->bg = 0xff; + } else { + pCg6->fbc->alu = Cg6OpaqueStippleROP[rop]|GX_PATTERN_ONES; + pCg6->fbc->bg = bg; + } + + pCg6->fbc->fg = fg; + pCg6->fbc->incx = 32; + pCg6->fbc->incy = 0; + pCg6->fbc->pixelm = ~0; + pCg6->fbc->s = 0; + pCg6->fbc->pm = planemask; + pCg6->fbc->clip = 0; +} + +#if 0 +static void +Cg6SubsequentCPUToScreenColorExpandFill +( + ScrnInfoPtr pScrn, + int x, + int y, + int w, + int h, + int skipleft +) +{ + Cg6Ptr pCg6 = GET_CG6_FROM_SCRN(pScrn); + + pCg6->fbc->x0 = x; + pCg6->fbc->x1 = x + w - 1; + pCg6->fbc->y0 = y; + pCg6->fbc->patalign = (skipleft & 0xffff) << 16; +} +#endif + +static void +Cg6SubsequentScanlineCPUToScreenColorExpandFill +( + ScrnInfoPtr pScrn, + int x, + int y, + int w, + int h, + int skipleft +) +{ + Cg6Ptr pCg6 = GET_CG6_FROM_SCRN(pScrn); + + pCg6->scan_x = x; + pCg6->scan_xe = x + w - 1; + pCg6->scan_y = y; + pCg6->fbc->patalign = (skipleft & 0xffff) << 16; + pCg6->fbc->clipminx = x; + pCg6->fbc->clipmaxx = x + w - 1; + pCg6->words_in_scanline = (w + 31) >> 5; +} + +static void +Cg6SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno) +{ + Cg6Ptr pCg6 = GET_CG6_FROM_SCRN(pScrn); + int i; + + /* + * The GX is WEIRD. If we tell it to draw in pixels it will fill the entire + * line with whatever we feed into the font register. When we write the + * next word it draws the entire line AGAIN. So we turn on clipping and + * pretend to write only 32 pixels... + */ + pCg6->fbc->x0 = pCg6->scan_x; + pCg6->fbc->x1 = pCg6->scan_x + 31; + pCg6->fbc->y0 = pCg6->scan_y; + + for (i = 0; i < pCg6->words_in_scanline; i++) { + pCg6->fbc->font = pCg6->scanline[i]; + } + + pCg6->scan_y++; + Cg6Sync(pScrn); +} + +int +CG6AccelInit(ScrnInfoPtr pScrn) +{ + Cg6Ptr pCg6 = GET_CG6_FROM_SCRN(pScrn); + XAAInfoRecPtr pXAAInfo = pCg6->pXAA; + + pXAAInfo->Flags = LINEAR_FRAMEBUFFER | PIXMAP_CACHE | OFFSCREEN_PIXMAPS; + pXAAInfo->maxOffPixWidth = pCg6->width; + pXAAInfo->maxOffPixHeight = pCg6->maxheight; + + Cg6InitEngine(pCg6); + + /* Sync */ + pXAAInfo->Sync = Cg6Sync; + /* Screen-to-screen copy */ + pXAAInfo->ScreenToScreenCopyFlags=NO_TRANSPARENCY; + pXAAInfo->SetupForScreenToScreenCopy = Cg6SetupForScreenToScreenCopy; + pXAAInfo->SubsequentScreenToScreenCopy = + Cg6SubsequentScreenToScreenCopy; + + /* Solid fills */ + pXAAInfo->SetupForSolidFill = Cg6SetupForSolidFill; + pXAAInfo->SubsequentSolidFillRect = Cg6SubsequentSolidFillRect; + + /* colour expansion */ +#if 0 + pXAAInfo->CPUToScreenColorExpandFillFlags = SCANLINE_PAD_DWORD | + CPU_TRANSFER_BASE_FIXED /* | LEFT_EDGE_CLIPPING */; + pXAAInfo->ColorExpandBase = (unsigned char *)&pCg6->fbc->font; + pXAAInfo->SetupForCPUToScreenColorExpandFill = + Cg6SetupForCPUToScreenColorExpandFill; + pXAAInfo->SubsequentCPUToScreenColorExpandFill = + Cg6SubsequentCPUToScreenColorExpandFill; +#else + pXAAInfo->ScanlineCPUToScreenColorExpandFillFlags = + LEFT_EDGE_CLIPPING | SCANLINE_PAD_DWORD; + pXAAInfo->NumScanlineColorExpandBuffers = 1; + pCg6->buffers[0] = (unsigned char *)pCg6->scanline; + pXAAInfo->ScanlineColorExpandBuffers = pCg6->buffers; + pXAAInfo->SetupForScanlineCPUToScreenColorExpandFill = + Cg6SetupForCPUToScreenColorExpandFill; + pXAAInfo->SubsequentScanlineCPUToScreenColorExpandFill = + Cg6SubsequentScanlineCPUToScreenColorExpandFill; + pXAAInfo->SubsequentColorExpandScanline = + Cg6SubsequentColorExpandScanline; +#endif + return 0; +} Index: xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c:1.12 xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c:1.15 --- xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c:1.12 Thu Feb 17 21:55:09 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c Thu Mar 16 11:50:16 2006 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c,v 1.12 2005/02/18 02:55:09 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c,v 1.15 2006/03/16 16:50:16 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -89,9 +89,33 @@ static const OptionInfoRec CG6Options[] = { { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; +static const char *fbSymbols[] = +{ + "fbPictureInit", + "fbScreenInit", + NULL +}; + +static const char *ramdacSymbols[] = +{ + "xf86CreateCursorInfoRec", + "xf86DestroyCursorInfoRec", + "xf86InitCursor", + NULL +}; + +static const char *xaaSymbols[] = +{ + "XAACreateInfoRec", + "XAADestroyInfoRec", + "XAAInit", + NULL +}; + #ifdef XFree86LOADER static MODULESETUPPROTO(cg6Setup); @@ -113,7 +137,7 @@ XF86ModuleData suncg6ModuleData = { &suncg6VersRec, cg6Setup, NULL }; static pointer -cg6Setup(pointer module, pointer opts, int *errmaj, int *errmin) +cg6Setup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -125,6 +149,8 @@ * Modules that this driver always requires can be loaded here * by calling LoadSubModule(). */ + xf86LoaderModRefSymLists(module, fbSymbols, ramdacSymbols, + xaaSymbols, NULL); /* * The return value must be non-NULL on success even though there @@ -282,6 +308,7 @@ sbusDevicePtr psdp; MessageType from; int i; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) return FALSE; @@ -381,15 +408,32 @@ xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pCg6->HWCursor ? "HW" : "SW"); - if (xf86LoadSubModule(pScrn, "fb") == NULL) { - CG6FreeRec(pScrn); - return FALSE; + if (xf86ReturnOptValBool(pCg6->Options, OPTION_NOACCEL, FALSE)) { + pCg6->NoAccel = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } - if (pCg6->HWCursor && xf86LoadSubModule(pScrn, "ramdac") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { CG6FreeRec(pScrn); return FALSE; } + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); + + if (pCg6->HWCursor) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { + CG6FreeRec(pScrn); + return FALSE; + } + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); + } + + if (!pCg6->NoAccel) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { + CG6FreeRec(pScrn); + return FALSE; + } + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); + } /********************* set up clock and mode stuff @@ -424,16 +468,37 @@ ScrnInfoPtr pScrn; Cg6Ptr pCg6; sbusDevicePtr psdp; - int ret; + int ret, vidmem; pScrn = xf86Screens[pScreen->myNum]; pCg6 = GET_CG6_FROM_SCRN(pScrn); psdp = pCg6->psdp; + vidmem = psdp->width * psdp->height; /* Map CG6 memory areas */ pCg6->fbc = xf86MapSbusMem(psdp, CG6_FBC_VOFF, sizeof(*pCg6->fbc)); pCg6->thc = xf86MapSbusMem(psdp, CG6_THC_VOFF, sizeof(*pCg6->thc)); - pCg6->fb = xf86MapSbusMem(psdp, CG6_RAM_VOFF, psdp->width * psdp->height); + + do { + if (!pCg6->NoAccel) { + /* + * To allow for off-screen pixmaps, first try mapping 2MB, then + * 1MB, followed by the minimum required. + */ + pCg6->vidmem = max(2 * 1024 * 1024, vidmem); + pCg6->fb = xf86MapSbusMem(psdp, CG6_RAM_VOFF, pCg6->vidmem); + if (pCg6->fb || (pCg6->vidmem == vidmem)) + break; + + pCg6->vidmem = max(1024 * 1024, vidmem); + pCg6->fb = xf86MapSbusMem(psdp, CG6_RAM_VOFF, pCg6->vidmem); + if (pCg6->fb || (pCg6->vidmem == vidmem)) + break; + } + + pCg6->vidmem = vidmem; + pCg6->fb = xf86MapSbusMem(psdp, CG6_RAM_VOFF, pCg6->vidmem); + } while (0); if (!pCg6->fbc || !pCg6->thc || !pCg6->fb) { if (pCg6->fbc) { @@ -447,13 +512,16 @@ } if (pCg6->fb) { - xf86UnmapSbusMem(psdp, pCg6->fb, psdp->width * psdp->height); + xf86UnmapSbusMem(psdp, pCg6->fb, pCg6->vidmem); pCg6->fb = NULL; } return FALSE; } + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Mapped %d KB of video memory\n", + pCg6->vidmem >> 10); + /* Darken the screen for aesthetic reasons and set the viewport */ CG6SaveScreen(pScreen, SCREEN_SAVER_ON); @@ -493,6 +561,10 @@ if (!ret) return FALSE; + pCg6->width = pScrn->virtualX; + pCg6->height = pScrn->virtualY; + pCg6->maxheight = (pCg6->vidmem / pCg6->width) & 0xffff; + fbPictureInit(pScreen, 0, 0); miInitializeBackingStore(pScreen); @@ -501,6 +573,21 @@ xf86SetBlackWhitePixels(pScreen); + if (!pCg6->NoAccel) { + BoxRec bx; + + pCg6->pXAA = XAACreateInfoRec(); + CG6AccelInit(pScrn); + bx.x1 = bx.y1 = 0; + bx.x2 = pCg6->width; + bx.y2 = pCg6->maxheight; + xf86InitFBManager(pScreen, &bx); + if(!XAAInit(pScreen, pCg6->pXAA)) + return FALSE; + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using acceleration\n"); + } + /* Initialise cursor functions */ miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); @@ -604,19 +691,31 @@ ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; Cg6Ptr pCg6 = GET_CG6_FROM_SCRN(pScrn); sbusDevicePtr psdp = pCg6->psdp; + Bool closed; pScrn->vtSema = FALSE; - xf86UnmapSbusMem(psdp, pCg6->fbc, sizeof(*pCg6->fbc)); - xf86UnmapSbusMem(psdp, pCg6->thc, sizeof(*pCg6->thc)); - xf86UnmapSbusMem(psdp, pCg6->fb, psdp->width * psdp->height); - if (pCg6->HWCursor) xf86SbusHideOsHwCursor(psdp); + if (pCg6->pXAA) { + XAADestroyInfoRec(pCg6->pXAA); + pCg6->pXAA = NULL; + } + pScreen->CloseScreen = pCg6->CloseScreen; - return (*pScreen->CloseScreen)(scrnIndex, pScreen); - return FALSE; + closed = (*pScreen->CloseScreen)(scrnIndex, pScreen); + + if (pCg6->CursorInfoRec) { + xf86DestroyCursorInfoRec(pCg6->CursorInfoRec); + pCg6->CursorInfoRec = NULL; + } + + xf86UnmapSbusMem(psdp, pCg6->fbc, sizeof(*pCg6->fbc)); + xf86UnmapSbusMem(psdp, pCg6->thc, sizeof(*pCg6->thc)); + xf86UnmapSbusMem(psdp, pCg6->fb, pCg6->vidmem); + + return closed; } Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/Imakefile:1.13 xc/programs/Xserver/hw/xfree86/drivers/sunffb/Imakefile:1.17 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/Imakefile:1.13 Mon Feb 28 22:48:53 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/Imakefile Sat Jan 28 19:57:55 2006 @@ -1,9 +1,9 @@ XCOMM XCOMM This is an Imakefile for the ffb driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/Imakefile,v 1.13 2005/03/01 03:48:53 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/Imakefile,v 1.17 2006/01/29 00:57:55 tsi Exp $ /* - * Copyright (c) 1994-2004 by The XFree86 Project, Inc. + * Copyright (c) 1994-2006 by The XFree86 Project, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -55,12 +55,11 @@ #if BuildXF86DRI DRISRCS = ffb_dri.c DRIOBJS = ffb_dri.o -DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri -I$(TOP)/include \ - -I$(DRMINCLUDESDIR) +DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri -I$(DRMINCLUDESDIR) DRIDEFINES = $(GLX_DEFINES) #endif -#if defined(AsVISOption) +#if defined(AsVISOption) && defined(UseElfFormat) VISOBJS = VISmoveImage.o ffb_asm.o VISOPTIONS = -DUSE_VIS ASVISOPTION = AsVISOption @@ -68,7 +67,7 @@ #if AsOutputArchSize == 32 #define FFBCObjectRule(name) @@\ name.o: name.c @@\ - ObjectCompile(-mv8 -mtune=ultrasparc \ + ObjectCompile(-mcpu=v8 -mtune=ultrasparc \ $(GCCVISOPTION) $(VISOPTIONS) $(DRIDEFINES)) @@\ dd if=/dev/zero bs=1 count=3 2>/dev/null | \ dd of=$@ bs=1 count=3 seek=36 conv=notrunc 2>/dev/null @@\ @@ -77,10 +76,10 @@ dd of=$@ bs=1 count=1 seek=19 conv=notrunc 2>/dev/null @@\ @@\ name.i: name.c @@\ - CPPOnlyCompile(name.c,-mv8 \ + CPPOnlyCompile(name.c,-mcpu=v8 \ $(GCCVISOPTION) $(VISOPTIONS) $(DRIDEFINES)) @@\ @@\ -CenterLoadTarget(debug_src,name.c,NullParameter,$(ALLDEFINES) -mv8 \ +CenterLoadTarget(debug_src,name.c,NullParameter,$(ALLDEFINES) -mcpu=v8 \ $(GCCVISOPTION) $(VISOPTIONS) $(DRIDEFINES)) #define FFBsObjectRule(name) @@\ name.o: name.s @@\ @@ -119,18 +118,17 @@ $(DRIOBJS) #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/Xext -I$(SERVERSRC)/cfb \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/cfb \ -I$(SERVERSRC)/dbe \ -I$(XF86SRC)/xf8_32wid \ -I$(XF86SRC)/ramdac \ -I$(XF86SRC)/ddc \ -I$(XF86SRC)/i2c \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) \ + -I$(SERVERSRC)/include \ $(DRIINCLUDES) #endif @@ -138,11 +136,31 @@ SubdirLibraryRule($(OBJS)) #endif +/* + * The following should match the definitions in hw/xfree86/loader/os.c. Add + * to this as necessary. + */ +#if defined(LinuxArchitecture) +OSDIR = linux +#elif defined(SunArchitecture) +OSDIR = sunos +#elif defined(NetBSDArchitecture) +OSDIR = netbsd +#elif defined(FreeBSDArchitecture) +OSDIR = freebsd +#elif defined(OpenBSDArchitecture) +OSDIR = openbsd +#elif defined(GNUMachArchitecture) +OSDIR = hurd +#else +OSDIR = svr4 +#endif + ModuleObjectRule() -ObjectModuleTarget(sunffb,$(OBJS),drivers) +ObjectModuleTarget(sunffb,$(OBJS),drivers/$(OSDIR)) -InstallObjectModule(sunffb,$(MODULEDIR),drivers) +InstallObjectModule(sunffb,$(MODULEDIR),drivers/$(OSDIR)) #if !defined(XF86DriverSDK) InstallModuleManPage(sunffb) @@ -180,3 +198,24 @@ #endif DependTarget() + +#if DoLoadableServer +/* Remove instances of this module at its old location */ + +#undef SunFfbDriverModuleName +#if MakeDllModules +# define SunFfbDriverModuleName drivers/sunffb_drv.so +#else +# define SunFfbDriverModuleName drivers/sunffb_drv.o +#endif + +all:: + RemoveFile($(BUILDMODULEDIR)/SunFfbDriverModuleName) + +install:: + RemoveFile($(DESTDIR)$(MODULEDIR)/SunFfbDriverModuleName) + +install.sdk:: + RemoveFile($(DESTDIR)$(DRIVERSDKMODULEDIR)/SunFfbDriverModuleName) + +#endif Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/VISmoveImage.s diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/VISmoveImage.s:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunffb/VISmoveImage.s:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/VISmoveImage.s:1.2 Tue May 23 00:47:43 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/VISmoveImage.s Fri Sep 23 01:07:50 2005 @@ -21,7 +21,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/VISmoveImage.s,v 1.2 2000/05/23 04:47:43 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/VISmoveImage.s,v 1.3 2005/09/23 05:07:50 tsi Exp $ */ /* NOTE NOTE NOTE: All loads in these routines _MUST_ be 64-byte block @@ -77,6 +77,10 @@ */ #if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__) + + .register %g2, #scratch + .register %g3, #scratch + #define SMUL mulx #define ICC xcc #else @@ -178,7 +182,7 @@ .globl VISmoveImageLR .align 32 VISmoveImageLR: - save %sp, -160, %sp ! Group 0 + save %sp, -192, %sp ! Group 0 0: rd %pc, %tmp3 ! Group 1 sub %src, %dst, %mode ! Group 7 brz,pn %h, return @@ -779,7 +783,11 @@ sub %tmp3, %rightw, %curw return: return %i7+8 +#ifdef __NetBSD__ + wr %g0, 4, %fprs +#else wr %g0, 0, %fprs +#endif narrowst: and %leftw, 0x38, %tmp1 @@ -1142,7 +1150,7 @@ .globl VISmoveImageRL .align 32 VISmoveImageRL: - save %sp, -160, %sp ! Group 0 + save %sp, -192, %sp ! Group 0 0: rd %pc, %tmp3 ! Group 1 and %dst, 63, %leftw ! Group 7 mov 64, %tmp1 @@ -2174,7 +2182,11 @@ sub %curw, %rightw, %curw rreturn:return %i7+8 +#ifdef __NetBSD__ + wr %g0, 4, %fprs +#else wr %g0, 0, %fprs +#endif narrowstr: cmp %rightw, 64 Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h:1.11 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h:1.14 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h:1.11 Sun Dec 5 18:06:37 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h Fri Oct 14 11:16:46 2005 @@ -24,7 +24,7 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h,v 1.11 2004/12/05 23:06:37 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h,v 1.14 2005/10/14 15:16:46 tsi Exp $ */ #ifndef FFB_H #define FFB_H @@ -33,7 +33,7 @@ #include "xf86_OSproc.h" #include "xf86_ansic.h" #include "xf86RamDac.h" -#include "Xmd.h" +#include <X11/Xmd.h> #include "gcstruct.h" #include "windowstr.h" #include "ffb_regs.h" @@ -46,40 +46,29 @@ #ifndef DPMS_SERVER #define DPMS_SERVER #endif /* DPMS_SERVER */ -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> /* Various offsets in virtual (ie. mmap()) spaces Linux and Solaris support. */ -/* Note: do not mmap FFB_DFB8R_VOFF and following mappings using one mmap together - with any previous SFB mapping, otherwise the OS won't be able to use 4M pages - for the DFB mappings. -jj */ -#define FFB_SFB8R_VOFF 0x00000000 -#define FFB_SFB8G_VOFF 0x00400000 -#define FFB_SFB8B_VOFF 0x00800000 -#define FFB_SFB8X_VOFF 0x00c00000 -#define FFB_SFB32_VOFF 0x01000000 -#define FFB_SFB64_VOFF 0x02000000 -#define FFB_FBC_REGS_VOFF 0x04000000 -#define FFB_BM_FBC_REGS_VOFF 0x04002000 -#define FFB_DFB8R_VOFF 0x04004000 -#define FFB_DFB8G_VOFF 0x04404000 -#define FFB_DFB8B_VOFF 0x04804000 -#define FFB_DFB8X_VOFF 0x04c04000 -#define FFB_DFB24_VOFF 0x05004000 -#define FFB_DFB32_VOFF 0x06004000 -#define FFB_DFB422A_VOFF 0x07004000 /* DFB 422 mode write to A */ -#define FFB_DFB422AD_VOFF 0x07804000 /* DFB 422 mode with line doubling */ -#define FFB_DFB24B_VOFF 0x08004000 /* DFB 24bit mode write to B */ -#define FFB_DFB422B_VOFF 0x09004000 /* DFB 422 mode write to B */ -#define FFB_DFB422BD_VOFF 0x09804000 /* DFB 422 mode with line doubling */ -#define FFB_SFB16Z_VOFF 0x0a004000 /* 16bit mode Z planes */ -#define FFB_SFB8Z_VOFF 0x0a404000 /* 8bit mode Z planes */ -#define FFB_SFB422_VOFF 0x0ac04000 /* SFB 422 mode write to A/B */ -#define FFB_SFB422D_VOFF 0x0b404000 /* SFB 422 mode with line doubling */ -#define FFB_FBC_KREGS_VOFF 0x0bc04000 -#define FFB_DAC_VOFF 0x0bc06000 -#define FFB_PROM_VOFF 0x0bc08000 -#define FFB_EXP_VOFF 0x0bc18000 +/* + * Note: do not mmap FFB_DFB8R_VOFF and following mappings using one mmap + * together with any previous SFB mapping, otherwise the OS won't be able to + * use 4M pages for the DFB mappings. -jj + */ +#define FFB_SFB8R_VOFF 0x00000000 +#define FFB_SFB8X_VOFF 0x00c00000 +#define FFB_SFB32_VOFF 0x01000000 +#define FFB_FBC_REGS_VOFF 0x04000000 +#define FFB_DFB8R_VOFF 0x04004000 +#define FFB_DFB8X_VOFF 0x04c04000 +#define FFB_DFB24_VOFF 0x05004000 +#ifdef sun +# define FFB_DAC_VOFF 0x07018000 +# define FFB_EXP_VOFF 0x07006000 +#else +# define FFB_DAC_VOFF 0x0bc06000 +# define FFB_EXP_VOFF 0x0bc18000 +#endif #if defined(__GNUC__) && defined(USE_VIS) #define FFB_ALIGN64 __attribute__((aligned(8))) @@ -241,7 +230,7 @@ extern void FFBDacFini(FFBPtr); extern void FFBDacEnterVT(FFBPtr); extern void FFBDacLeaveVT(FFBPtr); -extern Bool FFBDacSaveScreen(FFBPtr, int); +extern Bool FFBDacSaveScreen(ScrnInfoPtr, int); extern void FFBDacDPMSMode(FFBPtr, int, int); /* Exported WID layer routines. */ Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_accel.c:1.10 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_accel.c:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_accel.c:1.10 Sun Dec 5 18:06:37 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_accel.c Fri Oct 14 11:16:46 2005 @@ -24,13 +24,13 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_accel.c,v 1.10 2004/12/05 23:06:37 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_accel.c,v 1.11 2005/10/14 15:16:46 tsi Exp $ */ #include "scrnintstr.h" #include "pixmapstr.h" #include "regionstr.h" #include "mistruct.h" -#include "fontstruct.h" +#include <X11/fonts/fontstruct.h> #include "dixfontstr.h" #define PSZ 8 #include "cfb.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_asm.s diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_asm.s:1.1 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_asm.s:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_asm.s:1.1 Thu May 18 19:21:35 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_asm.s Fri Sep 23 01:07:50 2005 @@ -22,7 +22,7 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_asm.s,v 1.1 2000/05/18 23:21:35 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_asm.s,v 1.2 2005/09/23 05:07:50 tsi Exp $ */ /* Hardware register offsets */ #define FFB_BY 0x0060 @@ -54,6 +54,11 @@ #define SEG_X2 0x04 #define SEG_Y2 0x06 +#if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__) + .register %g2, #scratch + .register %g3, #scratch +#endif + .text .align 32 Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_bcopy.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_bcopy.c:1.4 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_bcopy.c:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_bcopy.c:1.4 Sun Dec 5 18:06:37 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_bcopy.c Wed Mar 1 16:01:56 2006 @@ -22,13 +22,14 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_bcopy.c,v 1.4 2004/12/05 23:06:37 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_bcopy.c,v 1.5 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" #include "ffb_rcache.h" #include "ffb_fifo.h" #include "ffb_loops.h" +#include "ffb_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" @@ -518,12 +519,12 @@ ret = cfbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, - (void (*)())CreatorDoVertBitblt, 0); + CreatorDoVertBitblt, 0); else ret = cfb32BitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, - (void (*)())CreatorDoVertBitblt, 0); + CreatorDoVertBitblt, 0); FFBLOG(("CreatorCopyArea: Done, returning %p\n", ret)); return ret; } @@ -547,11 +548,11 @@ if (pSrcDrawable->bitsPerPixel == 8) ret = cfbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, - dstx, dsty, (void (*)())CreatorDoBitblt, 0); + dstx, dsty, CreatorDoBitblt, 0); else ret = cfb32BitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, - dstx, dsty, (void (*)())CreatorDoBitblt, 0); + dstx, dsty, CreatorDoBitblt, 0); FFBLOG(("CreatorCopyArea: Done, returning %p\n", ret)); return ret; Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_checks.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_checks.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_checks.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_checks.c:1.3 Sun Dec 5 18:06:37 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_checks.c Wed Mar 1 16:01:56 2006 @@ -23,12 +23,13 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_checks.c,v 1.3 2004/12/05 23:06:37 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_checks.c,v 1.4 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" #include "ffb_rcache.h" #include "ffb_fifo.h" +#include "ffb_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_circle.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_circle.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_circle.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_circle.c:1.2 Tue May 23 00:47:44 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_circle.c Wed Mar 1 16:01:56 2006 @@ -22,13 +22,14 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_circle.c,v 1.2 2000/05/23 04:47:44 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_circle.c,v 1.3 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" #include "ffb_rcache.h" #include "ffb_fifo.h" #include "ffb_stip.h" +#include "ffb_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_cplane.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_cplane.c:1.5 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_cplane.c:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_cplane.c:1.5 Sun Dec 5 18:06:37 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_cplane.c Wed Mar 1 16:01:56 2006 @@ -22,12 +22,13 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_cplane.c,v 1.5 2004/12/05 23:06:37 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_cplane.c,v 1.6 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" #include "ffb_rcache.h" #include "ffb_fifo.h" +#include "ffb_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dac.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dac.c:1.4 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dac.c:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dac.c:1.4 Thu Dec 5 21:44:03 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dac.c Fri Sep 23 01:07:50 2005 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dac.c,v 1.4 2002/12/06 02:44:03 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dac.c,v 1.5 2005/09/23 05:07:50 tsi Exp $ */ #include "ffb.h" #include "ffb_rcache.h" @@ -39,7 +39,7 @@ #ifndef DPMS_SPIN_COUNT #define DPMS_SPIN_COUNT 100 -#endif /* DPMS_SPIN_COUNT */ +#endif /* Cursor programming */ @@ -195,7 +195,7 @@ if (vctr == 0) break; - } + } DACCFG_WRITE(dac, FFBDAC_CFG_TGEN, 0); } @@ -514,99 +514,128 @@ * results in Off. Maybe related? */ static void -SPIN(ffb_dacPtr d, int count) { +SPIN(ffb_dacPtr d, int count) +{ while(count-- > 0) { (void) DACCFG_READ(d, FFBDAC_CFG_TGVC); } - return; } /* Screen save (blank) restore */ Bool -FFBDacSaveScreen(FFBPtr pFfb, int mode) { - int tmp; - ffb_dacPtr dac; - if(!pFfb) return FALSE; /* Is there any way at all this could happen? */ - else dac = pFfb -> dac; +FFBDacSaveScreen(ScrnInfoPtr pScrn, int mode) +{ + FFBPtr pFfb = GET_FFB_FROM_SCRN(pScrn); + ffb_dacPtr dac = pFfb->dac; + int tmp; - tmp = DACCFG_READ(dac, FFBDAC_CFG_TGEN); /* Get the timing information */ + /* Get the timing information */ + tmp = DACCFG_READ(dac, FFBDAC_CFG_TGEN); - switch(mode) { + switch (mode) { case SCREEN_SAVER_ON: case SCREEN_SAVER_CYCLE: - tmp &= ~FFBDAC_CFG_TGEN_VIDE; /* Kill the video */ - break; + if (!(tmp & FFBDAC_CFG_TGEN_VIDE)) + return TRUE; + + tmp &= ~FFBDAC_CFG_TGEN_VIDE; /* Kill the video */ + break; case SCREEN_SAVER_OFF: case SCREEN_SAVER_FORCER: - tmp |= FFBDAC_CFG_TGEN_VIDE; /* Turn the video on */ - break; + if (tmp & FFBDAC_CFG_TGEN_VIDE) + return TRUE; + + tmp |= FFBDAC_CFG_TGEN_VIDE; /* Turn the video on */ + break; default: - return FALSE; /* Don't know what to do; gently fail. */ - } - DACCFG_WRITE(dac, FFBDAC_CFG_TGEN, tmp); /* Restore timing register, video set as asked */ - SPIN(dac, DPMS_SPIN_COUNT/10); - return TRUE; -} - -/* DPMS Control, also hinted at by David Miller. - - The rule seems to be: - - StandBy = -HSYNC +VSYNC -VIDEO - Suspend = +HSYNC -VSYNC -VIDEO - Off = -HSYNC -VSYNC -VIDEO - On = +HSYNC +VSINC +VIDEO - - If you don't force video off, someone periodically tries to turn the - monitor on for some reason. I don't know who or why, so I kill the video - when trying to go into some sort of energy saving mode. (In real life, - 'xset s blank s xx' could well have taken care of this.) - - Also, on MY monitor, StandBy as above defined (-H+V-Vid) in fact - gives the same as Off, which I don't want. Hence, I just do (-Vid) - - 05.xii.01, FEM - 08.xii.01, FEM -*/ -void -FFBDacDPMSMode(FFBPtr pFfb, int DPMSMode, int flags) { - int tmp; - ffb_dacPtr dac = pFfb -> dac; + return FALSE; /* Don't know what to do; gently fail. */ + } - tmp = DACCFG_READ(dac, FFBDAC_CFG_TGEN); /* Get timing control */ + /* Restore timing register, video set as asked */ + DACCFG_WRITE(dac, FFBDAC_CFG_TGEN, tmp); - switch(DPMSMode) { + SPIN(dac, DPMS_SPIN_COUNT / 10); + if (!(tmp & FFBDAC_CFG_TGEN_VIDE) || (pFfb->ffb_type >= ffb2_prototype)) + return TRUE; + + /* Redraw screen on buggy FFB1's */ + (*pScrn->EnableDisableFBAccess)(pScrn->scrnIndex, FALSE); + (*pScrn->EnableDisableFBAccess)(pScrn->scrnIndex, TRUE); + + return TRUE; +} + +/* + * DPMS Control, also hinted at by David Miller. + * + * The rule seems to be: + * + * StandBy = -HSYNC +VSYNC -VIDEO + * Suspend = +HSYNC -VSYNC -VIDEO + * Off = -HSYNC -VSYNC -VIDEO + * On = +HSYNC +VSINC +VIDEO + * + * If you don't force video off, someone periodically tries to turn the + * monitor on for some reason. I don't know who or why, so I kill the video + * when trying to go into some sort of energy saving mode. (In real life, + * 'xset s blank s xx' could well have taken care of this.) + * + * Also, on MY monitor, StandBy as above defined (-H+V-Vid) in fact + * gives the same as Off, which I don't want. Hence, I just do (-Vid) + * + * 05.xii.01, FEM + * 08.xii.01, FEM + */ +void +FFBDacDPMSMode(FFBPtr pFfb, int DPMSMode, int flags) +{ + int tmp; + ffb_dacPtr dac = pFfb->dac; + + /* Get timing control */ + tmp = DACCFG_READ(dac, FFBDAC_CFG_TGEN); + + switch(DPMSMode) { case DPMSModeOn: - tmp &= ~(FFBDAC_CFG_TGEN_VSD | FFBDAC_CFG_TGEN_HSD); /* Turn off VSYNC, HSYNC - disable bits */ - tmp |= FFBDAC_CFG_TGEN_VIDE; /* Turn the video on */ - break; + /* Turn off VSYNC, HSYNC disable bits */ + tmp &= ~(FFBDAC_CFG_TGEN_VSD | FFBDAC_CFG_TGEN_HSD); + + /* Turn the video on */ + tmp |= FFBDAC_CFG_TGEN_VIDE; + break; case DPMSModeStandby: -#ifdef DPMS_TRUE_STANDBY - tmp |= FFBDAC_CFG_TGEN_HSD; /* HSYNC = OFF */ -#endif /* DPMS_TRUE_STANDBY */ - tmp &= ~FFBDAC_CFG_TGEN_VSD; /* VSYNC = ON */ - tmp &= ~FFBDAC_CFG_TGEN_VIDE; /* Kill the video */ - break; +#ifdef DPMS_TRUE_STANDBY + /* HSYNC = OFF */ + tmp |= FFBDAC_CFG_TGEN_HSD; +#endif + /* VSYNC = ON and Video off */ + tmp &= ~(FFBDAC_CFG_TGEN_VSD | FFBDAC_CFG_TGEN_VIDE); + break; case DPMSModeSuspend: - tmp |= FFBDAC_CFG_TGEN_VSD; /* VSYNC = OFF */ - tmp &= ~FFBDAC_CFG_TGEN_HSD; /* HSYNC = ON */ - tmp &= ~FFBDAC_CFG_TGEN_VIDE; /* Kill the video */ - break; + /* VSYNC = OFF */ + tmp |= FFBDAC_CFG_TGEN_VSD; + /* HSYNC = ON and Video off */ + tmp &= ~(FFBDAC_CFG_TGEN_HSD | FFBDAC_CFG_TGEN_VIDE); + break; case DPMSModeOff: - tmp |= (FFBDAC_CFG_TGEN_VSD | FFBDAC_CFG_TGEN_HSD); /* Kill HSYNC, VSYNC both */ - tmp &= ~FFBDAC_CFG_TGEN_VIDE; /* Kill the video */ + /* Kill HSYNC, VSYNC both */ + tmp |= (FFBDAC_CFG_TGEN_VSD | FFBDAC_CFG_TGEN_HSD); + /* Kill the video */ + tmp &= ~FFBDAC_CFG_TGEN_VIDE; break; - + default: return; /* If we get here, we really should log an error */ - } - DACCFG_WRITE(dac, FFBDAC_CFG_TGEN,tmp); /* Restore timing register, video set as asked */ - SPIN(dac, DPMS_SPIN_COUNT); /* Is this necessary? Why? */ + } + + /* Restore timing register, video set as asked */ + DACCFG_WRITE(dac, FFBDAC_CFG_TGEN,tmp); + + SPIN(dac, DPMS_SPIN_COUNT); /* Is this necessary? Why? */ } Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dbe.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dbe.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dbe.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dbe.c:1.2 Mon Feb 10 22:19:02 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dbe.c Wed Mar 1 16:01:56 2006 @@ -21,12 +21,12 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dbe.c,v 1.2 2003/02/11 03:19:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dbe.c,v 1.4 2006/03/01 21:01:56 dawes Exp $ */ #define NEED_REPLIES #define NEED_EVENTS -#include "X.h" -#include "Xproto.h" +#include <X11/X.h> +#include <X11/Xproto.h> #include "misc.h" #include "os.h" #include "windowstr.h" @@ -887,7 +887,7 @@ pDbeScreenPriv->WinPrivDelete = FFBDbeWinPrivDelete; /* The FFB implementation doesn't need buffer validation. */ - pDbeScreenPriv->ValidateBuffer = (void (*)())NoopDDA; + pDbeScreenPriv->ValidateBuffer = (void (*)(WindowPtr, XID, Bool))NoopDDA; return TRUE; } Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c:1.15 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c:1.17 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c:1.15 Thu Feb 17 21:55:09 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c Thu Mar 16 11:50:17 2006 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c,v 1.15 2005/02/18 02:55:09 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c,v 1.17 2006/03/16 16:50:17 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -123,7 +123,7 @@ XF86ModuleData sunffbModuleData = { &sunffbVersRec, ffbSetup, NULL }; static pointer -ffbSetup(pointer module, pointer opts, int *errmaj, int *errmin) +ffbSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -808,9 +808,6 @@ xf86Msg(X_INFO, "%s: ... AFB firmware is loaded\n", psdp->device); } - /* Darken the screen for aesthetic reasons and set the viewport */ - FFBSaveScreen(pScreen, SCREEN_SAVER_ON); - if (pFfb->NoAccel == TRUE) { if (!CreatorUnaccelWidInit(pScreen)) return FALSE; @@ -961,9 +958,6 @@ xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); } - /* unblank the screen */ - FFBSaveScreen(pScreen, SCREEN_SAVER_OFF); - /* Done */ return TRUE; } @@ -1055,6 +1049,8 @@ FFBDRICloseScreen(pScreen); #endif + FFBDacCursorEnableDisable(pFfb, 0); + /* Restore kernel ramdac state before we unmap registers. */ FFBDacFini(pFfb); @@ -1106,13 +1102,12 @@ static Bool FFBSaveScreen(ScreenPtr pScreen, int mode) /* This function blanks the screen when mode=SCREEN_SAVER_ON and - unblanks it when mode=SCREEN_SAVER_OFF. It is used internally in the - FFBScreenInit code `for aesthetic reasons,' and it is used for + unblanks it when mode=SCREEN_SAVER_OFF. It is used for blanking if you set "xset s on s blank." The work (such as it is) is done in "ffb_dac.c" `for aesthetic reasons.' */ { - return FFBDacSaveScreen(GET_FFB_FROM_SCREEN(pScreen), mode); + return FFBDacSaveScreen(xf86Screens[pScreen->myNum], mode); } /* Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_frect.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_frect.c:1.3 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_frect.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_frect.c:1.3 Thu Apr 5 13:42:33 2001 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_frect.c Wed Mar 1 16:01:56 2006 @@ -24,7 +24,7 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_frect.c,v 1.3 2001/04/05 17:42:33 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_frect.c,v 1.4 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" @@ -32,6 +32,7 @@ #include "ffb_fifo.h" #include "ffb_stip.h" #include "ffb_loops.h" +#include "ffb_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_fspans.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_fspans.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_fspans.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_fspans.c:1.2 Tue May 23 00:47:44 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_fspans.c Wed Mar 1 16:01:56 2006 @@ -22,7 +22,7 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_fspans.c,v 1.2 2000/05/23 04:47:44 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_fspans.c,v 1.3 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" @@ -30,6 +30,7 @@ #include "ffb_fifo.h" #include "ffb_stip.h" #include "ffb_loops.h" +#include "ffb_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_gc.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_gc.c:1.4 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_gc.c:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_gc.c:1.4 Mon Jun 23 13:35:48 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_gc.c Wed Mar 1 16:01:56 2006 @@ -24,7 +24,7 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_gc.c,v 1.4 2003/06/23 17:35:48 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_gc.c,v 1.6 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" @@ -35,7 +35,7 @@ #include "scrnintstr.h" #include "pixmapstr.h" -#include "fontstruct.h" +#include <X11/fonts/fontstruct.h> #include "dixfontstr.h" #define PSZ 8 @@ -443,7 +443,10 @@ pGC->ops->PushPixels = mfbPushPixels; } -void +extern GCOps cfbNonTEOps; +extern GCOps cfb32NonTEOps; + +static void CreatorValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { int mask; /* stateChanges */ @@ -462,9 +465,6 @@ type = pFfb->vtSema ? -1 : pDrawable->type; if (type != DRAWABLE_WINDOW) { if (gcPriv->type == DRAWABLE_WINDOW) { - extern GCOps cfbNonTEOps; - extern GCOps cfb32NonTEOps; - miDestroyGCOps (pGC->ops); if (pGC->depth == 8) Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_glyph.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_glyph.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_glyph.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_glyph.c:1.2 Tue May 23 00:47:45 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_glyph.c Wed Mar 1 16:01:56 2006 @@ -24,17 +24,18 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_glyph.c,v 1.2 2000/05/23 04:47:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_glyph.c,v 1.4 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" #include "ffb_rcache.h" #include "ffb_fifo.h" #include "ffb_loops.h" +#include "ffb_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" -#include "fontstruct.h" +#include <X11/fonts/fontstruct.h> #include "dixfontstr.h" #define PSZ 8 Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_line.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_line.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_line.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_line.c:1.2 Tue May 23 00:47:45 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_line.c Wed Mar 1 16:01:56 2006 @@ -22,13 +22,14 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_line.c,v 1.2 2000/05/23 04:47:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_line.c,v 1.3 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" #include "ffb_rcache.h" #include "ffb_fifo.h" #include "ffb_stip.h" +#include "ffb_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_plygon.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_plygon.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_plygon.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_plygon.c:1.2 Tue May 23 00:47:45 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_plygon.c Wed Mar 1 16:01:56 2006 @@ -23,13 +23,14 @@ * IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_plygon.c,v 1.2 2000/05/23 04:47:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_plygon.c,v 1.3 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" #include "ffb_rcache.h" #include "ffb_fifo.h" #include "ffb_stip.h" +#include "ffb_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_point.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_point.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_point.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_point.c:1.2 Tue May 23 00:47:45 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_point.c Wed Mar 1 16:01:56 2006 @@ -23,13 +23,14 @@ * IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_point.c,v 1.2 2000/05/23 04:47:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_point.c,v 1.3 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" #include "ffb_rcache.h" #include "ffb_fifo.h" #include "ffb_loops.h" +#include "ffb_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_seg.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_seg.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_seg.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_seg.c:1.2 Tue May 23 00:47:45 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_seg.c Wed Mar 1 16:01:56 2006 @@ -23,7 +23,7 @@ * IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_seg.c,v 1.2 2000/05/23 04:47:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_seg.c,v 1.3 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" @@ -31,6 +31,7 @@ #include "ffb_fifo.h" #include "ffb_loops.h" #include "ffb_stip.h" +#include "ffb_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_sspans.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_sspans.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_sspans.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_sspans.c:1.2 Tue May 23 00:47:45 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_sspans.c Wed Mar 1 16:01:56 2006 @@ -22,12 +22,13 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_sspans.c,v 1.2 2000/05/23 04:47:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_sspans.c,v 1.3 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" #include "ffb_rcache.h" #include "ffb_fifo.h" +#include "ffb_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_stubs.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_stubs.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_stubs.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_stubs.c:1.2 Tue May 23 00:47:45 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_stubs.c Wed Mar 1 16:01:56 2006 @@ -22,12 +22,13 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_stubs.c,v 1.2 2000/05/23 04:47:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_stubs.c,v 1.3 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" #include "ffb_rcache.h" #include "ffb_fifo.h" +#include "ffb_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_zeroarc.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_zeroarc.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_zeroarc.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_zeroarc.c:1.2 Tue May 23 00:47:45 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_zeroarc.c Wed Mar 1 16:01:56 2006 @@ -24,13 +24,14 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_zeroarc.c,v 1.2 2000/05/23 04:47:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_zeroarc.c,v 1.3 2006/03/01 21:01:56 dawes Exp $ */ #include "ffb.h" #include "ffb_regs.h" #include "ffb_rcache.h" #include "ffb_fifo.h" #include "ffb_stip.h" +#include "ffb_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile:1.6 xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile:1.6 Mon May 31 20:17:02 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile Fri Oct 14 11:16:46 2005 @@ -1,7 +1,7 @@ XCOMM XCOMM This is an Imakefile for the leo driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile,v 1.6 2004/06/01 00:17:02 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile,v 1.7 2005/10/14 15:16:46 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -60,14 +60,12 @@ leo_stubs.o leo_cursor.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/cfb \ - -I$(XF86SRC)/ramdac \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) + -I$(XF86SRC)/ramdac -I$(SERVERSRC)/include #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h diff -u xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h:1.5 xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h:1.5 Sun Dec 5 18:06:38 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h Fri Oct 14 11:16:46 2005 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h,v 1.5 2004/12/05 23:06:38 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h,v 1.6 2005/10/14 15:16:46 tsi Exp $ */ #ifndef LEO_H #define LEO_H @@ -29,7 +29,7 @@ #include "xf86_OSproc.h" #include "xf86_ansic.h" #include "xf86RamDac.h" -#include "Xmd.h" +#include <X11/Xmd.h> #include "gcstruct.h" #include "leo_regs.h" #include "xf86sbusBus.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_accel.c:1.5 xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_accel.c:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_accel.c:1.5 Sun Dec 5 18:06:38 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_accel.c Fri Oct 14 11:16:46 2005 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_accel.c,v 1.5 2004/12/05 23:06:38 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_accel.c,v 1.6 2005/10/14 15:16:46 tsi Exp $ */ #define PSZ 32 @@ -28,7 +28,7 @@ #include "pixmapstr.h" #include "regionstr.h" #include "mistruct.h" -#include "fontstruct.h" +#include <X11/fonts/fontstruct.h> #include "dixfontstr.h" #include "cfb.h" #include "cfbmskbits.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_bcopy.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_bcopy.c:1.1 xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_bcopy.c:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_bcopy.c:1.1 Thu May 18 19:21:39 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_bcopy.c Wed Mar 1 16:01:57 2006 @@ -20,12 +20,13 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_bcopy.c,v 1.1 2000/05/18 23:21:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_bcopy.c,v 1.2 2006/03/01 21:01:57 dawes Exp $ */ #define PSZ 32 #include "leo.h" #include "leo_regs.h" +#include "leo_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" @@ -174,5 +175,5 @@ return cfbCopyArea (pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty); return cfbBitBlt (pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, (void (*)())LeoDoBitblt, 0); + pGC, srcx, srcy, width, height, dstx, dsty, LeoDoBitblt, 0); } Index: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_checks.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_checks.c:1.1 xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_checks.c:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_checks.c:1.1 Thu May 18 19:21:39 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_checks.c Wed Mar 1 16:01:57 2006 @@ -20,18 +20,19 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_checks.c,v 1.1 2000/05/18 23:21:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_checks.c,v 1.2 2006/03/01 21:01:57 dawes Exp $ */ #define PSZ 32 #include "leo.h" +#include "leo_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" #include "cfb.h" -int +static int LeoCheckTile (PixmapPtr pPixmap, LeoStipplePtr stipple, int ox, int oy) { unsigned int *sbits; @@ -88,7 +89,7 @@ return TRUE; } -int +static int LeoCheckStipple (PixmapPtr pPixmap, LeoStipplePtr stipple, int ox, int oy) { unsigned int *sbits; Index: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c:1.12 xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c:1.13 --- xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c:1.12 Thu Feb 17 21:55:10 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c Thu Mar 16 11:50:17 2006 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c,v 1.12 2005/02/18 02:55:10 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c,v 1.13 2006/03/16 16:50:17 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -116,7 +116,7 @@ XF86ModuleData sunleoModuleData = { &sunleoVersRec, leoSetup, NULL }; static pointer -leoSetup(pointer module, pointer opts, int *errmaj, int *errmin) +leoSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; Index: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_frect.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_frect.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_frect.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_frect.c:1.2 Tue May 23 00:47:47 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_frect.c Wed Mar 1 16:01:57 2006 @@ -20,12 +20,13 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_frect.c,v 1.2 2000/05/23 04:47:47 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_frect.c,v 1.3 2006/03/01 21:01:57 dawes Exp $ */ #define PSZ 32 #include "leo.h" #include "leo_regs.h" +#include "leo_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_frectsp.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_frectsp.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_frectsp.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_frectsp.c:1.2 Tue May 23 00:47:47 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_frectsp.c Wed Mar 1 16:01:57 2006 @@ -20,12 +20,13 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_frectsp.c,v 1.2 2000/05/23 04:47:47 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_frectsp.c,v 1.3 2006/03/01 21:01:57 dawes Exp $ */ #define PSZ 32 #include "leo.h" #include "leo_regs.h" +#include "leo_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspans.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspans.c:1.1 xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspans.c:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspans.c:1.1 Thu May 18 19:21:40 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspans.c Wed Mar 1 16:01:57 2006 @@ -20,11 +20,12 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspans.c,v 1.1 2000/05/18 23:21:40 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspans.c,v 1.2 2006/03/01 21:01:57 dawes Exp $ */ #define PSZ 32 #include "leo.h" +#include "leo_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspanssp.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspanssp.c:1.1 xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspanssp.c:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspanssp.c:1.1 Thu May 18 19:21:40 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspanssp.c Wed Mar 1 16:01:57 2006 @@ -20,11 +20,12 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspanssp.c,v 1.1 2000/05/18 23:21:40 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspanssp.c,v 1.2 2006/03/01 21:01:57 dawes Exp $ */ #define PSZ 32 #include "leo.h" +#include "leo_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_gc.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_gc.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_gc.c:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_gc.c:1.2 Thu Nov 30 19:24:35 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_gc.c Wed Mar 1 16:01:57 2006 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_gc.c,v 1.2 2000/12/01 00:24:35 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_gc.c,v 1.4 2006/03/01 21:01:57 dawes Exp $ */ #define PSZ 32 @@ -28,11 +28,11 @@ #include "leo_regs.h" #include "leo_gc.h" -#include "X.h" -#include "Xmd.h" -#include "Xproto.h" +#include <X11/X.h> +#include <X11/Xmd.h> +#include <X11/Xproto.h> #include "cfb.h" -#include "fontstruct.h" +#include <X11/fonts/fontstruct.h> #include "dixfontstr.h" #include "gcstruct.h" #include "windowstr.h" @@ -164,7 +164,7 @@ #endif }; -GCOps * +static GCOps * LeoMatchCommon (GCPtr pGC, cfbPrivGCPtr devPriv) { if (pGC->lineWidth != 0) @@ -221,6 +221,8 @@ miDestroyGC (pGC); } +extern GCOps cfbNonTEOps; + void LeoValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { @@ -240,8 +242,6 @@ type = pLeo->vtSema ? -1 : pDrawable->type; if (type != DRAWABLE_WINDOW) { if (gcPriv->type == DRAWABLE_WINDOW) { - extern GCOps cfbNonTEOps; - miDestroyGCOps (pGC->ops); pGC->ops = &cfbNonTEOps; changes = (1 << (GCLastBit+1)) - 1; Index: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_glyph.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_glyph.c:1.1 xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_glyph.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_glyph.c:1.1 Thu May 18 19:21:40 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_glyph.c Wed Mar 1 16:01:57 2006 @@ -20,15 +20,16 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_glyph.c,v 1.1 2000/05/18 23:21:40 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_glyph.c,v 1.3 2006/03/01 21:01:57 dawes Exp $ */ #define PSZ 32 #include "leo.h" +#include "leo_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" -#include "fontstruct.h" +#include <X11/fonts/fontstruct.h> #include "dixfontstr.h" #include "cfb.h" Index: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_stubs.c diff -u xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_stubs.c:1.1 xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_stubs.c:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_stubs.c:1.1 Thu May 18 19:21:40 2000 +++ xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_stubs.c Wed Mar 1 16:01:57 2006 @@ -21,11 +21,12 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_stubs.c,v 1.1 2000/05/18 23:21:40 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_stubs.c,v 1.2 2006/03/01 21:01:57 dawes Exp $ */ #define PSZ 32 #include "leo.h" +#include "leo_gc.h" #include "pixmapstr.h" #include "scrnintstr.h" Index: xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile:1.6 xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile:1.6 Mon May 31 20:17:03 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile Fri Oct 14 11:16:47 2005 @@ -1,7 +1,7 @@ XCOMM XCOMM This is an Imakefile for the tcx driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile,v 1.6 2004/06/01 00:17:03 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile,v 1.7 2005/10/14 15:16:47 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -56,14 +56,12 @@ OBJS = tcx_driver.o tcx_cursor.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ - -I$(XF86SRC)/ramdac \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) + -I$(XF86SRC)/ramdac -I$(SERVERSRC)/include #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h diff -u xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h:1.3 xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h:1.3 Sun Dec 5 18:06:38 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h Fri Oct 14 11:16:47 2005 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h,v 1.3 2004/12/05 23:06:38 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h,v 1.5 2005/10/14 15:16:47 tsi Exp $ */ #ifndef TCX_H #define TCX_H @@ -29,7 +29,7 @@ #include "xf86_OSproc.h" #include "xf86_ansic.h" #include "xf86RamDac.h" -#include "Xmd.h" +#include <X11/Xmd.h> #include "gcstruct.h" #include "xf86sbusBus.h" #include "tcx_regs.h" @@ -43,7 +43,6 @@ #define TCX_THC_VOFF 0x70004000 #define TCX_DHC_VOFF 0x70008000 #define TCX_ALT_VOFF 0x7000a000 -#define TCX_SYNC_VOFF 0x7000e000 typedef struct { unsigned char *fb; Index: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c:1.11 xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c:1.12 --- xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c:1.11 Thu Feb 17 21:55:10 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c Thu Mar 16 11:50:17 2006 @@ -20,7 +20,7 @@ * 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. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c,v 1.11 2005/02/18 02:55:10 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c,v 1.12 2006/03/16 16:50:17 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -113,7 +113,7 @@ XF86ModuleData suntcxModuleData = { &suntcxVersRec, tcxSetup, NULL }; static pointer -tcxSetup(pointer module, pointer opts, int *errmaj, int *errmin) +tcxSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; Index: xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile:1.27 xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile:1.28 --- xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile:1.27 Mon Feb 28 22:48:53 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile Fri Oct 14 11:16:47 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile,v 1.27 2005/03/01 03:48:53 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile,v 1.28 2005/10/14 15:16:47 tsi Exp $ XCOMM XCOMM This is the Imakefile for the TDFX driver. XCOMM @@ -58,8 +58,7 @@ #if BuildXF86DRI DRISRCS = tdfx_dri.c DRIOBJS = tdfx_dri.o -DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri -I$(TOP)/include \ - -I$(DRMINCLUDESDIR) +DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri -I$(DRMINCLUDESDIR) DRIDEFINES = $(GLX_DEFINES) #endif @@ -76,17 +75,15 @@ tdfx_dga.o tdfx_priv.o tdfx_sli.o $(XVOBJS) $(DRIOBJS) #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(XF86SRC)/xaa -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ + -I$(XF86SRC)/xaa -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa -I$(XF86SRC)/ramdac \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ + -I$(XF86SRC)/vgahw -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ -I$(XF86SRC)/ddc -I$(XF86SRC)/vbe -I$(SERVERSRC)/Xext \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) -I$(SERVERSRC)/render \ - $(DRIINCLUDES) + -I$(SERVERSRC)/include -I$(SERVERSRC)/render $(DRIINCLUDES) #endif DEFINES = $(DRIDEFINES) Index: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c:1.109 xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c:1.114 --- xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c:1.109 Thu Feb 17 21:55:10 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c Thu Mar 16 11:50:17 2006 @@ -27,7 +27,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c,v 1.109 2005/02/18 02:55:10 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c,v 1.114 2006/03/16 16:50:17 dawes Exp $ */ /* * Authors: @@ -81,7 +81,7 @@ /* !!! These need to be checked !!! */ #if 0 #define _XF86DGA_SERVER_ -#include "extensions/xf86dgastr.h" +#include <X11/extensions/xf86dgastr.h> #endif /* The driver's own header file: */ @@ -92,7 +92,7 @@ #include "dixstruct.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #ifdef XF86DRI #include "dri.h" @@ -138,6 +138,8 @@ static void TDFXDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagermentMode, int flags); +static xf86MonPtr doTDFXDDC(ScrnInfoPtr pScrn); + DriverRec TDFX = { TDFX_VERSION, TDFX_DRIVER_NAME, @@ -214,6 +216,14 @@ static const char *ddcSymbols[] = { "xf86PrintEDID", "xf86SetDDCproperties", + "xf86DoEDID_DDC2", + NULL +}; + + +static const char *i2cSymbols[] = { + "xf86CreateI2CBusRec", + "xf86I2CBusInit", NULL }; @@ -291,7 +301,7 @@ XF86ModuleData tdfxModuleData = {&tdfxVersRec, tdfxSetup, 0}; static pointer -tdfxSetup(pointer module, pointer opts, int *errmaj, int *errmin) +tdfxSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -310,12 +320,12 @@ * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, - ramdacSymbols, vbeSymbols, int10Symbols, + LoaderModRefSymLists(module, vgahwSymbols, fbSymbols, xaaSymbols, + ramdacSymbols, vbeSymbols, int10Symbols, #ifdef XF86DRI - drmSymbols, driSymbols, + drmSymbols, driSymbols, #endif - NULL); + NULL); /* * The return value must be non-NULL on success even though there @@ -375,11 +385,14 @@ TDFXProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; - if (xf86LoadSubModule(pScrn, "vbe")) + ModuleDescPtr pMod; + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } @@ -674,12 +687,14 @@ { TDFXPtr pTDFX; ClockRangePtr clockRanges; + xf86MonPtr pMon; int i; MessageType from; int flags24; rgb defaultWeight = {0, 0, 0}; pciVideoPtr match; int availableMem; + ModuleDescPtr pMod, pDDCMod; TDFXTRACE("TDFXPreInit start\n"); if (pScrn->numEntities != 1) return FALSE; @@ -706,19 +721,19 @@ if (pTDFX->pEnt->location.type != BUS_PCI) return FALSE; /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) return FALSE; + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* Allocate a vgaHWRec */ if (!vgaHWGetHWRec(pScrn)) return FALSE; #if USE_INT10 #if !defined(__powerpc__) - if (xf86LoadSubModule(pScrn, "int10")) { + if ((pMod = xf86LoadSubModule(pScrn, "int10"))) { xf86Int10InfoPtr pInt; - xf86LoaderReqSymLists(int10Symbols, NULL); + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Softbooting the board (through the int10 interface).\n"); pInt = xf86InitInt10(pTDFX->pEnt->index); @@ -975,46 +990,20 @@ availableMem = pScrn->videoRam - 4096 - (((255 <= CMDFIFO_PAGES) ? 255 : CMDFIFO_PAGES) << 12); - i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, - pScrn->display->modes, clockRanges, - 0, 320, 2048, 16*pScrn->bitsPerPixel, - 200, 2047, - pScrn->display->virtualX, pScrn->display->virtualY, - availableMem, LOOKUP_BEST_REFRESH); - - if (i==-1) { - TDFXFreeRec(pScrn); - return FALSE; - } - - xf86PruneDriverModes(pScrn); - - if (!i || !pScrn->modes) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); - TDFXFreeRec(pScrn); - return FALSE; - } - - xf86SetCrtcForModes(pScrn, 0); - - pScrn->currentMode = pScrn->modes; - - xf86PrintModes(pScrn); - xf86SetDpi(pScrn, 0, 0); - if (!xf86LoadSubModule(pScrn, "fb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { TDFXFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); if (!xf86ReturnOptValBool(pTDFX->Options, OPTION_NOACCEL, FALSE)) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { TDFXFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } if (!xf86GetOptValBool(pTDFX->Options, OPTION_SHOWCACHE, &(pTDFX->ShowCache))) { @@ -1036,40 +1025,79 @@ } if (!xf86ReturnOptValBool(pTDFX->Options, OPTION_SW_CURSOR, FALSE)) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { TDFXFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } -#if USE_INT10 -#if !defined(__powerpc__) - /* Load DDC if needed */ - /* This gives us DDC1 - we should be able to get DDC2B using i2c */ - if (!xf86LoadSubModule(pScrn, "ddc")) { + /* Load DDC and I2C for monitor ID */ + if (!(pMod = xf86LoadSubModule(pScrn, "i2c"))) { TDFXFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ddcSymbols, NULL); + xf86LoaderModReqSymLists(pMod, i2cSymbols, NULL); - /* Initialize DDC1 if possible */ - if (xf86LoadSubModule(pScrn, "vbe")) { - xf86MonPtr pMon; - vbeInfoPtr pVbe = VBEInit(NULL,pTDFX->pEnt->index); - - xf86LoaderReqSymLists(vbeSymbols, NULL); - pMon = vbeDoEDID(pVbe, NULL); - vbeFree(pVbe); - xf86SetDDCproperties(pScrn,xf86PrintEDID(pMon)); + if (!(pDDCMod = xf86LoadSubModule(pScrn, "ddc"))) { + TDFXFreeRec(pScrn); + return FALSE; } + xf86LoaderModReqSymLists(pDDCMod, ddcSymbols, NULL); + + /* try to read read DDC2 data */ + pMon = doTDFXDDC(pScrn); + if (pMon != NULL) { + xf86SetDDCproperties(pScrn,xf86PrintEDID(pMon)); +#if USE_INT10 +#if !defined(__powerpc__) + } else { + /* try to use vbe if we didn't find anything */ + /* Initialize DDC1 if possible */ + if ((pMod = xf86LoadVBEModule(pScrn))) { + vbeInfoPtr pVbe = VBEInit(NULL,pTDFX->pEnt->index); + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); + if (pVbe) { + pMon = vbeDoEDID(pVbe, pDDCMod); + vbeFree(pVbe); + xf86SetDDCproperties(pScrn,xf86PrintEDID(pMon)); + } + xf86UnloadSubModule(pMod); + } #endif #endif + } if (xf86ReturnOptValBool(pTDFX->Options, OPTION_USE_PIO, FALSE)) { pTDFX->usePIO=TRUE; } + i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, + pScrn->display->modes, clockRanges, + 0, 320, 2048, 16*pScrn->bitsPerPixel, + 200, 2047, + pScrn->display->virtualX, pScrn->display->virtualY, + availableMem, LOOKUP_BEST_REFRESH); + + if (i==-1) { + TDFXFreeRec(pScrn); + return FALSE; + } + + xf86PruneDriverModes(pScrn); + + if (!i || !pScrn->modes) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); + TDFXFreeRec(pScrn); + return FALSE; + } + + xf86SetCrtcForModes(pScrn, 0); + + pScrn->currentMode = pScrn->modes; + + xf86PrintModes(pScrn); + #if X_BYTE_ORDER == X_BIG_ENDIAN pTDFX->ModeReg.miscinit0 = pTDFX->readLong(pTDFX, MISCINIT0); pTDFX->SavedReg.miscinit0 = pTDFX->ModeReg.miscinit0; @@ -1102,8 +1130,8 @@ #ifdef XF86DRI /* Load the dri module if requested. */ if (xf86ReturnOptValBool(pTDFX->Options, OPTION_DRI, FALSE)) { - if (xf86LoadSubModule(pScrn, "dri")) { - xf86LoaderReqSymLists(driSymbols, drmSymbols, NULL); + if ((pMod = xf86LoadSubModule(pScrn, "dri"))) { + xf86LoaderModReqSymLists(pMod, driSymbols, drmSymbols, NULL); } } #endif @@ -2521,3 +2549,69 @@ dacmode|=state; pTDFX->writeLong(pTDFX, DACMODE, dacmode); } + +static void +TDFXPutBits(I2CBusPtr b, int scl, int sda) +{ + TDFXPtr pTDFX; + CARD32 reg; + + pTDFX = b->DriverPrivate.ptr; + reg = pTDFX->readLong(pTDFX, VIDSERIALPARALLELPORT); + reg = (reg & ~(VSP_SDA0_OUT | VSP_SCL0_OUT)) | + (scl ? VSP_SCL0_OUT : 0) | + (sda ? VSP_SDA0_OUT : 0); + pTDFX->writeLong(pTDFX, VIDSERIALPARALLELPORT, reg); +} + +static void +TDFXGetBits(I2CBusPtr b, int *scl, int *sda) +{ + TDFXPtr pTDFX; + CARD32 reg; + + pTDFX = b->DriverPrivate.ptr; + reg = pTDFX->readLong(pTDFX, VIDSERIALPARALLELPORT); + *sda = (reg & VSP_SDA0_IN) ? 1 : 0; + *scl = (reg & VSP_SCL0_IN) ? 1 : 0; +} + +static xf86MonPtr +doTDFXDDC(ScrnInfoPtr pScrn) +{ + TDFXPtr pTDFX; + I2CBusPtr pI2CBus; + xf86MonPtr pMon = NULL; + CARD32 reg; + + pTDFX = TDFXPTR(pScrn); + + if (!(pI2CBus = xf86CreateI2CBusRec())) + { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unable to allocate I2C Bus record.\n"); + return NULL; + } + + /* Fill in generic structure fields */ + pI2CBus->BusName = "DDC"; + pI2CBus->scrnIndex = pScrn->scrnIndex; + pI2CBus->I2CPutBits = TDFXPutBits; + pI2CBus->I2CGetBits = TDFXGetBits; + + pI2CBus->DriverPrivate.ptr = pTDFX; + + reg = pTDFX->readLong(pTDFX, VIDSERIALPARALLELPORT); + pTDFX->writeLong(pTDFX, VIDSERIALPARALLELPORT, reg | VSP_ENABLE_IIC0); + + if (xf86I2CBusInit(pI2CBus)) + { + pMon = xf86DoEDID_DDC2(pScrn->scrnIndex, pI2CBus); + if (pMon == NULL) + xf86Msg(X_WARNING, "No DDC2 capable monitor found\n"); + xf86DestroyI2CBusRec(pI2CBus, TRUE, TRUE); + } + pTDFX->writeLong(pTDFX, VIDSERIALPARALLELPORT, reg); + + return pMon; +} + Index: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c:1.22 xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c:1.23 --- xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c:1.22 Tue Mar 30 05:34:07 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c Fri Oct 14 11:16:47 2005 @@ -1,10 +1,10 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c,v 1.22 2004/03/30 10:34:07 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c,v 1.23 2005/10/14 15:16:47 tsi Exp $ */ #include "xf86.h" #include "tdfx.h" #include "dixstruct.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "fourcc.h" static Atom xvColorKey, xvFilterQuality; Index: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h diff -u xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h:1.14 xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h:1.15 --- xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h:1.14 Wed Jun 18 12:17:41 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h Fri Sep 23 01:07:50 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h,v 1.14 2003/06/18 16:17:41 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h,v 1.15 2005/09/23 05:07:50 tsi Exp $ */ /* Voodoo Banshee driver version 1.0.1 @@ -384,4 +384,28 @@ #define SST_POWERDOWN_DAC BIT(8) +/* VIDSERIALPARALELPORT */ +#define VSP_TVOUT_RESET 0x80000000 /* 0 forces TVout reset */ +#define VSP_GPIO2_IN 0x40000000 +#define VSP_GPIO1_OUT 0x20000000 +#define VSP_VMI_RESET_N 0x10000000 /* 0 forces a VMI reset */ +#define VSP_SDA1_IN 0x08000000 /* i2c bus on the feature connector */ +#define VSP_SCL1_IN 0x04000000 +#define VSP_SDA1_OUT 0x02000000 +#define VSP_SCL1_OUT 0x01000000 +#define VSP_ENABLE_IIC1 0x00800000 /* 1 enables I2C bus 1 */ +#define VSP_SDA0_IN 0x00400000 /* i2c bus on the monitor connector */ +#define VSP_SCL0_IN 0x00200000 +#define VSP_SDA0_OUT 0x00100000 +#define VSP_SCL0_OUT 0x00080000 +#define VSP_ENABLE_IIC0 0x00040000 /* 1 enables I2C bus 0 */ +#define VSP_VMI_ADDRESS 0x0003c000 /* mask */ +#define VSP_VMI_DATA 0x00003fc0 /* mask */ +#define VSP_VMI_DISABLE 0x00000020 /* 0 enables VMI output */ +#define VSP_VMI_RDY_N 0x00000010 +#define VSP_RW_N 0x00000008 +#define VSP_DS_N 0x00000004 +#define VSP_CS_N 0x00000002 +#define VSP_HOST_ENABLE 0x00000001 /* 1 enables VMI host control*/ + #endif Index: xc/programs/Xserver/hw/xfree86/drivers/tga/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/tga/Imakefile:1.18 xc/programs/Xserver/hw/xfree86/drivers/tga/Imakefile:1.20 --- xc/programs/Xserver/hw/xfree86/drivers/tga/Imakefile:1.18 Mon May 31 20:17:03 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/tga/Imakefile Fri Oct 14 11:16:47 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tga/Imakefile,v 1.18 2004/06/01 00:17:03 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tga/Imakefile,v 1.20 2005/10/14 15:16:47 tsi Exp $ XCOMM XCOMM This is an Imakefile for the TGA driver. XCOMM @@ -56,15 +56,13 @@ OBJS = tga_driver.o tga_dac.o tga_accel.o BTramdac.o ICS1562.o BT463ramdac.o tga_cursor.o tga_line.o tga_seg.o IBM561ramdac.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ - -I$(XF86SRC)/rac -I$(EXTINCSRC) \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(SERVERSRC)/render + -I$(XF86SRC)/ramdac -I$(XF86SRC)/rac \ + -I$(SERVERSRC)/include -I$(SERVERSRC)/render #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c:1.62 xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c:1.65 --- xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c:1.62 Thu Feb 17 21:55:10 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c Thu Mar 16 11:50:18 2006 @@ -22,7 +22,7 @@ * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> * Matthew Grossman, <mattg@oz.net> - acceleration and misc fixes */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c,v 1.62 2005/02/18 02:55:10 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c,v 1.65 2006/03/16 16:50:18 dawes Exp $ */ /* everybody includes these */ #include "xf86.h" @@ -39,8 +39,6 @@ /* RAC stuff */ #include "xf86Resources.h" -/* #include "vgaHW.h" */ - /* software cursor */ #include "mipointer.h" /* backing store */ @@ -63,14 +61,14 @@ #include "tga.h" #define _XF86DGA_SERVER_ -#include "extensions/xf86dgastr.h" +#include <X11/extensions/xf86dgastr.h> #include "globals.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> static const OptionInfoRec * TGAAvailableOptions(int chipid, int busid); static void TGAIdentify(int flags); @@ -221,7 +219,7 @@ XF86ModuleData tgaModuleData = { &tgaVersRec, tgaSetup, NULL }; pointer -tgaSetup(pointer module, pointer opts, int *errmaj, int *errmin) +tgaSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -234,7 +232,8 @@ * by calling LoadSubModule(). */ - LoaderRefSymLists(ramdacSymbols, fbSymbols, xaaSymbols, NULL); + LoaderModRefSymLists(module, ramdacSymbols, fbSymbols, + xaaSymbols, NULL); /* * The return value must be non-NULL on success even though there @@ -454,6 +453,7 @@ int i; ClockRangePtr clockRanges; pointer Base; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) return FALSE; @@ -471,10 +471,10 @@ */ /* The ramdac module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "ramdac")) + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) return FALSE; - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); /* Allocate the TGARec driverPrivate */ if (!TGAGetRec(pScrn)) { @@ -786,20 +786,20 @@ pTga->FbMapSize = pScrn->videoRam * 1024; - if (xf86LoadSubModule(pScrn, "fb") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { TGAFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); /* Load XAA if needed */ if (!pTga->NoAccel || pTga->HWCursor) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { TGAFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } Index: xc/programs/Xserver/hw/xfree86/drivers/tga/tga_line.c diff -u xc/programs/Xserver/hw/xfree86/drivers/tga/tga_line.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/tga/tga_line.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/tga/tga_line.c:1.2 Wed Dec 15 21:26:30 1999 +++ xc/programs/Xserver/hw/xfree86/drivers/tga/tga_line.c Fri Oct 14 11:16:47 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tga/tga_line.c,v 1.2 1999/12/16 02:26:30 robin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tga/tga_line.c,v 1.3 2005/10/14 15:16:47 tsi Exp $ */ /* * Copyright 1999 by Matthew Grossman, Seattle, USA. @@ -31,7 +31,7 @@ /* accelerated solid and dashed lines */ /* adapted from xaa/xaaLine.c */ -#include "X.h" +#include <X11/X.h> #include "misc.h" #include "xf86.h" #include "xf86_ansic.h" Index: xc/programs/Xserver/hw/xfree86/drivers/trident/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/trident/Imakefile:1.35 xc/programs/Xserver/hw/xfree86/drivers/trident/Imakefile:1.36 --- xc/programs/Xserver/hw/xfree86/drivers/trident/Imakefile:1.35 Mon May 31 20:17:03 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/trident/Imakefile Fri Oct 14 11:16:47 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/Imakefile,v 1.35 2004/06/01 00:17:03 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/Imakefile,v 1.36 2005/10/14 15:16:47 tsi Exp $ XCOMM XCOMM This is an Imakefile for the TRIDENT driver. XCOMM @@ -62,18 +62,17 @@ trident_shadow.o trident_video.o xp_accel.o trident_tv.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ - -I$(SERVERSRC)/mi -I$(XF86SRC)/xaa -I$(SERVERSRC)/fb \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ + -I$(SERVERSRC)/mi -I$(XF86SRC)/xaa -I$(SERVERSRC)/fb \ -I$(XF86SRC)/xf1bpp -I$(SERVERSRC)/miext/shadow \ -I$(SERVERSRC)/render -I$(XF86SRC)/shadowfb \ -I$(XF86SRC)/xf4bpp -I$(SERVERSRC)/mfb \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ - -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ + -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ + -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(EXTINCSRC) -I$(XF86SRC)/vbe + -I$(SERVERSRC)/include -I$(XF86SRC)/vbe #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h diff -u xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h:1.60 xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h:1.62 --- xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h:1.60 Thu Oct 30 08:38:01 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h Fri Jan 27 12:21:18 2006 @@ -21,8 +21,7 @@ * * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h,v 1.60 2003/10/30 13:38:01 alanh Exp $ */ -/*#define VBE_INFO*/ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h,v 1.62 2006/01/27 17:21:18 alanh Exp $ */ #ifndef _TRIDENT_H_ #define _TRIDENT_H_ @@ -40,6 +39,8 @@ #include "xf86Pci.h" #include "vbe.h" +#define PCI_CHIP_2200 0x2200 + typedef struct { unsigned char tridentRegs3x4[0x100]; unsigned char tridentRegs3CE[0x100]; @@ -130,9 +131,6 @@ xf86CursorInfoPtr CursorInfoRec; xf86Int10InfoPtr Int10; vbeInfoPtr pVbe; -#ifdef VBE_INFO - vbeModeInfoPtr vbeModes; -#endif XAAInfoRecPtr AccelInfoRec; CloseScreenProcPtr CloseScreen; ScreenBlockHandlerProcPtr BlockHandler; @@ -305,7 +303,8 @@ CYBERBLADEE4, BLADEXP, CYBERBLADEXPAI1, - CYBERBLADEXP4 + CYBERBLADEXP4, + XP5 } TRIDENTType; #define UseMMIO (pTrident->NoMMIO == FALSE) @@ -336,6 +335,7 @@ (pTrident->Chipset == BLADE3D) || \ (pTrident->Chipset == CYBERBLADEXPAI1) || \ (pTrident->Chipset == CYBERBLADEXP4) || \ + (pTrident->Chipset == XP5) || \ (pTrident->Chipset == BLADEXP)) /* Index: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c diff -u xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c:1.81 xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c:1.82 --- xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c:1.81 Fri Nov 26 08:45:05 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c Fri Jan 27 12:21:18 2006 @@ -21,7 +21,7 @@ * * Author: Alan Hourihane, alanh@fairlite.demon.co.uk */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c,v 1.81 2004/11/26 13:45:05 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c,v 1.82 2006/01/27 17:21:18 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -506,6 +506,7 @@ /* Enable Chipset specific options */ switch (pTrident->Chipset) { + case XP5: case CYBERBLADEXP4: case CYBERBLADEXPAI1: case BLADEXP: @@ -588,6 +589,7 @@ pReg->tridentRegs3x4[PixelBusReg] = 0x29; pReg->tridentRegsDAC[0x00] = 0xD0; if (pTrident->Chipset == CYBERBLADEXP4 || + pTrident->Chipset == XP5 || pTrident->Chipset == CYBERBLADEE4) { OUTB(vgaIOBase+ 4, New32); pReg->tridentRegs3x4[New32] = INB(vgaIOBase + 5) & 0x7F; @@ -596,6 +598,7 @@ case 32: pReg->tridentRegs3CE[MiscExtFunc] |= 0x02; if (pTrident->Chipset != CYBERBLADEXP4 + && pTrident->Chipset != XP5 && pTrident->Chipset != CYBERBLADEE4 && pTrident->Chipset != CYBERBLADEXPAI1) { /* Clock Division by 2*/ @@ -606,6 +609,7 @@ pReg->tridentRegs3x4[PixelBusReg] = 0x09; pReg->tridentRegsDAC[0x00] = 0xD0; if (pTrident->Chipset == CYBERBLADEXP4 + || pTrident->Chipset == XP5 || pTrident->Chipset == CYBERBLADEE4 || pTrident->Chipset == CYBERBLADEXPAI1) { OUTB(vgaIOBase+ 4, New32); @@ -735,7 +739,8 @@ OUTB(0x3C5, protect); } - if (pTrident->Chipset == CYBERBLADEXP4) + if (pTrident->Chipset == CYBERBLADEXP4 || + pTrident->Chipset == XP5) pReg->tridentRegs3CE[DisplayEngCont] = 0x08; /* Avoid lockup on Blade3D, PCI Retry is permanently on */ @@ -814,8 +819,10 @@ if (pTrident->Chipset >= CYBER9385) OUTW_3x4(Enhancement0); if (pTrident->Chipset >= BLADE3D) OUTW_3x4(RAMDACTiming); if (pTrident->Chipset == CYBERBLADEXP4 || + pTrident->Chipset == XP5 || pTrident->Chipset == CYBERBLADEE4) OUTW_3x4(New32); - if (pTrident->Chipset == CYBERBLADEXP4) OUTW_3CE(DisplayEngCont); + if (pTrident->Chipset == CYBERBLADEXP4 || + pTrident->Chipset == XP5) OUTW_3CE(DisplayEngCont); if (pTrident->IsCyber) { CARD8 tmp; @@ -946,8 +953,10 @@ if (pTrident->Chipset >= CYBER9385) INB_3x4(Enhancement0); if (pTrident->Chipset >= BLADE3D) INB_3x4(RAMDACTiming); if (pTrident->Chipset == CYBERBLADEXP4 || + pTrident->Chipset == XP5 || pTrident->Chipset == CYBERBLADEE4) INB_3x4(New32); - if (pTrident->Chipset == CYBERBLADEXP4) INB_3CE(DisplayEngCont); + if (pTrident->Chipset == CYBERBLADEXP4 || + pTrident->Chipset == XP5) INB_3CE(DisplayEngCont); if (pTrident->IsCyber) { CARD8 tmp; INB_3CE(VertStretch); @@ -1182,6 +1191,7 @@ HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK | HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 | ((pTrident->Chipset == CYBERBLADEXP4 || + pTrident->Chipset == XP5 || pTrident->Chipset == CYBERBLADEE4) ? HARDWARE_CURSOR_TRUECOLOR_AT_8BPP : 0); infoPtr->SetCursorColors = TridentSetCursorColors; Index: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c:1.193 xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c:1.199 --- xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c:1.193 Thu Feb 17 21:55:10 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c Thu Mar 16 11:50:18 2006 @@ -28,7 +28,7 @@ * Massimiliano Ghilardi, max@Linuz.sns.it, some fixes to the * clockchip programming code. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c,v 1.193 2005/02/18 02:55:10 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c,v 1.199 2006/03/16 16:50:18 dawes Exp $ */ #include "xf1bpp.h" #include "xf4bpp.h" @@ -58,11 +58,11 @@ #include "trident_regs.h" #define _XF86DGA_SERVER_ -#include "extensions/xf86dgastr.h" +#include <X11/extensions/xf86dgastr.h> #include "globals.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> #include "xf86xv.h" @@ -167,6 +167,7 @@ { BLADEXP, "bladeXP" }, { CYBERBLADEXPAI1, "cyberbladeXPAi1" }, { CYBERBLADEXP4, "cyberbladeXP4" }, + { XP5, "XP5" }, { -1, NULL } }; @@ -210,6 +211,7 @@ { BLADEXP, PCI_CHIP_9910, RES_SHARED_VGA }, { CYBERBLADEXPAI1, PCI_CHIP_8820, RES_SHARED_VGA }, { CYBERBLADEXP4, PCI_CHIP_2100, RES_SHARED_VGA }, + { XP5, PCI_CHIP_2200, RES_SHARED_VGA }, { -1, -1, RES_UNDEFINED } }; @@ -309,6 +311,7 @@ 230000, 230000, 230000, + 230000, }; static int ClockLimit16bpp[] = { @@ -352,6 +355,7 @@ 230000, 230000, 230000, + 230000, }; static int ClockLimit24bpp[] = { @@ -395,6 +399,7 @@ 115000, 115000, 115000, + 115000, }; static int ClockLimit32bpp[] = { @@ -439,6 +444,7 @@ 115000, 115000, 115000, + 115000, }; /* @@ -577,16 +583,16 @@ XF86ModuleData tridentModuleData = { &tridentVersRec, tridentSetup, NULL }; pointer -tridentSetup(pointer module, pointer opts, int *errmaj, int *errmin) +tridentSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; if (!setupDone) { setupDone = TRUE; xf86AddDriver(&TRIDENT, module, 0); - LoaderRefSymLists(vgahwSymbols, fbSymbols, i2cSymbols, vbeSymbols, - miscfbSymbols, ramdacSymbols, int10Symbols, - xaaSymbols, shadowSymbols, NULL); + LoaderModRefSymLists(module, vgahwSymbols, fbSymbols, i2cSymbols, + vbeSymbols, miscfbSymbols, ramdacSymbols, + int10Symbols, xaaSymbols, shadowSymbols, NULL); return (pointer)TRUE; } @@ -1048,10 +1054,14 @@ TRIDENTProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; - if (xf86LoadSubModule(pScrn, "vbe")) { + ModuleDescPtr pMod; + + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); + xf86UnloadSubModule(pMod); } } @@ -1075,6 +1085,7 @@ const char *Sym = ""; Bool ddcLoaded = FALSE; char *s; + ModuleDescPtr pMod; /* Allocate the TRIDENTRec driverPrivate */ if (!TRIDENTGetRec(pScrn)) { @@ -1165,10 +1176,10 @@ pix24bpp = xf86GetBppFromDepth(pScrn, 24); /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* * Allocate a vgaHWRec @@ -1184,10 +1195,10 @@ xf86SetOperatingState(resVga, pTrident->pEnt->index, ResUnusedOpr); /* The ramdac module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "ramdac")) + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) return FALSE; - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); /* * This must happen after pScrn->display has been set because @@ -1530,29 +1541,21 @@ * when MMIO is turned on! */ - if (xf86LoadSubModule(pScrn, "vbe")) { + if ((pMod = xf86LoadVBEModule(pScrn))) { xf86MonPtr pMon; vbeInfoPtr pVbe; - xf86LoaderReqSymLists(vbeSymbols, NULL); - pVbe = VBEInit(NULL,pTrident->pEnt->index); + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); + pVbe = VBEInit(NULL, pTrident->pEnt->index); pMon = vbeDoEDID(pVbe, NULL); -#ifdef VBE_INFO - { - VbeInfoBlock* vbeInfoBlockPtr; - if ((vbeInfoBlockPtr = VBEGetVBEInfo(pVbe))) { - pTrident->vbeModes = VBEBuildVbeModeList(pVbe,vbeInfoBlockPtr); - VBEFreeVBEInfo(vbeInfoBlockPtr); - } - } -#endif vbeFree(pVbe); + xf86UnloadSubModule(pMod); if (pMon) { - if (!xf86LoadSubModule(pScrn, "ddc")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ddc"))) { TRIDENTFreeRec(pScrn); return FALSE; } else { - xf86LoaderReqSymLists(ddcSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); xf86SetDDCproperties(pScrn,xf86PrintEDID(pMon)); ddcLoaded = TRUE; } @@ -2029,6 +2032,17 @@ chipset = "CyberBladeXP4"; pTrident->NewClockCode = TRUE; pTrident->frequency = NTSC; + case XP5: + pTrident->ddc1Read = Tridentddc1Read; + ramtype = "SGRAM"; + pTrident->HasSGRAM = TRUE; + pTrident->IsCyber = TRUE; + pTrident->shadowNew = TRUE; + pTrident->NoAccel = TRUE; /* for now */ + Support24bpp = TRUE; + chipset = "XP5"; + pTrident->NewClockCode = TRUE; + pTrident->frequency = NTSC; break; } @@ -2075,6 +2089,27 @@ pScrn->videoRam = pTrident->pEnt->device->videoRam; from = X_CONFIG; } else { + if (pTrident->Chipset == XP5) { + OUTB(vgaIOBase + 4, 0x60); + videoram = INB(vgaIOBase + 5); + switch (videoram & 0x7) { + case 0x00: + pScrn->videoRam = 131072; + break; + case 0x01: + pScrn->videoRam = 65536; + break; + case 0x02: + pScrn->videoRam = 32768; + break; + case 0x03: + pScrn->videoRam = 16384; + break; + case 0x04: + pScrn->videoRam = 8192; + break; + } + } else if (pTrident->Chipset == CYBER9525DVD) { pScrn->videoRam = 2560; } else @@ -2388,7 +2423,7 @@ break; } - if (mod && xf86LoadSubModule(pScrn, mod) == NULL) { + if (mod && !(pMod = xf86LoadSubModule(pScrn, mod))) { if (IsPciCard && UseMMIO) { TRIDENTDisableMMIO(pScrn); TRIDENTUnmapMem(pScrn); @@ -2399,13 +2434,13 @@ if (mod) { if (Sym) { - xf86LoaderReqSymbols(Sym, NULL); + xf86LoaderModReqSymbols(pMod, Sym, NULL); } else { - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); } } - if (!xf86LoadSubModule(pScrn, "i2c")) { + if (!(pMod = xf86LoadSubModule(pScrn, "i2c"))) { if (IsPciCard && UseMMIO) { TRIDENTDisableMMIO(pScrn); TRIDENTUnmapMem(pScrn); @@ -2414,20 +2449,20 @@ return FALSE; } - xf86LoaderReqSymLists(i2cSymbols, NULL); + xf86LoaderModReqSymLists(pMod, i2cSymbols, NULL); /* Load shadow if needed */ if (pTrident->ShadowFB) { - if (!xf86LoadSubModule(pScrn, "shadow")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadow"))) { TRIDENTFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } /* Load XAA if needed */ if (!pTrident->NoAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { if (IsPciCard && UseMMIO) { TRIDENTDisableMMIO(pScrn); TRIDENTUnmapMem(pScrn); @@ -2436,7 +2471,7 @@ return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); switch (pScrn->displayWidth * pScrn->bitsPerPixel / 8) { case 512: @@ -2459,7 +2494,7 @@ /* This gives us DDC1 - we should be able to get DDC2B using i2c */ if (! ddcLoaded) - if (!xf86LoadSubModule(pScrn, "ddc")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ddc"))) { if (IsPciCard && UseMMIO) { TRIDENTDisableMMIO(pScrn); TRIDENTUnmapMem(pScrn); @@ -2468,7 +2503,7 @@ return FALSE; } - xf86LoaderReqSymLists(ddcSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); if (IsPciCard && UseMMIO) { TRIDENTDisableMMIO(pScrn); @@ -2606,7 +2641,7 @@ TRIDENTPtr pTrident = TRIDENTPTR(pScrn); TRIDENTRegPtr tridentReg; - WAITFORVSYNC; + if (!xf86IsPc98()) WAITFORVSYNC; TridentFindClock(pScrn,mode->Clock); @@ -2632,6 +2667,7 @@ case BLADEXP: case CYBERBLADEXPAI1: case CYBERBLADEXP4: + case XP5: /* Get ready for MUX mode */ if (pTrident->MUX && pScrn->bitsPerPixel == 8 && @@ -2753,6 +2789,7 @@ VisualPtr visual; unsigned char *FBStart; int width, height, displayWidth; + ModuleDescPtr pMod; /* * First get the ScrnInfoRec @@ -2769,20 +2806,10 @@ if (!TRIDENTMapMem(pScrn)) return FALSE; - if (!xf86IsPc98()) { -#ifdef VBE_INFO - if (pTrident->vbeModes) { - pTrident->pVbe = VBEInit(NULL,pTrident->pEnt->index); - pTrident->Int10 = pTrident->pVbe->pInt10; - } else -#endif - { - if (xf86LoadSubModule(pScrn, "int10")) { - xf86LoaderReqSymLists(int10Symbols, NULL); - xf86DrvMsg(pScrn->scrnIndex,X_INFO,"Initializing int10\n"); - pTrident->Int10 = xf86InitInt10(pTrident->pEnt->index); - } - } + if (!xf86IsPc98() && (pMod = xf86LoadSubModule(pScrn, "int10"))) { + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); + xf86DrvMsg(pScrn->scrnIndex,X_INFO,"Initializing int10\n"); + pTrident->Int10 = xf86InitInt10(pTrident->pEnt->index); } hwp = VGAHWPTR(pScrn); @@ -2821,7 +2848,7 @@ * function. If not, the visuals will need to be setup before calling * a fb ScreenInit() function and fixed up after. * - * For most PC hardware at depths >= 8, the defaults that cfb uses + * For most PC hardware at depths >= 8, the defaults that fb uses * are not appropriate. In this driver, we fixup the visuals after. */ @@ -3635,26 +3662,6 @@ { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); - -#ifdef VBE_INFO - if (pTrident->vbeModes) { - vbeSaveRestoreRec vbesr; - vbesr.stateMode = VBECalcVbeModeIndex(pTrident->vbeModes, - mode, pScrn->bitsPerPixel); - vbesr.pstate = NULL; - if (vbesr.stateMode) { - if (IsPciCard && UseMMIO) - TRIDENTDisableMMIO(pScrn); - VBEVesaSaveRestore(pTrident->pVbe,&vbesr,MODE_RESTORE); - if (IsPciCard && UseMMIO) - TRIDENTEnableMMIO(pScrn); - return; - } else - xf86DrvMsg(pScrn->scrnIndex,X_WARNING,"No BIOS Mode matches " - "%ix%I@%ibpp\n",mode->HDisplay,mode->VDisplay, - pScrn->bitsPerPixel); - } -#endif /* This function is only for LCD screens, and also when we have * int10 available */ Index: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h diff -u xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h:1.28 xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h:1.29 --- xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h:1.28 Wed Jan 21 17:51:19 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h Fri Dec 16 19:43:10 2005 @@ -21,7 +21,7 @@ * * Author: Alan Hourihane, alanh@fairlite.demon.co.uk */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h,v 1.28 2004/01/21 22:51:19 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h,v 1.29 2005/12/17 00:43:10 dawes Exp $ */ #define DEBUG 1 @@ -202,10 +202,10 @@ /* Wait for VSync */ #define WAITFORVSYNC \ - { \ + do { \ while (hwp->readST01(hwp)&0x8) {}; \ while (!(hwp->readST01(hwp)&0x8)) {}; \ - } + } while (0) /* Defines for IMAGE Graphics Engine */ #define IMAGE_GE_STATUS 0x2164 @@ -216,7 +216,7 @@ #define BLADE_XP_GER_OPERMODE 0x2125 #define REPLICATE(r) \ -{ \ +do { \ if (pScrn->bitsPerPixel == 16) { \ r = ((r & 0xFFFF) << 16) | (r & 0xFFFF); \ } else \ @@ -225,16 +225,18 @@ r |= (r<<8); \ r |= (r<<16); \ } \ -} +} while (0) #define CHECKCLIPPING \ +do { \ if (pTrident->Clipping) { \ pTrident->Clipping = FALSE; \ if (pTrident->Chipset < PROVIDIA9682) { \ TGUI_SRCCLIP_XY(0,0); \ TGUI_DSTCLIP_XY(4095,2047); \ } \ - } + } \ +} while (0) /* Merge XY */ @@ -250,21 +252,21 @@ MMIO_IN32(pTrident->IOBase,(r)) #define OUTB(addr, data) \ -{ \ +do { \ if (IsPciCard && UseMMIO) { \ MMIO_OUT8(pTrident->IOBase, addr, data); \ } else { \ outb(pTrident->PIOBase + (addr), data); \ } \ -} +} while (0) #define OUTW(addr, data) \ -{ \ +do { \ if (IsPciCard && UseMMIO) { \ MMIO_OUT16(pTrident->IOBase, addr, data); \ } else { \ outw(pTrident->PIOBase + (addr), data); \ } \ -} +} while (0) #define INB(addr) \ ( \ (IsPciCard && UseMMIO) ? \ @@ -289,12 +291,14 @@ tridentReg->tridentRegs3CE[reg] = INB(0x3CF); #define VIDEOOUT(val,reg) \ +do { \ if (pTrident->Chipset >= CYBER9397) { \ OUTW(0x3C4, (val << 8) | reg); \ } else { \ OUTB(0x83C8, reg); \ OUTB(0x83C6, val); \ - } + } \ +} while (0) #define BLTBUSY(b) \ @@ -313,11 +317,11 @@ MMIO_OUT8(pTrident->IOBase, BLADE_XP_GER_OPERMODE, (c)) /* XXX */ #define OLDTGUI_OPERMODE(c) \ - { \ + do { \ MMIO_OUT16(pTrident->IOBase, OLDGER_MWIDTH, \ vga256InfoRec.displayWidth - 1); \ MMIO_OUT8(pTrident->IOBase, OLDGER_MFORMAT, (c)); \ - } + } while (0) #define TGUI_FCOLOUR(c) \ MMIO_OUT32(pTrident->IOBase, GER_FCOLOUR, (c)) #define TGUI_FPATCOL(c) \ Index: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c:1.47 xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c:1.51 --- xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c:1.47 Mon Mar 29 11:25:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c Fri Dec 9 04:12:47 2005 @@ -21,7 +21,7 @@ * * Author: Alan Hourihane, alanh@fairlite.demon.co.uk */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c,v 1.47 2004/03/29 16:25:22 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c,v 1.51 2005/12/09 09:12:47 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -35,7 +35,7 @@ #include "trident.h" #include "trident_regs.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "xaa.h" #include "dixstruct.h" #include "fourcc.h" @@ -666,7 +666,11 @@ OUTW(vgaIOBase + 4, ((width<<1) & 0xff00) | 0x91); OUTW(vgaIOBase + 4, ((offset) & 0xff) << 8 | 0x92); OUTW(vgaIOBase + 4, ((offset) & 0xff00) | 0x93); - OUTW(vgaIOBase + 4, ((offset) & 0x070000) >> 8 | 0x94); + if (pTrident->Chipset >= CYBER9397) { + OUTW(vgaIOBase + 4, ((offset) & 0x0f0000) >> 8 | 0x94); + } else { + OUTW(vgaIOBase + 4, ((offset) & 0x070000) >> 8 | 0x94); + } /* Horizontal Zoom */ if (pTrident->videoFlags & VID_ZOOM_INV) { @@ -1307,6 +1311,8 @@ * full vblank has passed. * - Alan. */ - WAITFORVSYNC; - WAITFORVSYNC; + if (!xf86IsPc98()) { + WAITFORVSYNC; + WAITFORVSYNC; + } } Index: xc/programs/Xserver/hw/xfree86/drivers/tseng/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/tseng/Imakefile:1.23 xc/programs/Xserver/hw/xfree86/drivers/tseng/Imakefile:1.26 --- xc/programs/Xserver/hw/xfree86/drivers/tseng/Imakefile:1.23 Mon May 31 20:17:03 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/tseng/Imakefile Fri Oct 14 11:16:48 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/Imakefile,v 1.23 2004/06/01 00:17:03 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/Imakefile,v 1.26 2005/10/14 15:16:48 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -58,22 +58,18 @@ tseng_dpms.o tseng_dga.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa \ -I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \ - -I$(XF86SRC)/xf24_32bpp -I$(SERVERSRC)/Xext \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ - -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ - -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(FONTINCSRC) \ - -I$(EXTINCSRC) -I$(SERVERSRC)/render + -I$(SERVERSRC)/Xext -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ + -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ + -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ + -I$(SERVERSRC)/include -I$(SERVERSRC)/render #endif -DEFINES = -DPSZ=8 - #if MakeHasPosixVariableSubstitutions SubdirLibraryRule($(OBJS)) #endif Index: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c:1.99 xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c:1.102 --- xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c:1.99 Fri Nov 26 08:45:05 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c Thu Mar 16 11:50:19 2006 @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c,v 1.99 2004/11/26 13:45:05 tsi Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c,v 1.102 2006/03/16 16:50:19 dawes Exp $ * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -26,11 +26,6 @@ * * Large parts rewritten for XFree86 4.0 by Koen Gadeyne. */ -/* $XConsortium: et4_driver.c /main/27 1996/10/28 04:48:15 kaleb $ */ - - - - /*** Generic includes ***/ @@ -50,7 +45,7 @@ #include "xf86int10.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> /*** Chip-specific includes ***/ @@ -297,7 +292,7 @@ XF86ModuleData tsengModuleData = { &tsengVersRec, tsengSetup, NULL }; static pointer -tsengSetup(pointer module, pointer opts, int *errmaj, int *errmin) +tsengSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -313,8 +308,8 @@ * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(vgaHWSymbols, miscfbSymbols, fbSymbols, xaaSymbols, - int10Symbols, ramdacSymbols, NULL); + LoaderModRefSymLists(module, vgaHWSymbols, miscfbSymbols, fbSymbols, + xaaSymbols, int10Symbols, ramdacSymbols, NULL); /* * The return value must be non-NULL on success even though there @@ -1534,6 +1529,7 @@ TsengPtr pTseng; MessageType from; int i; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) return FALSE; @@ -1568,9 +1564,9 @@ pTseng->pEnt = xf86GetEntityInfo(*pScrn->entityList); #if 1 - if (xf86LoadSubModule(pScrn, "int10")) { + if ((pMod = xf86LoadSubModule(pScrn, "int10"))) { xf86Int10InfoPtr pInt; - xf86LoaderReqSymLists(int10Symbols, NULL); + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); #if 1 xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n"); pInt = xf86InitInt10(pTseng->pEnt->index); @@ -1579,9 +1575,9 @@ } #endif - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgaHWSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgaHWSymbols, NULL); /* * Allocate a vgaHWRec */ @@ -1856,43 +1852,43 @@ /* Load bpp-specific modules */ switch (pScrn->bitsPerPixel) { case 1: - if (xf86LoadSubModule(pScrn, "xf1bpp") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "xf1bpp"))) { TsengFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymbols("xf1bppScreenInit", NULL); + xf86LoaderModReqSymbols(pMod, "xf1bppScreenInit", NULL); break; case 4: - if (xf86LoadSubModule(pScrn, "xf4bpp") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "xf4bpp"))) { TsengFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymbols("xf4bppScreenInit", NULL); + xf86LoaderModReqSymbols(pMod, "xf4bppScreenInit", NULL); break; default: - if (xf86LoadSubModule(pScrn, "fb") == NULL) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { TsengFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); break; } /* Load XAA if needed */ if (pTseng->UseAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { TsengFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } /* Load ramdac if needed */ if (pTseng->HWCursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { TsengFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } /* TsengLock(); */ Index: xc/programs/Xserver/hw/xfree86/drivers/v4l/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/v4l/Imakefile:1.7 xc/programs/Xserver/hw/xfree86/drivers/v4l/Imakefile:1.10 --- xc/programs/Xserver/hw/xfree86/drivers/v4l/Imakefile:1.7 Mon May 31 20:17:03 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/v4l/Imakefile Fri Oct 14 11:16:48 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/Imakefile,v 1.7 2004/06/01 00:17:03 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/Imakefile,v 1.10 2005/10/14 15:16:48 tsi Exp $ XCOMM XCOMM This is an Imakefile for the v4l Xv driver. XCOMM @@ -56,17 +56,10 @@ OBJS = v4l.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ - -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(XF86SRC)/xf24_32bpp -I$(FONTINCSRC) \ - -I$(XF86SRC)/xf8_32bpp -I$(XF86SRC)/xf1bpp \ - -I$(XF86SRC)/xf4bpp -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c -I$(EXTINCSRC) +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ + -I$(SERVERSRC)/include #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c diff -u xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c:1.34 xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c:1.36 --- xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c:1.34 Wed Dec 31 01:08:53 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c Thu Mar 16 11:50:20 2006 @@ -2,7 +2,7 @@ * video4linux Xv Driver * based on Michael Schimek's permedia 2 driver. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c,v 1.34 2003/12/31 06:08:53 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c,v 1.36 2006/03/16 16:50:20 dawes Exp $ */ #include "videodev.h" #include "xf86.h" @@ -12,7 +12,7 @@ #include "xf86PciInfo.h" #include "xf86fbman.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "regionstr.h" #include "dgaproc.h" #include "xf86str.h" @@ -61,7 +61,7 @@ XF86ModuleData v4lModuleData = { &v4lVersRec, v4lSetup, NULL }; static pointer -v4lSetup(pointer module, pointer opts, int *errmaj, int *errmin) +v4lSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { const char *osname; static Bool setupDone = FALSE; Index: xc/programs/Xserver/hw/xfree86/drivers/v4l/videodev.h diff -u xc/programs/Xserver/hw/xfree86/drivers/v4l/videodev.h:1.8 xc/programs/Xserver/hw/xfree86/drivers/v4l/videodev.h:1.9 --- xc/programs/Xserver/hw/xfree86/drivers/v4l/videodev.h:1.8 Sat Mar 3 17:46:31 2001 +++ xc/programs/Xserver/hw/xfree86/drivers/v4l/videodev.h Fri Oct 14 11:16:48 2005 @@ -7,9 +7,9 @@ * Used here with the explicit permission of the original author, Alan Cox. * <alan@lxorguk.ukuu.org.uk> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/videodev.h,v 1.8 2001/03/03 22:46:31 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/videodev.h,v 1.9 2005/10/14 15:16:48 tsi Exp $ */ -#include "Xmd.h" +#include <X11/Xmd.h> #define VID_TYPE_CAPTURE 1 /* Can capture */ #define VID_TYPE_TUNER 2 /* Can tune */ Index: xc/programs/Xserver/hw/xfree86/drivers/vesa/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/vesa/Imakefile:1.9 xc/programs/Xserver/hw/xfree86/drivers/vesa/Imakefile:1.11 --- xc/programs/Xserver/hw/xfree86/drivers/vesa/Imakefile:1.9 Mon May 31 20:17:03 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/vesa/Imakefile Fri Oct 14 11:16:48 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/Imakefile,v 1.9 2004/06/01 00:17:03 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/Imakefile,v 1.11 2005/10/14 15:16:48 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -54,18 +54,15 @@ OBJS = vesa.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(SERVERSRC)/fb -I$(XF86SRC)/xf4bpp -I$(XF86SRC)/xf1bpp \ - -I$(XF86SRC)/xf24_32bpp \ +INCLUDES = -I$(SERVERSRC)/fb -I$(XF86SRC)/xf4bpp -I$(XF86SRC)/xf1bpp \ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/afb -I$(SERVERSRC)/mi \ -I$(SERVERSRC)/miext/shadow -I$(SERVERSRC)/render \ - -I$(XF86SRC)/vgahw \ - -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ - -I$(SERVERSRC)/include -I$(FONTINCSRC) -I$(XINCLUDESRC)\ + -I$(XF86SRC)/vgahw -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/include \ -I$(XF86SRC)/rac -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(XF86SRC)/vbe -I$(XF86SRC)/int10 \ - -I$(EXTINCSRC) + -I$(XF86SRC)/vbe -I$(XF86SRC)/int10 #endif #if MakeHasPosixVariableSubstitutions Index: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c diff -u xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c:1.47 xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c:1.55 --- xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c:1.47 Fri Feb 25 22:18:38 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c Thu Mar 16 11:50:20 2006 @@ -28,7 +28,7 @@ * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * David Dawes <dawes@xfree86.org> * - * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.47 2005/02/26 03:18:38 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.55 2006/03/16 16:50:20 dawes Exp $ */ /* * Copyright (c) 2000-2005 by The XFree86 Project, Inc. @@ -91,7 +91,7 @@ /* DPMS */ #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> /* Mandatory functions */ static const OptionInfoRec * VESAAvailableOptions(int chipid, int busid); @@ -113,7 +113,7 @@ static void VESADisplayPowerManagementSet(ScrnInfoPtr pScrn, int mode, - int flags); + int flags); /* locally used functions */ static int VESAFindIsaDevice(GDevPtr dev); @@ -122,10 +122,10 @@ static int VESABankSwitch(ScreenPtr pScreen, unsigned int iBank); static void VESALoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual); -static void SaveFonts(ScrnInfoPtr pScrn); -static void RestoreFonts(ScrnInfoPtr pScrn); -static Bool -VESASaveRestore(ScrnInfoPtr pScrn, vbeSaveRestoreFunction function); +static void VESASavePlanes(ScrnInfoPtr pScrn); +static void VESARestorePlanes(ScrnInfoPtr pScrn); +static Bool VESASaveRestore(ScrnInfoPtr pScrn, + vbeSaveRestoreFunction function); static void *VESAWindowPlanar(ScreenPtr pScrn, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure); @@ -136,7 +136,7 @@ static Bool VESADGAInit(ScrnInfoPtr pScrn, ScreenPtr pScreen); -/* +/* * This contains the functions needed by the server after loading the * driver module. It must be supplied, and gets added the driver list by * the Module Setup funtion in the dynamic case. In the static case a @@ -162,27 +162,29 @@ static SymTabRec VESAChipsets[] = { {CHIP_VESA_GENERIC, "vesa"}, - {-1, NULL} + {-1, NULL} }; static PciChipsets VESAPCIchipsets[] = { { CHIP_VESA_GENERIC, PCI_CHIP_VGA, RES_SHARED_VGA }, - { -1, -1, RES_UNDEFINED }, + { -1, -1, RES_UNDEFINED }, }; static IsaChipsets VESAISAchipsets[] = { {CHIP_VESA_GENERIC, RES_EXCLUSIVE_VGA}, - {-1, 0 } + {-1, 0 } }; typedef enum { OPTION_SHADOW_FB, - OPTION_DFLT_REFRESH + OPTION_DFLT_REFRESH, + OPTION_VBE_BIG_ENDIAN } VESAOpts; static const OptionInfoRec VESAOptions[] = { { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_DFLT_REFRESH, "DefaultRefresh", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_VBE_BIG_ENDIAN, "VBEBigEndian", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; @@ -190,8 +192,8 @@ * List of symbols from other modules that this module references. This * list is used to tell the loader that it is OK for symbols here to be * unresolved providing that it hasn't been told that they haven't been - * told that they are essential via a call to xf86LoaderReqSymbols() or - * xf86LoaderReqSymLists(). The purpose is this is to avoid warnings about + * told that they are essential via a call to xf86LoaderModReqSymbols() or + * xf86LoaderModReqSymLists(). The purpose is this is to avoid warnings about * unresolved symbols that are not required. */ #ifdef XFree86LOADER @@ -223,7 +225,9 @@ "VBEBankSwitch", "VBEExtendedInit", "VBEFindSupportedDepths", + "VBEFreeVBEInfo", "VBEGetModeInfo", + "VBEGetModePool", "VBEGetVBEInfo", "VBEGetVBEMode", "VBEPrintModes", @@ -241,14 +245,13 @@ NULL }; -#ifdef XFree86LOADER static const char *ddcSymbols[] = { "xf86PrintEDID", "xf86SetDDCproperties", NULL }; - +#ifdef XFree86LOADER /* Module loader interface */ static MODULESETUPPROTO(vesaSetup); @@ -273,7 +276,7 @@ XF86ModuleData vesaModuleData = { &vesaVersionRec, vesaSetup, NULL }; static pointer -vesaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor) +vesaSetup(ModuleDescPtr Module, pointer Options, int *ErrorMajor, int *ErrorMinor) { static Bool Initialised = FALSE; @@ -281,12 +284,13 @@ { Initialised = TRUE; xf86AddDriver(&VESA, Module, 0); - LoaderRefSymLists(miscfbSymbols, - fbSymbols, - shadowSymbols, - vbeSymbols, - ddcSymbols, - NULL); + LoaderModRefSymLists(Module, + miscfbSymbols, + fbSymbols, + shadowSymbols, + vbeSymbols, + ddcSymbols, + NULL); return (pointer)TRUE; } @@ -334,7 +338,7 @@ /* PCI BUS */ if (xf86GetPciVideoInfo()) { numUsed = xf86MatchPciInstances(VESA_NAME, PCI_VENDOR_GENERIC, - VESAChipsets, VESAPCIchipsets, + VESAChipsets, VESAPCIchipsets, devSections, numDevSections, drv, &usedChips); if (numUsed > 0) { @@ -379,7 +383,7 @@ if ((pScrn = xf86ConfigIsaEntity(pScrn, 0,usedChips[i], VESAISAchipsets, NULL, NULL, NULL, NULL, NULL))) { - + pScrn->driverVersion = VESA_VERSION; pScrn->driverName = VESA_DRIVER_NAME; pScrn->name = VESA_NAME; @@ -431,7 +435,7 @@ VESAGetRec(ScrnInfoPtr pScrn) { if (!pScrn->driverPrivate) - pScrn->driverPrivate = xcalloc(sizeof(VESARec), 1); + pScrn->driverPrivate = xnfcalloc(sizeof(VESARec), 1); return ((VESAPtr)pScrn->driverPrivate); } @@ -462,10 +466,11 @@ } #endif xfree(pVesa->monitor); - xfree(pVesa->vbeInfo); + if (pVesa->vbeInfo) + VBEFreeVBEInfo(pVesa->vbeInfo); xfree(pVesa->pal); xfree(pVesa->savedPal); - xfree(pVesa->fonts); + xfree(pVesa->planes); xfree(pScrn->driverPrivate); pScrn->driverPrivate = NULL; } @@ -483,9 +488,10 @@ VbeModeInfoBlock *mode; char *mod = NULL; const char *reqSym = NULL; - Gamma gzeros = {0.0, 0.0, 0.0}; - rgb rzeros = {0, 0, 0}; - pointer pDDCModule; + static const Gamma defaultGamma = {0.0, 0.0, 0.0}; + static const rgb defaultWeight = {0, 0, 0}; + rgb defaultMask = {0, 0, 0}; + ModuleDescPtr pDDCModule = NULL, pVBEModule, pMod = NULL; int i; int flags24 = 0; int defaultDepth = 0; @@ -499,24 +505,16 @@ pVesa->device = xf86GetDevFromEntity(pScrn->entityList[0], pScrn->entityInstanceList[0]); -#if 0 - /* Load vgahw module */ - if (!xf86LoadSubModule(pScrn, "vgahw")) - return (FALSE); - - xf86LoaderReqSymLists(vgahwSymbols, NULL); -#endif - /* Load vbe module */ - if (!xf86LoadSubModule(pScrn, "vbe")) - return (FALSE); + if (!(pVBEModule = xf86LoadVBEModule(pScrn))) + return (FALSE); - xf86LoaderReqSymLists(vbeSymbols, NULL); + xf86LoaderModReqSymLists(pVBEModule, vbeSymbols, NULL); if ((pVesa->pVbe = VBEExtendedInit(NULL, pVesa->pEnt->index, - SET_BIOS_SCRATCH - | RESTORE_BIOS_SCRATCH)) == NULL) - return (FALSE); + SET_BIOS_SCRATCH + | RESTORE_BIOS_SCRATCH)) == NULL) + return (FALSE); if (pVesa->pEnt->location.type == BUS_PCI) { pVesa->pciInfo = xf86GetPciInfoForEntity(pVesa->pEnt->index); @@ -546,17 +544,25 @@ V_MODETYPE_VBE); /* Preferred order for default depth selection. */ +#if X_BYTE_ORDER == X_LITTLE_ENDIAN + /* These defaults aren't appropriate for big-endian systems */ if (depths & V_DEPTH_16) defaultDepth = 16; - else if (depths & V_DEPTH_15) + else + if (depths & V_DEPTH_15) defaultDepth = 15; - else if (depths & V_DEPTH_8) + else +#endif + if (depths & V_DEPTH_8) defaultDepth = 8; - else if (depths & V_DEPTH_24) + else + if (depths & V_DEPTH_24) defaultDepth = 24; - else if (depths & V_DEPTH_4) + else + if (depths & V_DEPTH_4) defaultDepth = 4; - else if (depths & V_DEPTH_1) + else + if (depths & V_DEPTH_1) defaultDepth = 1; /* @@ -571,61 +577,129 @@ flags24 |= SupportConvert32to24 | PreferConvert32to24; if (!xf86SetDepthBpp(pScrn, defaultDepth, 0, 0, flags24)) { - vbeFree(pVesa->pVbe); + vbeFree(pVesa->pVbe); + pVesa->pVbe = NULL; return (FALSE); } - xf86PrintDepthBpp(pScrn); - /* color weight */ - if (pScrn->depth > 8 && !xf86SetWeight(pScrn, rzeros, rzeros)) { - vbeFree(pVesa->pVbe); - return (FALSE); - } - /* visual init */ - if (!xf86SetDefaultVisual(pScrn, -1)) { - vbeFree(pVesa->pVbe); - return (FALSE); - } + xf86PrintDepthBpp(pScrn); /* options */ xf86CollectOptions(pScrn, NULL); - if (!(pVesa->Options = xalloc(sizeof(VESAOptions)))) { - vbeFree(pVesa->pVbe); + if (!(pVesa->Options = xnfalloc(sizeof(VESAOptions)))) { + vbeFree(pVesa->pVbe); + pVesa->pVbe = NULL; return FALSE; } memcpy(pVesa->Options, VESAOptions, sizeof(VESAOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pVesa->Options); - xf86SetGamma(pScrn, gzeros); +#if X_BYTE_ORDER == X_BIG_ENDIAN + + /* The default is to assume all apertures are little-endian */ + if (!xf86ReturnOptValBool(pVesa->Options, OPTION_VBE_BIG_ENDIAN, FALSE)) { + if ((pScrn->depth == 24) && (pScrn->bitsPerPixel == 24)) { + /* + * For bpp 24, the common layer's xf86SetWeight() sets a default of + * 'RGB'. Byte-swap this to 'BGR'. + */ + defaultMask.red = 0x000000FF; + defaultMask.green = 0x0000FF00; + defaultMask.blue = 0x00FF0000; + } else if ((pScrn->depth == 24) && (pScrn->bitsPerPixel == 32)) { + /* + * For bpp 32, the common layer's xf86SetWeight() sets a default of + * 'aRGB'. Byte-swap this to 'BGRa'. + */ + defaultMask.red = 0x0000FF00; + defaultMask.green = 0x00FF0000; + defaultMask.blue = 0xFF000000; + } else if (pScrn->bitsPerPixel > 8) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Support for depth %d fbbpp" + " %d requires a big-endian aperture\n", + pScrn->depth, pScrn->bitsPerPixel); + vbeFree(pVesa->pVbe); + pVesa->pVbe = NULL; + return FALSE; + } + } + +#endif + + /* color weight */ + if (pScrn->depth > 8 && !xf86SetWeight(pScrn, defaultWeight, defaultMask)) { + vbeFree(pVesa->pVbe); + pVesa->pVbe = NULL; + return (FALSE); + } + + /* visual init */ + if (!xf86SetDefaultVisual(pScrn, -1)) { + vbeFree(pVesa->pVbe); + pVesa->pVbe = NULL; + return (FALSE); + } + + xf86SetGamma(pScrn, defaultGamma); if (pVesa->major >= 2) { /* Load ddc module */ - if ((pDDCModule = xf86LoadSubModule(pScrn, "ddc")) == NULL) { + if (!(pDDCModule = xf86LoadSubModule(pScrn, "ddc"))) { vbeFree(pVesa->pVbe); + pVesa->pVbe = NULL; return (FALSE); } + xf86LoaderModReqSymLists(pDDCModule, ddcSymbols, NULL); if ((pVesa->monitor = vbeDoEDID(pVesa->pVbe, pDDCModule)) != NULL) { xf86PrintEDID(pVesa->monitor); } - xf86UnloadSubModule(pDDCModule); } - if ((pScrn->monitor->DDC = pVesa->monitor) != NULL) + if ((pScrn->monitor->DDC = pVesa->monitor) != NULL) { xf86SetDDCproperties(pScrn, pVesa->monitor); + /* This test is probably not entirely accurate */ + if (pVesa->monitor->features.input_type) { + /* + * For digital panels, ignore any sync tolerance specifications in + * XF86Config monitor sections. This assumes the BIOS is smart + * enough to deal with the panel's tolerances by stretching and/or + * centering modes, and disallowing modes larger than the panel. + */ + if (pScrn->monitor->nHsync > 0) { + xf86DrvMsg(pScrn->scrnIndex, X_NOTICE, + "Ignoring XF86Config HorizSync specification(s) for" + " digital panel\n"); + pScrn->monitor->nHsync = 0; + } + + if (pScrn->monitor->nVrefresh > 0) { + xf86DrvMsg(pScrn->scrnIndex, X_NOTICE, + "Ignoring XF86Config VertRefresh specification(s)" + " for digital panel\n"); + pScrn->monitor->nVrefresh = 0; + } + + pScrn->monitor->flags |= MON_TOLERANCES_OPTIONAL; + pVesa->defaultRefresh = TRUE; + } + } + if (pDDCModule) + xf86UnloadSubModule(pDDCModule); + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, DEBUG_VERB, - "Searching for matching VESA mode(s):\n"); + "Searching for matching VESA mode(s):\n"); /* * Check the available BIOS modes, and extract those that match the * requirements into the modePool. Note: modePool is a NULL-terminated * list. */ - pScrn->modePool = VBEGetModePool (pScrn, pVesa->pVbe, pVesa->vbeInfo, - V_MODETYPE_VBE); + pScrn->modePool = VBEGetModePool(pScrn, pVesa->pVbe, pVesa->vbeInfo, + V_MODETYPE_VBE); xf86ErrorFVerb(DEBUG_VERB, "\n"); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, DEBUG_VERB, @@ -635,13 +709,14 @@ pVesa->mapSize = vbe->TotalMemory * 65536; if (pScrn->modePool == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No matching modes\n"); - vbeFree(pVesa->pVbe); + vbeFree(pVesa->pVbe); + pVesa->pVbe = NULL; return (FALSE); } VBESetModeNames(pScrn->modePool); - i = VBEValidateModes(pScrn, NULL, pScrn->display->modes, + i = VBEValidateModes(pScrn, NULL, pScrn->display->modes, NULL, NULL, 0, 2048, 1, 0, 2048, pScrn->display->virtualX, pScrn->display->virtualY, @@ -649,7 +724,8 @@ if (i <= 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes\n"); - vbeFree(pVesa->pVbe); + vbeFree(pVesa->pVbe); + pVesa->pVbe = NULL; return (FALSE); } @@ -674,12 +750,13 @@ if (pScrn->modes == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes\n"); - vbeFree(pVesa->pVbe); + vbeFree(pVesa->pVbe); + pVesa->pVbe = NULL; return (FALSE); } /* Use shadow by default */ - if (xf86ReturnOptValBool(pVesa->Options, OPTION_SHADOW_FB, TRUE)) + if (xf86ReturnOptValBool(pVesa->Options, OPTION_SHADOW_FB, TRUE)) pVesa->shadowFB = TRUE; if (xf86ReturnOptValBool(pVesa->Options, OPTION_DFLT_REFRESH, FALSE)) @@ -701,9 +778,7 @@ case 0x3: /* Planar */ if (pVesa->shadowFB) { mod = "fb"; - pScrn->bitmapBitOrder = BITMAP_BIT_ORDER; - - xf86LoaderReqSymbols("fbPictureInit", NULL); + pScrn->bitmapBitOrder = BITMAP_BIT_ORDER; } else { switch (pScrn->bitsPerPixel) { @@ -725,7 +800,7 @@ case 0x4: /* Packed pixel */ case 0x6: /* Direct Color */ mod = "fb"; - pScrn->bitmapBitOrder = BITMAP_BIT_ORDER; + pScrn->bitmapBitOrder = BITMAP_BIT_ORDER; switch (pScrn->bitsPerPixel) { case 8: @@ -737,6 +812,7 @@ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unsupported bpp: %d", pScrn->bitsPerPixel); vbeFree(pVesa->pVbe); + pVesa->pVbe = NULL; return FALSE; } break; @@ -745,31 +821,34 @@ if (pVesa->shadowFB) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using \"Shadow Framebuffer\"\n"); if (pScrn->depth == 1) { - mod = "mfb"; + mod = "mfb"; reqSym = "mfbScreenInit"; } - if (!xf86LoadSubModule(pScrn, "shadow")) { + if (!(pMod = xf86LoadSubModule(pScrn, "shadow"))) { vbeFree(pVesa->pVbe); + pVesa->pVbe = NULL; return (FALSE); } - xf86LoaderReqSymLists(shadowSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } - if (mod && xf86LoadSubModule(pScrn, mod) == NULL) { + if (mod && !(pMod = xf86LoadSubModule(pScrn, mod))) { VESAFreeRec(pScrn); - vbeFree(pVesa->pVbe); + vbeFree(pVesa->pVbe); + pVesa->pVbe = NULL; return (FALSE); } if (mod) { if (reqSym) { - xf86LoaderReqSymbols(reqSym, NULL); + xf86LoaderModReqSymbols(pMod, reqSym, NULL); } else { - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); } } vbeFree(pVesa->pVbe); + pVesa->pVbe = NULL; return (TRUE); } @@ -788,7 +867,7 @@ if ((pVesa->pVbe = VBEExtendedInit(NULL, pVesa->pEnt->index, SET_BIOS_SCRATCH | RESTORE_BIOS_SCRATCH)) == NULL) - return (FALSE); + return (FALSE); mode = ((VbeModeInfoData*)(pScrn->currentMode->Private))->data; if (pVesa->mapPhys == 0) { @@ -870,13 +949,13 @@ return (FALSE); case 0x3: /* Planar */ if (pVesa->shadowFB) { - if (pScrn->depth == 1) { + if (pScrn->depth == 1) { if (!mfbScreenInit(pScreen, pVesa->shadowPtr, pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth)) - return FALSE; + return FALSE; } else { if (!fbScreenInit(pScreen, pVesa->shadowPtr, @@ -1024,7 +1103,7 @@ /* Report any unused options (only for the first generation) */ if (serverGeneration == 1) - xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); + xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); return (TRUE); } @@ -1161,31 +1240,33 @@ pScrn->memPhysBase = pVesa->mapPhys; pScrn->fbOffset = pVesa->mapOff; - if (pVesa->mapPhys != 0xa0000 && pVesa->pEnt->location.type == BUS_PCI) - pVesa->base = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pVesa->pciTag, pScrn->memPhysBase, - pVesa->mapSize); + pVesa->ioBase = pScrn->domainIOBase; + + if (pVesa->pEnt->location.type == BUS_PCI) + pVesa->VGAbase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, + pVesa->pciTag, 0x0a0000, 0x010000); else - pVesa->base = xf86MapDomainMemory(pScrn->scrnIndex, 0, pVesa->pciTag, - pScrn->memPhysBase, pVesa->mapSize); + pVesa->VGAbase = xf86MapVidMem(pScrn->scrnIndex, VIDMEM_MMIO, + 0x0a0000, 0x010000); - if (pVesa->base) { - if (pVesa->mapPhys != 0xa0000) - pVesa->VGAbase = xf86MapDomainMemory(pScrn->scrnIndex, 0, - pVesa->pciTag, - 0xa0000, 0x10000); + if (pVesa->VGAbase != NULL) { + if (pVesa->mapPhys == 0x0a0000) + pVesa->base = pVesa->VGAbase; + else if (pVesa->pEnt->location.type == BUS_PCI) + pVesa->base = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, + pVesa->pciTag, pScrn->memPhysBase, + pVesa->mapSize); else - pVesa->VGAbase = pVesa->base; + pVesa->base = xf86MapVidMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, + pScrn->memPhysBase, pVesa->mapSize); } - pVesa->ioBase = pScrn->domainIOBase; - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, DEBUG_VERB, "virtual address = %p,\n" "\tphysical address = 0x%lx, size = %ld\n", pVesa->base, pScrn->memPhysBase, pVesa->mapSize); - return (pVesa->base != NULL); + return pVesa->base != NULL; } static void @@ -1267,7 +1348,7 @@ int base; if (pVesa->pal == NULL) - pVesa->pal = xcalloc(1, sizeof(CARD32) * 256); + pVesa->pal = xnfcalloc(1, sizeof(CARD32) * 256); for (i = 0, base = idx = indices[i]; i < numColors; i++, idx++) { int j = indices[i]; @@ -1382,12 +1463,12 @@ } static void -SaveFonts(ScrnInfoPtr pScrn) +VESASavePlanes(ScrnInfoPtr pScrn) { VESAPtr pVesa = VESAGetRec(pScrn); - unsigned char miscOut, attr10, gr4, gr5, gr6, seq2, seq4, scrn; + CARD8 miscOut, attr10, gr1, gr3, gr4, gr5, gr6, gr8, seq2, seq4, scrn; - if (pVesa->fonts != NULL) + if (pVesa->planes != NULL) return; /* If in graphics mode, don't save anything */ @@ -1395,13 +1476,22 @@ if (attr10 & 0x01) return; - pVesa->fonts = xalloc(16384); + /* Ensure bank 0 (ignoring error returns) */ + (void) VBEBankSwitch(pVesa->pVbe, 0, 0); + (void) VBEBankSwitch(pVesa->pVbe, 0, 1); + pVesa->curBank = -1; + + /* Save the first 64K of all four planes */ + pVesa->planes = xnfalloc(4 * 0x010000); /* save the registers that are needed here */ miscOut = ReadMiscOut(); + gr1 = ReadGr(pVesa, 0x01); + gr3 = ReadGr(pVesa, 0x03); gr4 = ReadGr(pVesa, 0x04); gr5 = ReadGr(pVesa, 0x05); gr6 = ReadGr(pVesa, 0x06); + gr8 = ReadGr(pVesa, 0x08); seq2 = ReadSeq(pVesa, 0x02); seq4 = ReadSeq(pVesa, 0x04); @@ -1414,22 +1504,32 @@ SeqReset(pVesa, FALSE); WriteAttr(pVesa, 0x10, 0x01); /* graphics mode */ - - /*font1 */ - WriteSeq(0x02, 0x04); /* write to plane 2 */ - WriteSeq(0x04, 0x06); /* enable plane graphics */ - WriteGr(0x04, 0x02); /* read plane 2 */ - WriteGr(0x05, 0x00); /* write mode 0, read mode 0 */ - WriteGr(0x06, 0x05); /* set graphics */ - slowbcopy_frombus(pVesa->VGAbase, pVesa->fonts, 8192); - - /* font2 */ - WriteSeq(0x02, 0x08); /* write to plane 3 */ - WriteSeq(0x04, 0x06); /* enable plane graphics */ - WriteGr(0x04, 0x03); /* read plane 3 */ - WriteGr(0x05, 0x00); /* write mode 0, read mode 0 */ - WriteGr(0x06, 0x05); /* set graphics */ - slowbcopy_frombus(pVesa->VGAbase, pVesa->fonts + 8192, 8192); + WriteSeq(0x04, 0x06); /* enable plane graphics */ + WriteGr(0x01, 0x00); /* all planes come from CPU */ + WriteGr(0x03, 0x00); /* don't rotate, write unmodified */ + WriteGr(0x05, 0x00); /* write mode 0, read mode 0 */ + WriteGr(0x06, 0x05); /* set graphics */ + WriteGr(0x08, 0xFF); /* write all bits in a byte */ + + /* plane0 */ + WriteSeq(0x02, 0x01); /* write to plane 0 */ + WriteGr(0x04, 0x00); /* read plane 0 */ + slowbcopy_frombus(pVesa->VGAbase, pVesa->planes + 0 * 0x010000, 0x010000); + + /* plane1 */ + WriteSeq(0x02, 0x02); /* write to plane 1 */ + WriteGr(0x04, 0x01); /* read plane 1 */ + slowbcopy_frombus(pVesa->VGAbase, pVesa->planes + 1 * 0x010000, 0x010000); + + /* plane2 */ + WriteSeq(0x02, 0x04); /* write to plane 2 */ + WriteGr(0x04, 0x02); /* read plane 2 */ + slowbcopy_frombus(pVesa->VGAbase, pVesa->planes + 2 * 0x010000, 0x010000); + + /* plane3 */ + WriteSeq(0x02, 0x08); /* write to plane 3 */ + WriteGr(0x04, 0x03); /* read plane 3 */ + slowbcopy_frombus(pVesa->VGAbase, pVesa->planes + 3 * 0x010000, 0x010000); scrn = ReadSeq(pVesa, 0x01) & ~0x20; SeqReset(pVesa, TRUE); @@ -1440,23 +1540,28 @@ WriteAttr(pVesa, 0x10, attr10); WriteSeq(0x02, seq2); WriteSeq(0x04, seq4); + WriteGr(0x01, gr1); + WriteGr(0x03, gr3); WriteGr(0x04, gr4); WriteGr(0x05, gr5); WriteGr(0x06, gr6); + WriteGr(0x08, gr8); WriteMiscOut(miscOut); } static void -RestoreFonts(ScrnInfoPtr pScrn) +VESARestorePlanes(ScrnInfoPtr pScrn) { VESAPtr pVesa = VESAGetRec(pScrn); - unsigned char miscOut, attr10, gr1, gr3, gr4, gr5, gr6, gr8, seq2, seq4, scrn; + CARD8 miscOut, attr10, gr1, gr3, gr4, gr5, gr6, gr8, seq2, seq4, scrn; - if (pVesa->fonts == NULL) + if (pVesa->planes == NULL) return; - if (pVesa->mapPhys == 0xa0000 && pVesa->curBank != 0) - VESABankSwitch(pScrn->pScreen, 0); + /* Ensure bank 0 (ignoring error returns) */ + (void) VBEBankSwitch(pVesa->pVbe, 0, 0); + (void) VBEBankSwitch(pVesa->pVbe, 0, 1); + pVesa->curBank = -1; /* save the registers that are needed here */ miscOut = ReadMiscOut(); @@ -1479,26 +1584,28 @@ SeqReset(pVesa, FALSE); WriteAttr(pVesa, 0x10, 0x01); /* graphics mode */ - if (pScrn->depth == 4) { - /* GJA */ - WriteGr(0x03, 0x00); /* don't rotate, write unmodified */ - WriteGr(0x08, 0xFF); /* write all bits in a byte */ - WriteGr(0x01, 0x00); /* all planes come from CPU */ - } - - WriteSeq(0x02, 0x04); /* write to plane 2 */ - WriteSeq(0x04, 0x06); /* enable plane graphics */ - WriteGr(0x04, 0x02); /* read plane 2 */ - WriteGr(0x05, 0x00); /* write mode 0, read mode 0 */ - WriteGr(0x06, 0x05); /* set graphics */ - slowbcopy_tobus(pVesa->fonts, pVesa->VGAbase, 8192); - - WriteSeq(0x02, 0x08); /* write to plane 3 */ - WriteSeq(0x04, 0x06); /* enable plane graphics */ - WriteGr(0x04, 0x03); /* read plane 3 */ - WriteGr(0x05, 0x00); /* write mode 0, read mode 0 */ - WriteGr(0x06, 0x05); /* set graphics */ - slowbcopy_tobus(pVesa->fonts + 8192, pVesa->VGAbase, 8192); + WriteSeq(0x04, 0x06); /* enable plane graphics */ + WriteGr(0x01, 0x00); /* all planes come from CPU */ + WriteGr(0x03, 0x00); /* don't rotate, write unmodified */ + WriteGr(0x05, 0x00); /* write mode 0, read mode 0 */ + WriteGr(0x06, 0x05); /* set graphics */ + WriteGr(0x08, 0xFF); /* write all bits in a byte */ + + WriteSeq(0x02, 0x01); /* write to plane 0 */ + WriteGr(0x04, 0x00); /* read plane 0 */ + slowbcopy_tobus(pVesa->planes + 0 * 0x010000, pVesa->VGAbase, 0x010000); + + WriteSeq(0x02, 0x02); /* write to plane 1 */ + WriteGr(0x04, 0x01); /* read plane 1 */ + slowbcopy_tobus(pVesa->planes + 1 * 0x010000, pVesa->VGAbase, 0x010000); + + WriteSeq(0x02, 0x04); /* write to plane 2 */ + WriteGr(0x04, 0x02); /* read plane 2 */ + slowbcopy_tobus(pVesa->planes + 2 * 0x010000, pVesa->VGAbase, 0x010000); + + WriteSeq(0x02, 0x08); /* write to plane 3 */ + WriteGr(0x04, 0x03); /* read plane 3 */ + slowbcopy_tobus(pVesa->planes + 3 * 0x010000, pVesa->VGAbase, 0x010000); scrn = ReadSeq(pVesa, 0x01) & ~0x20; SeqReset(pVesa, TRUE); @@ -1555,7 +1662,7 @@ return (TRUE); } -static int +static int VESABankSwitch(ScreenPtr pScreen, unsigned int iBank) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; @@ -1564,9 +1671,9 @@ if (pVesa->curBank == iBank) return (0); if (!VBEBankSwitch(pVesa->pVbe, iBank, 0)) - return (1); + return (1); if (pVesa->bankSwitchWindowB) { - if (!VBEBankSwitch(pVesa->pVbe, iBank, 1)) + if (!VBEBankSwitch(pVesa->pVbe, iBank, 1)) return (1); } pVesa->curBank = iBank; @@ -1579,7 +1686,7 @@ { VESAPtr pVesa; - if (MODE_QUERY < 0 || function > MODE_RESTORE) + if ((function < MODE_QUERY) || (function > MODE_RESTORE)) return (FALSE); pVesa = VESAGetRec(pScrn); @@ -1591,21 +1698,26 @@ /* Make sure we save at least this information in case of failure */ (void)VBEGetVBEMode(pVesa->pVbe, &pVesa->stateMode); - SaveFonts(pScrn); + VESASavePlanes(pScrn); - if (pVesa->major > 1) { + /* This only for VESA modes */ + if ((pVesa->stateMode & 0x0100) && (pVesa->major > 1)) { if (!VBESaveRestore(pVesa->pVbe,function,(pointer)&pVesa->state, &pVesa->stateSize,&pVesa->statePage)) - return FALSE; + return FALSE; } } /* Save/Restore Super VGA state */ if (function != MODE_QUERY) { - Bool retval = TRUE; + Bool retval = TRUE; + + if (function == MODE_RESTORE) + VBESetVBEMode(pVesa->pVbe, pVesa->stateMode, NULL); - if (pVesa->major > 1) { + /* This only for VESA modes */ + if ((pVesa->stateMode & 0x0100) && (pVesa->major > 1)) { if (function == MODE_RESTORE) memcpy(pVesa->state, pVesa->pstate, pVesa->stateSize); @@ -1613,17 +1725,15 @@ (pointer)&pVesa->state, &pVesa->stateSize,&pVesa->statePage)) && function == MODE_SAVE) { - /* don't rely on the memory not being touched */ - if (pVesa->pstate == NULL) - pVesa->pstate = xalloc(pVesa->stateSize); + /* don't rely on the memory not being touched */ + if (pVesa->pstate == NULL) + pVesa->pstate = xnfalloc(pVesa->stateSize); memcpy(pVesa->pstate, pVesa->state, pVesa->stateSize); } } - if (function == MODE_RESTORE) { - VBESetVBEMode(pVesa->pVbe, pVesa->stateMode, NULL); - RestoreFonts(pScrn); - } + if (function == MODE_RESTORE) + VESARestorePlanes(pScrn); if (!retval) return (FALSE); @@ -1635,7 +1745,7 @@ static void VESADisplayPowerManagementSet(ScrnInfoPtr pScrn, int mode, - int flags) + int flags) { VESAPtr pVesa = VESAGetRec(pScrn); unsigned char seq1 = 0, crtc17 = 0; Index: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h diff -u xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h:1.14 xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h:1.17 --- xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h:1.14 Thu Jan 16 11:09:10 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h Thu Mar 16 11:50:21 2006 @@ -26,7 +26,7 @@ * * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.14 2003/01/16 16:09:10 eich Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.17 2006/03/16 16:50:21 dawes Exp $ */ #ifndef _VESA_H_ @@ -58,9 +58,6 @@ /* ShadowFB support */ #include "shadow.h" -/* Int 10 support */ -#include "xf86int10.h" - /* bank switching */ #include "mibank.h" @@ -75,7 +72,6 @@ #include "fb.h" #include "afb.h" #include "mfb.h" -#include "cfb24_32.h" #define VESA_VERSION 4000 #define VESA_NAME "VESA" @@ -104,7 +100,7 @@ int statePage, stateSize, stateMode; int page; CARD32 *pal, *savedPal; - CARD8 *fonts; + CARD8 *planes; xf86MonPtr monitor; Bool shadowFB, primary; CARD8 *shadowPtr; Index: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man diff -u xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man:1.3 xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man:1.4 --- xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man:1.3 Mon Dec 17 15:52:34 2001 +++ xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man Thu Aug 18 11:13:07 2005 @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.3 2001/12/17 20:52:34 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.man,v 1.4 2005/08/18 15:13:07 tsi Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH VESA __drivermansuffix__ __vendorversion__ @@ -46,7 +46,15 @@ Enable or disable use of the shadow framebuffer layer. Default: on. This option is recommended for performance reasons. +.TP +.BI "Option \*qVBEBigEndian\*q \*q" boolean \*q +This +.B Option +is only acted upon on big-endian systems. Normally, the driver will disallow +colour depths and framebuffer bpp's that cannot be supported through simple +byte-swapping of pixels. This option exists to override this behaviour should +the adapter's BIOS be intelligent enough to detect host endianness. .SH "SEE ALSO" XFree86(1), XF86Config(__filemansuffix__), xf86cfg(1), xf86config(1), Xserver(1), X(__miscmansuffix__) .SH AUTHORS -Authors include: Paulo César Pereira de Andrade. +Authors include: Paulo C\('esar Pereira de Andrade. Index: xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile:1.15 xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile:1.16 --- xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile:1.15 Mon May 31 20:17:03 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile Fri Oct 14 11:16:48 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile,v 1.15 2004/06/01 00:17:03 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile,v 1.16 2005/10/14 15:16:48 tsi Exp $ /* * Copyright (c) 1994-2004 by The XFree86 Project, Inc. * All rights reserved. @@ -58,13 +58,12 @@ #endif #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(SERVERSRC)/fb -I$(XF86SRC)/xf4bpp -I$(XF86SRC)/xf1bpp \ +INCLUDES = -I$(SERVERSRC)/fb -I$(XF86SRC)/xf4bpp -I$(XF86SRC)/xf1bpp \ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi -I$(XF86SRC)/vgahw \ - -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render -I$(EXTINCSRC)\ - -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/include -I$(FONTINCSRC) -I$(XINCLUDESRC)\ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ + -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/include \ -I$(XF86SRC)/rac -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ -I$(XF86SRC)/shadowfb -I$(XF86SRC)/int10 #endif Index: xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c diff -u xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c:1.68 xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c:1.69 --- xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c:1.68 Fri Nov 26 06:50:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c Thu Mar 16 11:50:21 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c,v 1.68 2004/11/26 11:50:22 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c,v 1.69 2006/03/16 16:50:21 dawes Exp $ */ /* * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. * @@ -195,7 +195,8 @@ XF86ModuleData vgaModuleData = { &GenericVersionRec, GenericSetup, NULL }; static pointer -GenericSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor) +GenericSetup(ModuleDescPtr Module, pointer Options, + int *ErrorMajor, int *ErrorMinor) { static Bool Initialised = FALSE; @@ -203,8 +204,8 @@ { Initialised = TRUE; xf86AddDriver(&VGA, Module, 0); - LoaderRefSymLists(vgahwSymbols, miscfbSymbols, fbSymbols, - shadowfbSymbols, int10Symbols, NULL); + LoaderModRefSymLists(Module, vgahwSymbols, miscfbSymbols, fbSymbols, + shadowfbSymbols, int10Symbols, NULL); return (pointer)TRUE; } @@ -505,6 +506,7 @@ vgaHWPtr pvgaHW; GenericPtr pGenericPriv; EntityInfoPtr pEnt; + ModuleDescPtr pMod; if (flags & PROBE_DETECT) return FALSE; @@ -518,10 +520,10 @@ if (pEnt->resources) return FALSE; - if (xf86LoadSubModule(pScreenInfo, "int10")) + if ((pMod = xf86LoadSubModule(pScreenInfo, "int10"))) { xf86Int10InfoPtr pInt; - xf86LoaderReqSymLists(int10Symbols, NULL); + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); xf86DrvMsg(pScreenInfo->scrnIndex, X_INFO, "initializing int10.\n"); pInt = xf86ExtendedInitInt10(pEnt->index, SET_BIOS_SCRATCH | RESTORE_BIOS_SCRATCH); @@ -618,10 +620,10 @@ return FALSE; /* Ensure vgahw entry points are available for the clock probe */ - if (!xf86LoadSubModule(pScreenInfo, "vgahw")) + if (!(pMod = xf86LoadSubModule(pScreenInfo, "vgahw"))) return FALSE; - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); /* Allocate driver private structure */ if (!(pGenericPriv = GenericGetRec(pScreenInfo))) @@ -768,21 +770,21 @@ pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; Module = "fb"; Sym = NULL; - if (!xf86LoadSubModule(pScreenInfo, "shadowfb")) + if (!(pMod = xf86LoadSubModule(pScreenInfo, "shadowfb"))) return FALSE; - xf86LoaderReqSymLists(shadowfbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowfbSymbols, NULL); } /* Ensure depth-specific entry points are available */ if (Module) { - if (!xf86LoadSubModule(pScreenInfo, Module)) + if (!(pMod = xf86LoadSubModule(pScreenInfo, Module))) return FALSE; if (Sym) - xf86LoaderReqSymbols(Sym, NULL); + xf86LoaderModReqSymbols(pMod, Sym, NULL); else - xf86LoaderReqSymLists(fbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); } /* Only one chipset here */ Index: xc/programs/Xserver/hw/xfree86/drivers/via/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/via/Imakefile:1.11 xc/programs/Xserver/hw/xfree86/drivers/via/Imakefile:1.14 --- xc/programs/Xserver/hw/xfree86/drivers/via/Imakefile:1.11 Mon Feb 28 22:48:53 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/via/Imakefile Fri Oct 14 11:16:49 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/Imakefile,v 1.11 2005/03/01 03:48:53 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/Imakefile,v 1.14 2005/10/14 15:16:49 tsi Exp $ #define IHaveModules #include <Server.tmpl> @@ -7,7 +7,7 @@ DRISRCS = via_dri.c DRIOBJS = via_dri.o DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri \ - -I$(XF86OSSRC)/linux/drm/kernel -I$(TOP)/include -I$(DRMINCLUDESDIR) + -I$(XF86OSSRC)/linux/drm/kernel -I$(DRMINCLUDESDIR) DRIDEFINES = $(GLX_DEFINES) #endif @@ -48,21 +48,15 @@ via_overlay.o $(DRIOBJS) -DEFINES = -DPSZ=8 - #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa \ - -I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \ - -I$(XF86SRC)/xf24_32bpp -I$(SERVERSRC)/Xext \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/mi -I$(XF86SRC)/xaa \ + -I$(SERVERSRC)/Xext -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ -I$(XF86SRC)/rac -I$(XF86SRC)/int10 -I$(SERVERSRC)/render \ - -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(FONTINCSRC) \ - -I$(EXTINCSRC) -I$(XF86SRC)/vbe -I$(XF86SRC)/shadowfb \ + -I$(SERVERSRC)/include -I$(XF86SRC)/vbe -I$(XF86SRC)/shadowfb \ -I$(SERVERSRC)/fb $(DRIINCLUDES) #endif Index: xc/programs/Xserver/hw/xfree86/drivers/via/via_accel.c diff -u xc/programs/Xserver/hw/xfree86/drivers/via/via_accel.c:1.13 xc/programs/Xserver/hw/xfree86/drivers/via/via_accel.c:1.14 --- xc/programs/Xserver/hw/xfree86/drivers/via/via_accel.c:1.13 Sat Apr 3 16:39:55 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/via/via_accel.c Fri Oct 14 11:16:49 2005 @@ -21,7 +21,7 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_accel.c,v 1.13 2004/04/03 21:39:55 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_accel.c,v 1.14 2005/10/14 15:16:49 tsi Exp $ */ /************************************************************************* * @@ -30,7 +30,7 @@ * ************************************************************************/ -#include "Xarch.h" +#include <X11/Xarch.h> #include "xaarop.h" #include "miline.h" Index: xc/programs/Xserver/hw/xfree86/drivers/via/via_bios.c diff -u xc/programs/Xserver/hw/xfree86/drivers/via/via_bios.c:1.12 xc/programs/Xserver/hw/xfree86/drivers/via/via_bios.c:1.13 --- xc/programs/Xserver/hw/xfree86/drivers/via/via_bios.c:1.12 Sat Oct 23 11:29:30 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/via/via_bios.c Fri Jul 29 11:42:40 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_bios.c,v 1.12 2004/10/23 15:29:30 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_bios.c,v 1.13 2005/07/29 15:42:40 tsi Exp $ */ /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. @@ -12556,3 +12556,22 @@ return TRUE; } +/************************************************* + Name : VIAGetBIOSConnectedDevice + Purpose: Check BIOS for connected devices + Input : Pointer to VIA structure + Output : Connected mask, conform to Int 0x10,ax=1414 bx=0x3 +*************************************************/ +unsigned char VIAGetBIOSConnectedDevice(ScrnInfoPtr pScrn) +{ + VIAPtr pVia = VIAPTR(pScrn); + pVia->pInt10->ax = 0x4F14; + pVia->pInt10->bx = 0x4; + pVia->pInt10->cx = 0; + xf86ExecX86int10(pVia->pInt10); + if (pVia->pInt10->ax != 0x4f /* include status for test */) { + /* the user should specify it manually or use the standard procedure */ + return 0; + } + return pVia->pInt10->cx; +} Index: xc/programs/Xserver/hw/xfree86/drivers/via/via_bios.h diff -u xc/programs/Xserver/hw/xfree86/drivers/via/via_bios.h:1.4 xc/programs/Xserver/hw/xfree86/drivers/via/via_bios.h:1.5 --- xc/programs/Xserver/hw/xfree86/drivers/via/via_bios.h:1.4 Wed Dec 31 00:42:04 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/via/via_bios.h Fri Jul 29 11:42:40 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_bios.h,v 1.4 2003/12/31 05:42:04 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_bios.h,v 1.5 2005/07/29 15:42:40 tsi Exp $ */ /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. @@ -707,5 +707,5 @@ void VIAEnabledPrimaryExtendedFIFO(VIABIOSInfoPtr pBIOSInfo); void VIAEnabledSecondaryExtendedFIFO(VIABIOSInfoPtr pBIOSInfo); void VIAFillExpireNumber(VIABIOSInfoPtr pBIOSInfo); - +unsigned char VIAGetBIOSConnectedDevice(ScrnInfoPtr pScrn); #endif /* _VIA_BIOS_H_ */ Index: xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.c diff -u xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.c:1.36 xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.c:1.45 --- xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.c:1.36 Fri Dec 10 11:07:03 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.c Thu Mar 16 11:50:22 2006 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.c,v 1.36 2004/12/10 16:07:03 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.c,v 1.45 2006/03/16 16:50:22 dawes Exp $ */ /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. @@ -35,7 +35,7 @@ #include "globals.h" #define DPMS_SERVER -#include "extensions/dpms.h" +#include <X11/extensions/dpms.h> #include "via_driver.h" @@ -65,13 +65,13 @@ static Bool VIACloseScreen(int scrnIndex, ScreenPtr pScreen); static Bool VIASaveScreen(ScreenPtr pScreen, int mode); static void VIALoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies, - LOCO *colors, VisualPtr pVisual); + LOCO *colors, VisualPtr pVisual); static Bool VIAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, - char **argv); + char **argv); static int VIAInternalScreenInit(int scrnIndex, ScreenPtr pScreen); static void VIAFreeScreen(int scrnIndex, int flags); static ModeStatus VIAValidMode(int index, DisplayModePtr mode, - Bool verbose, int flags); + Bool verbose, int flags); static void VIADPMS(ScrnInfoPtr pScrn, int mode, int flags); static const OptionInfoRec * VIAAvailableOptions(int chipid, int busid); @@ -152,7 +152,8 @@ OPTION_CAP0_DEINTERLACE, OPTION_CAP1_DEINTERLACE, OPTION_CAP0_FIELDSWAP, - OPTION_DRIXINERAMA + OPTION_DRIXINERAMA, + OPTION_CONNECTED_DEVICE } VIAOpts; @@ -168,7 +169,7 @@ {OPTION_VIDEORAM, "VideoRAM", OPTV_INTEGER, {0}, FALSE}, {OPTION_ACTIVEDEVICE, "ActiveDevice", OPTV_ANYSTR, {0}, FALSE}, {OPTION_LCDDUALEDGE, "LCDDualEdge", OPTV_BOOLEAN, {0}, FALSE}, - {OPTION_BUSWIDTH, "BusWidth", OPTV_ANYSTR, {0}, FALSE}, + {OPTION_BUSWIDTH, "BusWidth", OPTV_ANYSTR, {0}, FALSE}, {OPTION_CENTER, "Center", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_PANELSIZE, "PanelSize", OPTV_ANYSTR, {0}, FALSE}, {OPTION_TVDOTCRAWL, "TVDotCrawl", OPTV_BOOLEAN, {0}, FALSE}, @@ -184,9 +185,31 @@ {OPTION_CAP1_DEINTERLACE, "Cap1Deinterlace", OPTV_ANYSTR, {0}, FALSE}, {OPTION_CAP0_FIELDSWAP, "Cap0FieldSwap", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_DRIXINERAMA, "DRIXINERAMA", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_CONNECTED_DEVICE,"ConnectedDevice",OPTV_ANYSTR,{0},FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; +struct OutputDesc { char *Name;unsigned char Mask;}; +const static struct OutputDesc Values[]= +{ + {"NONE",0} , + {"BIOS",0xFF} , + {"CRT",VIA_DEVICE_CRT1} , + {"CRT ONLY",VIA_DEVICE_CRT1} , + {"TV", VIA_DEVICE_TV}, + {"TV ONLY", VIA_DEVICE_TV}, + {"LCD",VIA_DEVICE_LCD}, + {"LCD ONLY",VIA_DEVICE_LCD} , + {"DVI",VIA_DEVICE_DFP}, + {"DVI ONLY",VIA_DEVICE_DFP}, + {"DFP",VIA_DEVICE_DFP}, + {"DFP ONLY",VIA_DEVICE_DFP}, + {"CRT2",VIA_DEVICE_CRT2} +}; +static char *DevMask2Str[5]= +{ + "CRT","LCD","TV","DFP","CRT2" +}; static const char *vgaHWSymbols[] = { "vgaHWGetHWRec", @@ -262,24 +285,11 @@ NULL }; -#ifdef USE_FB static const char *fbSymbols[] = { "fbScreenInit", "fbPictureInit", NULL }; -#else -static const char *cfbSymbols[] = { - "cfbScreenInit", - "cfb16ScreenInit", - "cfb24ScreenInit", - "cfb24_32ScreenInit", - "cfb32ScreenInit", - "cfb16BresS", - "cfb24BresS", - NULL -}; -#endif #ifdef XFree86LOADER #ifdef XF86DRI @@ -346,41 +356,39 @@ XF86ModuleData viaModuleData = {&VIAVersRec, VIASetup, NULL}; -static pointer VIASetup(pointer module, pointer opts, int *errmaj, int *errmin) +/* static */ +pointer VIASetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; if (!setupDone) { - setupDone = TRUE; - xf86AddDriver(&VIA, module, 0); - LoaderRefSymLists(vgaHWSymbols, -#ifdef USE_FB - fbSymbols, -#else - cfbSymbols, -#endif - ramdacSymbols, - xaaSymbols, - shadowSymbols, - vbeSymbols, - i2cSymbols, - ddcSymbols, - /* - mpegSymbols, - */ + setupDone = TRUE; + xf86AddDriver(&VIA, module, 0); + LoaderModRefSymLists(module, + vgaHWSymbols, + fbSymbols, + ramdacSymbols, + xaaSymbols, + shadowSymbols, + vbeSymbols, + i2cSymbols, + ddcSymbols, + /* + mpegSymbols, + */ #ifdef XF86DRI - drmSymbols, - driSymbols, + drmSymbols, + driSymbols, #endif - NULL); + NULL); - return (pointer) 1; + return (pointer) 1; } else { - if (errmaj) - *errmaj = LDR_ONCEONLY; + if (errmaj) + *errmaj = LDR_ONCEONLY; - return NULL; + return NULL; } } /* VIASetup */ @@ -391,30 +399,30 @@ VIAPtr pVia = VIAPTR(pScrn); VIABIOSInfoPtr pBIOSInfo = pVia->pBIOSInfo; - pVia->graphicInfo.TotalVRAM = pVia->videoRambytes; - pVia->graphicInfo.VideoHeapBase = (unsigned long) pVia->FBFreeStart; - pVia->graphicInfo.VideoHeapEnd = (unsigned long) (pVia->FBFreeEnd - 1); - pVia->graphicInfo.dwWidth = pBIOSInfo->CrtcHDisplay; - pVia->graphicInfo.dwHeight = pBIOSInfo->CrtcVDisplay; - pVia->graphicInfo.dwBPP = pScrn->bitsPerPixel; - pVia->graphicInfo.dwPitch = (((pScrn->virtualX) + 15) & ~15) * (pScrn->bitsPerPixel) / 8; - pVia->graphicInfo.dwRefreshRate = (unsigned long)pBIOSInfo->FoundRefresh; - pVia->graphicInfo.dwDVIOn = pBIOSInfo->DVIAttach; - pVia->graphicInfo.dwExpand = pBIOSInfo->scaleY; - pVia->graphicInfo.dwPanelWidth = pBIOSInfo->panelX; - pVia->graphicInfo.dwPanelHeight = pBIOSInfo->panelY; - pVia->graphicInfo.Cap0_Deinterlace = pVia->Cap0_Deinterlace; - pVia->graphicInfo.Cap1_Deinterlace = pVia->Cap1_Deinterlace; - pVia->graphicInfo.Cap0_FieldSwap = pVia->Cap0_FieldSwap; - pVia->graphicInfo.RevisionID = pVia->ChipRev; - - /* for SAMM mode passing screen info */ - pVia->graphicInfo.HasSecondary = pBIOSInfo->HasSecondary; - pVia->graphicInfo.IsSecondary = pBIOSInfo->IsSecondary; + pVia->graphicInfo.TotalVRAM = pVia->videoRambytes; + pVia->graphicInfo.VideoHeapBase = (unsigned long) pVia->FBFreeStart; + pVia->graphicInfo.VideoHeapEnd = (unsigned long) (pVia->FBFreeEnd - 1); + pVia->graphicInfo.dwWidth = pBIOSInfo->CrtcHDisplay; + pVia->graphicInfo.dwHeight = pBIOSInfo->CrtcVDisplay; + pVia->graphicInfo.dwBPP = pScrn->bitsPerPixel; + pVia->graphicInfo.dwPitch = (((pScrn->virtualX) + 15) & ~15) * (pScrn->bitsPerPixel) / 8; + pVia->graphicInfo.dwRefreshRate = (unsigned long)pBIOSInfo->FoundRefresh; + pVia->graphicInfo.dwDVIOn = pBIOSInfo->DVIAttach; + pVia->graphicInfo.dwExpand = pBIOSInfo->scaleY; + pVia->graphicInfo.dwPanelWidth = pBIOSInfo->panelX; + pVia->graphicInfo.dwPanelHeight = pBIOSInfo->panelY; + pVia->graphicInfo.Cap0_Deinterlace = pVia->Cap0_Deinterlace; + pVia->graphicInfo.Cap1_Deinterlace = pVia->Cap1_Deinterlace; + pVia->graphicInfo.Cap0_FieldSwap = pVia->Cap0_FieldSwap; + pVia->graphicInfo.RevisionID = pVia->ChipRev; + + /* for SAMM mode passing screen info */ + pVia->graphicInfo.HasSecondary = pBIOSInfo->HasSecondary; + pVia->graphicInfo.IsSecondary = pBIOSInfo->IsSecondary; - /* Added to pass DRM info to V4L */ + /* Added to pass DRM info to V4L */ #ifdef XF86DRI - pVia->graphicInfo.DRMEnabled = pVia->directRenderingEnabled; + pVia->graphicInfo.DRMEnabled = pVia->directRenderingEnabled; #endif } @@ -426,12 +434,12 @@ mem_barrier(); while (!(VIAGETREG(VIA_REG_STATUS) & VIA_VR_QUEUE_BUSY) && (loop++ < MAXLOOP)) - ; + ; while ((VIAGETREG(VIA_REG_STATUS) & - (VIA_CMD_RGTR_BUSY | VIA_2D_ENG_BUSY | VIA_3D_ENG_BUSY)) && - (loop++ < MAXLOOP)) - ; + (VIA_CMD_RGTR_BUSY | VIA_2D_ENG_BUSY | VIA_3D_ENG_BUSY)) && + (loop++ < MAXLOOP)) + ; return loop >= MAXLOOP; } @@ -441,15 +449,15 @@ { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAGetRec\n")); if (pScrn->driverPrivate) - return TRUE; + return TRUE; pScrn->driverPrivate = xnfcalloc(sizeof(VIARec), 1); ((VIARec *)(pScrn->driverPrivate))->pBIOSInfo = - xnfcalloc(sizeof(VIABIOSInfoRec), 1); + xnfcalloc(sizeof(VIABIOSInfoRec), 1); ((VIARec *)(pScrn->driverPrivate))->pBIOSInfo->UserSetting = - xnfcalloc(sizeof(VIAUserSettingRec), 1); + xnfcalloc(sizeof(VIAUserSettingRec), 1); ((VIARec *)(pScrn->driverPrivate))->pBIOSInfo->pModeTable = - xnfcalloc(sizeof(VIAModeTableRec), 1); + xnfcalloc(sizeof(VIAModeTableRec), 1); /* initial value in VIARec */ ((VIARec *)(pScrn->driverPrivate))->SavedReg.mode = 0xFF; @@ -466,7 +474,7 @@ { DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAFreeRec\n")); if (!pScrn->driverPrivate) - return; + return; xfree(((VIARec *)(pScrn->driverPrivate))->pBIOSInfo->pModeTable); xfree(((VIARec *)(pScrn->driverPrivate))->pBIOSInfo->UserSetting); @@ -505,92 +513,92 @@ /* sanity checks */ if ((numDevSections = xf86MatchDevice(DRIVER_NAME, &devSections)) <= 0) - return FALSE; + return FALSE; if (xf86GetPciVideoInfo() == NULL) - return FALSE; + return FALSE; numUsed = xf86MatchPciInstances(DRIVER_NAME, - PCI_VIA_VENDOR_ID, - VIAChipsets, - VIAPciChipsets, - devSections, - numDevSections, - drv, - &usedChips); + PCI_VIA_VENDOR_ID, + VIAChipsets, + VIAPciChipsets, + devSections, + numDevSections, + drv, + &usedChips); xfree(devSections); if (numUsed <= 0) - return FALSE; + return FALSE; if (flags & PROBE_DETECT) { - foundScreen = TRUE; + foundScreen = TRUE; } else { - for (i = 0; i < numUsed; i++) { - ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0); - EntityInfoPtr pEnt; - if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i], - VIAPciChipsets, 0, 0, 0, 0, 0))) - { - pScrn->driverVersion = VIA_VERSION; - pScrn->driverName = DRIVER_NAME; - pScrn->name = "VIA"; - pScrn->Probe = VIAProbe; - pScrn->PreInit = VIAPreInit; - pScrn->ScreenInit = VIAScreenInit; - pScrn->SwitchMode = VIASwitchMode; - pScrn->AdjustFrame = VIAAdjustFrame; - pScrn->EnterVT = VIAEnterVT; - pScrn->LeaveVT = VIALeaveVT; - pScrn->FreeScreen = VIAFreeScreen; - pScrn->ValidMode = VIAValidMode; - foundScreen = TRUE; - } - /* - xf86ConfigActivePciEntity(pScrn, - usedChips[i], - VIAPciChipsets, - NULL, - NULL, - NULL, - NULL, - NULL); - */ - - pEnt = xf86GetEntityInfo(usedChips[i]); - - /* CLE266 card support Dual-Head, mark the entity as sharable*/ - if(pEnt->chipset == VIA_CLE266 || pEnt->chipset == VIA_KM400) - { - static int instance = 0; - DevUnion* pPriv; - - xf86SetEntitySharable(usedChips[i]); - xf86SetEntityInstanceForScreen(pScrn, - pScrn->entityList[0], instance); - - if(gVIAEntityIndex < 0) - { - gVIAEntityIndex = xf86AllocateEntityPrivateIndex(); - pPriv = xf86GetEntityPrivate(pScrn->entityList[0], - gVIAEntityIndex); - - if (!pPriv->ptr) - { - VIAEntPtr pVIAEnt; - pPriv->ptr = xnfcalloc(sizeof(VIAEntRec), 1); - pVIAEnt = pPriv->ptr; - pVIAEnt->IsDRIEnabled = FALSE; - pVIAEnt->BypassSecondary = FALSE; - pVIAEnt->HasSecondary = FALSE; - pVIAEnt->IsSecondaryRestored = FALSE; - } - } - instance++; - } - xfree(pEnt); - } + for (i = 0; i < numUsed; i++) { + ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0); + EntityInfoPtr pEnt; + if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i], + VIAPciChipsets, 0, 0, 0, 0, 0))) + { + pScrn->driverVersion = VIA_VERSION; + pScrn->driverName = DRIVER_NAME; + pScrn->name = "VIA"; + pScrn->Probe = VIAProbe; + pScrn->PreInit = VIAPreInit; + pScrn->ScreenInit = VIAScreenInit; + pScrn->SwitchMode = VIASwitchMode; + pScrn->AdjustFrame = VIAAdjustFrame; + pScrn->EnterVT = VIAEnterVT; + pScrn->LeaveVT = VIALeaveVT; + pScrn->FreeScreen = VIAFreeScreen; + pScrn->ValidMode = VIAValidMode; + foundScreen = TRUE; + } + /* + xf86ConfigActivePciEntity(pScrn, + usedChips[i], + VIAPciChipsets, + NULL, + NULL, + NULL, + NULL, + NULL); + */ + + pEnt = xf86GetEntityInfo(usedChips[i]); + + /* CLE266 card support Dual-Head, mark the entity as sharable*/ + if(pEnt->chipset == VIA_CLE266 || pEnt->chipset == VIA_KM400) + { + static int instance = 0; + DevUnion* pPriv; + + xf86SetEntitySharable(usedChips[i]); + xf86SetEntityInstanceForScreen(pScrn, + pScrn->entityList[0], instance); + + if(gVIAEntityIndex < 0) + { + gVIAEntityIndex = xf86AllocateEntityPrivateIndex(); + pPriv = xf86GetEntityPrivate(pScrn->entityList[0], + gVIAEntityIndex); + + if (!pPriv->ptr) + { + VIAEntPtr pVIAEnt; + pPriv->ptr = xnfcalloc(sizeof(VIAEntRec), 1); + pVIAEnt = pPriv->ptr; + pVIAEnt->IsDRIEnabled = FALSE; + pVIAEnt->BypassSecondary = FALSE; + pVIAEnt->HasSecondary = FALSE; + pVIAEnt->IsSecondaryRestored = FALSE; + } + } + instance++; + } + xfree(pEnt); + } } xfree(usedChips); @@ -605,10 +613,10 @@ /* Is there a function to do this for me? */ while (pset->numChipset >= 0) { - if (pset->PCIid == ChipID) - return pset->numChipset; + if (pset->PCIid == ChipID) + return pset->numChipset; - pset++; + pset++; } return -1; @@ -647,16 +655,16 @@ /* initialize chipset */ VGAOUT8(0x3c4, 0x26); tmp = VGAIN8(0x3c5); - + VGAOUT8(0x3c4, 0x26); VGAOUT8(0x3c5, (tmp | 0x11)); - + pMon = xf86DoEDID_DDC1(scrnIndex, vgaHWddc1SetSpeed, VIAddc1Read); /* undo initialization */ VGAOUT8(0x3c4, 0x26); VGAOUT8(0x3c5, tmp); - + return pMon; #else return NULL; @@ -667,14 +675,74 @@ VIAProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; + ModuleDescPtr pMod; - if (xf86LoadSubModule(pScrn, "vbe")) { - pVbe = VBEInit(NULL,index); - ConfiguredMonitor = vbeDoEDID(pVbe, NULL); - } + if ((pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); + pVbe = VBEInit(NULL,index); + ConfiguredMonitor = vbeDoEDID(pVbe, NULL); + xf86UnloadSubModule(pMod); + } +} +/*********************************************************** + Purpose: sets connectedDevice map according to user requirements + + Input: string passed to driver via ConnectedDevice option + + output: mask of connected devices + + Remarks: the option BIOS sets the value according to register SR32 + ~ char negates the value; + +************************************************************/ +static unsigned char ParseDeviceMask( + ScrnInfoPtr pScrn, + const char *opt_value, + const char *opt_name, + const int start) +{ + unsigned char val=0; + + do { + char str[5],neg=0; + unsigned char pv=0; + int n; + int err = 1; + const char *p=strchr(opt_value,','); + if(!p) + p = opt_value + strlen(opt_value); + if(*opt_value == '~') { + ++opt_value; + neg=1; + } + if((n=p - opt_value) <= sizeof(str)) { + memcpy(str,opt_value,n*sizeof(str[0])); + str[n]='\0'; + for(n=start;n<sizeof(Values)/sizeof(Values[0]);++n) + if (!xf86NameCmp(str,Values[n].Name)) + break; + if( n < (sizeof(Values)/sizeof(Values[0]))) { + pv=Values[n].Mask; + if(pv == 0xFF) + pv = VIAGetBIOSConnectedDevice(pScrn); + if(neg) + val &= ~pv; + else + val |= pv; + err = 0; + } + } + if(err) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Option %s, value %s is unknown in this context.\n", + opt_name, opt_value); + + } + opt_value = p+ ((*p) ? 1:0); + } while(*opt_value); + return val; } - - +/*****************************************************************/ static Bool VIAPreInit(ScrnInfoPtr pScrn, int flags) { EntityInfoPtr pEnt; @@ -683,27 +751,24 @@ MessageType from = X_DEFAULT; ClockRangePtr clockRanges; char *s = NULL; -#ifndef USE_FB - char *mod = NULL; - const char *reqSym = NULL; -#endif vgaHWPtr hwp; int i, bMemSize = 0, tmp; + ModuleDescPtr pMod; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAPreInit\n")); if (pScrn->numEntities > 1) - return FALSE; + return FALSE; if (flags & PROBE_DETECT) - return FALSE; + return FALSE; - if (!xf86LoadSubModule(pScrn, "vgahw")) - return FALSE; + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) + return FALSE; - xf86LoaderReqSymLists(vgaHWSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgaHWSymbols, NULL); if (!vgaHWGetHWRec(pScrn)) - return FALSE; + return FALSE; #if 0 /* Here we can alter the number of registers saved and restored by the @@ -713,7 +778,7 @@ #endif if (!VIAGetRec(pScrn)) { - return FALSE; + return FALSE; } pVia = VIAPTR(pScrn); @@ -722,56 +787,56 @@ pVia->IsSecondary = FALSE; pEnt = xf86GetEntityInfo(pScrn->entityList[0]); if (pEnt->resources) { - xfree(pEnt); - VIAFreeRec(pScrn); - return FALSE; + xfree(pEnt); + VIAFreeRec(pScrn); + return FALSE; } pVia->EntityIndex = pEnt->index; if(xf86IsEntityShared(pScrn->entityList[0])) { - if(xf86IsPrimInitDone(pScrn->entityList[0])) - { - DevUnion* pPriv; - VIAEntPtr pVIAEnt; - VIAPtr pVia1; - - pVia->IsSecondary = TRUE; - pPriv = xf86GetEntityPrivate(pScrn->entityList[0], - gVIAEntityIndex); - pVIAEnt = pPriv->ptr; - if(pVIAEnt->BypassSecondary) return FALSE; - pVIAEnt->pSecondaryScrn = pScrn; - pVIAEnt->HasSecondary = TRUE; - pVia1 = VIAPTR(pVIAEnt->pPrimaryScrn); - pVia1->HasSecondary = TRUE; + if(xf86IsPrimInitDone(pScrn->entityList[0])) + { + DevUnion* pPriv; + VIAEntPtr pVIAEnt; + VIAPtr pVia1; + + pVia->IsSecondary = TRUE; + pPriv = xf86GetEntityPrivate(pScrn->entityList[0], + gVIAEntityIndex); + pVIAEnt = pPriv->ptr; + if(pVIAEnt->BypassSecondary) return FALSE; + pVIAEnt->pSecondaryScrn = pScrn; + pVIAEnt->HasSecondary = TRUE; + pVia1 = VIAPTR(pVIAEnt->pPrimaryScrn); + pVia1->HasSecondary = TRUE; pVia->sharedData = pVia1->sharedData; - } - else - { - DevUnion* pPriv; - VIAEntPtr pVIAEnt; - - xf86SetPrimInitDone(pScrn->entityList[0]); - pPriv = xf86GetEntityPrivate(pScrn->entityList[0], - gVIAEntityIndex); + } + else + { + DevUnion* pPriv; + VIAEntPtr pVIAEnt; + + xf86SetPrimInitDone(pScrn->entityList[0]); + pPriv = xf86GetEntityPrivate(pScrn->entityList[0], + gVIAEntityIndex); pVia->sharedData = xnfcalloc(sizeof(ViaSharedRec),1); - pVIAEnt = pPriv->ptr; - pVIAEnt->pPrimaryScrn = pScrn; - pVIAEnt->IsDRIEnabled = FALSE; - pVIAEnt->BypassSecondary = FALSE; - pVIAEnt->HasSecondary = FALSE; - pVIAEnt->RestorePrimary = FALSE; - pVIAEnt->IsSecondaryRestored = FALSE; - } + pVIAEnt = pPriv->ptr; + pVIAEnt->pPrimaryScrn = pScrn; + pVIAEnt->IsDRIEnabled = FALSE; + pVIAEnt->BypassSecondary = FALSE; + pVIAEnt->HasSecondary = FALSE; + pVIAEnt->RestorePrimary = FALSE; + pVIAEnt->IsSecondaryRestored = FALSE; + } } else { pVia->sharedData = xnfcalloc(sizeof(ViaSharedRec),1); } if (flags & PROBE_DETECT) { - VIAProbeDDC(pScrn, pVia->EntityIndex); - return TRUE; + VIAProbeDDC(pScrn, pVia->EntityIndex); + return TRUE; } pScrn->monitor = pScrn->confScreen->monitor; @@ -782,52 +847,52 @@ */ if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support32bppFb)) { - return FALSE; + return FALSE; } else { - switch (pScrn->depth) { - case 8: - case 16: - case 24: - case 32: - /* OK */ - break; - default: - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Given depth (%d) is not supported by this driver\n", - pScrn->depth); - return FALSE; - } + switch (pScrn->depth) { + case 8: + case 16: + case 24: + case 32: + /* OK */ + break; + default: + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Given depth (%d) is not supported by this driver\n", + pScrn->depth); + return FALSE; + } } xf86PrintDepthBpp(pScrn); if (pScrn->depth == 32) { - pScrn->depth = 24; + pScrn->depth = 24; } if (pScrn->depth > 8) { - rgb zeros = {0, 0, 0}; + rgb zeros = {0, 0, 0}; - if (!xf86SetWeight(pScrn, zeros, zeros)) - return FALSE; - else { - /* TODO check weight returned is supported */ - ; - } + if (!xf86SetWeight(pScrn, zeros, zeros)) + return FALSE; + else { + /* TODO check weight returned is supported */ + ; + } } if (!xf86SetDefaultVisual(pScrn, -1)) { - return FALSE; + return FALSE; } else { - /* We don't currently support DirectColor at > 8bpp */ - if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual" - " (%s) is not supported at depth %d\n", - xf86GetVisualName(pScrn->defaultVisual), pScrn->depth); - return FALSE; - } + /* We don't currently support DirectColor at > 8bpp */ + if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual" + " (%s) is not supported at depth %d\n", + xf86GetVisualName(pScrn->defaultVisual), pScrn->depth); + return FALSE; + } } /* We use a programmable clock */ @@ -837,86 +902,86 @@ /* Set the bits per RGB for 8bpp mode */ if (pScrn->depth == 8) - pScrn->rgbBits = 6; + pScrn->rgbBits = 6; xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, VIAOptions); #ifdef XF86DRI pVia->drixinerama = FALSE; if (xf86IsOptionSet(VIAOptions, OPTION_DRIXINERAMA)) - pVia->drixinerama = TRUE; + pVia->drixinerama = TRUE; #else if (xf86IsOptionSet(VIAOptions, OPTION_DRIXINERAMA)) - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Option: drixinerama ignored, no DRI support compiled into driver.\n"); + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Option: drixinerama ignored, no DRI support compiled into driver.\n"); #endif if (xf86ReturnOptValBool(VIAOptions, OPTION_PCI_BURST, FALSE)) { - pVia->pci_burst = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Option: pci_burst - PCI burst read enabled\n"); + pVia->pci_burst = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Option: pci_burst - PCI burst read enabled\n"); } else { - pVia->pci_burst = FALSE; + pVia->pci_burst = FALSE; } pVia->NoPCIRetry = 1; /* default */ if (xf86ReturnOptValBool(VIAOptions, OPTION_PCI_RETRY, FALSE)) { - if (xf86ReturnOptValBool(VIAOptions, OPTION_PCI_BURST, FALSE)) { - pVia->NoPCIRetry = 0; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_retry\n"); - } - else { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "\"pci_retry\" option requires \"pci_burst\"\n"); - } + if (xf86ReturnOptValBool(VIAOptions, OPTION_PCI_BURST, FALSE)) { + pVia->NoPCIRetry = 0; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_retry\n"); + } + else { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "\"pci_retry\" option requires \"pci_burst\"\n"); + } } if (xf86IsOptionSet(VIAOptions, OPTION_SHADOW_FB)) { - pVia->shadowFB = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: ShadowFB %s.\n", - pVia->shadowFB ? "enabled" : "disabled"); + pVia->shadowFB = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: ShadowFB %s.\n", + pVia->shadowFB ? "enabled" : "disabled"); } else { - pVia->shadowFB = FALSE; + pVia->shadowFB = FALSE; } if ((s = xf86GetOptValString(VIAOptions, OPTION_ROTATE))) { - if (!xf86NameCmp(s, "CW")) { - /* accel is disabled below for shadowFB */ - pVia->shadowFB = TRUE; - pVia->rotate = 1; - pVia->hwcursor = FALSE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Rotating screen clockwise - acceleration disabled\n"); - } - else if(!xf86NameCmp(s, "CCW")) { - pVia->shadowFB = TRUE; - pVia->rotate = -1; - pVia->hwcursor = FALSE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen" - "counter clockwise - acceleration disabled\n"); - } - else { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid" - "value for Option \"Rotate\"\n", s); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Valid options are \"CW\" or \"CCW\"\n"); - } + if (!xf86NameCmp(s, "CW")) { + /* accel is disabled below for shadowFB */ + pVia->shadowFB = TRUE; + pVia->rotate = 1; + pVia->hwcursor = FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Rotating screen clockwise - acceleration disabled\n"); + } + else if(!xf86NameCmp(s, "CCW")) { + pVia->shadowFB = TRUE; + pVia->rotate = -1; + pVia->hwcursor = FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen" + "counter clockwise - acceleration disabled\n"); + } + else { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid" + "value for Option \"Rotate\"\n", s); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Valid options are \"CW\" or \"CCW\"\n"); + } } if (xf86ReturnOptValBool(VIAOptions, OPTION_NOACCEL, FALSE)) { - pVia->NoAccel = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Option: NoAccel -Acceleration Disabled\n"); + pVia->NoAccel = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Option: NoAccel -Acceleration Disabled\n"); } else { - pVia->NoAccel = FALSE; + pVia->NoAccel = FALSE; } if (pVia->shadowFB && !pVia->NoAccel) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "HW acceleration not supported with \"shadowFB\".\n"); - pVia->NoAccel = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "HW acceleration not supported with \"shadowFB\".\n"); + pVia->NoAccel = TRUE; } /* @@ -927,304 +992,275 @@ from = X_DEFAULT; pVia->hwcursor = pVia->shadowFB ? FALSE : TRUE; if (xf86GetOptValBool(VIAOptions, OPTION_HWCURSOR, &pVia->hwcursor)) - from = X_CONFIG; + from = X_CONFIG; if (xf86ReturnOptValBool(VIAOptions, OPTION_SWCURSOR, FALSE)) { - pVia->hwcursor = FALSE; - from = X_CONFIG; + pVia->hwcursor = FALSE; + from = X_CONFIG; } if (pVia->IsSecondary) pVia->hwcursor = FALSE; xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", - pVia->hwcursor ? "HW" : "SW"); + pVia->hwcursor ? "HW" : "SW"); if (xf86ReturnOptValBool(VIAOptions, OPTION_A2, FALSE)) { - pBIOSInfo->A2 = TRUE; + pBIOSInfo->A2 = TRUE; } else { - pBIOSInfo->A2 = FALSE; + pBIOSInfo->A2 = FALSE; } from = X_DEFAULT; if (xf86ReturnOptValBool(VIAOptions, OPTION_USEBIOS, FALSE)) { - from = X_CONFIG; - pBIOSInfo->UseBIOS = TRUE; + from = X_CONFIG; + pBIOSInfo->UseBIOS = TRUE; } else { - pBIOSInfo->UseBIOS = FALSE; + pBIOSInfo->UseBIOS = FALSE; } xf86DrvMsg(pScrn->scrnIndex, from, "%ssing video BIOS to set modes\n", - pBIOSInfo->UseBIOS ? "U" : "Not u" ); + pBIOSInfo->UseBIOS ? "U" : "Not u" ); pScrn->videoRam = 0; if(xf86GetOptValInteger(VIAOptions, OPTION_VIDEORAM, &pScrn->videoRam)) { - xf86DrvMsg( pScrn->scrnIndex, X_CONFIG, - "Option: VideoRAM %dkB\n", pScrn->videoRam ); + xf86DrvMsg( pScrn->scrnIndex, X_CONFIG, + "Option: VideoRAM %dkB\n", pScrn->videoRam ); } if (xf86ReturnOptValBool(VIAOptions, OPTION_DISABLEVQ, FALSE)) { - pVia->VQEnable = FALSE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Option: DisableVQ -VQ Disabled\n"); + pVia->VQEnable = FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Option: DisableVQ -VQ Disabled\n"); } else { - pVia->VQEnable = TRUE; + pVia->VQEnable = TRUE; } if (xf86ReturnOptValBool(VIAOptions, OPTION_DISABLEIRQ, FALSE)) { - pVia->DRIIrqEnable = FALSE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Option: DisableIRQ - DRI IRQ Disabled\n"); + pVia->DRIIrqEnable = FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Option: DisableIRQ - DRI IRQ Disabled\n"); } else { - pVia->DRIIrqEnable = TRUE; + pVia->DRIIrqEnable = TRUE; } /* ActiveDevice Option for device selection */ pBIOSInfo->ActiveDevice = 0x00; if ((s = xf86GetOptValString(VIAOptions, OPTION_ACTIVEDEVICE))) { - if (!xf86NameCmp(s, "CRT,TV") || !xf86NameCmp(s, "TV,CRT")) { - pBIOSInfo->ActiveDevice = VIA_DEVICE_CRT1 | VIA_DEVICE_TV; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Active Device is CRT and TV.\n"); - } - else if(!xf86NameCmp(s, "CRT,LCD") || !xf86NameCmp(s, "LCD,CRT")) { - pBIOSInfo->ActiveDevice = VIA_DEVICE_CRT1 | VIA_DEVICE_LCD; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Active Device is CRT and LCD.\n"); - } - else if(!xf86NameCmp(s, "CRT,DFP") || !xf86NameCmp(s, "DFP,CRT") - || !xf86NameCmp(s, "CRT,DVI") || !xf86NameCmp(s, "DVI,CRT")) { - pBIOSInfo->ActiveDevice = VIA_DEVICE_CRT1 | VIA_DEVICE_DFP; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Active Device is CRT and DFP.\n"); - } - else if(!xf86NameCmp(s, "TV,DFP") || !xf86NameCmp(s, "DFP,TV") - || !xf86NameCmp(s, "TV,DVI") || !xf86NameCmp(s, "DVI,TV")) { - pBIOSInfo->ActiveDevice = VIA_DEVICE_TV | VIA_DEVICE_DFP; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Active Device is TV and DFP.\n"); - } -#if 0 - else if(!xf86NameCmp(s, "DFP,LCD") || !xf86NameCmp(s, "LCD,DFP") - || !xf86NameCmp(s, "LCD,DVI") || !xf86NameCmp(s, "DVI,LCD")) { - pBIOSInfo->ActiveDevice = VIA_DEVICE_DFP | VIA_DEVICE_LCD; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Active Device is DFP and LCD.\n"); - } -#endif - else if(!xf86NameCmp(s, "CRT") || !xf86NameCmp(s, "CRT ONLY")) { - pBIOSInfo->ActiveDevice = VIA_DEVICE_CRT1; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Active Device is CRT Only.\n"); - } - else if(!xf86NameCmp(s, "LCD") || !xf86NameCmp(s, "LCD ONLY")) { - pBIOSInfo->ActiveDevice = VIA_DEVICE_LCD; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Active Device is LCD Only.\n"); - } - else if(!xf86NameCmp(s, "TV") || !xf86NameCmp(s, "TV ONLY")) { - pBIOSInfo->ActiveDevice = VIA_DEVICE_TV; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Active Device is TV Only.\n"); - } - else if(!xf86NameCmp(s, "DFP") || !xf86NameCmp(s, "DFP ONLY") - || !xf86NameCmp(s, "DVI") || !xf86NameCmp(s, "DVI ONLY")) { - pBIOSInfo->ActiveDevice = VIA_DEVICE_DFP; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Active Device is DFP Only.\n"); - } - else { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option \"%s\" can't recognize!, Active Device by default.\n", s); - } + char ActDevStr[128]; + int k; + pBIOSInfo->ActiveDevice = ParseDeviceMask(pScrn,s,"ActiveDevice",2); + ActDevStr[0]='\0'; + for(k=0;k<5;++k) { + if( pBIOSInfo->ActiveDevice & (1<<k)) { + strcat(ActDevStr,DevMask2Str[k]); + strcat(ActDevStr,","); + } + } + k = strlen(ActDevStr); + if(k) + ActDevStr[k-1]='\0'; /* remove last , */ + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Active device is %s.\n", + ActDevStr); } - /* LCDDualEdge Option */ pBIOSInfo->LCDDualEdge = FALSE; if (xf86ReturnOptValBool(VIAOptions, OPTION_LCDDUALEDGE, FALSE)) { - pBIOSInfo->LCDDualEdge = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Option: Using Dual Edge mode to set LCD\n"); + pBIOSInfo->LCDDualEdge = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Option: Using Dual Edge mode to set LCD\n"); } else { - pBIOSInfo->LCDDualEdge = FALSE; + if((pBIOSInfo->ActiveDevice & VIA_DEVICE_LCD) + && (pBIOSInfo->ActiveDevice & (~VIA_DEVICE_LCD))) + pBIOSInfo->LCDDualEdge = TRUE; } /* Digital Output Bus Width Option */ pBIOSInfo->BusWidth = VIA_DI_12BIT; if ((s = xf86GetOptValString(VIAOptions, OPTION_BUSWIDTH))) { - if (!xf86NameCmp(s, "12BIT")) { - pBIOSInfo->BusWidth = VIA_DI_12BIT; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Digital Output Bus Width is 12BIT\n"); - } - else if (!xf86NameCmp(s, "24BIT")) { - pBIOSInfo->BusWidth = VIA_DI_24BIT; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Digital Output Bus Width is 24BIT\n"); - } + if (!xf86NameCmp(s, "12BIT")) { + pBIOSInfo->BusWidth = VIA_DI_12BIT; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Digital Output Bus Width is 12BIT\n"); + } + else if (!xf86NameCmp(s, "24BIT")) { + pBIOSInfo->BusWidth = VIA_DI_24BIT; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Digital Output Bus Width is 24BIT\n"); + } } /* LCD Center/Expend Option */ if (xf86ReturnOptValBool(VIAOptions, OPTION_CENTER, FALSE)) { - pBIOSInfo->Center = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "DVI Center is On\n"); + pBIOSInfo->Center = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "DVI Center is On\n"); } else { - pBIOSInfo->Center = FALSE; + pBIOSInfo->Center = FALSE; } /* Panel Size Option */ pBIOSInfo->PanelSize = VIA_PANEL_INVALID; if ((s = xf86GetOptValString(VIAOptions, OPTION_PANELSIZE))) { - if (!xf86NameCmp(s, "640x480")) { - pBIOSInfo->PanelSize = VIA_PANEL6X4; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Selected Panel Size is 640x480\n"); - } - else if (!xf86NameCmp(s, "800x600")) { - pBIOSInfo->PanelSize = VIA_PANEL8X6; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Selected Panel Size is 800x600\n"); - } - else if(!xf86NameCmp(s, "1024x768")) { - pBIOSInfo->PanelSize = VIA_PANEL10X7; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Selected Panel Size is 1024x768\n"); - } - else if (!xf86NameCmp(s, "1280x768")) { - pBIOSInfo->PanelSize = VIA_PANEL12X7; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Selected Panel Size is 1280x768\n"); - } - else if (!xf86NameCmp(s, "1280x1024")) { - pBIOSInfo->PanelSize = VIA_PANEL12X10; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Selected Panel Size is 1280x1024\n"); - } - else if (!xf86NameCmp(s, "1400x1050")) { - pBIOSInfo->PanelSize = VIA_PANEL14X10; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Selected Panel Size is 1400x1050\n"); - } + if (!xf86NameCmp(s, "640x480")) { + pBIOSInfo->PanelSize = VIA_PANEL6X4; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Selected Panel Size is 640x480\n"); + } + else if (!xf86NameCmp(s, "800x600")) { + pBIOSInfo->PanelSize = VIA_PANEL8X6; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Selected Panel Size is 800x600\n"); + } + else if(!xf86NameCmp(s, "1024x768")) { + pBIOSInfo->PanelSize = VIA_PANEL10X7; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Selected Panel Size is 1024x768\n"); + } + else if (!xf86NameCmp(s, "1280x768")) { + pBIOSInfo->PanelSize = VIA_PANEL12X7; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Selected Panel Size is 1280x768\n"); + } + else if (!xf86NameCmp(s, "1280x1024")) { + pBIOSInfo->PanelSize = VIA_PANEL12X10; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Selected Panel Size is 1280x1024\n"); + } + else if (!xf86NameCmp(s, "1400x1050")) { + pBIOSInfo->PanelSize = VIA_PANEL14X10; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Selected Panel Size is 1400x1050\n"); + } } /* TV DotCrawl Enable Option */ if (xf86ReturnOptValBool(VIAOptions, OPTION_TVDOTCRAWL, FALSE)) { - pBIOSInfo->TVDotCrawl = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "DotCrawl is Enable\n"); + pBIOSInfo->TVDotCrawl = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "DotCrawl is Enable\n"); } else { - pBIOSInfo->TVDotCrawl = FALSE; + pBIOSInfo->TVDotCrawl = FALSE; } pBIOSInfo->TVType = TVTYPE_NONE; if ((s = xf86GetOptValString(VIAOptions, OPTION_TVTYPE))) { - if (!xf86NameCmp(s, "NTSC")) { - pBIOSInfo->TVType = TVTYPE_NTSC; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is NTSC\n"); - } - else if(!xf86NameCmp(s, "PAL")) { - pBIOSInfo->TVType = TVTYPE_PAL; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is PAL\n"); - } + if (!xf86NameCmp(s, "NTSC")) { + pBIOSInfo->TVType = TVTYPE_NTSC; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is NTSC\n"); + } + else if(!xf86NameCmp(s, "PAL")) { + pBIOSInfo->TVType = TVTYPE_PAL; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Type is PAL\n"); + } } /* TV out put signal Option */ pBIOSInfo->TVOutput = TVOUTPUT_NONE; if ((s = xf86GetOptValString(VIAOptions, OPTION_TVOUTPUT))) { - if (!xf86NameCmp(s, "S-Video")) { - pBIOSInfo->TVOutput = TVOUTPUT_SVIDEO; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is S-Video\n"); - } - else if(!xf86NameCmp(s, "Composite")) { - pBIOSInfo->TVOutput = TVOUTPUT_COMPOSITE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is Composite\n"); - } - else if(!xf86NameCmp(s, "SC")) { - pBIOSInfo->TVOutput = TVOUTPUT_SC; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is SC\n"); - } - else if(!xf86NameCmp(s, "RGB")) { - pBIOSInfo->TVOutput = TVOUTPUT_RGB; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is RGB\n"); - } - else if(!xf86NameCmp(s, "YCbCr")) { - pBIOSInfo->TVOutput = TVOUTPUT_YCBCR; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is YCbCr\n"); - } + if (!xf86NameCmp(s, "S-Video")) { + pBIOSInfo->TVOutput = TVOUTPUT_SVIDEO; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is S-Video\n"); + } + else if(!xf86NameCmp(s, "Composite")) { + pBIOSInfo->TVOutput = TVOUTPUT_COMPOSITE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is Composite\n"); + } + else if(!xf86NameCmp(s, "SC")) { + pBIOSInfo->TVOutput = TVOUTPUT_SC; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is SC\n"); + } + else if(!xf86NameCmp(s, "RGB")) { + pBIOSInfo->TVOutput = TVOUTPUT_RGB; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is RGB\n"); + } + else if(!xf86NameCmp(s, "YCbCr")) { + pBIOSInfo->TVOutput = TVOUTPUT_YCBCR; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Output Signal is YCbCr\n"); + } } /* TV Standard Option */ pBIOSInfo->TVVScan = VIA_TVNORMAL; if ((s = xf86GetOptValString(VIAOptions, OPTION_TVVSCAN))) { - if (!xf86NameCmp(s, "under")) { - pBIOSInfo->TVVScan = VIA_TVNORMAL; - } - else if (!xf86NameCmp(s, "over")) { - pBIOSInfo->TVVScan = VIA_TVOVER; - } + if (!xf86NameCmp(s, "under")) { + pBIOSInfo->TVVScan = VIA_TVNORMAL; + } + else if (!xf86NameCmp(s, "over")) { + pBIOSInfo->TVVScan = VIA_TVOVER; + } } pBIOSInfo->TVHScale = VIA_NO_TVHSCALE; if ((s = xf86GetOptValString(VIAOptions, OPTION_TVHSCALE))) { #if 0 - if (!xf86NameCmp(s, "0")) { - pBIOSInfo->TVHScale = VIA_TVHSCALE0; - } - else if (!xf86NameCmp(s, "1")) { - pBIOSInfo->TVHScale = VIA_TVHSCALE1; - } - else if(!xf86NameCmp(s, "2")) { - pBIOSInfo->TVHScale = VIA_TVHSCALE2; - } - else if (!xf86NameCmp(s, "3")) { - pBIOSInfo->TVHScale = VIA_TVHSCALE3; - } - else if (!xf86NameCmp(s, "4")) { - pBIOSInfo->TVHScale = VIA_TVHSCALE4; - } + if (!xf86NameCmp(s, "0")) { + pBIOSInfo->TVHScale = VIA_TVHSCALE0; + } + else if (!xf86NameCmp(s, "1")) { + pBIOSInfo->TVHScale = VIA_TVHSCALE1; + } + else if(!xf86NameCmp(s, "2")) { + pBIOSInfo->TVHScale = VIA_TVHSCALE2; + } + else if (!xf86NameCmp(s, "3")) { + pBIOSInfo->TVHScale = VIA_TVHSCALE3; + } + else if (!xf86NameCmp(s, "4")) { + pBIOSInfo->TVHScale = VIA_TVHSCALE4; + } #endif } /* TV Encoder Type Option */ pBIOSInfo->TVEncoder = VIA_NONETV; if ((s = xf86GetOptValString(VIAOptions, OPTION_TVENCODER))) { - if (!xf86NameCmp(s, "VT1621")) { - pBIOSInfo->TVEncoder = VIA_TV2PLUS; - pBIOSInfo->TVI2CAdd = 0x40; - } - else if(!xf86NameCmp(s, "VT1622")) { - pBIOSInfo->TVEncoder = VIA_TV3; - pBIOSInfo->TVI2CAdd = 0x40; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Encoder is VT1622!\n"); - } - else if(!xf86NameCmp(s, "VT1622A")) { - pBIOSInfo->TVEncoder = VIA_VT1622A; - pBIOSInfo->TVI2CAdd = 0x40; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Encoder is VT1622!\n"); - } - else if(!xf86NameCmp(s, "CH7019")) { - pBIOSInfo->TVEncoder = VIA_CH7019; - pBIOSInfo->TVI2CAdd = 0xEA; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Encoder is CH7019!\n"); - } - else if(!xf86NameCmp(s, "SAA7108")) { - pBIOSInfo->TVEncoder = VIA_SAA7108; - pBIOSInfo->TVI2CAdd = 0x88; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Encoder is SAA7108!\n"); - } - else if(!xf86NameCmp(s, "FS454")) { - pBIOSInfo->TVEncoder = VIA_FS454; - pBIOSInfo->TVI2CAdd = 0xD4; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Encoder is FS453/FS454!\n"); - } + if (!xf86NameCmp(s, "VT1621")) { + pBIOSInfo->TVEncoder = VIA_TV2PLUS; + pBIOSInfo->TVI2CAdd = 0x40; + } + else if(!xf86NameCmp(s, "VT1622")) { + pBIOSInfo->TVEncoder = VIA_TV3; + pBIOSInfo->TVI2CAdd = 0x40; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Encoder is VT1622!\n"); + } + else if(!xf86NameCmp(s, "VT1622A")) { + pBIOSInfo->TVEncoder = VIA_VT1622A; + pBIOSInfo->TVI2CAdd = 0x40; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Encoder is VT1622!\n"); + } + else if(!xf86NameCmp(s, "CH7019")) { + pBIOSInfo->TVEncoder = VIA_CH7019; + pBIOSInfo->TVI2CAdd = 0xEA; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Encoder is CH7019!\n"); + } + else if(!xf86NameCmp(s, "SAA7108")) { + pBIOSInfo->TVEncoder = VIA_SAA7108; + pBIOSInfo->TVI2CAdd = 0x88; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Encoder is SAA7108!\n"); + } + else if(!xf86NameCmp(s, "FS454")) { + pBIOSInfo->TVEncoder = VIA_FS454; + pBIOSInfo->TVI2CAdd = 0xD4; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Encoder is FS453/FS454!\n"); + } } if (xf86GetOptValInteger(VIAOptions, OPTION_REFRESH, &(pBIOSInfo->OptRefresh))) { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Refresh is %d\n", pBIOSInfo->OptRefresh); + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Refresh is %d\n", pBIOSInfo->OptRefresh); } - if (xf86LoadSubModule(pScrn, "int10")) { - xf86LoaderReqSymLists(int10Symbols, NULL); - pVia->pInt10 = xf86InitInt10(pEnt->index); + if ((pMod = xf86LoadSubModule(pScrn, "int10"))) { + xf86LoaderModReqSymLists(pMod, int10Symbols, NULL); + pVia->pInt10 = xf86InitInt10(pEnt->index); } - if (pVia->pInt10 && xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols, NULL); - pVia->pVbe = VBEInit(pVia->pInt10, pVia->EntityIndex); + if (pVia->pInt10 && (pMod = xf86LoadVBEModule(pScrn))) { + xf86LoaderModReqSymLists(pMod, vbeSymbols, NULL); + pVia->pVbe = VBEInit(pVia->pInt10, pVia->EntityIndex); } pVia->PciInfo = xf86GetPciInfoForEntity(pEnt->index); @@ -1235,45 +1271,45 @@ */ if (pEnt->device->chipset && *pEnt->device->chipset) { - pScrn->chipset = pEnt->device->chipset; - pVia->ChipId = pEnt->device->chipID; - pVia->Chipset = xf86StringToToken(VIAChipsets, pScrn->chipset); - from = X_CONFIG; + pScrn->chipset = pEnt->device->chipset; + pVia->ChipId = pEnt->device->chipID; + pVia->Chipset = xf86StringToToken(VIAChipsets, pScrn->chipset); + from = X_CONFIG; } else if (pEnt->device->chipID >= 0) { - pVia->ChipId = pEnt->device->chipID; - pVia->Chipset = LookupChipID(VIAPciChipsets, pVia->ChipId); - pScrn->chipset = (char *)xf86TokenToString(VIAChipsets, - pVia->Chipset); - from = X_CONFIG; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n", - pEnt->device->chipID); + pVia->ChipId = pEnt->device->chipID; + pVia->Chipset = LookupChipID(VIAPciChipsets, pVia->ChipId); + pScrn->chipset = (char *)xf86TokenToString(VIAChipsets, + pVia->Chipset); + from = X_CONFIG; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n", + pEnt->device->chipID); } else { - from = X_PROBED; - pVia->ChipId = pVia->PciInfo->chipType; - pVia->Chipset = LookupChipID(VIAPciChipsets, pVia->ChipId); - pScrn->chipset = (char *)xf86TokenToString(VIAChipsets, - pVia->Chipset); + from = X_PROBED; + pVia->ChipId = pVia->PciInfo->chipType; + pVia->Chipset = LookupChipID(VIAPciChipsets, pVia->ChipId); + pScrn->chipset = (char *)xf86TokenToString(VIAChipsets, + pVia->Chipset); } if (pEnt->device->chipRev >= 0) { - pVia->ChipRev = pEnt->device->chipRev; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n", - pVia->ChipRev); + pVia->ChipRev = pEnt->device->chipRev; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n", + pVia->ChipRev); } else { - /*pVia->ChipRev = pVia->PciInfo->chipRev;*/ - /* Read PCI bus 0, dev 0, function 0, index 0xF6 to get chip rev. */ - pVia->ChipRev = pciReadByte(pciTag(0, 0, 0), 0xF6); + /*pVia->ChipRev = pVia->PciInfo->chipRev;*/ + /* Read PCI bus 0, dev 0, function 0, index 0xF6 to get chip rev. */ + pVia->ChipRev = pciReadByte(pciTag(0, 0, 0), 0xF6); } if (pEnt->device->videoRam != 0) { - if (!pScrn->videoRam) - pScrn->videoRam = pEnt->device->videoRam; - else { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Video Memory Size in Option is %d KB, Detect is %d KB!", - pScrn->videoRam, pEnt->device->videoRam); - } + if (!pScrn->videoRam) + pScrn->videoRam = pEnt->device->videoRam; + else { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Video Memory Size in Option is %d KB, Detect is %d KB!", + pScrn->videoRam, pEnt->device->videoRam); + } } pBIOSInfo->Chipset = pVia->Chipset; pBIOSInfo->ChipRev = pVia->ChipRev; @@ -1287,24 +1323,37 @@ xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n", pScrn->chipset); pVia->PciTag = pciTag(pVia->PciInfo->bus, pVia->PciInfo->device, - pVia->PciInfo->func); + pVia->PciInfo->func); switch (pVia->ChipRev) { - case 2: - pBIOSInfo->A2 = TRUE; - break; - default: - pBIOSInfo->A2 = FALSE; - break; + case 2: + pBIOSInfo->A2 = TRUE; + break; + default: + pBIOSInfo->A2 = FALSE; + break; } xf86DrvMsg(pScrn->scrnIndex, from, "Chipset Rev.: %d\n", pVia->ChipRev); hwp = VGAHWPTR(pScrn); vgaHWGetIOBase(hwp); +#define VBECLEAN do { \ + if (pVia->pVbe) { \ + vbeFree(pVia->pVbe); \ + pVia->pVbe = NULL; \ + } \ + } while (0) + if (!VIAMapMMIO(pScrn)) { - vbeFree(pVia->pVbe); - return FALSE; + VBECLEAN; + return FALSE; + } + /* now we can check what devices are connected */ + pBIOSInfo->ConnectedDevice=0; + if ((s = xf86GetOptValString(VIAOptions, OPTION_CONNECTED_DEVICE))) { + pBIOSInfo->ConnectedDevice = + ParseDeviceMask(pScrn,s,"ConnectedDevice",0); } /* Get BIOS ver. From BIOS Call Function */ @@ -1315,109 +1364,110 @@ VIABIOS_GetBIOSDate(pScrn); if (pBIOSInfo->TVType == TVTYPE_NONE) { - /* use jumper to determine TV Type */ - VGAOUT8(0x3D4, 0x3B); - if (VGAIN8(0x3D5) & 0x02) { - pBIOSInfo->TVType = TVTYPE_PAL; - } - else { - pBIOSInfo->TVType = TVTYPE_NTSC; - } + /* use jumper to determine TV Type */ + VGAOUT8(0x3D4, 0x3B); + if (VGAIN8(0x3D5) & 0x02) { + pBIOSInfo->TVType = TVTYPE_PAL; + } + else { + pBIOSInfo->TVType = TVTYPE_NTSC; + } } { - Gamma zeros = {0.0, 0.0, 0.0}; + Gamma zeros = {0.0, 0.0, 0.0}; - if (!xf86SetGamma(pScrn, zeros)) { - vbeFree(pVia->pVbe); - return FALSE; - } + if (!xf86SetGamma(pScrn, zeros)) { + VBECLEAN; + return FALSE; + } } /* Next go on to detect amount of installed ram */ if (pScrn->videoRam < 16384 || pScrn->videoRam > 65536) { - bMemSize = VIABIOS_GetVideoMemSize(pScrn); - if (bMemSize) { - pScrn->videoRam = bMemSize << 6; - } - else { - if(pVia->Chipset == VIA_CLE266) - VGAOUT8(0x3C4, 0x34); - else - VGAOUT8(0x3C4, 0x39); - bMemSize = VGAIN8(0x3c5); - if (bMemSize > 16 && bMemSize <= 128) { - pScrn->videoRam = (bMemSize + 1) << 9; - } - else if (bMemSize > 0 && bMemSize < 31){ - pScrn->videoRam = bMemSize << 12; - } - else { - DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "bMemSize = %d\nGet Video Memory Size by default.\n", bMemSize)); - pScrn->videoRam = 16 << 10; /* Assume the base 16Mb */ - } - } + bMemSize = VIABIOS_GetVideoMemSize(pScrn); + if (bMemSize) { + pScrn->videoRam = bMemSize << 6; + } + else { + if(pVia->Chipset == VIA_CLE266) + VGAOUT8(0x3C4, 0x34); + else + VGAOUT8(0x3C4, 0x39); + bMemSize = VGAIN8(0x3c5); + if (bMemSize > 16 && bMemSize <= 128) { + pScrn->videoRam = (bMemSize + 1) << 9; + } + else if (bMemSize > 0 && bMemSize < 31){ + pScrn->videoRam = bMemSize << 12; + } + else { + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "bMemSize = %d\nGet Video Memory Size by default.\n", bMemSize)); + pScrn->videoRam = 16 << 10; /* Assume the base 16Mb */ + } + } } /* Split FB for SAMM */ /* FIXME: For now, split FB into two equal sections. This should * be able to be adjusted by user with a config option. */ if (pVia->IsSecondary) { - DevUnion* pPriv; - VIAEntPtr pVIAEnt; - VIAPtr pVia1; - - pPriv = xf86GetEntityPrivate(pScrn->entityList[0], - gVIAEntityIndex); - pVIAEnt = pPriv->ptr; - pScrn->videoRam = pScrn->videoRam >> 1; - pVIAEnt->pPrimaryScrn->videoRam = pScrn->videoRam; - pVia1 = VIAPTR(pVIAEnt->pPrimaryScrn); - pVia1->videoRambytes = pScrn->videoRam << 10; - pVia->FrameBufferBase += (pScrn->videoRam << 10); + DevUnion* pPriv; + VIAEntPtr pVIAEnt; + VIAPtr pVia1; + + pPriv = xf86GetEntityPrivate(pScrn->entityList[0], + gVIAEntityIndex); + pVIAEnt = pPriv->ptr; + pScrn->videoRam = pScrn->videoRam >> 1; + pVIAEnt->pPrimaryScrn->videoRam = pScrn->videoRam; + pVia1 = VIAPTR(pVIAEnt->pPrimaryScrn); + pVia1->videoRambytes = pScrn->videoRam << 10; + pVia->FrameBufferBase += (pScrn->videoRam << 10); } pVia->videoRambytes = pScrn->videoRam << 10; xf86DrvMsg(pScrn->scrnIndex, X_PROBED,"videoram = %dk\n", - pScrn->videoRam); + pScrn->videoRam); /* Set status word positions based on chip type. */ switch (pVia->Chipset) { - case VIA_CLE266: - pVia->myWaitIdle = WaitIdleCLE266; - break; - default: - pVia->myWaitIdle = WaitIdleCLE266; - break; + case VIA_CLE266: + pVia->myWaitIdle = WaitIdleCLE266; + break; + default: + pVia->myWaitIdle = WaitIdleCLE266; + break; } - if (!xf86LoadSubModule(pScrn, "i2c")) { - VIAFreeRec(pScrn); - return FALSE; + if (!(pMod = xf86LoadSubModule(pScrn, "i2c"))) { + VIAFreeRec(pScrn); + return FALSE; } else { - xf86LoaderReqSymLists(i2cSymbols,NULL); - VIAI2CInit(pScrn); + xf86LoaderModReqSymLists(pMod, i2cSymbols,NULL); + VIAI2CInit(pScrn); } - if (!xf86LoadSubModule(pScrn, "ddc")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ddc"))) { VIAFreeRec(pScrn); return FALSE; } else { - xf86LoaderReqSymLists(ddcSymbols, NULL); - - if (!(pVia->pVbe && ((pVia->DDC1 = vbeDoEDID(pVia->pVbe, NULL))))) + xf86LoaderModReqSymLists(pMod, ddcSymbols, NULL); + + if (!(pVia->pVbe && ((pVia->DDC1 = vbeDoEDID(pVia->pVbe, pMod))))) if (!(pVia->DDC1 = xf86DoEDID_DDC2(pScrn->scrnIndex, pVia->I2C_Port1))) pVia->DDC1 = VIAddc1(pScrn->scrnIndex, pVia); - + if (pVia->DDC1) { xf86PrintEDID(pVia->DDC1); xf86SetDDCproperties(pScrn, pVia->DDC1); } } + VBECLEAN; /* * Setup the ClockRanges, which describe what clock ranges are available, @@ -1443,41 +1493,41 @@ /* Select valid modes from those available */ i = xf86ValidateModes(pScrn, - pScrn->monitor->Modes, /* availModes */ - pScrn->display->modes, /* modeNames */ - clockRanges, /* list of clock ranges */ - NULL, /* list of line pitches */ - 256, /* mini line pitch */ - 2048, /* max line pitch */ - 16 * pScrn->bitsPerPixel, /* pitch inc (bits) */ - 128, /* min height */ - 2048, /* max height */ - pScrn->display->virtualX, /* virtual width */ - pScrn->display->virtualY, /* virutal height */ - pVia->videoRambytes, /* size of video memory */ - LOOKUP_BEST_REFRESH); /* lookup mode flags */ + pScrn->monitor->Modes, /* availModes */ + pScrn->display->modes, /* modeNames */ + clockRanges, /* list of clock ranges */ + NULL, /* list of line pitches */ + 256, /* mini line pitch */ + 2048, /* max line pitch */ + 16 * pScrn->bitsPerPixel, /* pitch inc (bits) */ + 128, /* min height */ + 2048, /* max height */ + pScrn->display->virtualX, /* virtual width */ + pScrn->display->virtualY, /* virutal height */ + pVia->videoRambytes, /* size of video memory */ + LOOKUP_BEST_REFRESH); /* lookup mode flags */ if (i == -1) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86ValidateModes failure\n"); - VIAFreeRec(pScrn); - return FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86ValidateModes failure\n"); + VIAFreeRec(pScrn); + return FALSE; } xf86PruneDriverModes(pScrn); if (i == 0 || pScrn->modes == NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); - VIAFreeRec(pScrn); - return FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); + VIAFreeRec(pScrn); + return FALSE; } - + /* Set up screen parameters. */ pVia->Bpp = pScrn->bitsPerPixel >> 3; pVia->Bpl = pScrn->displayWidth * pVia->Bpp; if (!VIAGetBIOSTable(pBIOSInfo)) { - VIAFreeRec(pScrn); - return FALSE; + VIAFreeRec(pScrn); + return FALSE; } pBIOSInfo->I2C_Port1 = pVia->I2C_Port1; @@ -1487,119 +1537,94 @@ /* Detect TV Encoder */ if (!pBIOSInfo->TVEncoder) { - pBIOSInfo->TVEncoder = VIACheckTVExist(pBIOSInfo); + pBIOSInfo->TVEncoder = VIACheckTVExist(pBIOSInfo); } /* Detect TMDS/LVDS Encoder */ VIAPostDVI(pBIOSInfo); /*VIAGetPanelInfo(pBIOSInfo);*/ - pBIOSInfo->ConnectedDevice = VIAGetDeviceDetect(pBIOSInfo); + if(!pBIOSInfo->ConnectedDevice) + pBIOSInfo->ConnectedDevice = VIAGetDeviceDetect(pBIOSInfo); xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V); pScrn->currentMode = pScrn->modes; xf86PrintModes(pScrn); xf86SetDpi(pScrn, 0, 0); -#ifdef USE_FB - if (xf86LoadSubModule(pScrn, "fb") == NULL) { - VIAFreeRec(pScrn); - return FALSE; - } - - xf86LoaderReqSymLists(fbSymbols, NULL); - -#else - /* load bpp-specific modules */ - switch (pScrn->bitsPerPixel) { - case 8: - mod = "cfb"; - reqSym = "cfbScreenInit"; - break; - case 16: - mod = "cfb16"; - reqSym = "cfb16ScreenInit"; - break; - case 32: - mod = "cfb32"; - reqSym = "cfb32ScreenInit"; - break; - } - - if (mod && xf86LoadSubModule(pScrn, mod) == NULL) { - VIAFreeRec(pScrn); - return FALSE; + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { + VIAFreeRec(pScrn); + return FALSE; } - xf86LoaderReqSymbols(reqSym, NULL); -#endif + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); if (!pVia->NoAccel) { - if(!xf86LoadSubModule(pScrn, "xaa")) { - VIAFreeRec(pScrn); - return FALSE; - } - xf86LoaderReqSymLists(xaaSymbols, NULL); + if(!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { + VIAFreeRec(pScrn); + return FALSE; + } + xf86LoaderModReqSymLists(pMod, xaaSymbols, NULL); } if (pVia->hwcursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { - VIAFreeRec(pScrn); - return FALSE; - } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { + VIAFreeRec(pScrn); + return FALSE; + } + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } if (pVia->shadowFB) { - if (!xf86LoadSubModule(pScrn, "shadowfb")) { - VIAFreeRec(pScrn); - return FALSE; - } - xf86LoaderReqSymLists(shadowSymbols, NULL); + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { + VIAFreeRec(pScrn); + return FALSE; + } + xf86LoaderModReqSymLists(pMod, shadowSymbols, NULL); } /* Capture option parameter */ pVia->Cap0_Deinterlace = CAP_BOB; if ((s = xf86GetOptValString(VIAOptions, OPTION_CAP0_DEINTERLACE))) { - if (!xf86NameCmp(s, "Bob")) { - pVia->Cap0_Deinterlace = CAP_BOB; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Capture 0 de-interlace mode is Bob\n"); - } - else if(!xf86NameCmp(s, "Weave")) { - pVia->Cap0_Deinterlace = CAP_WEAVE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Capture 0 de-interlace mode is Weave\n"); - } + if (!xf86NameCmp(s, "Bob")) { + pVia->Cap0_Deinterlace = CAP_BOB; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Capture 0 de-interlace mode is Bob\n"); + } + else if(!xf86NameCmp(s, "Weave")) { + pVia->Cap0_Deinterlace = CAP_WEAVE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Capture 0 de-interlace mode is Weave\n"); + } } pVia->Cap1_Deinterlace = CAP_BOB; if ((s = xf86GetOptValString(VIAOptions, OPTION_CAP1_DEINTERLACE))) { - if (!xf86NameCmp(s, "Bob")) { - pVia->Cap1_Deinterlace = CAP_BOB; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Capture 1 de-interlace mode is Bob\n"); - } - else if(!xf86NameCmp(s, "Weave")) { - pVia->Cap1_Deinterlace = CAP_WEAVE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Capture 1 de-interlace mode is Weave\n"); - } + if (!xf86NameCmp(s, "Bob")) { + pVia->Cap1_Deinterlace = CAP_BOB; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Capture 1 de-interlace mode is Bob\n"); + } + else if(!xf86NameCmp(s, "Weave")) { + pVia->Cap1_Deinterlace = CAP_WEAVE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Capture 1 de-interlace mode is Weave\n"); + } } - + if (xf86ReturnOptValBool(VIAOptions, OPTION_CAP0_FIELDSWAP, FALSE)) { - pVia->Cap0_FieldSwap = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Option: Cap0_FieldSwap Enabled\n"); + pVia->Cap0_FieldSwap = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Option: Cap0_FieldSwap Enabled\n"); } else { - pVia->Cap0_FieldSwap = FALSE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Option: Cap0_FieldSwap Disabled\n"); + pVia->Cap0_FieldSwap = FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Option: Cap0_FieldSwap Disabled\n"); } - /* xf86LoaderReqSymLists(mpegSymbols, NULL); */ + /* xf86LoaderModReqSymLists(pMod, mpegSymbols, NULL); */ VIADeviceSelection(pScrn); if (pVia->IsSecondary) { - if (pBIOSInfo->SAMM) - VIADeviceDispatch(pScrn); - else - return FALSE; + if (pBIOSInfo->SAMM) + VIADeviceDispatch(pScrn); + else + return FALSE; } VIAUnmapMem(pScrn); @@ -1625,18 +1650,18 @@ /* Patch for APM suspend resume, HWCursor has garbage */ if (pVia->hwcursor && pVia->CursorImage) { - DEBUG(xf86DrvMsg(scrnIndex, X_INFO, "Restore Cursor Image!\n")); - memcpy(pVia->FBBase + pVia->CursorStart, pVia->CursorImage, 0x1000); - VIASETREG(VIA_REG_CURSOR_FG, pVia->CursorFG); - VIASETREG(VIA_REG_CURSOR_BG, pVia->CursorBG); - VIASETREG(VIA_REG_CURSOR_MODE, pVia->CursorMC); - xfree(pVia->CursorImage); - /*VIALoadCursorImage(pScrn, *pVia->CursorImage);*/ + DEBUG(xf86DrvMsg(scrnIndex, X_INFO, "Restore Cursor Image!\n")); + memcpy(pVia->FBBase + pVia->CursorStart, pVia->CursorImage, 0x1000); + VIASETREG(VIA_REG_CURSOR_FG, pVia->CursorFG); + VIASETREG(VIA_REG_CURSOR_BG, pVia->CursorBG); + VIASETREG(VIA_REG_CURSOR_MODE, pVia->CursorMC); + xfree(pVia->CursorImage); + /*VIALoadCursorImage(pScrn, *pVia->CursorImage);*/ } /* retore video status */ if (!pVia->IsSecondary) - viaRestoreVideo(pScrn); + viaRestoreVideo(pScrn); VIAAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); return ret; @@ -1652,29 +1677,29 @@ VIARegPtr viaSavePtr = &pVia->SavedReg; DEBUG(xf86DrvMsg(scrnIndex, X_INFO, "VIALeaveVT\n")); - + /* FIXME: take the DRI lock here to avoid accidents */ /* FIXME: unbind the AGP memory ? */ - + /* Wait Hardware Engine idle to exit graphicd mode */ WaitIdle(); if (pVia->VQEnable) { - /* if we use VQ, disable it before we exit */ - VIASETREG(0x43c, 0x00fe0000); - VIASETREG(0x440, 0x00000004); + /* if we use VQ, disable it before we exit */ + VIASETREG(0x43c, 0x00fe0000); + VIASETREG(0x440, 0x00000004); } /* Save video status and turn off all video activities */ if (!pVia->IsSecondary) - viaSaveVideo(pScrn); + viaSaveVideo(pScrn); if (pVia->hwcursor) { - pVia->CursorImage = xcalloc(1, 0x1000); - memcpy(pVia->CursorImage, pVia->FBBase + pVia->CursorStart, 0x1000); - pVia->CursorFG = (CARD32)VIAGETREG(VIA_REG_CURSOR_FG); - pVia->CursorBG = (CARD32)VIAGETREG(VIA_REG_CURSOR_BG); - pVia->CursorMC = (CARD32)VIAGETREG(VIA_REG_CURSOR_MODE); + pVia->CursorImage = xcalloc(1, 0x1000); + memcpy(pVia->CursorImage, pVia->FBBase + pVia->CursorStart, 0x1000); + pVia->CursorFG = (CARD32)VIAGETREG(VIA_REG_CURSOR_FG); + pVia->CursorBG = (CARD32)VIAGETREG(VIA_REG_CURSOR_BG); + pVia->CursorMC = (CARD32)VIAGETREG(VIA_REG_CURSOR_MODE); } VIAWriteMode(pScrn, vgaSavePtr, viaSavePtr); @@ -1699,174 +1724,174 @@ if(pVia->IsSecondary) { - DevUnion* pPriv; - VIAEntPtr pVIAEnt; - VIAPtr pVia1; - vgaHWPtr hwp1; - pPriv = xf86GetEntityPrivate(pScrn->entityList[0], - gVIAEntityIndex); - pVIAEnt = pPriv->ptr; - hwp1 = VGAHWPTR(pVIAEnt->pPrimaryScrn); - pVia1 = VIAPTR(pVIAEnt->pPrimaryScrn); - hwp->SavedReg = hwp1->SavedReg; - pVia->SavedReg = pVia1->SavedReg; - } - else { - vgaHWProtect(pScrn, TRUE); - - if (xf86IsPrimaryPci(pVia->PciInfo)) { - vgaHWSave(pScrn, vgaSavePtr, VGA_SR_ALL); - } - else { - vgaHWSave(pScrn, vgaSavePtr, VGA_SR_MODE); - } - - vgaIOBase = hwp->IOBase; - vgaCRReg = vgaIOBase + 5; - vgaCRIndex = vgaIOBase + 4; - - /* Unlock Extended Regs */ - outb(0x3c4, 0x10); - outb(0x3c5, 0x01); - - VGAOUT8(0x3c4, 0x14); - save->SR14 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x15); - save->SR15 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x16); - save->SR16 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x17); - save->SR17 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x18); - save->SR18 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x19); - save->SR19 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x1a); - save->SR1A = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x1b); - save->SR1B = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x1c); - save->SR1C = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x1d); - save->SR1D = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x1e); - save->SR1E = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x1f); - save->SR1F = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x22); - save->SR22 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x23); - save->SR23 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x24); - save->SR24 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x25); - save->SR25 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x26); - save->SR26 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x27); - save->SR27 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x28); - save->SR28 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x29); - save->SR29 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x2a); - save->SR2A = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x2b); - save->SR2B = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x2e); - save->SR2E = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x44); - save->SR44 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x45); - save->SR45 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x46); - save->SR46 = VGAIN8(0x3c5); - VGAOUT8(0x3c4, 0x47); - save->SR47 = VGAIN8(0x3c5); - - VGAOUT8(vgaCRIndex, 0x13); - save->CR13 = VGAIN8(vgaCRReg); - VGAOUT8(vgaCRIndex, 0x32); - save->CR32 = VGAIN8(vgaCRReg); - VGAOUT8(vgaCRIndex, 0x33); - save->CR33 = VGAIN8(vgaCRReg); - VGAOUT8(vgaCRIndex, 0x34); - save->CR34 = VGAIN8(vgaCRReg); - VGAOUT8(vgaCRIndex, 0x35); - save->CR35 = VGAIN8(vgaCRReg); - VGAOUT8(vgaCRIndex, 0x36); - save->CR36 = VGAIN8(vgaCRReg); - - /* Saving TV register status before set mode */ - switch (pBIOSInfo->TVEncoder) { - case VIA_NONETV: - break; - case VIA_VT1623: - VIAGPIOI2C_Initial(pBIOSInfo, 0x40); - for (i = 0; i < 0x6C; i++) { - VIAGPIOI2C_ReadByte(pBIOSInfo, i, (TVRegs + i)); - save->TVRegs[i] = TVRegs[i]; - /*DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Save TV Register[%d]0x%X\n", i, save->TVRegs[i]));*/ - } - break; - default: - if (xf86I2CProbeAddress(pVia->I2C_Port2, pBIOSInfo->TVI2CAdd)) { - dev = xf86CreateI2CDevRec(); - dev->DevName = "TV"; - dev->SlaveAddr = pBIOSInfo->TVI2CAdd; - dev->pI2CBus = pVia->I2C_Port2; - - if (xf86I2CDevInit(dev)) { - W_Buffer[0] = 0; - xf86I2CWriteRead(dev, W_Buffer,1, TVRegs, 0xFF); - for (i = 0; i < 0xFF; i++) { - save->TVRegs[i] = TVRegs[i]; - } - xf86DestroyI2CDevRec(dev,TRUE); - } - else - xf86DestroyI2CDevRec(dev,TRUE); - } - break; - } - - /* Saving LVDS register status before set mode - if (pBIOSInfo->LVDS == VIA_CH7019LVDS) { - dev = xf86CreateI2CDevRec(); - dev->DevName = "LVDS"; - dev->SlaveAddr = 0xEA; - dev->pI2CBus = pVia->I2C_Port2; - - if (xf86I2CDevInit(dev)) { - for (i = 0; i < 0x40; i++) { - W_Buffer[0] = i + 0x40; - xf86I2CWriteRead(dev, W_Buffer, 1, save->LCDRegs + i, 1); - } - xf86DestroyI2CDevRec(dev,TRUE); - } - else - xf86DestroyI2CDevRec(dev,TRUE); - }*/ - - /* Save LCD control regs */ - for (i = 0; i < 68; i++) { - VGAOUT8(vgaCRIndex, i + 0x50); - save->CRTCRegs[i] = VGAIN8(vgaCRReg); - } - - if (!pVia->ModeStructInit) { - vgaHWCopyReg(&hwp->ModeReg, vgaSavePtr); - memcpy(&pVia->ModeReg, save, sizeof(VIARegRec)); - pVia->ModeStructInit = TRUE; - } - vgaHWProtect(pScrn, FALSE); + DevUnion* pPriv; + VIAEntPtr pVIAEnt; + VIAPtr pVia1; + vgaHWPtr hwp1; + pPriv = xf86GetEntityPrivate(pScrn->entityList[0], + gVIAEntityIndex); + pVIAEnt = pPriv->ptr; + hwp1 = VGAHWPTR(pVIAEnt->pPrimaryScrn); + pVia1 = VIAPTR(pVIAEnt->pPrimaryScrn); + hwp->SavedReg = hwp1->SavedReg; + pVia->SavedReg = pVia1->SavedReg; + } + else { + vgaHWProtect(pScrn, TRUE); + + if (xf86IsPrimaryPci(pVia->PciInfo)) { + vgaHWSave(pScrn, vgaSavePtr, VGA_SR_ALL); + } + else { + vgaHWSave(pScrn, vgaSavePtr, VGA_SR_MODE); + } + + vgaIOBase = hwp->IOBase; + vgaCRReg = vgaIOBase + 5; + vgaCRIndex = vgaIOBase + 4; + + /* Unlock Extended Regs */ + outb(0x3c4, 0x10); + outb(0x3c5, 0x01); + + VGAOUT8(0x3c4, 0x14); + save->SR14 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x15); + save->SR15 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x16); + save->SR16 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x17); + save->SR17 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x18); + save->SR18 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x19); + save->SR19 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x1a); + save->SR1A = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x1b); + save->SR1B = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x1c); + save->SR1C = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x1d); + save->SR1D = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x1e); + save->SR1E = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x1f); + save->SR1F = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x22); + save->SR22 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x23); + save->SR23 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x24); + save->SR24 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x25); + save->SR25 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x26); + save->SR26 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x27); + save->SR27 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x28); + save->SR28 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x29); + save->SR29 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x2a); + save->SR2A = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x2b); + save->SR2B = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x2e); + save->SR2E = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x44); + save->SR44 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x45); + save->SR45 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x46); + save->SR46 = VGAIN8(0x3c5); + VGAOUT8(0x3c4, 0x47); + save->SR47 = VGAIN8(0x3c5); + + VGAOUT8(vgaCRIndex, 0x13); + save->CR13 = VGAIN8(vgaCRReg); + VGAOUT8(vgaCRIndex, 0x32); + save->CR32 = VGAIN8(vgaCRReg); + VGAOUT8(vgaCRIndex, 0x33); + save->CR33 = VGAIN8(vgaCRReg); + VGAOUT8(vgaCRIndex, 0x34); + save->CR34 = VGAIN8(vgaCRReg); + VGAOUT8(vgaCRIndex, 0x35); + save->CR35 = VGAIN8(vgaCRReg); + VGAOUT8(vgaCRIndex, 0x36); + save->CR36 = VGAIN8(vgaCRReg); + + /* Saving TV register status before set mode */ + switch (pBIOSInfo->TVEncoder) { + case VIA_NONETV: + break; + case VIA_VT1623: + VIAGPIOI2C_Initial(pBIOSInfo, 0x40); + for (i = 0; i < 0x6C; i++) { + VIAGPIOI2C_ReadByte(pBIOSInfo, i, (TVRegs + i)); + save->TVRegs[i] = TVRegs[i]; + /*DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Save TV Register[%d]0x%X\n", i, save->TVRegs[i]));*/ + } + break; + default: + if (xf86I2CProbeAddress(pVia->I2C_Port2, pBIOSInfo->TVI2CAdd)) { + dev = xf86CreateI2CDevRec(); + dev->DevName = "TV"; + dev->SlaveAddr = pBIOSInfo->TVI2CAdd; + dev->pI2CBus = pVia->I2C_Port2; + + if (xf86I2CDevInit(dev)) { + W_Buffer[0] = 0; + xf86I2CWriteRead(dev, W_Buffer,1, TVRegs, 0xFF); + for (i = 0; i < 0xFF; i++) { + save->TVRegs[i] = TVRegs[i]; + } + xf86DestroyI2CDevRec(dev,TRUE); + } + else + xf86DestroyI2CDevRec(dev,TRUE); + } + break; + } + + /* Saving LVDS register status before set mode + if (pBIOSInfo->LVDS == VIA_CH7019LVDS) { + dev = xf86CreateI2CDevRec(); + dev->DevName = "LVDS"; + dev->SlaveAddr = 0xEA; + dev->pI2CBus = pVia->I2C_Port2; + + if (xf86I2CDevInit(dev)) { + for (i = 0; i < 0x40; i++) { + W_Buffer[0] = i + 0x40; + xf86I2CWriteRead(dev, W_Buffer, 1, save->LCDRegs + i, 1); + } + xf86DestroyI2CDevRec(dev,TRUE); + } + else + xf86DestroyI2CDevRec(dev,TRUE); + }*/ + + /* Save LCD control regs */ + for (i = 0; i < 68; i++) { + VGAOUT8(vgaCRIndex, i + 0x50); + save->CRTCRegs[i] = VGAIN8(vgaCRReg); + } + + if (!pVia->ModeStructInit) { + vgaHWCopyReg(&hwp->ModeReg, vgaSavePtr); + memcpy(&pVia->ModeReg, save, sizeof(VIARegRec)); + pVia->ModeStructInit = TRUE; + } + vgaHWProtect(pScrn, FALSE); } return; } static void VIAWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, - VIARegPtr restore) + VIARegPtr restore) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); @@ -1889,29 +1914,29 @@ */ if (restore->mode != 0xFF) { - /* Set up the mode. Don't clear video RAM. */ - if (!pVia->IsSecondary) - VIASetModeUseBIOSTable(pBIOSInfo); - else - VIASetModeForMHS(pBIOSInfo); - - /* Restore the DAC.*/ - if (pBIOSInfo->FirstInit ) { - vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_CMAP); - } - /*else { - vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_MODE); - } - vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_CMAP);*/ - pBIOSInfo->FirstInit = FALSE; - /* Enable the graphics engine. */ - if (!pVia->NoAccel) - VIAInitialize2DEngine(pScrn); + /* Set up the mode. Don't clear video RAM. */ + if (!pVia->IsSecondary) + VIASetModeUseBIOSTable(pBIOSInfo); + else + VIASetModeForMHS(pBIOSInfo); + + /* Restore the DAC.*/ + if (pBIOSInfo->FirstInit ) { + vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_CMAP); + } + /*else { + vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_MODE); + } + vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_CMAP);*/ + pBIOSInfo->FirstInit = FALSE; + /* Enable the graphics engine. */ + if (!pVia->NoAccel) + VIAInitialize2DEngine(pScrn); #ifdef XF86DRI - VIAInitialize3DEngine(pScrn); + VIAInitialize3DEngine(pScrn); #endif - return; + return; } vgaHWProtect(pScrn, TRUE); /* Unlock Extended Regs */ @@ -1929,71 +1954,71 @@ VGAOUT8(vgaCRReg, 0); switch (pBIOSInfo->TVEncoder) { - case VIA_TV2PLUS: - case VIA_TV3: - case VIA_CH7009: - case VIA_CH7019: - case VIA_SAA7108: - case VIA_CH7005: - case VIA_VT1622A: - dev = xf86CreateI2CDevRec(); - dev->DevName = "TV"; - dev->SlaveAddr = pBIOSInfo->TVI2CAdd; - dev->pI2CBus = pVia->I2C_Port2; - if (xf86I2CDevInit(dev)) { - for (i = 0; i < 0xFF; i++) { - W_Buffer[0] = (unsigned char)(i); - W_Buffer[1] = (unsigned char)(restore->TVRegs[i]); - xf86I2CWriteRead(dev, W_Buffer, 2, NULL,0); - } - xf86DestroyI2CDevRec(dev,TRUE); - } - else - xf86DestroyI2CDevRec(dev,TRUE); - break; - case VIA_FS454: - dev = xf86CreateI2CDevRec(); - dev->DevName = "TV"; - dev->SlaveAddr = pBIOSInfo->TVI2CAdd; - dev->pI2CBus = pVia->I2C_Port2; - if (xf86I2CDevInit(dev)) { - - /* QPR programming */ - W_Buffer[0] = 0xC4; - W_Buffer[1] = (unsigned char)(restore->TVRegs[0xC4]); - W_Buffer[2] = (unsigned char)(restore->TVRegs[0xC5]); - xf86I2CWriteRead(dev, W_Buffer,3, NULL,0); - - /* Restore TV Regs */ - for (i = 0; i < 0xFF; i++) { - W_Buffer[0] = (unsigned char)(i); - W_Buffer[1] = (unsigned char)(restore->TVRegs[i]); - if (i == 0xC4) - i++; - else - xf86I2CWriteRead(dev, W_Buffer, 2, NULL,0); - } - xf86DestroyI2CDevRec(dev,TRUE); - } - else - xf86DestroyI2CDevRec(dev,TRUE); - break; - case VIA_VT1623: - VIAGPIOI2C_Initial(pBIOSInfo, 0x40); - for (i = 0; i < 0x6C; i++) { - VIAGPIOI2C_Write(pBIOSInfo, i, restore->TVRegs[i]); - /*DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Write Back Register[%d]:0x%X\n", i, restore->TVRegs[i]));*/ - } - break; - default: - break; + case VIA_TV2PLUS: + case VIA_TV3: + case VIA_CH7009: + case VIA_CH7019: + case VIA_SAA7108: + case VIA_CH7005: + case VIA_VT1622A: + dev = xf86CreateI2CDevRec(); + dev->DevName = "TV"; + dev->SlaveAddr = pBIOSInfo->TVI2CAdd; + dev->pI2CBus = pVia->I2C_Port2; + if (xf86I2CDevInit(dev)) { + for (i = 0; i < 0xFF; i++) { + W_Buffer[0] = (unsigned char)(i); + W_Buffer[1] = (unsigned char)(restore->TVRegs[i]); + xf86I2CWriteRead(dev, W_Buffer, 2, NULL,0); + } + xf86DestroyI2CDevRec(dev,TRUE); + } + else + xf86DestroyI2CDevRec(dev,TRUE); + break; + case VIA_FS454: + dev = xf86CreateI2CDevRec(); + dev->DevName = "TV"; + dev->SlaveAddr = pBIOSInfo->TVI2CAdd; + dev->pI2CBus = pVia->I2C_Port2; + if (xf86I2CDevInit(dev)) { + + /* QPR programming */ + W_Buffer[0] = 0xC4; + W_Buffer[1] = (unsigned char)(restore->TVRegs[0xC4]); + W_Buffer[2] = (unsigned char)(restore->TVRegs[0xC5]); + xf86I2CWriteRead(dev, W_Buffer,3, NULL,0); + + /* Restore TV Regs */ + for (i = 0; i < 0xFF; i++) { + W_Buffer[0] = (unsigned char)(i); + W_Buffer[1] = (unsigned char)(restore->TVRegs[i]); + if (i == 0xC4) + i++; + else + xf86I2CWriteRead(dev, W_Buffer, 2, NULL,0); + } + xf86DestroyI2CDevRec(dev,TRUE); + } + else + xf86DestroyI2CDevRec(dev,TRUE); + break; + case VIA_VT1623: + VIAGPIOI2C_Initial(pBIOSInfo, 0x40); + for (i = 0; i < 0x6C; i++) { + VIAGPIOI2C_Write(pBIOSInfo, i, restore->TVRegs[i]); + /*DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Write Back Register[%d]:0x%X\n", i, restore->TVRegs[i]));*/ + } + break; + default: + break; } /* restore the standard vga regs */ if (xf86IsPrimaryPci(pVia->PciInfo)) - vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_ALL); + vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_ALL); else - vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_MODE); + vgaHWRestore(pScrn, vgaSavePtr, VGA_SR_MODE); /* restore extended regs */ VGAOUT8(0x3c4, 0x14); @@ -2066,32 +2091,32 @@ /* Restore LCD control regs */ for (i = 0; i < 68; i++) { - VGAOUT8(vgaCRIndex, i + 0x50); - VGAOUT8(vgaCRReg, restore->CRTCRegs[i]); + VGAOUT8(vgaCRIndex, i + 0x50); + VGAOUT8(vgaCRReg, restore->CRTCRegs[i]); } /*if (pBIOSInfo->LVDS == VIA_CH7019LVDS) { - dev = xf86CreateI2CDevRec(); - dev->DevName = "LVDS"; - dev->SlaveAddr = 0xEA; - dev->pI2CBus = pVia->I2C_Port2; - - if (xf86I2CDevInit(dev)) { - for (i = 0; i < 0x40; i++) { - W_Buffer[0] = (unsigned char)(i + 0x40); - W_Buffer[1] = (unsigned char)(restore->LCDRegs[i]); - xf86I2CWriteRead(dev, W_Buffer, 2, NULL,0); - } - - xf86DestroyI2CDevRec(dev,TRUE); - } - else - xf86DestroyI2CDevRec(dev,TRUE); + dev = xf86CreateI2CDevRec(); + dev->DevName = "LVDS"; + dev->SlaveAddr = 0xEA; + dev->pI2CBus = pVia->I2C_Port2; + + if (xf86I2CDevInit(dev)) { + for (i = 0; i < 0x40; i++) { + W_Buffer[0] = (unsigned char)(i + 0x40); + W_Buffer[1] = (unsigned char)(restore->LCDRegs[i]); + xf86I2CWriteRead(dev, W_Buffer, 2, NULL,0); + } + + xf86DestroyI2CDevRec(dev,TRUE); + } + else + xf86DestroyI2CDevRec(dev,TRUE); - ActiveDevice = VIABIOS_GetActiveDevice(pScrn); + ActiveDevice = VIABIOS_GetActiveDevice(pScrn); }*/ if (pBIOSInfo->DefaultActiveDevice & VIA_DEVICE_LCD) - VIAEnableLCD(pBIOSInfo); + VIAEnableLCD(pBIOSInfo); VIADisabledExtendedFIFO(pBIOSInfo); /* Reset clock */ @@ -2101,7 +2126,7 @@ /* If we're going into graphics mode and acceleration was enabled, */ /* if (graphicsMode && (!pVia->NoAccel)) { - VIAInitialize2DEngine(pScrn); + VIAInitialize2DEngine(pScrn); } */ vgaHWProtect(pScrn, FALSE); @@ -2121,26 +2146,26 @@ pVia->MmioBase = pVia->PciInfo->memBase[1]; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, - "mapping MMIO @ 0x%lx with size 0x%x\n", - pVia->MmioBase, VIA_MMIO_REGSIZE); + "mapping MMIO @ 0x%lx with size 0x%x\n", + pVia->MmioBase, VIA_MMIO_REGSIZE); pVia->MapBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag, - pVia->MmioBase, - VIA_MMIO_REGSIZE); + pVia->MmioBase, + VIA_MMIO_REGSIZE); pBIOSInfo->MapBase = pVia->MapBase; xf86DrvMsg(pScrn->scrnIndex, X_PROBED, - "mapping BitBlt MMIO @ 0x%lx with size 0x%x\n", - pVia->MmioBase + VIA_MMIO_BLTBASE, VIA_MMIO_BLTSIZE); + "mapping BitBlt MMIO @ 0x%lx with size 0x%x\n", + pVia->MmioBase + VIA_MMIO_BLTBASE, VIA_MMIO_BLTSIZE); pVia->BltBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag, - pVia->MmioBase + VIA_MMIO_BLTBASE, - VIA_MMIO_BLTSIZE); + pVia->MmioBase + VIA_MMIO_BLTBASE, + VIA_MMIO_BLTSIZE); if (!pVia->MapBase || !pVia->BltBase) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Internal error: cound not map registers\n"); - return FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Internal error: cound not map registers\n"); + return FALSE; } /* Memory mapped IO for Video Engine */ @@ -2161,8 +2186,8 @@ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAMapFB\n")); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, - "mapping framebuffer @ 0x%lx with size 0x%lx\n", - pVia->FrameBufferBase, pVia->videoRambytes); + "mapping framebuffer @ 0x%lx with size 0x%lx\n", + pVia->FrameBufferBase, pVia->videoRambytes); if (pVia->videoRambytes) { @@ -2172,37 +2197,37 @@ * in the OS support layer. */ - unsigned char *tmp; - tmp = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, + unsigned char *tmp; + tmp = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pVia->PciTag, pVia->FrameBufferBase, pVia->videoRambytes); - xf86UnMapVidMem(pScrn->scrnIndex, (pointer)tmp, - pVia->videoRambytes); + xf86UnMapVidMem(pScrn->scrnIndex, (pointer)tmp, + pVia->videoRambytes); /* * End of hack. */ - pVia->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - pVia->PciTag, pVia->FrameBufferBase, - pVia->videoRambytes); + pVia->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, + pVia->PciTag, pVia->FrameBufferBase, + pVia->videoRambytes); pBIOSInfo->FBBase = pVia->FBBase; pBIOSInfo->videoRambytes = pVia->videoRambytes; - if (!pVia->FBBase) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Internal error: could not map framebuffer\n"); - return FALSE; - } - - pVia->FBStart = pVia->FBBase; - pVia->FBFreeStart = (pScrn->displayWidth * pScrn->bitsPerPixel >> 3) * - pScrn->virtualY; - pVia->FBFreeEnd = pVia->videoRambytes; - - xf86DrvMsg(pScrn->scrnIndex, X_PROBED, - "Frame buffer start: %p, free start: 0x%x end: 0x%x\n", - pVia->FBStart, pVia->FBFreeStart, pVia->FBFreeEnd); + if (!pVia->FBBase) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Internal error: could not map framebuffer\n"); + return FALSE; + } + + pVia->FBStart = pVia->FBBase; + pVia->FBFreeStart = (pScrn->displayWidth * pScrn->bitsPerPixel >> 3) * + pScrn->virtualY; + pVia->FBFreeEnd = pVia->videoRambytes; + + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Frame buffer start: %p, free start: 0x%x end: 0x%x\n", + pVia->FBStart, pVia->FBFreeStart, pVia->FBFreeEnd); } pScrn->memPhysBase = pVia->PciInfo->memBase[0]; @@ -2224,18 +2249,18 @@ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIAUnmapMem\n")); if (pVia->MapBase) { - xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pVia->MapBase, - VIA_MMIO_REGSIZE); + xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pVia->MapBase, + VIA_MMIO_REGSIZE); } if (pVia->BltBase) { - xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pVia->BltBase, - VIA_MMIO_BLTSIZE); + xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pVia->BltBase, + VIA_MMIO_BLTSIZE); } if (pVia->FBBase) { - xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pVia->FBBase, - pVia->videoRambytes); + xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pVia->FBBase, + pVia->videoRambytes); } return; @@ -2243,7 +2268,7 @@ static Bool VIAScreenInit(int scrnIndex, ScreenPtr pScreen, - int argc, char **argv) + int argc, char **argv) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; vgaHWPtr hwp = VGAHWPTR(pScrn); @@ -2254,10 +2279,10 @@ vgaHWUnlock(hwp); if (!VIAMapFB(pScrn)) - return FALSE; + return FALSE; if (!VIAMapMMIO(pScrn)) - return FALSE; + return FALSE; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- Mem Mapped\n")); @@ -2266,7 +2291,7 @@ vgaHWBlankScreen(pScrn, FALSE); if (!VIAModeInit(pScrn, pScrn->currentMode)) - return FALSE; + return FALSE; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- State saved\n")); @@ -2279,17 +2304,17 @@ miClearVisualTypes(); if (pScrn->bitsPerPixel > 8 && !pVia->IsSecondary) { - if (!miSetVisualTypes(pScrn->depth, TrueColorMask, - pScrn->rgbBits, pScrn->defaultVisual)) - return FALSE; - if (!miSetPixmapDepths()) - return FALSE; + if (!miSetVisualTypes(pScrn->depth, TrueColorMask, + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; + if (!miSetPixmapDepths()) + return FALSE; } else { - if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), - pScrn->rgbBits, pScrn->defaultVisual)) - return FALSE; - if (!miSetPixmapDepths()) - return FALSE; + if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; + if (!miSetPixmapDepths()) + return FALSE; } DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- Visuals set up\n")); @@ -2297,59 +2322,54 @@ ret = VIAInternalScreenInit(scrnIndex, pScreen); if (!ret) - return FALSE; + return FALSE; xf86SetBlackWhitePixels(pScreen); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- B & W\n")); if (pScrn->bitsPerPixel > 8) { - VisualPtr visual; + VisualPtr visual; - visual = pScreen->visuals + pScreen->numVisuals; - while (--visual >= pScreen->visuals) { - if ((visual->class | DynamicClass) == DirectColor) { - visual->offsetRed = pScrn->offset.red; - visual->offsetGreen = pScrn->offset.green; - visual->offsetBlue = pScrn->offset.blue; - visual->redMask = pScrn->mask.red; - visual->greenMask = pScrn->mask.green; - visual->blueMask = pScrn->mask.blue; - } - } + visual = pScreen->visuals + pScreen->numVisuals; + while (--visual >= pScreen->visuals) { + if ((visual->class | DynamicClass) == DirectColor) { + visual->offsetRed = pScrn->offset.red; + visual->offsetGreen = pScrn->offset.green; + visual->offsetBlue = pScrn->offset.blue; + visual->redMask = pScrn->mask.red; + visual->greenMask = pScrn->mask.green; + visual->blueMask = pScrn->mask.blue; + } + } } -#ifdef USE_FB /* must be after RGB ordering fixed */ fbPictureInit(pScreen, 0, 0); -#endif if (!pVia->NoAccel) { - VIAInitAccel(pScreen); - } -#ifdef XFREE86_44 - else { + VIAInitAccel(pScreen); + } else { /* * This is needed because xf86InitFBManagerLinear in VIAInitLinear - * needs xf86InitFBManager to have been initialized, and + * needs xf86InitFBManager to have been initialized, and * xf86InitFBManager needs at least one line of free memory to * work. This is only for Xv in Noaccel part, and since Xv is in some * sense accelerated, it might be a better idea to disable it * altogether. - */ - BoxRec AvailFBArea; + */ + BoxRec AvailFBArea; - AvailFBArea.x1 = 0; - AvailFBArea.y1 = 0; - AvailFBArea.x2 = pScrn->displayWidth; - AvailFBArea.y2 = pScrn->virtualY + 1; - /* - * Update FBFreeStart also for other memory managers, since + AvailFBArea.x1 = 0; + AvailFBArea.y1 = 0; + AvailFBArea.x2 = pScrn->displayWidth; + AvailFBArea.y2 = pScrn->virtualY + 1; + /* + * Update FBFreeStart also for other memory managers, since * we steal one line to make xf86InitFBManager work. */ pVia->FBFreeStart = (AvailFBArea.y2 + 1) * pVia->Bpl; - xf86InitFBManager(pScreen, &AvailFBArea); + xf86InitFBManager(pScreen, &AvailFBArea); } -#endif miInitializeBackingStore(pScreen); xf86SetBackingStore(pScreen); @@ -2357,51 +2377,51 @@ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- Backing store set up\n")); if(!pVia->shadowFB) /* hardware cursor needs to wrap this layer */ - VIADGAInit(pScreen); + VIADGAInit(pScreen); miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- SW cursor set up\n")); if (pVia->hwcursor) { - if (!VIAHWCursorInit(pScreen)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Hardware cursor initialization failed\n"); - } + if (!VIAHWCursorInit(pScreen)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Hardware cursor initialization failed\n"); + } } if (pVia->shadowFB) { - RefreshAreaFuncPtr refreshArea = VIARefreshArea; + RefreshAreaFuncPtr refreshArea = VIARefreshArea; - if(pVia->rotate) { - if (!pVia->PointerMoved) { - pVia->PointerMoved = pScrn->PointerMoved; - pScrn->PointerMoved = VIAPointerMoved; - } - - switch(pScrn->bitsPerPixel) { - case 8: - refreshArea = VIARefreshArea8; - break; - case 16: - refreshArea = VIARefreshArea16; - break; - case 32: - refreshArea = VIARefreshArea32; - break; - } - } + if(pVia->rotate) { + if (!pVia->PointerMoved) { + pVia->PointerMoved = pScrn->PointerMoved; + pScrn->PointerMoved = VIAPointerMoved; + } + + switch(pScrn->bitsPerPixel) { + case 8: + refreshArea = VIARefreshArea8; + break; + case 16: + refreshArea = VIARefreshArea16; + break; + case 32: + refreshArea = VIARefreshArea32; + break; + } + } - ShadowFBInit(pScreen, refreshArea); + ShadowFBInit(pScreen, refreshArea); } if (!miCreateDefColormap(pScreen)) - return FALSE; + return FALSE; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- Def Color map set up\n")); if (!xf86HandleColormaps(pScreen, 256, 6, VIALoadPalette, NULL, - CMAP_RELOAD_ON_MODE_SWITCH - | CMAP_PALETTED_TRUECOLOR)) - return FALSE; + CMAP_RELOAD_ON_MODE_SWITCH + | CMAP_PALETTED_TRUECOLOR)) + return FALSE; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- Palette loaded\n")); @@ -2423,26 +2443,26 @@ pVia->directRenderingEnabled = VIADRIFinishScreenInit(pScreen); } if (pVia->directRenderingEnabled) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "direct rendering enabled\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "direct rendering enabled\n"); } else { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "direct rendering disabled\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "direct rendering disabled\n"); } if (!pVia->directRenderingEnabled) VIAInitLinear(pScreen); -#else +#else VIAInitLinear(pScreen); #endif - + if (!pVia->IsSecondary) { - /* The chipset is checked in viaInitVideo */ - viaFillGraphicInfo(pScrn); - viaInitVideo(pScreen); + /* The chipset is checked in viaInitVideo */ + viaFillGraphicInfo(pScrn); + viaInitVideo(pScreen); } if (serverGeneration == 1) - xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); + xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- Done\n")); return TRUE; @@ -2465,60 +2485,34 @@ displayWidth = pScrn->displayWidth; if (pVia->rotate) { - height = pScrn->virtualX; - width = pScrn->virtualY; + height = pScrn->virtualX; + width = pScrn->virtualY; } else { - width = pScrn->virtualX; - height = pScrn->virtualY; + width = pScrn->virtualX; + height = pScrn->virtualY; } if (pVia->shadowFB) { - pVia->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width); - pVia->ShadowPtr = xalloc(pVia->ShadowPitch * height); - displayWidth = pVia->ShadowPitch / (pScrn->bitsPerPixel >> 3); - FBStart = pVia->ShadowPtr; + pVia->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width); + pVia->ShadowPtr = xalloc(pVia->ShadowPitch * height); + displayWidth = pVia->ShadowPitch / (pScrn->bitsPerPixel >> 3); + FBStart = pVia->ShadowPtr; } else { - pVia->ShadowPtr = NULL; - FBStart = pVia->FBStart; + pVia->ShadowPtr = NULL; + FBStart = pVia->FBStart; } -#ifdef USE_FB ret = fbScreenInit(pScreen, FBStart, width, height, - pScrn->xDpi, pScrn->yDpi, displayWidth, - pScrn->bitsPerPixel); -#else - switch (pScrn->bitsPerPixel) { - case 8: - ret = cfbScreenInit(pScreen, FBStart, width, height, pScrn->xDpi, - pScrn->yDpi, displayWidth); - break; - - case 16: - ret = cfb16ScreenInit(pScreen, FBStart, width, height, pScrn->xDpi, - pScrn->yDpi, displayWidth); - break; - - case 32: - ret = cfb32ScreenInit(pScreen, FBStart, width, height, pScrn->xDpi, - pScrn->yDpi, displayWidth); - break; - - default: - xf86DrvMsg(scrnIndex, X_ERROR, - "Internal error: invalid bpp (%d) in SavageScreenInit\n", - pScrn->bitsPerPixel); - ret = FALSE; - break; - } -#endif + pScrn->xDpi, pScrn->yDpi, displayWidth, + pScrn->bitsPerPixel); return ret; } static ModeStatus VIAValidMode(int scrnIndex, DisplayModePtr mode, - Bool verbose, int flags) + Bool verbose, int flags) { DEBUG(xf86DrvMsg(scrnIndex, X_INFO, "VIAValidMode\n")); /* TODO check modes */ @@ -2545,19 +2539,19 @@ pBIOSInfo->CrtcHDisplay = pMode->CrtcHDisplay; pBIOSInfo->CrtcVDisplay = pMode->CrtcVDisplay; if (pBIOSInfo->FirstInit) { - pBIOSInfo->SaveframeX1 = pScrn->frameX1; - pBIOSInfo->SaveframeY1 = pScrn->frameY1; - pBIOSInfo->SaveHDisplay = pMode->HDisplay; - pBIOSInfo->SaveVDisplay = pMode->VDisplay; - pBIOSInfo->SaveCrtcHDisplay = pMode->CrtcHDisplay; - pBIOSInfo->SaveCrtcVDisplay = pMode->CrtcVDisplay; + pBIOSInfo->SaveframeX1 = pScrn->frameX1; + pBIOSInfo->SaveframeY1 = pScrn->frameY1; + pBIOSInfo->SaveHDisplay = pMode->HDisplay; + pBIOSInfo->SaveVDisplay = pMode->VDisplay; + pBIOSInfo->SaveCrtcHDisplay = pMode->CrtcHDisplay; + pBIOSInfo->SaveCrtcVDisplay = pMode->CrtcVDisplay; } pBIOSInfo->IsSecondary = pVia->IsSecondary; pBIOSInfo->HasSecondary = pVia->HasSecondary; for (i = 0; i < 0xFF; i++) { - pBIOSInfo->TVRegs[i] = pVia->SavedReg.TVRegs[i]; + pBIOSInfo->TVRegs[i] = pVia->SavedReg.TVRegs[i]; } } @@ -2593,8 +2587,8 @@ hwp->Flags |= VGA_FIX_SYNC_PULSES; if (!vgaHWInit(pScrn, mode)) { - vgaHWBlankScreen(pScrn, TRUE); - return FALSE; + vgaHWBlankScreen(pScrn, TRUE); + return FALSE; } pScrn->vtSema = TRUE; @@ -2602,9 +2596,9 @@ VIABIOSInit(pVia, pScrn, mode); if (!VIAFindModeUseBIOSTable(pBIOSInfo)) { - vgaHWBlankScreen(pScrn, TRUE); - VIAFreeRec(pScrn); - return FALSE; + vgaHWBlankScreen(pScrn, TRUE); + VIAFreeRec(pScrn); + return FALSE; } VIAPostFindMode(pVia, pScrn, mode); @@ -2617,17 +2611,17 @@ /* Coz mode changes, some member in pVia->graphicInfo need to modify */ if (VIA_SERIES(pVia->Chipset) && !pVia->IsSecondary) { - viaFillGraphicInfo(pScrn); + viaFillGraphicInfo(pScrn); - DBG_DD(ErrorF("SWOV: VIAVidSet2DInfo\n")); + DBG_DD(ErrorF("SWOV: VIAVidSet2DInfo\n")); - /* Save MCLK value*/ - VGAOUT8(0x3C4, 0x16); pVia->swov.Save_3C4_16 = VGAIN8(0x3C5); - DBG_DD(ErrorF(" 3c4.16 : %08x \n",VGAIN8(0x3C5))); - VGAOUT8(0x3C4, 0x17); pVia->swov.Save_3C4_17 = VGAIN8(0x3C5); - DBG_DD(ErrorF(" 3c4.17 : %08x \n",VGAIN8(0x3C5))); - VGAOUT8(0x3C4, 0x18); pVia->swov.Save_3C4_18 = VGAIN8(0x3C5); - DBG_DD(ErrorF(" 3c4.18 : %08x \n",VGAIN8(0x3C5))); + /* Save MCLK value*/ + VGAOUT8(0x3C4, 0x16); pVia->swov.Save_3C4_16 = VGAIN8(0x3C5); + DBG_DD(ErrorF(" 3c4.16 : %08x \n",VGAIN8(0x3C5))); + VGAOUT8(0x3C4, 0x17); pVia->swov.Save_3C4_17 = VGAIN8(0x3C5); + DBG_DD(ErrorF(" 3c4.17 : %08x \n",VGAIN8(0x3C5))); + VGAOUT8(0x3C4, 0x18); pVia->swov.Save_3C4_18 = VGAIN8(0x3C5); + DBG_DD(ErrorF(" 3c4.18 : %08x \n",VGAIN8(0x3C5))); } VIAAdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); return TRUE; @@ -2648,25 +2642,25 @@ /* Is the display currently visible ? */ if(pScrn->vtSema) { - /* Wait Hardware Engine idle to exit graphical mode */ - WaitIdle(); - + /* Wait Hardware Engine idle to exit graphical mode */ + WaitIdle(); + /* Patch for normal log out and restart X, 3D application will hang */ VIAWriteMode(pScrn, vgaSavePtr, viaSavePtr); if (!pVia->IsSecondary) { - /* Turn off all video activities */ - viaExitVideo(pScrn); - /* Diable Hardware Cursor */ - dwCursorMode = VIAGETREG(VIA_REG_CURSOR_MODE); - VIASETREG(VIA_REG_CURSOR_MODE, dwCursorMode & 0xFFFFFFFE); - } - - if (pVia->VQEnable) { - /* if we use VQ, disable it before we exit */ - VIASETREG(0x43c, 0x00fe0000); - VIASETREG(0x440, 0x00000004); - } + /* Turn off all video activities */ + viaExitVideo(pScrn); + /* Diable Hardware Cursor */ + dwCursorMode = VIAGETREG(VIA_REG_CURSOR_MODE); + VIASETREG(VIA_REG_CURSOR_MODE, dwCursorMode & 0xFFFFFFFE); + } + + if (pVia->VQEnable) { + /* if we use VQ, disable it before we exit */ + VIASETREG(0x43c, 0x00fe0000); + VIASETREG(0x440, 0x00000004); + } } #ifdef XF86DRI if (pVia->directRenderingEnabled) { @@ -2674,30 +2668,30 @@ } #endif if (pVia->AccelInfoRec) { - XAADestroyInfoRec(pVia->AccelInfoRec); - pVia->AccelInfoRec = NULL; + XAADestroyInfoRec(pVia->AccelInfoRec); + pVia->AccelInfoRec = NULL; } if (pVia->CursorInfoRec) { - xf86DestroyCursorInfoRec(pVia->CursorInfoRec); - pVia->CursorInfoRec = NULL; + xf86DestroyCursorInfoRec(pVia->CursorInfoRec); + pVia->CursorInfoRec = NULL; } if (pVia->ShadowPtr) { - xfree(pVia->ShadowPtr); - pVia->ShadowPtr = NULL; + xfree(pVia->ShadowPtr); + pVia->ShadowPtr = NULL; } if (pVia->DGAModes) { - xfree(pVia->DGAModes); - pVia->DGAModes = NULL; + xfree(pVia->DGAModes); + pVia->DGAModes = NULL; } if(pVia->pInt10) { - xf86FreeInt10(pVia->pInt10); - pVia->pInt10 = NULL; + xf86FreeInt10(pVia->pInt10); + pVia->pInt10 = NULL; } if (pScrn->vtSema) { - VIAWriteMode(pScrn, vgaSavePtr, viaSavePtr); - vgaHWLock(hwp); - VIAUnmapMem(pScrn); + VIAWriteMode(pScrn, vgaSavePtr, viaSavePtr); + vgaHWLock(hwp); + VIAUnmapMem(pScrn); } pScrn->vtSema = FALSE; pScreen->CloseScreen = pVia->CloseScreen; @@ -2743,21 +2737,21 @@ /* now program the start address registers */ if (pVia->IsSecondary) { - Base = (Base + pScrn->fbOffset) >> 3; - VGAOUT8(vgaCRIndex, 0x62); - tmp = VGAIN8(vgaCRReg) & 0x01; - tmp |= (Base & 0x7F) << 1; - VGAOUT8(vgaCRReg, tmp); - VGAOUT8(vgaCRIndex, 0x63); - VGAOUT8(vgaCRReg, ((Base & 0x7F80) >> 7)); - VGAOUT8(vgaCRIndex, 0x64); - VGAOUT8(vgaCRReg, ((Base & 0x7F8000) >> 15)); + Base = (Base + pScrn->fbOffset) >> 3; + VGAOUT8(vgaCRIndex, 0x62); + tmp = VGAIN8(vgaCRReg) & 0x01; + tmp |= (Base & 0x7F) << 1; + VGAOUT8(vgaCRReg, tmp); + VGAOUT8(vgaCRIndex, 0x63); + VGAOUT8(vgaCRReg, ((Base & 0x7F80) >> 7)); + VGAOUT8(vgaCRIndex, 0x64); + VGAOUT8(vgaCRReg, ((Base & 0x7F8000) >> 15)); } else { - Base = Base >> 1; - VGAOUT16(vgaCRIndex, (Base & 0x00ff00) | 0x0c); - VGAOUT16(vgaCRIndex, ((Base & 0x00ff) << 8) | 0x0d); - VGAOUT16(vgaCRIndex, ((Base & 0xff0000) >> 8) | 0x34); + Base = Base >> 1; + VGAOUT16(vgaCRIndex, (Base & 0x00ff00) | 0x0c); + VGAOUT16(vgaCRIndex, ((Base & 0x00ff) << 8) | 0x0d); + VGAOUT16(vgaCRIndex, ((Base & 0xff0000) >> 8) | 0x34); } /* Pass Panning (x, y) info to V4L */ @@ -2769,39 +2763,39 @@ /* Check if HW mpeg engine active */ if (pVia->Video.VideoStatus & SW_VIDEO_ON) /* SW video case */ { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - " Call SW MPEG UpdateOverlay at panning mode.\n"); + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + " Call SW MPEG UpdateOverlay at panning mode.\n"); - ddLock.dwFourCC = FOURCC_YUY2; + ddLock.dwFourCC = FOURCC_YUY2; - VIAVidLockSurface(pScrn, &ddLock); + VIAVidLockSurface(pScrn, &ddLock); - UpdateOverlay.dwFlags = DDOVER_SHOW | DDOVER_KEYDEST; - UpdateOverlay.dwColorSpaceLowValue = VIAGETREG(0x220); - UpdateOverlay.rSrc.left = 0; - UpdateOverlay.rSrc.top = 0; - UpdateOverlay.rSrc.right = 720; - UpdateOverlay.rSrc.bottom = 480; - - UpdateOverlay.rDest.left = (int) lpddLock->SWDevice.gdwSWDstLeft; - UpdateOverlay.rDest.top = (int) lpddLock->SWDevice.gdwSWDstTop; - UpdateOverlay.rDest.right = UpdateOverlay.rDest.left + lpddLock->SWDevice.gdwSWDstWidth; - UpdateOverlay.rDest.bottom = UpdateOverlay.rDest.top + lpddLock->SWDevice.gdwSWDstHeight; + UpdateOverlay.dwFlags = DDOVER_SHOW | DDOVER_KEYDEST; + UpdateOverlay.dwColorSpaceLowValue = VIAGETREG(0x220); + UpdateOverlay.rSrc.left = 0; + UpdateOverlay.rSrc.top = 0; + UpdateOverlay.rSrc.right = 720; + UpdateOverlay.rSrc.bottom = 480; + + UpdateOverlay.rDest.left = (int) lpddLock->SWDevice.gdwSWDstLeft; + UpdateOverlay.rDest.top = (int) lpddLock->SWDevice.gdwSWDstTop; + UpdateOverlay.rDest.right = UpdateOverlay.rDest.left + lpddLock->SWDevice.gdwSWDstWidth; + UpdateOverlay.rDest.bottom = UpdateOverlay.rDest.top + lpddLock->SWDevice.gdwSWDstHeight; - VIAVidUpdateOverlay(pScrn, &UpdateOverlay); + VIAVidUpdateOverlay(pScrn, &UpdateOverlay); } else if (VIAGETREG(0x310) & 0x1) /* capture 0 (TV0) case */ { - ddLock.dwFourCC = FOURCC_TV0; + ddLock.dwFourCC = FOURCC_TV0; - VIAVidLockSurface(pScrn, &ddLock); + VIAVidLockSurface(pScrn, &ddLock); } if (VIAGETREG(0x354) & 0x1) /* capture 1 (TV1) case */ { - ddLock.dwFourCC = FOURCC_TV1; + ddLock.dwFourCC = FOURCC_TV1; - VIAVidLockSurface(pScrn, &ddLock); + VIAVidLockSurface(pScrn, &ddLock); } return; @@ -2818,9 +2812,9 @@ WaitIdle(); if (pVia->VQEnable) { - /* if we use VQ, disable it before we exit */ - VIASETREG(0x43c, 0x00fe0000); - VIASETREG(0x440, 0x00000004); + /* if we use VQ, disable it before we exit */ + VIASETREG(0x43c, 0x00fe0000); + VIASETREG(0x440, 0x00000004); } return VIAModeInit(xf86Screens[scrnIndex], mode); @@ -2834,14 +2828,14 @@ unsigned char val; if (xf86IsPrimaryPci(pVia->PciInfo)) { - /* If we are primary card, we still use std vga port. If we use - * MMIO, system will hang in vgaHWSave when our card used in - * PLE and KLE (integrated Trident MVP4) - */ - vgaHWSetStdFuncs(hwp); + /* If we are primary card, we still use std vga port. If we use + * MMIO, system will hang in vgaHWSave when our card used in + * PLE and KLE (integrated Trident MVP4) + */ + vgaHWSetStdFuncs(hwp); } else { - vgaHWSetMmioFuncs(hwp, pVia->MapBase, 0x8000); + vgaHWSetMmioFuncs(hwp, pVia->MapBase, 0x8000); } val = VGAIN8(0x3c3); @@ -2885,7 +2879,7 @@ void VIALoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies, - LOCO *colors, VisualPtr pVisual) + LOCO *colors, VisualPtr pVisual) { VIAPtr pVia = VIAPTR(pScrn); int i, index; @@ -2894,7 +2888,7 @@ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIALoadPalette\n")); if (pScrn->bitsPerPixel != 8) - return; + return; VGAOUT8(0x3C4, 0x1A); sr1a = VGAIN8(0x3C5); VGAOUT8(0x3C4, 0x1B); @@ -2905,43 +2899,43 @@ cr6a = VGAIN8(0x3D5); if (pVia->IsSecondary) { - VGAOUT8(0x3C4, 0x1A); - VGAOUT8(0x3C5, sr1a | 0x01); - VGAOUT8(0x3C4, 0x1B); - VGAOUT8(0x3C5, sr1b | 0x80); - VGAOUT8(0x3D4, 0x67); - VGAOUT8(0x3D5, cr67 & 0x3F); - VGAOUT8(0x3D4, 0x6A); - VGAOUT8(0x3D5, cr6a | 0xC0); + VGAOUT8(0x3C4, 0x1A); + VGAOUT8(0x3C5, sr1a | 0x01); + VGAOUT8(0x3C4, 0x1B); + VGAOUT8(0x3C5, sr1b | 0x80); + VGAOUT8(0x3D4, 0x67); + VGAOUT8(0x3D5, cr67 & 0x3F); + VGAOUT8(0x3D4, 0x6A); + VGAOUT8(0x3D5, cr6a | 0xC0); } for (i = 0; i < numColors; i++) { - index = indicies[i]; - VGAOUT8(0x3c8, index); - VGAOUT8(0x3c9, colors[index].red); - VGAOUT8(0x3c9, colors[index].green); - VGAOUT8(0x3c9, colors[index].blue); + index = indicies[i]; + VGAOUT8(0x3c8, index); + VGAOUT8(0x3c9, colors[index].red); + VGAOUT8(0x3c9, colors[index].green); + VGAOUT8(0x3c9, colors[index].blue); } if (pVia->IsSecondary) { - VGAOUT8(0x3C4, 0x1A); - VGAOUT8(0x3C5, sr1a); - VGAOUT8(0x3C4, 0x1B); - VGAOUT8(0x3C5, sr1b); - VGAOUT8(0x3D4, 0x67); - VGAOUT8(0x3D5, cr67); - VGAOUT8(0x3D4, 0x6A); - VGAOUT8(0x3D5, cr6a); - - /* Screen 0 palette was changed by mode setting of Screen 1, - * so load again */ - for (i = 0; i < numColors; i++) { - index = indicies[i]; - VGAOUT8(0x3c8, index); - VGAOUT8(0x3c9, colors[index].red); - VGAOUT8(0x3c9, colors[index].green); - VGAOUT8(0x3c9, colors[index].blue); - } + VGAOUT8(0x3C4, 0x1A); + VGAOUT8(0x3C5, sr1a); + VGAOUT8(0x3C4, 0x1B); + VGAOUT8(0x3C5, sr1b); + VGAOUT8(0x3D4, 0x67); + VGAOUT8(0x3D5, cr67); + VGAOUT8(0x3D4, 0x6A); + VGAOUT8(0x3D5, cr6a); + + /* Screen 0 palette was changed by mode setting of Screen 1, + * so load again */ + for (i = 0; i < numColors; i++) { + index = indicies[i]; + VGAOUT8(0x3c8, index); + VGAOUT8(0x3c9, colors[index].red); + VGAOUT8(0x3c9, colors[index].green); + VGAOUT8(0x3c9, colors[index].blue); + } } @@ -2968,129 +2962,129 @@ val &= 0xCF; /* Turn Off CRT, if user doesn't want crt on */ if (!pVia->IsSecondary && !(pBIOSInfo->ActiveDevice & VIA_DEVICE_CRT1)) { - val |= 0x30; + val |= 0x30; } switch (mode) { case DPMSModeOn: - if (pBIOSInfo->ActiveDevice & (VIA_DEVICE_DFP | VIA_DEVICE_LCD)) { - /* Enable LCD */ - VIAEnableLCD(pBIOSInfo); - } - - if (pBIOSInfo->ActiveDevice & VIA_DEVICE_TV) { - dev = xf86CreateI2CDevRec(); - dev->DevName = "TV"; - dev->SlaveAddr = pBIOSInfo->TVI2CAdd; - dev->pI2CBus = pBIOSInfo->I2C_Port2; - if (xf86I2CDevInit(dev)) { - switch (pBIOSInfo->TVEncoder) { - case VIA_TV2PLUS: - case VIA_TV3: - case VIA_VT1622A: - W_Buffer[0] = 0x0E; - W_Buffer[1] = 0x0; - xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); - break; - case VIA_VT1623: - VIAGPIOI2C_Initial(pBIOSInfo, 0x40); - VIAGPIOI2C_Write(pBIOSInfo, 0x0E, 0); - break; - case VIA_CH7019: - W_Buffer[0] = 0x49; - W_Buffer[1] = 0x20; - xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); - /*W_Buffer[0] = 0x1E; - W_Buffer[1] = 0xD0; - xf86I2CWriteRead(dev, W_Buffer,2, NULL,0);*/ - break; - case VIA_SAA7108: - W_Buffer[0] = 0x2D; - switch (pBIOSInfo->TVOutput) { - case TVOUTPUT_COMPOSITE: - case TVOUTPUT_SVIDEO: - W_Buffer[1] = 0xB4; - break; - case TVOUTPUT_RGB: - W_Buffer[1] = 0; - break; - case TVOUTPUT_YCBCR: - W_Buffer[1] = 0x84; - break; - default: - W_Buffer[1] = 0x08; - break; - } - xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); - break; - default: - break; - } - xf86DestroyI2CDevRec(dev,TRUE); - } - else - xf86DestroyI2CDevRec(dev,TRUE); - } - VGAOUT8(vgaCRIndex, 0x36); - VGAOUT8(vgaCRReg, val); - break; + if (pBIOSInfo->ActiveDevice & (VIA_DEVICE_DFP | VIA_DEVICE_LCD)) { + /* Enable LCD */ + VIAEnableLCD(pBIOSInfo); + } + + if (pBIOSInfo->ActiveDevice & VIA_DEVICE_TV) { + dev = xf86CreateI2CDevRec(); + dev->DevName = "TV"; + dev->SlaveAddr = pBIOSInfo->TVI2CAdd; + dev->pI2CBus = pBIOSInfo->I2C_Port2; + if (xf86I2CDevInit(dev)) { + switch (pBIOSInfo->TVEncoder) { + case VIA_TV2PLUS: + case VIA_TV3: + case VIA_VT1622A: + W_Buffer[0] = 0x0E; + W_Buffer[1] = 0x0; + xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); + break; + case VIA_VT1623: + VIAGPIOI2C_Initial(pBIOSInfo, 0x40); + VIAGPIOI2C_Write(pBIOSInfo, 0x0E, 0); + break; + case VIA_CH7019: + W_Buffer[0] = 0x49; + W_Buffer[1] = 0x20; + xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); + /*W_Buffer[0] = 0x1E; + W_Buffer[1] = 0xD0; + xf86I2CWriteRead(dev, W_Buffer,2, NULL,0);*/ + break; + case VIA_SAA7108: + W_Buffer[0] = 0x2D; + switch (pBIOSInfo->TVOutput) { + case TVOUTPUT_COMPOSITE: + case TVOUTPUT_SVIDEO: + W_Buffer[1] = 0xB4; + break; + case TVOUTPUT_RGB: + W_Buffer[1] = 0; + break; + case TVOUTPUT_YCBCR: + W_Buffer[1] = 0x84; + break; + default: + W_Buffer[1] = 0x08; + break; + } + xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); + break; + default: + break; + } + xf86DestroyI2CDevRec(dev,TRUE); + } + else + xf86DestroyI2CDevRec(dev,TRUE); + } + VGAOUT8(vgaCRIndex, 0x36); + VGAOUT8(vgaCRReg, val); + break; case DPMSModeStandby: case DPMSModeSuspend: case DPMSModeOff: - if (pBIOSInfo->ActiveDevice & (VIA_DEVICE_DFP | VIA_DEVICE_LCD)) { - VIADisableLCD(pBIOSInfo); - } - if (pBIOSInfo->ActiveDevice & VIA_DEVICE_TV) { - dev = xf86CreateI2CDevRec(); - dev->DevName = "TV"; - dev->SlaveAddr = pBIOSInfo->TVI2CAdd; - dev->pI2CBus = pBIOSInfo->I2C_Port2; - if (xf86I2CDevInit(dev)) { - switch (pBIOSInfo->TVEncoder) { - case VIA_TV2PLUS: - W_Buffer[0] = 0x0E; - W_Buffer[1] = 0x03; - xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); - break; - case VIA_TV3: - case VIA_VT1622A: - W_Buffer[0] = 0x0E; - W_Buffer[1] = 0x0F; - xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); - break; - case VIA_VT1623: - VIAGPIOI2C_Initial(pBIOSInfo, 0x40); - VIAGPIOI2C_Write(pBIOSInfo, 0x0E, 0x0F); - break; - case VIA_CH7019: - W_Buffer[0] = 0x49; - W_Buffer[1] = 0x3E; - xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); - W_Buffer[0] = 0x1E; - W_Buffer[1] = 0xD0; - xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); - break; - case VIA_SAA7108: - W_Buffer[0] = 0x2D; - W_Buffer[1] = 0x08; - xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); - break; - default: - break; - } - xf86DestroyI2CDevRec(dev,TRUE); - } - else - xf86DestroyI2CDevRec(dev,TRUE); - } - - val |= 0x30; - VGAOUT8(vgaCRIndex, 0x36); - VGAOUT8(vgaCRReg, val); - break; + if (pBIOSInfo->ActiveDevice & (VIA_DEVICE_DFP | VIA_DEVICE_LCD)) { + VIADisableLCD(pBIOSInfo); + } + if (pBIOSInfo->ActiveDevice & VIA_DEVICE_TV) { + dev = xf86CreateI2CDevRec(); + dev->DevName = "TV"; + dev->SlaveAddr = pBIOSInfo->TVI2CAdd; + dev->pI2CBus = pBIOSInfo->I2C_Port2; + if (xf86I2CDevInit(dev)) { + switch (pBIOSInfo->TVEncoder) { + case VIA_TV2PLUS: + W_Buffer[0] = 0x0E; + W_Buffer[1] = 0x03; + xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); + break; + case VIA_TV3: + case VIA_VT1622A: + W_Buffer[0] = 0x0E; + W_Buffer[1] = 0x0F; + xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); + break; + case VIA_VT1623: + VIAGPIOI2C_Initial(pBIOSInfo, 0x40); + VIAGPIOI2C_Write(pBIOSInfo, 0x0E, 0x0F); + break; + case VIA_CH7019: + W_Buffer[0] = 0x49; + W_Buffer[1] = 0x3E; + xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); + W_Buffer[0] = 0x1E; + W_Buffer[1] = 0xD0; + xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); + break; + case VIA_SAA7108: + W_Buffer[0] = 0x2D; + W_Buffer[1] = 0x08; + xf86I2CWriteRead(dev, W_Buffer,2, NULL,0); + break; + default: + break; + } + xf86DestroyI2CDevRec(dev,TRUE); + } + else + xf86DestroyI2CDevRec(dev,TRUE); + } + + val |= 0x30; + VGAOUT8(vgaCRIndex, 0x36); + VGAOUT8(vgaCRReg, val); + break; default: - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid DPMS mode %d\n", mode); - break; + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid DPMS mode %d\n", mode); + break; } return; } @@ -3109,30 +3103,30 @@ pBIOSInfo->DefaultActiveDevice = VIABIOS_GetActiveDevice(pScrn); /* if XF86Config Option "ActiveDevice" hasn't set, active device according CMOS */ if (!pBIOSInfo->ActiveDevice) { - pBIOSInfo->ActiveDevice = pBIOSInfo->DefaultActiveDevice; + pBIOSInfo->ActiveDevice = pBIOSInfo->DefaultActiveDevice; } /* if XF86Config-4 set SAMM, and only active one device, active device according CMOS */ else if (pVia->IsSecondary && (pBIOSInfo->ActiveDevice == VIA_DEVICE_CRT1 || - pBIOSInfo->ActiveDevice == VIA_DEVICE_LCD || - pBIOSInfo->ActiveDevice == VIA_DEVICE_TV || - pBIOSInfo->ActiveDevice == VIA_DEVICE_DFP || - pBIOSInfo->ActiveDevice == VIA_DEVICE_CRT2)){ - pBIOSInfo->ActiveDevice = VIABIOS_GetActiveDevice(pScrn); + pBIOSInfo->ActiveDevice == VIA_DEVICE_LCD || + pBIOSInfo->ActiveDevice == VIA_DEVICE_TV || + pBIOSInfo->ActiveDevice == VIA_DEVICE_DFP || + pBIOSInfo->ActiveDevice == VIA_DEVICE_CRT2)){ + pBIOSInfo->ActiveDevice = VIABIOS_GetActiveDevice(pScrn); } if (((pBIOSInfo->ActiveDevice & pBIOSInfo->ConnectedDevice) == pBIOSInfo->ActiveDevice) - && (pVia->IsSecondary)) { - pBIOSInfo->SAMM = TRUE; + && (pVia->IsSecondary)) { + pBIOSInfo->SAMM = TRUE; } pBIOSInfo->ActiveDevice &= pBIOSInfo->ConnectedDevice; pVia->ActiveDevice = pBIOSInfo->ActiveDevice; /*if (pBIOSInfo->ActiveDevice & VIA_DEVICE_LCD) { - pBIOSInfo->DVIEncoder = VIA_VT3191; - numDevice = 0x02; - i = VIABIOS_GetDisplayDeviceInfo(pScrn, &numDevice); - if (i != 0xFFFF) { - if (pBIOSInfo->PanelSize == VIA_PANEL_INVALID) - pBIOSInfo->PanelSize = numDevice; + pBIOSInfo->DVIEncoder = VIA_VT3191; + numDevice = 0x02; + i = VIABIOS_GetDisplayDeviceInfo(pScrn, &numDevice); + if (i != 0xFFFF) { + if (pBIOSInfo->PanelSize == VIA_PANEL_INVALID) + pBIOSInfo->PanelSize = numDevice; }*/ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Connected Device is %d\n", pBIOSInfo->ConnectedDevice)); @@ -3152,32 +3146,32 @@ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VIADeviceDispatch\n")); pBIOSInfo0->SAMM = TRUE; switch (pBIOSInfo1->ActiveDevice) { - case (VIA_DEVICE_CRT1 | VIA_DEVICE_LCD) : /* If CRT + LCD, CRT is IGA1 */ - pBIOSInfo0->ActiveDevice = VIA_DEVICE_CRT1; - pBIOSInfo1->ActiveDevice = VIA_DEVICE_LCD; - break; - case (VIA_DEVICE_CRT1 | VIA_DEVICE_TV) : /* If CRT + TV, CRT is IGA1 */ - pBIOSInfo0->ActiveDevice = VIA_DEVICE_CRT1; - pBIOSInfo1->ActiveDevice = VIA_DEVICE_TV; - break; - case (VIA_DEVICE_CRT1 | VIA_DEVICE_DFP) : /* If CRT + DFP, CRT is IGA1 */ - pBIOSInfo0->ActiveDevice = VIA_DEVICE_CRT1; - pBIOSInfo1->ActiveDevice = VIA_DEVICE_DFP; - break; - case (VIA_DEVICE_LCD | VIA_DEVICE_TV) : /* If LCD + TV, TV is IGA1 */ - pBIOSInfo0->ActiveDevice = VIA_DEVICE_TV; - pBIOSInfo1->ActiveDevice = VIA_DEVICE_LCD; - break; - case (VIA_DEVICE_LCD | VIA_DEVICE_DFP) : /* If LCD + DFP, DFP is IGA1 */ - pBIOSInfo0->ActiveDevice = VIA_DEVICE_DFP; - pBIOSInfo1->ActiveDevice = VIA_DEVICE_LCD; - break; - case (VIA_DEVICE_TV | VIA_DEVICE_DFP) : /* If TV + DFP, TV is IGA1 */ - pBIOSInfo0->ActiveDevice = VIA_DEVICE_TV; - pBIOSInfo1->ActiveDevice = VIA_DEVICE_DFP; - break; - default : - return FALSE; + case (VIA_DEVICE_CRT1 | VIA_DEVICE_LCD) : /* If CRT + LCD, CRT is IGA1 */ + pBIOSInfo0->ActiveDevice = VIA_DEVICE_CRT1; + pBIOSInfo1->ActiveDevice = VIA_DEVICE_LCD; + break; + case (VIA_DEVICE_CRT1 | VIA_DEVICE_TV) : /* If CRT + TV, CRT is IGA1 */ + pBIOSInfo0->ActiveDevice = VIA_DEVICE_CRT1; + pBIOSInfo1->ActiveDevice = VIA_DEVICE_TV; + break; + case (VIA_DEVICE_CRT1 | VIA_DEVICE_DFP) : /* If CRT + DFP, CRT is IGA1 */ + pBIOSInfo0->ActiveDevice = VIA_DEVICE_CRT1; + pBIOSInfo1->ActiveDevice = VIA_DEVICE_DFP; + break; + case (VIA_DEVICE_LCD | VIA_DEVICE_TV) : /* If LCD + TV, TV is IGA1 */ + pBIOSInfo0->ActiveDevice = VIA_DEVICE_TV; + pBIOSInfo1->ActiveDevice = VIA_DEVICE_LCD; + break; + case (VIA_DEVICE_LCD | VIA_DEVICE_DFP) : /* If LCD + DFP, DFP is IGA1 */ + pBIOSInfo0->ActiveDevice = VIA_DEVICE_DFP; + pBIOSInfo1->ActiveDevice = VIA_DEVICE_LCD; + break; + case (VIA_DEVICE_TV | VIA_DEVICE_DFP) : /* If TV + DFP, TV is IGA1 */ + pBIOSInfo0->ActiveDevice = VIA_DEVICE_TV; + pBIOSInfo1->ActiveDevice = VIA_DEVICE_DFP; + break; + default : + return FALSE; } DEBUG(xf86DrvMsg(pVIAEnt->pPrimaryScrn->scrnIndex, X_INFO, "Active Device is %d\n", pBIOSInfo0->ActiveDevice)); DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Active Device is %d\n", pBIOSInfo1->ActiveDevice)); @@ -3194,71 +3188,71 @@ if (!pVia->sharedData->b3DRegsInitialized) { - VIASETREG(0x43C, 0x00010000); + VIASETREG(0x43C, 0x00010000); + + for (i = 0; i <= 0x7D; i++) + { + VIASETREG(0x440, (CARD32) i << 24); + } + + VIASETREG(0x43C, 0x00020000); + + for (i = 0; i <= 0x94; i++) + { + VIASETREG(0x440, (CARD32) i << 24); + } + + VIASETREG(0x440, 0x82400000); + + VIASETREG(0x43C, 0x01020000); + + + for (i = 0; i <= 0x94; i++) + { + VIASETREG(0x440, (CARD32) i << 24); + } - for (i = 0; i <= 0x7D; i++) - { - VIASETREG(0x440, (CARD32) i << 24); - } - - VIASETREG(0x43C, 0x00020000); - - for (i = 0; i <= 0x94; i++) - { - VIASETREG(0x440, (CARD32) i << 24); - } - - VIASETREG(0x440, 0x82400000); - - VIASETREG(0x43C, 0x01020000); - - - for (i = 0; i <= 0x94; i++) - { - VIASETREG(0x440, (CARD32) i << 24); - } - - VIASETREG(0x440, 0x82400000); - VIASETREG(0x43C, 0xfe020000); - - for (i = 0; i <= 0x03; i++) - { - VIASETREG(0x440, (CARD32) i << 24); - } - - VIASETREG(0x43C, 0x00030000); - - for (i = 0; i <= 0xff; i++) - { - VIASETREG(0x440, 0); - } - VIASETREG(0x43C, 0x00100000); - VIASETREG(0x440, 0x00333004); - VIASETREG(0x440, 0x10000002); - VIASETREG(0x440, 0x60000000); - VIASETREG(0x440, 0x61000000); - VIASETREG(0x440, 0x62000000); - VIASETREG(0x440, 0x63000000); - VIASETREG(0x440, 0x64000000); - - VIASETREG(0x43C, 0x00fe0000); - - if (pVia->ChipRev >= 3 ) - VIASETREG(0x440,0x40008c0f); - else - VIASETREG(0x440,0x4000800f); - - VIASETREG(0x440,0x44000000); - VIASETREG(0x440,0x45080C04); - VIASETREG(0x440,0x46800408); - VIASETREG(0x440,0x50000000); - VIASETREG(0x440,0x51000000); - VIASETREG(0x440,0x52000000); - VIASETREG(0x440,0x53000000); - - pVia->sharedData->b3DRegsInitialized = 1; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "3D Engine has been initialized.\n"); + VIASETREG(0x440, 0x82400000); + VIASETREG(0x43C, 0xfe020000); + + for (i = 0; i <= 0x03; i++) + { + VIASETREG(0x440, (CARD32) i << 24); + } + + VIASETREG(0x43C, 0x00030000); + + for (i = 0; i <= 0xff; i++) + { + VIASETREG(0x440, 0); + } + VIASETREG(0x43C, 0x00100000); + VIASETREG(0x440, 0x00333004); + VIASETREG(0x440, 0x10000002); + VIASETREG(0x440, 0x60000000); + VIASETREG(0x440, 0x61000000); + VIASETREG(0x440, 0x62000000); + VIASETREG(0x440, 0x63000000); + VIASETREG(0x440, 0x64000000); + + VIASETREG(0x43C, 0x00fe0000); + + if (pVia->ChipRev >= 3 ) + VIASETREG(0x440,0x40008c0f); + else + VIASETREG(0x440,0x4000800f); + + VIASETREG(0x440,0x44000000); + VIASETREG(0x440,0x45080C04); + VIASETREG(0x440,0x46800408); + VIASETREG(0x440,0x50000000); + VIASETREG(0x440,0x51000000); + VIASETREG(0x440,0x52000000); + VIASETREG(0x440,0x53000000); + + pVia->sharedData->b3DRegsInitialized = 1; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "3D Engine has been initialized.\n"); } VIASETREG(0x43C,0x00fe0000); Index: xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h diff -u xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h:1.16 xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h:1.19 --- xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h:1.16 Fri Dec 10 11:07:03 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h Sun Aug 28 13:48:03 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h,v 1.16 2004/12/10 16:07:03 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h,v 1.19 2005/08/28 17:48:03 tsi Exp $ */ /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. @@ -45,14 +45,7 @@ #include "mipointer.h" #include "micmap.h" -#define USE_FB -#ifdef USE_FB #include "fb.h" -#else -#include "cfb.h" -#include "cfb16.h" -#include "cfb32.h" -#endif #include "xf86cmap.h" #include "vbe.h" @@ -73,18 +66,12 @@ #endif #define DRIVER_NAME "via" -#define DRIVER_VERSION "4.1.0" +#define DRIVER_VERSION "4.1.31" #define VERSION_MAJOR 4 #define VERSION_MINOR 1 -#define PATCHLEVEL 30 +#define PATCHLEVEL 31 #define VIA_VERSION ((VERSION_MAJOR<<24) | (VERSION_MINOR<<16) | PATCHLEVEL) -#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,14,0) -#undef XFREE86_44 -#else -#define XFREE86_44 1 -#endif - #define VGAIN8(addr) MMIO_IN8(pVia->MapBase+0x8000, addr) #define VGAIN16(addr) MMIO_IN16(pVia->MapBase+0x8000, addr) #define VGAIN(addr) MMIO_IN32(pVia->MapBase+0x8000, addr) @@ -101,11 +88,8 @@ #define VIA_MAX_ACCEL_X (2047) #define VIA_MAX_ACCEL_Y (2047) -#ifdef XFREE86_44 -#define VIA_PIXMAP_CACHE_SIZE (4 * (VIA_MAX_ACCEL_X + 1) * (VIA_MAX_ACCEL_Y +1)) -#else -#define VIA_PIXMAP_CACHE_SIZE (256 * 1024) -#endif /* XFREE86_44 */ +#define VIA_PIXMAP_CACHE_SIZE \ + (4 * (VIA_MAX_ACCEL_X + 1) * (VIA_MAX_ACCEL_Y +1)) #define VIA_CURSOR_SIZE (4 * 1024) #define VIA_VQ_SIZE (256 * 1024) @@ -205,9 +189,9 @@ #define SAA7108H 0 #define SAA7113H 1 #define SAA7114H 2 - I2CDevPtr I2C; /* Decoder I2C */ - I2CDevPtr FMI2C; /* FM Tuner I2C */ - + I2CDevPtr I2C; /* Decoder I2C */ + I2CDevPtr FMI2C; /* FM Tuner I2C */ + /* Not yet used */ int autoDetect; /* Autodetect mode */ int tunerMode; /* Fixed mode */ @@ -248,7 +232,7 @@ unsigned char* MapBaseDense; unsigned char* FBBase; unsigned char* FBStart; - + /* Private memory pool management */ int SWOVUsed[MEM_BLOCKS]; /* Free map for SWOV pool */ unsigned long SWOVPool; /* Base of SWOV pool */ @@ -329,18 +313,18 @@ #ifdef XF86DRI Bool directRenderingEnabled; DRIInfoPtr pDRIInfo; - int drmFD; - int numVisualConfigs; - __GLXvisualConfig* pVisualConfigs; - VIAConfigPrivPtr pVisualConfigsPriv; - unsigned long agpHandle; - unsigned long registerHandle; - unsigned long agpAddr; + int drmFD; + int numVisualConfigs; + __GLXvisualConfig* pVisualConfigs; + VIAConfigPrivPtr pVisualConfigsPriv; + unsigned long agpHandle; + unsigned long registerHandle; + unsigned long agpAddr; drmAddress agpMappedAddr; - unsigned char *agpBase; - unsigned int agpSize; - Bool IsPCI; - Bool drixinerama; + unsigned char *agpBase; + unsigned int agpSize; + Bool IsPCI; + Bool drixinerama; #endif Bool DRIIrqEnable; @@ -361,15 +345,15 @@ pointer VidReg; unsigned long gdwVidRegCounter; unsigned long old_dwUseExtendedFIFO; - + /* Overlay TV Tuners */ ViaTunerPtr Tuner[2]; I2CDevPtr CXA2104S; int AudioMode; int AudioMute; - + /* Global 2D state block - needs to slowly die */ - ViaGraphicRec graphicInfo; + ViaGraphicRec graphicInfo; ViaSharedPtr sharedData; } VIARec, *VIAPtr; @@ -457,11 +441,11 @@ /* in via_overlay.c */ unsigned long viaOverlayHQVCalcZoomHeight (VIAPtr pVia, unsigned long srcHeight,unsigned long dstHeight, - unsigned long * lpzoomCtl, unsigned long * lpminiCtl, unsigned long * lpHQVfilterCtl, unsigned long * lpHQVminiCtl,unsigned long * lpHQVzoomflag); + unsigned long * lpzoomCtl, unsigned long * lpminiCtl, unsigned long * lpHQVfilterCtl, unsigned long * lpHQVminiCtl,unsigned long * lpHQVzoomflag); unsigned long viaOverlayGetSrcStartAddress (VIAPtr pVia, unsigned long dwVideoFlag,RECTL rSrc,RECTL rDest, unsigned long dwSrcPitch,LPDDPIXELFORMAT lpDPF,unsigned long * lpHQVoffset ); void viaOverlayGetDisplayCount(VIAPtr pVIa, unsigned long dwVideoFlag,LPDDPIXELFORMAT lpDPF,unsigned long dwSrcWidth,unsigned long * lpDisplayCountW); unsigned long viaOverlayHQVCalcZoomWidth(VIAPtr pVia, unsigned long dwVideoFlag, unsigned long srcWidth , unsigned long dstWidth, - unsigned long * lpzoomCtl, unsigned long * lpminiCtl, unsigned long * lpHQVfilterCtl, unsigned long * lpHQVminiCtl,unsigned long * lpHQVzoomflag); + unsigned long * lpzoomCtl, unsigned long * lpminiCtl, unsigned long * lpHQVfilterCtl, unsigned long * lpHQVminiCtl,unsigned long * lpHQVzoomflag); void viaOverlayGetV1Format(VIAPtr pVia, unsigned long dwVideoFlag,LPDDPIXELFORMAT lpDPF, unsigned long * lpdwVidCtl,unsigned long * lpdwHQVCtl ); void viaOverlayGetV3Format(VIAPtr pVia, unsigned long dwVideoFlag,LPDDPIXELFORMAT lpDPF, unsigned long * lpdwVidCtl,unsigned long * lpdwHQVCtl ); Index: xc/programs/Xserver/hw/xfree86/drivers/via/via_memory.c diff -u xc/programs/Xserver/hw/xfree86/drivers/via/via_memory.c:1.7 xc/programs/Xserver/hw/xfree86/drivers/via/via_memory.c:1.9 --- xc/programs/Xserver/hw/xfree86/drivers/via/via_memory.c:1.7 Tue Dec 14 20:26:50 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/via/via_memory.c Sun Aug 28 12:24:08 2005 @@ -20,7 +20,7 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_memory.c,v 1.7 2004/12/15 01:26:50 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_memory.c,v 1.9 2005/08/28 16:24:08 tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -50,7 +50,7 @@ * 2 - DRM * 3 - Preallocated buffer (Used in 4.3 only) */ - + void VIAFreeLinear(VIAMemPtr mem) { VIAPtr pVia; @@ -80,13 +80,12 @@ } } -#ifdef XFREE86_44 static unsigned long offScreenLinear(VIAMemPtr mem, ScrnInfoPtr pScrn, unsigned long size) { int depth = (pScrn->bitsPerPixel + 7) >> 3; /* Make sure we don't truncate requested size */ - mem->linear = xf86AllocateOffscreenLinear(pScrn->pScreen, + mem->linear = xf86AllocateOffscreenLinear(pScrn->pScreen, ( size + depth - 1 ) / depth, 32, NULL, NULL, NULL); if(mem->linear == NULL) @@ -96,115 +95,57 @@ return Success; } -#endif -unsigned long VIAAllocLinear(VIAMemPtr mem, ScrnInfoPtr pScrn, unsigned long size) +unsigned long VIAAllocLinear(VIAMemPtr mem, ScrnInfoPtr pScrn, + unsigned long size) { -#if defined(XF86DRI) || !defined(XFREE86_44) - VIAPtr pVia = VIAPTR(pScrn); -#endif - #ifdef XF86DRI + VIAPtr pVia = VIAPTR(pScrn); int ret; + if(mem->pool) + ErrorF("VIA Double Alloc.\n"); - if(mem->pool) - ErrorF("VIA Double Alloc.\n"); - if(pVia->graphicInfo.DRMEnabled) { - mem->drm_fd = pVia->drmFD; - mem->drm.context = 1; - mem->drm.size = size; - mem->drm.type = VIDEO; - ret = drmCommandWrite(mem->drm_fd, DRM_VIA_ALLOCMEM, &mem->drm, + mem->drm_fd = pVia->drmFD; + mem->drm.context = 1; + mem->drm.size = size; + mem->drm.type = VIDEO; + ret = drmCommandWrite(mem->drm_fd, DRM_VIA_ALLOCMEM, &mem->drm, sizeof(drmViaMem)); if (ret || (size != mem->drm.size)) { -#ifdef XFREE86_44 /* * Try XY Fallback before failing. - */ - + */ + if (Success == offScreenLinear(mem, pScrn, size)) return Success; -#endif ErrorF("DRM memory allocation failed\n"); return BadAlloc; - } - - mem->base = mem->drm.offset; - mem->pool = 2; - DEBUG(ErrorF("Fulfilled via DRI at %lu\n", mem->base)); - return 0; - } -#endif - -#ifdef XFREE86_44 - { - if (Success == offScreenLinear(mem, pScrn, size)) - return Success; - ErrorF("Linear memory allocation failed\n"); - return BadAlloc; - } -#else - { - int i; - if(size > pVia->SWOVSize) - return BadAccess; - for(i = 0; i < MEM_BLOCKS; i++) { - if(!pVia->SWOVUsed[i]) { - pVia->SWOVUsed[i] = 1; - mem->pool = 3; - mem->base = pVia->SWOVPool + pVia->SWOVSize * i; - mem->pVia = pVia; - mem->slot = i; - DEBUG(ErrorF("Fulfilled via pool at %lu\n", mem->base)); - return 0; - } - } } - ErrorF("Out of pools.\n"); - return BadAlloc; -#endif -} -#ifndef XFREE86_44 + mem->base = mem->drm.offset; + mem->pool = 2; + DEBUG(ErrorF("Fulfilled via DRI at %lu\n", mem->base)); + return 0; + } +#endif -static void -VIAInitPool(VIAPtr pVia, unsigned long offset, unsigned long size) -{ - DEBUG(ErrorF("VIAInitPool %lu bytes at %lu\n", size, offset)); - - size /= 4; - - DEBUG(ErrorF("VIAInitPool %d pools of %lu bytes\n", MEM_BLOCKS, size)); - pVia->SWOVPool = offset; - pVia->SWOVSize = size; + if (Success == offScreenLinear(mem, pScrn, size)) + return Success; + ErrorF("Linear memory allocation failed\n"); + return BadAlloc; } -#endif - void VIAInitLinear(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; VIAPtr pVia = VIAPTR(pScrn); -#ifdef XFREE86_44 /* - * In the 44 path we must take care not to truncate offset and size so - * that we get overlaps. If there is available memory below line 2048 - * we use it. - */ - unsigned long offset = (pVia->FBFreeStart + pVia->Bpp - 1 ) / pVia->Bpp; + * We must take care not to truncate offset and size so that we get + * overlaps. If there is available memory below line 2048 we use it. + */ + unsigned long offset = (pVia->FBFreeStart + pVia->Bpp - 1 ) / pVia->Bpp; unsigned long size = pVia->FBFreeEnd / pVia->Bpp - offset; if (size > 0) xf86InitFBManagerLinear(pScreen, offset, size); -#else - /* - * In the 43 path we don't have to care about truncation. just use - * all available memory, also below line 2048. The drm module uses - * pVia->FBFreeStart as offscreen available start. We do it to. - */ - unsigned long offset = pVia->FBFreeStart; - unsigned long size = pVia->FBFreeEnd - offset; - if (size > 0 ) VIAInitPool(pVia, offset, size); -#endif } - Index: xc/programs/Xserver/hw/xfree86/drivers/via/via_video.c diff -u xc/programs/Xserver/hw/xfree86/drivers/via/via_video.c:1.18 xc/programs/Xserver/hw/xfree86/drivers/via/via_video.c:1.22 --- xc/programs/Xserver/hw/xfree86/drivers/via/via_video.c:1.18 Mon Mar 29 11:25:22 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/via/via_video.c Fri Oct 14 11:16:49 2005 @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_video.c,v 1.18 2004/03/29 16:25:22 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/via_video.c,v 1.22 2005/10/14 15:16:49 tsi Exp $ */ /* * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. @@ -43,7 +43,7 @@ #include "via.h" #include "xf86xv.h" -#include "Xv.h" +#include <X11/extensions/Xv.h> #include "xaa.h" #include "dixstruct.h" #include "via_xvpriv.h" @@ -56,7 +56,7 @@ #define OFF_DELAY 200 /* milliseconds */ #define FREE_DELAY 60000 #define PARAMSIZE 1024 -#define SLICESIZE 65536 +#define SLICESIZE 65536 #define OFF_TIMER 0x01 #define FREE_TIMER 0x02 #define TIMER_MASK (OFF_TIMER | FREE_TIMER) @@ -78,10 +78,6 @@ #define IN_DISPLAY ( viaVidEng->interruptflag & 0x00000200) #define IN_VBLANK ( !IN_DISPLAY ) -#ifndef XvExtension -void viaInitVideo(ScreenPtr pScreen) {} -#else - /* * F U N C T I O N D E C L A R A T I O N */ @@ -90,16 +86,16 @@ static int viaSetPortAttributeG(ScrnInfoPtr, Atom, INT32, pointer); static int viaGetPortAttributeG(ScrnInfoPtr, Atom ,INT32 *, pointer); static void viaQueryBestSizeG(ScrnInfoPtr, Bool, - short, short, short, short, unsigned int *, unsigned int *, pointer); -static int viaPutImageG( ScrnInfoPtr, - short, short, short, short, short, short, short, short, - int, unsigned char*, short, short, Bool, RegionPtr, pointer); + short, short, short, short, unsigned int *, unsigned int *, pointer); +static int viaPutImageG( ScrnInfoPtr, + short, short, short, short, short, short, short, short, + int, unsigned char*, short, short, Bool, RegionPtr, pointer); static int viaPutVideo(ScrnInfoPtr , short , short , short , short ,short , short , short , short , RegionPtr , pointer ); -static int viaQueryImageAttributesG(ScrnInfoPtr, - int, unsigned short *, unsigned short *, int *, int *); +static int viaQueryImageAttributesG(ScrnInfoPtr, + int, unsigned short *, unsigned short *, int *, int *); static Atom xvBrightness, xvContrast, xvColorKey, xvHue, xvSaturation, xvPort, xvCompose, xvEncoding, xvMute, xvVolume, xvFreq, xvAudioCtrl, @@ -123,7 +119,7 @@ #define NUM_FORMATS_G 9 -static XF86VideoFormatRec FormatsG[NUM_FORMATS_G] = +static XF86VideoFormatRec FormatsG[NUM_FORMATS_G] = { { 8, TrueColor }, /* Dithered */ { 8, PseudoColor }, /* Using .. */ @@ -164,55 +160,55 @@ static XF86ImageRec ImagesG[NUM_IMAGES_G] = { { - 0x32595559, - XvYUV, - LSBFirst, - {'Y','U','Y','2', - 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, - 16, - XvPacked, - 1, - 0, 0, 0, 0 , - 8, 8, 8, - 1, 2, 2, - 1, 2, 2, - {'Y','U','Y','V', - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - XvTopToBottom + 0x32595559, + XvYUV, + LSBFirst, + {'Y','U','Y','2', + 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, + 16, + XvPacked, + 1, + 0, 0, 0, 0 , + 8, 8, 8, + 1, 2, 2, + 1, 2, 2, + {'Y','U','Y','V', + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + XvTopToBottom } , { - 0x32315659, - XvYUV, - LSBFirst, - {'Y','V','1','2', - 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, - 12, - XvPlanar, - 3, - 0, 0, 0, 0 , - 8, 8, 8, - 1, 2, 2, - 1, 2, 2, - {'Y','V','U', - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - XvTopToBottom + 0x32315659, + XvYUV, + LSBFirst, + {'Y','V','1','2', + 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, + 12, + XvPlanar, + 3, + 0, 0, 0, 0 , + 8, 8, 8, + 1, 2, 2, + 1, 2, 2, + {'Y','V','U', + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + XvTopToBottom }/*, { - 0x59565955, - XvYUV, - LSBFirst, - {'U','Y','V','Y', - 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, - 16, - XvPacked, - 1, - 0, 0, 0, 0 , - 8, 8, 8, - 1, 2, 2, - 1, 1, 1, - {'U','Y','V','Y', - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, - XvTopToBottom + 0x59565955, + XvYUV, + LSBFirst, + {'U','Y','V','Y', + 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, + 16, + XvPacked, + 1, + 0, 0, 0, 0 , + 8, 8, 8, + 1, 2, 2, + 1, 1, 1, + {'U','Y','V','Y', + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + XvTopToBottom } */ }; @@ -234,7 +230,7 @@ while (IN_DISPLAY); } -static __inline void waitIfFlip(vmmtr viaVidEng) +static __inline void waitIfFlip(vmmtr viaVidEng) { while( IN_FLIP ); } @@ -252,47 +248,47 @@ static Bool DecideOverlaySupport(VIAPtr pVia) { - /* Small trick here. We keep the height in 16's of lines and width in 32's + /* Small trick here. We keep the height in 16's of lines and width in 32's to avoid numeric overflow */ unsigned long bandwidth = (pVia->graphicInfo.dwHeight >> 4) * (pVia->graphicInfo.dwWidth >> 5) * - pVia->graphicInfo.dwBPP * pVia->graphicInfo.dwRefreshRate; + pVia->graphicInfo.dwBPP * pVia->graphicInfo.dwRefreshRate; VGAOUT8(0x3D4, 0x3D); switch ((VGAIN8(0x3D5) & 0x70) >> 4) { - case 0: /* No overlay without DDR */ - case SDR100: - case SDR133: - return FALSE; - case DDR100: - /* Basic limit for DDR100 is about this */ - if(bandwidth > 1800000) - return FALSE; - /* But we have constraints at higher than 800x600 */ - if (pVia->graphicInfo.dwWidth > 800) - { - if(pVia->graphicInfo.dwBPP != 8) - return FALSE; - if(pVia->graphicInfo.dwHeight > 768) - return FALSE; - if(pVia->graphicInfo.dwRefreshRate > 60) - return FALSE; - } - return TRUE; - - case DDR133: - if(bandwidth > 7901250) - return FALSE; - return TRUE; + case 0: /* No overlay without DDR */ + case SDR100: + case SDR133: + return FALSE; + case DDR100: + /* Basic limit for DDR100 is about this */ + if(bandwidth > 1800000) + return FALSE; + /* But we have constraints at higher than 800x600 */ + if (pVia->graphicInfo.dwWidth > 800) + { + if(pVia->graphicInfo.dwBPP != 8) + return FALSE; + if(pVia->graphicInfo.dwHeight > 768) + return FALSE; + if(pVia->graphicInfo.dwRefreshRate > 60) + return FALSE; + } + return TRUE; + + case DDR133: + if(bandwidth > 7901250) + return FALSE; + return TRUE; } return FALSE; } -void viaResetVideo(ScrnInfoPtr pScrn) +void viaResetVideo(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); - vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; + vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; DBG_DD(ErrorF(" via_video.c : viaResetVideo: \n")); @@ -307,7 +303,7 @@ void viaSaveVideo(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); - vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; + vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; pVia->dwV1 = ((vmmtr)viaVidEng)->video1_ctl; pVia->dwV3 = ((vmmtr)viaVidEng)->video3_ctl; @@ -319,7 +315,7 @@ void viaRestoreVideo(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); - vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; + vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; waitVBLANK(viaVidEng); viaVidEng->video1_ctl = pVia->dwV1 ; @@ -329,14 +325,14 @@ void viaExitVideo(ScrnInfoPtr pScrn) { VIAPtr pVia = VIAPTR(pScrn); - vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; + vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; DBG_DD(ErrorF(" via_video.c : viaExitVideo : \n")); waitVBLANK(viaVidEng); viaVidEng->video1_ctl = 0; viaVidEng->video3_ctl = 0; -} +} XF86VideoAdaptorPtr adaptPtr[XV_PORT_NUM]; @@ -355,39 +351,39 @@ */ if(pVia->Chipset == VIA_CLE266) { - newAdaptor = viaSetupImageVideoG(pScreen); + newAdaptor = viaSetupImageVideoG(pScreen); } num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); DBG_DD(ErrorF(" via_video.c : num_adaptors : %d\n",num_adaptors)); if(newAdaptor) { - if(!num_adaptors) { - num_adaptors = 1; - adaptors = &newAdaptor; /* Now ,useless */ - } else { - DBG_DD(ErrorF(" via_video.c : viaInitVideo : Warning !!! MDS not supported yet !\n")); - newAdaptors = /* need to free this someplace */ - xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*)); - if(newAdaptors) { - memcpy(newAdaptors, adaptors, num_adaptors * - sizeof(XF86VideoAdaptorPtr)); - newAdaptors[num_adaptors] = newAdaptor; - adaptors = newAdaptors; - num_adaptors++; - } - } + if(!num_adaptors) { + num_adaptors = 1; + adaptors = &newAdaptor; /* Now ,useless */ + } else { + DBG_DD(ErrorF(" via_video.c : viaInitVideo : Warning !!! MDS not supported yet !\n")); + newAdaptors = /* need to free this someplace */ + xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*)); + if(newAdaptors) { + memcpy(newAdaptors, adaptors, num_adaptors * + sizeof(XF86VideoAdaptorPtr)); + newAdaptors[num_adaptors] = newAdaptor; + adaptors = newAdaptors; + num_adaptors++; + } + } } if(num_adaptors) - xf86XVScreenInit(pScreen, adaptPtr, XV_PORT_NUM); + xf86XVScreenInit(pScreen, adaptPtr, XV_PORT_NUM); if(newAdaptors) - xfree(newAdaptors); + xfree(newAdaptors); } -XF86VideoAdaptorPtr +XF86VideoAdaptorPtr viaSetupImageVideoG(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; @@ -395,7 +391,7 @@ viaPortPrivRec *gviaPortPriv[XV_PORT_NUM]; DevUnion * pdevUnion[XV_PORT_NUM]; int i; - + DBG_DD(ErrorF(" via_video.c : viaSetupImageVideoG: \n")); /* Look for available devices */ @@ -414,72 +410,68 @@ xvFreq = MAKE_ATOM("XV_FREQ"); xvAudioCtrl = MAKE_ATOM("XV_AUDIOCTRL"); xvHQV = MAKE_ATOM("XV_HIGHQVDO"); - xvBOB = MAKE_ATOM("XV_BOB"); + xvBOB = MAKE_ATOM("XV_BOB"); xvExitTV = MAKE_ATOM("XV_EXITTV"); /* AllocatePortPriv();*/ for ( i = 0; i< XV_PORT_NUM; i ++ ) { - if(!(adaptPtr[i] = xf86XVAllocateVideoAdaptorRec(pScrn))) - return NULL; + if(!(adaptPtr[i] = xf86XVAllocateVideoAdaptorRec(pScrn))) + return NULL; - gviaPortPriv[i] = (viaPortPrivPtr)xnfcalloc(1, sizeof(viaPortPrivRec) ); - pdevUnion[i] = (DevUnion *)xnfcalloc(1, sizeof(DevUnion)); + gviaPortPriv[i] = (viaPortPrivPtr)xnfcalloc(1, sizeof(viaPortPrivRec) ); + pdevUnion[i] = (DevUnion *)xnfcalloc(1, sizeof(DevUnion)); - if(i == 0) /* Overlay engine */ - { - adaptPtr[i]->type = XvInputMask | XvWindowMask | XvImageMask | XvVideoMask | XvStillMask; - adaptPtr[i]->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; - } - else - { - adaptPtr[i]->type = XvInputMask | XvWindowMask | XvVideoMask; - adaptPtr[i]->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; - } - adaptPtr[i]->name = XVPORTNAME[i]; - adaptPtr[i]->nEncodings = 8; - adaptPtr[i]->pEncodings = DummyEncoding; - adaptPtr[i]->nFormats = sizeof(FormatsG) / sizeof(FormatsG[0]); - adaptPtr[i]->pFormats = FormatsG; - - /* The adapter can handle 1 port simultaneously */ - adaptPtr[i]->nPorts = 1; - adaptPtr[i]->pPortPrivates = pdevUnion[i]; - adaptPtr[i]->pPortPrivates->ptr = (pointer) gviaPortPriv[i]; - if (i == 3) /* Utility port doesn't need attribute */ - { - adaptPtr[i]->nAttributes = 0; - adaptPtr[i]->pAttributes = NULL; - } - else - { - adaptPtr[i]->nAttributes = NUM_ATTRIBUTES_G; - adaptPtr[i]->pAttributes = AttributesG; - } - adaptPtr[i]->nImages = NUM_IMAGES_G; - adaptPtr[i]->pImages = ImagesG; - adaptPtr[i]->PutVideo = viaPutVideo; - adaptPtr[i]->StopVideo = viaStopVideoG; - adaptPtr[i]->SetPortAttribute = viaSetPortAttributeG; - adaptPtr[i]->GetPortAttribute = viaGetPortAttributeG; - adaptPtr[i]->QueryBestSize = viaQueryBestSizeG; - adaptPtr[i]->PutImage = viaPutImageG; - adaptPtr[i]->QueryImageAttributes = viaQueryImageAttributesG; + if(i == 0) /* Overlay engine */ + { + adaptPtr[i]->type = XvInputMask | XvWindowMask | XvImageMask | XvVideoMask | XvStillMask; + adaptPtr[i]->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; + } + else + { + adaptPtr[i]->type = XvInputMask | XvWindowMask | XvVideoMask; + adaptPtr[i]->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; + } + adaptPtr[i]->name = XVPORTNAME[i]; + adaptPtr[i]->nEncodings = 8; + adaptPtr[i]->pEncodings = DummyEncoding; + adaptPtr[i]->nFormats = sizeof(FormatsG) / sizeof(FormatsG[0]); + adaptPtr[i]->pFormats = FormatsG; + + /* The adapter can handle 1 port simultaneously */ + adaptPtr[i]->nPorts = 1; + adaptPtr[i]->pPortPrivates = pdevUnion[i]; + adaptPtr[i]->pPortPrivates->ptr = (pointer) gviaPortPriv[i]; + if (i == 3) /* Utility port doesn't need attribute */ + { + adaptPtr[i]->nAttributes = 0; + adaptPtr[i]->pAttributes = NULL; + } + else + { + adaptPtr[i]->nAttributes = NUM_ATTRIBUTES_G; + adaptPtr[i]->pAttributes = AttributesG; + } + adaptPtr[i]->nImages = NUM_IMAGES_G; + adaptPtr[i]->pImages = ImagesG; + adaptPtr[i]->PutVideo = viaPutVideo; + adaptPtr[i]->StopVideo = viaStopVideoG; + adaptPtr[i]->SetPortAttribute = viaSetPortAttributeG; + adaptPtr[i]->GetPortAttribute = viaGetPortAttributeG; + adaptPtr[i]->QueryBestSize = viaQueryBestSizeG; + adaptPtr[i]->PutImage = viaPutImageG; + adaptPtr[i]->QueryImageAttributes = viaQueryImageAttributesG; #ifdef COLOR_KEY - gviaPortPriv[i]->colorKey = 0x0821; -#endif - gviaPortPriv[i]->brightness = 0; - gviaPortPriv[i]->saturation = 0; - gviaPortPriv[i]->contrast = 0; - gviaPortPriv[i]->hue = 0; - gviaPortPriv[i]->xv_portnum = i; - - /* gotta uninit this someplace */ -#ifdef XFREE86_44 - REGION_NULL(pScreen, &gviaPortPriv[i]->clip); -#else - REGION_INIT(pScreen, &gviaPortPriv[i]->clip, NullBox, 1); + gviaPortPriv[i]->colorKey = 0x0821; #endif + gviaPortPriv[i]->brightness = 0; + gviaPortPriv[i]->saturation = 0; + gviaPortPriv[i]->contrast = 0; + gviaPortPriv[i]->hue = 0; + gviaPortPriv[i]->xv_portnum = i; + + /* gotta uninit this someplace */ + REGION_NULL(pScreen, &gviaPortPriv[i]->clip); } /* End of for */ viaResetVideo(pScrn); return adaptPtr[0]; @@ -493,7 +485,7 @@ unsigned long retCode; if (pVia->Video.VideoStatus & SWOV_SURFACE_CREATED) - return Success; + return Success; lpSurfaceDesc->dwWidth = (unsigned long)width; lpSurfaceDesc->dwHeight = (unsigned long)height; @@ -513,7 +505,7 @@ DBG_DD(ErrorF(" lpSWOverlaySurface[0]: %p\n", pPriv->ddLock.SWDevice.lpSWOverlaySurface[0])); DBG_DD(ErrorF(" lpSWOverlaySurface[1]: %p\n", pPriv->ddLock.SWDevice.lpSWOverlaySurface[1])); - + pVia->Video.VideoStatus |= SWOV_SURFACE_CREATED|SW_VIDEO_ON; pVia->Video.dwAction = ACTION_SET_VIDEOSTATUS; return Success; @@ -525,21 +517,21 @@ VIAPtr pVia = VIAPTR(pScrn); LPDDSURFACEDESC lpSurfaceDesc = &pPriv->SurfaceDesc; DBG_DD(ErrorF(" via_video.c : Destroy SW Overlay Surface, fourcc =0x%08x : \n", - lpSurfaceDesc->dwFourCC)); + lpSurfaceDesc->dwFourCC)); if (pVia->Video.VideoStatus & SWOV_SURFACE_CREATED) { - DBG_DD(ErrorF(" via_video.c : Destroy SW Overlay Surface, VideoStatus =0x%08x : \n", - pVia->Video.VideoStatus)); + DBG_DD(ErrorF(" via_video.c : Destroy SW Overlay Surface, VideoStatus =0x%08x : \n", + pVia->Video.VideoStatus)); } else { - DBG_DD(ErrorF(" via_video.c : No SW Overlay Surface Destroyed, VideoStatus =0x%08x : \n", - pVia->Video.VideoStatus)); - return; + DBG_DD(ErrorF(" via_video.c : No SW Overlay Surface Destroyed, VideoStatus =0x%08x : \n", + pVia->Video.VideoStatus)); + return; } - VIAVidDestroySurface(pScrn, lpSurfaceDesc); + VIAVidDestroySurface(pScrn, lpSurfaceDesc); pVia->Video.VideoStatus &= ~SWOV_SURFACE_CREATED; pVia->Video.dwAction = ACTION_SET_VIDEOSTATUS; @@ -556,11 +548,11 @@ pVia->Video.dwAction = ACTION_SET_VIDEOSTATUS; lpUpdateOverlay->dwFlags = DDOVER_HIDE; - VIAVidUpdateOverlay(pScrn, lpUpdateOverlay); + VIAVidUpdateOverlay(pScrn, lpUpdateOverlay); } -static void +static void viaStopVideoG(ScrnInfoPtr pScrn, pointer data, Bool exit) { VIAPtr pVia = VIAPTR(pScrn); @@ -572,7 +564,7 @@ if(exit) { StopSWOVerlay(pScrn); DestroySWOVSurface(pScrn, pPriv); - pVia->dwFrameNum = 0; + pVia->dwFrameNum = 0; pPriv->old_drw_x= 0; pPriv->old_drw_y= 0; pPriv->old_drw_w= 0; @@ -603,30 +595,30 @@ case PAL_60_COMPOSITE : case PAL_60_TUNER : case PAL_60_SVIDEO : - divider = 633 + (short)frequency; - break; + divider = 633 + (short)frequency; + break; case NTSC_COMPOSITE : case NTSC_TUNER : case NTSC_SVIDEO : - divider = 733 + (short)frequency; - break; + divider = 733 + (short)frequency; + break; default: - divider = frequency; + divider = frequency; } control = 0x8E00; if ( divider <= LOW_BAND ) - control |= 0xA0; + control |= 0xA0; else if ( divider <= MID_BAND ) - control |= 0x90; + control |= 0x90; else - control |= 0x30; + control |= 0x30; DBG_DD(ErrorF(" via_video.c : SetTunerChannel : Divider = 0x%08x, Control= 0x%08x, \n", divider,control)); if(pTuner) - ViaTunerChannel(pTuner, divider, control); + ViaTunerChannel(pTuner, divider, control); } /* SetTunerChannel ()... */ @@ -647,7 +639,7 @@ } -static int +static int viaSetPortAttributeG( ScrnInfoPtr pScrn, Atom attribute, @@ -655,16 +647,16 @@ pointer data ){ VIAPtr pVia = VIAPTR(pScrn); - vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; + vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; viaPortPrivPtr pPriv = (viaPortPrivPtr)data; int attr, avalue; ViaTunerPtr pTuner = NULL; - + if(pPriv->xv_portnum == COMMAND_FOR_TV0) - pTuner = pVia->Tuner[0]; + pTuner = pVia->Tuner[0]; else if(pPriv->xv_portnum == COMMAND_FOR_TV1) - pTuner = pVia->Tuner[1]; - ; + pTuner = pVia->Tuner[1]; + ; DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : \n")); pVia->OverlaySupported = DecideOverlaySupport(pVia); @@ -672,112 +664,112 @@ /* Color Key */ if(attribute == xvColorKey) { - DBG_DD(ErrorF(" V4L Disable xvColorKey = %08x\n",value)); + DBG_DD(ErrorF(" V4L Disable xvColorKey = %08x\n",value)); - pPriv->colorKey = value; - /* All assume color depth is 16 */ - value &= 0x00FFFFFF; - viaVidEng->color_key = value; - viaVidEng->snd_color_key = value; - REGION_EMPTY(pScrn->pScreen, &pPriv->clip); - DBG_DD(ErrorF(" V4L Disable done xvColorKey = %08x\n",value)); + pPriv->colorKey = value; + /* All assume color depth is 16 */ + value &= 0x00FFFFFF; + viaVidEng->color_key = value; + viaVidEng->snd_color_key = value; + REGION_EMPTY(pScrn->pScreen, &pPriv->clip); + DBG_DD(ErrorF(" V4L Disable done xvColorKey = %08x\n",value)); /* Color Control */ } else if (attribute == xvBrightness || - attribute == xvContrast || - attribute == xvSaturation || - attribute == xvHue) { - if (attribute == xvBrightness) - { - DBG_DD(ErrorF(" xvBrightness = %08d\n",value)); - pPriv->pict.brightness = xv_to_v4l(value); - if(pTuner) - ViaTunerBrightness(pTuner, value); - } - if (attribute == xvContrast) - { - DBG_DD(ErrorF(" xvContrast = %08d\n",value)); - pPriv->pict.contrast = xv_to_v4l(value); - if(pTuner) - ViaTunerContrast(pTuner, value); - } - if (attribute == xvSaturation) - { - DBG_DD(ErrorF(" xvSaturation = %08d\n",value)); - pPriv->pict.colour = xv_to_v4l(value); - if(pTuner) - ViaTunerSaturation(pTuner, value); - } - if (attribute == xvHue) - { - DBG_DD(ErrorF(" xvHue = %08d\n",value)); - pPriv->pict.hue = xv_to_v4l(value); - if(pTuner) - ViaTunerHue(pTuner, value); - } + attribute == xvContrast || + attribute == xvSaturation || + attribute == xvHue) { + if (attribute == xvBrightness) + { + DBG_DD(ErrorF(" xvBrightness = %08d\n",value)); + pPriv->pict.brightness = xv_to_v4l(value); + if(pTuner) + ViaTunerBrightness(pTuner, value); + } + if (attribute == xvContrast) + { + DBG_DD(ErrorF(" xvContrast = %08d\n",value)); + pPriv->pict.contrast = xv_to_v4l(value); + if(pTuner) + ViaTunerContrast(pTuner, value); + } + if (attribute == xvSaturation) + { + DBG_DD(ErrorF(" xvSaturation = %08d\n",value)); + pPriv->pict.colour = xv_to_v4l(value); + if(pTuner) + ViaTunerSaturation(pTuner, value); + } + if (attribute == xvHue) + { + DBG_DD(ErrorF(" xvHue = %08d\n",value)); + pPriv->pict.hue = xv_to_v4l(value); + if(pTuner) + ViaTunerHue(pTuner, value); + } /* Audio control */ } else if (attribute == xvMute){ - DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvMute = %08d\n",value)); - if(value) - value = 1; - ViaAudioMute(pVia, value); + DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvMute = %08d\n",value)); + if(value) + value = 1; + ViaAudioMute(pVia, value); } else if (attribute == xvVolume){ - DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvVolume = %08d\n",value)); - pPriv->Volume = value; - attr = ATTR_VOLUME; - avalue = value; - /* FIXME */ + DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvVolume = %08d\n",value)); + pPriv->Volume = value; + attr = ATTR_VOLUME; + avalue = value; + /* FIXME */ /* Tuner control. Channel switch */ } else if (attribute == xvFreq){ - DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvFreq = %08x\n",value)); - SetTunerChannel(pTuner, pPriv, value ); + DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvFreq = %08x\n",value)); + SetTunerChannel(pTuner, pPriv, value ); /* Video decoder control. NTSC/PAL, SVIDEO/COMPOSITIVE/TV */ } else if (attribute == xvEncoding){ - DBG_DD(ErrorF(" xvEncoding = %d. \n",value)); - pPriv->dwEncoding = value; - if(pTuner) - ViaTunerStandard(pTuner, value); + DBG_DD(ErrorF(" xvEncoding = %d. \n",value)); + pPriv->dwEncoding = value; + if(pTuner) + ViaTunerStandard(pTuner, value); /* VIA Proprietary Attribute for Video control */ } else if (attribute == xvPort ){ - DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvPort=%d\n", value)); + DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvPort=%d\n", value)); } else if (attribute == xvCompose){ - DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvCompose=%08x\n",value)); + DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvCompose=%08x\n",value)); } else if (attribute == xvHQV){ - DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvHQV=%08x\n",value)); + DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvHQV=%08x\n",value)); } else if (attribute == xvBOB){ - DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvBOB=%08x\n",value)); + DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvBOB=%08x\n",value)); } else if (attribute == xvExitTV){ - DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvExitTV=%08x\n",value)); + DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvExitTV=%08x\n",value)); /* VIA Proprietary Attribute for AUDIO control */ } else if (attribute == xvAudioCtrl ){ - DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvAudioSwitch=%d\n", value)); - if(pTuner) - { - ViaAudioMode(pVia, value); - if(pPriv->xv_portnum == COMMAND_FOR_TV0) - ViaAudioSelect(pVia,0); - else - ViaAudioSelect(pVia, 1); - } + DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : xvAudioSwitch=%d\n", value)); + if(pTuner) + { + ViaAudioMode(pVia, value); + if(pPriv->xv_portnum == COMMAND_FOR_TV0) + ViaAudioSelect(pVia,0); + else + ViaAudioSelect(pVia, 1); + } }else{ - DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : is not supported the attribute")); - return BadMatch; + DBG_DD(ErrorF(" via_video.c : viaSetPortAttributeG : is not supported the attribute")); + return BadMatch; } - + /* attr,avalue hardware processing goes here */ (void)attr; (void)avalue; - + return Success; } -static int +static int viaGetPortAttributeG( ScrnInfoPtr pScrn, Atom attribute, @@ -792,42 +784,42 @@ if (attribute == xvColorKey ) { - *value =(INT32) pPriv->colorKey; - DBG_DD(ErrorF(" via_video.c : ColorKey 0x%x\n",pPriv->colorKey)); + *value =(INT32) pPriv->colorKey; + DBG_DD(ErrorF(" via_video.c : ColorKey 0x%x\n",pPriv->colorKey)); /* Color Control */ } else if (attribute == xvBrightness || - attribute == xvContrast || - attribute == xvSaturation || - attribute == xvHue) { - if (attribute == xvBrightness) - { - *value = v4l_to_xv(pPriv->pict.brightness); - DBG_DD(ErrorF(" xvBrightness = %08d\n", *value)); - } - if (attribute == xvContrast) - { - *value = v4l_to_xv(pPriv->pict.contrast); - DBG_DD(ErrorF(" xvContrast = %08d\n", *value)); - } - if (attribute == xvSaturation) - { - *value = v4l_to_xv(pPriv->pict.colour); - DBG_DD(ErrorF(" xvSaturation = %08d\n", *value)); - } - if (attribute == xvHue) - { - *value = v4l_to_xv(pPriv->pict.hue); - DBG_DD(ErrorF(" xvHue = %08d\n", *value)); - } + attribute == xvContrast || + attribute == xvSaturation || + attribute == xvHue) { + if (attribute == xvBrightness) + { + *value = v4l_to_xv(pPriv->pict.brightness); + DBG_DD(ErrorF(" xvBrightness = %08d\n", *value)); + } + if (attribute == xvContrast) + { + *value = v4l_to_xv(pPriv->pict.contrast); + DBG_DD(ErrorF(" xvContrast = %08d\n", *value)); + } + if (attribute == xvSaturation) + { + *value = v4l_to_xv(pPriv->pict.colour); + DBG_DD(ErrorF(" xvSaturation = %08d\n", *value)); + } + if (attribute == xvHue) + { + *value = v4l_to_xv(pPriv->pict.hue); + DBG_DD(ErrorF(" xvHue = %08d\n", *value)); + } }else { - /*return BadMatch*/ ; + /*return BadMatch*/ ; } return Success; } -static void +static void viaQueryBestSizeG( ScrnInfoPtr pScrn, Bool motion, @@ -841,7 +833,7 @@ *p_h = drw_h; if(*p_w > 2048 ) - *p_w = 2048; + *p_w = 2048; } /* @@ -851,21 +843,21 @@ { switch(fourcc) { - case FOURCC_UYVY: - case FOURCC_YUY2: - while ((VIDInD(HQV_CONTROL) & HQV_SW_FLIP) ); - VIDOutD(HQV_SRC_STARTADDR_Y, pPriv->ddLock.SWDevice.dwSWPhysicalAddr[DisplayBufferIndex]); - VIDOutD(HQV_CONTROL,( VIDInD(HQV_CONTROL)&~HQV_FLIP_ODD) |HQV_SW_FLIP|HQV_FLIP_STATUS); - break; - - case FOURCC_YV12: - default: - while ((VIDInD(HQV_CONTROL) & HQV_SW_FLIP) ); - VIDOutD(HQV_SRC_STARTADDR_Y, pPriv->ddLock.SWDevice.dwSWPhysicalAddr[DisplayBufferIndex]); - VIDOutD(HQV_SRC_STARTADDR_U, pPriv->ddLock.SWDevice.dwSWCbPhysicalAddr[DisplayBufferIndex]); - VIDOutD(HQV_SRC_STARTADDR_V, pPriv->ddLock.SWDevice.dwSWCrPhysicalAddr[DisplayBufferIndex]); - VIDOutD(HQV_CONTROL,( VIDInD(HQV_CONTROL)&~HQV_FLIP_ODD) |HQV_SW_FLIP|HQV_FLIP_STATUS); - break; + case FOURCC_UYVY: + case FOURCC_YUY2: + while ((VIDInD(HQV_CONTROL) & HQV_SW_FLIP) ); + VIDOutD(HQV_SRC_STARTADDR_Y, pPriv->ddLock.SWDevice.dwSWPhysicalAddr[DisplayBufferIndex]); + VIDOutD(HQV_CONTROL,( VIDInD(HQV_CONTROL)&~HQV_FLIP_ODD) |HQV_SW_FLIP|HQV_FLIP_STATUS); + break; + + case FOURCC_YV12: + default: + while ((VIDInD(HQV_CONTROL) & HQV_SW_FLIP) ); + VIDOutD(HQV_SRC_STARTADDR_Y, pPriv->ddLock.SWDevice.dwSWPhysicalAddr[DisplayBufferIndex]); + VIDOutD(HQV_SRC_STARTADDR_U, pPriv->ddLock.SWDevice.dwSWCbPhysicalAddr[DisplayBufferIndex]); + VIDOutD(HQV_SRC_STARTADDR_V, pPriv->ddLock.SWDevice.dwSWCrPhysicalAddr[DisplayBufferIndex]); + VIDOutD(HQV_CONTROL,( VIDInD(HQV_CONTROL)&~HQV_FLIP_ODD) |HQV_SW_FLIP|HQV_FLIP_STATUS); + break; } } @@ -884,15 +876,15 @@ /* copy YUY2 data to video memory, * do 32 bits alignment. */ - + w <<= 1; /* Each pixel is YU or YV - 16 bits */ srcPitch <<= 1; - + count = h; while(count--) { - memcpy(dst, src, w); - src += srcPitch; - dst += dstPitch; + memcpy(dst, src, w); + src += srcPitch; + dst += dstPitch; } } @@ -917,9 +909,9 @@ /* copy Y component to video memory */ count = h; while(count--) { - memcpy(dst1, src1, w); - src1 += srcPitch; - dst1 += dstPitch; + memcpy(dst1, src1, w); + src1 += srcPitch; + dst1 += dstPitch; } /* UV component is 1/4 of Y */ @@ -931,23 +923,23 @@ /* copy V(Cr) component to video memory */ count = h; while(count--) { - memcpy(dst2, src2, w); - src2 += srcPitch; - dst2 += dstPitch; + memcpy(dst2, src2, w); + src2 += srcPitch; + dst2 += dstPitch; } /* copy U(Cb) component to video memory */ count = h; while(count--) { - memcpy(dst3, src3, w); - src3 += srcPitch; - dst3 += dstPitch; + memcpy(dst3, src3, w); + src3 += srcPitch; + dst3 += dstPitch; } } -static int -viaPutImageG( +static int +viaPutImageG( ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, short drw_y, @@ -960,7 +952,7 @@ ){ VIAPtr pVia = VIAPTR(pScrn); viaPortPrivPtr pPriv = (viaPortPrivPtr)data; - vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; + vmmtr viaVidEng = (vmmtr) pVia->VidMapBase; unsigned long retCode; /* int i; BoxPtr pbox; */ @@ -974,165 +966,165 @@ switch ( pPriv->xv_portnum ) { - case COMMAND_FOR_TV0 : - case COMMAND_FOR_TV1 : - DBG_DD(ErrorF(" via_video.c : : Shall not happen! \n")); - break; - - case COMMAND_FOR_SWOV : - case COMMAND_FOR_DUMMY : - { - DDUPDATEOVERLAY UpdateOverlay_Video; - LPDDUPDATEOVERLAY lpUpdateOverlay = &UpdateOverlay_Video; - - int srcPitch, dstPitch; - int srcYSize, srcUVSize; - int dstYSize, dstUVSize; - unsigned long dwUseExtendedFIFO=0; - - DBG_DD(ErrorF(" via_video.c : : S/W Overlay! \n")); - - /* Allocate video memory(CreateSurface), - * add codes to judge if need to re-create surface - */ - if ( (pPriv->old_src_w != src_w) || (pPriv->old_src_h != src_h) ) - DestroySWOVSurface(pScrn, pPriv); - - if (Success != ( retCode = CreateSWOVSurface(pScrn, pPriv, id, width, height) )) - { - DBG_DD(ErrorF(" : Fail to Create SW Video Surface\n")); + case COMMAND_FOR_TV0 : + case COMMAND_FOR_TV1 : + DBG_DD(ErrorF(" via_video.c : : Shall not happen! \n")); + break; + + case COMMAND_FOR_SWOV : + case COMMAND_FOR_DUMMY : + { + DDUPDATEOVERLAY UpdateOverlay_Video; + LPDDUPDATEOVERLAY lpUpdateOverlay = &UpdateOverlay_Video; + + int srcPitch, dstPitch; + int srcYSize, srcUVSize; + int dstYSize, dstUVSize; + unsigned long dwUseExtendedFIFO=0; + + DBG_DD(ErrorF(" via_video.c : : S/W Overlay! \n")); + + /* Allocate video memory(CreateSurface), + * add codes to judge if need to re-create surface + */ + if ( (pPriv->old_src_w != src_w) || (pPriv->old_src_h != src_h) ) + DestroySWOVSurface(pScrn, pPriv); + + if (Success != ( retCode = CreateSWOVSurface(pScrn, pPriv, id, width, height) )) + { + DBG_DD(ErrorF(" : Fail to Create SW Video Surface\n")); return retCode; - } + } - /* Copy image data from system memory to video memory - * TODO: use DRM's DMA feature to accelerate data copy - */ - srcPitch = width; - srcYSize = width * height; - srcUVSize = srcYSize >>2; - dstPitch = pPriv->ddLock.SWDevice.dwPitch; - dstYSize = dstPitch * height; - dstUVSize = dstYSize >>2; - - switch(id) - { - case FOURCC_YV12: - CopyDataYUV420(pScrn, pVia, buf , buf + srcYSize, buf + srcYSize + srcUVSize, - pPriv->ddLock.SWDevice.lpSWOverlaySurface[pVia->dwFrameNum&1], - pPriv->ddLock.SWDevice.lpSWOverlaySurface[pVia->dwFrameNum&1] + dstYSize, - pPriv->ddLock.SWDevice.lpSWOverlaySurface[pVia->dwFrameNum&1] + dstYSize + dstUVSize, - srcPitch, dstPitch, height, width); - break; - - case FOURCC_UYVY: - case FOURCC_YUY2: - default: - CopyDataYUV422(pScrn, pVia, buf, - pPriv->ddLock.SWDevice.lpSWOverlaySurface[pVia->dwFrameNum&1], - srcPitch, dstPitch, height, width); - break; - } - - /* If there is bandwidth issue, block the H/W overlay */ - if ((viaVidEng->video3_ctl & 0x00000001) && !pVia->OverlaySupported) - return BadAlloc; - - /* - * fill video overlay parameter - */ - lpUpdateOverlay->rSrc.left = src_x; - lpUpdateOverlay->rSrc.top = src_y; - lpUpdateOverlay->rSrc.right = src_x + width; - lpUpdateOverlay->rSrc.bottom = src_y + height; - - lpUpdateOverlay->rDest.left = drw_x; - lpUpdateOverlay->rDest.top = drw_y; - lpUpdateOverlay->rDest.right = lpUpdateOverlay->rDest.left + drw_w; - lpUpdateOverlay->rDest.bottom = drw_y + drw_h; - - lpUpdateOverlay->dwFlags = DDOVER_SHOW | DDOVER_KEYDEST; - if (pScrn->bitsPerPixel == 8) - { - lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey & 0xff; - } - else - { - lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey; - } - lpUpdateOverlay->dwFourcc = id; - - /* If use extend FIFO mode */ - if ((pVia->graphicInfo.dwWidth > 1024)) - { - dwUseExtendedFIFO = 1; - } - - - DBG_DD(ErrorF(" : Flip\n")); - Flip(pVia, pPriv, id, pVia->dwFrameNum&1); - - pVia->dwFrameNum ++; - - /* If the dest rec. & extendFIFO doesn't change, don't do UpdateOverlay - unless the surface clipping has changed */ - if ( (pPriv->old_drw_x == drw_x) && (pPriv->old_drw_y == drw_y) - && (pPriv->old_drw_w == drw_w) && (pPriv->old_drw_h == drw_h) - && (pPriv->old_src_w == src_w) && (pPriv->old_src_h == src_h) - && (pVia->old_dwUseExtendedFIFO == dwUseExtendedFIFO) - && (pVia->Video.VideoStatus & SW_VIDEO_ON) && - REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) - { - return Success; - } - - pPriv->old_drw_x = drw_x; - pPriv->old_drw_y = drw_y; - pPriv->old_drw_w = drw_w; - pPriv->old_drw_h = drw_h; - pVia->old_dwUseExtendedFIFO = dwUseExtendedFIFO; - pVia->Video.VideoStatus |= SW_VIDEO_ON; - - /* add to judge if need to re-create surface */ - pPriv->old_src_w = src_w; - pPriv->old_src_h = src_h; - - /* BitBlt: Draw the colorkey rectangle */ - if(!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) { - REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes); - - xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes); - } - - /* - * Call v4l to do update video overlay - */ - if ( -1 == VIAVidUpdateOverlay(pScrn, lpUpdateOverlay)) - { - DBG_DD(ErrorF(" via_video.c : : call v4l updateoverlay fail. \n")); - } - else - { + /* Copy image data from system memory to video memory + * TODO: use DRM's DMA feature to accelerate data copy + */ + srcPitch = width; + srcYSize = width * height; + srcUVSize = srcYSize >>2; + dstPitch = pPriv->ddLock.SWDevice.dwPitch; + dstYSize = dstPitch * height; + dstUVSize = dstYSize >>2; + + switch(id) + { + case FOURCC_YV12: + CopyDataYUV420(pScrn, pVia, buf , buf + srcYSize, buf + srcYSize + srcUVSize, + pPriv->ddLock.SWDevice.lpSWOverlaySurface[pVia->dwFrameNum&1], + pPriv->ddLock.SWDevice.lpSWOverlaySurface[pVia->dwFrameNum&1] + dstYSize, + pPriv->ddLock.SWDevice.lpSWOverlaySurface[pVia->dwFrameNum&1] + dstYSize + dstUVSize, + srcPitch, dstPitch, height, width); + break; + + case FOURCC_UYVY: + case FOURCC_YUY2: + default: + CopyDataYUV422(pScrn, pVia, buf, + pPriv->ddLock.SWDevice.lpSWOverlaySurface[pVia->dwFrameNum&1], + srcPitch, dstPitch, height, width); + break; + } + + /* If there is bandwidth issue, block the H/W overlay */ + if ((viaVidEng->video3_ctl & 0x00000001) && !pVia->OverlaySupported) + return BadAlloc; + + /* + * fill video overlay parameter + */ + lpUpdateOverlay->rSrc.left = src_x; + lpUpdateOverlay->rSrc.top = src_y; + lpUpdateOverlay->rSrc.right = src_x + width; + lpUpdateOverlay->rSrc.bottom = src_y + height; + + lpUpdateOverlay->rDest.left = drw_x; + lpUpdateOverlay->rDest.top = drw_y; + lpUpdateOverlay->rDest.right = lpUpdateOverlay->rDest.left + drw_w; + lpUpdateOverlay->rDest.bottom = drw_y + drw_h; + + lpUpdateOverlay->dwFlags = DDOVER_SHOW | DDOVER_KEYDEST; + if (pScrn->bitsPerPixel == 8) + { + lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey & 0xff; + } + else + { + lpUpdateOverlay->dwColorSpaceLowValue = pPriv->colorKey; + } + lpUpdateOverlay->dwFourcc = id; + + /* If use extend FIFO mode */ + if ((pVia->graphicInfo.dwWidth > 1024)) + { + dwUseExtendedFIFO = 1; + } + + + DBG_DD(ErrorF(" : Flip\n")); + Flip(pVia, pPriv, id, pVia->dwFrameNum&1); + + pVia->dwFrameNum ++; + + /* If the dest rec. & extendFIFO doesn't change, don't do UpdateOverlay + unless the surface clipping has changed */ + if ( (pPriv->old_drw_x == drw_x) && (pPriv->old_drw_y == drw_y) + && (pPriv->old_drw_w == drw_w) && (pPriv->old_drw_h == drw_h) + && (pPriv->old_src_w == src_w) && (pPriv->old_src_h == src_h) + && (pVia->old_dwUseExtendedFIFO == dwUseExtendedFIFO) + && (pVia->Video.VideoStatus & SW_VIDEO_ON) && + REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) + { + return Success; + } + + pPriv->old_drw_x = drw_x; + pPriv->old_drw_y = drw_y; + pPriv->old_drw_w = drw_w; + pPriv->old_drw_h = drw_h; + pVia->old_dwUseExtendedFIFO = dwUseExtendedFIFO; + pVia->Video.VideoStatus |= SW_VIDEO_ON; + + /* add to judge if need to re-create surface */ + pPriv->old_src_w = src_w; + pPriv->old_src_h = src_h; + + /* BitBlt: Draw the colorkey rectangle */ + if(!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) { + REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes); + + xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes); + } + + /* + * Call v4l to do update video overlay + */ + if ( -1 == VIAVidUpdateOverlay(pScrn, lpUpdateOverlay)) + { + DBG_DD(ErrorF(" via_video.c : : call v4l updateoverlay fail. \n")); + } + else + { DBG_DD(ErrorF(" via_video.c : PutImageG done OK\n")); - return Success; - } - } - break; - - case COMMAND_FOR_UTCTRL :{ - VIAXVUtilityProc(pScrn, buf); - break; - } - default: - DBG_DD(ErrorF(" via_video.c : XVPort not supported\n")); - break; + return Success; + } + } + break; + + case COMMAND_FOR_UTCTRL :{ + VIAXVUtilityProc(pScrn, buf); + break; + } + default: + DBG_DD(ErrorF(" via_video.c : XVPort not supported\n")); + break; } DBG_DD(ErrorF(" via_video.c : PutImageG done OK\n")); return Success; } -static int +static int viaQueryImageAttributesG( ScrnInfoPtr pScrn, int id, @@ -1150,32 +1142,32 @@ if(*h > 1024) *h = 1024; *w = (*w + 1) & ~1; - if(offsets) - offsets[0] = 0; + if(offsets) + offsets[0] = 0; switch(id) { case 0x32315659: /*Planar format : YV12 -4:2:0*/ - *h = (*h + 1) & ~1; - size = (*w + 3) & ~3; - if(pitches) pitches[0] = size; - size *= *h; - if(offsets) offsets[1] = size; - tmp = ((*w >> 1) + 3) & ~3; - if(pitches) pitches[1] = pitches[2] = tmp; - tmp *= (*h >> 1); - size += tmp; - if(offsets) offsets[2] = size; - size += tmp; - break; - + *h = (*h + 1) & ~1; + size = (*w + 3) & ~3; + if(pitches) pitches[0] = size; + size *= *h; + if(offsets) offsets[1] = size; + tmp = ((*w >> 1) + 3) & ~3; + if(pitches) pitches[1] = pitches[2] = tmp; + tmp *= (*h >> 1); + size += tmp; + if(offsets) offsets[2] = size; + size += tmp; + break; + case 0x59565955: /*Packed format : UYVY -4:2:2*/ case 0x32595559: /*Packed format : YUY2 -4:2:2*/ default: - size = *w << 1; - if(pitches) - pitches[0] = size; - size *= *h; - break; + size = *w << 1; + if(pitches) + pitches[0] = size; + size *= *h; + break; } if ( pitches ) @@ -1206,39 +1198,37 @@ /* BitBlt: Color fill */ if(!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) { - REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes); - xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes); + REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes); + xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes); } switch ( pPriv->xv_portnum ) { - case COMMAND_FOR_TV0 : - pPriv->yuv_win.x = drw_x; - pPriv->yuv_win.y = drw_y; - pPriv->yuv_win.width = drw_w; - pPriv->yuv_win.height = drw_h; - pPriv->yuv_win.chromakey = pPriv->colorKey; - break; - - case COMMAND_FOR_TV1 : - pPriv->yuv_win.x = drw_x; - pPriv->yuv_win.y = drw_y; - pPriv->yuv_win.width = drw_w; - pPriv->yuv_win.height = drw_h; - pPriv->yuv_win.chromakey = pPriv->colorKey; - break; - - case COMMAND_FOR_SWOV : - case COMMAND_FOR_DUMMY : - case COMMAND_FOR_UTCTRL : - DBG_DD(ErrorF(" via_video.c : This port doesn't support PutVideo.\n")); - return XvBadAlloc; - default: - DBG_DD(ErrorF(" via_video.c : Error port access.\n")); - return XvBadAlloc; + case COMMAND_FOR_TV0 : + pPriv->yuv_win.x = drw_x; + pPriv->yuv_win.y = drw_y; + pPriv->yuv_win.width = drw_w; + pPriv->yuv_win.height = drw_h; + pPriv->yuv_win.chromakey = pPriv->colorKey; + break; + + case COMMAND_FOR_TV1 : + pPriv->yuv_win.x = drw_x; + pPriv->yuv_win.y = drw_y; + pPriv->yuv_win.width = drw_w; + pPriv->yuv_win.height = drw_h; + pPriv->yuv_win.chromakey = pPriv->colorKey; + break; + + case COMMAND_FOR_SWOV : + case COMMAND_FOR_DUMMY : + case COMMAND_FOR_UTCTRL : + DBG_DD(ErrorF(" via_video.c : This port doesn't support PutVideo.\n")); + return XvBadAlloc; + default: + DBG_DD(ErrorF(" via_video.c : Error port access.\n")); + return XvBadAlloc; } return Success; } - -#endif /* !XvExtension */ Index: xc/programs/Xserver/hw/xfree86/drivers/via/videodev.h diff -u xc/programs/Xserver/hw/xfree86/drivers/via/videodev.h:1.1 xc/programs/Xserver/hw/xfree86/drivers/via/videodev.h:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/via/videodev.h:1.1 Mon Aug 4 06:32:28 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/via/videodev.h Fri Oct 14 11:16:49 2005 @@ -7,9 +7,9 @@ * Used here with the explicit permission of the original author, Alan Cox. * <alan@lxorguk.ukuu.org.uk> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/videodev.h,v 1.1 2003/08/04 10:32:28 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/via/videodev.h,v 1.2 2005/10/14 15:16:49 tsi Exp $ */ -#include "Xmd.h" +#include <X11/Xmd.h> #define VID_TYPE_CAPTURE 1 /* Can capture */ #define VID_TYPE_TUNER 2 /* Can tune */ Index: xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile diff -u xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile:1.8 xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile:1.10 --- xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile:1.8 Thu Mar 18 02:06:57 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile Fri Oct 14 11:16:49 2005 @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile,v 1.8 2004/03/18 07:06:57 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile,v 1.10 2005/10/14 15:16:49 tsi Exp $ XCOMM XCOMM This is an Imakefile for the VMware virtual SVGA driver. XCOMM @@ -11,17 +11,16 @@ OBJS = vmware.o vmwarecurs.o vmwarexaa.o bits2pixels.o offscreen_manager.o #if defined(XF86DriverSDK) -INCLUDES = -I. -I../../include +INCLUDES = -I../../include #else -INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(XF86SRC)/int10 \ -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \ - -I$(XF86SRC)/vgahw -I$(XF86SRC)/fbdevhw \ + -I$(XF86SRC)/vgahw \ -I$(XF86SRC)/ramdac -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ - -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(XF86SRC)/shadowfb -I$(EXTINCSRC) \ - -I$(XF86SRC)/vbe $(DRIINCLUDES) + -I$(SERVERSRC)/include -I$(XF86SRC)/shadowfb \ + -I$(XF86SRC)/vbe $(DRIINCLUDES) #endif DEFINES = $(DRIDEFINES) Index: xc/programs/Xserver/hw/xfree86/drivers/vmware/bits2pixels.c diff -u xc/programs/Xserver/hw/xfree86/drivers/vmware/bits2pixels.c:1.2 xc/programs/Xserver/hw/xfree86/drivers/vmware/bits2pixels.c:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/vmware/bits2pixels.c:1.2 Wed Dec 11 12:07:58 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/vmware/bits2pixels.c Mon Jan 9 10:00:14 2006 @@ -1,13 +1,9 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/bits2pixels.c,v 1.2 2002/12/11 17:07:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/bits2pixels.c,v 1.3 2006/01/09 15:00:14 dawes Exp $ */ /* ********************************************************** * Copyright (C) 1999-2001 VMware, Inc. * All Rights Reserved * **********************************************************/ -#ifdef VMX86_DEVEL -char rcsId_bits2pixels[] = "Id: bits2pixels.c,v 1.6 2001/01/26 23:32:15 yoel Exp $"; -#else #define FILECODE "F(814)" -#endif /* * bits2pixels.c -- Index: xc/programs/Xserver/hw/xfree86/drivers/vmware/bits2pixels.h diff -u xc/programs/Xserver/hw/xfree86/drivers/vmware/bits2pixels.h:1.2 xc/programs/Xserver/hw/xfree86/drivers/vmware/bits2pixels.h:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/vmware/bits2pixels.h:1.2 Wed Dec 11 12:07:58 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/vmware/bits2pixels.h Mon Jan 9 10:00:14 2006 @@ -1,8 +1,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/bits2pixels.h,v 1.2 2002/12/11 17:07:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/bits2pixels.h,v 1.3 2006/01/09 15:00:14 dawes Exp $ */ /* ********************************************************** * Copyright (C) 1999-2001 VMware, Inc. * All Rights Reserved - * Id: bits2pixels.h,v 1.4 2001/01/26 23:32:15 yoel Exp $ * **********************************************************/ /* Index: xc/programs/Xserver/hw/xfree86/drivers/vmware/guest_os.h diff -u xc/programs/Xserver/hw/xfree86/drivers/vmware/guest_os.h:1.1 xc/programs/Xserver/hw/xfree86/drivers/vmware/guest_os.h:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/vmware/guest_os.h:1.1 Thu Apr 5 15:29:44 2001 +++ xc/programs/Xserver/hw/xfree86/drivers/vmware/guest_os.h Mon Jan 9 10:00:15 2006 @@ -1,8 +1,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/guest_os.h,v 1.1 2001/04/05 19:29:44 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/guest_os.h,v 1.2 2006/01/09 15:00:15 dawes Exp $ */ /* ********************************************************* * Copyright (C) 1999-2001 VMware, Inc. * All Rights Reserved - * Id: guest_os.h,v 1.5 2001/01/26 23:32:15 yoel Exp $ * **********************************************************/ #ifndef _GUEST_OS_H_ Index: xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_limits.h diff -u xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_limits.h:1.2 xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_limits.h:1.3 --- xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_limits.h:1.2 Wed Oct 16 18:12:53 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_limits.h Mon Jan 9 10:00:15 2006 @@ -1,8 +1,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_limits.h,v 1.2 2002/10/16 22:12:53 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_limits.h,v 1.3 2006/01/09 15:00:15 dawes Exp $ */ /* ********************************************************** * Copyright (C) 1998-2001 VMware, Inc. * All Rights Reserved - * $Id: svga_limits.h,v 1.10 2002/06/26 22:26:22 tonyc Exp $ * **********************************************************/ /* Index: xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_reg.h diff -u xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_reg.h:1.8 xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_reg.h:1.9 --- xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_reg.h:1.8 Mon Feb 3 20:39:53 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_reg.h Mon Jan 9 10:00:15 2006 @@ -1,7 +1,6 @@ /* ********************************************************** * Copyright (C) 1998-2001 VMware, Inc. * All Rights Reserved - * $Id: svga_reg.h,v 1.26 2002/08/26 16:36:55 tonyc Exp $ * **********************************************************/ /* @@ -9,7 +8,7 @@ * * SVGA hardware definitions */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_reg.h,v 1.8 2003/02/04 01:39:53 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/svga_reg.h,v 1.9 2006/01/09 15:00:15 dawes Exp $ */ #ifndef _SVGA_REG_H_ #define _SVGA_REG_H_ Index: xc/programs/Xserver/hw/xfree86/drivers/vmware/vm_basic_types.h diff -u xc/programs/Xserver/hw/xfree86/drivers/vmware/vm_basic_types.h:1.5 xc/programs/Xserver/hw/xfree86/drivers/vmware/vm_basic_types.h:1.6 --- xc/programs/Xserver/hw/xfree86/drivers/vmware/vm_basic_types.h:1.5 Mon Jan 7 15:38:29 2002 +++ xc/programs/Xserver/hw/xfree86/drivers/vmware/vm_basic_types.h Mon Jan 9 10:00:15 2006 @@ -1,8 +1,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vm_basic_types.h,v 1.5 2002/01/07 20:38:29 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vm_basic_types.h,v 1.6 2006/01/09 15:00:15 dawes Exp $ */ /* ********************************************************** * Copyright (C) 1998-2001 VMware, Inc. * All Rights Reserved - * Id: vm_basic_types.h,v 1.9 2001/02/14 22:22:53 bennett Exp $ * **********************************************************/ /* Index: xc/programs/Xserver/hw/xfree86/drivers/vmware/vm_device_version.h diff -u xc/programs/Xserver/hw/xfree86/drivers/vmware/vm_device_version.h:1.1 xc/programs/Xserver/hw/xfree86/drivers/vmware/vm_device_version.h:1.2 --- xc/programs/Xserver/hw/xfree86/drivers/vmware/vm_device_version.h:1.1 Thu Apr 5 15:29:44 2001 +++ xc/programs/Xserver/hw/xfree86/drivers/vmware/vm_device_version.h Mon Jan 9 10:00:15 2006 @@ -1,8 +1,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vm_device_version.h,v 1.1 2001/04/05 19:29:44 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vm_device_version.h,v 1.2 2006/01/09 15:00:15 dawes Exp $ */ /* ********************************************************** * Copyright (C) 1998-2001 VMware, Inc. * All Rights Reserved - * Id: vm_device_version.h,v 1.2 2001/01/26 21:53:27 yoel Exp $ * **********************************************************/ Index: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c diff -u xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c:1.24 xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c:1.26 --- xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c:1.24 Fri Feb 25 20:07:13 2005 +++ xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c Thu Mar 16 11:50:22 2006 @@ -2,11 +2,7 @@ * Copyright (C) 1998-2001 VMware, Inc. * All Rights Reserved * **********************************************************/ -#ifdef VMX86_DEVEL -char rcsId_vmware[] = - "Id: vmware.c,v 1.11 2001/02/23 02:10:39 yoel Exp $"; -#endif -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c,v 1.24 2005/02/26 01:07:13 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c,v 1.26 2006/03/16 16:50:22 dawes Exp $ */ /* * TODO: support the vmware linux kernel fb driver (Option "UseFBDev"). @@ -391,6 +387,7 @@ int i; ClockRange* clockRanges; IOADDRESS domainIOBase = 0; + ModuleDescPtr pMod; #ifndef BUILD_FOR_420 domainIOBase = pScrn->domainIOBase; @@ -436,11 +433,11 @@ "VMware SVGA regs at (0x%04lx, 0x%04lx)\n", pVMWARE->indexReg, pVMWARE->valueReg); - if (!xf86LoadSubModule(pScrn, "vgahw")) { + if (!(pMod = xf86LoadSubModule(pScrn, "vgahw"))) { return FALSE; } - xf86LoaderReqSymLists(vgahwSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vgahwSymbols, NULL); if (!vgaHWGetHWRec(pScrn)) { return FALSE; @@ -761,28 +758,32 @@ pScrn->currentMode = pScrn->modes; xf86PrintModes(pScrn); xf86SetDpi(pScrn, 0, 0); - if (!xf86LoadSubModule(pScrn, "fb") || - !xf86LoadSubModule(pScrn, "shadowfb")) { + if (!(pMod = xf86LoadSubModule(pScrn, "fb"))) { + VMWAREFreeRec(pScrn); + return FALSE; + } + xf86LoaderModReqSymLists(pMod, fbSymbols, NULL); + if (!(pMod = xf86LoadSubModule(pScrn, "shadowfb"))) { VMWAREFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(fbSymbols, shadowfbSymbols, NULL); + xf86LoaderModReqSymLists(pMod, shadowfbSymbols, NULL); /* Need ramdac for hwcursor */ if (pVMWARE->hwCursor) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { + if (!(pMod = xf86LoadSubModule(pScrn, "ramdac"))) { VMWAREFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(ramdacSymbols, NULL); + xf86LoaderModReqSymLists(pMod, ramdacSymbols, NULL); } if (!pVMWARE->noAccel) { - if (!xf86LoadSubModule(pScrn, "xaa")) { + if (!(pMod = xf86LoadSubModule(pScrn, "xaa"))) { VMWAREFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(vmwareXaaSymbols, NULL); + xf86LoaderModReqSymLists(pMod, vmwareXaaSymbols, NULL); } return TRUE; @@ -1428,7 +1429,7 @@ XF86ModuleData vmwareModuleData = { &vmwareVersRec, vmwareSetup, NULL }; static pointer -vmwareSetup(pointer module, pointer opts, int *errmaj, int *errmin) +vmwareSetup(ModuleDescPtr module, pointer opts, int *errmaj, int *errmin) { static Bool setupDone = FALSE; @@ -1436,8 +1437,8 @@ setupDone = TRUE; xf86AddDriver(&VMWARE, module, 0); - LoaderRefSymLists(vgahwSymbols, fbSymbols, ramdacSymbols, - shadowfbSymbols, vmwareXaaSymbols, NULL); + LoaderModRefSymLists(module, vgahwSymbols, fbSymbols, ramdacSymbols, + shadowfbSymbols, vmwareXaaSymbols, NULL); return (pointer)1; } Index: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h diff -u xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h:1.13 xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h:1.14 --- xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h:1.13 Sun Jul 25 16:49:16 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h Mon Jan 9 10:00:15 2006 @@ -1,9 +1,8 @@ /* ********************************************************** * Copyright (C) 1998-2001 VMware, Inc. * All Rights Reserved - * Id: vmware.h,v 1.6 2001/01/30 18:13:47 bennett Exp $ * **********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h,v 1.13 2004/07/25 20:49:16 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h,v 1.14 2006/01/09 15:00:15 dawes Exp $ */ #ifndef VMWARE_H #define VMWARE_H Index: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarecurs.c diff -u xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarecurs.c:1.12 xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarecurs.c:1.13 --- xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarecurs.c:1.12 Sun Jul 25 16:49:16 2004 +++ xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarecurs.c Mon Jan 9 10:00:15 2006 @@ -2,11 +2,7 @@ * Copyright (C) 1998-2001 VMware, Inc. * All Rights Reserved * **********************************************************/ -#ifdef VMX86_DEVEL -char rcsId_vmwarecurs[] = - "Id: vmwarecurs.c,v 1.5 2001/01/30 23:33:02 bennett Exp $"; -#endif -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarecurs.c,v 1.12 2004/07/25 20:49:16 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarecurs.c,v 1.13 2006/01/09 15:00:15 dawes Exp $ */ #include "vmware.h" #include "bits2pixels.h" Index: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarexaa.c diff -u xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarexaa.c:1.6 xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarexaa.c:1.7 --- xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarexaa.c:1.6 Sun Apr 13 14:09:27 2003 +++ xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarexaa.c Mon Jan 9 10:00:15 2006 @@ -2,11 +2,7 @@ * Copyright (C) 1998-2001 VMware, Inc. * All Rights Reserved * **********************************************************/ -#ifdef VMX86_DEVEL -char rcsId_vmwarexaa[] = - "Id: $"; -#endif -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarexaa.c,v 1.6 2003/04/13 18:09:27 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarexaa.c,v 1.7 2006/01/09 15:00:15 dawes Exp $ */ #include "vmware.h" Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/Imakefile diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/Imakefile:1.4 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/Imakefile Fri Oct 14 11:16:49 2005 @@ -0,0 +1,113 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/Imakefile,v 1.4 2005/10/14 15:16:49 tsi Exp $ +XCOMM +XCOMM This is an Imakefile for the XGI driver. +XCOMM + +#define IHaveModules +#include <Server.tmpl> + +/* DRI static build only works on Linux */ +#if !defined(LinuxArchitecture) && !DoLoadableServer && BuildXF86DRI +#undef BuildXF86DRI +#define BuildXF86DRI NO +#endif + +#if BuildXF86DRI +DRISRCS = xgi_dri.c +DRIOBJS = xgi_dri.o +DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri \ + -I$(XF86OSSRC)/shared/drm/kernel +DRIDEFINES = $(GLX_DEFINES) +#endif + +SRCS = vb_ext.c vb_init.c vb_setmode.c vb_util.c\ + xgi_driver.c xgi_dac.c xgi_cursor.c xgi_accel.c xgi_setup.c\ + xgi_vga.c xgi_vb.c\ + xgi_opt.c xgi_dga.c init.c \ + xgi_video.c xgi_videohw.c $(DRISRCS) +OBJS = vb_ext.o vb_init.o vb_setmode.o vb_util.o\ + xgi_driver.o xgi_dac.o xgi_cursor.o xgi_accel.o xgi_setup.o\ + xgi_vga.o xgi_vb.o\ + xgi_opt.o xgi_dga.o init.o \ + xgi_video.o xgi_videohw.o $(DRIOBJS) + +#if defined(XF86DriverSDK) +INCLUDES = -I../../include +#else +INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ + -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa \ + -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ + -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c -I$(XF86SRC)/vbe \ + -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ + -I$(SERVERSRC)/include -I$(SERVERSRC)/render -I$(XF86SRC)/shadowfb \ + $(DRIINCLUDES) +#endif + +DEFINES = $(DRIDEFINES) + +#if MakeHasPosixVariableSubstitutions +SubdirLibraryRule($(OBJS)) +#endif + +ModuleObjectRule() + +ObjectModuleTarget(xgi,$(OBJS),drivers) + +InstallObjectModule(xgi,$(MODULEDIR),drivers) + +#if !defined(XF86DriverSDK) +InstallModuleManPage(xgi) +#endif + +DependTarget() + +InstallDriverSDKNonExecFile(Imakefile,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_accel.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_accel.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(init.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(init.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(osdef.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(initdef.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_cursor.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_cursor.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_dac.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_dac.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_dga.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_dri.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_dri.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_common.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_driver.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_video.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_video.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_videohw.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_videohw.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_vidregs.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_driver.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_opt.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(regs.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_setup.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_vb.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_vb.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_vga.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_accel.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(vgatypes.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_ver.h,$(DRIVERSDKDIR)/drivers/xgi) + +InstallDriverSDKNonExecFile(vb_struct.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(vb_def.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(vb_ext.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(vb_init.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(vb_setmode.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(vb_util.c,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(vb_ext.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(vb_init.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(vb_setmode.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(vb_util.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(vb_struct.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(vb_table.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_pci.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(xgi_regs.h,$(DRIVERSDKDIR)/drivers/xgi) +InstallDriverSDKNonExecFile(valid_mode.h,$(DRIVERSDKDIR)/drivers/xgi) + +InstallDriverSDKObjectModule(xgi,$(DRIVERSDKMODULEDIR),drivers) Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/init.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/init.c:1.3 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/init.c Tue Jun 28 21:14:11 2005 @@ -0,0 +1,2149 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/init.c,v 1.3 2005/06/29 01:14:11 dawes Exp $ */ +/* + * Mode initializing code (CRT1 section) + * (Universal module for Linux kernel framebuffer and XFree86 4.x) + * + * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria + * + * If distributed as part of the Linux kernel, the following license terms + * apply: + * + * * This program is free software; you can redistribute it and/or modify + * * it under the terms of the GNU General Public License as published by + * * the Free Software Foundation; either version 2 of the named License, + * * or any later version. + * * + * * This program is distributed in the hope that it will be useful, + * * but WITHOUT ANY WARRANTY; without even the implied warranty of + * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * * GNU General Public License for more details. + * * + * * You should have received a copy of the GNU General Public License + * * along with this program; if not, write to the Free Software + * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + * + * Otherwise, the following license terms apply: + * + * * Redistribution and use in source and binary forms, with or without + * * modification, are permitted provided that the following conditions + * * are met: + * * 1) Redistributions of source code must retain the above copyright + * * notice, this list of conditions and the following disclaimer. + * * 2) Redistributions in binary form must reproduce the above copyright + * * notice, this list of conditions and the following disclaimer in the + * * documentation and/or other materials provided with the distribution. + * * 3) The name of the author may not be used to endorse or promote products + * * derived from this software without specific prior written permission. + * * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR + * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Author: Thomas Winischhofer <thomas@winischhofer.net> + * + * Formerly based on non-functional code-fragements for 300 series by XGI, Inc. + * Used by permission. + * + * TW says: This code looks awful, I know. But please don't do anything about + * this otherwise debugging will be hell. + * The code is extremely fragile as regards the different chipsets, different + * video bridges and combinations thereof. If anything is changed, extreme + * care has to be taken that that change doesn't break it for other chipsets, + * bridges or combinations thereof. + * All comments in this file are by me, regardless if they are marked TW or not. + * + */ + +#include "init.h" +#include "vgatypes.h" +#include "vb_setmode.h" + +#if defined(ALLOC_PRAGMA) +#pragma alloc_text(PAGE,XGISetMode) +#endif + + +/*********************************************/ +/* HELPER: Get ModeID */ +/*********************************************/ + +USHORT +XGI_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, + int Depth, BOOLEAN FSTN, int LCDwidth, int LCDheight) +{ + USHORT ModeIndex = 0; + + switch(HDisplay) + { + case 320: + if(VDisplay == 200) ModeIndex = ModeIndex_320x200[Depth]; + else if(VDisplay == 240) { + if(FSTN) ModeIndex = ModeIndex_320x240_FSTN[Depth]; + else ModeIndex = ModeIndex_320x240[Depth]; + } + break; + case 400: + if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth]; + break; + case 512: + if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth]; + break; + case 640: + if(VDisplay == 480) ModeIndex = ModeIndex_640x480[Depth]; + else if(VDisplay == 400) ModeIndex = ModeIndex_640x400[Depth]; + break; + case 720: + if(!(VBFlags & CRT1_LCDA)) { + if(VDisplay == 480) ModeIndex = ModeIndex_720x480[Depth]; + else if(VDisplay == 576) ModeIndex = ModeIndex_720x576[Depth]; + } + break; + case 768: + if(!(VBFlags & CRT1_LCDA)) { + if(VDisplay == 576) ModeIndex = ModeIndex_768x576[Depth]; + } + break; + case 800: + if(VDisplay == 600) ModeIndex = ModeIndex_800x600[Depth]; + else if(!(VBFlags & CRT1_LCDA)) { + if(VDisplay == 480) ModeIndex = ModeIndex_800x480[Depth]; + } + break; + case 848: + if(!(VBFlags & CRT1_LCDA)) { + if(VDisplay == 480) ModeIndex = ModeIndex_848x480[Depth]; + } + break; + case 856: + if(!(VBFlags & CRT1_LCDA)) { + if(VDisplay == 480) ModeIndex = ModeIndex_856x480[Depth]; + } + break; + case 1024: + if(VDisplay == 768) ModeIndex = ModeIndex_1024x768[Depth]; + else if(!(VBFlags & CRT1_LCDA)) { + if(VDisplay == 576) ModeIndex = ModeIndex_1024x576[Depth]; + } + break; + case 1152: + if(!(VBFlags & CRT1_LCDA)) { + if(VDisplay == 864) ModeIndex = ModeIndex_1152x864[Depth]; + } + break; + case 1280: + if(VDisplay == 1024) ModeIndex = ModeIndex_1280x1024[Depth]; + else if(VDisplay == 720) { + if((VBFlags & CRT1_LCDA) && (LCDwidth == 1280) && (LCDheight == 720)) { + ModeIndex = ModeIndex_1280x720[Depth]; + } else if(!(VBFlags & CRT1_LCDA)) { + ModeIndex = ModeIndex_1280x720[Depth]; + } + } else if(!(VBFlags & CRT1_LCDA)) { + if(VDisplay == 960) ModeIndex = ModeIndex_1280x960[Depth]; + else if(VDisplay == 768) { + ModeIndex = ModeIndex_310_1280x768[Depth]; + } + } + break; + case 1360: + if(!(VBFlags & CRT1_LCDA)) { + if(VDisplay == 768) ModeIndex = ModeIndex_1360x768[Depth]; + } + break; + case 1400: + break; + case 1600: + if(VDisplay == 1200) ModeIndex = ModeIndex_1600x1200[Depth]; + break; + case 1680: + break; + case 1920: + if(!(VBFlags & CRT1_LCDA)) { + if(VDisplay == 1440) ModeIndex = ModeIndex_1920x1440[Depth]; + } + break; + case 2048: + if(!(VBFlags & CRT1_LCDA)) { + if(VDisplay == 1536) { + ModeIndex = ModeIndex_310_2048x1536[Depth]; + } + } + break; + } + + return(ModeIndex); +} + +/*********************************************/ +/* HELPER: SetReg, GetReg */ +/*********************************************/ + +void +XGI_SetReg(XGIIOADDRESS port, USHORT index, USHORT data) +{ + OutPortByte(port,index); + OutPortByte(port + 1,data); +} + +void +XGI_SetRegByte(XGIIOADDRESS port, USHORT data) +{ + OutPortByte(port,data); +} + +void +XGI_SetRegShort(XGIIOADDRESS port, USHORT data) +{ + OutPortWord(port,data); +} + +void +XGI_SetRegLong(XGIIOADDRESS port, ULONG data) +{ + OutPortLong(port,data); +} + +UCHAR +XGI_GetReg(XGIIOADDRESS port, USHORT index) +{ + OutPortByte(port,index); + return(InPortByte(port + 1)); +} + +UCHAR +XGI_GetRegByte(XGIIOADDRESS port) +{ + return(InPortByte(port)); +} + +USHORT +XGI_GetRegShort(XGIIOADDRESS port) +{ + return(InPortWord(port)); +} + +ULONG +XGI_GetRegLong(XGIIOADDRESS port) +{ + return(InPortLong(port)); +} + +void +XGI_SetRegANDOR(XGIIOADDRESS Port,USHORT Index,USHORT DataAND,USHORT DataOR) +{ + USHORT temp; + + temp = XGI_GetReg(Port,Index); + temp = (temp & (DataAND)) | DataOR; + XGI_SetReg(Port,Index,temp); +} + +void +XGI_SetRegAND(XGIIOADDRESS Port,USHORT Index,USHORT DataAND) +{ + USHORT temp; + + temp = XGI_GetReg(Port,Index); + temp &= DataAND; + XGI_SetReg(Port,Index,temp); +} + +void +XGI_SetRegOR(XGIIOADDRESS Port,USHORT Index,USHORT DataOR) +{ + USHORT temp; + + temp = XGI_GetReg(Port,Index); + temp |= DataOR; + XGI_SetReg(Port,Index,temp); +} + +/*********************************************/ +/* HELPER: DisplayOn, DisplayOff */ +/*********************************************/ + +void +XGI_New_DisplayOn(XGI_Private *XGI_Pr) +{ + XGI_SetRegAND(XGI_Pr->XGI_P3c4,0x01,0xDF); +} + +void +XGI_New_DisplayOff(XGI_Private *XGI_Pr) +{ + XGI_SetRegOR(XGI_Pr->XGI_P3c4,0x01,0x20); +} + + +/*********************************************/ +/* HELPER: Init Port Addresses */ +/*********************************************/ + +void +XGIRegInit(XGI_Private *XGI_Pr, XGIIOADDRESS BaseAddr) +{ + XGI_Pr->XGI_P3c4 = BaseAddr + 0x14; + XGI_Pr->XGI_P3d4 = BaseAddr + 0x24; + XGI_Pr->XGI_P3c0 = BaseAddr + 0x10; + XGI_Pr->XGI_P3ce = BaseAddr + 0x1e; + XGI_Pr->XGI_P3c2 = BaseAddr + 0x12; + XGI_Pr->XGI_P3ca = BaseAddr + 0x1a; + XGI_Pr->XGI_P3c6 = BaseAddr + 0x16; + XGI_Pr->XGI_P3c7 = BaseAddr + 0x17; + XGI_Pr->XGI_P3c8 = BaseAddr + 0x18; + XGI_Pr->XGI_P3c9 = BaseAddr + 0x19; + XGI_Pr->XGI_P3cb = BaseAddr + 0x1b; + XGI_Pr->XGI_P3cd = BaseAddr + 0x1d; + XGI_Pr->XGI_P3da = BaseAddr + 0x2a; + XGI_Pr->XGI_Part1Port = BaseAddr + XGI_CRT2_PORT_04; /* Digital video interface registers (LCD) */ + XGI_Pr->XGI_Part2Port = BaseAddr + XGI_CRT2_PORT_10; /* 301 TV Encoder registers */ + XGI_Pr->XGI_Part3Port = BaseAddr + XGI_CRT2_PORT_12; /* 301 Macrovision registers */ + XGI_Pr->XGI_Part4Port = BaseAddr + XGI_CRT2_PORT_14; /* 301 VGA2 (and LCD) registers */ + XGI_Pr->XGI_Part5Port = BaseAddr + XGI_CRT2_PORT_14 + 2; /* 301 palette address port registers */ + XGI_Pr->XGI_DDC_Port = BaseAddr + 0x14; /* DDC Port ( = P3C4, SR11/0A) */ + XGI_Pr->XGI_VidCapt = BaseAddr + XGI_VIDEO_CAPTURE; + XGI_Pr->XGI_VidPlay = BaseAddr + XGI_VIDEO_PLAYBACK; +} + +/*********************************************/ +/* HELPER: GetSysFlags */ +/*********************************************/ + +static void +XGI_GetSysFlags(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo) +{ +/* unsigned char cr5f, temp1, temp2; */ + + /* 661 and newer: NEVER write non-zero to SR11[7:4] */ + /* (SR11 is used for DDC and in enable/disablebridge) */ + XGI_Pr->XGI_SensibleSR11 = FALSE; + XGI_Pr->XGI_MyCR63 = 0x63; + if(HwInfo->jChipType >= XGI_661) { + XGI_Pr->XGI_SensibleSR11 = TRUE; + XGI_Pr->XGI_MyCR63 = 0x53; + } + + /* You should use the macros, not these flags directly */ + + XGI_Pr->XGI_SysFlags = 0; +} + +/*********************************************/ +/* HELPER: Init PCI & Engines */ +/*********************************************/ + +static void +XGIInitPCIetc(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo) +{ + switch(HwInfo->jChipType) { + case XG40: + case XG42: + case XG20: + XGI_SetReg(XGI_Pr->XGI_P3c4,0x20,0xa1); + /* - Enable 2D (0x40) + * - Enable 3D (0x02) + * - Enable 3D vertex command fetch (0x10) + * - Enable 3D command parser (0x08) + * - Enable 3D G/L transformation engine (0x80) + */ + XGI_SetRegOR(XGI_Pr->XGI_P3c4,0x1E,0xDA); + break; + } +} + +/*********************************************/ +/* HELPER: Enable DSTN/FSTN */ +/*********************************************/ + +void +XGI_SetEnableDstn(XGI_Private *XGI_Pr, int enable) +{ + XGI_Pr->XGI_IF_DEF_DSTN = enable ? 1 : 0; +} + +void +XGI_SetEnableFstn(XGI_Private *XGI_Pr, int enable) +{ + XGI_Pr->XGI_IF_DEF_FSTN = enable ? 1 : 0; +} + +/*********************************************/ +/* HELPER: SET SEGMENT REGISTERS */ +/*********************************************/ +/* +static void +XGI_SetSegRegLower(XGI_Private *XGI_Pr, USHORT value) +{ + USHORT temp; + + value &= 0x00ff; + temp = XGI_GetRegByte(XGI_Pr->XGI_P3cb) & 0xf0; + temp |= (value >> 4); + XGI_SetRegByte(XGI_Pr->XGI_P3cb, temp); + temp = XGI_GetRegByte(XGI_Pr->XGI_P3cd) & 0xf0; + temp |= (value & 0x0f); + XGI_SetRegByte(XGI_Pr->XGI_P3cd, temp); +} + +static void +XGI_SetSegRegUpper(XGI_Private *XGI_Pr, USHORT value) +{ + USHORT temp; + + value &= 0x00ff; + temp = XGI_GetRegByte(XGI_Pr->XGI_P3cb) & 0x0f; + temp |= (value & 0xf0); + XGI_SetRegByte(XGI_Pr->XGI_P3cb, temp); + temp = XGI_GetRegByte(XGI_Pr->XGI_P3cd) & 0x0f; + temp |= (value << 4); + XGI_SetRegByte(XGI_Pr->XGI_P3cd, temp); +} + +static void +XGI_SetSegmentReg(XGI_Private *XGI_Pr, USHORT value) +{ + XGI_SetSegRegLower(XGI_Pr, value); + XGI_SetSegRegUpper(XGI_Pr, value); +} + +static void +XGI_ResetSegmentReg(XGI_Private *XGI_Pr) +{ + XGI_SetSegmentReg(XGI_Pr, 0); +} + +static void +XGI_SetSegmentRegOver(XGI_Private *XGI_Pr, USHORT value) +{ + USHORT temp = value >> 8; + + temp &= 0x07; + temp |= (temp << 4); + XGI_SetReg(XGI_Pr->XGI_P3c4,0x1d,temp); + XGI_SetSegmentReg(XGI_Pr, value); +} + +static void +XGI_ResetSegmentRegOver(XGI_Private *XGI_Pr) +{ + XGI_SetSegmentRegOver(XGI_Pr, 0); +} +*/ +/*********************************************/ +/* HELPER: GetVBType */ +/*********************************************/ + +void +XGI_New_GetVBType(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo) +{ + USHORT flag=0, rev=0, nolcd=0; + + XGI_Pr->XGI_VBType = 0; + + if((XGI_Pr->XGI_IF_DEF_LVDS) || (XGI_Pr->XGI_IF_DEF_CONEX)) + return; + + flag = XGI_GetReg(XGI_Pr->XGI_Part4Port,0x00); + + if(flag > 3) return; + + rev = XGI_GetReg(XGI_Pr->XGI_Part4Port,0x01); + + if(flag >= 2) { + XGI_Pr->XGI_VBType = VB_XGI302B; + } else if(flag == 1) { + if(rev >= 0xC0) { + XGI_Pr->XGI_VBType = VB_XGI301C; + } else if(rev >= 0xB0) { + XGI_Pr->XGI_VBType = VB_XGI301B; + /* Check if 30xB DH version (no LCD support, use Panel Link instead) */ + nolcd = XGI_GetReg(XGI_Pr->XGI_Part4Port,0x23); + if(!(nolcd & 0x02)) XGI_Pr->XGI_VBType |= VB_NoLCD; + } else { + XGI_Pr->XGI_VBType = VB_XGI301; + } + } + if(XGI_Pr->XGI_VBType & (VB_XGI301B | VB_XGI301C | VB_XGI302B)) { + if(rev >= 0xE0) { + flag = XGI_GetReg(XGI_Pr->XGI_Part4Port,0x39); + if(flag == 0xff) XGI_Pr->XGI_VBType = VB_XGI302LV; + else XGI_Pr->XGI_VBType = VB_XGI302ELV; + } else if(rev >= 0xD0) { + XGI_Pr->XGI_VBType = VB_XGI301LV; + } + } +} + +/*********************************************/ +/* HELPER: Check RAM size */ +/*********************************************/ + +#ifndef LINUX_XF86 +static BOOLEAN +XGI_CheckMemorySize(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, + USHORT ModeNo, USHORT ModeIdIndex) +{ + USHORT memorysize,modeflag; + ULONG temp; + + if(XGI_Pr->UseCustomMode) { + modeflag = XGI_Pr->CModeFlag; + } else { + if(ModeNo <= 0x13) { + modeflag = XGI_Pr->XGI_SModeIDTable[ModeIdIndex].St_ModeFlag; + } else { + modeflag = XGI_Pr->XGI_EModeIDTable[ModeIdIndex].Ext_ModeFlag; + } + } + + memorysize = modeflag & MemoryInfoFlag; + memorysize >>= MemorySizeShift; /* Get required memory size */ + memorysize++; + + temp = GetDRAMSize(XGI_Pr, HwInfo); /* Get adapter memory size (in MB) */ + temp /= (1024*1024); + + if(temp < memorysize) return(FALSE); + else return(TRUE); +} +#endif + +/*********************************************/ +/* HELPER: ClearBuffer */ +/*********************************************/ + +#ifndef LINUX_XF86 +static void +XGI_ClearBuffer(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, USHORT ModeNo) +{ + UCHAR *VideoMemoryAddress = HwInfo->pjVideoMemoryAddress; + ULONG AdapterMemorySize = (ULONG)HwInfo->ulVideoMemorySize; + USHORT *pBuffer; + int i; + + if(XGI_Pr->XGI_ModeType >= ModeEGA) { + if(ModeNo > 0x13) { + AdapterMemorySize = GetDRAMSize(XGI_Pr, HwInfo); + XGI_SetMemory(VideoMemoryAddress,AdapterMemorySize,0); + } else { + pBuffer = (USHORT *)VideoMemoryAddress; + for(i=0; i<0x4000; i++) + pBuffer[i] = 0x0000; + } + } else { + pBuffer = (USHORT *)VideoMemoryAddress; + if(XGI_Pr->XGI_ModeType < ModeCGA) { + for(i=0; i<0x4000; i++) + pBuffer[i] = 0x0720; + } else { + XGI_SetMemory(VideoMemoryAddress,0x8000,0); + } + } +} +#endif + +/*********************************************/ +/* HELPER: SearchModeID */ +/*********************************************/ + +BOOLEAN +XGI_New_SearchModeID(XGI_Private *XGI_Pr, USHORT *ModeNo, USHORT *ModeIdIndex) +{ + UCHAR VGAINFO = XGI_Pr->XGI_VGAINFO; + + if(*ModeNo <= 0x13) { + + if((*ModeNo) <= 0x05) (*ModeNo) |= 0x01; + + for(*ModeIdIndex = 0; ;(*ModeIdIndex)++) { + if(XGI_Pr->XGI_SModeIDTable[*ModeIdIndex].St_ModeID == (*ModeNo)) break; + if(XGI_Pr->XGI_SModeIDTable[*ModeIdIndex].St_ModeID == 0xFF) return FALSE; + } + + if(*ModeNo == 0x07) { + if(VGAINFO & 0x10) (*ModeIdIndex)++; /* 400 lines */ + /* else 350 lines */ + } + if(*ModeNo <= 0x03) { + if(!(VGAINFO & 0x80)) (*ModeIdIndex)++; + if(VGAINFO & 0x10) (*ModeIdIndex)++; /* 400 lines */ + /* else 350 lines */ + } + /* else 200 lines */ + + } else { + + for(*ModeIdIndex = 0; ;(*ModeIdIndex)++) { + if(XGI_Pr->XGI_EModeIDTable[*ModeIdIndex].Ext_ModeID == (*ModeNo)) break; + if(XGI_Pr->XGI_EModeIDTable[*ModeIdIndex].Ext_ModeID == 0xFF) return FALSE; + } + + } + return TRUE; +} + +/*********************************************/ +/* HELPER: GetModePtr */ +/*********************************************/ + +UCHAR +XGI_New_GetModePtr(XGI_Private *XGI_Pr, USHORT ModeNo, USHORT ModeIdIndex) +{ + UCHAR index; + + if(ModeNo <= 0x13) { + index = XGI_Pr->XGI_SModeIDTable[ModeIdIndex].St_StTableIndex; + } else { + if(XGI_Pr->XGI_ModeType <= 0x02) index = 0x1B; /* 02 -> ModeEGA */ + else index = 0x0F; + } + return index; +} + +/*********************************************/ +/* HELPER: LowModeTests */ +/*********************************************/ + +static BOOLEAN +XGI_DoLowModeTest(XGI_Private *XGI_Pr, USHORT ModeNo, PXGI_HW_DEVICE_INFO HwInfo) +{ + USHORT temp,temp1,temp2; + + if((ModeNo != 0x03) && (ModeNo != 0x10) && (ModeNo != 0x12)) + return(1); + temp = XGI_GetReg(XGI_Pr->XGI_P3d4,0x11); + XGI_SetRegOR(XGI_Pr->XGI_P3d4,0x11,0x80); + temp1 = XGI_GetReg(XGI_Pr->XGI_P3d4,0x00); + XGI_SetReg(XGI_Pr->XGI_P3d4,0x00,0x55); + temp2 = XGI_GetReg(XGI_Pr->XGI_P3d4,0x00); + XGI_SetReg(XGI_Pr->XGI_P3d4,0x00,temp1); + XGI_SetReg(XGI_Pr->XGI_P3d4,0x11,temp); + if((HwInfo->jChipType >= XGI_315H) || + (HwInfo->jChipType == XGI_300)) { + if(temp2 == 0x55) return(0); + else return(1); + } else { + if(temp2 != 0x55) return(1); + else { + XGI_SetRegOR(XGI_Pr->XGI_P3d4,0x35,0x01); + return(0); + } + } +} + +static void +XGI_SetLowModeTest(XGI_Private *XGI_Pr, USHORT ModeNo, PXGI_HW_DEVICE_INFO HwInfo) +{ + if(XGI_DoLowModeTest(XGI_Pr, ModeNo, HwInfo)) { + XGI_Pr->XGI_SetFlag |= LowModeTests; + } +} + +static void +XGI_HandleCRT1(XGI_Private *XGI_Pr) +{ + XGI_SetRegAND(XGI_Pr->XGI_P3d4,XGI_Pr->XGI_MyCR63,0xbf); +} + +/*********************************************/ +/* HELPER: GetColorDepth */ +/*********************************************/ + +USHORT +XGI_New_GetColorDepth(XGI_Private *XGI_Pr, USHORT ModeNo, USHORT ModeIdIndex) +{ + USHORT ColorDepth[6] = { 1, 2, 4, 4, 6, 8}; + SHORT index; + USHORT modeflag; + + /* Do NOT check UseCustomMode, will skrew up FIFO */ + if(ModeNo == 0xfe) { + modeflag = XGI_Pr->CModeFlag; + } else { + if(ModeNo <= 0x13) + modeflag = XGI_Pr->XGI_SModeIDTable[ModeIdIndex].St_ModeFlag; + else + modeflag = XGI_Pr->XGI_EModeIDTable[ModeIdIndex].Ext_ModeFlag; + } + + index = (modeflag & ModeInfoFlag) - ModeEGA; + if(index < 0) index = 0; + return(ColorDepth[index]); +} + +/*********************************************/ +/* HELPER: GetOffset */ +/*********************************************/ + +USHORT +XGI_New_GetOffset(XGI_Private *XGI_Pr,USHORT ModeNo,USHORT ModeIdIndex, + USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwInfo) +{ + USHORT xres, temp, colordepth, infoflag; + + if(XGI_Pr->UseCustomMode) { + infoflag = XGI_Pr->CInfoFlag; + xres = XGI_Pr->CHDisplay; + } else { + infoflag = XGI_Pr->XGI_RefIndex[RefreshRateTableIndex].Ext_InfoFlag; + xres = XGI_Pr->XGI_RefIndex[RefreshRateTableIndex].XRes; + } + + colordepth = XGI_New_GetColorDepth(XGI_Pr,ModeNo,ModeIdIndex); + + temp = xres / 16; + if(infoflag & InterlaceMode) temp <<= 1; + temp *= colordepth; + if(xres % 16) { + colordepth >>= 1; + temp += colordepth; + } + + return(temp); +} + +/*********************************************/ +/* SEQ */ +/*********************************************/ + +static void +XGI_New_SetSeqRegs(XGI_Private *XGI_Pr, USHORT StandTableIndex, PXGI_HW_DEVICE_INFO HwInfo) +{ + UCHAR SRdata; + USHORT i; + + XGI_SetReg(XGI_Pr->XGI_P3c4,0x00,0x03); /* Set SR0 */ + + SRdata = XGI_Pr->XGI_StandTable[StandTableIndex].SR[0]; + + if(XGI_Pr->XGI_VBType & VB_XGI301BLV302BLV) { + if(XGI_Pr->XGI_VBInfo & SetCRT2ToLCDA) { + SRdata |= 0x01; + } + if(HwInfo->jChipType >= XGI_661) { + if(XGI_Pr->XGI_VBInfo & (SetCRT2ToLCD | SetCRT2ToTV)) { + if(XGI_Pr->XGI_VBInfo & SetInSlaveMode) { + SRdata |= 0x01; /* 8 dot clock */ + } + } + } else if(XGI_Pr->XGI_VBInfo & SetCRT2ToLCD) { + if(XGI_Pr->XGI_VBType & VB_NoLCD) { + if(XGI_Pr->XGI_VBInfo & SetInSlaveMode) { + SRdata |= 0x01; /* 8 dot clock */ + } + } + } + } + + if(XGI_Pr->XGI_IF_DEF_LVDS == 1) { + if(XGI_Pr->XGI_IF_DEF_CH70xx != 0) { + if(XGI_Pr->XGI_VBInfo & SetCRT2ToTV) { + if(XGI_Pr->XGI_VBInfo & SetInSlaveMode) { + SRdata |= 0x01; /* 8 dot clock */ + } + } + } + if(XGI_Pr->XGI_VBInfo & SetCRT2ToLCD) { + if(XGI_Pr->XGI_VBInfo & SetInSlaveMode) { + SRdata |= 0x01; /* 8 dot clock */ + } + } + } + + SRdata |= 0x20; /* screen off */ + + XGI_SetReg(XGI_Pr->XGI_P3c4,0x01,SRdata); + + for(i = 2; i <= 4; i++) { + SRdata = XGI_Pr->XGI_StandTable[StandTableIndex].SR[i-1]; + XGI_SetReg(XGI_Pr->XGI_P3c4,i,SRdata); + } +} + +/*********************************************/ +/* MISC */ +/*********************************************/ + +static void +XGI_New_SetMiscRegs(XGI_Private *XGI_Pr, USHORT StandTableIndex, PXGI_HW_DEVICE_INFO HwInfo) +{ + UCHAR Miscdata; + + Miscdata = XGI_Pr->XGI_StandTable[StandTableIndex].MISC; + + if(HwInfo->jChipType < XGI_661) { + if(XGI_Pr->XGI_VBType & VB_XGI301BLV302BLV) { + if(XGI_Pr->XGI_VBInfo & SetCRT2ToLCDA) { + Miscdata |= 0x0C; + } + } + } + + XGI_SetRegByte(XGI_Pr->XGI_P3c2,Miscdata); +} + +/*********************************************/ +/* CRTC */ +/*********************************************/ + +static void +XGI_New_SetCRTCRegs(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, + USHORT StandTableIndex) +{ + UCHAR CRTCdata; + USHORT i; + + XGI_SetRegAND(XGI_Pr->XGI_P3d4,0x11,0x7f); /* Unlock CRTC */ + + for(i = 0; i <= 0x18; i++) { + CRTCdata = XGI_Pr->XGI_StandTable[StandTableIndex].CRTC[i]; + XGI_SetReg(XGI_Pr->XGI_P3d4,i,CRTCdata); /* Set CRTC(3d4) */ + } + +} + +/*********************************************/ +/* ATT */ +/*********************************************/ + +static void +XGI_New_SetATTRegs(XGI_Private *XGI_Pr, USHORT StandTableIndex, + PXGI_HW_DEVICE_INFO HwInfo) +{ + UCHAR ARdata; + USHORT i; + + for(i = 0; i <= 0x13; i++) { + ARdata = XGI_Pr->XGI_StandTable[StandTableIndex].ATTR[i]; + + if(i == 0x13) { + /* Pixel shift. If screen on LCD or TV is shifted left or right, + * this might be the cause. + */ + if(XGI_Pr->XGI_VBType & VB_XGI301BLV302BLV) { + if(XGI_Pr->XGI_VBInfo & SetCRT2ToLCDA) ARdata=0; + } + if(XGI_Pr->XGI_IF_DEF_LVDS == 1) { + if(XGI_Pr->XGI_IF_DEF_CH70xx != 0) { + if(XGI_Pr->XGI_VBInfo & SetCRT2ToTV) { + if(XGI_Pr->XGI_VBInfo & SetInSlaveMode) ARdata=0; + } + } + } + } + XGI_GetRegByte(XGI_Pr->XGI_P3da); /* reset 3da */ + XGI_SetRegByte(XGI_Pr->XGI_P3c0,i); /* set index */ + XGI_SetRegByte(XGI_Pr->XGI_P3c0,ARdata); /* set data */ + } + XGI_GetRegByte(XGI_Pr->XGI_P3da); /* reset 3da */ + XGI_SetRegByte(XGI_Pr->XGI_P3c0,0x14); /* set index */ + XGI_SetRegByte(XGI_Pr->XGI_P3c0,0x00); /* set data */ + + XGI_GetRegByte(XGI_Pr->XGI_P3da); + XGI_SetRegByte(XGI_Pr->XGI_P3c0,0x20); /* Enable Attribute */ + XGI_GetRegByte(XGI_Pr->XGI_P3da); +} + +/*********************************************/ +/* GRC */ +/*********************************************/ + +static void +XGI_New_SetGRCRegs(XGI_Private *XGI_Pr, USHORT StandTableIndex) +{ + UCHAR GRdata; + USHORT i; + + for(i = 0; i <= 0x08; i++) { + GRdata = XGI_Pr->XGI_StandTable[StandTableIndex].GRC[i]; + XGI_SetReg(XGI_Pr->XGI_P3ce,i,GRdata); + } + + if(XGI_Pr->XGI_ModeType > ModeVGA) { + /* 256 color disable */ + XGI_SetRegAND(XGI_Pr->XGI_P3ce,0x05,0xBF); + } +} + +/*********************************************/ +/* CLEAR EXTENDED REGISTERS */ +/*********************************************/ + +static void +XGI_New_ClearExt1Regs(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, USHORT ModeNo) +{ + USHORT i; + + for(i = 0x0A; i <= 0x0E; i++) { + XGI_SetReg(XGI_Pr->XGI_P3c4,i,0x00); + } + + if(HwInfo->jChipType >= XGI_315H) { + XGI_SetRegAND(XGI_Pr->XGI_P3c4,0x37,0xFE); + if(ModeNo <= 0x13) { + if(ModeNo == 0x06 || ModeNo >= 0x0e) { + XGI_SetReg(XGI_Pr->XGI_P3c4,0x0e,0x20); + } + } + } +} + +/*********************************************/ +/* RESET VCLK */ +/*********************************************/ + +static void +XGI_ResetCRT1VCLK(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo) +{ + if(HwInfo->jChipType >= XGI_315H) { + if(HwInfo->jChipType < XGI_661) { + if(XGI_Pr->XGI_IF_DEF_LVDS == 0) return; + } + } else { + if((XGI_Pr->XGI_IF_DEF_LVDS == 0) && + (!(XGI_Pr->XGI_VBType & VB_XGI301BLV302BLV)) ) { + return; + } + } + + if(HwInfo->jChipType >= XGI_315H) { + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x31,0xCF,0x20); + } else { + XGI_SetReg(XGI_Pr->XGI_P3c4,0x31,0x20); + } + XGI_SetReg(XGI_Pr->XGI_P3c4,0x2B,XGI_Pr->XGI_VCLKData[1].SR2B); + XGI_SetReg(XGI_Pr->XGI_P3c4,0x2C,XGI_Pr->XGI_VCLKData[1].SR2C); + XGI_SetReg(XGI_Pr->XGI_P3c4,0x2D,0x80); + if(HwInfo->jChipType >= XGI_315H) { + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x31,0xcf,0x10); + } else { + XGI_SetReg(XGI_Pr->XGI_P3c4,0x31,0x10); + } + XGI_SetReg(XGI_Pr->XGI_P3c4,0x2B,XGI_Pr->XGI_VCLKData[0].SR2B); + XGI_SetReg(XGI_Pr->XGI_P3c4,0x2C,XGI_Pr->XGI_VCLKData[0].SR2C); + XGI_SetReg(XGI_Pr->XGI_P3c4,0x2D,0x80); +} + +/*********************************************/ +/* SYNC */ +/*********************************************/ + +static void +XGI_SetCRT1Sync(XGI_Private *XGI_Pr, USHORT RefreshRateTableIndex) +{ + USHORT sync; + + if(XGI_Pr->UseCustomMode) { + sync = XGI_Pr->CInfoFlag >> 8; + } else { + sync = XGI_Pr->XGI_RefIndex[RefreshRateTableIndex].Ext_InfoFlag >> 8; + } + + sync &= 0xC0; + sync |= 0x2f; + XGI_SetRegByte(XGI_Pr->XGI_P3c2,sync); +} + +/*********************************************/ +/* CRTC/2 */ +/*********************************************/ + +static void +XGI_New_SetCRT1CRTC(XGI_Private *XGI_Pr, USHORT ModeNo, USHORT ModeIdIndex, + USHORT RefreshRateTableIndex, + PXGI_HW_DEVICE_INFO HwInfo) +{ + UCHAR index; + USHORT temp,i,j,modeflag; + + XGI_SetRegAND(XGI_Pr->XGI_P3d4,0x11,0x7f); /* unlock cr0-7 */ + + if(XGI_Pr->UseCustomMode) { + + modeflag = XGI_Pr->CModeFlag; + + for(i=0,j=0;i<=7;i++,j++) { + XGI_SetReg(XGI_Pr->XGI_P3d4,j,XGI_Pr->CCRT1CRTC[i]); + } + for(j=0x10;i<=10;i++,j++) { + XGI_SetReg(XGI_Pr->XGI_P3d4,j,XGI_Pr->CCRT1CRTC[i]); + } + for(j=0x15;i<=12;i++,j++) { + XGI_SetReg(XGI_Pr->XGI_P3d4,j,XGI_Pr->CCRT1CRTC[i]); + } + for(j=0x0A;i<=15;i++,j++) { + XGI_SetReg(XGI_Pr->XGI_P3c4,j,XGI_Pr->CCRT1CRTC[i]); + } + + temp = XGI_Pr->CCRT1CRTC[16] & 0xE0; + XGI_SetReg(XGI_Pr->XGI_P3c4,0x0E,temp); + + temp = (XGI_Pr->CCRT1CRTC[16] & 0x01) << 5; + if(modeflag & DoubleScanMode) temp |= 0x80; + XGI_SetRegANDOR(XGI_Pr->XGI_P3d4,0x09,0x5F,temp); + + } else { + + if(ModeNo <= 0x13) { + modeflag = XGI_Pr->XGI_SModeIDTable[ModeIdIndex].St_ModeFlag; + } else { + modeflag = XGI_Pr->XGI_EModeIDTable[ModeIdIndex].Ext_ModeFlag; + } + + index = XGI_Pr->XGI_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; + + for(i=0,j=0;i<=7;i++,j++) { + XGI_SetReg(XGI_Pr->XGI_P3d4,j,XGI_Pr->XGI_CRT1Table[index].CR[i]); + } + for(j=0x10;i<=10;i++,j++) { + XGI_SetReg(XGI_Pr->XGI_P3d4,j,XGI_Pr->XGI_CRT1Table[index].CR[i]); + } + for(j=0x15;i<=12;i++,j++) { + XGI_SetReg(XGI_Pr->XGI_P3d4,j,XGI_Pr->XGI_CRT1Table[index].CR[i]); + } + for(j=0x0A;i<=15;i++,j++) { + XGI_SetReg(XGI_Pr->XGI_P3c4,j,XGI_Pr->XGI_CRT1Table[index].CR[i]); + } + + temp = XGI_Pr->XGI_CRT1Table[index].CR[16] & 0xE0; + XGI_SetReg(XGI_Pr->XGI_P3c4,0x0E,temp); + + temp = ((XGI_Pr->XGI_CRT1Table[index].CR[16]) & 0x01) << 5; + if(modeflag & DoubleScanMode) temp |= 0x80; + XGI_SetRegANDOR(XGI_Pr->XGI_P3d4,0x09,0x5F,temp); + + } + + if(XGI_Pr->XGI_ModeType > ModeVGA) XGI_SetReg(XGI_Pr->XGI_P3d4,0x14,0x4F); +} + +/*********************************************/ +/* OFFSET & PITCH */ +/*********************************************/ +/* (partly overruled by SetPitch() in XF86) */ +/*********************************************/ + +static void +XGI_New_SetCRT1Offset(XGI_Private *XGI_Pr, USHORT ModeNo, USHORT ModeIdIndex, + USHORT RefreshRateTableIndex, + PXGI_HW_DEVICE_INFO HwInfo) +{ + USHORT temp, DisplayUnit, infoflag; + + if(XGI_Pr->UseCustomMode) { + infoflag = XGI_Pr->CInfoFlag; + } else { + infoflag = XGI_Pr->XGI_RefIndex[RefreshRateTableIndex].Ext_InfoFlag; + } + + DisplayUnit = XGI_New_GetOffset(XGI_Pr,ModeNo,ModeIdIndex, + RefreshRateTableIndex,HwInfo); + + temp = (DisplayUnit >> 8) & 0x0f; + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x0E,0xF0,temp); + + temp = DisplayUnit & 0xFF; + XGI_SetReg(XGI_Pr->XGI_P3d4,0x13,temp); + + if(infoflag & InterlaceMode) DisplayUnit >>= 1; + + DisplayUnit <<= 5; + temp = (DisplayUnit & 0xff00) >> 8; + if(DisplayUnit & 0xff) temp++; + temp++; + XGI_SetReg(XGI_Pr->XGI_P3c4,0x10,temp); +} + +/*********************************************/ +/* VCLK */ +/*********************************************/ + +static void +XGI_New_SetCRT1VCLK(XGI_Private *XGI_Pr, USHORT ModeNo, USHORT ModeIdIndex, + PXGI_HW_DEVICE_INFO HwInfo, USHORT RefreshRateTableIndex) +{ + USHORT index=0, clka, clkb; + + if(XGI_Pr->UseCustomMode) { + clka = XGI_Pr->CSR2B; + clkb = XGI_Pr->CSR2C; + } else { + if((XGI_Pr->XGI_VBType & VB_XGI301BLV302BLV) && (XGI_Pr->XGI_VBInfo & SetCRT2ToLCDA)) { + clka = XGI_Pr->XGI_VBVCLKData[index].Part4_A; + clkb = XGI_Pr->XGI_VBVCLKData[index].Part4_B; + } else { + clka = XGI_Pr->XGI_VCLKData[index].SR2B; + clkb = XGI_Pr->XGI_VCLKData[index].SR2C; + } + } + + if(HwInfo->jChipType >= XGI_315H) { + XGI_SetRegAND(XGI_Pr->XGI_P3c4,0x31,0xCF); + } else { + XGI_SetReg(XGI_Pr->XGI_P3c4,0x31,0x00); + } + + XGI_SetReg(XGI_Pr->XGI_P3c4,0x2B,clka); + XGI_SetReg(XGI_Pr->XGI_P3c4,0x2C,clkb); + + if(HwInfo->jChipType >= XGI_315H) { + XGI_SetReg(XGI_Pr->XGI_P3c4,0x2D,0x01); + } else { + XGI_SetReg(XGI_Pr->XGI_P3c4,0x2D,0x80); + } +} + +/*********************************************/ +/* MODE REGISTERS */ +/*********************************************/ + +static void +XGI_New_SetVCLKState(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, + USHORT ModeNo, USHORT RefreshRateTableIndex, + USHORT ModeIdIndex) +{ + USHORT data=0, VCLK=0, index=0; + + if(ModeNo > 0x13) { + if(XGI_Pr->UseCustomMode) { + VCLK = XGI_Pr->CSRClock; + } else { + VCLK = XGI_Pr->XGI_VCLKData[index].CLOCK; + } + } + + if(HwInfo->jChipType < XGI_315H) { + + if(VCLK > 150) data |= 0x80; + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x07,0x7B,data); + + data = 0x00; + if(VCLK >= 150) data |= 0x08; + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x32,0xF7,data); + + } else { + + if(VCLK >= 166) data |= 0x0c; + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x32,0xf3,data); + + if(VCLK >= 166) { + XGI_SetRegAND(XGI_Pr->XGI_P3c4,0x1f,0xe7); + } + } + + /* DAC speed */ + if(HwInfo->jChipType >= XGI_661) { + + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x07,0xE8,0x10); + + } else { + + data = 0x03; + if((VCLK >= 135) && (VCLK < 160)) data = 0x02; + else if((VCLK >= 160) && (VCLK < 260)) data = 0x01; + else if(VCLK >= 260) data = 0x00; + + if(HwInfo->jChipType < XGI_315H) { + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x07,0xFC,data); + } else { + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x07,0xF8,data); + } + + } +} + +static void +XGI_New_SetCRT1ModeRegs(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, + USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex) +{ + USHORT data,infoflag=0,modeflag; + USHORT resindex = 0,xres; + + if(XGI_Pr->UseCustomMode) { + modeflag = XGI_Pr->CModeFlag; + infoflag = XGI_Pr->CInfoFlag; + xres = XGI_Pr->CHDisplay; + } else { + if(ModeNo > 0x13) { + modeflag = XGI_Pr->XGI_EModeIDTable[ModeIdIndex].Ext_ModeFlag; + infoflag = XGI_Pr->XGI_RefIndex[RefreshRateTableIndex].Ext_InfoFlag; + xres = XGI_Pr->XGI_ModeResInfo[resindex].HTotal; + } else { + modeflag = XGI_Pr->XGI_SModeIDTable[ModeIdIndex].St_ModeFlag; + xres = XGI_Pr->XGI_StResInfo[resindex].HTotal; + } + } + + /* Disable DPMS */ + XGI_SetRegAND(XGI_Pr->XGI_P3c4,0x1F,0x3F); + + data = 0; + if(ModeNo > 0x13) { + if(XGI_Pr->XGI_ModeType > 0x02) { + data |= 0x02; + data |= ((XGI_Pr->XGI_ModeType - ModeVGA) << 2); + } + if(infoflag & InterlaceMode) data |= 0x20; + } + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x06,0xC0,data); + + if(HwInfo->jChipType != XGI_300) { + data = 0; + if(infoflag & InterlaceMode) { + if(xres <= 800) data = 0x0020; + else if(xres <= 1024) data = 0x0035; + else data = 0x0048; + } + XGI_SetReg(XGI_Pr->XGI_P3d4,0x19,(data & 0xFF)); + XGI_SetRegANDOR(XGI_Pr->XGI_P3d4,0x1a,0xFC,(data >> 8)); + } + + if(modeflag & HalfDCLK) { + XGI_SetRegOR(XGI_Pr->XGI_P3c4,0x01,0x08); + } + + data = 0; + if(modeflag & LineCompareOff) data = 0x08; + + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x0F,0xB7,data); + if(XGI_Pr->XGI_ModeType == ModeEGA) { + if(ModeNo > 0x13) { + XGI_SetRegOR(XGI_Pr->XGI_P3c4,0x0F,0x40); + } + } + + if(HwInfo->jChipType >= XGI_661) { + XGI_SetRegAND(XGI_Pr->XGI_P3c4,0x31,0xfb); + } + + data = 0x60; + if(XGI_Pr->XGI_ModeType != ModeText) { + data ^= 0x60; + if(XGI_Pr->XGI_ModeType != ModeEGA) { + data ^= 0xA0; + } + } + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x21,0x1F,data); + + XGI_New_SetVCLKState(XGI_Pr, HwInfo, ModeNo, RefreshRateTableIndex, ModeIdIndex); +} + +/*********************************************/ +/* LOAD DAC */ +/*********************************************/ + +static void +XGI_New_WriteDAC(XGI_Private *XGI_Pr, XGIIOADDRESS DACData, USHORT shiftflag, + USHORT dl, USHORT ah, USHORT al, USHORT dh) +{ + USHORT temp,bh,bl; + + bh = ah; + bl = al; + if(dl != 0) { + temp = bh; + bh = dh; + dh = temp; + if(dl == 1) { + temp = bl; + bl = dh; + dh = temp; + } else { + temp = bl; + bl = bh; + bh = temp; + } + } + if(shiftflag) { + dh <<= 2; + bh <<= 2; + bl <<= 2; + } + XGI_SetRegByte(DACData,(USHORT)dh); + XGI_SetRegByte(DACData,(USHORT)bh); + XGI_SetRegByte(DACData,(USHORT)bl); +} + +void +XGI_New_LoadDAC(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, + USHORT ModeNo, USHORT ModeIdIndex) +{ + USHORT data,data2; + USHORT time,i,j,k,m,n,o; + USHORT si,di,bx,dl,al,ah,dh; + USHORT shiftflag; + XGIIOADDRESS DACAddr, DACData; + const USHORT *table = NULL; + + if(ModeNo <= 0x13) { + data = XGI_Pr->XGI_SModeIDTable[ModeIdIndex].St_ModeFlag; + } else { + if(XGI_Pr->UseCustomMode) { + data = XGI_Pr->CModeFlag; + } else { + data = XGI_Pr->XGI_EModeIDTable[ModeIdIndex].Ext_ModeFlag; + } + } + + data &= DACInfoFlag; + time = 64; + if(data == 0x00) table = XGI_MDA_DAC; + if(data == 0x08) table = XGI_CGA_DAC; + if(data == 0x10) table = XGI_EGA_DAC; + if(data == 0x18) { + time = 256; + table = XGI_VGA_DAC; + } + if(time == 256) j = 16; + else j = time; + + if( ( (XGI_Pr->XGI_VBInfo & SetCRT2ToLCD) && /* 301B-DH LCD */ + (XGI_Pr->XGI_VBType & VB_NoLCD) ) || + (XGI_Pr->XGI_VBInfo & SetCRT2ToLCDA) || /* LCDA */ + (!(XGI_Pr->XGI_SetFlag & ProgrammingCRT2)) ) { /* Programming CRT1 */ + DACAddr = XGI_Pr->XGI_P3c8; + DACData = XGI_Pr->XGI_P3c9; + shiftflag = 0; + XGI_SetRegByte(XGI_Pr->XGI_P3c6,0xFF); + } else { + shiftflag = 1; + DACAddr = XGI_Pr->XGI_Part5Port; + DACData = XGI_Pr->XGI_Part5Port + 1; + } + + XGI_SetRegByte(DACAddr,0x00); + + for(i=0; i<j; i++) { + data = table[i]; + for(k=0; k<3; k++) { + data2 = 0; + if(data & 0x01) data2 = 0x2A; + if(data & 0x02) data2 += 0x15; + if(shiftflag) data2 <<= 2; + XGI_SetRegByte(DACData, data2); + data >>= 2; + } + } + + if(time == 256) { + for(i = 16; i < 32; i++) { + data = table[i]; + if(shiftflag) data <<= 2; + for(k = 0; k < 3; k++) XGI_SetRegByte(DACData, data); + } + si = 32; + for(m = 0; m < 9; m++) { + di = si; + bx = si + 4; + dl = 0; + for(n = 0; n < 3; n++) { + for(o = 0; o < 5; o++) { + dh = table[si]; + ah = table[di]; + al = table[bx]; + si++; + XGI_New_WriteDAC(XGI_Pr, DACData, shiftflag, dl, ah, al, dh); + } + si -= 2; + for(o = 0; o < 3; o++) { + dh = table[bx]; + ah = table[di]; + al = table[si]; + si--; + XGI_New_WriteDAC(XGI_Pr, DACData, shiftflag, dl, ah, al, dh); + } + dl++; + } /* for n < 3 */ + si += 5; + } /* for m < 9 */ + } +} + +/*********************************************/ +/* SET CRT1 REGISTER GROUP */ +/*********************************************/ + +static void +XGI_New_SetCRT1Group(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, + USHORT ModeNo, USHORT ModeIdIndex) +{ + USHORT StandTableIndex,RefreshRateTableIndex = 0 ; + + XGI_Pr->XGI_CRT1Mode = ModeNo; + StandTableIndex = XGI_New_GetModePtr(XGI_Pr, ModeNo, ModeIdIndex); +/* + if(XGI_Pr->XGI_SetFlag & LowModeTests) { + if(XGI_Pr->XGI_VBInfo & (SetSimuScanMode | SwitchCRT2)) { + XGI_New_DisableBridge(XGI_Pr, HwInfo); + } + } +*/ + XGI_New_SetSeqRegs(XGI_Pr, StandTableIndex, HwInfo); + XGI_New_SetMiscRegs(XGI_Pr, StandTableIndex, HwInfo); + XGI_New_SetCRTCRegs(XGI_Pr, HwInfo, StandTableIndex); + XGI_New_SetATTRegs(XGI_Pr, StandTableIndex, HwInfo); + XGI_New_SetGRCRegs(XGI_Pr, StandTableIndex); + XGI_New_ClearExt1Regs(XGI_Pr, HwInfo, ModeNo); + XGI_ResetCRT1VCLK(XGI_Pr, HwInfo); + + XGI_Pr->XGI_SelectCRT2Rate = 0; + XGI_Pr->XGI_SetFlag &= (~ProgrammingCRT2); + +#ifdef LINUX_XF86 + xf86DrvMsgVerb(0, X_PROBED, 4, "(init: VBType=0x%04x, VBInfo=0x%04x)\n", + XGI_Pr->XGI_VBType, XGI_Pr->XGI_VBInfo); +#endif + + if(XGI_Pr->XGI_VBInfo & SetSimuScanMode) { + if(XGI_Pr->XGI_VBInfo & SetInSlaveMode) { + XGI_Pr->XGI_SetFlag |= ProgrammingCRT2; + } + } + + if(XGI_Pr->XGI_VBInfo & SetCRT2ToLCDA) { + XGI_Pr->XGI_SetFlag |= ProgrammingCRT2; + } + + if(!(XGI_Pr->XGI_VBInfo & SetCRT2ToLCDA)) { + XGI_Pr->XGI_SetFlag &= ~ProgrammingCRT2; + } + + if(RefreshRateTableIndex != 0xFFFF) { + XGI_SetCRT1Sync(XGI_Pr, RefreshRateTableIndex); + XGI_New_SetCRT1CRTC(XGI_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo); + XGI_New_SetCRT1Offset(XGI_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo); + XGI_New_SetCRT1VCLK(XGI_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex); + } + + XGI_New_SetCRT1ModeRegs(XGI_Pr, HwInfo, ModeNo, ModeIdIndex, RefreshRateTableIndex); + + XGI_New_LoadDAC(XGI_Pr, HwInfo, ModeNo, ModeIdIndex); + +#ifndef LINUX_XF86 + if(XGI_Pr->XGI_flag_clearbuffer) { + XGI_ClearBuffer(XGI_Pr,HwInfo,ModeNo); + } +#endif +/* + if(!(XGI_Pr->XGI_VBInfo & (SetSimuScanMode | SwitchCRT2 | SetCRT2ToLCDA))) { + XGI_WaitRetrace1(XGI_Pr); + XGI_New_DisplayOn(XGI_Pr); + } +*/ +} + + + +/*********************************************/ +/* HELPER: RESET VIDEO BRIDGE */ +/*********************************************/ + +static void +XGI_ResetVB(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo) +{ + UCHAR *ROMAddr = HwInfo->pjVirtualRomBase; + USHORT temp; + + if(XGI_Pr->XGI_UseROM) { + if(HwInfo->jChipType < XGI_330) { + temp = ROMAddr[VB310Data_1_2_Offset] | 0x40; + if(XGI_Pr->XGI_ROMNew) temp = ROMAddr[0x80] | 0x40; + XGI_SetReg(XGI_Pr->XGI_Part1Port,0x02,temp); + } else if(HwInfo->jChipType >= XGI_661) { + temp = ROMAddr[0x7e]; + if(XGI_Pr->XGI_ROMNew) temp = ROMAddr[0x80]; + if(HwInfo->jChipType >= XGI_660) temp |= 0x40; + else if(XGI_GetReg(XGI_Pr->XGI_P3d4,0x7b) >= 100) temp |= 0x40; + XGI_SetReg(XGI_Pr->XGI_Part1Port,0x02,temp); + } + } +} + +/*********************************************/ +/* XFree86: SET SCREEN PITCH */ +/*********************************************/ + +#ifdef LINUX_XF86 +static void +XGI_SetPitchCRT1(XGI_Private *XGI_Pr, ScrnInfoPtr pScrn) +{ + XGIPtr pXGI = XGIPTR(pScrn); + UShort HDisplay = pXGI->scrnPitch >> 3; + + XGI_SetReg(XGI_Pr->XGI_P3d4,0x13,(HDisplay & 0xFF)); + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x0E,0xF0,(HDisplay>>8)); +} + +static void +XGI_SetPitch(XGI_Private *XGI_Pr, ScrnInfoPtr pScrn) +{ + XGIPtr pXGI = XGIPTR(pScrn); + BOOLEAN isslavemode = FALSE; + + /* We need to set pitch for CRT1 if bridge is in slave mode, too */ + if((pXGI->VBFlags & DISPTYPE_DISP1) || (isslavemode)) { + XGI_SetPitchCRT1(XGI_Pr, pScrn); + } +} +#endif + +/*********************************************/ +/* XGISetMode() */ +/*********************************************/ + +#ifdef LINUX_XF86 +/* We need pScrn for setting the pitch correctly */ +BOOLEAN +XGISetMode(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo,ScrnInfoPtr pScrn,USHORT ModeNo, BOOLEAN dosetpitch) +#else +BOOLEAN +XGISetMode(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo,USHORT ModeNo) +#endif +{ + USHORT ModeIdIndex; + XGIIOADDRESS BaseAddr = HwInfo->pjIOAddress; + unsigned char backupreg=0; +#ifndef LINUX_XF86 + USHORT KeepLockReg; + ULONG temp; + + XGI_Pr->UseCustomMode = FALSE; + XGI_Pr->CRT1UsesCustomMode = FALSE; +#endif + + if(XGI_Pr->UseCustomMode) { + ModeNo = 0xfe; + } + + XGIRegInit(XGI_Pr, BaseAddr); + XGI_GetSysFlags(XGI_Pr, HwInfo); + +#if defined(LINUX_XF86) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(__amd64__) || defined(__x86_64__)) + if(pScrn) XGI_Pr->XGI_VGAINFO = XGI_GetSetBIOSScratch(pScrn, 0x489, 0xff); + else +#endif + XGI_Pr->XGI_VGAINFO = 0x11; + + XGIInitPCIetc(XGI_Pr, HwInfo); + + XGI_Pr->XGI_flag_clearbuffer = 0; + + if(!XGI_Pr->UseCustomMode) { +#ifndef LINUX_XF86 + if(!(ModeNo & 0x80)) XGI_Pr->XGI_flag_clearbuffer = 1; +#endif + ModeNo &= 0x7f; + } + +#ifndef LINUX_XF86 + KeepLockReg = XGI_GetReg(XGI_Pr->XGI_P3c4,0x05); +#endif + XGI_SetReg(XGI_Pr->XGI_P3c4,0x05,0x86); + + if(!XGI_Pr->UseCustomMode) { + if(!(XGI_New_SearchModeID(XGI_Pr, &ModeNo, &ModeIdIndex))) return FALSE; + } else { + ModeIdIndex = 0; + } + + XGI_New_GetVBType(XGI_Pr, HwInfo); + + /* Init/restore some VB registers */ + + if(XGI_Pr->XGI_VBType & VB_XGI301BLV302BLV) { + if(HwInfo->jChipType >= XGI_315H) { + XGI_ResetVB(XGI_Pr, HwInfo); + XGI_SetRegOR(XGI_Pr->XGI_P3c4,0x32,0x10); + XGI_SetRegOR(XGI_Pr->XGI_Part2Port,0x00,0x0c); + backupreg = XGI_GetReg(XGI_Pr->XGI_P3d4,0x38); + } else { + backupreg = XGI_GetReg(XGI_Pr->XGI_P3d4,0x35); + } + (void)backupreg; + } + + /* Get VB information (connectors, connected devices) */ + XGI_SetLowModeTest(XGI_Pr, ModeNo, HwInfo); + +#ifndef LINUX_XF86 + /* 3. Check memory size (Kernel framebuffer driver only) */ + temp = XGI_CheckMemorySize(XGI_Pr, HwInfo, ModeNo, ModeIdIndex); + if(!temp) return(0); +#endif + + if(XGI_Pr->UseCustomMode) { + XGI_Pr->CRT1UsesCustomMode = TRUE; + XGI_Pr->CSRClock_CRT1 = XGI_Pr->CSRClock; + XGI_Pr->CModeFlag_CRT1 = XGI_Pr->CModeFlag; + } else { + XGI_Pr->CRT1UsesCustomMode = FALSE; + } + + /* Set mode on CRT1 */ + if( (XGI_Pr->XGI_VBInfo & (SetSimuScanMode | SetCRT2ToLCDA)) || + (!(XGI_Pr->XGI_VBInfo & SwitchCRT2)) ) { + XGI_New_SetCRT1Group(XGI_Pr, HwInfo, ModeNo, ModeIdIndex); + } + + XGI_HandleCRT1(XGI_Pr); + + XGI_New_DisplayOn(XGI_Pr); + XGI_SetRegByte(XGI_Pr->XGI_P3c6,0xFF); + +#ifdef LINUX_XF86 + if(pScrn) { + /* SetPitch: Adapt to virtual size & position */ + if((ModeNo > 0x13) && (dosetpitch)) { + XGI_SetPitch(XGI_Pr, pScrn); + } + + /* Backup/Set ModeNo in BIOS scratch area */ + XGI_GetSetModeID(pScrn, ModeNo); + } +#endif + +#ifndef LINUX_XF86 /* We never lock registers in XF86 */ + if(KeepLockReg == 0xA1) XGI_SetReg(XGI_Pr->XGI_P3c4,0x05,0x86); + else XGI_SetReg(XGI_Pr->XGI_P3c4,0x05,0x00); +#endif + + return TRUE; +} + +/*********************************************/ +/* XFree86: XGIBIOSSetMode() */ +/* for non-Dual-Head mode */ +/*********************************************/ + +#ifdef LINUX_XF86 +BOOLEAN +XGIBIOSSetMode(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, ScrnInfoPtr pScrn, DisplayModePtr mode, BOOLEAN IsCustom, BOOLEAN dosetpitch) +{ + XGIPtr pXGI = XGIPTR(pScrn); + UShort ModeNo=0; + BOOLEAN SetModeRet ; + UShort HDisplay = pXGI->scrnOffset >> 3 ; + + XGI_Pr->UseCustomMode = FALSE; + + if((IsCustom) && (XGI_CheckBuildCustomMode(pScrn, mode, pXGI->VBFlags))) { + + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting custom mode %dx%d\n", + XGI_Pr->CHDisplay, + (mode->Flags & V_INTERLACE ? XGI_Pr->CVDisplay * 2 : + (mode->Flags & V_DBLSCAN ? XGI_Pr->CVDisplay / 2 : + XGI_Pr->CVDisplay))); + + return(XGISetMode(XGI_Pr, HwInfo, pScrn, ModeNo, TRUE)); + + return(XGISetModeNew( HwInfo, ModeNo)); + + } + + ModeNo = XGI_CalcModeIndex(pScrn, mode, pXGI->VBFlags, pXGI->HaveCustomModes); + if(!ModeNo) return FALSE; + + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting standard mode 0x%x\n", ModeNo); + + PDEBUG(ErrorF("C code setmode: ModeNo: 0x%08lX \n",ModeNo)); + +/* PDEBUG(XGIDumpRegs(pScrn)) ; */ +/* + return(XGISetMode(XGI_Pr, HwInfo, pScrn, ModeNo, TRUE)); +*/ +/* +if( ModeNo <= 13 ) + outXGIIDXREG(XGISR, 0x20, 0x21); +else + outXGIIDXREG(XGISR, 0x20, 0xAD); +*/ +/* outXGIIDXREG(XGISR, 0x1E, 0xDA); */ + +SetModeRet = XGISetModeNew( HwInfo, ModeNo ); + +#ifdef LINUX_XF86 + if(pScrn) { + /* SetPitch: Adapt to virtual size & position */ + if((ModeNo > 0x13) && (dosetpitch)) { +/* XGI_SetPitch(XGI_Pr, pScrn); */ + XGI_SetReg(XGI_Pr->XGI_P3d4,0x13,(HDisplay & 0xFF)); + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x0E,0xF0,(HDisplay>>8)); + } + /* Backup/Set ModeNo in BIOS scratch area */ +/* XGI_GetSetModeID(pScrn, ModeNo); */ + } +#endif + + return SetModeRet ; +/* return (XGISetModeNew( HwInfo, ModeNo )); */ +} + +/*********************************************/ +/* XFree86: XGIBIOSSetModeCRT1() */ +/* for Dual-Head modes */ +/*********************************************/ + +BOOLEAN +XGIBIOSSetModeCRT1(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, ScrnInfoPtr pScrn, + DisplayModePtr mode, BOOLEAN IsCustom) +{ + XGIPtr pXGI = XGIPTR(pScrn); + XGIIOADDRESS BaseAddr = HwInfo->pjIOAddress; + USHORT ModeIdIndex, ModeNo=0; + UCHAR backupreg=0; +#ifdef XGIDUALHEAD + XGIEntPtr pXGIEnt = pXGI->entityPrivate; + UCHAR backupcr30, backupcr31, backupcr38, backupcr35, backupp40d=0; + BOOLEAN backupcustom; +#endif + + XGI_Pr->UseCustomMode = FALSE; + + if((IsCustom) && (XGI_CheckBuildCustomMode(pScrn, mode, pXGI->VBFlags))) { + + USHORT temptemp = XGI_Pr->CVDisplay; + + if(XGI_Pr->CModeFlag & DoubleScanMode) temptemp >>= 1; + else if(XGI_Pr->CInfoFlag & InterlaceMode) temptemp <<= 1; + + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "Setting custom mode %dx%d on CRT1\n", + XGI_Pr->CHDisplay, temptemp); + ModeNo = 0xfe; + + } else { + + ModeNo = XGI_CalcModeIndex(pScrn, mode, pXGI->VBFlags, pXGI->HaveCustomModes); + if(!ModeNo) return FALSE; + + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "Setting standard mode 0x%x on CRT1\n", ModeNo); + } + + XGIRegInit(XGI_Pr, BaseAddr); + XGI_GetSysFlags(XGI_Pr, HwInfo); +#if (defined(i386) || defined(__i386) || defined(__i386__) || defined(__AMD64__)) + XGI_Pr->XGI_VGAINFO = XGI_GetSetBIOSScratch(pScrn, 0x489, 0xff); +#else + XGI_Pr->XGI_VGAINFO = 0x11; +#endif + XGIInitPCIetc(XGI_Pr, HwInfo); + + /* We don't clear the buffer under X */ + XGI_Pr->XGI_flag_clearbuffer = 0; + + XGI_SetReg(XGI_Pr->XGI_P3c4,0x05,0x86); + + if(!XGI_Pr->UseCustomMode) { + if(!(XGI_New_SearchModeID(XGI_Pr, &ModeNo, &ModeIdIndex))) return FALSE; + } else { + ModeIdIndex = 0; + } + + /* Determine VBType */ + XGI_New_GetVBType(XGI_Pr, HwInfo); + + if(XGI_Pr->XGI_VBType & VB_XGI301BLV302BLV) { + if(HwInfo->jChipType >= XGI_315H) { + backupreg = XGI_GetReg(XGI_Pr->XGI_P3d4,0x38); + } else { + backupreg = XGI_GetReg(XGI_Pr->XGI_P3d4,0x35); + } + (void)backupreg; + } + + /* Get VB information (connectors, connected devices) */ + /* (We don't care if the current mode is a CRT2 mode) */ + XGI_SetLowModeTest(XGI_Pr, ModeNo, HwInfo); + + /* Set mode on CRT1 */ + XGI_New_SetCRT1Group(XGI_Pr, HwInfo, ModeNo, ModeIdIndex); + /* SetPitch: Adapt to virtual size & position */ + XGI_SetPitchCRT1(XGI_Pr, pScrn); + +#ifdef XGIDUALHEAD + if(pXGI->DualHeadMode) { + pXGIEnt->CRT1ModeNo = ModeNo; + pXGIEnt->CRT1DMode = mode; + } +#endif + + if(XGI_Pr->UseCustomMode) { + XGI_Pr->CRT1UsesCustomMode = TRUE; + XGI_Pr->CSRClock_CRT1 = XGI_Pr->CSRClock; + XGI_Pr->CModeFlag_CRT1 = XGI_Pr->CModeFlag; + } else { + XGI_Pr->CRT1UsesCustomMode = FALSE; + } + + /* Reset CRT2 if changing mode on CRT1 */ +#ifdef XGIDUALHEAD + if(pXGI->DualHeadMode) { + if(pXGIEnt->CRT2ModeNo != -1) { + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "(Re-)Setting mode for CRT2\n"); + backupcustom = XGI_Pr->UseCustomMode; + backupcr30 = XGI_GetReg(XGI_Pr->XGI_P3d4,0x30); + backupcr31 = XGI_GetReg(XGI_Pr->XGI_P3d4,0x31); + backupcr35 = XGI_GetReg(XGI_Pr->XGI_P3d4,0x35); + backupcr38 = XGI_GetReg(XGI_Pr->XGI_P3d4,0x38); + if(XGI_Pr->XGI_VBType & VB_XGIVB) { + /* Backup LUT-enable */ + if(pXGIEnt->CRT2ModeSet) { + backupp40d = XGI_GetReg(XGI_Pr->XGI_Part4Port,0x0d) & 0x08; + } + } + if(XGI_Pr->XGI_VBInfo & SetCRT2ToLCDA) { + XGI_SetReg(XGI_Pr->XGI_P3d4,0x30,pXGIEnt->CRT2CR30); + XGI_SetReg(XGI_Pr->XGI_P3d4,0x31,pXGIEnt->CRT2CR31); + XGI_SetReg(XGI_Pr->XGI_P3d4,0x35,pXGIEnt->CRT2CR35); + XGI_SetReg(XGI_Pr->XGI_P3d4,0x38,pXGIEnt->CRT2CR38); + } + + XGI_SetReg(XGI_Pr->XGI_P3d4,0x30,backupcr30); + XGI_SetReg(XGI_Pr->XGI_P3d4,0x31,backupcr31); + XGI_SetReg(XGI_Pr->XGI_P3d4,0x35,backupcr35); + XGI_SetReg(XGI_Pr->XGI_P3d4,0x38,backupcr38); + if(XGI_Pr->XGI_VBType & VB_XGIVB) { + XGI_SetRegANDOR(XGI_Pr->XGI_Part4Port,0x0d, ~0x08, backupp40d); + } + XGI_Pr->UseCustomMode = backupcustom; + } + } +#endif + + /* Warning: From here, the custom mode entries in XGI_Pr are + * possibly overwritten + */ + + XGI_HandleCRT1(XGI_Pr); + + XGI_New_DisplayOn(XGI_Pr); + XGI_SetRegByte(XGI_Pr->XGI_P3c6,0xFF); + + /* Backup/Set ModeNo in BIOS scratch area */ + XGI_GetSetModeID(pScrn,ModeNo); + + return TRUE; +} +#endif /* Linux_XF86 */ + +#ifndef GETBITSTR +#define BITMASK(h,l) (((unsigned)(1U << ((h)-(l)+1))-1)<<(l)) +#define GENMASK(mask) BITMASK(1?mask,0?mask) +#define GETBITS(var,mask) (((var) & GENMASK(mask)) >> (0?mask)) +#define GETBITSTR(val,from,to) ((GETBITS(val,from)) << (0?to)) +#endif + +static void +XGI_CalcCRRegisters(XGI_Private *XGI_Pr, int depth) +{ + XGI_Pr->CCRT1CRTC[0] = ((XGI_Pr->CHTotal >> 3) - 5) & 0xff; /* CR0 */ + XGI_Pr->CCRT1CRTC[1] = (XGI_Pr->CHDisplay >> 3) - 1; /* CR1 */ + XGI_Pr->CCRT1CRTC[2] = (XGI_Pr->CHBlankStart >> 3) - 1; /* CR2 */ + XGI_Pr->CCRT1CRTC[3] = (((XGI_Pr->CHBlankEnd >> 3) - 1) & 0x1F) | 0x80; /* CR3 */ + XGI_Pr->CCRT1CRTC[4] = (XGI_Pr->CHSyncStart >> 3) + 3; /* CR4 */ + XGI_Pr->CCRT1CRTC[5] = ((((XGI_Pr->CHBlankEnd >> 3) - 1) & 0x20) << 2) | /* CR5 */ + (((XGI_Pr->CHSyncEnd >> 3) + 3) & 0x1F); + + XGI_Pr->CCRT1CRTC[6] = (XGI_Pr->CVTotal - 2) & 0xFF; /* CR6 */ + XGI_Pr->CCRT1CRTC[7] = (((XGI_Pr->CVTotal - 2) & 0x100) >> 8) /* CR7 */ + | (((XGI_Pr->CVDisplay - 1) & 0x100) >> 7) + | ((XGI_Pr->CVSyncStart & 0x100) >> 6) + | (((XGI_Pr->CVBlankStart - 1) & 0x100) >> 5) + | 0x10 + | (((XGI_Pr->CVTotal - 2) & 0x200) >> 4) + | (((XGI_Pr->CVDisplay - 1) & 0x200) >> 3) + | ((XGI_Pr->CVSyncStart & 0x200) >> 2); + + XGI_Pr->CCRT1CRTC[16] = ((((XGI_Pr->CVBlankStart - 1) & 0x200) >> 4) >> 5); /* CR9 */ + + if(depth != 8) { + if(XGI_Pr->CHDisplay >= 1600) XGI_Pr->CCRT1CRTC[16] |= 0x60; /* SRE */ + else if(XGI_Pr->CHDisplay >= 640) XGI_Pr->CCRT1CRTC[16] |= 0x40; + } + + XGI_Pr->CCRT1CRTC[8] = (XGI_Pr->CVSyncStart ) & 0xFF; /* CR10 */ + XGI_Pr->CCRT1CRTC[9] = ((XGI_Pr->CVSyncEnd ) & 0x0F) | 0x80; /* CR11 */ + XGI_Pr->CCRT1CRTC[10] = (XGI_Pr->CVDisplay - 1) & 0xFF; /* CR12 */ + XGI_Pr->CCRT1CRTC[11] = (XGI_Pr->CVBlankStart - 1) & 0xFF; /* CR15 */ + XGI_Pr->CCRT1CRTC[12] = (XGI_Pr->CVBlankEnd - 1) & 0xFF; /* CR16 */ + + XGI_Pr->CCRT1CRTC[13] = /* SRA */ + GETBITSTR((XGI_Pr->CVTotal -2), 10:10, 0:0) | + GETBITSTR((XGI_Pr->CVDisplay -1), 10:10, 1:1) | + GETBITSTR((XGI_Pr->CVBlankStart-1), 10:10, 2:2) | + GETBITSTR((XGI_Pr->CVSyncStart ), 10:10, 3:3) | + GETBITSTR((XGI_Pr->CVBlankEnd -1), 8:8, 4:4) | + GETBITSTR((XGI_Pr->CVSyncEnd ), 4:4, 5:5) ; + + XGI_Pr->CCRT1CRTC[14] = /* SRB */ + GETBITSTR((XGI_Pr->CHTotal >> 3) - 5, 9:8, 1:0) | + GETBITSTR((XGI_Pr->CHDisplay >> 3) - 1, 9:8, 3:2) | + GETBITSTR((XGI_Pr->CHBlankStart >> 3) - 1, 9:8, 5:4) | + GETBITSTR((XGI_Pr->CHSyncStart >> 3) + 3, 9:8, 7:6) ; + + + XGI_Pr->CCRT1CRTC[15] = /* SRC */ + GETBITSTR((XGI_Pr->CHBlankEnd >> 3) - 1, 7:6, 1:0) | + GETBITSTR((XGI_Pr->CHSyncEnd >> 3) + 3, 5:5, 2:2) ; +} + +void +XGI_CalcLCDACRT1Timing(XGI_Private *XGI_Pr,USHORT ModeNo,USHORT ModeIdIndex) +{ + USHORT modeflag, tempax, tempbx, VGAHDE = XGI_Pr->XGI_VGAHDE; + int i,j; + + /* 1:1 data: use data set by setcrt1crtc() */ + if(XGI_Pr->XGI_LCDInfo & LCDPass11) return; + + if(ModeNo <= 0x13) { + modeflag = XGI_Pr->XGI_SModeIDTable[ModeIdIndex].St_ModeFlag; + } else if(XGI_Pr->UseCustomMode) { + modeflag = XGI_Pr->CModeFlag; + } else { + modeflag = XGI_Pr->XGI_EModeIDTable[ModeIdIndex].Ext_ModeFlag; + } + + if(modeflag & HalfDCLK) VGAHDE >>= 1; + + XGI_Pr->CHDisplay = VGAHDE; + XGI_Pr->CHBlankStart = VGAHDE; + + XGI_Pr->CVDisplay = XGI_Pr->XGI_VGAVDE; + XGI_Pr->CVBlankStart = XGI_Pr->XGI_VGAVDE; + + tempbx = XGI_Pr->PanelHT - XGI_Pr->PanelXRes; + tempax = XGI_Pr->XGI_VGAHDE; /* not /2 ! */ + if(XGI_Pr->XGI_LCDInfo & DontExpandLCD) { + tempax = XGI_Pr->PanelXRes; + } + tempbx += tempax; + if(modeflag & HalfDCLK) tempbx -= VGAHDE; + XGI_Pr->CHTotal = XGI_Pr->CHBlankEnd = tempbx; + + tempax = VGAHDE; + tempbx = XGI_Pr->CHTotal; + if(XGI_Pr->XGI_LCDInfo & DontExpandLCD) { + tempbx = XGI_Pr->PanelXRes; + if(modeflag & HalfDCLK) tempbx >>= 1; + tempax += ((tempbx - tempax) >> 1); + } + + tempax += XGI_Pr->PanelHRS; + XGI_Pr->CHSyncStart = tempax; + tempax += XGI_Pr->PanelHRE; + XGI_Pr->CHSyncEnd = tempax; + + tempbx = XGI_Pr->PanelVT - XGI_Pr->PanelYRes; + tempax = XGI_Pr->XGI_VGAVDE; + if(XGI_Pr->XGI_LCDInfo & DontExpandLCD) { + tempax = XGI_Pr->PanelYRes; + } + XGI_Pr->CVTotal = XGI_Pr->CVBlankEnd = tempbx + tempax; + + tempax = XGI_Pr->XGI_VGAVDE; + if(XGI_Pr->XGI_LCDInfo & DontExpandLCD) { + tempax += (XGI_Pr->PanelYRes - tempax) >> 1; + } + tempax += XGI_Pr->PanelVRS; + XGI_Pr->CVSyncStart = tempax; + tempax += XGI_Pr->PanelVRE; + XGI_Pr->CVSyncEnd = tempax; + + XGI_CalcCRRegisters(XGI_Pr, 8); + XGI_Pr->CCRT1CRTC[16] &= ~0xE0; + + XGI_SetRegAND(XGI_Pr->XGI_P3d4,0x11,0x7f); + + for(i=0,j=0;i<=7;i++,j++) { + XGI_SetReg(XGI_Pr->XGI_P3d4,j,XGI_Pr->CCRT1CRTC[i]); + } + for(j=0x10;i<=10;i++,j++) { + XGI_SetReg(XGI_Pr->XGI_P3d4,j,XGI_Pr->CCRT1CRTC[i]); + } + for(j=0x15;i<=12;i++,j++) { + XGI_SetReg(XGI_Pr->XGI_P3d4,j,XGI_Pr->CCRT1CRTC[i]); + } + for(j=0x0A;i<=15;i++,j++) { + XGI_SetReg(XGI_Pr->XGI_P3c4,j,XGI_Pr->CCRT1CRTC[i]); + } + + tempax = XGI_Pr->CCRT1CRTC[16] & 0xE0; + XGI_SetRegANDOR(XGI_Pr->XGI_P3c4,0x0E,0x1F,tempax); + + tempax = (XGI_Pr->CCRT1CRTC[16] & 0x01) << 5; + if(modeflag & DoubleScanMode) tempax |= 0x80; + XGI_SetRegANDOR(XGI_Pr->XGI_P3d4,0x09,0x5F,tempax); + +#ifdef TWDEBUG + xf86DrvMsg(0, X_INFO, "%d %d %d %d %d %d %d %d (%d %d %d %d)\n", + XGI_Pr->CHDisplay, XGI_Pr->CHSyncStart, XGI_Pr->CHSyncEnd, XGI_Pr->CHTotal, + XGI_Pr->CVDisplay, XGI_Pr->CVSyncStart, XGI_Pr->CVSyncEnd, XGI_Pr->CVTotal, + XGI_Pr->CHBlankStart, XGI_Pr->CHBlankEnd, XGI_Pr->CVBlankStart, XGI_Pr->CVBlankEnd); + + xf86DrvMsg(0, X_INFO, " {{0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", + XGI_Pr->CCRT1CRTC[0], XGI_Pr->CCRT1CRTC[1], + XGI_Pr->CCRT1CRTC[2], XGI_Pr->CCRT1CRTC[3], + XGI_Pr->CCRT1CRTC[4], XGI_Pr->CCRT1CRTC[5], + XGI_Pr->CCRT1CRTC[6], XGI_Pr->CCRT1CRTC[7]); + xf86DrvMsg(0, X_INFO, " 0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", + XGI_Pr->CCRT1CRTC[8], XGI_Pr->CCRT1CRTC[9], + XGI_Pr->CCRT1CRTC[10], XGI_Pr->CCRT1CRTC[11], + XGI_Pr->CCRT1CRTC[12], XGI_Pr->CCRT1CRTC[13], + XGI_Pr->CCRT1CRTC[14], XGI_Pr->CCRT1CRTC[15]); + xf86DrvMsg(0, X_INFO, " 0x%02x}},\n", XGI_Pr->CCRT1CRTC[16]); +#endif +} + +/* ================ XFREE86 ================= */ + +/* Helper functions */ + +#ifdef LINUX_XF86 + +USHORT +XGI_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int VBFlags) +{ + XGIPtr pXGI = XGIPTR(pScrn); + int out_n, out_dn, out_div, out_sbit, out_scale; + int depth = pXGI->CurrentLayout.bitsPerPixel; + unsigned int vclk[5]; + +#define Midx 0 +#define Nidx 1 +#define VLDidx 2 +#define Pidx 3 +#define PSNidx 4 + + pXGI->XGI_Pr->CModeFlag = 0; + + pXGI->XGI_Pr->CDClock = mode->Clock; + + pXGI->XGI_Pr->CHDisplay = mode->HDisplay; + pXGI->XGI_Pr->CHSyncStart = mode->HSyncStart; + pXGI->XGI_Pr->CHSyncEnd = mode->HSyncEnd; + pXGI->XGI_Pr->CHTotal = mode->HTotal; + + pXGI->XGI_Pr->CVDisplay = mode->VDisplay; + pXGI->XGI_Pr->CVSyncStart = mode->VSyncStart; + pXGI->XGI_Pr->CVSyncEnd = mode->VSyncEnd; + pXGI->XGI_Pr->CVTotal = mode->VTotal; + + pXGI->XGI_Pr->CFlags = mode->Flags; + + if(pXGI->XGI_Pr->CFlags & V_INTERLACE) { + pXGI->XGI_Pr->CVDisplay >>= 1; + pXGI->XGI_Pr->CVSyncStart >>= 1; + pXGI->XGI_Pr->CVSyncEnd >>= 1; + pXGI->XGI_Pr->CVTotal >>= 1; + } + if(pXGI->XGI_Pr->CFlags & V_DBLSCAN) { + /* pXGI->XGI_Pr->CDClock <<= 1; */ + pXGI->XGI_Pr->CVDisplay <<= 1; + pXGI->XGI_Pr->CVSyncStart <<= 1; + pXGI->XGI_Pr->CVSyncEnd <<= 1; + pXGI->XGI_Pr->CVTotal <<= 1; + } + + pXGI->XGI_Pr->CHBlankStart = pXGI->XGI_Pr->CHDisplay; + pXGI->XGI_Pr->CHBlankEnd = pXGI->XGI_Pr->CHTotal; + pXGI->XGI_Pr->CVBlankStart = pXGI->XGI_Pr->CVSyncStart - 1; + pXGI->XGI_Pr->CVBlankEnd = pXGI->XGI_Pr->CVTotal; + + if(XGI_compute_vclk(pXGI->XGI_Pr->CDClock, &out_n, &out_dn, &out_div, &out_sbit, &out_scale)) { + pXGI->XGI_Pr->CSR2B = (out_div == 2) ? 0x80 : 0x00; + pXGI->XGI_Pr->CSR2B |= ((out_n - 1) & 0x7f); + pXGI->XGI_Pr->CSR2C = (out_dn - 1) & 0x1f; + pXGI->XGI_Pr->CSR2C |= (((out_scale - 1) & 3) << 5); + pXGI->XGI_Pr->CSR2C |= ((out_sbit & 0x01) << 7); +#ifdef TWDEBUG + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Clock %d: n %d dn %d div %d sb %d sc %d\n", + pXGI->XGI_Pr->CDClock, out_n, out_dn, out_div, out_sbit, out_scale); +#endif + } else { + XGICalcClock(pScrn, pXGI->XGI_Pr->CDClock, 2, vclk); + pXGI->XGI_Pr->CSR2B = (vclk[VLDidx] == 2) ? 0x80 : 0x00; + pXGI->XGI_Pr->CSR2B |= (vclk[Midx] - 1) & 0x7f; + pXGI->XGI_Pr->CSR2C = (vclk[Nidx] - 1) & 0x1f; + if(vclk[Pidx] <= 4) { + /* postscale 1,2,3,4 */ + pXGI->XGI_Pr->CSR2C |= ((vclk[Pidx] - 1) & 3) << 5; + } else { + /* postscale 6,8 */ + pXGI->XGI_Pr->CSR2C |= (((vclk[Pidx] / 2) - 1) & 3) << 5; + pXGI->XGI_Pr->CSR2C |= 0x80; + } +#ifdef TWDEBUG + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Clock %d: n %d dn %d div %d sc %d\n", + pXGI->XGI_Pr->CDClock, vclk[Midx], vclk[Nidx], vclk[VLDidx], vclk[Pidx]); +#endif + } + + pXGI->XGI_Pr->CSRClock = (pXGI->XGI_Pr->CDClock / 1000) + 1; + + XGI_CalcCRRegisters(pXGI->XGI_Pr, depth); + + switch(depth) { + case 8: pXGI->XGI_Pr->CModeFlag |= 0x223b; break; + case 16: pXGI->XGI_Pr->CModeFlag |= 0x227d; break; + case 32: pXGI->XGI_Pr->CModeFlag |= 0x22ff; break; + default: return 0; + } + + if(pXGI->XGI_Pr->CFlags & V_DBLSCAN) + pXGI->XGI_Pr->CModeFlag |= DoubleScanMode; + + if((pXGI->XGI_Pr->CVDisplay >= 1024) || + (pXGI->XGI_Pr->CVTotal >= 1024) || + (pXGI->XGI_Pr->CHDisplay >= 1024)) + pXGI->XGI_Pr->CModeFlag |= LineCompareOff; + + if(pXGI->XGI_Pr->CFlags & V_CLKDIV2) + pXGI->XGI_Pr->CModeFlag |= HalfDCLK; + + pXGI->XGI_Pr->CInfoFlag = 0x0007; + + if(pXGI->XGI_Pr->CFlags & V_NHSYNC) + pXGI->XGI_Pr->CInfoFlag |= 0x4000; + + if(pXGI->XGI_Pr->CFlags & V_NVSYNC) + pXGI->XGI_Pr->CInfoFlag |= 0x8000; + + if(pXGI->XGI_Pr->CFlags & V_INTERLACE) + pXGI->XGI_Pr->CInfoFlag |= InterlaceMode; + + pXGI->XGI_Pr->UseCustomMode = TRUE; +#ifdef TWDEBUG + xf86DrvMsg(0, X_INFO, "Custom mode %dx%d:\n", + pXGI->XGI_Pr->CHDisplay,pXGI->XGI_Pr->CVDisplay); + xf86DrvMsg(0, X_INFO, "Modeflag %04x, Infoflag %04x\n", + pXGI->XGI_Pr->CModeFlag, pXGI->XGI_Pr->CInfoFlag); + xf86DrvMsg(0, X_INFO, " {{0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", + pXGI->XGI_Pr->CCRT1CRTC[0], pXGI->XGI_Pr->CCRT1CRTC[1], + pXGI->XGI_Pr->CCRT1CRTC[2], pXGI->XGI_Pr->CCRT1CRTC[3], + pXGI->XGI_Pr->CCRT1CRTC[4], pXGI->XGI_Pr->CCRT1CRTC[5], + pXGI->XGI_Pr->CCRT1CRTC[6], pXGI->XGI_Pr->CCRT1CRTC[7]); + xf86DrvMsg(0, X_INFO, " 0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", + pXGI->XGI_Pr->CCRT1CRTC[8], pXGI->XGI_Pr->CCRT1CRTC[9], + pXGI->XGI_Pr->CCRT1CRTC[10], pXGI->XGI_Pr->CCRT1CRTC[11], + pXGI->XGI_Pr->CCRT1CRTC[12], pXGI->XGI_Pr->CCRT1CRTC[13], + pXGI->XGI_Pr->CCRT1CRTC[14], pXGI->XGI_Pr->CCRT1CRTC[15]); + xf86DrvMsg(0, X_INFO, " 0x%02x}},\n", pXGI->XGI_Pr->CCRT1CRTC[16]); + xf86DrvMsg(0, X_INFO, "Clock: 0x%02x, 0x%02x, %d\n", + pXGI->XGI_Pr->CSR2B, pXGI->XGI_Pr->CSR2C, pXGI->XGI_Pr->CSRClock); +#endif + return 1; +} + +#endif /* Xfree86 */ + + Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/init.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/init.h:1.1 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/init.h Mon May 2 09:28:02 2005 @@ -0,0 +1,1807 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/init.h,v 1.1 2005/05/02 13:28:02 dawes Exp $ */ +/* + * Data and prototypes for init.c + * + * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria + * + * If distributed as part of the Linux kernel, the following license terms + * apply: + * + * * This program is free software; you can redistribute it and/or modify + * * it under the terms of the GNU General Public License as published by + * * the Free Software Foundation; either version 2 of the named License, + * * or any later version. + * * + * * This program is distributed in the hope that it will be useful, + * * but WITHOUT ANY WARRANTY; without even the implied warranty of + * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * * GNU General Public License for more details. + * * + * * You should have received a copy of the GNU General Public License + * * along with this program; if not, write to the Free Software + * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + * + * Otherwise, the following license terms apply: + * + * * Redistribution and use in source and binary forms, with or without + * * modification, are permitted provided that the following conditions + * * are met: + * * 1) Redistributions of source code must retain the above copyright + * * notice, this list of conditions and the following disclaimer. + * * 2) Redistributions in binary form must reproduce the above copyright + * * notice, this list of conditions and the following disclaimer in the + * * documentation and/or other materials provided with the distribution. + * * 3) The name of the author may not be used to endorse or promote products + * * derived from this software without specific prior written permission. + * * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR + * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Author: Thomas Winischhofer <thomas@winischhofer.net> + * + */ + +#ifndef _INIT_ +#define _INIT_ + +#include "osdef.h" + +#include "initdef.h" +#include "vgatypes.h" +#include "vb_struct.h" + +#ifdef LINUX_XF86 +#include "xf86.h" +#include "xf86Pci.h" +#include "xf86PciInfo.h" +#include "xf86_OSproc.h" +#include "xgi.h" +#include "regs.h" +#endif + +#ifdef LINUX_KERNEL +#ifdef XGI_CP +#undef XGI_CP +#endif +#include <linux/config.h> +#include <linux/version.h> +#include <linux/types.h> +#include <asm/io.h> +#include <linux/fb.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +#include <linux/xgifb.h> +#else +#include <video/xgifb.h> +#endif +#endif + +/* Mode numbers */ +const USHORT ModeIndex_320x200[] = {0x59, 0x41, 0x00, 0x4f}; +const USHORT ModeIndex_320x240[] = {0x50, 0x56, 0x00, 0x53}; +const USHORT ModeIndex_320x240_FSTN[] = {0x5a, 0x5b, 0x00, 0x00}; /* FSTN */ +const USHORT ModeIndex_400x300[] = {0x51, 0x57, 0x00, 0x54}; +const USHORT ModeIndex_512x384[] = {0x52, 0x58, 0x00, 0x5c}; +const USHORT ModeIndex_640x400[] = {0x2f, 0x5d, 0x00, 0x5e}; +const USHORT ModeIndex_640x480[] = {0x2e, 0x44, 0x00, 0x62}; +const USHORT ModeIndex_720x480[] = {0x31, 0x33, 0x00, 0x35}; +const USHORT ModeIndex_720x576[] = {0x32, 0x34, 0x00, 0x36}; +const USHORT ModeIndex_768x576[] = {0x5f, 0x60, 0x00, 0x61}; +const USHORT ModeIndex_800x480[] = {0x70, 0x7a, 0x00, 0x76}; +const USHORT ModeIndex_800x600[] = {0x30, 0x47, 0x00, 0x63}; +const USHORT ModeIndex_848x480[] = {0x39, 0x3b, 0x00, 0x3e}; +const USHORT ModeIndex_856x480[] = {0x3f, 0x42, 0x00, 0x45}; +const USHORT ModeIndex_1024x768[] = {0x38, 0x4a, 0x00, 0x64}; +const USHORT ModeIndex_1024x576[] = {0x71, 0x74, 0x00, 0x77}; +const USHORT ModeIndex_1024x600[] = {0x20, 0x21, 0x00, 0x22}; /* 300 series only */ +const USHORT ModeIndex_1280x1024[] = {0x3a, 0x4d, 0x00, 0x65}; +const USHORT ModeIndex_1280x960[] = {0x7b, 0x7c, 0x00, 0x7d}; +const USHORT ModeIndex_1152x768[] = {0x23, 0x24, 0x00, 0x25}; /* 300 series only */ +const USHORT ModeIndex_1152x864[] = {0x20, 0x21, 0x00, 0x22}; +const USHORT ModeIndex_300_1280x768[] = {0x55, 0x5a, 0x00, 0x5b}; +const USHORT ModeIndex_310_1280x768[] = {0x23, 0x24, 0x00, 0x25}; +const USHORT ModeIndex_1280x720[] = {0x79, 0x75, 0x00, 0x78}; +const USHORT ModeIndex_1280x800[] = {0x14, 0x15, 0x00, 0x16}; +const USHORT ModeIndex_1360x768[] = {0x48, 0x4b, 0x00, 0x4e}; +const USHORT ModeIndex_300_1360x1024[]= {0x67, 0x6f, 0x00, 0x72}; /* 300 series, BARCO only */ +const USHORT ModeIndex_1400x1050[] = {0x26, 0x27, 0x00, 0x28}; /* 315 series only */ +const USHORT ModeIndex_1680x1050[] = {0x17, 0x18, 0x00, 0x19}; /* 315 series only */ +const USHORT ModeIndex_1600x1200[] = {0x3c, 0x3d, 0x00, 0x66}; +const USHORT ModeIndex_1920x1440[] = {0x68, 0x69, 0x00, 0x6b}; +const USHORT ModeIndex_300_2048x1536[]= {0x6c, 0x6d, 0x00, 0x00}; +const USHORT ModeIndex_310_2048x1536[]= {0x6c, 0x6d, 0x00, 0x6e}; + +const USHORT XGI_DRAMType[17][5]={ + {0x0C,0x0A,0x02,0x40,0x39}, + {0x0D,0x0A,0x01,0x40,0x48}, + {0x0C,0x09,0x02,0x20,0x35}, + {0x0D,0x09,0x01,0x20,0x44}, + {0x0C,0x08,0x02,0x10,0x31}, + {0x0D,0x08,0x01,0x10,0x40}, + {0x0C,0x0A,0x01,0x20,0x34}, + {0x0C,0x09,0x01,0x08,0x32}, + {0x0B,0x08,0x02,0x08,0x21}, + {0x0C,0x08,0x01,0x08,0x30}, + {0x0A,0x08,0x02,0x04,0x11}, + {0x0B,0x0A,0x01,0x10,0x28}, + {0x09,0x08,0x02,0x02,0x01}, + {0x0B,0x09,0x01,0x08,0x24}, + {0x0B,0x08,0x01,0x04,0x20}, + {0x0A,0x08,0x01,0x02,0x10}, + {0x09,0x08,0x01,0x01,0x00} +}; + +const USHORT XGI_SDRDRAM_TYPE[13][5] = +{ + { 2,12, 9,64,0x35}, + { 1,13, 9,64,0x44}, + { 2,12, 8,32,0x31}, + { 2,11, 9,32,0x25}, + { 1,12, 9,32,0x34}, + { 1,13, 8,32,0x40}, + { 2,11, 8,16,0x21}, + { 1,12, 8,16,0x30}, + { 1,11, 9,16,0x24}, + { 1,11, 8, 8,0x20}, + { 2, 9, 8, 4,0x01}, + { 1,10, 8, 4,0x10}, + { 1, 9, 8, 2,0x00} +}; + +const USHORT XGI_DDRDRAM_TYPE[4][5] = +{ + { 2,12, 9,64,0x35}, + { 2,12, 8,32,0x31}, + { 2,11, 8,16,0x21}, + { 2, 9, 8, 4,0x01} +}; + +const USHORT XGI_MDA_DAC[] = +{ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, + 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, + 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, + 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, + 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F +}; + +const USHORT XGI_CGA_DAC[] = +{ + 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, + 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, + 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F, + 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F, + 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, + 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, + 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F, + 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F +}; + +const USHORT XGI_EGA_DAC[] = +{ + 0x00,0x10,0x04,0x14,0x01,0x11,0x05,0x15, + 0x20,0x30,0x24,0x34,0x21,0x31,0x25,0x35, + 0x08,0x18,0x0C,0x1C,0x09,0x19,0x0D,0x1D, + 0x28,0x38,0x2C,0x3C,0x29,0x39,0x2D,0x3D, + 0x02,0x12,0x06,0x16,0x03,0x13,0x07,0x17, + 0x22,0x32,0x26,0x36,0x23,0x33,0x27,0x37, + 0x0A,0x1A,0x0E,0x1E,0x0B,0x1B,0x0F,0x1F, + 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F +}; + +const USHORT XGI_VGA_DAC[] = +{ + 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, + 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F, + 0x00,0x05,0x08,0x0B,0x0E,0x11,0x14,0x18, + 0x1C,0x20,0x24,0x28,0x2D,0x32,0x38,0x3F, + 0x00,0x10,0x1F,0x2F,0x3F,0x1F,0x27,0x2F, + 0x37,0x3F,0x2D,0x31,0x36,0x3A,0x3F,0x00, + 0x07,0x0E,0x15,0x1C,0x0E,0x11,0x15,0x18, + 0x1C,0x14,0x16,0x18,0x1A,0x1C,0x00,0x04, + 0x08,0x0C,0x10,0x08,0x0A,0x0C,0x0E,0x10, + 0x0B,0x0C,0x0D,0x0F,0x10 +}; + +static const XGI_New_StResInfoStruct XGI_StResInfo[]= +{ + { 640,400}, + { 640,350}, + { 720,400}, + { 720,350}, + { 640,480} +}; + +static const XGI_New_ModeResInfoStruct XGI_ModeResInfo[] = +{ + { 320, 200, 8, 8}, /* 0x00 */ + { 320, 240, 8, 8}, /* 0x01 */ + { 320, 400, 8, 8}, /* 0x02 */ + { 400, 300, 8, 8}, /* 0x03 */ + { 512, 384, 8, 8}, /* 0x04 */ + { 640, 400, 8,16}, /* 0x05 */ + { 640, 480, 8,16}, /* 0x06 */ + { 800, 600, 8,16}, /* 0x07 */ + { 1024, 768, 8,16}, /* 0x08 */ + { 1280,1024, 8,16}, /* 0x09 */ + { 1600,1200, 8,16}, /* 0x0a */ + { 1920,1440, 8,16}, /* 0x0b */ + { 2048,1536, 8,16}, /* 0x0c */ + { 720, 480, 8,16}, /* 0x0d */ + { 720, 576, 8,16}, /* 0x0e */ + { 1280, 960, 8,16}, /* 0x0f */ + { 800, 480, 8,16}, /* 0x10 */ + { 1024, 576, 8,16}, /* 0x11 */ + { 1280, 720, 8,16}, /* 0x12 */ + { 856, 480, 8,16}, /* 0x13 */ + { 1280, 768, 8,16}, /* 0x14 */ + { 1400,1050, 8,16}, /* 0x15 */ + { 1152, 864, 8,16}, /* 0x16 */ + { 848, 480, 8,16}, /* 0x17 */ + { 1360, 768, 8,16}, /* 0x18 */ + { 1024, 600, 8,16}, /* 0x19 */ + { 1152, 768, 8,16}, /* 0x1a */ + { 768, 576, 8,16}, /* 0x1b */ + { 1360,1024, 8,16}, /* 0x1c */ + { 1280, 800, 8,16}, /* 0x1d */ + { 1680,1050, 8,16} /* 0x1e */ +}; + +/**************************************************************/ +/* XGI VIDEO BRIDGE ----------------------------------------- */ +/**************************************************************/ + +static const UCHAR XGI_SoftSetting = 0x30; /* RAM setting */ + +static const UCHAR XGI_OutputSelect = 0x40; + +static const UCHAR XGI_NTSCTiming[] = { + 0x17,0x1d,0x03,0x09,0x05,0x06,0x0c,0x0c, + 0x94,0x49,0x01,0x0a,0x06,0x0d,0x04,0x0a, + 0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b, + 0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17, + 0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02, + 0x03,0x0a,0x65,0x9d,0x08,0x92,0x8f,0x40, + 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x50, + 0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00 +}; + +static const UCHAR XGI_PALTiming[] = { + 0x19,0x52,0x35,0x6e,0x04,0x38,0x3d,0x70, + 0x94,0x49,0x01,0x12,0x06,0x3e,0x35,0x6d, + 0x06,0x14,0x3e,0x35,0x6d,0x00,0x45,0x2b, + 0x70,0x50,0x00,0x9b,0x00,0xd9,0x5d,0x17, + 0x7d,0x05,0x45,0x00,0x00,0xe8,0x00,0x02, + 0x0d,0x00,0x68,0xb0,0x0b,0x92,0x8f,0x40, + 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x63, + 0x00,0x40,0x3e,0x00,0xe1,0x02,0x28,0x00 +}; + +static const UCHAR XGI_HiTVExtTiming[] = { + 0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64, + 0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d, + 0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f, + 0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13, + 0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40, + 0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40, + 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d, + 0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00 +}; + +static const UCHAR XGI_HiTVSt1Timing[] = { + 0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65, + 0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d, + 0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f, + 0x65,0x90,0x7b,0xa8,0x03,0xf0,0x87,0x03, + 0x11,0x15,0x11,0xcf,0x10,0x11,0xcf,0x10, + 0x35,0x35,0x3b,0x69,0x1d,0x92,0x0f,0x40, + 0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x86, + 0xaf,0x5d,0x0e,0x00,0xfc,0xff,0x2d,0x00 +}; + +static const UCHAR XGI_HiTVSt2Timing[] = { + 0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64, + 0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d, + 0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f, + 0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13, + 0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40, + 0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40, + 0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d, + 0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00 +}; + +static const UCHAR XGI_HiTVGroup3Data[] = { + 0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x5f, + 0x05,0x21,0xb2,0xb2,0x55,0x77,0x2a,0xa6, + 0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20, + 0x8c,0x6e,0x60,0x2e,0x58,0x48,0x72,0x44, + 0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80, + 0x4f,0x7f,0x03,0xa8,0x7d,0x20,0x1a,0xa9, + 0x14,0x05,0x03,0x7e,0x64,0x31,0x14,0x75, + 0x18,0x05,0x18,0x05,0x4c,0xa8,0x01 +}; + +static const UCHAR XGI_HiTVGroup3Simu[] = { + 0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x95, + 0xdb,0x20,0xb8,0xb8,0x55,0x47,0x2a,0xa6, + 0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20, + 0x8c,0x6e,0x60,0x15,0x26,0xd3,0xe4,0x11, + 0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80, + 0x67,0x36,0x01,0x47,0x0e,0x10,0xbe,0xb4, + 0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75, + 0x18,0x05,0x18,0x05,0x4c,0xa8,0x01 +}; + +static const UCHAR XGI_NTSCPhase[] = {0x21,0xed,0xba,0x08}; +static const UCHAR XGI_PALPhase[] = {0x2a,0x05,0xe3,0x00}; +static const UCHAR XGI_PALMPhase[] = {0x21,0xE4,0x2E,0x9B}; +static const UCHAR XGI_PALNPhase[] = {0x21,0xF4,0x3E,0xBA}; +static const UCHAR XGI_NTSCPhase2[] = {0x21,0xF0,0x7B,0xD6}; +static const UCHAR XGI_PALPhase2[] = {0x2a,0x09,0x86,0xe9}; +static const UCHAR XGI_PALMPhase2[] = {0x21,0xE6,0xEF,0xA4}; +static const UCHAR XGI_PALNPhase2[] = {0x21,0xF6,0x94,0x46}; +static const UCHAR XGI_SpecialPhase[] = {0x1e,0x8c,0x5c,0x7a}; +static const UCHAR XGI_SpecialPhaseM[]= {0x1e,0x83,0x0a,0xe0}; +static const UCHAR XGI_SpecialPhaseJ[]= {0x25,0xd4,0xfd,0x5e}; + +static const XGI_TVDataStruct XGI_New_StPALData[] = +{ + { 1, 1, 864, 525,1270, 400, 100, 0, 760,0xf4,0xff,0x1c,0x22}, + { 1, 1, 864, 525,1270, 350, 100, 0, 760,0xf4,0xff,0x1c,0x22}, + { 1, 1, 864, 525,1270, 400, 0, 0, 720,0xf1,0x04,0x1f,0x18}, + { 1, 1, 864, 525,1270, 350, 0, 0, 720,0xf4,0x0b,0x1c,0x0a}, + { 1, 1, 864, 525,1270, 480, 50, 0, 760,0xf4,0xff,0x1c,0x22}, + { 1, 1, 864, 525,1270, 600, 50, 0, 0,0xf4,0xff,0x1c,0x22} +}; + +static const XGI_TVDataStruct XGI_New_ExtPALData[] = +{ + { 27, 10, 848, 448,1270, 530, 50, 0, 50,0xf4,0xff,0x1c,0x22}, /* 640x400, 320x200 */ + { 108, 35, 848, 398,1270, 530, 50, 0, 50,0xf4,0xff,0x1c,0x22}, + { 12, 5, 954, 448,1270, 530, 50, 0, 50,0xf1,0x04,0x1f,0x18}, + { 9, 4, 960, 463,1644, 438, 50, 0, 50,0xf4,0x0b,0x1c,0x0a}, + { 9, 4, 848, 528,1270, 530, 0, 0, 50,0xf5,0xfb,0x1b,0x2a}, /* 640x480, 320x240 */ +/*{ 36, 25,1060, 648,1316, 530, 438, 0, 438,0xeb,0x05,0x25,0x16},*//* 800x600, 400x300 */ + { 36, 25,1060, 648,1270, 530, 438, 0, 438,0xeb,0x05,0x25,0x16}, /* 800x600, 400x300 - better */ + { 3, 2,1080, 619,1270, 540, 438, 0, 438,0xf3,0x00,0x1d,0x20}, /* 720x576 */ + { 1, 1,1170, 821,1270, 520, 686, 0, 686,0xF3,0x00,0x1D,0x20}, /* 1024x768 */ + { 1, 1,1170, 821,1270, 520, 686, 0, 686,0xF3,0x00,0x1D,0x20} /* 1024x768 (for NTSC equ) */ +}; + +static const XGI_TVDataStruct XGI_New_StNTSCData[] = +{ + { 1, 1, 858, 525,1270, 400, 50, 0, 760,0xf1,0x04,0x1f,0x18}, + { 1, 1, 858, 525,1270, 350, 50, 0, 640,0xf1,0x04,0x1f,0x18}, + { 1, 1, 858, 525,1270, 400, 0, 0, 720,0xf1,0x04,0x1f,0x18}, + { 1, 1, 858, 525,1270, 350, 0, 0, 720,0xf4,0x0b,0x1c,0x0a}, + { 1, 1, 858, 525,1270, 480, 0, 0, 760,0xf1,0x04,0x1f,0x18} +}; + +static const XGI_TVDataStruct XGI_New_ExtNTSCData[] = +{ + { 143, 65, 858, 443,1270, 440, 171, 0, 171,0xf1,0x04,0x1f,0x18}, /* 640x400, 320x200 */ + { 88, 35, 858, 393,1270, 440, 171, 0, 171,0xf1,0x04,0x1f,0x18}, + { 143, 70, 924, 443,1270, 440, 92, 0, 92,0xf1,0x04,0x1f,0x18}, + { 143, 70, 924, 393,1270, 440, 92, 0, 92,0xf4,0x0b,0x1c,0x0a}, + { 143, 76, 836, 523,1270, 440, 224, 0, 0,0xf1,0x05,0x1f,0x16}, /* 640x480, 320x240 */ + { 143, 120,1056, 643,1270, 440, 0, 128, 0,0xf4,0x10,0x1c,0x00}, /* 800x600, 400x300 */ +/*{ 2, 1, 858, 503,1270, 480, 0, 128, 0,0xee,0x0c,0x22,0x08},*/ /* 720x480 (old, from 650) */ + { 143, 76, 836, 523,1270, 440, 0, 128, 0,0xee,0x0c,0x22,0x08}, /* 720x480 - BETTER (from 300 series) */ +/*{ 65, 64,1056, 791,1270, 480, 638, 0, 0,0xEE,0x0C,0x22,0x08} */ /* 1024x768 (525i) */ + { 1, 1,1100, 811,1412, 440, 0, 128, 0,0xee,0x0c,0x22,0x08}, /* 1024x768 (525i) CORRECTED */ + { 65, 64,1056, 791,1270, 480, 455, 0, 0,0x00,0x00,0x00,0x00} /* 1024x768 (525p) */ +}; + +static const XGI_TVDataStruct XGI_StHiTVData[] = /* Slave + TVSimu */ +{ + { 1, 1, 0x37c,0x233,0x2b2,0x320, 0, 0, 0, 0x00,0x00,0x00,0x00}, + { 1, 1, 0x37c,0x233,0x2b2,0x2bc, 0, 0, 0, 0x00,0x00,0x00,0x00}, + { 1, 1, 0x37c,0x233,0x2b2,0x320, 0, 0, 0, 0x00,0x00,0x00,0x00}, + { 1, 1, 0x37c,0x233,0x2b2,0x2bc, 0, 0, 0, 0x00,0x00,0x00,0x00}, + { 1, 1, 0x37c,0x233,0x2b2,0x3c0, 0, 0, 0, 0x00,0x00,0x00,0x00}, + { 8, 5, 0x41a,0x2ab,0x670,0x3c0,0x150,128, 0, 0x00,0x00,0x00,0x00} +}; + +static const XGI_TVDataStruct XGI_New_St2HiTVData[] = /* Slave */ +{ + { 3, 1, 0x348,0x1e3,0x670,0x3c0,0x032, 0, 0, 0x00,0x00,0x00,0x00}, + { 1, 1, 0x37c,0x233,0x2b2,0x2bc, 0, 0, 0, 0x00,0x00,0x00,0x00}, + { 3, 1, 0x348,0x1e3,0x670,0x3c0,0x032, 0, 0, 0x00,0x00,0x00,0x00}, + { 1, 1, 0x37c,0x233,0x2b2,0x2bc, 0, 0, 0, 0x00,0x00,0x00,0x00}, + { 5, 2, 0x348,0x233,0x670,0x3c0,0x08d,128, 0, 0x00,0x00,0x00,0x00}, + { 8, 5, 0x41a,0x2ab,0x670,0x3c0,0x17c,128, 0, 0x00,0x00,0x00,0x00} +}; + +static const XGI_TVDataStruct XGI_New_ExtHiTVData[] = +{ + { 6, 1, 0x348,0x233,0x660,0x3c0, 0, 0, 0, 0x00,0x00,0x00,0x00}, + { 3, 1, 0x3c0,0x233,0x660,0x3c0, 0, 0, 0, 0x00,0x00,0x00,0x00}, + { 6, 1, 0x348,0x233,0x660,0x3c0, 0, 0, 0, 0x00,0x00,0x00,0x00}, + { 3, 1, 0x3c0,0x233,0x660,0x3c0, 0, 0, 0, 0x00,0x00,0x00,0x00}, + { 5, 1, 0x348,0x233,0x670,0x3c0,0x166,128, 0, 0x00,0x00,0x00,0x00}, /* 640x480 */ + { 16, 5, 0x41a,0x2ab,0x670,0x3c0,0x143,128, 0, 0x00,0x00,0x00,0x00}, /* 800x600 */ + { 25, 12, 0x4ec,0x353,0x670,0x3c0,0x032, 0, 0, 0x00,0x00,0x00,0x00}, /* 1024x768 */ + { 5, 4, 0x627,0x464,0x670,0x3c0,0x128, 0, 0, 0x00,0x00,0x00,0x00}, /* 1280x1024 */ + { 4, 1, 0x41a,0x233,0x60c,0x3c0,0x143,128, 0, 0x00,0x00,0x00,0x00}, /* 800x480 */ + { 5, 2, 0x578,0x293,0x670,0x3c0,0x032, 0, 0, 0x00,0x00,0x00,0x00}, /* 1024x576 */ + { 8, 5, 0x6d6,0x323,0x670,0x3c0,0x128, 0, 0, 0x00,0x00,0x00,0x00} /* 1280x720 */ +}; + +static const XGI_TVDataStruct XGI_St525pData[] = +{ + { 1, 1, 0x6b4,0x20d,0x4f6,0x190, 50, 0, 0x2f8, 0x00,0x00,0x00,0x00}, + { 1, 1, 0x6b4,0x20d,0x4f6,0x15e, 50, 0, 0x280, 0x00,0x00,0x00,0x00}, + { 1, 1, 0x6b4,0x20d,0x4f6,0x190, 50, 0, 0x2f8, 0x00,0x00,0x00,0x00}, + { 1, 1, 0x6b4,0x20d,0x4f6,0x15e, 50, 0, 0x280, 0x00,0x00,0x00,0x00}, + { 1, 1, 0x6b4,0x20d,0x4f6,0x1e0, 0, 0, 0x2f8, 0x00,0x00,0x00,0x00} +}; + +static const XGI_TVDataStruct XGI_St750pData[] = +{ + { 1, 1, 0x672,0x2ee,0x500,0x190, 50, 0, 0x2f8, 0x00,0x00,0x00,0x00}, + { 1, 1, 0x672,0x2ee,0x500,0x15e, 50, 0, 0x280, 0x00,0x00,0x00,0x00}, + { 1, 1, 0x672,0x2ee,0x500,0x190, 0, 0, 0x2d0, 0x00,0x00,0x00,0x00}, + { 1, 1, 0x672,0x2ee,0x500,0x15e, 0, 0, 0x2d0, 0x00,0x00,0x00,0x00}, + { 1, 1, 0x672,0x2ee,0x500,0x1e0, 0, 0, 0x2f8, 0x00,0x00,0x00,0x00} +}; + +static const XGI_TVDataStruct XGI_Ext750pData[] = +{ + { 3, 1, 0x3a7,0x1d6,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, + { 24, 7, 0x3a7,0x1a4,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, + { 3, 1, 0x3a7,0x1d6,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, + { 24, 7, 0x3a7,0x1a4,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, + { 99, 32, 0x320,0x1fe,0x500,0x2d0, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 640x480 */ + { 5, 4, 0x5d8,0x29e,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 800x600 */ + { 2, 1, 0x35a,0x1f7,0x4f6,0x1e0, 0,128, 0, 0x00,0x00,0x00,0x00}, /* 720x480 */ + { 68, 64, 0x55f,0x346,0x500,0x2a8,0x27e, 0, 0, 0x00,0x00,0x00,0x00}, /* 1024x768 */ + { 25, 24, 0x5d8,0x2f3,0x460,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00} /* 1280x720 */ +}; + +static const XGI_LCDDataStruct XGI_LCD1280x720Data[] = +{ + { 14, 5, 864, 432, 1344, 806 }, /* 640x400 */ + { 16, 5, 864, 378, 1344, 806 }, + { 14, 5, 864, 432, 1344, 806 }, + { 16, 5, 864, 378, 1344, 806 }, + { 24, 11, 924, 523, 1344, 806 }, /* 640x480 */ + { 7, 5, 1152, 664, 1344, 806 }, /* 800x600 */ + { 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1344, 806, 1344, 806 } /* 1280x720 */ +}; + +/* About 1280x768: For TMDS, Panel_1280x768 will only be set if + * the panel is a Fujitsu 7911 (VL-17WDX8) (with clock 81, 1688x802) + * Other TMDS panels of this resolution will be treated as custom. + * For LVDS, we know two types. Data follows: + */ + +static const XGI_LCDDataStruct XGI_StLCD1280x768_2Data[] = +{ + { 64, 21, 858, 434, 1408, 806 }, /* 640x400 */ + { 32, 9, 858, 372, 1408, 806 }, + { 64, 21, 858, 434, 1408, 806 }, + { 32, 9, 858, 372, 1408, 806 }, + { 143, 68, 1024, 527, 1408, 806 }, /* 640x480 */ + { 64, 51, 1364, 663, 1408, 806 }, /* 800x600 */ + { 88, 81, 1296, 806, 1408, 806 }, /* 1024x768 */ + { 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1408, 806, 1408, 806 } /* 1280x768 */ +}; + +static const XGI_LCDDataStruct XGI_ExtLCD1280x768_2Data[] = +{ + { 64, 25, 1056, 422, 1408, 806 }, /*, 664 */ + { 128, 39, 884, 396, 1408, 806 }, /*, 640 */ + { 64, 25, 1056, 422, 1408, 806 }, /*, 664 */ + { 128, 39, 884, 396, 1408, 806 }, /*, 640 */ + { 32, 15, 1056, 513, 1408, 806 }, /*, 664 */ + { 176, 125, 1280, 640, 1408, 806 }, /*, 768 */ + { 88, 81, 1296, 806, 1408, 806 }, + { 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1408, 806, 1408, 806 } +}; + +static const XGI_LCDDataStruct XGI_LCD1280x768_3Data[] = +{ + { 64, 25, 1056, 422, 1664, 798 }, /* 640x400 */ + { 128, 39, 884, 396, 1408, 806 }, /* ,640 */ + { 64, 25, 1056, 422, 1664, 798 }, /* 640x400 */ + { 128, 39, 884, 396, 1408, 806 }, /* ,640 */ + { 32, 15, 1056, 513, 1408, 806 }, /* ,664 */ /* 640x480 */ + { 176, 125, 1280, 640, 1408, 806 }, /* ,768 */ /* 800x600 */ + { 64, 61, 1342, 806, 1408, 806 }, /* 1024x768 */ + { 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1408, 806, 1408, 806 } /* 1280x768 */ +}; + +static const XGI_LCDDataStruct XGI_LCD1280x800Data[] = +{ + { 128, 51, 1122, 412, 1408, 816 }, /* 640x400 */ + { 128, 49, 1232, 361, 1408, 816 }, + { 128, 51, 1122, 412, 1408, 816 }, + { 128, 49, 1232, 361, 1408, 816 }, + { 8, 3, 880, 491, 1408, 816 }, /* 640x480 */ + { 11, 6, 1024, 612, 1408, 816 }, /* 800x600 */ + { 22, 21, 1400, 784, 1408, 816 }, /* 1024x768 */ + { 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1408, 816, 1408, 816 } /* 1280x800 */ +}; + +static const XGI_LCDDataStruct XGI_LCD1280x960Data[] = +{ + { 9, 2, 800, 500, 1800, 1000 }, + { 9, 2, 800, 500, 1800, 1000 }, + { 4, 1, 900, 500, 1800, 1000 }, + { 4, 1, 900, 500, 1800, 1000 }, + { 9, 2, 800, 500, 1800, 1000 }, + { 30, 11, 1056, 625, 1800, 1000 }, + { 5, 3, 1350, 800, 1800, 1000 }, + { 1, 1, 1576, 1050, 1576, 1050 }, + { 1, 1, 1800, 1000, 1800, 1000 } +}; + +static const XGI_LCDDataStruct XGI_New_StLCD1400x1050Data[] = +{ + { 211, 100, 2100, 408, 1688, 1066 }, + { 211, 64, 1536, 358, 1688, 1066 }, + { 211, 100, 2100, 408, 1688, 1066 }, + { 211, 64, 1536, 358, 1688, 1066 }, + { 211, 48, 840, 488, 1688, 1066 }, + { 211, 72, 1008, 609, 1688, 1066 }, + { 211, 128, 1400, 776, 1688, 1066 }, + { 211, 205, 1680, 1041, 1688, 1066 }, + { 1, 1, 1688, 1066, 1688, 1066 } +}; + +static const XGI_LCDDataStruct XGI_New_ExtLCD1400x1050Data[] = +{ + { 211, 100, 2100, 408, 1688, 1066 }, /* 640x400 */ + { 211, 64, 1536, 358, 1688, 1066 }, + { 211, 100, 2100, 408, 1688, 1066 }, + { 211, 64, 1536, 358, 1688, 1066 }, + { 211, 48, 840, 488, 1688, 1066 }, /* 640x480 */ + { 211, 72, 1008, 609, 1688, 1066 }, /* 800x600 */ + { 211, 128, 1400, 776, 1688, 1066 }, + { 211, 205, 1680, 1041, 1688, 1066 }, + { 1, 1, 1688, 1066, 1688, 1066 } +}; + +static const XGI_LCDDataStruct XGI_LCD1680x1050Data[] = +{ + { 95, 24, 1260, 410, 1900, 1066 }, /* 0 640x400 */ + { 10, 3, 1710, 362, 1900, 1066 }, + { 95, 24, 1260, 410, 1900, 1066 }, + { 10, 3, 1710, 362, 1900, 1066 }, + { 95, 32, 1400, 490, 1900, 1066 }, /* 4 640x480 */ + { 95, 42, 1470, 610, 1900, 1066 }, /* 5 800x600 */ + { 95, 64, 1750, 784, 1900, 1066 }, /* 6 1024x768 */ + { 95, 94, 1900, 1055, 1900, 1066 }, /* 7 1280x1024 */ + { 41, 31, 1900, 806, 1900, 1066 }, /* 8 1280x768 */ + { 95, 69, 1800, 817, 1900, 1066 }, /* 9 1280x800 patch */ + { 13, 9, 1900, 739, 1900, 1066 }, /* 10 1280x720 */ + { 95, 94, 1880, 1066, 1900, 1066 }, /* 11 1400x1050 patch */ + { 1, 1, 1900, 1066, 1900, 1066 } /* 12 1680x1050 */ +}; + +static const XGI_LCDDataStruct XGI_New_StLCD1600x1200Data[] = +{ + {27, 4, 800, 500, 2160, 1250 }, + {27, 4, 800, 500, 2160, 1250 }, + { 6, 1, 900, 500, 2160, 1250 }, + { 6, 1, 900, 500, 2160, 1250 }, + {27, 1, 800, 500, 2160, 1250 }, + { 4, 1,1080, 625, 2160, 1250 }, + { 5, 2,1350, 800, 2160, 1250 }, + {135,88,1600,1100, 2160, 1250 }, + {135,88,1600,1100, 2160, 1250 }, + { 1, 1,2160,1250, 2160, 1250 } +}; + +static const XGI_LCDDataStruct XGI_New_ExtLCD1600x1200Data[] = +{ + {27, 4, 800, 500, 2160, 1250 }, + {27, 4, 800, 500, 2160, 1250 }, + { 6, 1, 900, 500, 2160, 1250 }, + { 6, 1, 900, 500, 2160, 1250 }, + {27, 1, 800, 500, 2160, 1250 }, + { 4, 1,1080, 625, 2160, 1250 }, + { 5, 2,1350, 800, 2160, 1250 }, + {27,16,1500,1064, 2160, 1250 }, + {27,16,1500,1064, 2160, 1250 }, + { 1, 1,2160,1250, 2160, 1250 } +}; + +static const XGI_LCDDataStruct XGI_NoScaleData[] = +{ + { 1, 1, 800, 449, 800, 449 }, /* 0x00: 320x200, 640x400 */ + { 1, 1, 800, 449, 800, 449 }, + { 1, 1, 900, 449, 900, 449 }, + { 1, 1, 900, 449, 900, 449 }, + { 1, 1, 800, 525, 800, 525 }, /* 0x04: 320x240, 640x480 */ + { 1, 1,1056, 628,1056, 628 }, /* 0x05: 400x300, 800x600 */ + { 1, 1,1344, 806,1344, 806 }, /* 0x06: 512x384, 1024x768 */ + { 1, 1,1688,1066,1688,1066 }, /* 0x07: 1280x1024 */ + { 1, 1,1688, 802,1688, 802 }, /* 0x08: 1280x768: Fujitsu, TMDS only */ + { 1, 1,2160,1250,2160,1250 }, /* 0x09: 1600x1200 */ + { 1, 1,1800,1000,1800,1000 }, /* 0x0a: 1280x960 */ + { 1, 1,1688,1066,1688,1066 }, /* 0x0b: 1400x1050 */ + { 1, 1,1650, 750,1650, 750 }, /* 0x0c: 1280x720 (TMDS) */ + { 1, 1,1408, 816,1408, 816 }, /* 0x0d: 1280x800 */ + { 1, 1,1900,1066,1900,1066 }, /* 0x0e: 1680x1050 (LVDS) */ + { 1, 1,1408, 806,1408, 806 }, /* 0x0f: 1280x768_2 */ + { 1, 1,1664, 798,1664, 798 }, /* 0x10: 1280x768_3 */ + { 1, 1,1688, 802,1688, 802 }, /* 0x11: 1280x768: Std, TMDS only */ + { 1, 1,1344, 806,1344, 806 } /* 0x12: 1280x720 (LVDS) */ +}; + + +/**************************************************************/ +/* LVDS ----------------------------------------------------- */ +/**************************************************************/ + +static const XGI_LVDSDataStruct XGI_LVDS320x480Data_1[]= +{ + { 848, 433, 400, 525}, + { 848, 389, 400, 525}, + { 848, 433, 400, 525}, + { 848, 389, 400, 525}, + { 848, 518, 400, 525}, + {1056, 628, 400, 525}, + { 400, 525, 400, 525}, + { 800, 449,1000, 644}, + { 800, 525,1000, 635} +}; + +static const XGI_LVDSDataStruct XGI_LVDS640x480Data_1[]= +{ + { 800, 445, 800, 525}, /* 800, 449, 800, 449 */ + { 800, 395, 800, 525}, + { 800, 445, 800, 525}, + { 800, 395, 800, 525}, + { 800, 525, 800, 525}, + { 800, 525, 800, 525}, /* pseudo */ + { 800, 525, 800, 525} /* pseudo */ +}; + +/* FSTN 320x240 */ +static const XGI_LVDSDataStruct XGI_LVDS640x480Data_2[]= +{ + { 800, 445, 800, 525}, + { 800, 395, 800, 525}, + { 800, 445, 800, 525}, + { 800, 395, 800, 525}, + { 800, 525, 800, 525}, + { 800, 525, 800, 525}, /* pseudo */ + { 800, 525, 800, 525} /* pseudo */ +}; + + +static const XGI_LVDSDataStruct XGI_LVDS800x600Data_1[]= +{ + { 848, 433,1060, 629}, + { 848, 389,1060, 629}, + { 848, 433,1060, 629}, + { 848, 389,1060, 629}, + { 848, 518,1060, 629}, + {1056, 628,1056, 628}, + {1056, 628,1056, 628} +}; + +static const XGI_LVDSDataStruct XGI_LVDS800x600Data_2[]= +{ + {1056, 628,1056, 628}, + {1056, 628,1056, 628}, + {1056, 628,1056, 628}, + {1056, 628,1056, 628}, + {1056, 628,1056, 628}, + {1056, 628,1056, 628}, + {1056, 628,1056, 628} +}; + +static const XGI_LVDSDataStruct XGI_New_LVDS1024x768Data_1[]= +{ + { 840, 438,1344, 806}, + { 840, 409,1344, 806}, + { 840, 438,1344, 806}, + { 840, 409,1344, 806}, + { 840, 518,1344, 806}, /* 640x480 */ + {1050, 638,1344, 806}, /* 800x600 */ + {1344, 806,1344, 806}, /* 1024x768 */ +}; + +static const XGI_LVDSDataStruct XGI_New_LVDS1024x768Data_2[]= +{ + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, +}; + +static const XGI_LVDSDataStruct XGI_New_LVDS1280x1024Data_1[]= +{ + {1048, 442,1688,1066}, + {1048, 392,1688,1066}, + {1048, 442,1688,1066}, + {1048, 392,1688,1066}, + {1048, 522,1688,1066}, + {1208, 642,1688,1066}, + {1432, 810,1688,1066}, + {1688,1066,1688,1066} +}; + +static const XGI_LVDSDataStruct XGI_New_LVDS1280x1024Data_2[]= +{ + {1688,1066,1688,1066}, + {1688,1066,1688,1066}, + {1688,1066,1688,1066}, + {1688,1066,1688,1066}, + {1688,1066,1688,1066}, + {1688,1066,1688,1066}, + {1688,1066,1688,1066}, + {1688,1066,1688,1066} +}; + +static const XGI_LVDSDataStruct XGI_New_LVDS1400x1050Data_1[]= +{ + { 928, 416, 1688,1066}, + { 928, 366, 1688,1066}, + { 928, 416, 1688,1066}, + { 928, 366, 1688,1066}, + { 928, 496, 1688,1066}, + {1088, 616, 1688,1066}, + {1312, 784, 1688,1066}, + {1568,1040, 1688,1066}, + {1688,1066, 1688,1066} +}; + +static const XGI_LVDSDataStruct XGI_New_LVDS1400x1050Data_2[]= +{ + {1688,1066, 1688,1066}, + {1688,1066, 1688,1066}, + {1688,1066, 1688,1066}, + {1688,1066, 1688,1066}, + {1688,1066, 1688,1066}, + {1688,1066, 1688,1066}, + {1688,1066, 1688,1066}, + {1688,1066, 1688,1066}, + {1688,1066, 1688,1066}, +}; + +static const XGI_LVDSDataStruct XGI_New_LVDS1600x1200Data_1[]= +{ + {1088, 520, 2048,1320}, + {1088, 470, 2048,1320}, + {1088, 520, 2048,1320}, + {1088, 470, 2048,1320}, + {1088, 600, 2048,1320}, + {1248, 720, 2048,1320}, + {1472, 888, 2048,1320}, + {1728,1144, 2048,1320}, + {1848,1170, 2048,1320}, + {2048,1320, 2048,1320} +}; + +static const XGI_LVDSDataStruct XGI_LVDS1600x1200Data_2[]= +{ + {2048,1320, 2048,1320}, + {2048,1320, 2048,1320}, + {2048,1320, 2048,1320}, + {2048,1320, 2048,1320}, + {2048,1320, 2048,1320}, + {2048,1320, 2048,1320}, + {2048,1320, 2048,1320}, + {2048,1320, 2048,1320}, + {2048,1320, 2048,1320}, + {2048,1320, 2048,1320} +}; + +static const XGI_LVDSDataStruct XGI_LVDS1280x960Data_1[]= +{ + { 840, 438,1344, 806}, + { 840, 409,1344, 806}, + { 840, 438,1344, 806}, + { 840, 409,1344, 806}, + { 840, 518,1344, 806}, + {1050, 638,1344, 806}, + {1344, 806,1344, 806}, + { 800, 449,1280, 801}, + { 800, 525,1280, 813} +}; + +static const XGI_LVDSDataStruct XGI_LVDS1280x960Data_2[]= +{ + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + { 800, 449,1280, 801}, + { 800, 525,1280, 813} +}; + +static const XGI_LVDSDataStruct XGI_LVDS1280x768Data_1[]= +{ + { 768, 438, 1408, 806}, + { 768, 388, 1408, 806}, + { 768, 438, 1408, 806}, + { 768, 388, 1408, 806}, + { 768, 518, 1408, 806}, + { 928, 638, 1408, 806}, + {1152, 806, 1408, 806}, + {1408, 806, 1408, 806}, + {1408, 806, 1408, 806} +}; + +static const XGI_LVDSDataStruct XGI_LVDS1280x768Data_2[]= +{ + {1408, 806, 1408, 806}, + {1408, 806, 1408, 806}, + {1408, 806, 1408, 806}, + {1408, 806, 1408, 806}, + {1408, 806, 1408, 806}, + {1408, 806, 1408, 806}, + {1408, 806, 1408, 806}, + {1408, 806, 1408, 806}, + {1408, 806, 1408, 806} +}; + +static const XGI_LVDSDataStruct XGI_LVDS1024x600Data_1[] = +{ + { 840, 604,1344, 800}, + { 840, 560,1344, 800}, + { 840, 604,1344, 800}, + { 840, 560,1344, 800}, + { 840, 689,1344, 800}, + {1050, 800,1344, 800}, + {1344, 800,1344, 800} +}; + +static const XGI_LVDSDataStruct XGI_LVDS1024x600Data_2[] = +{ + {1344, 800,1344, 800}, + {1344, 800,1344, 800}, + {1344, 800,1344, 800}, + {1344, 800,1344, 800}, + {1344, 800,1344, 800}, + {1344, 800,1344, 800}, + {1344, 800,1344, 800} +}; + +static const XGI_LVDSDataStruct XGI_LVDS1152x768Data_1[] = +{ + { 840, 438,1344, 806}, + { 840, 409,1344, 806}, + { 840, 438,1344, 806}, + { 840, 409,1344, 806}, + { 840, 518,1344, 806}, + {1050, 638,1344, 806}, + {1344, 806,1344, 806} +}; + +static const XGI_LVDSDataStruct XGI_LVDS1152x768Data_2[] = +{ + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806} +}; + +/* Pass 1:1 data */ +static const XGI_LVDSDataStruct XGI_LVDSXXXxXXXData_1[]= +{ + { 800, 449, 800, 449}, + { 800, 449, 800, 449}, + { 900, 449, 900, 449}, + { 900, 449, 900, 449}, + { 800, 525, 800, 525}, /* 640x480 */ + {1056, 628, 1056, 628}, /* 800x600 */ + {1344, 806, 1344, 806}, /* 1024x768 */ + {1688,1066, 1688,1066}, /* 1280x1024 */ /* INSERTED ! */ + {1688, 806, 1688, 806}, /* 1280x768 */ + /* No other panels ! */ +}; + +/* Custom data for Barco iQ R series */ +static const XGI_LVDSDataStruct XGI_LVDSBARCO1366Data_1[]= +{ + { 832, 438,1331, 806}, + { 832, 388,1331, 806}, + { 832, 438,1331, 806}, + { 832, 388,1331, 806}, + { 832, 518,1331, 806}, + {1050, 638,1344, 806}, + {1344, 806,1344, 806}, + {1688,1066,1688,1066}, + {1688,1066,1688,1066} /* 1360x1024 */ +}; + +/* Custom data for Barco iQ R series */ +static const XGI_LVDSDataStruct XGI_LVDSBARCO1366Data_2[]= +{ + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1688,1066,1688,1066}, + {1688,1066,1688,1066} /* 1360x1024 */ +}; + +/* Custom data for Barco iQ G series */ +static const XGI_LVDSDataStruct XGI_LVDSBARCO1024Data_1[]= +{ + { 832, 438,1331, 806}, + { 832, 409,1331, 806}, + { 832, 438,1331, 806}, + { 832, 409,1331, 806}, + { 832, 518,1331, 806}, /* 640x480 */ + {1050, 638,1344, 806}, /* 800x600 */ + {1344, 806,1344, 806}, /* 1024x768 */ +}; + +/* Custom data for Barco iQ G series */ +static const XGI_LVDSDataStruct XGI_LVDSBARCO1024Data_2[]= +{ + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, + {1344, 806,1344, 806}, +}; + +/* Custom data for 848x480 parallel panel */ +static const XGI_LVDSDataStruct XGI_LVDS848x480Data_1[]= +{ + { 0, 0, 0, 0}, + { 0, 0, 0, 0}, + { 0, 0, 0, 0}, + { 0, 0, 0, 0}, + {1088, 525,1088, 525}, /* 640x480 TODO */ + {1088, 525,1088, 525}, /* 800x600 TODO */ + {1088, 525,1088, 525}, /* 1024x768 TODO */ + { 0, 0, 0, 0}, + { 0, 0, 0, 0}, + { 0, 0, 0, 0}, + { 0, 0, 0, 0}, + {1088, 525,1088, 525}, /* 848x480 */ + {1088, 525,1088, 525} /* 1360x768 TODO */ +}; + +/* Custom data for 848x480 parallel panel */ +static const XGI_LVDSDataStruct XGI_LVDS848x480Data_2[]= +{ + { 0, 0, 0, 0}, + { 0, 0, 0, 0}, + { 0, 0, 0, 0}, + { 0, 0, 0, 0}, + {1088, 525,1088, 525}, /* 640x480 */ + {1088, 525,1088, 525}, /* 800x600 */ + {1088, 525,1088, 525}, /* 1024x768 */ + { 0, 0, 0, 0}, + { 0, 0, 0, 0}, + { 0, 0, 0, 0}, + { 0, 0, 0, 0}, + {1088, 525,1088, 525}, /* 848x480 */ + {1088, 525,1088, 525} /* 1360x768 TODO */ +}; + +static const XGI_LVDSDataStruct XGI_New_CHTVUNTSCData[]= +{ + { 840, 600, 840, 600}, + { 840, 600, 840, 600}, + { 840, 600, 840, 600}, + { 840, 600, 840, 600}, + { 784, 600, 784, 600}, + {1064, 750,1064, 750}, + {1160, 945,1160, 945} +}; + +static const XGI_LVDSDataStruct XGI_New_CHTVONTSCData[]= +{ + { 840, 525, 840, 525}, + { 840, 525, 840, 525}, + { 840, 525, 840, 525}, + { 840, 525, 840, 525}, + { 784, 525, 784, 525}, + {1040, 700,1040, 700}, + {1160, 840,1160, 840} +}; + +/* Chrontel TV Skew */ + +static const XGI_LVDSDesStruct XGI_CHTVUNTSCDesData[]= +{ + { 0, 0}, + { 0, 0}, + { 0, 0}, + { 0, 0}, + { 0, 0}, + { 0, 0}, + { 0, 0} +}; + +static const XGI_LVDSDesStruct XGI_CHTVONTSCDesData[]= +{ + { 0, 0}, + { 0, 0}, + { 0, 0}, + { 0, 0}, + { 0, 0}, + { 0, 0}, + { 0, 0} +}; + +static const XGI_LVDSDesStruct XGI_CHTVUPALDesData[]= +{ + {256, 0}, + {256, 0}, + {256, 0}, + {256, 0}, + { 0, 0}, + { 0, 0}, + { 0, 0} +}; + +static const XGI_LVDSDesStruct XGI_CHTVOPALDesData[]= +{ + {256, 0}, + {256, 0}, + {256, 0}, + {256, 0}, + { 0, 0}, + { 0, 0}, + { 0, 0} +}; + +/* CRT1 CRTC data for slave modes */ + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT1320x480_1[] = +{ + {{0x65,0x4f,0x89,0x56,0x83,0xaa,0x1f, + 0x90,0x85,0x8f,0xab,0x30,0x00,0x05, + 0x00 }}, + {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f, + 0x5e,0x83,0x5d,0x79,0x10,0x00,0x05, + 0x00 }}, + {{0x65,0x4f,0x89,0x54,0x9f,0xc4,0x1f, + 0x92,0x89,0x8f,0xb5,0x30,0x00,0x01, + 0x00 }}, + {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f, + 0x5e,0x83,0x5d,0x79,0x10,0x00,0x05, + 0x00 }}, + {{0x65,0x4f,0x89,0x56,0x83,0x04,0x3e, + 0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05, + 0x00 }}, + {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0, + 0x58,0x8c,0x57,0x73,0x20,0x00,0x06, + 0x01 }}, + {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e, + 0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00, + 0x00 }} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT1640x480_1[] = +{ + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05, + 0x00}}, + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05, + 0x00}}, + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05, + 0x00}}, + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05, + 0x00}}, + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05, + 0x00}}, + {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0, + 0x58,0x8c,0x57,0x73,0x20,0x00,0x06, + 0x01}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT1640x480_1_H[] = +{ + {{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f, + 0x9c,0x8e,0x96,0xb9,0x00,0x00,0x00, + 0x00}}, + {{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f, + 0x83,0x85,0x63,0xba,0x00,0x00,0x00, + 0x00}}, + {{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f, + 0x9c,0x8e,0x96,0xb9,0x00,0x00,0x00, + 0x00}}, + {{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f, + 0x83,0x85,0x63,0xba,0x00,0x00,0x00, + 0x00}}, + {{0x2d,0x28,0x90,0x2c,0x80,0x0b,0x3e, + 0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00, + 0x00}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT1640x480_2[] = +{ + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05, + 0x00}}, + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05, + 0x00}}, + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05, + 0x00}}, + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05, + 0x00}}, + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05, + 0x00}}, + {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0, + 0x58,0x8c,0x57,0x73,0x20,0x00,0x06, + 0x01}}, + {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e, + 0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00, + 0x00}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT1640x480_2_H[] = +{ + {{0x65,0x4f,0x89,0x56,0x83,0xaa,0x1f, + 0x90,0x85,0x8f,0xab,0x30,0x00,0x05, + 0x00}}, + {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f, + 0x5e,0x83,0x5d,0x79,0x10,0x00,0x05, + 0x00}}, + {{0x65,0x4f,0x89,0x54,0x9f,0xc4,0x1f, + 0x92,0x89,0x8f,0xb5,0x30,0x00,0x01, + 0x00}}, + {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f, + 0x5e,0x83,0x5d,0x79,0x10,0x00,0x05, + 0x00}}, + {{0x65,0x4f,0x89,0x56,0x83,0x04,0x3e, + 0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05, + 0x00}}, + {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0, + 0x58,0x8c,0x57,0x73,0x20,0x00,0x06, + 0x01}}, + {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e, + 0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00, + 0x00}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT1640x480_3[] = +{ + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05, + 0x00}}, + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05, + 0x00}}, + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05, + 0x00}}, + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05, + 0x00}}, + {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e, + 0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05, + 0x00}}, + {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0, + 0x58,0x8c,0x57,0x73,0x20,0x00,0x06, + 0x01}}, + {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e, + 0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00, + 0x00}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT1640x480_3_H[] = +{ + {{0x65,0x4f,0x89,0x56,0x83,0xaa,0x1f, + 0x90,0x85,0x8f,0xab,0x30,0x00,0x05, + 0x00}}, + {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f, + 0x5e,0x83,0x5d,0x79,0x10,0x00,0x05, + 0x00}}, + {{0x65,0x4f,0x89,0x54,0x9f,0xc4,0x1f, + 0x92,0x89,0x8f,0xb5,0x30,0x00,0x01, + 0x00}}, + {{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f, + 0x5e,0x83,0x5d,0x79,0x10,0x00,0x05, + 0x00}}, + {{0x65,0x4f,0x89,0x56,0x83,0x04,0x3e, + 0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05, + 0x00}}, + {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0, + 0x58,0x8c,0x57,0x73,0x20,0x00,0x06, + 0x01}}, + {{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e, + 0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00, + 0x00}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT11024x600_1[] = +{ + {{0x64,0x4f,0x88,0x54,0x9f,0x5a,0x3e, + 0xe8,0x8f,0x8f,0x5b,0x00,0x00,0x01, + 0x00}}, + {{0x64,0x4f,0x88,0x54,0x9f,0x2e,0x3e, + 0xb9,0x80,0x5d,0x2f,0x00,0x00,0x01, + 0x00}}, + {{0x64,0x4f,0x88,0x54,0x9f,0x5a,0x3e, + 0xe8,0x8f,0x8f,0x5b,0x00,0x00,0x01, + 0x00}}, + {{0x64,0x4f,0x88,0x54,0x9f,0x2e,0x3e, + 0xb9,0x80,0x5d,0x2f,0x00,0x00,0x01, + 0x00}}, + {{0x64,0x4f,0x88,0x54,0x9f,0xaf,0xba, + 0x3b,0x82,0xdf,0xb0,0x00,0x00,0x01, + 0x00}}, + {{0x7e,0x63,0x82,0x68,0x15,0x1e,0xf1, + 0xae,0x85,0x57,0x1f,0x30,0x00,0x26, + 0x01}}, + {{0xa3,0x7f,0x87,0x86,0x97,0x1e,0xf1, + 0xae,0x85,0x57,0x1f,0x30,0x00,0x02, + 0x01}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT11024x600_1_H[] = +{ + {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f, + 0x92,0x89,0x8f,0xb5,0x30,0x00,0x44, + 0x00}}, + {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f, + 0x60,0x87,0x5d,0x83,0x10,0x00,0x44, + 0x00}}, + {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f, + 0x92,0x89,0x8f,0xb5,0x30,0x00,0x44, + 0x00}}, + {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f, + 0x60,0x87,0x5d,0x83,0x10,0x00,0x44, + 0x00}}, + {{0x2f,0x27,0x93,0x2b,0x90,0x04,0x3e, + 0xe2,0x89,0xdf,0x05,0x00,0x00,0x44, + 0x00}}, + {{0x3c,0x31,0x80,0x35,0x1c,0x7c,0xf0, + 0x5a,0x8f,0x57,0x7d,0x20,0x00,0x55, + 0x01}}, + {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5, + 0x02,0x88,0xff,0x25,0x10,0x00,0x01, + 0x01}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT11024x600_2[] = +{ + {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb, + 0x4a,0x80,0x8f,0x25,0x30,0x00,0x06, + 0x00}}, + {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb, + 0x31,0x87,0x5d,0x25,0x30,0x00,0x06, + 0x00}}, + {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb, + 0x4a,0x80,0x8f,0x25,0x30,0x00,0x06, + 0x00}}, + {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb, + 0x31,0x87,0x5d,0x25,0x30,0x00,0x06, + 0x00}}, + {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb, + 0x72,0x88,0xdf,0x25,0x30,0x00,0x06, + 0x00}}, + {{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1, + 0xae,0x84,0x57,0x25,0x30,0x00,0x02, + 0x01}}, + {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5, + 0x02,0x88,0xff,0x25,0x10,0x00,0x02, + 0x01}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT11024x600_2_H[] = +{ + {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb, + 0x4a,0x80,0x8f,0x25,0x30,0x00,0x01, + 0x00}}, + {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb, + 0x31,0x87,0x5d,0x25,0x30,0x00,0x01, + 0x00}}, + {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb, + 0x4a,0x80,0x8f,0x25,0x30,0x00,0x01, + 0x00}}, + {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb, + 0x31,0x87,0x5d,0x25,0x30,0x00,0x01, + 0x00}}, + {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb, + 0x72,0x88,0xdf,0x25,0x30,0x00,0x01, + 0x00}}, + {{0x4f,0x31,0x93,0x3e,0x06,0x24,0xf1, + 0xae,0x84,0x57,0x25,0x30,0x00,0x01, + 0x01}}, + {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5, + 0x02,0x88,0xff,0x25,0x10,0x00,0x01, + 0x01}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT11152x768_1[] = +{ + {{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f, + 0x92,0x89,0x8f,0xb5,0x30,0x00,0x01, + 0x00}}, + {{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f, + 0x60,0x87,0x5d,0x83,0x10,0x00,0x01, + 0x00}}, + {{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f, + 0x92,0x89,0x8f,0xb5,0x30,0x00,0x01, + 0x00}}, + {{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f, + 0x60,0x87,0x5d,0x83,0x10,0x00,0x01, + 0x00}}, + {{0x64,0x4f,0x88,0x54,0x9f,0x04,0x3e, + 0xe2,0x89,0xdf,0x05,0x00,0x00,0x01, + 0x00}}, + {{0x7e,0x63,0x82,0x68,0x15,0x7c,0xf0, + 0x5a,0x8f,0x57,0x7d,0x20,0x00,0x26, + 0x01}}, + {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5, + 0x02,0x88,0xff,0x25,0x10,0x00,0x02, + 0x01}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT11152x768_1_H[] = +{ + {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f, + 0x92,0x89,0x8f,0xb5,0x30,0x00,0x44, + 0x00}}, + {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f, + 0x60,0x87,0x5d,0x83,0x10,0x00,0x44, + 0x00}}, + {{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f, + 0x92,0x89,0x8f,0xb5,0x30,0x00,0x44, + 0x00}}, + {{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f, + 0x60,0x87,0x5d,0x83,0x10,0x00,0x44, + 0x00}}, + {{0x2f,0x27,0x93,0x2b,0x90,0x04,0x3e, + 0xe2,0x89,0xdf,0x05,0x00,0x00,0x44, + 0x00}}, + {{0x3c,0x31,0x80,0x35,0x1c,0x7c,0xf0, + 0x5a,0x8f,0x57,0x7d,0x20,0x00,0x55, + 0x01}}, + {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5, + 0x02,0x88,0xff,0x25,0x10,0x00,0x01, + 0x01}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT11152x768_2[] = +{ + {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb, + 0x4a,0x80,0x8f,0x25,0x30,0x00,0x06, + 0x00}}, + {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb, + 0x31,0x87,0x5d,0x25,0x30,0x00,0x06, + 0x00}}, + {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb, + 0x4a,0x80,0x8f,0x25,0x30,0x00,0x06, + 0x00}}, + {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb, + 0x31,0x87,0x5d,0x25,0x30,0x00,0x06, + 0x00}}, + {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb, + 0x72,0x88,0xdf,0x25,0x30,0x00,0x06, + 0x00}}, + {{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1, + 0xae,0x84,0x57,0x25,0x30,0x00,0x02, + 0x01}}, + {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5, + 0x02,0x88,0xff,0x25,0x10,0x00,0x02, + 0x01}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT11152x768_2_H[] = +{ + {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb, + 0x4a,0x80,0x8f,0x25,0x30,0x00,0x01, + 0x00}}, + {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb, + 0x31,0x87,0x5d,0x25,0x30,0x00,0x01, + 0x00}}, + {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb, + 0x4a,0x80,0x8f,0x25,0x30,0x00,0x01, + 0x00}}, + {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb, + 0x31,0x87,0x5d,0x25,0x30,0x00,0x01, + 0x00}}, + {{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb, + 0x72,0x88,0xdf,0x25,0x30,0x00,0x01, + 0x00}}, + {{0x4f,0x31,0x93,0x3e,0x06,0x24,0xf1, + 0xae,0x84,0x57,0x25,0x30,0x00,0x01, + 0x01}}, + {{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5, + 0x02,0x88,0xff,0x25,0x10,0x00,0x01, + 0x01}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT11280x768_1[] = +{ + {{0x5b,0x4f,0x9f,0x55,0x19,0xb4,0x1f, + 0x9c,0x8e,0x8f,0xb5,0x10,0x00,0x01, + 0x00}}, + {{0x5b,0x4f,0x9f,0x55,0x19,0x82,0x1f, + 0x6a,0x8c,0x5d,0x83,0x30,0x00,0x01, + 0x00}}, + {{0x5b,0x4f,0x9f,0x55,0x19,0xb4,0x1f, + 0x9c,0x8e,0x8f,0xb5,0x10,0x00,0x01, + 0x00}}, + {{0x5b,0x4f,0x9f,0x55,0x19,0x82,0x1f, + 0x6a,0x8c,0x5d,0x83,0x30,0x00,0x01, + 0x00}}, + {{0x5b,0x4f,0x9f,0x55,0x19,0x04,0x3e, + 0xec,0x8e,0xdf,0x05,0x20,0x00,0x01, + 0x00}}, + {{0x6f,0x63,0x93,0x69,0x8d,0x7c,0xf0, + 0x64,0x86,0x57,0x7d,0x20,0x00,0x05, + 0x01}}, + {{0x8b,0x7f,0x8f,0x85,0x09,0x24,0xf5, + 0x0c,0x8e,0xff,0x25,0x30,0x00,0x02, + 0x01}}, + {{0xab,0x9f,0x8f,0xa5,0x89,0x24,0xf5, + 0x0c,0x8e,0xff,0x25,0x30,0x00,0x06, + 0x01}}, + {{0xab,0x9f,0x8f,0xa5,0x89,0x24,0xf5, + 0x0c,0x8e,0xff,0x25,0x30,0x00,0x06, + 0x01}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT11280x768_1_H[] = +{ + {{0x47,0x27,0x8b,0x2c,0x1a,0x9e,0x1f, + 0x93,0x86,0x8f,0x9f,0x30,0x00,0x05, + 0x00}}, + {{0x47,0x27,0x8b,0x2c,0x1a,0x6c,0x1f, + 0x60,0x84,0x5d,0x6d,0x10,0x00,0x05, + 0x00}}, + {{0x47,0x27,0x8b,0x30,0x1e,0x9e,0x1f, + 0x92,0x86,0x8f,0x9f,0x30,0x00,0x05, + 0x00}}, + {{0x47,0x27,0x8b,0x2c,0x1a,0x6c,0x1f, + 0x60,0x84,0x5d,0x6d,0x10,0x00,0x05, + 0x00}}, + {{0x47,0x27,0x8b,0x2c,0x1a,0xee,0x1f, + 0xe2,0x86,0xdf,0xef,0x10,0x00,0x05, + 0x00}}, + {{0x51,0x31,0x95,0x36,0x04,0x66,0xf0, + 0x5a,0x8e,0x57,0x67,0x20,0x00,0x01, + 0x01}}, + {{0x5f,0x3f,0x83,0x44,0x92,0x0e,0xf5, + 0x02,0x86,0xff,0x0f,0x10,0x00,0x01, + 0x01}}, + {{0x6f,0x4f,0x93,0x54,0x82,0x0e,0x5a, + 0x02,0x86,0xff,0x0f,0x09,0x00,0x05, + 0x01}}, + {{0x6f,0x4f,0x93,0x54,0x82,0x0e,0x5a, + 0x02,0x86,0xff,0x0f,0x09,0x00,0x05, + 0x01}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT11280x768_2[] = +{ + {{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb, + 0x54,0x86,0xdb,0xda,0x00,0x00,0x02, + 0x00}}, + {{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb, + 0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x02, + 0x00}}, + {{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb, + 0x54,0x86,0xdb,0xda,0x00,0x00,0x02, + 0x00}}, + {{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb, + 0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x02, + 0x00}}, + {{0xab,0x60,0x9f,0x80,0x04,0x24,0xb3, + 0x7c,0x8e,0x03,0x02,0x10,0x00,0x02, + 0x01}}, + {{0xab,0x63,0x8f,0x8a,0x8e,0x24,0xf1, + 0xb6,0x88,0x57,0x25,0x10,0x00,0x02, + 0x01}}, + {{0xab,0x7f,0x8f,0x98,0x9c,0x24,0xf5, + 0x0a,0x8c,0xff,0x25,0x30,0x00,0x02, + 0x01}}, + {{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5, + 0x0a,0x8c,0xff,0x25,0x30,0x00,0x06, + 0x01}}, + {{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5, + 0x0a,0x8c,0xff,0x25,0x30,0x00,0x06, + 0x01}} +}; + +static const XGI_LVDSCRT1DataStruct XGI_LVDSCRT11280x768_2_H[] = +{ + {{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb, + 0x54,0x86,0xdb,0xda,0x00,0x00,0x01, + 0x00}}, + {{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb, + 0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x01, + 0x00}}, + {{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb, + 0x54,0x86,0xdb,0xda,0x00,0x00,0x01, + 0x00}}, + {{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb, + 0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x01, + 0x00}}, + {{0x83,0x38,0x97,0x58,0x9c,0x24,0xb3, + 0x7c,0x8e,0x03,0x02,0x10,0x00,0x01, + 0x01}}, + {{0x79,0x31,0x9d,0x58,0x9c,0x24,0xf1, + 0xb6,0x88,0x57,0x25,0x10,0x00,0x01, + 0x01}}, + {{0x6b,0x3f,0x8f,0x58,0x9c,0x24,0xf5, + 0x0a,0x8c,0xff,0x25,0x30,0x00,0x01, + 0x01}}, + {{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5, + 0x0a,0x8c,0xff,0x25,0x30,0x00,0x06, + 0x01}}, + {{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5, + 0x0a,0x8c,0xff,0x25,0x30,0x00,0x06, + 0x01}} +}; + +/**************************************************************/ +/* COMMON --------------------------------------------------- */ +/**************************************************************/ + +#define XGI_PL_HSYNCP 0x01 +#define XGI_PL_HSYNCN 0x02 +#define XGI_PL_VSYNCP 0x04 +#define XGI_PL_VSYNCN 0x08 +#define XGI_PL_DVI 0x80 + +typedef struct _XGI_PlasmaModes +{ + const char *name; + ULONG clock; + USHORT HDisplay, HTotal, HFrontPorch, HSyncWidth; + USHORT VDisplay, VTotal, VFrontPorch, VSyncWidth; + UCHAR SyncFlags; +} XGI_PlasmaModes; + +typedef struct _XGI_PlasmaTables +{ + USHORT vendor; + UCHAR productnum; + USHORT product[5]; + const char *DDCnames[5]; + const char *plasmaname; + UCHAR modenum; + UCHAR plasmamodes[20]; /* | 0x80 = DVI-capable, | 0x40 = analog */ +} XGI_PlasmaTables; + +static const XGI_PlasmaModes XGI_PlasmaMode[] = { + { "640x400", /* 00: IBM 400@70 */ + 25175, + 640, 800, 17, 64, + 400, 449, 13, 2, + XGI_PL_HSYNCN | XGI_PL_VSYNCN }, + { "640x480", /* 01: VESA 480@72 */ + 31500, + 640, 832, 24, 40, + 480, 520, 9, 3, + XGI_PL_HSYNCN | XGI_PL_VSYNCN }, + { "800x600", /* 02: VESA 600@72 */ + 50000, + 800, 1040, 56, 120, + 600, 666, 37, 6, + XGI_PL_HSYNCP | XGI_PL_VSYNCP }, + { "864x480", /* 03: Cereb wide 1 */ + 42526, + 864, 1134, 22, 86, + 480, 500, 1, 3, + XGI_PL_HSYNCP | XGI_PL_VSYNCN }, + { "848x480", /* 04: VESA wide (NEC1) */ + 33750, + 848, 1088, 16, 112, + 480, 517, 6, 8, + XGI_PL_HSYNCP | XGI_PL_VSYNCP }, + { "1024x576", /* 05: VESA wide (NEC2) */ + 47250, + 1024, 1320, 16, 144, + 576, 596, 2, 4, + XGI_PL_HSYNCP | XGI_PL_VSYNCP }, + { "1280x720", /* 06: VESA wide (NEC3) */ + 76500, + 1280, 1696, 48, 176, + 720, 750, 4, 8, + XGI_PL_HSYNCP | XGI_PL_VSYNCP }, + { "1360x765", /* 07: VESA wide (NEC4) */ + 85500, + 1360, 1792, 64, 176, + 765, 795, 4, 8, + XGI_PL_HSYNCP | XGI_PL_VSYNCP }, + { "1024x600", /* 08: CEREB wide 2 */ + 51200, + 1024, 1352, 51, 164, + 600, 628, 1, 4, + XGI_PL_HSYNCN | XGI_PL_VSYNCP }, + { "1024x768", /* 09: VESA 768@75 */ + 78750, + 1024, 1312, 16, 96, + 768, 800, 1, 3, + XGI_PL_HSYNCP | XGI_PL_VSYNCP }, + { "1152x864", /* 10: VESA 1152x864@75 */ + 108000, + 1152, 1600, 64, 128, + 864, 900, 1, 3, + XGI_PL_HSYNCP | XGI_PL_VSYNCP }, + { "1280x1024", /* 11: VESA 1024@60 */ + 108000, + 1280, 1688, 48, 112, + 1024, 1066, 1, 3, + XGI_PL_HSYNCP | XGI_PL_VSYNCP }, + { "1280x768", /* 12: W_XGA */ + 81000, + 1280, 1688, 48, 112, + 768, 802, 3, 6, + XGI_PL_HSYNCP | XGI_PL_VSYNCN }, + { "1280x768", /* 13: I/O Data W_XGA@56Hz */ + 76064, + 1280, 1688, 48, 112, + 768, 802, 2, 3, + XGI_PL_HSYNCP | XGI_PL_VSYNCP }, + { "1376x768", /* 14: I/O Wide XGA */ + 87340, + 1376, 1808, 32, 128, + 768, 806, 3, 6, + XGI_PL_HSYNCN | XGI_PL_VSYNCP }, + { "1280x960", /* 15: VESA 960@60 */ + 108000, + 1280, 1800, 96, 112, + 960, 1000, 1, 3, + XGI_PL_HSYNCP | XGI_PL_VSYNCP }, + { "1400x1050", /* 16: VESA 1050@60Hz */ + 108000, + 1400, 1688, 48, 112, + 1050, 1066, 1, 3, + XGI_PL_HSYNCN | XGI_PL_VSYNCN }, + { "1360x768", /* 17: VESA wide (NEC4/2) */ + 85500, + 1360, 1792, 64, 112, + 765, 795, 3, 6, + XGI_PL_HSYNCP | XGI_PL_VSYNCP }, + { "800x600", /* 18: VESA 600@56 */ + 36000, + 800, 1024, 24, 2, + 600, 625, 1, 2, + XGI_PL_HSYNCP | XGI_PL_VSYNCP }, + { "1072x600", /* 19: Panasonic 1072x600 (sync?) */ + 54100, + 1072, 1424, 48, 176, + 600, 628, 16, 1, + XGI_PL_HSYNCP | XGI_PL_VSYNCP }, + { "848x480", /* 20: Panasonic 848x480 (sync?) */ + 33070, /* is 852x480, but we can't use 852 */ + 848, 1068, 20, 40, /* differs from DDC data, better centered */ + 480, 516, 3, 5, /* won't work assumingly, because data is % 8 */ + XGI_PL_HSYNCN | XGI_PL_VSYNCN }, +}; + +static const XGI_PlasmaTables XGI_PlasmaTable[] = { + + { 0x38a3, 4, + { 0xa482, 0xa483, 0x0000, 0x0000, 0x0000 }, + { "PX-42VM", "", "", "", "" }, + "NEC PlasmaSync 42MP3/42MP4/50MP2/61MP1", + 11, /* All DVI except 0, 7, 13, 17 */ + { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,10|0xc0,11|0xc0,13|0x40,14|0xc0, + 17|0x40, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } + }, + + { 0x412f, 2, + { 0x000c, 0x000b, 0x0000, 0x0000, 0x0000 }, + { "", "", "", "", "" }, + "Pioneer 503CMX/PDA-5002", + 6, /* DVI unknown */ + { 1|0xc0, 2|0xc0, 9|0xc0,11|0xc0,12|0xc0,15|0xc0, 0 , 0 , 0 , 0 , + 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } + }, + { 0x34a9, 1, + { 0xa00e, 0x0000, 0x0000, 0x0000, 0x0000 }, + { "", "", "", "", "" }, + "Panasonic TH-42", + 5, /* No DVI output */ + { 1|0x40, 2|0x40, 4|0x40, 9|0x40,15|0x40, 0 , 0 , 0 , 0 , 0 , + 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } + }, + { 0x34a9, 1, + { 0xa005, 0x0000, 0x0000, 0x0000, 0x0000 }, + { "TH-42PW*4", "", "", "", "" }, + "Panasonic TH-42PW5", + 1, /* No special modes otherwise; no DVI. */ + {20|0x40,19|0x40, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , + 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } + }, + { 0x0000 } +}; + +USHORT XGI_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, + int Depth, BOOLEAN FSTN, int LCDwith, int LCDheight); + +void XGI_SetReg(XGIIOADDRESS port, USHORT index, USHORT data); +void XGI_SetRegByte(XGIIOADDRESS port, USHORT data); +void XGI_SetRegShort(XGIIOADDRESS port, USHORT data); +void XGI_SetRegLong(XGIIOADDRESS port, ULONG data); +UCHAR XGI_GetReg(XGIIOADDRESS port, USHORT index); +UCHAR XGI_GetRegByte(XGIIOADDRESS port); +USHORT XGI_GetRegShort(XGIIOADDRESS port); +ULONG XGI_GetRegLong(XGIIOADDRESS port); +void XGI_SetRegANDOR(XGIIOADDRESS Port,USHORT Index,USHORT DataAND,USHORT DataOR); +void XGI_SetRegAND(XGIIOADDRESS Port,USHORT Index,USHORT DataAND); +void XGI_SetRegOR(XGIIOADDRESS Port,USHORT Index,USHORT DataOR); +void XGI_New_DisplayOn(XGI_Private *XGI_Pr); +void XGI_New_DisplayOff(XGI_Private *XGI_Pr); +void XGIRegInit(XGI_Private *XGI_Pr, XGIIOADDRESS BaseAddr); + +void XGI_SetEnableDstn(XGI_Private *XGI_Pr, int enable); +void XGI_SetEnableFstn(XGI_Private *XGI_Pr, int enable); +void XGI_New_GetVBType(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo); +USHORT XGI_GetMCLK(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo); +BOOLEAN XGI_New_SearchModeID(XGI_Private *XGI_Pr, USHORT *ModeNo, USHORT *ModeIdIndex); +UCHAR XGI_New_GetModePtr(XGI_Private *XGI_Pr, USHORT ModeNo, USHORT ModeIdIndex); +USHORT XGI_New_GetColorDepth(XGI_Private *XGI_Pr, USHORT ModeNo, USHORT ModeIdIndex); +USHORT XGI_New_GetOffset(XGI_Private *XGI_Pr,USHORT ModeNo,USHORT ModeIdIndex, + USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwInfo); +void XGI_New_LoadDAC(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, USHORT ModeNo, USHORT ModeIdIndex); +void XGI_CalcLCDACRT1Timing(XGI_Private *XGI_Pr,USHORT ModeNo,USHORT ModeIdIndex); +#ifdef LINUX_XF86 +BOOLEAN XGISetMode(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo,ScrnInfoPtr pScrn,USHORT ModeNo, BOOLEAN dosetpitch); +BOOLEAN XGIBIOSSetMode(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, ScrnInfoPtr pScrn, + DisplayModePtr mode, BOOLEAN IsCustom, BOOLEAN dosetpitch); + +BOOLEAN XGIBIOSSetModeCRT1(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, ScrnInfoPtr pScrn, + DisplayModePtr mode, BOOLEAN IsCustom); + +USHORT XGI_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int VBFlags); + +#else +BOOLEAN XGISetMode(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo,USHORT ModeNo); +#endif + +extern USHORT XGI_GetCH700x(XGI_Private *XGI_Pr, USHORT tempax); +extern BOOLEAN XGI_IsVAMode(XGI_Private *, PXGI_HW_DEVICE_INFO); +extern BOOLEAN XGI_IsDualEdge(XGI_Private *, PXGI_HW_DEVICE_INFO); + +#ifdef LINUX_XF86 +extern void XGICalcClock(ScrnInfoPtr pScrn, int clock, int max_VLD, unsigned int *vclk); + +extern unsigned char XGI_GetSetBIOSScratch(ScrnInfoPtr pScrn, USHORT offset, unsigned char value); +extern unsigned char XGI_GetSetModeID(ScrnInfoPtr pScrn, unsigned char id); +extern USHORT XGI_CalcModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned long VBFlags, + BOOLEAN hcm); +#endif + +#endif + Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/initdef.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/initdef.h:1.1 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/initdef.h Mon May 2 09:28:02 2005 @@ -0,0 +1,632 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/initdef.h,v 1.1 2005/05/02 13:28:02 dawes Exp $ */ +/* + * Global definitions for init.c and init301.c + * + * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria + * + * If distributed as part of the Linux kernel, the following license terms + * apply: + * + * * This program is free software; you can redistribute it and/or modify + * * it under the terms of the GNU General Public License as published by + * * the Free Software Foundation; either version 2 of the named License, + * * or any later version. + * * + * * This program is distributed in the hope that it will be useful, + * * but WITHOUT ANY WARRANTY; without even the implied warranty of + * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * * GNU General Public License for more details. + * * + * * You should have received a copy of the GNU General Public License + * * along with this program; if not, write to the Free Software + * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + * + * Otherwise, the following license terms apply: + * + * * Redistribution and use in source and binary forms, with or without + * * modification, are permitted provided that the following conditions + * * are met: + * * 1) Redistributions of source code must retain the above copyright + * * notice, this list of conditions and the following disclaimer. + * * 2) Redistributions in binary form must reproduce the above copyright + * * notice, this list of conditions and the following disclaimer in the + * * documentation and/or other materials provided with the distribution. + * * 3) The name of the author may not be used to endorse or promote products + * * derived from this software without specific prior written permission. + * * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR + * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Author: Thomas Winischhofer <thomas@winischhofer.net> + * + */ + +#ifndef _INITDEF_ +#define _INITDEF_ + +#define XGIGETROMW(x) (ROMAddr[(x)] | (ROMAddr[(x)+1] << 8)) + + +#define VB_XGI301 0x0001 +#define VB_XGI301B 0x0002 +#define VB_XGI302B 0x0004 +#define VB_XGI301LV 0x0008 +#define VB_XGI302LV 0x0010 +#define VB_XGI302ELV 0x0020 +#define VB_XGI301C 0x0040 +#define VB_NoLCD 0x8000 +#define VB_XGI301BLV302BLV (VB_XGI301B|VB_XGI301C|VB_XGI302B|VB_XGI301LV|VB_XGI302LV|VB_XGI302ELV) +#define VB_XGI301B302B (VB_XGI301B|VB_XGI301C|VB_XGI302B) +#define VB_XGI301LV302LV (VB_XGI301LV|VB_XGI302LV|VB_XGI302ELV) +#define VB_XGIVB (VB_XGI301 | VB_XGI301BLV302BLV) + +/* VBInfo */ +#define SetSimuScanMode 0x0001 /* CR 30 */ +#define SwitchCRT2 0x0002 +#define SetCRT2ToAVIDEO 0x0004 +#define SetCRT2ToSVIDEO 0x0008 +#define SetCRT2ToSCART 0x0010 +#define SetCRT2ToLCD 0x0020 +#define SetCRT2ToRAMDAC 0x0040 +#define SetCRT2ToHiVision 0x0080 +#define SetCRT2ToCHYPbPr SetCRT2ToHiVision /* for Chrontel */ +#define SetNTSCTV 0x0000 /* CR 31 */ +#define SetPALTV 0x0100 /* Deprecated here, now in TVMode */ +#define SetInSlaveMode 0x0200 +#define SetNotSimuMode 0x0400 +#define SetNotSimuTVMode SetNotSimuMode +#define SetDispDevSwitch 0x0800 +#define SetCRT2ToYPbPr525750 0x0800 +#define LoadDACFlag 0x1000 +#define DisableCRT2Display 0x2000 +#define DriverMode 0x4000 +#define HotKeySwitch 0x8000 +#define SetCRT2ToLCDA 0x8000 + +/* v-- Needs change in xgi_vga.c if changed (GPIO) --v */ +#define SetCRT2ToTV (SetCRT2ToYPbPr525750|SetCRT2ToHiVision|SetCRT2ToSCART|SetCRT2ToSVIDEO|SetCRT2ToAVIDEO) +#define SetCRT2ToTVNoYPbPrHiVision (SetCRT2ToSCART | SetCRT2ToSVIDEO | SetCRT2ToAVIDEO) +#define SetCRT2ToTVNoHiVision (SetCRT2ToYPbPr525750 | SetCRT2ToSCART | SetCRT2ToSVIDEO | SetCRT2ToAVIDEO) + +/* XGI_ModeType */ +#define ModeText 0x00 +#define ModeCGA 0x01 +#define ModeEGA 0x02 +#define ModeVGA 0x03 +#define Mode15Bpp 0x04 +#define Mode16Bpp 0x05 +#define Mode24Bpp 0x06 +#define Mode32Bpp 0x07 + +#define ModeInfoFlag 0x07 +#define IsTextMode 0x07 + +#define DACInfoFlag 0x0018 +#define MemoryInfoFlag 0x01E0 +#define MemorySizeShift 5 + +/* modeflag */ +#define Charx8Dot 0x0200 +#define LineCompareOff 0x0400 +#define CRT2Mode 0x0800 +#define HalfDCLK 0x1000 +#define NoSupportSimuTV 0x2000 +#define DoubleScanMode 0x8000 + +/* Infoflag */ +#define SupportTV 0x0008 +#define SupportTV1024 0x0800 +#define SupportCHTV 0x0800 +#define Support64048060Hz 0x0800 /* Special for 640x480 LCD */ +#define SupportHiVision 0x0010 +#define SupportYPbPr750p 0x1000 +#define SupportLCD 0x0020 +#define SupportRAMDAC2 0x0040 /* All (<= 100Mhz) */ +#define SupportRAMDAC2_135 0x0100 /* All except DH (<= 135Mhz) */ +#define SupportRAMDAC2_162 0x0200 /* B, C (<= 162Mhz) */ +#define SupportRAMDAC2_202 0x0400 /* C (<= 202Mhz) */ +#define InterlaceMode 0x0080 +#define SyncPP 0x0000 +#define SyncPN 0x4000 +#define SyncNP 0x8000 +#define SyncNN 0xc000 + +/* SetFlag */ +#define ProgrammingCRT2 0x0001 +#define LowModeTests 0x0002 +/* #define TVSimuMode 0x0002 - deprecated */ +/* #define RPLLDIV2XO 0x0004 - deprecated */ +#define LCDVESATiming 0x0008 +#define EnableLVDSDDA 0x0010 +#define SetDispDevSwitchFlag 0x0020 +#define CheckWinDos 0x0040 +#define SetDOSMode 0x0080 + +/* TVMode flag */ +#define TVSetPAL 0x0001 +#define TVSetNTSCJ 0x0002 +#define TVSetPALM 0x0004 +#define TVSetPALN 0x0008 +#define TVSetCHOverScan 0x0010 +#define TVSetYPbPr525i 0x0020 /* new 0x10 */ +#define TVSetYPbPr525p 0x0040 /* new 0x20 */ +#define TVSetYPbPr750p 0x0080 /* new 0x40 */ +#define TVSetHiVision 0x0100 /* new 0x80; = 1080i, software-wise identical */ +#define TVSetTVSimuMode 0x0200 /* new 0x200, prev. 0x800 */ +#define TVRPLLDIV2XO 0x0400 /* prev 0x1000 */ +#define TVSetNTSC1024 0x0800 /* new 0x100, prev. 0x2000 */ +#define TVAspect43 0x2000 +#define TVAspect169 0x4000 +#define TVAspect43LB 0x8000 + +/* YPbPr flag (>=315, <661; converted to TVMode) */ +#define YPbPr525p 0x0001 +#define YPbPr750p 0x0002 +#define YPbPr525i 0x0004 +#define YPbPrHiVision 0x0008 +#define YPbPrModeMask (YPbPr750p | YPbPr525p | YPbPr525i | YPbPrHiVision) + +/* SysFlags (to identify special versions) */ +#define SF_Is651 0x0001 +#define SF_IsM650 0x0002 +#define SF_Is652 0x0004 +#define SF_IsM652 0x0008 +#define SF_IsM653 0x0010 +#define SF_IsM661 0x0020 +#define SF_IsM741 0x0040 +#define SF_IsM760 0x0080 +#define SF_760UMA 0x8000 + +/* CR32 (Newer 630, and 315 series) + + [0] VB connected with CVBS + [1] VB connected with SVHS + [2] VB connected with SCART + [3] VB connected with LCD + [4] VB connected with CRT2 (secondary VGA) + [5] CRT1 monitor is connected + [6] VB connected with Hi-Vision TV + [7] <= 330: VB connected with DVI combo connector + >= 661: VB connected to YPbPr +*/ + +/* CR35 (300 series only) */ +#define TVOverScan 0x10 +#define TVOverScanShift 4 + +/* CR35 (661 series only) + + [0] 1 = PAL, 0 = NTSC + [1] 1 = NTSC-J (if D0 = 0) + [2] 1 = PALM (if D0 = 1) + [3] 1 = PALN (if D0 = 1) + [4] 1 = Overscan (Chrontel only) + [7:5] (only if D2 in CR38 is set) + 000 525i + 001 525p + 010 750p + 011 1080i (or HiVision on 301, 301B) + + These bits are being translated to TVMode flag. + +*/ + +/* + CR37 + + [0] Set 24/18 bit (0/1) RGB to LVDS/TMDS transmitter (set by BIOS) + [3:1] External chip + 300 series: + 001 XGI301 (never seen) + 010 LVDS + 011 LVDS + Tumpion Zurac + 100 LVDS + Chrontel 7005 + 110 Chrontel 7005 + 315/330 series + 001 XGI30x (never seen) + 010 LVDS + 011 LVDS + Chrontel 7019 + 660 series [2:1] only: + reserved (now in CR38) + All other combinations reserved + [3] 661 only: Pass 1:1 data + [4] LVDS: 0: Panel Link expands / 1: Panel Link does not expand + 30x: 0: Bridge scales / 1: Bridge does not scale = Panel scales (if possible) + [5] LCD polarity select + 0: VESA DMT Standard + 1: EDID 2.x defined + [6] LCD horizontal polarity select + 0: High active + 1: Low active + [7] LCD vertical polarity select + 0: High active + 1: Low active +*/ + +/* CR37: LCDInfo */ +#define LCDRGB18Bit 0x0001 +#define LCDNonExpanding 0x0010 +#define LCDSync 0x0020 +#define LCDPass11 0x0100 /* 0: center screen, 1: Pass 1:1 data */ +#define LCDDualLink 0x0200 + +#define DontExpandLCD LCDNonExpanding +#define LCDNonExpandingShift 4 +#define DontExpandLCDShift LCDNonExpandingShift +#define LCDSyncBit 0x00e0 +#define LCDSyncShift 6 + +/* CR38 (315 series) */ +#define EnableDualEdge 0x01 +#define SetToLCDA 0x02 /* LCD channel A (301C/302B/30x(E)LV and 650+LVDS only) */ +#define EnableCHScart 0x04 /* Scart on Ch7019 (unofficial definition - TW) */ +#define EnableCHYPbPr 0x08 /* YPbPr on Ch7019 (480i HDTV); only on 650/Ch7019 systems */ +#define EnableXGIYPbPr 0x08 /* Enable YPbPr mode (30xLV/301C only) */ +#define EnableYPbPr525i 0x00 /* Enable 525i YPbPr mode (30xLV/301C only) (mask 0x30) */ +#define EnableYPbPr525p 0x10 /* Enable 525p YPbPr mode (30xLV/301C only) (mask 0x30) */ +#define EnableYPbPr750p 0x20 /* Enable 750p YPbPr mode (30xLV/301C only) (mask 0x30) */ +#define EnableYPbPr1080i 0x30 /* Enable 1080i YPbPr mode (30xLV/301C only) (mask 0x30) */ +#define EnablePALM 0x40 /* 1 = Set PALM */ +#define EnablePALN 0x80 /* 1 = Set PALN */ +#define EnableNTSCJ EnablePALM /* Not BIOS */ + +/* CR38 (661 and later) + D[7:5] 000 No VB + 001 301 series VB + 010 LVDS + 011 Chrontel 7019 + 100 Conexant + D2 Enable YPbPr output (see CR35) + D[1:0] LCDA (like before) +*/ + +#define EnablePALMN 0x40 /* Romflag: 1 = Allow PALM/PALN */ + +/* CR39 (650 only) */ +#define LCDPass1_1 0x01 /* 0: center screen, 1: pass 1:1 data output */ +#define Enable302LV_DualLink 0x04 /* 302LV only; enable dual link */ + +/* CR39 (661 and later) + D[1:0] YPbPr Aspect Ratio + 00 4:3 letterbox + 01 4:3 + 10 16:9 + 11 4:3 +*/ + +/* CR3B (651+301C) + D[1:0] YPbPr Aspect Ratio + ? +*/ + +/* CR79 (315/330 series only; not 661 and later) + [3-0] Notify driver + 0001 Mode Switch event (set by BIOS) + 0010 Epansion On/Off event + 0011 TV UnderScan/OverScan event + 0100 Set Brightness event + 0101 Set Contrast event + 0110 Set Mute event + 0111 Set Volume Up/Down event + [4] Enable Backlight Control by BIOS/driver + (set by driver; set means that the BIOS should + not touch the backlight registers because eg. + the driver already switched off the backlight) + [5] PAL/NTSC (set by BIOS) + [6] Expansion On/Off (set by BIOS; copied to CR32[4]) + [7] TV UnderScan/OverScan (set by BIOS) +*/ + +/* LCDResInfo */ +#define Panel300_800x600 0x01 /* CR36 */ +#define Panel300_1024x768 0x02 +#define Panel300_1280x1024 0x03 +#define Panel300_1280x960 0x04 +#define Panel300_640x480 0x05 +#define Panel300_1024x600 0x06 +#define Panel300_1152x768 0x07 +#define Panel300_1280x768 0x0a +#define Panel300_320x480 0x0e /* fstn - This is fake, can be any */ +#define Panel300_Custom 0x0f +#define Panel300_Barco1366 0x10 + +#define Panel310_800x600 0x01 +#define Panel310_1024x768 0x02 +#define Panel310_1280x1024 0x03 +#define Panel310_640x480 0x04 +#define Panel310_1024x600 0x05 +#define Panel310_1152x864 0x06 +#define Panel310_1280x960 0x07 +#define Panel310_1152x768 0x08 /* LVDS only */ +#define Panel310_1400x1050 0x09 +#define Panel310_1280x768 0x0a +#define Panel310_1600x1200 0x0b +#define Panel310_640x480_2 0x0c +#define Panel310_640x480_3 0x0d +#define Panel310_320x480 0x0e /* fstn - TW: This is fake, can be any */ +#define Panel310_Custom 0x0f + +#define Panel661_800x600 0x01 +#define Panel661_1024x768 0x02 +#define Panel661_1280x1024 0x03 +#define Panel661_640x480 0x04 +#define Panel661_1024x600 0x05 +#define Panel661_1152x864 0x06 +#define Panel661_1280x960 0x07 +#define Panel661_1152x768 0x08 +#define Panel661_1400x1050 0x09 +#define Panel661_1280x768 0x0a +#define Panel661_1600x1200 0x0b +#define Panel661_1280x800 0x0c +#define Panel661_1680x1050 0x0d +#define Panel661_1280x720 0x0e +#define Panel661_Custom 0x0f + +#define Panel_800x600 0x01 /* Unified values */ +#define Panel_1024x768 0x02 /* MUST match BIOS values from 0-e */ +#define Panel_1280x1024 0x03 +#define Panel_640x480 0x04 +#define Panel_1024x600 0x05 +#define Panel_1152x864 0x06 +#define Panel_1280x960 0x07 +#define Panel_1152x768 0x08 /* LVDS only */ +#define Panel_1400x1050 0x09 +#define Panel_1280x768 0x0a /* 30xB/C and LVDS only (BIOS: all) */ +#define Panel_1600x1200 0x0b +#define Panel_1280x800 0x0c /* 661etc */ +#define Panel_1680x1050 0x0d /* 661etc */ +#define Panel_1280x720 0x0e /* 661etc */ +#define Panel_Custom 0x0f /* MUST BE 0x0f (for DVI DDC detection */ +#define Panel_320x480 0x10 +#define Panel_Barco1366 0x11 +#define Panel_848x480 0x12 +#define Panel_640x480_2 0x13 +#define Panel_640x480_3 0x14 +#define Panel_1280x768_2 0x15 /* 30xLV */ +#define Panel_1280x768_3 0x16 /* 30xLV */ + +/* Index in ModeResInfo table */ +#define XGI_RI_320x200 0 +#define XGI_RI_320x240 1 +#define XGI_RI_320x400 2 +#define XGI_RI_400x300 3 +#define XGI_RI_512x384 4 +#define XGI_RI_640x400 5 +#define XGI_RI_640x480 6 +#define XGI_RI_800x600 7 +#define XGI_RI_1024x768 8 +#define XGI_RI_1280x1024 9 +#define XGI_RI_1600x1200 10 +#define XGI_RI_1920x1440 11 +#define XGI_RI_2048x1536 12 +#define XGI_RI_720x480 13 +#define XGI_RI_720x576 14 +#define XGI_RI_1280x960 15 +#define XGI_RI_800x480 16 +#define XGI_RI_1024x576 17 +#define XGI_RI_1280x720 18 +#define XGI_RI_856x480 19 +#define XGI_RI_1280x768 20 +#define XGI_RI_1400x1050 21 +#define XGI_RI_1152x864 22 +#define XGI_RI_848x480 23 +#define XGI_RI_1360x768 24 +#define XGI_RI_1024x600 25 +#define XGI_RI_1152x768 26 +#define XGI_RI_768x576 27 +#define XGI_RI_1360x1024 28 +#define XGI_RI_1680x1050 29 +#define XGI_RI_1280x800 30 + +/* CR5F */ +#define IsM650 0x80 + +/* Timing data */ +#define NTSCHT 1716 +#define NTSC2HT 1920 +#define NTSCVT 525 +#define PALHT 1728 +#define PALVT 625 +#define StHiTVHT 892 +#define StHiTVVT 1126 +#define StHiTextTVHT 1000 +#define StHiTextTVVT 1126 +#define ExtHiTVHT 2100 +#define ExtHiTVVT 1125 + +/* Indices in (VB)VCLKData tables */ + +#define VCLK28 0x00 /* Index in VCLKData table (300 and 315) */ +#define VCLK40 0x04 /* Index in VCLKData table (300 and 315) */ +#define VCLK65_300 0x09 /* Index in VCLKData table (300) */ +#define VCLK108_2_300 0x14 /* Index in VCLKData table (300) */ +#define VCLK81_300 0x3f /* Index in VCLKData table (300) */ +#define VCLK108_3_300 0x42 /* Index in VCLKData table (300) */ +#define VCLK100_300 0x43 /* Index in VCLKData table (300) */ +#define VCLK34_300 0x3d /* Index in VCLKData table (300) */ +#define VCLK_CUSTOM_300 0x46 +#define VCLK65_315 0x0b /* Index in (VB)VCLKData table (315) */ +#define VCLK108_2_315 0x19 /* Index in (VB)VCLKData table (315) */ +#define VCLK81_315 0x5b /* Index in (VB)VCLKData table (315) */ +#define VCLK162_315 0x5e /* Index in (VB)VCLKData table (315) */ +#define VCLK108_3_315 0x45 /* Index in VBVCLKData table (315) */ +#define VCLK100_315 0x46 /* Index in VBVCLKData table (315) */ +#define VCLK34_315 0x55 +#define VCLK68_315 0x0d +#define VCLK69_315 0x5c /* Index in VBVCLKData table (315) */ +#define VCLK121_315 0x5d /* Index in VBVCLKData table (315) */ +#define VCLK_1280x720 0x5f +#define VCLK_1280x768_2 0x60 +#define VCLK_1280x768_3 0x61 +#define VCLK_CUSTOM_315 0x62 +#define VCLK_1280x720_2 0x63 + +#define TVCLKBASE_300 0x21 /* Indices on TV clocks in VCLKData table (300) */ +#define TVCLKBASE_315 0x3a /* Indices on TV clocks in (VB)VCLKData table (315) */ +#define TVVCLKDIV2 0x00 /* Index relative to TVCLKBASE */ +#define TVVCLK 0x01 /* Index relative to TVCLKBASE */ +#define HiTVVCLKDIV2 0x02 /* Index relative to TVCLKBASE */ +#define HiTVVCLK 0x03 /* Index relative to TVCLKBASE */ +#define HiTVSimuVCLK 0x04 /* Index relative to TVCLKBASE */ +#define HiTVTextVCLK 0x05 /* Index relative to TVCLKBASE */ +#define YPbPr750pVCLK 0x25 /* Index relative to TVCLKBASE; was 0x0f NOT relative */ + +/* ------------------------------ */ + +#define SetSCARTOutput 0x01 + +#define HotPlugFunction 0x08 + +#define StStructSize 0x06 + +#define XGI_VIDEO_CAPTURE 0x00 - 0x30 +#define XGI_VIDEO_PLAYBACK 0x02 - 0x30 +#define XGI_CRT2_PORT_04 0x04 - 0x30 +#define XGI_CRT2_PORT_10 0x10 - 0x30 +#define XGI_CRT2_PORT_12 0x12 - 0x30 +#define XGI_CRT2_PORT_14 0x14 - 0x30 + +#define ADR_CRT2PtrData 0x20E +#define offset_Zurac 0x210 /* TW: Trumpion Zurac data pointer */ +#define ADR_LVDSDesPtrData 0x212 +#define ADR_LVDSCRT1DataPtr 0x214 +#define ADR_CHTVVCLKPtr 0x216 +#define ADR_CHTVRegDataPtr 0x218 + +#define LCDDataLen 8 +#define HiTVDataLen 12 +#define TVDataLen 16 + +#define LVDSDataLen 6 +#define LVDSDesDataLen 3 +#define ActiveNonExpanding 0x40 +#define ActiveNonExpandingShift 6 +#define ActivePAL 0x20 +#define ActivePALShift 5 +#define ModeSwitchStatus 0x0F +#define SoftTVType 0x40 +#define SoftSettingAddr 0x52 +#define ModeSettingAddr 0x53 + +#define _PanelType00 0x00 +#define _PanelType01 0x08 +#define _PanelType02 0x10 +#define _PanelType03 0x18 +#define _PanelType04 0x20 +#define _PanelType05 0x28 +#define _PanelType06 0x30 +#define _PanelType07 0x38 +#define _PanelType08 0x40 +#define _PanelType09 0x48 +#define _PanelType0A 0x50 +#define _PanelType0B 0x58 +#define _PanelType0C 0x60 +#define _PanelType0D 0x68 +#define _PanelType0E 0x70 +#define _PanelType0F 0x78 + +#define PRIMARY_VGA 0 + +#define BIOSIDCodeAddr 0x235 /* Offsets to ptrs in BIOS image */ +#define OEMUtilIDCodeAddr 0x237 +#define VBModeIDTableAddr 0x239 +#define OEMTVPtrAddr 0x241 +#define PhaseTableAddr 0x243 +#define NTSCFilterTableAddr 0x245 +#define PALFilterTableAddr 0x247 +#define OEMLCDPtr_1Addr 0x249 +#define OEMLCDPtr_2Addr 0x24B +#define LCDHPosTable_1Addr 0x24D +#define LCDHPosTable_2Addr 0x24F +#define LCDVPosTable_1Addr 0x251 +#define LCDVPosTable_2Addr 0x253 +#define OEMLCDPIDTableAddr 0x255 + +#define VBModeStructSize 5 +#define PhaseTableSize 4 +#define FilterTableSize 4 +#define LCDHPosTableSize 7 +#define LCDVPosTableSize 5 +#define OEMLVDSPIDTableSize 4 +#define LVDSHPosTableSize 4 +#define LVDSVPosTableSize 6 + +#define VB_ModeID 0 +#define VB_TVTableIndex 1 +#define VB_LCDTableIndex 2 +#define VB_LCDHIndex 3 +#define VB_LCDVIndex 4 + +#define OEMLCDEnable 0x0001 +#define OEMLCDDelayEnable 0x0002 +#define OEMLCDPOSEnable 0x0004 +#define OEMTVEnable 0x0100 +#define OEMTVDelayEnable 0x0200 +#define OEMTVFlickerEnable 0x0400 +#define OEMTVPhaseEnable 0x0800 +#define OEMTVFilterEnable 0x1000 + +#define OEMLCDPanelIDSupport 0x0080 + +/* + ============================================================= + for 315 series + ============================================================= +*/ +#define SoftDRAMType 0x80 +#define SoftSetting_OFFSET 0x52 +#define SR07_OFFSET 0x7C +#define SR15_OFFSET 0x7D +#define SR16_OFFSET 0x81 +#define SR17_OFFSET 0x85 +#define SR19_OFFSET 0x8D +#define SR1F_OFFSET 0x99 +#define SR21_OFFSET 0x9A +#define SR22_OFFSET 0x9B +#define SR23_OFFSET 0x9C +#define SR24_OFFSET 0x9D +#define SR25_OFFSET 0x9E +#define SR31_OFFSET 0x9F +#define SR32_OFFSET 0xA0 +#define SR33_OFFSET 0xA1 + +#define CR40_OFFSET 0xA2 +#define SR25_1_OFFSET 0xF6 +#define CR49_OFFSET 0xF7 + +#define VB310Data_1_2_Offset 0xB6 +#define VB310Data_4_D_Offset 0xB7 +#define VB310Data_4_E_Offset 0xB8 +#define VB310Data_4_10_Offset 0xBB + +#define RGBSenseDataOffset 0xBD +#define YCSenseDataOffset 0xBF +#define VideoSenseDataOffset 0xC1 +#define OutputSelectOffset 0xF3 + +#define ECLK_MCLK_DISTANCE 0x14 +#define VBIOSTablePointerStart 0x100 +#define StandTablePtrOffset VBIOSTablePointerStart+0x02 +#define EModeIDTablePtrOffset VBIOSTablePointerStart+0x04 +#define CRT1TablePtrOffset VBIOSTablePointerStart+0x06 +#define ScreenOffsetPtrOffset VBIOSTablePointerStart+0x08 +#define VCLKDataPtrOffset VBIOSTablePointerStart+0x0A +#define MCLKDataPtrOffset VBIOSTablePointerStart+0x0E +#define CRT2PtrDataPtrOffset VBIOSTablePointerStart+0x10 +#define TVAntiFlickPtrOffset VBIOSTablePointerStart+0x12 +#define TVDelayPtr1Offset VBIOSTablePointerStart+0x14 +#define TVPhaseIncrPtr1Offset VBIOSTablePointerStart+0x16 +#define TVYFilterPtr1Offset VBIOSTablePointerStart+0x18 +#define LCDDelayPtr1Offset VBIOSTablePointerStart+0x20 +#define TVEdgePtr1Offset VBIOSTablePointerStart+0x24 +#define CRT2Delay1Offset VBIOSTablePointerStart+0x28 + +#endif Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/osdef.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/osdef.h:1.1 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/osdef.h Mon May 2 09:28:02 2005 @@ -0,0 +1,192 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/osdef.h,v 1.1 2005/05/02 13:28:02 dawes Exp $ */ +/* + * OS depending defines + * + * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria + * + * If distributed as part of the Linux kernel, the following license terms + * apply: + * + * * This program is free software; you can redistribute it and/or modify + * * it under the terms of the GNU General Public License as published by + * * the Free Software Foundation; either version 2 of the named License, + * * or any later version. + * * + * * This program is distributed in the hope that it will be useful, + * * but WITHOUT ANY WARRANTY; without even the implied warranty of + * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * * GNU General Public License for more details. + * * + * * You should have received a copy of the GNU General Public License + * * along with this program; if not, write to the Free Software + * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + * + * Otherwise, the following license terms apply: + * + * * Redistribution and use in source and binary forms, with or without + * * modification, are permitted provided that the following conditions + * * are met: + * * 1) Redistributions of source code must retain the above copyright + * * notice, this list of conditions and the following disclaimer. + * * 2) Redistributions in binary form must reproduce the above copyright + * * notice, this list of conditions and the following disclaimer in the + * * documentation and/or other materials provided with the distribution. + * * 3) The name of the author may not be used to endorse or promote products + * * derived from this software without specific prior written permission. + * * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR + * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Author: Thomas Winischhofer <thomas@winischhofer.net> + * Silicon Integrated Systems, Inc. (used by permission) + * + */ + +/* The choices are: */ +/* #define LINUX_KERNEL */ /* Kernel framebuffer */ +#define LINUX_XF86 /* XFree86 */ + +/**********************************************************************/ +#ifdef LINUX_KERNEL +# include <linux/config.h> +# ifdef CONFIG_FB_XGI_300 +# define XGI300 +# endif + +# ifdef CONFIG_FB_XGI_315 +# define XGI315H +# endif +#else +# define XGI315H +#endif + +/**********************************************************************/ +#ifdef TC +#endif +#ifdef WIN2000 +#endif +#ifdef WINCE_HEADER +#endif +#ifdef LINUX_XF86 +#define LINUX +#endif +#ifdef LINUX_KERNEL +#define LINUX +#endif + +/**********************************************************************/ +#ifdef TC +#define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize); +#endif +#ifdef WIN2000 +#define XGI_SetMemory(MemoryAddress,MemorySize,value) MemFill((PVOID) MemoryAddress,(ULONG) MemorySize,(UCHAR) value); +#endif +#ifdef WINCE_HEADER +#define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize); +#endif +#ifdef LINUX_XF86 +#define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize) +#endif +#ifdef LINUX_KERNEL +#define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize) +#endif +/**********************************************************************/ + +/**********************************************************************/ + +#ifdef TC +#define XGI_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length); +#endif +#ifdef WIN2000 +#define XGI_MemoryCopy(Destination,Soruce,Length) /*VideoPortMoveMemory((PUCHAR)Destination , Soruce,length);*/ +#endif +#ifdef WINCE_HEADER +#define XGI_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length); +#endif +#ifdef LINUX_XF86 +#define XGI_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length) +#endif +#ifdef LINUX_KERNEL +#define XGI_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length) +#endif + +/**********************************************************************/ + +#ifdef OutPortByte +#undef OutPortByte +#endif + +#ifdef OutPortWord +#undef OutPortWord +#endif + +#ifdef OutPortLong +#undef OutPortLong +#endif + +#ifdef InPortByte +#undef InPortByte +#endif + +#ifdef InPortWord +#undef InPortWord +#endif + +#ifdef InPortLong +#undef InPortLong +#endif + +/**********************************************************************/ +/* LINUX KERNEL */ +/**********************************************************************/ + +#ifdef LINUX_KERNEL +#include <linux/config.h> +#include <linux/version.h> + +#ifdef CONFIG_FB_XGI_300 +#define XGI300 +#endif + +#ifdef CONFIG_FB_XGI_315 +#define XGI315H +#endif + +#if 1 +#define XGIFBACCEL /* Include 2D acceleration */ +#endif + +#define OutPortByte(p,v) outb((u8)(v),(IOADDRESS)(p)) +#define OutPortWord(p,v) outw((u16)(v),(IOADDRESS)(p)) +#define OutPortLong(p,v) outl((u32)(v),(IOADDRESS)(p)) +#define InPortByte(p) inb((IOADDRESS)(p)) +#define InPortWord(p) inw((IOADDRESS)(p)) +#define InPortLong(p) inl((IOADDRESS)(p)) +#define XGI_SetMemory(MemoryAddress,MemorySize,value) memset_io(MemoryAddress, value, MemorySize) +#endif + +/**********************************************************************/ +/* XFree86 */ +/**********************************************************************/ + +#ifdef LINUX_XF86 +#define XGI300 +#define XGI315H + +#define OutPortByte(p,v) outb((IOADDRESS)(p),(CARD8)(v)) +#define OutPortWord(p,v) outw((IOADDRESS)(p),(CARD16)(v)) +#define OutPortLong(p,v) outl((IOADDRESS)(p),(CARD32)(v)) +#define InPortByte(p) inb((IOADDRESS)(p)) +#define InPortWord(p) inw((IOADDRESS)(p)) +#define InPortLong(p) inl((IOADDRESS)(p)) +#define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize) +#endif + Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/regs.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/regs.h:1.1 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/regs.h Mon May 2 09:28:02 2005 @@ -0,0 +1,595 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/regs.h,v 1.1 2005/05/02 13:28:02 dawes Exp $ */ +/* + * Register definitions for old and 300 series + * + * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2) Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3) The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Old series register definitions + * Copyright (C) 1998, 1999 by Alan Hourihane, Wigan, England. + * + * Authors: Thomas Winischhofer <thomas@winischhofer.net> + * Alan Hourihane + * + */ + +/* For general use --------------------------------------------------------------- */ + +#define xgiPART1_VERTRETRACE 0x30 +#define IS_BIT_VERT_ACTIVE (1<<3) +#define VGA_RELIO_BASE 0x380 +#define XGI_IS1 (pXGI->RelIO+IS1OFFSET) +#define IS1OFFSET VGA_IOBASE_COLOR - VGA_RELIO_BASE + VGA_IN_STAT_1_OFFSET +#define XGIMMIOLONG(offset) *(volatile CARD32 *)(pXGI->IOBase+(offset)) + +#define read_xr(num,var) do {outb(0x3c4, num);var=inb(0x3c5);} while (0) + +#define inXGIREG(base) inb(base) +#define outXGIREG(base,val) outb(base,val) +#define orXGIREG(base,val) do { \ + unsigned char __Temp = inb(base); \ + outXGIREG(base, __Temp | (val)); \ + } while (0) +#define andXGIREG(base,val) do { \ + unsigned char __Temp = inb(base); \ + outXGIREG(base, __Temp & (val)); \ + } while (0) + +#define inXGIIDXREG(base,idx,var) do { \ + outb(base,idx); var=inb((base)+1); \ + } while (0) +#define outXGIIDXREG(base,idx,val) do { \ + outb(base,idx); outb((base)+1,val); \ + } while (0) +#define orXGIIDXREG(base,idx,val) do { \ + unsigned char __Temp; \ + outb(base,idx); \ + __Temp = inb((base)+1)|(val); \ + outXGIIDXREG(base,idx,__Temp); \ + } while (0) +#define andXGIIDXREG(base,idx,and) do { \ + unsigned char __Temp; \ + outb(base,idx); \ + __Temp = inb((base)+1)&(and); \ + outXGIIDXREG(base,idx,__Temp); \ + } while (0) +#define setXGIIDXREG(base,idx,and,or) do { \ + unsigned char __Temp; \ + outb(base,idx); \ + __Temp = (inb((base)+1)&(and))|(or); \ + outXGIIDXREG(base,idx,__Temp); \ + } while (0) + +#define BITMASK(h,l) (((unsigned)(1U << ((h)-(l)+1))-1)<<(l)) +#define GENMASK(mask) BITMASK(1?mask,0?mask) + +#define GETBITS(var,mask) (((var) & GENMASK(mask)) >> (0?mask)) +#define SETBITS(val,mask) ((val) << (0?mask)) +#define SETBIT(n) (1<<(n)) + +#define GETBITSTR(val,from,to) ((GETBITS(val,from)) << (0?to)) +#define SETVARBITS(var,val,from,to) (((var)&(~(GENMASK(to)))) | \ + GETBITSTR(val,from,to)) +#define GETVAR8(var) ((var)&0xFF) +#define SETVAR8(var,val) (var) = GETVAR8(val) + +#define AROFFSET 0x40 +#define ARROFFSET 0x41 +#define GROFFSET 0x4e +#define SROFFSET 0x44 +#define CROFFSET 0x54 +#define MISCROFFSET 0x4c +#define MISCWOFFSET 0x42 +#define INPUTSTATOFFSET 0x5A +#define PART1OFFSET 0x04 +#define PART2OFFSET 0x10 +#define PART3OFFSET 0x12 +#define PART4OFFSET 0x14 +#define PART5OFFSET 0x16 +#define CAPTUREOFFSET 0x00 +#define VIDEOOFFSET 0x02 +#define COLREGOFFSET 0x48 +#define PELMASKOFFSET 0x46 + +#define XGIAR pXGI->RelIO + AROFFSET +#define XGIARR pXGI->RelIO + ARROFFSET +#define XGIGR pXGI->RelIO + GROFFSET +#define XGISR pXGI->RelIO + SROFFSET +#define XGICR pXGI->RelIO + CROFFSET +#define XGIMISCR pXGI->RelIO + MISCROFFSET +#define XGIMISCW pXGI->RelIO + MISCWOFFSET +#define XGIINPSTAT pXGI->RelIO + INPUTSTATOFFSET +#define XGIPART1 pXGI->RelIO + PART1OFFSET +#define XGIPART2 pXGI->RelIO + PART2OFFSET +#define XGIPART3 pXGI->RelIO + PART3OFFSET +#define XGIPART4 pXGI->RelIO + PART4OFFSET +#define XGIPART5 pXGI->RelIO + PART5OFFSET +#define XGICAP pXGI->RelIO + CAPTUREOFFSET +#define XGIVID pXGI->RelIO + VIDEOOFFSET +#define XGICOLIDX pXGI->RelIO + COLREGOFFSET +#define XGICOLDATA pXGI->RelIO + COLREGOFFSET + 1 +#define XGICOL2IDX XGIPART5 +#define XGICOL2DATA XGIPART5 + 1 +#define XGIPEL pXGI->RelIO + PELMASKOFFSET + +#define vc_index_offset CAPTUREOFFSET /* Video capture - unused */ +#define vc_data_offset (CAPTUREOFFSET + 1) +#define vi_index_offset VIDEOOFFSET +#define vi_data_offset (VIDEOOFFSET + 1) +#define crt2_index_offset PART1OFFSET +#define crt2_port_offset (PART1OFFSET + 1) +#define sr_index_offset SROFFSET +#define sr_data_offset (SROFFSET + 1) +#define cr_index_offset CROFFSET +#define cr_data_offset (CROFFSET + 1) +#define input_stat INPUTSTATOFFSET + +/* For old chipsets (5597/5598, 6326, 530/620) ------------ */ +/* SR (3C4) */ +#define BankReg 0x06 +#define ClockReg 0x07 +#define CPUThreshold 0x08 +#define CRTThreshold 0x09 +#define CRTCOff 0x0A +#define DualBanks 0x0B +#define MMIOEnable 0x0B +#define RAMSize 0x0C +#define Mode64 0x0C +#define ExtConfStatus1 0x0E +#define ClockBase 0x13 +#define LinearAdd0 0x20 +#define LinearAdd1 0x21 +#define GraphEng 0x27 +#define MemClock0 0x28 +#define MemClock1 0x29 +#define XR2A 0x2A +#define XR2B 0x2B +#define TurboQueueBase 0x2C +#define FBSize 0x2F +#define ExtMiscCont5 0x34 +#define ExtMiscCont9 0x3C + +/* 3x4 */ +#define Offset 0x13 + +/* Registers for 300, 540, 630, 730, 315, 550, 650, 740 ---------------------- */ + +/* VGA standard register */ +#define Index_SR_Graphic_Mode 0x06 +#define Index_SR_RAMDAC_Ctrl 0x07 +#define Index_SR_Threshold_Ctrl1 0x08 +#define Index_SR_Threshold_Ctrl2 0x09 +#define Index_SR_Misc_Ctrl 0x0F +#define Index_SR_DDC 0x11 +#define Index_SR_Feature_Connector_Ctrl 0x12 +#define Index_SR_DRAM_Sizing 0x14 +#define Index_SR_DRAM_State_Machine_Ctrl 0x15 +#define Index_SR_AGP_PCI_State_Machine 0x21 +#define Index_SR_Internal_MCLK0 0x28 +#define Index_SR_Internal_MCLK1 0x29 +#define Index_SR_Internal_DCLK1 0x2B +#define Index_SR_Internal_DCLK2 0x2C +#define Index_SR_Internal_DCLK3 0x2D +#define Index_SR_Ext_Clock_Sel 0x32 +#define Index_SR_Int_Status 0x34 +#define Index_SR_Int_Enable 0x35 +#define Index_SR_Int_Reset 0x36 +#define Index_SR_Power_On_Trap 0x38 +#define Index_SR_Power_On_Trap2 0x39 +#define Index_SR_Power_On_Trap3 0x3A + +/* video registers (300/630/730/315/550/650/740 only) */ +#define Index_VI_Passwd 0x00 + +/* Video overlay horizontal start/end, unit=screen pixels */ +#define Index_VI_Win_Hor_Disp_Start_Low 0x01 +#define Index_VI_Win_Hor_Disp_End_Low 0x02 +#define Index_VI_Win_Hor_Over 0x03 /* Overflow */ + +/* Video overlay vertical start/end, unit=screen pixels */ +#define Index_VI_Win_Ver_Disp_Start_Low 0x04 +#define Index_VI_Win_Ver_Disp_End_Low 0x05 +#define Index_VI_Win_Ver_Over 0x06 /* Overflow */ + +/* Y Plane (4:2:0) or YUV (4:2:2) buffer start address, unit=word */ +#define Index_VI_Disp_Y_Buf_Start_Low 0x07 +#define Index_VI_Disp_Y_Buf_Start_Middle 0x08 +#define Index_VI_Disp_Y_Buf_Start_High 0x09 + +/* U Plane (4:2:0) buffer start address, unit=word */ +#define Index_VI_U_Buf_Start_Low 0x0A +#define Index_VI_U_Buf_Start_Middle 0x0B +#define Index_VI_U_Buf_Start_High 0x0C + +/* V Plane (4:2:0) buffer start address, unit=word */ +#define Index_VI_V_Buf_Start_Low 0x0D +#define Index_VI_V_Buf_Start_Middle 0x0E +#define Index_VI_V_Buf_Start_High 0x0F + +/* Pitch for Y, UV Planes, unit=word */ +#define Index_VI_Disp_Y_Buf_Pitch_Low 0x10 +#define Index_VI_Disp_UV_Buf_Pitch_Low 0x11 +#define Index_VI_Disp_Y_UV_Buf_Pitch_Middle 0x12 + +/* What is this ? */ +#define Index_VI_Disp_Y_Buf_Preset_Low 0x13 +#define Index_VI_Disp_Y_Buf_Preset_Middle 0x14 + +#define Index_VI_UV_Buf_Preset_Low 0x15 +#define Index_VI_UV_Buf_Preset_Middle 0x16 +#define Index_VI_Disp_Y_UV_Buf_Preset_High 0x17 + +/* Scaling control registers */ +#define Index_VI_Hor_Post_Up_Scale_Low 0x18 +#define Index_VI_Hor_Post_Up_Scale_High 0x19 +#define Index_VI_Ver_Up_Scale_Low 0x1A +#define Index_VI_Ver_Up_Scale_High 0x1B +#define Index_VI_Scale_Control 0x1C + +/* Playback line buffer control */ +#define Index_VI_Play_Threshold_Low 0x1D +#define Index_VI_Play_Threshold_High 0x1E +#define Index_VI_Line_Buffer_Size 0x1F + +/* Destination color key */ +#define Index_VI_Overlay_ColorKey_Red_Min 0x20 +#define Index_VI_Overlay_ColorKey_Green_Min 0x21 +#define Index_VI_Overlay_ColorKey_Blue_Min 0x22 +#define Index_VI_Overlay_ColorKey_Red_Max 0x23 +#define Index_VI_Overlay_ColorKey_Green_Max 0x24 +#define Index_VI_Overlay_ColorKey_Blue_Max 0x25 + +/* Source color key, YUV color space */ +#define Index_VI_Overlay_ChromaKey_Red_Y_Min 0x26 +#define Index_VI_Overlay_ChromaKey_Green_U_Min 0x27 +#define Index_VI_Overlay_ChromaKey_Blue_V_Min 0x28 +#define Index_VI_Overlay_ChromaKey_Red_Y_Max 0x29 +#define Index_VI_Overlay_ChromaKey_Green_U_Max 0x2A +#define Index_VI_Overlay_ChromaKey_Blue_V_Max 0x2B + +/* Contrast enhancement and brightness control */ +#define Index_VI_Contrast_Factor 0x2C /* obviously unused/undefined */ +#define Index_VI_Brightness 0x2D +#define Index_VI_Contrast_Enh_Ctrl 0x2E + +#define Index_VI_Key_Overlay_OP 0x2F + +#define Index_VI_Control_Misc0 0x30 +#define Index_VI_Control_Misc1 0x31 +#define Index_VI_Control_Misc2 0x32 + +/* TW: Subpicture registers */ +#define Index_VI_SubPict_Buf_Start_Low 0x33 +#define Index_VI_SubPict_Buf_Start_Middle 0x34 +#define Index_VI_SubPict_Buf_Start_High 0x35 + +/* TW: What is this ? */ +#define Index_VI_SubPict_Buf_Preset_Low 0x36 +#define Index_VI_SubPict_Buf_Preset_Middle 0x37 + +/* TW: Subpicture pitch, unit=16 bytes */ +#define Index_VI_SubPict_Buf_Pitch 0x38 + +/* TW: Subpicture scaling control */ +#define Index_VI_SubPict_Hor_Scale_Low 0x39 +#define Index_VI_SubPict_Hor_Scale_High 0x3A +#define Index_VI_SubPict_Vert_Scale_Low 0x3B +#define Index_VI_SubPict_Vert_Scale_High 0x3C + +#define Index_VI_SubPict_Scale_Control 0x3D +/* (0x40 = enable/disable subpicture) */ + +/* TW: Subpicture line buffer control */ +#define Index_VI_SubPict_Threshold 0x3E + +/* TW: What is this? */ +#define Index_VI_FIFO_Max 0x3F + +/* TW: Subpicture palette; 16 colors, total 32 bytes address space */ +#define Index_VI_SubPict_Pal_Base_Low 0x40 +#define Index_VI_SubPict_Pal_Base_High 0x41 + +/* I wish I knew how to use these ... */ +#define Index_MPEG_Read_Ctrl0 0x60 /* MPEG auto flip */ +#define Index_MPEG_Read_Ctrl1 0x61 /* MPEG auto flip */ +#define Index_MPEG_Read_Ctrl2 0x62 /* MPEG auto flip */ +#define Index_MPEG_Read_Ctrl3 0x63 /* MPEG auto flip */ + +/* TW: MPEG AutoFlip scale */ +#define Index_MPEG_Ver_Up_Scale_Low 0x64 +#define Index_MPEG_Ver_Up_Scale_High 0x65 + +#define Index_MPEG_Y_Buf_Preset_Low 0x66 +#define Index_MPEG_Y_Buf_Preset_Middle 0x67 +#define Index_MPEG_UV_Buf_Preset_Low 0x68 +#define Index_MPEG_UV_Buf_Preset_Middle 0x69 +#define Index_MPEG_Y_UV_Buf_Preset_High 0x6A + +/* TW: The following registers only exist on the 315 series */ + +/* TW: Bit 16:24 of Y_U_V buf start address */ +#define Index_VI_Y_Buf_Start_Over 0x6B +#define Index_VI_U_Buf_Start_Over 0x6C +#define Index_VI_V_Buf_Start_Over 0x6D + +#define Index_VI_Disp_Y_Buf_Pitch_High 0x6E +#define Index_VI_Disp_UV_Buf_Pitch_High 0x6F + +/* Hue and saturation */ +#define Index_VI_Hue 0x70 +#define Index_VI_Saturation 0x71 + +#define Index_VI_SubPict_Start_Over 0x72 +#define Index_VI_SubPict_Buf_Pitch_High 0x73 + +#define Index_VI_Control_Misc3 0x74 + +/* Bits in Scale control (0x1c) */ +#define VI_Scale_Ctrl_Horiz_DDA 0x20 +#define VI_Scale_Ctrl_Vert_DDA 0x40 + +/* TW: Bits (and helpers) for Index_VI_Control_Misc0 */ +#define VI_Misc0_Enable_Overlay 0x02 +#define VI_Misc0_420_Plane_Enable 0x04 /* Select Plane or Packed mode */ +#define VI_Misc0_422_Enable 0x20 /* Select 422 or 411 mode */ +#define VI_Misc0_Fmt_YVU420P 0x0C /* YUV420 Planar (I420, YV12) */ +#define VI_Misc0_Fmt_YUYV 0x28 /* YUYV Packed (=YUY2) */ +#define VI_Misc0_Fmt_UYVY 0x08 /* (UYVY) */ +#define VI_Misc0_Fmt_YVYU 0x38 /* (YVYU) (315 series only?) */ +#define VI_Misc0_Fmt_NV21 0x5c /* (330 series only?) */ +#define VI_Misc0_Fmt_NV12 0x4c /* (330 series only?) */ +#define VI_Misc0_ChromaKeyRGBYUV 0x40 /* 300 series only: 0 = RGB, 1 = YUV */ + +/* TW: Bits for Index_VI_Control_Misc1 */ +#define VI_Misc1_DisableGraphicsAtOverlay 0x01 /* Disables graphics display in overlay area */ +#define VI_Misc1_BOB_Enable 0x02 /* Enable BOB de-interlacer */ +#define VI_Misc1_Line_Merge 0x04 +#define VI_Misc1_Field_Mode 0x08 /* ? */ +#define VI_Misc1_Non_Interleave 0x10 /* ? 0x20 ? - Odd and Even fields are not interleaved ? */ +#define VI_Misc1_Buf_Addr_Lock 0x20 /* 315 series only? */ +/* #define VI_Misc1_? 0x40 */ +/* #define VI_Misc1_? 0x80 */ + +/* TW: Bits for Index_VI_Control_Misc2 */ +#define VI_Misc2_Select_Video2 0x01 +#define VI_Misc2_Video2_On_Top 0x02 +#define VI_Misc2_DisableGraphics 0x04 /* Disable graphics display entirely (<= 650 only, not >= M650, 651) */ +#define VI_Misc2_Vertical_Interpol 0x08 +#define VI_Misc2_Dual_Line_Merge 0x10 /* dual-overlay chips only; "dual video windows relative line buffer merge" */ +#define VI_Misc2_All_Line_Merge 0x20 /* > 315 only */ +#define VI_Misc2_Auto_Flip_Enable 0x40 +#define VI_Misc2_Video_Reg_Write_Enable 0x80 /* 315 series only? */ + +/* TW: Bits for Index_VI_Control_Misc3 */ +#define VI_Misc3_Submit_Video_1 0x01 /* AKA "address ready" */ +#define VI_Misc3_Submit_Video_2 0x02 /* AKA "address ready" */ +#define VI_Misc3_Submit_SubPict 0x04 /* AKA "address ready" */ + +/* TW: Values for Index_VI_Key_Overlay_OP (0x2F) */ +#define VI_ROP_Never 0x00 +#define VI_ROP_DestKey 0x03 +#define VI_ROP_ChromaKey 0x05 +#define VI_ROP_NotChromaKey 0x0A +#define VI_ROP_Always 0x0F + + +/* video registers (6326 and 530/620) --------------- */ +#define Index_VI6326_Passwd 0x80 + +/* Video overlay horizontal start/end, unit=screen pixels */ +#define Index_VI6326_Win_Hor_Disp_Start_Low 0x81 +#define Index_VI6326_Win_Hor_Disp_End_Low 0x82 +#define Index_VI6326_Win_Hor_Over 0x83 /* Overflow */ + +/* Video overlay vertical start/end, unit=screen pixels */ +#define Index_VI6326_Win_Ver_Disp_Start_Low 0x84 +#define Index_VI6326_Win_Ver_Disp_End_Low 0x85 +#define Index_VI6326_Win_Ver_Over 0x86 /* Overflow */ + +/* Y Plane (4:2:0) or YUV (4:2:2) buffer start address, unit=dword */ +#define Index_VI6326_Disp_Y_Buf_Start_Low 0x8A +#define Index_VI6326_Disp_Y_Buf_Start_Middle 0x8B +#define Index_VI6326_Disp_Capt_Y_Buf_Start_High 0x89 /* 6326: 7:4 display, 3:0 capture */ + /* 530/620: 7:3 display. 2:0 reserved */ +/* End address of Y plane (in 16k unit) - 6326 ONLY */ +#define Index_VI6326_Disp_Y_End 0x8D + +/* U Plane (4:2:0) buffer start address, unit=dword */ +#define Index_VI6326_U_Buf_Start_Low 0xB7 +#define Index_VI6326_U_Buf_Start_Middle 0xB8 + +/* V Plane (4:2:0) buffer start address, unit=dword */ +#define Index_VI6326_V_Buf_Start_Low 0xBA +#define Index_VI6326_V_Buf_Start_Middle 0xBB + +/* U/V plane start address overflow bits 19:16 */ +#define Index_VI6326_UV_Buf_Start_High 0xB9 + +/* Pitch for Y, UV Planes, unit=dword(6326 & 530/620) */ +#define Index_VI6326_Disp_Y_Buf_Pitch_Low 0x8C /* 7:0 */ +#define Index_VI6326_Disp_Y_Buf_Pitch_High 0x8E /* 11:8 (3:0 here) */ + +#define Index_VI6326_Disp_UV_Buf_Pitch_Low 0xBC /* 7:0 */ +#define Index_VI6326_Disp_UV_Buf_Pitch_High 0xBD /* 11:8 (3:0 here) */ + +/* Scaling control registers */ +#define Index_VI6326_Hor_Scale 0x92 +#define Index_VI6326_Hor_Scale_Integer 0x94 +#define Index_VI6326_Ver_Scale 0x93 + +/* Playback line buffer control */ +#define Index_VI6326_Play_Threshold_Low 0x9E +#define Index_VI6326_Play_Threshold_High 0x9F +#define Index_VI6326_Line_Buffer_Size 0xA0 /* 530 & 6326: quad-word */ + +/* Destination color key */ +#define Index_VI6326_Overlay_ColorKey_Red_Min 0x97 +#define Index_VI6326_Overlay_ColorKey_Green_Min 0x96 +#define Index_VI6326_Overlay_ColorKey_Blue_Min 0x95 +#define Index_VI6326_Overlay_ColorKey_Red_Max 0xA3 +#define Index_VI6326_Overlay_ColorKey_Green_Max 0xA2 +#define Index_VI6326_Overlay_ColorKey_Blue_Max 0xA1 + +/* Source color key */ +#define Index_VI6326_Overlay_ChromaKey_Red_Y_Min 0x9C +#define Index_VI6326_Overlay_ChromaKey_Green_U_Min 0x9B +#define Index_VI6326_Overlay_ChromaKey_Blue_V_Min 0x9A +#define Index_VI6326_Overlay_ChromaKey_Red_Y_Max 0xA6 +#define Index_VI6326_Overlay_ChromaKey_Green_U_Max 0xA5 +#define Index_VI6326_Overlay_ChromaKey_Blue_V_Max 0xA4 + +/* Contrast enhancement and brightness control */ +#define Index_VI6326_Contrast_Factor 0xB3 +#define Index_VI6326_Brightness 0xB4 +#define Index_VI6326_Contrast_Enh_Ctrl 0xB5 + +/* Alpha */ +#define Index_VI6326_AlphaGraph 0xA7 +#define Index_VI6326_AlphaVideo 0xA8 + +#define Index_VI6326_Key_Overlay_OP 0xA9 + +#define Index_VI6326_Control_Misc0 0x98 +#define Index_VI6326_Control_Misc1 0x99 /* (Datasheet: 6326 ONLY - not correct?) */ +#define Index_VI6326_Control_Misc3 0x9D +#define Index_VI6326_Control_Misc4 0xB6 +#define Index_VI6326_VideoFormatSelect Index_VI6326_Ver_Scale +#define Index_VI6326_Control_Misc5 0xBE /* (Datasheet: 530/620 ONLY - not correct) */ +#define Index_VI6326_Control_Misc6 0xB2 /* 5597 and 6326 only! */ + +/* TW: What is this? not a register, obviously */ +#define Index_VI6326_FIFO_Max 0x3F + +/* TW: Bits (and helpers) for Index_VI6326_Control_Misc0 */ +#define VI6326_Misc0_EnableCapture 0x01 /* 1 = on, 0 = off (6326 only) */ +#define VI6326_Misc0_EnableOverlay 0x02 /* 1 = on, 0 = off */ +#define VI6326_Misc0_VideoOnly 0x10 /* 1 = video only, 0 = gfx + video */ +#define VI6326_Misc0_CaptureInterlace 0x20 /* 1 = capture data is interlace, 0 = not (6326 only) */ +#define VI6326_Misc0_VideoFormat 0x40 /* 1 = YUV, 0 = RGB */ +#define VI6326_Misc0_FieldPolarity 0x80 /* 1 = *Odd / Even, 0 = Odd / *Even (6326 only) */ + +/* TW: Bits for Index_VI6326_Control_Misc1 (ALL 6326 ONLY) */ +#define VI6326_Misc1_EnableYUVCapture 0x01 /* 0 = RGB, 1 = YUV */ +#define VI6326_Misc1_EnableCaptureDithering 0x02 /* 0 = disable, 1 = enable */ +#define VI6326_Misc1_CaptureFormat555 0x04 /* 1 = 555, 0 = 565 */ +#define VI6326_Misc1_FilterModeMask 0x38 +#define VI6326_Misc1_FilterMode0 0x00 /* 1 */ +#define VI6326_Misc1_FilterMode1 0x08 /* 1/8(1+3z^-1+3z^-2+z^-3)*/ +#define VI6326_Misc1_FilterMode2 0x10 /* 1/4(1+2z^-1+z^-2) */ +#define VI6326_Misc1_FilterMode3 0x18 /* 1/2(1+z^-1) */ +#define VI6326_Misc1_FilterMode4 0x20 /* 1/8(1+2z^-1+2z^-2+2z^-3+z^-4) */ +#define VI6326_Misc1_EnableVBSyncIRQ 0x40 /* 1 = Enable IRQ on vertical blank */ +#define VI6326_Misc1_ClearVBSyncIRQ 0x80 /* Clear pending irq */ + +/* TW: Bits for Index_VI6326_Control_Misc3 */ +#define VI6326_Misc3_UVCaptureFormat 0x01 /* 1 = 2's complement, 0 = CCIR 601 (6326 only) */ +#define VI6326_Misc3_UVOverlayFormat 0x02 /* 1 = 2's complement, 0 = CCIR 601 */ +#define VI6326_Misc3_ChromaKeyFormat 0x04 /* 1 = YUV, 0 = RGB */ +#define VI6326_Misc3_VMIAccess 0x08 /* 1 = enable, 0 = disable (6326 only) */ +#define VI6326_Misc3_VMIEnable 0x10 /* 1 = enable, 0 = disable (6326 only) */ +#define VI6326_Misc3_VMIIRQ 0x20 /* 1 = enable, 0 = disable (6326 only) */ +#define VI6326_Misc3_BT819A 0x40 /* 1 = enable, 0 = disable (6326 only) */ +#define VI6326_Misc3_SystemMemFB 0x80 /* 1 = enable, 0 = disable (6326 only) */ + +/* TW: Bits for Index_VI6326_Control_Misc4 */ +#define VI6326_Misc4_CPUVideoFormatMask 0x03 +#define VI6326_Misc4_CPUVideoFormatRGB555 0x00 +#define VI6326_Misc4_CPUVideoFormatYUV422 0x01 +#define VI6326_Misc4_CPUVideoFormatRGB565 0x02 +#define VI6326_Misc4_EnableYUV420 0x04 /* 1 = enable, 0 = disable */ +/** #define WHATISTHIS 0x40 */ + +/* TW: Bits for Index_VI6326_Control_Misc5 (all 530/620 only) */ +#define VI6326_Misc5_LineBufferMerge 0x10 /* 0 = disable, 1=enable */ +#define VI6326_Misc5_VPlaneBit20 0x04 +#define VI6326_Misc5_UPlaneBit20 0x02 + +/* TW: Bits for Index_VI6326_Control_Misc6 (5597 and 6326 only) */ +#define VI6326_Misc6_Decimation 0x80 /* 0=disable 1=enable video decimation */ + +/* Video format selection */ +#define VI_6326_VideoUYVY422 0x00 +#define VI_6326_VideoVYUY422 0x40 +#define VI_6326_VideoYUYV422 0x80 +#define VI_6326_VideoYVYU422 0xC0 +#define VI_6326_VideoRGB555 0x00 +#define VI_6326_VideoRGB565 0x40 + +/* TW: Values for Index_VI6326_Key_Overlay_OP */ +#define VI6326_ROP_Never 0x00 +#define VI6326_ROP_DestKey 0x03 +#define VI6326_ROP_Always 0x0F + +/* --- end of 6326 video registers ---------------------------------- */ + +/* TW register base (6326 only) */ +#define Index_TV6326_TVOutIndex 0xE0 +#define Index_TV6326_TVOutData 0xE1 + +/* + * CRT_2 function control register --------------------------------- + */ +#define Index_CRT2_FC_CONTROL 0x00 +#define Index_CRT2_FC_SCREEN_HIGH 0x04 +#define Index_CRT2_FC_SCREEN_MID 0x05 +#define Index_CRT2_FC_SCREEN_LOW 0x06 +#define Index_CRT2_FC_ENABLE_WRITE 0x24 +#define Index_CRT2_FC_VR 0x25 +#define Index_CRT2_FC_VCount 0x27 +#define Index_CRT2_FC_VCount1 0x28 + +#define Index_310_CRT2_FC_VR 0x30 /* d[1] = vertical retrace */ +#define Index_310_CRT2_FC_RT 0x33 /* d[7] = retrace in progress */ + +/* video attributes - these should probably be configurable on the fly + * so users with different desktop sizes can keep + * captured data off the desktop + */ +#define _VINWID 704 +#define _VINHGT _VINHGT_NTSC +#define _VINHGT_NTSC 240 +#define _VINHGT_PAL 290 +#define _VIN_WINDOW (704 * 291 * 2) +#define _VBI_WINDOW (704 * 64 * 2) + +#define _VIN_FIELD_EVEN 1 +#define _VIN_FIELD_ODD 2 +#define _VIN_FIELD_BOTH 4 + + +/* i2c registers (TW; not on 300/315 series) */ +#define X_INDEXREG 0x14 +#define X_PORTREG 0x15 +#define X_DATA 0x0f +#define I2C_SCL 0x00 +#define I2C_SDA 0x01 +#define I2C_DELAY 10 + +/* mmio registers for video */ +#define REG_PRIM_CRT_COUNTER 0x8514 + +/* TW: MPEG MMIO registers (630 and later) ----------------------------------------- */ + +/* Not public (yet?) */ + Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/valid_mode.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/valid_mode.h:1.1 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/valid_mode.h Mon May 2 09:28:02 2005 @@ -0,0 +1,59 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/valid_mode.h,v 1.1 2005/05/02 13:28:02 dawes Exp $ */ + +#ifndef _ValidMode_h + +#define _ValidMode_h + +typedef struct _SupportMode +{ + int HDisplay; + int VDisplay; + int Clock; +} SupportMode; + +SupportMode *XgiMode; + +SupportMode XG20_Mode[]= { +{640, 480, 25200}, {640, 480, 31500}, {640, 480, 36000}, {640, 480, 44900}, {640, 480, 56250}, +{800, 600, 40000}, {800, 600, 50000}, {800, 600, 49500}, {800, 600, 56300}, {800, 600, 75800}, {800, 600, 84800}, {800, 600, 109175}, +{1024, 768, 65000}, {1024, 768, 75000}, {1024, 768, 78800}, {1024, 768, 94500}, {1024, 768, 104998}, {1024, 768, 132258}, {1024, 768, 192069}, +{1152, 864, 80350}, {1152, 864, 108000}, +{1280, 960, 108000}, {1280, 960, 125999}, {1280, 960, 148500}, {1280, 960, 178992}, {1280, 960, 217325}, +{1280, 1024, 108000}, {1280, 1024, 135000}, {1280, 1024, 157500}, {1280, 1024, 190960}, {1280, 1024, 233793}, +{1600, 1200, 162000}, {1600, 1200, 175500}, {1600, 1200, 189000}, {1600, 1200, 202500}, {1600, 1200, 229500}, + +{0, 0, 0} +}; + + +SupportMode XGI_Mode[]= { +{640, 400, 25175}, +{640, 480, 25200}, {640, 480, 31500}, {640, 480, 36000}, {640, 480, 44900}, {640, 480, 56250}, {640, 480, 67765}, {640, 480, 86600}, +{800, 600, 36000}, {800, 600, 40000}, {800, 600, 50000}, {800, 600, 49500}, {800, 600, 56300}, {800, 600, 75800}, {800, 600, 84800}, {800, 600, 109175}, +{1024, 768, 44900}, {1024, 768, 65000}, {1024, 768, 75000}, {1024, 768, 78800}, {1024, 768, 94500}, {1024, 768, 104998}, {1024, 768, 132258}, {1024, 768, 192069}, +{1152, 864, 80350}, {1152, 864, 108000}, +{1280, 960, 108000}, {1280, 960, 120839}, {1280, 960, 125999}, {1280, 960, 148500}, {1280, 960, 178992}, +{1280, 960, 217325}, {1280, 960, 299505}, +{1280, 1024, 78750}, {1280, 1024, 108000}, {1280, 1024, 135000}, {1280, 1024, 157500}, {1280, 1024, 190960}, +{1280, 1024, 233793}, {1280, 1024, 322273}, +{1600, 1200, 162000}, {1600, 1200, 175500}, {1600, 1200, 189000}, {1600, 1200, 202500}, {1600, 1200, 229500}, +{1600, 1200, 269655}, {1600, 1200, 323586}, +{1920, 1440, 234000}, {1920, 1440, 252699}, {1920, 1440, 272041}, {1920, 1440, 297000}, {1920, 1440, 330615}, +{1920, 1440, 388631}, +{2048, 1536, 265728}, {2048, 1536, 286359}, {2048, 1536, 309789}, {2048, 1536, 332177}, {2048, 1536, 375847}, +{800, 480, 39770}, {800, 480, 49500}, {800, 480, 56250}, +{1024, 576, 65000}, {1024, 576, 78750}, {1024, 576, 94500}, +{1280, 720, 108200}, {1280, 720, 135500}, {1280, 720, 157500}, +{720, 480, 28322}, +{720, 576, 36000}, +{856, 480, 36000}, +{1280, 768, 80000}, +{1400, 1050, 126260}, + +{800, 450, 27740}, +{0, 0, 0} +}; + +#endif +/* {108000, 1280, 960}, */ +/* {80350, 1152, 864}, {108000, 1152, 864}, */ Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_def.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_def.h:1.1 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_def.h Mon May 2 09:28:02 2005 @@ -0,0 +1,1005 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_def.h,v 1.1 2005/05/02 13:28:02 dawes Exp $ */ + +#ifndef _INITDEF_ +#define _INITDEF_ + +#ifndef NewScratch +#define NewScratch +#endif +/* shampoo */ +#ifdef LINUX_KERNEL +#define SEQ_ADDRESS_PORT 0x0014 +#define SEQ_DATA_PORT 0x0015 +#define MISC_OUTPUT_REG_READ_PORT 0x001C +#define MISC_OUTPUT_REG_WRITE_PORT 0x0012 +#define GRAPH_DATA_PORT 0x1F +#define GRAPH_ADDRESS_PORT 0x1E +#define XGI_MASK_DUAL_CHIP 0x04 /* SR3A */ +#define CRTC_ADDRESS_PORT_COLOR 0x0024 +#define VIDEO_SUBSYSTEM_ENABLE_PORT 0x0013 +#define PCI_COMMAND 0x04 +#endif +/* ~shampoo */ + + +#define VB_XGI301 0x0001 /*301b*/ +#define VB_XGI301B 0x0002 +#define VB_XGI302B 0x0004 +#define VB_XGI301LV 0x0008 /*301lv*/ +#define VB_XGI302LV 0x0010 +#define VB_XGI301C 0x0020 /* for 301C */ +#define VB_NoLCD 0x8000 +/*end 301b*/ + +#define VB_YPbPrInfo 0x07 /*301lv*/ +#define VB_YPbPr525i 0x00 +#define VB_YPbPr525p 0x01 +#define VB_YPbPr750p 0x02 +#define VB_YPbPr1080i 0x03 + +/* #define CRT1Len 17 */ +#define LVDSCRT1Len 15 +#define CHTVRegDataLen 5 + +/* #define ModeInfoFlag 0x07 */ +/* #define IsTextMode 0x07 */ +/* #define ModeText 0x00 */ +/* #define ModeCGA 0x01 */ +/* #define ModeEGA 0x02 */ +/* #define ModeVGA 0x03 */ +/* #define Mode15Bpp 0x04 */ +/* #define Mode16Bpp 0x05 */ +/* #define Mode24Bpp 0x06 */ +/* #define Mode32Bpp 0x07 */ + +/* #define DACInfoFlag 0x18 */ +/* #define MemoryInfoFlag 0x1E0 */ +/* #define MemorySizeShift 0x05 */ + +#define Charx8Dot 0x0200 +#define LineCompareOff 0x0400 +#define CRT2Mode 0x0800 +#define HalfDCLK 0x1000 +#define NoSupportSimuTV 0x2000 +#define DoubleScanMode 0x8000 + +#define SupportAllCRT2 0x0078 +#define SupportTV 0x0008 +#define SupportHiVisionTV 0x0010 +#define SupportLCD 0x0020 +#define SupportRAMDAC2 0x0040 +#define NoSupportTV 0x0070 +#define NoSupportHiVisionTV 0x0060 +#define NoSupportLCD 0x0058 +#define SupportCHTV 0x0800 +#define SupportCRT2in301C 0x0100 /* for 301C */ +#define SupportTV1024 0x0800 /*301b*/ +#define SupportYPbPr 0x1000 /*301lv*/ +#define InterlaceMode 0x0080 +#define SyncPP 0x0000 +#define SyncPN 0x4000 +#define SyncNP 0x8000 +/* #define SyncNN 0xc000 */ +#define ECLKindex0 0x0000 +#define ECLKindex1 0x0100 +#define ECLKindex2 0x0200 +#define ECLKindex3 0x0300 +#define ECLKindex4 0x0400 + +#define SetSimuScanMode 0x0001 +#define SwitchToCRT2 0x0002 +/* #define SetCRT2ToTV 0x009C */ +#define SetCRT2ToAVIDEO 0x0004 +#define SetCRT2ToSVIDEO 0x0008 +#define SetCRT2ToSCART 0x0010 +#define SetCRT2ToLCD 0x0020 +#define SetCRT2ToRAMDAC 0x0040 +#define SetCRT2ToHiVisionTV 0x0080 +#define SetNTSCTV 0x0000 +/* #define SetPALTV 0x0100 */ +#define SetInSlaveMode 0x0200 +#define SetNotSimuMode 0x0400 +#define SetNotSimuTVMode 0x0400 +#define SetDispDevSwitch 0x0800 +#define LoadDACFlag 0x1000 +#define DisableCRT2Display 0x2000 +#define DriverMode 0x4000 +#define HotKeySwitch 0x8000 +#define SetCHTVOverScan 0x8000 +/* #define SetCRT2ToLCDA 0x8000 301b */ +#define PanelRGB18Bit 0x0100 +#define PanelRGB24Bit 0x0000 + +#define TVOverScan 0x10 +#define TVOverScanShift 4 +#define ClearBufferFlag 0x20 +#define EnableDualEdge 0x01 /*301b*/ +#define SetToLCDA 0x02 + +#define YPbPrModeInfo 0x38 +/* #define YPbPrMode525i 0x00 */ +/* #define YPbPrMode525p 0x08 */ +/* #define YPbPrMode750p 0x10 */ +/* #define YPbPrMode1080i 0x18 */ + +#define SetSCARTOutput 0x01 +#define BoardTVType 0x02 +#define EnablePALMN 0x40 +/* #define ProgrammingCRT2 0x01 */ +/* #define TVSimuMode 0x02 */ +/* #define RPLLDIV2XO 0x04 */ +/* #define LCDVESATiming 0x08 */ +/* #define EnableLVDSDDA 0x10 */ +#define SetDispDevSwitchFlag 0x20 +#define CheckWinDos 0x40 +#define SetJDOSMode 0x80 + +#define Panel320x480 0x07/*fstn*/ +/* [ycchen] 02/12/03 Modify for Multi-Sync. LCD Support */ +#define PanelResInfo 0x1F /* CR36 Panel Type/LCDResInfo */ +#define PanelRefInfo 0x60 +#define Panel800x600 0x01 +#define Panel1024x768 0x02 +#define Panel1024x768x75 0x22 +#define Panel1280x1024 0x03 +#define Panel1280x1024x75 0x23 +#define Panel640x480 0x04 +#define Panel1024x600 0x05 +#define Panel1152x864 0x06 +#define Panel1280x960 0x07 +#define Panel1152x768 0x08 +#define Panel1400x1050 0x09 +#define Panel1280x768 0x0A +#define Panel1600x1200 0x0B + +#define PanelRef60Hz 0x00 +#define PanelRef75Hz 0x20 +#define LCDRGB18Bit 0x01 + +#define ExtChipTrumpion 0x06 +#define ExtChipCH7005 0x08 +#define ExtChipMitacTV 0x0a +#define LCDNonExpanding 0x10 +#define LCDNonExpandingShift 4 +#define LCDSync 0x20 +#define LCDSyncBit 0xe0 +#define LCDSyncShift 6 + +/* #define DDC2DelayTime 300 */ + +#define CRT2DisplayFlag 0x2000 +/* #define LCDDataLen 8 */ +/* #define HiTVDataLen 12 */ +/* #define TVDataLen 16 */ +/* #define SetPALTV 0x0100 */ +#define HalfDCLK 0x1000 +#define NTSCHT 1716 +#define NTSCVT 525 +#define PALHT 1728 +#define PALVT 625 +#define StHiTVHT 892 +#define StHiTVVT 1126 +#define StHiTextTVHT 1000 +#define StHiTextTVVT 1126 +#define ExtHiTVHT 2100 +#define ExtHiTVVT 1125 + +#define St750pTVHT 1716 +#define St750pTVVT 525 +#define Ext750pTVHT 1716 +#define Ext750pTVVT 525 +#define St525pTVHT 1716 +#define St525pTVVT 525 +#define Ext525pTVHT 1716 +#define Ext525pTVVT 525 +#define St525iTVHT 1716 +#define St525iTVVT 525 +#define Ext525iTVHT 1716 +#define Ext525iTVVT 525 + +#define VCLKStartFreq 25 +#define SoftDramType 0x80 +#define VCLK40 0x04 + +#define VCLK162 0x21 + +#define LCDRGB18Bit 0x01 +#define LoadDACFlag 0x1000 +#define AfterLockCRT2 0x4000 +#define SetCRT2ToAVIDEO 0x0004 +#define SetCRT2ToSCART 0x0010 +#define Ext2StructSize 5 + + +#define YPbPr525iVCLK 0x03B +#define YPbPr525iVCLK_2 0x03A + +#define SwitchToCRT2 0x0002 +/* #define LCDVESATiming 0x08 */ +#define SetSCARTOutput 0x01 +#define AVIDEOSense 0x01 +#define SVIDEOSense 0x02 +#define SCARTSense 0x04 +#define LCDSense 0x08 +#define Monitor1Sense 0x20 +#define Monitor2Sense 0x10 +#define HiTVSense 0x40 +#define BoardTVType 0x02 +#define HotPlugFunction 0x08 +#define StStructSize 0x06 + + +#define XGI_CRT2_PORT_00 0x00 - 0x030 +#define XGI_CRT2_PORT_04 0x04 - 0x030 +#define XGI_CRT2_PORT_10 0x10 - 0x30 +#define XGI_CRT2_PORT_12 0x12 - 0x30 +#define XGI_CRT2_PORT_14 0x14 - 0x30 + + +#define LCDNonExpanding 0x10 +#define ADR_CRT2PtrData 0x20E +#define offset_Zurac 0x210 +#define ADR_LVDSDesPtrData 0x212 +#define ADR_LVDSCRT1DataPtr 0x214 +#define ADR_CHTVVCLKPtr 0x216 +#define ADR_CHTVRegDataPtr 0x218 + +#define LVDSDataLen 6 +/* #define EnableLVDSDDA 0x10 */ +/* #define LVDSDesDataLen 3 */ +#define ActiveNonExpanding 0x40 +#define ActiveNonExpandingShift 6 +/* #define ActivePAL 0x20 */ +#define ActivePALShift 5 +/* #define ModeSwitchStatus 0x0F */ +#define SoftTVType 0x40 +#define SoftSettingAddr 0x52 +#define ModeSettingAddr 0x53 + +/* #define SelectCRT1Rate 0x4 */ + +#define _PanelType00 0x00 +#define _PanelType01 0x08 +#define _PanelType02 0x10 +#define _PanelType03 0x18 +#define _PanelType04 0x20 +#define _PanelType05 0x28 +#define _PanelType06 0x30 +#define _PanelType07 0x38 +#define _PanelType08 0x40 +#define _PanelType09 0x48 +#define _PanelType0A 0x50 +#define _PanelType0B 0x58 +#define _PanelType0C 0x60 +#define _PanelType0D 0x68 +#define _PanelType0E 0x70 +#define _PanelType0F 0x78 + + +#define PRIMARY_VGA 0 /* 1: XGI is primary vga 0:XGI is secondary vga */ +#define BIOSIDCodeAddr 0x235 +#define OEMUtilIDCodeAddr 0x237 +#define VBModeIDTableAddr 0x239 +#define OEMTVPtrAddr 0x241 +#define PhaseTableAddr 0x243 +#define NTSCFilterTableAddr 0x245 +#define PALFilterTableAddr 0x247 +#define OEMLCDPtr_1Addr 0x249 +#define OEMLCDPtr_2Addr 0x24B +#define LCDHPosTable_1Addr 0x24D +#define LCDHPosTable_2Addr 0x24F +#define LCDVPosTable_1Addr 0x251 +#define LCDVPosTable_2Addr 0x253 +#define OEMLCDPIDTableAddr 0x255 + +#define VBModeStructSize 5 +#define PhaseTableSize 4 +#define FilterTableSize 4 +#define LCDHPosTableSize 7 +#define LCDVPosTableSize 5 +#define OEMLVDSPIDTableSize 4 +#define LVDSHPosTableSize 4 +#define LVDSVPosTableSize 6 + +#define VB_ModeID 0 +#define VB_TVTableIndex 1 +#define VB_LCDTableIndex 2 +#define VB_LCDHIndex 3 +#define VB_LCDVIndex 4 + +#define OEMLCDEnable 0x0001 +#define OEMLCDDelayEnable 0x0002 +#define OEMLCDPOSEnable 0x0004 +#define OEMTVEnable 0x0100 +#define OEMTVDelayEnable 0x0200 +#define OEMTVFlickerEnable 0x0400 +#define OEMTVPhaseEnable 0x0800 +#define OEMTVFilterEnable 0x1000 + +#define OEMLCDPanelIDSupport 0x0080 + +/* #define LCDVESATiming 0x0001 //LCD Info CR37 */ +/* #define EnableLVDSDDA 0x0002 */ +#define EnableScalingLCD 0x0008 +#define SetPWDEnable 0x0004 +#define SetLCDtoNonExpanding 0x0010 +/* #define SetLCDPolarity 0x00E0 */ +#define SetLCDDualLink 0x0100 +#define SetLCDLowResolution 0x0200 +#define SetLCDStdMode 0x0400 +#define SetTVStdMode 0x0200 +#define SetTVLowResolution 0x0400 +/* ============================================================= + for 310 +============================================================== */ +#define SoftDRAMType 0x80 +#define SoftSetting_OFFSET 0x52 +#define SR07_OFFSET 0x7C +#define SR15_OFFSET 0x7D +#define SR16_OFFSET 0x81 +#define SR17_OFFSET 0x85 +#define SR19_OFFSET 0x8D +#define SR1F_OFFSET 0x99 +#define SR21_OFFSET 0x9A +#define SR22_OFFSET 0x9B +#define SR23_OFFSET 0x9C +#define SR24_OFFSET 0x9D +#define SR25_OFFSET 0x9E +#define SR31_OFFSET 0x9F +#define SR32_OFFSET 0xA0 +#define SR33_OFFSET 0xA1 + +#define CR40_OFFSET 0xA2 +#define SR25_1_OFFSET 0xF6 +#define CR49_OFFSET 0xF7 + +#define VB310Data_1_2_Offset 0xB6 +#define VB310Data_4_D_Offset 0xB7 +#define VB310Data_4_E_Offset 0xB8 +#define VB310Data_4_10_Offset 0xBB + +#define RGBSenseDataOffset 0xBD +#define YCSenseDataOffset 0xBF +#define VideoSenseDataOffset 0xC1 +#define OutputSelectOffset 0xF3 + +#define ECLK_MCLK_DISTANCE 0x14 +#define VBIOSTablePointerStart 0x200 +#define StandTablePtrOffset VBIOSTablePointerStart+0x02 +#define EModeIDTablePtrOffset VBIOSTablePointerStart+0x04 +#define CRT1TablePtrOffset VBIOSTablePointerStart+0x06 +#define ScreenOffsetPtrOffset VBIOSTablePointerStart+0x08 +#define VCLKDataPtrOffset VBIOSTablePointerStart+0x0A +#define MCLKDataPtrOffset VBIOSTablePointerStart+0x0E +#define CRT2PtrDataPtrOffset VBIOSTablePointerStart+0x10 +#define TVAntiFlickPtrOffset VBIOSTablePointerStart+0x12 +#define TVDelayPtr1Offset VBIOSTablePointerStart+0x14 +#define TVPhaseIncrPtr1Offset VBIOSTablePointerStart+0x16 +#define TVYFilterPtr1Offset VBIOSTablePointerStart+0x18 +#define LCDDelayPtr1Offset VBIOSTablePointerStart+0x20 +#define TVEdgePtr1Offset VBIOSTablePointerStart+0x24 +#define CRT2Delay1Offset VBIOSTablePointerStart+0x28 +#define LCDDataDesOffset VBIOSTablePointerStart-0x02 +#define LCDDataPtrOffset VBIOSTablePointerStart+0x2A +#define LCDDesDataPtrOffset VBIOSTablePointerStart+0x2C +#define LCDDataList VBIOSTablePointerStart+0x22 /* add for GetLCDPtr */ +#define TVDataList VBIOSTablePointerStart+0x36 /* add for GetTVPtr */ +/* */ +/* Modify from 310.inc */ +/* */ +/* */ + + +#define ShowMsgFlag 0x20 /* SoftSetting */ +#define ShowVESAFlag 0x10 +#define HotPlugFunction 0x08 +#define ModeSoftSetting 0x04 +#define TVSoftSetting 0x02 +#define LCDSoftSetting 0x01 + +#define GatingCRTinLCDA 0x10 +#define SetHiTVOutput 0x08 +#define SetYPbPrOutput 0x04 +#define BoardTVType 0x02 +#define SetSCARTOutput 0x01 + +#define ModeSettingYPbPr 0x02 /* TVModeSetting, Others as same as CR30 */ + +/* TVModeSetting same as CR35 */ + +/* LCDModeSetting same as CR37 */ + +#define EnableNewTVFont 0x10 /* MiscCapability */ + +#define EnableLCDOutput 0x80 /* LCDCfgSetting */ + +#define SoftDRAMType 0x80 /* DRAMSetting */ +#define SoftDRAMConfig 0x40 +#define MosSelDRAMType 0x20 +#define SDRAM 000h +#define SGRAM 0x01 +#define ESDRAM 0x02 + +#define EnableAGPCfgSetting 0x01 /* AGPCfgSetting */ + +/* ---------------- SetMode Stack */ +#define CRT1Len 15 +#define VCLKLen 4 +#define DefThreshold 0x0100 +#define ExtRegsSize (57+8+37+70+63+28+768+1)/64+1 + +#define VGA_XGI315 0x0001 /* VGA Type Info */ +#define VGA_SNewis315e 0x0002 /* 315 series */ +#define VGA_XGI550 0x0004 +#define VGA_XGI640 0x0008 +#define VGA_XGI740 0x0010 +#define VGA_XGI650 0x0020 +#define VGA_XGI650M 0x0040 +#define VGA_XGI651 0x0080 +#define VGA_XGI340 0x0001 /* 340 series */ +#define VGA_XGI330 0x0001 /* 330 series */ +#define VGA_XGI660 0x0001 /* 660 series */ + +#define VB_XGI301 0x0001 /* VB Type Info */ +#define VB_XGI301B 0x0002 /* 301 series */ +#define VB_XGI302B 0x0004 +#define VB_NoLCD 0x8000 +#define VB_XGI301LV 0x0008 +#define VB_XGI302LV 0x0010 +#define VB_LVDS_NS 0x0001 /* 3rd party chip */ +#define VB_CH7017 0x0002 +/* #define VB_LVDS_SI 0x0004 */ + +#define ModeInfoFlag 0x0007 +#define IsTextMode 0x0007 +#define ModeText 0x0000 +#define ModeCGA 0x0001 +#define ModeEGA 0x0002 /* 16 colors mode */ +#define ModeVGA 0x0003 /* 256 colors mode */ +#define Mode15Bpp 0x0004 /* 15 Bpp Color Mode */ +#define Mode16Bpp 0x0005 /* 16 Bpp Color Mode */ +#define Mode24Bpp 0x0006 /* 24 Bpp Color Mode */ +#define Mode32Bpp 0x0007 /* 32 Bpp Color Mode */ + +#define DACInfoFlag 0x0018 +#define MONODAC 0x0000 +#define CGADAC 0x0008 +#define EGADAC 0x0010 +#define VGADAC 0x0018 + +#define MemoryInfoFlag 0x01e0 +#define MemorySizeShift 5 +#define Need1MSize 0x0000 +#define Need2MSize 0x0020 +#define Need4MSize 0x0060 +#define Need8MSize 0x00e0 +#define Need16MSize 0x01e0 + +#define Charx8Dot 0x0200 +#define LineCompareOff 0x0400 +#define CRT2Mode 0x0800 +#define HalfDCLK 0x1000 +#define NoSupportSimuTV 0x2000 +#define DoubleScanMode 0x8000 + +/* -------------- Ext_InfoFlag */ +#define SupportModeInfo 0x0007 +#define Support256 0x0003 +#define Support15Bpp 0x0004 +#define Support16Bpp 0x0005 +#define Support24Bpp 0x0006 +#define Support32Bpp 0x0007 + +#define SupportAllCRT2 0x0078 +#define SupportTV 0x0008 +#define SupportHiVisionTV 0x0010 +#define SupportLCD 0x0020 +#define SupportRAMDAC2 0x0040 +#define NoSupportTV 0x0070 +#define NoSupportHiVisionTV 0x0060 +#define NoSupportLCD 0x0058 +#define SupportTV1024 0x0800 /* 301btest */ +#define SupportYPbPr 0x1000 /* 301lv */ +#define InterlaceMode 0x0080 +#define SyncPP 0x0000 +#define SyncPN 0x4000 +#define SyncNP 0x8000 +#define SyncNN 0xC000 + +/* -------------- SetMode Stack/Scratch */ +#define SetSimuScanMode 0x0001 /* VBInfo/CR30 & CR31 */ +#define SwitchToCRT2 0x0002 +#define SetCRT2ToTV1 0x009C +#define SetCRT2ToTV 0x089C +#define SetCRT2ToAVIDEO 0x0004 +#define SetCRT2ToSVIDEO 0x0008 +#define SetCRT2ToSCART 0x0010 +#define SetCRT2ToLCD 0x0020 +#define SetCRT2ToRAMDAC 0x0040 +#define SetCRT2ToHiVisionTV 0x0080 +#define SetCRT2ToLCDA 0x0100 +#define SetInSlaveMode 0x0200 +#define SetNotSimuMode 0x0400 +#define HKEventMode 0x0800 +#define SetCRT2ToYPbPr 0x0800 +#define LoadDACFlag 0x1000 +#define DisableCRT2Display 0x2000 +#define DriverMode 0x4000 +#define SetCRT2ToDualEdge 0x8000 +#define HotKeySwitch 0x8000 + +#define ProgrammingCRT2 0x0001 /* Set Flag */ +#define EnableVCMode 0x0002 +#define SetHKEventMode 0x0004 +#define ReserveTVOption 0x0008 +#define DisableRelocateIO 0x0010 +#define Win9xDOSMode 0x0020 +#define JDOSMode 0x0040 +/* #define SetWin9xforJap 0x0080 // not used now */ +/* #define SetWin9xforKorea 0x0100 // not used now */ +#define GatingCRT 0x0800 +#define DisableChB 0x1000 +#define EnableChB 0x2000 +#define DisableChA 0x4000 +#define EnableChA 0x8000 + +#define SetNTSCTV 0x0000 /* TV Info */ +#define SetPALTV 0x0001 +#define SetNTSCJ 0x0002 +#define SetPALMTV 0x0004 +#define SetPALNTV 0x0008 +#define SetCHTVUnderScan 0x0000 +/* #define SetCHTVOverScan 0x0010 */ +#define SetYPbPrMode525i 0x0020 +#define SetYPbPrMode525p 0x0040 +#define SetYPbPrMode750p 0x0080 +#define SetYPbPrMode1080i 0x0100 +#define SetTVStdMode 0x0200 +#define SetTVLowResolution 0x0400 +#define SetTVSimuMode 0x0800 +#define TVSimuMode 0x0800 +#define RPLLDIV2XO 0x1000 +#define NTSC1024x768 0x2000 +#define SetTVLockMode 0x4000 + +#define LCDVESATiming 0x0001 /* LCD Info/CR37 */ +#define EnableLVDSDDA 0x0002 +#define EnableScalingLCD 0x0008 +#define SetPWDEnable 0x0004 +#define SetLCDtoNonExpanding 0x0010 +#define SetLCDPolarity 0x00e0 +#define SetLCDDualLink 0x0100 +#define SetLCDLowResolution 0x0200 +#define SetLCDStdMode 0x0400 + +#define DefaultLCDCap 0x80ea /* LCD Capability shampoo */ +#define RLVDSDHL00 0x0000 +#define RLVDSDHL01 0x0001 +#define RLVDSDHL10 0x0002 /* default */ +#define RLVDSDHL11 0x0003 +#define EnableLCD24bpp 0x0004 /* default */ +#define DisableLCD24bpp 0x0000 +#define RLVDSClkSFT0 0x0000 +#define RLVDSClkSFT1 0x0008 /* default */ +#define EnableLVDSDCBal 0x0010 +#define DisableLVDSDCBal 0x0000 /* default */ +#define SinglePolarity 0x0020 /* default */ +#define MultiPolarity 0x0000 +#define LCDPolarity 0x00c0 /* default: SyncNN */ +#define LCDSingleLink 0x0000 /* default */ +#define LCDDualLink 0x0100 +#define EnableSpectrum 0x0200 +#define DisableSpectrum 0x0000 /* default */ +#define PWDEnable 0x0400 +#define PWDDisable 0x0000 /* default */ +#define PWMEnable 0x0800 +#define PWMDisable 0x0000 /* default */ +#define EnableVBCLKDRVLOW 0x4000 +#define EnableVBCLKDRVHigh 0x0000 /* default */ +#define EnablePLLSPLOW 0x8000 +#define EnablePLLSPHigh 0x0000 /* default */ + +#define LCDBToA 0x20 /* LCD SetFlag */ +#define StLCDBToA 0x40 +#define LockLCDBToA 0x80 +#define LCDToFull 0x10 +#define AVIDEOSense 0x01 /* CR32 */ +#define SVIDEOSense 0x02 +#define SCARTSense 0x04 +#define LCDSense 0x08 +#define Monitor2Sense 0x10 +#define Monitor1Sense 0x20 +#define HiTVSense 0x40 + +#ifdef NewScratch +#define YPbPrSense 0x80 /* NEW SCRATCH */ +#endif + +#define TVSense 0xc7 + +#define TVOverScan 0x10 /* CR35 */ +#define TVOverScanShift 4 + +#ifdef NewScratch +#define NTSCMode 0x00 +#define PALMode 0x00 +#define NTSCJMode 0x02 +#define PALMNMode 0x0c +#define YPbPrMode 0xe0 +#define YPbPrMode525i 0x00 +#define YPbPrMode525p 0x20 +#define YPbPrMode750p 0x40 +#define YPbPrMode1080i 0x60 +#else /* Old Scratch */ +#define ClearBufferFlag 0x20 +#endif + + +#define LCDRGB18Bit 0x01 /* CR37 */ +#define LCDNonExpanding 0x10 +#define LCDNonExpandingShift 4 +#define LCDSync 0x20 +#define LCDSyncBit 0xe0 /* H/V polarity & sync ID */ +#define LCDSyncShift 6 + +#ifdef NewScratch +#define ScalingLCD 0x08 +#else /* Old Scratch */ +#define ExtChipType 0x0e +#define ExtChip301 0x02 +#define ExtChipLVDS 0x04 +#define ExtChipCH7019 0x06 +#define ScalingLCD 0x10 +#endif + +#define EnableDualEdge 0x01 /* CR38 */ +#define SetToLCDA 0x02 +#ifdef NewScratch +#define SetYPbPr 0x04 +#define DisableChannelA 0x08 +#define DisableChannelB 0x10 +#define ExtChipType 0xe0 +#define ExtChip301 0x20 +#define ExtChipLVDS 0x40 +#define ExtChipCH7019 0x60 +#else /* Old Scratch */ +#define YPbPrSense 0x04 +#define SetYPbPr 0x08 +#define YPbPrMode 0x30 +#define YPbPrMode525i 0x00 +#define YPbPrMode525p 0x10 +#define YPbPrMode750p 0x20 +#define YPbPrMode1080i 0x30 +#define PALMNMode 0xc0 +#endif + +#define BacklightControlBit 0x01 /* CR3A */ +#define Win9xforJap 0x40 +#define Win9xforKorea 0x80 + +#define ForceMDBits 0x07 /* CR3B */ +#define ForceMD_JDOS 0x00 +#define ForceMD_640x400T 0x01 +#define ForceMD_640x350T 0x02 +#define ForceMD_720x400T 0x03 +#define ForceMD_640x480E 0x04 +#define ForceMD_640x400E 0x05 +#define ForceP1Bit 0x10 +#define ForceP2Bit 0x20 +#define EnableForceMDinBIOS 0x40 +#define EnableForceMDinDrv 0x80 + +#ifdef NewScratch /* New Scratch */ +/* ---------------------- VUMA Information */ +#define LCDSettingFromCMOS 0x04 /* CR3C */ +#define TVSettingFromCMOS 0x08 +#define DisplayDeviceFromCMOS 0x10 +#define HKSupportInSBIOS 0x20 +#define OSDSupportInSBIOS 0x40 +#define DisableLogo 0x80 + +/* ---------------------- HK Evnet Definition */ +#define HKEvent 0x0f /* CR3D */ +#define HK_ModeSwitch 0x01 +#define HK_Expanding 0x02 +#define HK_OverScan 0x03 +#define HK_Brightness 0x04 +#define HK_Contrast 0x05 +#define HK_Mute 0x06 +#define HK_Volume 0x07 +#define ModeSwitchStatus 0xf0 +#define ActiveCRT1 0x10 +#define ActiveLCD 0x0020 +#define ActiveTV 0x40 +#define ActiveCRT2 0x80 + +#define TVSwitchStatus 0x1f /* CR3E */ +#define ActiveAVideo 0x01 +#define ActiveSVideo 0x02 +#define ActiveSCART 0x04 +#define ActiveHiTV 0x08 +#define ActiveYPbPr 0x10 + +#define EnableHKEvent 0x01 /* CR3F */ +#define EnableOSDEvent 0x02 +#define StartOSDEvent 0x04 +#define IgnoreHKEvent 0x08 +#define IgnoreOSDEvent 0x10 +#else /* Old Scratch */ +#define OSD_SBIOS 0x02 /* SR17 */ +#define DisableLogo 0x04 +#define SelectKDOS 0x08 +#define KorWinMode 0x10 +#define KorMode3Bit 0x0020 +#define PSCCtrlBit 0x40 +#define NPSCCtrlBitShift 6 +#define BlueScreenBit 0x80 + +#define HKEvent 0x0f /* CR79 */ +#define HK_ModeSwitch 0x01 +#define HK_Expanding 0x02 +#define HK_OverScan 0x03 +#define HK_Brightness 0x04 +#define HK_Contrast 0x05 +#define HK_Mute 0x06 +#define HK_Volume 0x07 +#define ActivePAL 0x0020 +#define ActivePALShift 5 +#define ActiveNonExpanding 0x40 +#define ActiveNonExpandingShift 6 +#define ActiveOverScan 0x80 +#define ActiveOverScanShift 7 + +#define ModeSwitchStatus 0x0b /* SR15 */ +#define ActiveCRT1 0x01 +#define ActiveLCD 0x02 +#define ActiveCRT2 0x08 + +#define TVSwitchStatus 0xf0 /* SR16 */ +#define TVConfigShift 3 +#define ActiveTV 0x01 +#define ActiveYPbPr 0x04 +#define ActiveAVideo 0x10 +#define ActiveSVideo 0x0020 +#define ActiveSCART 0x40 +#define ActiveHiTV 0x80 + +#define EnableHKEvent 0x01 /* CR7A */ +#define EnableOSDEvent 0x02 +#define StartOSDEvent 0x04 +#define CMOSSupport 0x08 +#define HotKeySupport 0x10 +#define IngoreHKOSDEvent 0x20 +#endif + +/* //------------- Misc. Definition */ +#define SelectCRT1Rate 00h +/* #define SelectCRT2Rate 04h */ + +#define DDC1DelayTime 1000 +#ifdef TRUMPION +#define DDC2DelayTime 15 +#else +#define DDC2DelayTime 150 +#endif + +#define R_FACTOR 04Dh +#define G_FACTOR 097h +#define B_FACTOR 01Ch +/* --------------------------------------------------------- */ +/* translated from asm code 301def.h */ +/* */ +/* --------------------------------------------------------- */ +#define LCDDataLen 8 +#define HiTVDataLen 12 +#define TVDataLen 12 +#define LVDSCRT1Len_H 8 +#define LVDSCRT1Len_V 7 +#define LVDSDataLen 6 +#define LVDSDesDataLen 6 +#define LCDDesDataLen 6 +#define LVDSDesDataLen2 8 +#define LCDDesDataLen2 8 +#define CHTVRegLen 16 +#define CHLVRegLen 12 + +#define StHiTVHT 892 +#define StHiTVVT 1126 +#define StHiTextTVHT 1000 +#define StHiTextTVVT 1126 +#define ExtHiTVHT 2100 +#define ExtHiTVVT 1125 +#define NTSCHT 1716 +#define NTSCVT 525 +#define NTSC1024x768HT 1908 +#define NTSC1024x768VT 525 +#define PALHT 1728 +#define PALVT 625 + +#define YPbPrTV525iHT 1716 /* YPbPr */ +#define YPbPrTV525iVT 525 +#define YPbPrTV525pHT 1716 +#define YPbPrTV525pVT 525 +#define YPbPrTV750pHT 1650 +#define YPbPrTV750pVT 750 + +#define CRT2VCLKSel 0xc0 + +#define CRT2Delay1 0x04 /* XGI301 */ +#define CRT2Delay2 0x0A /* 301B,302 */ + + +#define VCLK25_175 0x00 +#define VCLK28_322 0x01 +#define VCLK31_5 0x02 +#define VCLK36 0x03 +#define VCLK40 0x04 +#define VCLK43_163 0x05 +#define VCLK44_9 0x06 +#define VCLK49_5 0x07 +#define VCLK50 0x08 +#define VCLK52_406 0x09 +#define VCLK56_25 0x0A +#define VCLK65 0x0B +#define VCLK67_765 0x0C +#define VCLK68_179 0x0D +#define VCLK72_852 0x0E +#define VCLK75 0x0F +#define VCLK75_8 0x10 +#define VCLK78_75 0x11 +#define VCLK79_411 0x12 +#define VCLK83_95 0x13 +#define VCLK84_8 0x14 +#define VCLK86_6 0x15 +#define VCLK94_5 0x16 +#define VCLK104_998 0x17 +#define VCLK105_882 0x18 +#define VCLK108_2 0x19 +#define VCLK109_175 0x1A +#define VCLK113_309 0x1B +#define VCLK116_406 0x1C +#define VCLK132_258 0x1D +#define VCLK135_5 0x1E +#define VCLK139_054 0x1F +#define VCLK157_5 0x20 +#define VCLK162 0x21 +#define VCLK175 0x22 +#define VCLK189 0x23 +#define VCLK194_4 0x24 +#define VCLK202_5 0x25 +#define VCLK229_5 0x26 +#define VCLK234 0x27 +#define VCLK252_699 0x28 +#define VCLK254_817 0x29 +#define VCLK265_728 0x2A +#define VCLK266_952 0x2B +#define VCLK269_655 0x2C +#define VCLK272_042 0x2D +#define VCLK277_015 0x2E +#define VCLK286_359 0x2F +#define VCLK291_132 0x30 +#define VCLK291_766 0x31 +#define VCLK309_789 0x32 +#define VCLK315_195 0x33 +#define VCLK323_586 0x34 +#define VCLK330_615 0x35 +#define VCLK332_177 0x36 +#define VCLK340_477 0x37 +#define VCLK375_847 0x38 +#define VCLK388_631 0x39 +#define VCLK125_999 0x51 +#define VCLK148_5 0x52 +#define VCLK178_992 0x54 +#define VCLK217_325 0x55 +#define VCLK299_505 0x56 +#define YPbPr750pVCLK 0x57 + +#define TVVCLKDIV2 0x3A +#define TVVCLK 0x3B +#define HiTVVCLKDIV2 0x3C +#define HiTVVCLK 0x3D +#define HiTVSimuVCLK 0x3E +#define HiTVTextVCLK 0x3F +#define VCLK39_77 0x40 +/* #define YPbPr750pVCLK 0x0F */ +#define YPbPr525pVCLK 0x3A +/* #define ;;YPbPr525iVCLK 0x3B */ +/* #define ;;YPbPr525iVCLK_2 0x3A */ +#define NTSC1024VCLK 0x41 +#define VCLK25_175_41 0x42 /* ; ScaleLCD */ +#define VCLK25_175_42 0x43 +#define VCLK28_322_43 0x44 +#define VCLK40_44 0x45 +#define VCLKQVGA_1 0x46 /* ; QVGA */ +#define VCLKQVGA_2 0x47 +#define VCLKQVGA_3 0x48 +#define VCLK35_2 0x49 /* ; 800x480 */ +#define VCLK122_61 0x4A +#define VCLK80_350 0x4B +#define VCLK107_385 0x4C + +#define CHTVVCLK30_2 0x50 /* ;;CHTV */ +#define CHTVVCLK28_1 0x51 +#define CHTVVCLK43_6 0x52 +#define CHTVVCLK26_4 0x53 +#define CHTVVCLK24_6 0x54 +#define CHTVVCLK47_8 0x55 +#define CHTVVCLK31_5 0x56 +#define CHTVVCLK26_2 0x57 +#define CHTVVCLK39 0x58 +#define CHTVVCLK36 0x59 +#define RES320x200 0x00 +#define RES320x240 0x01 +#define RES400x300 0x02 +#define RES512x384 0x03 +#define RES640x400 0x04 +#define RES640x480x60 0x05 +#define RES640x480x72 0x06 +#define RES640x480x75 0x07 +#define RES640x480x85 0x08 +#define RES640x480x100 0x09 +#define RES640x480x120 0x0A +#define RES640x480x160 0x0B +#define RES640x480x200 0x0C +#define RES800x600x56 0x0D +#define RES800x600x60 0x0E +#define RES800x600x72 0x0F +#define RES800x600x75 0x10 +#define RES800x600x85 0x11 +#define RES800x600x100 0x12 +#define RES800x600x120 0x13 +#define RES800x600x160 0x14 +#define RES1024x768x43 0x15 +#define RES1024x768x60 0x16 +#define RES1024x768x70 0x17 +#define RES1024x768x75 0x18 +#define RES1024x768x85 0x19 +#define RES1024x768x100 0x1A +#define RES1024x768x120 0x1B +#define RES1280x1024x43 0x1C +#define RES1280x1024x60 0x1D +#define RES1280x1024x75 0x1E +#define RES1280x1024x85 0x1F +#define RES1600x1200x60 0x20 +#define RES1600x1200x65 0x21 +#define RES1600x1200x70 0x22 +#define RES1600x1200x75 0x23 +#define RES1600x1200x85 0x24 +#define RES1600x1200x100 0x25 +#define RES1600x1200x120 0x26 +#define RES1920x1440x60 0x27 +#define RES1920x1440x65 0x28 +#define RES1920x1440x70 0x29 +#define RES1920x1440x75 0x2A +#define RES1920x1440x85 0x2B +#define RES1920x1440x100 0x2C +#define RES2048x1536x60 0x2D +#define RES2048x1536x65 0x2E +#define RES2048x1536x70 0x2F +#define RES2048x1536x75 0x30 +#define RES2048x1536x85 0x31 +#define RES800x480x60 0x32 +#define RES800x480x75 0x33 +#define RES800x480x85 0x34 +#define RES1024x576x60 0x35 +#define RES1024x576x75 0x36 +#define RES1024x576x85 0x37 +#define RES1280x720x60 0x38 +#define RES1280x720x75 0x39 +#define RES1280x720x85 0x3A +#define RES1280x960x60 0x3B +#define RES720x480x60 0x3C +#define RES720x576x56 0x3D +#define RES856x480x79I 0x3E +#define RES856x480x60 0x3F +#define RES1280x768x60 0x40 +#define RES1400x1050x60 0x41 +#define RES1152x864x60 0x42 +#define RES1152x864x75 0x43 +#define RES1024x768x160 0x44 +#define RES1280x960x75 0x45 +#define RES1280x960x85 0x46 +#define RES1280x960x120 0x47 + +#define LFBDRAMTrap 0x30 +#endif Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_ext.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_ext.c:1.1 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_ext.c Mon May 2 09:28:02 2005 @@ -0,0 +1,991 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_ext.c,v 1.1 2005/05/02 13:28:02 dawes Exp $ */ + +#include "osdef.h" + +#ifdef WIN2000 + +#include <dderror.h> +#include <devioctl.h> +#include <miniport.h> +#include <ntddvdeo.h> +#include <video.h> +#include "xgiv.h" +#include "dd_i2c.h" +#include "tools.h" +#endif /* WIN2000 */ + +#ifdef LINUX_XF86 +#include "xf86.h" +#include "xf86PciInfo.h" +#include "xgi.h" +#include "xgi_regs.h" +#endif + +#ifdef LINUX_KERNEL +#include <linux/version.h> +#include <asm/io.h> +#include <linux/types.h> +#include "XGIfb.h" +/*#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) +#include <video/XGIfb.h> +#else +#include <linux/XGIfb.h> +#endif*/ +#endif + + + +#include "vb_def.h" +#include "vgatypes.h" +#include "vb_struct.h" +#include "vb_util.h" +#include "vb_setmode.h" +#include "vb_ext.h" +extern UCHAR XGI330_SoftSetting; +extern UCHAR XGI330_OutputSelect; +extern USHORT XGI330_RGBSenseData2; +extern USHORT XGI330_YCSenseData2; +extern USHORT XGI330_VideoSenseData2; + +BOOLEAN XGINew_GetPanelID(PVB_DEVICE_INFO pVBInfo); +USHORT XGINew_SenseLCD(PXGI_HW_DEVICE_INFO,PVB_DEVICE_INFO pVBInfo); +BOOLEAN XGINew_GetLCDDDCInfo(PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo); +BOOLEAN XGINew_BridgeIsEnable(PXGI_HW_DEVICE_INFO,PVB_DEVICE_INFO pVBInfo ); +BOOLEAN XGINew_Sense(USHORT tempbx,USHORT tempcx, PVB_DEVICE_INFO pVBInfo); +BOOLEAN XGINew_SenseHiTV( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ) ; + +/************************************************************** + Dynamic Sense +*************************************************************/ + +BOOLEAN XGI_Is301C(PVB_DEVICE_INFO); +BOOLEAN XGI_Is301LV(PVB_DEVICE_INFO); + +#ifdef WIN2000 +UCHAR XGI_SenseLCD(PHW_DEVICE_EXTENSION, PVB_DEVICE_INFO); +UCHAR XGI_GetLCDDDCInfo(PHW_DEVICE_EXTENSION,PVB_DEVICE_INFO); + +extern BOOL bGetDdcInfo( +PHW_DEVICE_EXTENSION pHWDE, +ULONG ulWhichOne, +PUCHAR pjQueryBuffer, +ULONG ulBufferSize + ); + +#endif + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_Is301B */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static BOOLEAN XGINew_Is301B( PVB_DEVICE_INFO pVBInfo ) +{ + USHORT flag ; + + flag = XGINew_GetReg1( pVBInfo->Part4Port , 0x01 ) ; + + if ( flag > 0x0B0 ) + return( 0 ) ; /* 301b */ + else + return( 1 ) ; +} + +/* --------------------------------------------------------------------- */ +/* Function : XGI_Is301C */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGI_Is301C( PVB_DEVICE_INFO pVBInfo ) +{ + if ( ( XGINew_GetReg1( pVBInfo->Part4Port , 0x01 ) & 0xF0 ) == 0xC0 ) + return( 1 ) ; + + if ( XGINew_GetReg1( pVBInfo->Part4Port , 0x01 ) >= 0xD0 ) + { + if ( XGINew_GetReg1( pVBInfo->Part4Port , 0x39 ) == 0xE0 ) + return( 1 ) ; + } + + return( 0 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_Is301LV */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGI_Is301LV( PVB_DEVICE_INFO pVBInfo ) +{ + if ( XGINew_GetReg1( pVBInfo->Part4Port , 0x01 ) >= 0xD0 ) + { + if ( XGINew_GetReg1( pVBInfo->Part4Port , 0x39 ) == 0xFF ) + { + return( 1 ) ; + } + } + return( 0 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_Sense */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGINew_Sense( USHORT tempbx , USHORT tempcx, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT temp , i , tempch ; + + temp = tempbx & 0xFF ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x11 , temp ) ; + temp = ( tempbx & 0xFF00 ) >> 8 ; + temp |= ( tempcx & 0x00FF ) ; + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x10 , ~0x1F , temp ) ; + + for( i = 0 ; i < 10 ; i++ ) + XGI_LongWait( pVBInfo) ; + + tempch = ( tempcx & 0x7F00 ) >> 8 ; + temp = XGINew_GetReg1( pVBInfo->Part4Port , 0x03 ) ; + temp = temp ^ ( 0x0E ) ; + temp &= tempch ; + + if ( temp > 0 ) + return( 1 ) ; + else + return( 0 ) ; +} + +#ifdef WIN2000 +/* --------------------------------------------------------------------- */ +/* Function : XGI_SenseLCD */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +UCHAR XGI_SenseLCD( PHW_DEVICE_EXTENSION pHWDE, PVB_DEVICE_INFO pVBInfo) +{ + USHORT tempax , tempbx , tempcx ; + UCHAR SoftSetting = XGI330_SoftSetting ; + + if ( pVBInfo->VBType & ( VB_XGI301LV | VB_XGI302LV ) ) + return( 1 ) ; + + + if ( SoftSetting & HotPlugFunction ) /* Hot Plug Detection */ + { + XGINew_SetRegAND( pVBInfo->Part4Port , 0x0F , 0x3F ) ; + tempbx = 0 ; + tempcx = 0x9010 ; + if ( XGINew_Sense( tempbx , tempcx, pVBInfo ) ) + return( 1 ) ; + + return( 0 ) ; + } + else /* Get LCD Info from EDID */ + return(XGI_GetLCDDDCInfo(pHWDE, pVBInfo)); +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetLCDDDCInfo */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +UCHAR XGI_GetLCDDDCInfo( PHW_DEVICE_EXTENSION pHWDE , PVB_DEVICE_INFO pVBInfo) +{ + UCHAR tempah , tempbl , tempbh ; + USHORT tempbx , temp ; + UCHAR pjEDIDBuf[ 256 ] ; + ULONG ulBufferSize = 256 ; + UCHAR bMASK_OUTPUTSTATE_CRT2LCD = 2 ; /* 0423 shampoo */ + + bGetDdcInfo( pHWDE , MASK_OUTPUTSTATE_CRT2LCD , pjEDIDBuf , ulBufferSize ) ; + if ( ( *( ( PULONG )pjEDIDBuf ) == 0xFFFFFF00 ) && ( *( ( PULONG )( pjEDIDBuf + 4 ) ) == 0x00FFFFFF ) ) + { + tempah = Panel1024x768 ; + tempbl=( *( pjEDIDBuf + 0x3A ) ) & 0xf0 ; + + if ( tempbl != 0x40 ) + { + tempah = Panel1600x1200 ; + if ( tempbl != 0x60 ) + { + tempah = Panel1280x1024 ; + tempbh = ( *( pjEDIDBuf + 0x3B ) ) ; + if ( tempbh != 0x00 ) + { + tempah = Panel1280x960 ; + if ( tempbh != 0x0C0 ) + { + tempbx = ( ( *( pjEDIDBuf + 0x24 ) ) << 8 ) | ( *( pjEDIDBuf + 0x23 ) ) ; + tempah = Panel1280x1024 ; + if ( !( tempbx & 0x0100 ) ) + { + tempah = Panel1024x768 ; + if ( !( tempbx & 0x0E00 ) ) + { + tempah = Panel1280x1024 ; + } + } + } + + if ( tempbx & 0x00FF ) + { + temp = ScalingLCD ; + XGINew_SetRegOR( pVBInfo->P3d4 , 0x37 , temp ) ; + } + } + } + } + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x36 , ( ~0x07 ) , tempah ) ; + tempah = ( ( *( pjEDIDBuf + 0x47 ) ) & 0x06 ) ; /* Polarity */ + tempah = ( tempah ^ 0x06 ) << 4 ; + tempah |= LCDSync ; + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x37 , ( ~LCDSyncBit ) , tempah ) ; + tempbh= XGINew_GetReg1( pVBInfo->P3d4 , 0x36 ) ; + tempbh &= 0x07 ; + if ( tempbh == Panel1280x960 ) + XGINew_SetRegAND( pVBInfo->P3d4 , 0x37 , 0x0E ) ; + } + else if ( *pjEDIDBuf == 0x20 ) + { + tempah = Panel1024x768 ; + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x36 , ( ~0x07 ) , tempah ) ; + } + else + { + return( 0 ) ; + } + + return( 1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_DySense */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGI_DySense( PHW_DEVICE_EXTENSION pHWDE , PUCHAR ujConnectStatus) +{ + UCHAR pre_CRD,pre_SR1E , pre_Part2_0 , pre_Part4_D ; + USHORT tempax , tempbx , tempcx , pushax , temp ; + VB_DEVICE_INFO VBINF; + PVB_DEVICE_INFO pVBInfo = &VBINF; + UCHAR OutputSelect = XGI330_OutputSelect ; + PXGI_HW_DEVICE_INFO HwDeviceExtension= pHWDE->pXGIHWDE ; + UCHAR bConnectStatus = 0 ; + pVBInfo->BaseAddr = ( USHORT )HwDeviceExtension->pjIOAddress ; + pVBInfo->ROMAddr = pHWDE->pjVirtualRomBase ; + + pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12 ; + pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ; + pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24 ; + pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10 ; + pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 ; + pushax = XGINew_GetReg1( pVBInfo->P3d4 , 0x17 ) ; /* 0512 Fix Dysense hanged */ + temp = ( pushax & 0x00FF ) | 0x80 ; + XGINew_SetRegOR( pVBInfo->P3d4 , 0x17 , temp ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x05 , 0x86 ) ; + /* beginning of dynamic sense CRT1 */ + + if(( pHWDE->jChipID >= XG40 ) || ( pHWDE->jChipID == XG20 )) + { + + if ( pHWDE->jChipID >= XG40 ) + XGINew_SetReg1( pVBInfo->P3d4 , 0x57 , 0x4A ) ; /* write sense pattern 30->4a */ + else + XGINew_SetReg1( pVBInfo->P3d4 , 0x57 , 0x5F ) ; /* write sense pattern */ + + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x53 , 0xFF , 0x02 ) ; /* enable sense DAC */ + XGI_WaitDisply(pVBInfo) ; + + if(XGINew_GetReg2( pVBInfo->P3c2 ) & 0x10 ) + bConnectStatus |= Monitor1Sense ; + + XGINew_SetRegAND( pVBInfo->P3d4 , 0x53 , 0xFD ) ; /* disable sense DAC */ + XGINew_SetRegAND( pVBInfo->P3d4 , 0x57 , 0x00 ) ; /* clear sense pattern */ + + + /* ---------- End of dynamic sense CRT1 ----------- */ + + /* ---------- beginning of dynamic sense VB ------------ */ + pre_SR1E = XGINew_GetReg1( pVBInfo->P3c4 , 0x1E ) ; + XGINew_SetRegOR( pVBInfo->P3c4 , 0x1E , 0x20 ) ; /* Enable CRT2,work-a-round for 301B/301LV/302LV */ + pre_Part2_0 = XGINew_GetReg1( pVBInfo->Part2Port , 0x00 ) ; + pre_Part4_D = XGINew_GetReg1( pVBInfo->Part4Port , 0x0D ) ; + + if ( XGI_Is301C( pVBInfo ) ) /* 301C only */ + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x0D , ~0x07 , 0x01 ) ; /* Set Part4 0x0D D[2:0] to 001b */ + + /* tempax = 0 ; */ + if ( !XGI_Is301LV( pVBInfo ) ) + { + tempbx = XGI330_RGBSenseData2 ; + tempcx = 0x0E08 ; + if(XGINew_Sense( tempbx , tempcx, pVBInfo ) ) + { + bConnectStatus |= Monitor2Sense ; + if ( OutputSelect & SetSCARTOutput ) + { + bConnectStatus ^= ( Monitor2Sense | SCARTSense ) ; + } + } + } + if ( XGI_Is301C( pVBInfo ) ) /* 301C only */ + XGINew_SetRegOR( pVBInfo->Part4Port , 0x0D , 0x04 ) ; /* Set Part4 0x0D D[2]=1 for dynamic sense */ + + if ( ( XGINew_Is301B( pVBInfo ) ) ) + XGINew_SetRegOR( pVBInfo->Part2Port , 0x00 , 0x0C ) ; /* ????????? */ + + if ( XGINew_SenseHiTV( HwDeviceExtension , pVBInfo) ) /* add by kuku for Dysense HiTV //start */ + { + bConnectStatus|= YPbPrSense ; + } + else + { + tempbx = XGI330_YCSenseData2 ; /* Y/C Sense Data Ptr */ + tempcx = 0x0604 ; + if ( XGINew_Sense( tempbx , tempcx , pVBInfo) ) + bConnectStatus |= SVIDEOSense ; + + if ( OutputSelect & BoardTVType ) + { + tempbx = XGI330_VideoSenseData2 ; + tempcx = 0x0804 ; + if ( XGINew_Sense(tempbx , tempcx, pVBInfo) ) + bConnectStatus|= AVIDEOSense ; + } + else + { + if ( !( bConnectStatus & SVIDEOSense ) ) + { + tempbx = XGI330_VideoSenseData2 ; + tempcx = 0x0804 ; + if ( XGINew_Sense( tempbx , tempcx, pVBInfo ) ) + bConnectStatus |= AVIDEOSense ; + } + } + } /* end */ + /* DySenseVBCnt */ + + tempbx = 0 ; + tempcx = 0 ; + XGINew_Sense(tempbx , tempcx, pVBInfo ) ; + + if ( !( bConnectStatus & Monitor2Sense ) ) + { + if ( XGI_SenseLCD( pHWDE , pVBInfo ) ) + bConnectStatus |= LCDSense ; + } + + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x32 , ~( AVIDEOSense | SVIDEOSense | LCDSense | Monitor2Sense | Monitor1Sense ) , bConnectStatus ) ; + + XGINew_SetReg1( pVBInfo->Part4Port , 0x0D , pre_Part4_D ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x00 , pre_Part2_0 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x1E , pre_SR1E ) ; + + if ( XGI_Is301C( pVBInfo ) ) /* 301C only */ + { + tempax = XGINew_GetReg1( pVBInfo->Part2Port , 0x00 ) ; + if ( tempax & 0x20 ) + { + /* Reset VBPro */ + for( tempcx = 2 ; tempcx > 0 ; tempcx-- ) + { + tempax ^= 0x20 ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x00 , tempax ) ; + } + } + } + /* End of dynamic sense VB */ + } + else + { + XGI_SenseCRT1(pVBInfo) ; + XGI_GetSenseStatus( HwDeviceExtension, pVBInfo ) ; /* sense CRT2 */ + bConnectStatus = XGINew_GetReg1( pVBInfo->P3d4 , 0x32 ) ; + } + temp = pushax & 0x00FF ; /* 0512 Fix Dysense hanged */ + XGINew_SetReg1( pVBInfo->P3d4 , 0x17 , temp ) ; + if ( bConnectStatus ) + { + *ujConnectStatus = bConnectStatus ; + return( 1 ) ; + } + else + return( 0 ) ; +} + +#endif + +/* --------------------------------------------------------------------- */ +/* Function : XGISetDPMS */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID XGISetDPMS( PXGI_HW_DEVICE_INFO pXGIHWDE , ULONG VESA_POWER_STATE ) +{ + USHORT ModeNo, ModeIdIndex ; + UCHAR temp ; + VB_DEVICE_INFO VBINF; + PVB_DEVICE_INFO pVBInfo = &VBINF; + pVBInfo->BaseAddr = ( USHORT )pXGIHWDE->pjIOAddress ; + pVBInfo->ROMAddr = pXGIHWDE->pjVirtualRomBase ; + + if ( ( pXGIHWDE->ujVBChipID == VB_CHIP_301 ) || ( pXGIHWDE->ujVBChipID == VB_CHIP_302 ) ) + { + pVBInfo->IF_DEF_LVDS = 0 ; + pVBInfo->IF_DEF_CH7005 = 0 ; + pVBInfo->IF_DEF_HiVision = 1 ; + pVBInfo->IF_DEF_LCDA = 1 ; + pVBInfo->IF_DEF_CH7017 = 0 ; + pVBInfo->IF_DEF_YPbPr = 1 ; + pVBInfo->IF_DEF_CRT2Monitor = 0 ; + pVBInfo->IF_DEF_VideoCapture = 0 ; + pVBInfo->IF_DEF_ScaleLCD = 0 ; + pVBInfo->IF_DEF_OEMUtil = 0 ; + pVBInfo->IF_DEF_PWD = 0 ; + + XGI_InitTo330Pointer( pXGIHWDE->jChipType, pVBInfo ) ; + XGI_ReadVBIOSTablData( pXGIHWDE->jChipType , pVBInfo) ; + + pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ; + pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24 ; + pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10 ; + pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e ; + pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12 ; + pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a ; + pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16 ; + pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17 ; + pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18 ; + pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19 ; + pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A ; + pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00 ; + pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04 ; + pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10 ; + pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12 ; + pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 ; + pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2 ; + + XGINew_SetModeScratch ( pXGIHWDE , pVBInfo ) ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x05 , 0x86 ) ; /* 1.Openkey */ + XGI_UnLockCRT2( pXGIHWDE , pVBInfo) ; + ModeNo = XGINew_GetReg1( pVBInfo->P3d4 , 0x34 ) ; + XGI_SearchModeID( ModeNo , &ModeIdIndex, pVBInfo ) ; + XGI_GetVGAType( pXGIHWDE , pVBInfo ) ; + XGI_GetVBType( pVBInfo ) ; + XGI_GetVBInfo( ModeNo , ModeIdIndex , pXGIHWDE, pVBInfo ) ; + XGI_GetTVInfo( ModeNo , ModeIdIndex, pVBInfo ) ; + XGI_GetLCDInfo( ModeNo , ModeIdIndex, pVBInfo ) ; + } + + if ( VESA_POWER_STATE == 0x00000400 ) + XGINew_SetReg1( pVBInfo->Part4Port , 0x31 , ( UCHAR )( XGINew_GetReg1( pVBInfo->Part4Port , 0x31 ) & 0xFE ) ) ; + else + XGINew_SetReg1( pVBInfo->Part4Port , 0x31 , ( UCHAR )( XGINew_GetReg1( pVBInfo->Part4Port , 0x31 ) | 0x01 ) ) ; + + temp = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x1f ) ; + temp &= 0x3f ; + switch ( VESA_POWER_STATE ) + { + case 0x00000000: + if ( ( pXGIHWDE->ujVBChipID == VB_CHIP_301 ) || ( pXGIHWDE->ujVBChipID == VB_CHIP_302 ) ) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x1f , ( UCHAR )( temp | 0x00 ) ) ; + XGI_EnableBridge( pXGIHWDE, pVBInfo ) ; + } + else + { + temp = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x01 ) ; + temp &= 0xbf ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x1f , temp | 0x00 ) ; + } + break ; + case 0x00000100: + XGINew_SetReg1( pVBInfo->P3c4 , 0x1f , ( UCHAR )( temp | 0x40 ) ) ; + break ; + case 0x00000200: + XGINew_SetReg1( pVBInfo->P3c4 , 0x1f , ( UCHAR )( temp | 0x80 ) ) ; + break ; + case 0x00000400: + if ( (pXGIHWDE->ujVBChipID == VB_CHIP_301 ) || ( pXGIHWDE->ujVBChipID == VB_CHIP_302 ) ) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x1f , ( UCHAR )( temp | 0xc0 ) ) ; + XGI_DisableBridge( pXGIHWDE, pVBInfo ) ; + } + else + { + temp = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x01 ) ; + temp &= 0xbf ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x1f , temp | 0x20 ) ; + } + break ; + + default: + break ; + } + XGI_LockCRT2( pXGIHWDE , pVBInfo ) ; +} + + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetSenseStatus */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_GetSenseStatus( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +{ + USHORT tempax = 0 , tempbx , tempcx , temp , + P2reg0 = 0 , SenseModeNo = 0 , OutputSelect = *pVBInfo->pOutputSelect , + ModeIdIndex , i ; + pVBInfo->BaseAddr = ( USHORT )HwDeviceExtension->pjIOAddress ; + + if ( pVBInfo->IF_DEF_LVDS == 1 ) + { + tempax = XGINew_GetReg1( pVBInfo->P3c4 , 0x1A ) ; /* ynlai 02/27/2002 */ + tempbx = XGINew_GetReg1( pVBInfo->P3c4 , 0x1B ) ; + tempax = ( ( tempax & 0xFE ) >> 1 ) | ( tempbx << 8 ) ; + if ( tempax == 0x00 ) + { /* Get Panel id from DDC */ + temp = XGINew_GetLCDDDCInfo( HwDeviceExtension, pVBInfo ) ; + if ( temp == 1 ) + { /* LCD connect */ + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x39 , 0xFF , 0x01 ) ; /* set CR39 bit0="1" */ + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x37 , 0xEF , 0x00 ) ; /* clean CR37 bit4="0" */ + temp = LCDSense ; + } + else + { /* LCD don't connect */ + temp = 0 ; + } + } + else + { + XGINew_GetPanelID(pVBInfo) ; + temp = LCDSense ; + } + + tempbx = ~( LCDSense | AVIDEOSense | SVIDEOSense ) ; + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x32 , tempbx , temp ) ; + } + else + { /* for 301 */ + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { /* for HiVision */ + tempax = XGINew_GetReg1( pVBInfo->P3c4 , 0x38 ) ; + temp = tempax & 0x01 ; + tempax = XGINew_GetReg1( pVBInfo->P3c4 , 0x3A ) ; + temp = temp | ( tempax & 0x02 ) ; + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x32 , 0xA0 , temp ) ; + } + else + { + if ( XGI_BridgeIsOn( pVBInfo ) ) + { + P2reg0 = XGINew_GetReg1( pVBInfo->Part2Port , 0x00 ) ; + if ( !XGINew_BridgeIsEnable( HwDeviceExtension, pVBInfo ) ) + { + SenseModeNo = 0x2e ; + /* XGINew_SetReg1( pVBInfo->P3d4 , 0x30 , 0x41 ) ; */ + /* XGISetModeNew( HwDeviceExtension , 0x2e ) ; // ynlai InitMode */ + + temp = XGI_SearchModeID( SenseModeNo , &ModeIdIndex, pVBInfo ) ; + XGI_GetVGAType( HwDeviceExtension , pVBInfo) ; + XGI_GetVBType( pVBInfo ) ; + pVBInfo->SetFlag = 0x00 ; + pVBInfo->ModeType = ModeVGA ; + pVBInfo->VBInfo = SetCRT2ToRAMDAC | LoadDACFlag | SetInSlaveMode ; + XGI_GetLCDInfo( 0x2e , ModeIdIndex, pVBInfo ) ; + XGI_GetTVInfo( 0x2e , ModeIdIndex, pVBInfo ) ; + XGI_EnableBridge( HwDeviceExtension, pVBInfo ) ; + XGI_SetCRT2Group301( SenseModeNo , HwDeviceExtension, pVBInfo ) ; + XGI_SetCRT2ModeRegs( 0x2e , HwDeviceExtension, pVBInfo ) ; + /* XGI_DisableBridge( HwDeviceExtension, pVBInfo ) ; */ + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x01 , 0xDF , 0x20 ) ; /* Display Off 0212 */ + for( i = 0 ; i < 20 ; i++ ) + { + XGI_LongWait(pVBInfo) ; + } + } + XGINew_SetReg1( pVBInfo->Part2Port , 0x00 , 0x1c ) ; + tempax = 0 ; + tempbx = *pVBInfo->pRGBSenseData ; + + if ( !( XGINew_Is301B( pVBInfo ) ) ) + { + tempbx = *pVBInfo->pRGBSenseData2 ; + } + + tempcx = 0x0E08 ; + if ( XGINew_Sense(tempbx , tempcx, pVBInfo ) ) + { + if ( XGINew_Sense(tempbx , tempcx, pVBInfo ) ) + { + tempax |= Monitor2Sense ; + } + } + + if ( pVBInfo->VBType & VB_XGI301C) + { + XGINew_SetRegOR( pVBInfo->Part4Port , 0x0d , 0x04 ) ; + } + + if ( XGINew_SenseHiTV( HwDeviceExtension , pVBInfo) ) /* add by kuku for Multi-adapter sense HiTV */ + { + tempax |= HiTVSense ; + if ( ( pVBInfo->VBType & VB_XGI301C ) ) + { + tempax ^= ( HiTVSense | YPbPrSense ) ; + } + } + + if ( !( tempax & ( HiTVSense | YPbPrSense ) ) ) /* start */ + { + + tempbx = *pVBInfo->pYCSenseData ; + + if ( !( XGINew_Is301B( pVBInfo ) ) ) + { + tempbx=*pVBInfo->pYCSenseData2; + } + + tempcx = 0x0604 ; + if ( XGINew_Sense(tempbx , tempcx, pVBInfo ) ) + { + if ( XGINew_Sense(tempbx , tempcx, pVBInfo ) ) + { + tempax |= SVIDEOSense ; + } + } + + if ( OutputSelect & BoardTVType ) + { + tempbx = *pVBInfo->pVideoSenseData ; + + if ( !( XGINew_Is301B( pVBInfo ) ) ) + { + tempbx = *pVBInfo->pVideoSenseData2 ; + } + + tempcx = 0x0804 ; + if ( XGINew_Sense(tempbx , tempcx, pVBInfo ) ) + { + if ( XGINew_Sense(tempbx , tempcx, pVBInfo ) ) + { + tempax |= AVIDEOSense ; + } + } + } + else + { + if ( !( tempax & SVIDEOSense ) ) + { + tempbx = *pVBInfo->pVideoSenseData ; + + if ( !( XGINew_Is301B( pVBInfo ) ) ) + { + tempbx=*pVBInfo->pVideoSenseData2; + } + + tempcx = 0x0804 ; + if ( XGINew_Sense(tempbx , tempcx, pVBInfo ) ) + { + if ( XGINew_Sense(tempbx , tempcx, pVBInfo ) ) + { + tempax |= AVIDEOSense ; + } + } + } + } + } + } /* end */ + if ( !( tempax & Monitor2Sense ) ) + { + if ( XGINew_SenseLCD( HwDeviceExtension, pVBInfo ) ) + { + tempax |= LCDSense ; + } + } + tempbx = 0 ; + tempcx = 0 ; + XGINew_Sense(tempbx , tempcx, pVBInfo ) ; + + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x32 , ~0xDF , tempax ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x00 , P2reg0 ) ; + + if ( !( P2reg0 & 0x20 ) ) + { + pVBInfo->VBInfo = DisableCRT2Display ; + /* XGI_SetCRT2Group301( SenseModeNo , HwDeviceExtension, pVBInfo ) ; */ + } + } + } + XGI_DisableBridge( HwDeviceExtension, pVBInfo ) ; /* shampoo 0226 */ +} + + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SenseLCD */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +USHORT XGINew_SenseLCD( PXGI_HW_DEVICE_INFO HwDeviceExtension ,PVB_DEVICE_INFO pVBInfo) +{ + /* USHORT SoftSetting ; */ + USHORT temp ; + + if ( ( HwDeviceExtension->jChipType==XG20 ) || ( HwDeviceExtension->jChipType >= XG40 ) ) + temp = 0 ; + else + temp=XGINew_GetPanelID(pVBInfo) ; + + if( !temp ) + temp = XGINew_GetLCDDDCInfo( HwDeviceExtension, pVBInfo ) ; + + return( temp ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_GetLCDDDCInfo */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGINew_GetLCDDDCInfo( PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo) +{ + USHORT temp ; + + /* add lcd sense */ + if ( HwDeviceExtension->ulCRT2LCDType == LCD_UNKNOWN ) + { + return( 0 ) ; + } + else + { + temp = ( USHORT )HwDeviceExtension->ulCRT2LCDType ; + switch( HwDeviceExtension->ulCRT2LCDType ) + { + case LCD_INVALID: + case LCD_800x600: + case LCD_1024x768: + case LCD_1280x1024: + break ; + + case LCD_640x480: + case LCD_1024x600: + case LCD_1152x864: + case LCD_1280x960: + case LCD_1152x768: + temp = 0 ; + break ; + + case LCD_1400x1050: + case LCD_1280x768: + case LCD_1600x1200: + break ; + + case LCD_1920x1440: + case LCD_2048x1536: + temp = 0 ; + break ; + + default: + break ; + } + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x36 , 0xF0 , temp ) ; + return( 1 ) ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGINew_GetPanelID(PVB_DEVICE_INFO pVBInfo ) +{ + USHORT PanelTypeTable[ 16 ] = { SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType00 , + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType01 , + SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType02 , + SyncNN | PanelRGB18Bit | Panel640x480 | _PanelType03 , + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType04 , + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType05 , + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType06 , + SyncNN | PanelRGB24Bit | Panel1024x768 | _PanelType07 , + SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType08 , + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType09 , + SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType0A , + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0B , + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0C , + SyncNN | PanelRGB24Bit | Panel1024x768 | _PanelType0D , + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0E , + SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0F } ; + USHORT tempax , tempbx , temp ; + /* USHORT return_flag ; */ + + tempax = XGINew_GetReg1( pVBInfo->P3c4 , 0x1A ) ; + tempbx = tempax & 0x1E ; + + if ( tempax == 0 ) + return( 0 ) ; + else + { +/* + if ( !( tempax & 0x10 ) ) + { + if ( pVBInfo->IF_DEF_LVDS == 1 ) + { + tempbx = 0 ; + temp = XGINew_GetReg1( pVBInfo->P3c4 , 0x38 ) ; + if ( temp & 0x40 ) + tempbx |= 0x08 ; + if ( temp & 0x20 ) + tempbx |= 0x02 ; + if ( temp & 0x01 ) + tempbx |= 0x01 ; + + temp = XGINew_GetReg1( pVBInfo->P3c4 , 0x39 ) ; + if ( temp & 0x80 ) + tempbx |= 0x04 ; + } + else + { + return( 0 ) ; + } + } +*/ + + tempbx = tempbx >> 1 ; + temp = tempbx & 0x00F ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x36 , temp ) ; + tempbx-- ; + tempbx = PanelTypeTable[ tempbx ] ; + + temp = ( tempbx & 0xFF00 ) >> 8 ; + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x37 , ~( LCDSyncBit | LCDRGB18Bit ) , temp ) ; + return( 1 ) ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_BridgeIsEnable */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGINew_BridgeIsEnable( PXGI_HW_DEVICE_INFO HwDeviceExtension ,PVB_DEVICE_INFO pVBInfo) +{ + USHORT flag ; + + if ( XGI_BridgeIsOn( pVBInfo ) == 0 ) + { + flag = XGINew_GetReg1( pVBInfo->Part1Port , 0x0 ) ; + + if ( flag & 0x050 ) + { + return( 1 ) ; + } + else + { + return( 0 ) ; + } + + } + return( 0 ) ; +} + +/* ------------------------------------------------------ */ +/* Function : XGINew_SenseHiTV */ +/* Input : */ +/* Output : */ +/* Description : */ +/* ------------------------------------------------------ */ +BOOLEAN XGINew_SenseHiTV( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempbx , tempcx , temp , i , tempch; + + tempbx = *pVBInfo->pYCSenseData2 ; + + tempcx = 0x0604 ; + + temp = tempbx & 0xFF ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x11 , temp ) ; + temp = ( tempbx & 0xFF00 ) >> 8 ; + temp |= ( tempcx & 0x00FF ) ; + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x10 , ~0x1F , temp ) ; + + for( i = 0 ; i < 10 ; i++ ) + XGI_LongWait(pVBInfo) ; + + tempch = ( tempcx & 0xFF00 ) >> 8; + temp = XGINew_GetReg1( pVBInfo->Part4Port , 0x03 ) ; + temp = temp ^ ( 0x0E ) ; + temp &= tempch ; + + if ( temp != tempch ) + return( 0 ) ; + + tempbx = *pVBInfo->pVideoSenseData2 ; + + tempcx = 0x0804 ; + temp = tempbx & 0xFF ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x11 , temp ) ; + temp = ( tempbx & 0xFF00 ) >> 8 ; + temp |= ( tempcx & 0x00FF ) ; + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x10 , ~0x1F , temp ) ; + + for( i = 0 ; i < 10 ; i++ ) + XGI_LongWait(pVBInfo) ; + + tempch = ( tempcx & 0xFF00 ) >> 8; + temp = XGINew_GetReg1( pVBInfo->Part4Port , 0x03 ) ; + temp = temp ^ ( 0x0E ) ; + temp &= tempch ; + + if ( temp != tempch ) + return( 0 ) ; + else + { + tempbx = 0x3FF ; + tempcx = 0x0804 ; + temp = tempbx & 0xFF ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x11 , temp ) ; + temp = ( tempbx & 0xFF00 ) >> 8 ; + temp |= ( tempcx & 0x00FF ) ; + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x10 , ~0x1F , temp ) ; + + for( i = 0 ; i < 10 ; i++ ) + XGI_LongWait(pVBInfo) ; + + tempch = ( tempcx & 0xFF00 ) >> 8; + temp = XGINew_GetReg1( pVBInfo->Part4Port , 0x03 ) ; + temp = temp ^ ( 0x0E ) ; + temp &= tempch ; + + if ( temp != tempch ) + return( 1 ) ; + else + return( 0 ) ; + } +} Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_ext.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_ext.h:1.1 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_ext.h Mon May 2 09:28:02 2005 @@ -0,0 +1,14 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_ext.h,v 1.1 2005/05/02 13:28:02 dawes Exp $ */ + +#ifndef _VBEXT_ +#define _VBEXT_ + +extern void XGISetDPMS( PXGI_HW_DEVICE_INFO pXGIHWDE , ULONG VESA_POWER_STATE ) ; +extern void XGI_GetSenseStatus( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ); +extern void XGINew_SetModeScratch ( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ) ; +extern void XGI_ReadVBIOSTablData( UCHAR ChipType , PVB_DEVICE_INFO pVBInfo); +#ifdef WIN2000 +extern BOOLEAN XGI_DySense( PHW_DEVICE_EXTENSION pHWDE , PUCHAR ujConnectStatus ); +#endif /* WIN2000 */ + +#endif Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_init.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_init.c:1.1 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_init.c Mon May 2 09:28:02 2005 @@ -0,0 +1,3002 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_init.c,v 1.1 2005/05/02 13:28:02 dawes Exp $ */ + +#include "osdef.h" +#include "vgatypes.h" + + +#ifdef LINUX_KERNEL +#include <linux/version.h> +#include <linux/types.h> +#include <linux/delay.h> /* udelay */ +#include "XGIfb.h" +/*#if LINUX_VERSxION_CODE >= KERNEL_VERSION(2,5,0) +#include <video/XGIfb.h> +#else +#include <linux/XGIfb.h> +#endif */ +#endif + +#ifdef WIN2000 +#include <dderror.h> +#include <devioctl.h> +#include <miniport.h> +#include <ntddvdeo.h> +#include <video.h> +#include "xgiv.h" +#include "dd_i2c.h" +#include "tools.h" +#endif + +#include "vb_def.h" +#include "vb_struct.h" +#include "vb_util.h" +#include "vb_setmode.h" +#include "vb_init.h" +#include "vb_ext.h" + +#ifdef LINUX_XF86 +#include "xf86.h" +#include "xf86PciInfo.h" +#include "xgi.h" +#include "xgi_regs.h" +#endif + +#ifdef LINUX_KERNEL +#include <asm/io.h> +#include <linux/types.h> +#endif + + + + +static UCHAR XGINew_ChannelAB,XGINew_DataBusWidth; + +#if 0 +static USHORT XGINew_DRAMType[17][5]={{0x0C,0x0A,0x02,0x40,0x39},{0x0D,0x0A,0x01,0x40,0x48}, + {0x0C,0x09,0x02,0x20,0x35},{0x0D,0x09,0x01,0x20,0x44}, + {0x0C,0x08,0x02,0x10,0x31},{0x0D,0x08,0x01,0x10,0x40}, + {0x0C,0x0A,0x01,0x20,0x34},{0x0C,0x09,0x01,0x08,0x32}, + {0x0B,0x08,0x02,0x08,0x21},{0x0C,0x08,0x01,0x08,0x30}, + {0x0A,0x08,0x02,0x04,0x11},{0x0B,0x0A,0x01,0x10,0x28}, + {0x09,0x08,0x02,0x02,0x01},{0x0B,0x09,0x01,0x08,0x24}, + {0x0B,0x08,0x01,0x04,0x20},{0x0A,0x08,0x01,0x02,0x10}, + {0x09,0x08,0x01,0x01,0x00}}; +#endif + +static USHORT XGINew_SDRDRAM_TYPE[13][5]= +{ +{ 2,12, 9,64,0x35}, +{ 1,13, 9,64,0x44}, +{ 2,12, 8,32,0x31}, +{ 2,11, 9,32,0x25}, +{ 1,12, 9,32,0x34}, +{ 1,13, 8,32,0x40}, +{ 2,11, 8,16,0x21}, +{ 1,12, 8,16,0x30}, +{ 1,11, 9,16,0x24}, +{ 1,11, 8, 8,0x20}, +{ 2, 9, 8, 4,0x01}, +{ 1,10, 8, 4,0x10}, +{ 1, 9, 8, 2,0x00} +}; + +static USHORT XGINew_DDRDRAM_TYPE[4][5]= +{ +{ 2,12, 9,64,0x35}, +{ 2,12, 8,32,0x31}, +{ 2,11, 8,16,0x21}, +{ 2, 9, 8, 4,0x01} +}; +static USHORT XGINew_DDRDRAM_TYPE340[4][5]= +{ +{ 2,13, 9,64,0x45}, +{ 2,12, 9,32,0x35}, +{ 2,12, 8,16,0x31}, +{ 2,11, 8, 8,0x21} +}; +static USHORT XGINew_DDRDRAM_TYPE20[12][5]= +{ +{ 2,14,11,128,0x5D}, +{ 2,14,10,64,0x59}, +{ 2,13,11,64,0x4D}, +{ 2,14, 9,32,0x55}, +{ 2,13,10,32,0x49}, +{ 2,12,11,32,0x3D}, +{ 2,14, 8,16,0x51}, +{ 2,13, 9,16,0x45}, +{ 2,12,10,16,0x39}, +{ 2,13, 8, 8,0x41}, +{ 2,12, 9, 8,0x35}, +{ 2,12, 8, 4,0x31} +}; + +void XGINew_SetDRAMSize_340(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); +void XGINew_SetDRAMSize_310(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); +void XGINew_SetMemoryClock(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO ); +void XGINew_SetDRAMModeRegister(PVB_DEVICE_INFO ); +void XGINew_SetDRAMModeRegister340( PXGI_HW_DEVICE_INFO HwDeviceExtension ); +void XGINew_SetDRAMDefaultRegister340(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT, PVB_DEVICE_INFO ); +UCHAR XGINew_Get340DRAMType( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo); +static void DualChipInit(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO pVBInfo); +int XGINew_DDRSizing340( PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO ); +void XGINew_DisableRefresh( PXGI_HW_DEVICE_INFO ,PVB_DEVICE_INFO) ; +void XGINew_CheckBusWidth_310( PVB_DEVICE_INFO) ; +int XGINew_SDRSizing(PVB_DEVICE_INFO); +int XGINew_DDRSizing( PVB_DEVICE_INFO ); +void XGINew_EnableRefresh( PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); +int XGINew_RAMType; /*int ModeIDOffset,StandTable,CRT1Table,ScreenOffset,REFIndex;*/ +static ULONG UNIROM; /* UNIROM */ +void XGINew_Delay15us(ULONG); +static void SetPowerConsume (PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT XGI_P3d4Port); +void XGINew_DDR1x_MRS_XG20( USHORT P3c4 , PVB_DEVICE_INFO pVBInfo); +void XGINew_SetDRAMModeRegister_XG20( PXGI_HW_DEVICE_INFO HwDeviceExtension ); +void XGINew_ChkSenseStatus ( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ) ; + +#ifdef LINUX_KERNEL +void XGIDelayUS(ULONG MicroSeconds) +{ + udelay(MicroSeconds); +} +#endif + +/* --------------------------------------------------------------------- */ +/* Function : XGIInitNew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGIInitNew( PXGI_HW_DEVICE_INFO HwDeviceExtension ) +{ + + VB_DEVICE_INFO VBINF; + PVB_DEVICE_INFO pVBInfo = &VBINF; + /* USHORT Mclockdata[ 30 ] , Eclockdata[ 30 ] ; */ + UCHAR i , temp = 0 , temp1 , + VBIOSVersion[ 5 ] ; + + ULONG base,ChipsetID,VendorID,GraphicVendorID; + PUCHAR volatile pVideoMemory; + + /* ULONG j, k ; */ + + + + + PXGI_DSReg pSR ; + + ULONG Temp ; + + + pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; + pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; + pVBInfo->BaseAddr = ( USHORT )HwDeviceExtension->pjIOAddress ; + pVideoMemory = ( PUCHAR )pVBInfo->ROMAddr; + + + + XGI_Newdebugcode( 0x99 ) ; + + /* if ( pVBInfo->ROMAddr == 0 ) */ + /* return( FALSE ) ; */ + + if ( pVBInfo->FBAddr == 0 ) + return( FALSE ) ; + + if ( pVBInfo->BaseAddr == 0 ) + return( FALSE ) ; + + XGINew_SetReg3( ( USHORT )( pVBInfo->BaseAddr + 0x12 ) , 0x67 ) ; /* 3c2 <- 67 ,ynlai */ + + pVBInfo->ISXPDOS = 0 ; + + + + if ( !HwDeviceExtension->bIntegratedMMEnabled ) + return( FALSE ) ; /* alan */ + + + + XGI_MemoryCopy( VBIOSVersion , HwDeviceExtension->szVBIOSVer , 4 ) ; + + VBIOSVersion[ 4 ] = 0x0 ; + + /* 09/07/99 modify by domao */ + + + pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ; + pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24 ; + pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10 ; + pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e ; + pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12 ; + pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a ; + pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16 ; + pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17 ; + pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18 ; + pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19 ; + pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A ; + pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00 ; + pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04 ; + pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10 ; + pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12 ; + pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 ; + pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2 ; + + if ( HwDeviceExtension->jChipType != XG20 ) /* kuku 2004/06/25 */ + XGI_GetVBType( pVBInfo ) ; /* Run XGI_GetVBType before XGI_InitTo330Pointer */ + + XGI_InitTo330Pointer( HwDeviceExtension->jChipType, pVBInfo ) ; + + /* ReadVBIOSData */ + XGI_ReadVBIOSTablData( HwDeviceExtension->jChipType , pVBInfo) ; + + /* 1.Openkey */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x05 , 0x86 ) ; + + + + /* 2.Reset Extended register */ + + for( i = 0x06 ; i < 0x20 ; i++ ) + XGINew_SetReg1( pVBInfo->P3c4 , i , 0 ) ; + + for( i = 0x21 ; i <= 0x27 ; i++ ) + XGINew_SetReg1( pVBInfo->P3c4 , i , 0 ) ; + + /* for( i = 0x06 ; i <= 0x27 ; i++ ) */ + /* XGINew_SetReg1( pVBInfo->P3c4 , i , 0 ) ; */ + + + if(( HwDeviceExtension->jChipType == XG20 ) || ( HwDeviceExtension->jChipType >= XG40)) + { + for( i = 0x31 ; i <= 0x3B ; i++ ) + XGINew_SetReg1( pVBInfo->P3c4 , i , 0 ) ; + } + else + { + for( i = 0x31 ; i <= 0x3D ; i++ ) + XGINew_SetReg1( pVBInfo->P3c4 , i , 0 ) ; + } + + if ( HwDeviceExtension->jChipType == XG42 ) /* [Hsuan] 2004/08/20 Auto over driver for XG42 */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x3B , 0xC0 ) ; + + /* for( i = 0x30 ; i <= 0x3F ; i++ ) */ + /* XGINew_SetReg1( pVBInfo->P3d4 , i , 0 ) ; */ + + for( i = 0x79 ; i <= 0x7C ; i++ ) + XGINew_SetReg1( pVBInfo->P3d4 , i , 0 ) ; /* shampoo 0208 */ + + + + if ( HwDeviceExtension->jChipType == XG20 ) + XGINew_SetReg1( pVBInfo->P3d4 , 0x97 , *pVBInfo->pXGINew_CR97 ) ; + + /* 3.SetMemoryClock */ + if ( !( *pVBInfo->pSoftSetting & SoftDRAMType ) ) + { + if ( HwDeviceExtension->jChipType == XG20 ) + { + temp = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x97 ) ; + } + else + { + temp = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x3A ) ; + } + } + + + if ( HwDeviceExtension->jChipType == XG20 ) + XGINew_RAMType = temp & 0x01 ; + else + { + XGINew_RAMType = temp & 0x03 ; /* alan */ + } + + /* Get DRAM type */ + if ( HwDeviceExtension->jChipType >= XG40 ) + XGINew_RAMType = ( int )XGINew_Get340DRAMType( HwDeviceExtension , pVBInfo) ; + + if ( UNIROM == 1 ) XGINew_RAMType = 0; + + + if ( HwDeviceExtension->jChipType < XG40 ) + XGINew_SetMemoryClock( HwDeviceExtension , pVBInfo ) ; + + /* 4.SetDefExt1Regs begin */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x07 , *pVBInfo->pSR07 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x11 , 0x0F ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x1F , *pVBInfo->pSR1F ) ; + /* XGINew_SetReg1( pVBInfo->P3c4 , 0x20 , 0x20 ) ; */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x20 , 0xA0 ) ; /* alan, 2001/6/26 Frame buffer can read/write SR20 */ + + + /* SR11 = 0x0F ; */ + /* XGINew_SetReg1( pVBInfo->P3c4 , 0x11 , SR11 ) ; */ + + + if ( HwDeviceExtension->jChipType != XG20 ) /* kuku 2004/06/25 */ + { + /* Set AGP Rate */ + temp1 = XGINew_GetReg1( pVBInfo->P3c4 , 0x3B ) ; + temp1 &= 0x02 ; + if ( temp1 == 0x02 ) + { + XGINew_SetReg4( 0xcf8 , 0x80000000 ) ; + ChipsetID = XGINew_GetReg3( 0x0cfc ) ; + XGINew_SetReg4( 0xcf8 , 0x8000002C ) ; + VendorID = XGINew_GetReg3( 0x0cfc ) ; + VendorID &= 0x0000FFFF ; + XGINew_SetReg4( 0xcf8 , 0x8001002C ) ; + GraphicVendorID = XGINew_GetReg3( 0x0cfc ) ; + GraphicVendorID &= 0x0000FFFF; + + if ( ChipsetID == 0x7301039 ) + XGINew_SetReg1( pVBInfo->P3d4 , 0x5F , 0x09 ) ; + + ChipsetID &= 0x0000FFFF ; + + if ( ( ChipsetID == 0x700E ) || ( ChipsetID == 0x1022 ) || ( ChipsetID == 0x1106 ) || ( ChipsetID == 0x10DE ) ) + { + if ( ChipsetID == 0x1106 ) + { + if ( ( VendorID == 0x1019 ) && ( GraphicVendorID == 0x1019 ) ) + XGINew_SetReg1( pVBInfo->P3d4 , 0x5F , 0x0D ) ; + else + XGINew_SetReg1( pVBInfo->P3d4 , 0x5F , 0x0B ) ; + } + else + XGINew_SetReg1( pVBInfo->P3d4 , 0x5F , 0x0B ) ; + } + } + + if ( HwDeviceExtension->jChipType >= XG40 ) + { + /* Set AGP customize registers (in SetDefAGPRegs) Start */ + for( i = 0x47 ; i <= 0x4C ; i++ ) + XGINew_SetReg1( pVBInfo->P3d4 , i , pVBInfo->AGPReg[ i - 0x47 ] ) ; + + for( i = 0x70 ; i <= 0x71 ; i++ ) + XGINew_SetReg1( pVBInfo->P3d4 , i , pVBInfo->AGPReg[ 6 + i - 0x70 ] ) ; + + for( i = 0x74 ; i <= 0x77 ; i++ ) + XGINew_SetReg1( pVBInfo->P3d4 , i , pVBInfo->AGPReg[ 8 + i - 0x74 ] ) ; + /* Set AGP customize registers (in SetDefAGPRegs) End */ + /*[Hsuan]2004/12/14 AGP Input Delay Adjustment on 850 */ + XGINew_SetReg4( 0xcf8 , 0x80000000 ) ; + ChipsetID = XGINew_GetReg3( 0x0cfc ) ; + if ( ChipsetID == 0x25308086 ) + XGINew_SetReg1( pVBInfo->P3d4 , 0x77 , 0xF0 ) ; + + HwDeviceExtension->pQueryVGAConfigSpace( HwDeviceExtension , 0x50 , 0 , &Temp ) ; /* Get */ + Temp >>= 20 ; + Temp &= 0xF ; + + if ( Temp == 1 ) + XGINew_SetReg1( pVBInfo->P3d4 , 0x48 , 0x20 ) ; /* CR48 */ + } + + if ( HwDeviceExtension->jChipType < XG40 ) + XGINew_SetReg1( pVBInfo->P3d4 , 0x49 , pVBInfo->CR49[ 0 ] ) ; + } /* != XG20 */ + + /* Set PCI */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x23 , *pVBInfo->pSR23 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x24 , *pVBInfo->pSR24 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x25 , pVBInfo->SR25[ 0 ] ) ; + + if ( HwDeviceExtension->jChipType != XG20 ) /* kuku 2004/06/25 */ + { + /* Set VB */ + XGI_UnLockCRT2( HwDeviceExtension, pVBInfo) ; + XGINew_SetRegANDOR( pVBInfo->Part0Port , 0x3F , 0xEF , 0x00 ) ; /* alan, disable VideoCapture */ + XGINew_SetReg1( pVBInfo->Part1Port , 0x00 , 0x00 ) ; + temp1 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x7B ) ; /* chk if BCLK>=100MHz */ + temp = ( UCHAR )( ( temp1 >> 4 ) & 0x0F ) ; + + + XGINew_SetReg1( pVBInfo->Part1Port , 0x02 , ( *pVBInfo->pCRT2Data_1_2 ) ) ; + + + XGINew_SetReg1( pVBInfo->Part1Port , 0x2E , 0x08 ) ; /* use VB */ + } /* != XG20 */ + + + XGINew_SetReg1( pVBInfo->P3c4 , 0x27 , 0x1F ) ; + + if ( ( HwDeviceExtension->jChipType == XG42 ) && XGINew_Get340DRAMType( HwDeviceExtension , pVBInfo) != 0 ) /* Not DDR */ + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x31 , ( *pVBInfo->pSR31 & 0x3F ) | 0x40 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x32 , ( *pVBInfo->pSR32 & 0xFC ) | 0x01 ) ; + } + else + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x31 , *pVBInfo->pSR31 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x32 , *pVBInfo->pSR32 ) ; + } + XGINew_SetReg1( pVBInfo->P3c4 , 0x33 , *pVBInfo->pSR33 ) ; + + + + if ( HwDeviceExtension->jChipType >= XG40 ) + SetPowerConsume ( HwDeviceExtension , pVBInfo->P3c4); + + if ( HwDeviceExtension->jChipType != XG20 ) /* kuku 2004/06/25 */ + { + if ( XGI_BridgeIsOn( pVBInfo ) == 1 ) + { + if ( pVBInfo->IF_DEF_LVDS == 0 ) + { + XGINew_SetReg1( pVBInfo->Part2Port , 0x00 , 0x1C ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x0D , *pVBInfo->pCRT2Data_4_D ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x0E , *pVBInfo->pCRT2Data_4_E ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x10 , *pVBInfo->pCRT2Data_4_10 ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x0F , 0x3F ) ; + } + + XGI_LockCRT2( HwDeviceExtension, pVBInfo ) ; + } + } /* != XG20 */ + + if ( HwDeviceExtension->jChipType < XG40 ) + XGINew_SetReg1( pVBInfo->P3d4 , 0x83 , 0x00 ) ; + + + + if ( HwDeviceExtension->jChipType >= XG40 ) + { + XGINew_SetDRAMDefaultRegister340( HwDeviceExtension , pVBInfo->P3d4, pVBInfo ) ; + if ( HwDeviceExtension->bSkipDramSizing == TRUE ) + { + pSR = HwDeviceExtension->pSR ; + if ( pSR!=NULL ) + { + while( pSR->jIdx != 0xFF ) + { + XGINew_SetReg1( pVBInfo->P3c4 , pSR->jIdx , pSR->jVal ) ; + pSR++ ; + } + } + /* XGINew_SetDRAMModeRegister340( pVBInfo ) ; */ + } /* SkipDramSizing */ + else + { +/* if ( HwDeviceExtension->jChipType == XG20 ) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , pVBInfo->SR15[0][XGINew_RAMType] ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , pVBInfo->SR15[1][XGINew_RAMType] ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x20 , 0x20 ) ; + } + else*/ + XGINew_SetDRAMSize_340( HwDeviceExtension , pVBInfo) ; + } + } /* XG40 */ + + + + + /* SetDefExt2Regs begin */ +/* + AGP = 1 ; + temp =( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x3A ) ; + temp &= 0x30 ; + if ( temp == 0x30 ) + AGP = 0 ; + + if ( AGP == 0 ) + *pVBInfo->pSR21 &= 0xEF ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x21 , *pVBInfo->pSR21 ) ; + if ( AGP == 1 ) + *pVBInfo->pSR22 &= 0x20 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x22 , *pVBInfo->pSR22 ) ; +*/ + + base = 0x80000000 ; + OutPortLong( 0xcf8 , base ) ; + Temp = ( InPortLong( 0xcfc ) & 0xFFFF ) ; + if ( Temp == 0x1039 ) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x22 , ( UCHAR )( ( *pVBInfo->pSR22 ) & 0xFE ) ) ; + } + else + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x22 , *pVBInfo->pSR22 ) ; + } + + XGINew_SetReg1( pVBInfo->P3c4 , 0x21 , *pVBInfo->pSR21 ) ; + + if ( HwDeviceExtension->jChipType == XG40 ) /* Initialize seconary chip */ + { + if ( XGI_CheckDualChip(pVBInfo) ) + DualChipInit( HwDeviceExtension , pVBInfo) ; + /* SetDefExt2Regs end */ + } + + if ( HwDeviceExtension->bSkipSense == FALSE ) + { + XGI_SenseCRT1(pVBInfo) ; + /* XGINew_DetectMonitor( HwDeviceExtension ) ; */ + XGI_GetSenseStatus( HwDeviceExtension , pVBInfo ) ; /* sense CRT2 */ + } + + XGINew_ChkSenseStatus ( HwDeviceExtension , pVBInfo ) ; + XGINew_SetModeScratch ( HwDeviceExtension , pVBInfo ) ; + + XGI_Newdebugcode( 0x88 ) ; + + /* Johnson@062403. To save time for power management. */ + /* DelayMS(1000); */ + /* ~Johnson@062403. */ + /* XGINew_SetReg1( pVBInfo->P3d4 , 0x32 , 0x28 ) ; //0207 temp */ + /* XGINew_SetReg1( pVBInfo->P3d4 , 0x36 , 0x02 ) ; //0207 temp */ + + return( TRUE ) ; +} /* end of init */ + + + +/* --------------------------------------------------------------------- */ +/* Function : DualChipInit */ +/* Input : */ +/* Output : */ +/* Description : Initialize the secondary chip. */ +/* --------------------------------------------------------------------- */ +static void DualChipInit( PXGI_HW_DEVICE_INFO HwDeviceExtension ,PVB_DEVICE_INFO pVBInfo) +{ + USHORT BaseAddr2nd = (USHORT)HwDeviceExtension->pj2ndIOAddress ; + USHORT XGINew_P3C3 = pVBInfo->BaseAddr + VIDEO_SUBSYSTEM_ENABLE_PORT ; + USHORT XGINew_P3CC = pVBInfo->BaseAddr + MISC_OUTPUT_REG_READ_PORT ; + USHORT XGINew_2ndP3C3 = BaseAddr2nd + VIDEO_SUBSYSTEM_ENABLE_PORT ; + USHORT XGINew_2ndP3D4 = BaseAddr2nd + CRTC_ADDRESS_PORT_COLOR ; + USHORT XGINew_2ndP3C4 = BaseAddr2nd + SEQ_ADDRESS_PORT ; + USHORT XGINew_2ndP3C2 = BaseAddr2nd + MISC_OUTPUT_REG_WRITE_PORT ; + ULONG Temp ; + UCHAR tempal , i ; + + pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; + pVBInfo->BaseAddr = (USHORT)HwDeviceExtension->pjIOAddress ; + /* Programming Congiguration Space in Secondary Chip */ + /* set CRA1 D[6] = 1 */ + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0xA1 , 0xBF , 0x40 ) ; + + /* Write 2nd Chip Configuration Info into Configuration Space */ + /* Command CNFG04 */ + HwDeviceExtension->pQueryVGAConfigSpace( HwDeviceExtension , PCI_COMMAND , 0 , &Temp ) ; /* Get */ + HwDeviceExtension->pQueryVGAConfigSpace( HwDeviceExtension , PCI_COMMAND + 0x80 , 1 , &Temp ) ; /* Set */ + /* Latency Timer CNFG0C */ + HwDeviceExtension->pQueryVGAConfigSpace( HwDeviceExtension , 0x0c , 0 , &Temp ) ; /* Get */ + HwDeviceExtension->pQueryVGAConfigSpace( HwDeviceExtension , 0x0c + 0x80 , 1 , &Temp ) ; /* Set */ + /* Linear space */ + HwDeviceExtension->pQueryVGAConfigSpace( HwDeviceExtension , 0x10 , 0 , &Temp ) ; /* Get */ + HwDeviceExtension->pQueryVGAConfigSpace( HwDeviceExtension , 0x10 + 0x80 , 1 , &Temp ) ; /* Set */ + /* MMIO space */ + HwDeviceExtension->pQueryVGAConfigSpace( HwDeviceExtension , 0x14 , 0 , &Temp ) ; /* Get */ + Temp += 0x40000; + HwDeviceExtension->pQueryVGAConfigSpace( HwDeviceExtension , 0x14 + 0x80 , 1 , &Temp ) ; /* Set */ + /* Relocated IO space */ + HwDeviceExtension->pQueryVGAConfigSpace( HwDeviceExtension , 0x18 , 0 , &Temp ) ; /* Get */ + Temp += 0x80; + HwDeviceExtension->pQueryVGAConfigSpace( HwDeviceExtension , 0x18 + 0x80 , 1 , &Temp ) ; /* Set */ + /* Miscellaneous reg(input port 3cch,output port 3c2h) */ + tempal = ( UCHAR )XGINew_GetReg2( XGINew_P3CC ) ; /* 3cc */ + XGINew_SetReg3( XGINew_2ndP3C2 , tempal ) ; + /* VGA enable reg(port 3C3h) */ + tempal = ( UCHAR )XGINew_GetReg2( XGINew_P3C3 ) ; /* 3c3 */ + XGINew_SetReg3( XGINew_2ndP3C3 , tempal ) ; + SetPowerConsume ( HwDeviceExtension , XGINew_2ndP3D4); + /* ----- CRA0=42, CRA1=81, CRA2=60, CRA3=20, CRA4=50, CRA5=40, CRA8=88 -----// */ + /* ----- CRA9=10, CRAA=80, CRAB=01, CRAC=F1, CRAE=80, CRAF=45, CRB7=24 -----// */ + /* primary chip */ + XGINew_SetReg1( pVBInfo->P3d4 , 0xA0 , 0x72 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0xA1 , 0x81 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0xA2 , 0x60 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0xA3 , 0x20 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0xA4 , 0x50 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0xA5 , 0x40 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0xA8 , 0x88 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0xA9 , 0x10 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0xAA , 0x80 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0xAB , 0x01 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0xAC , 0xF1 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0xAE , 0x80 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0xAF , 0x45 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0xB7 , 0x24 ) ; + + /* secondary chip */ + XGINew_SetReg1( XGINew_2ndP3D4 , 0xA0 , 0x72 ) ; + XGINew_SetReg1( XGINew_2ndP3D4 , 0xA1 , 0x81 ) ; + XGINew_SetReg1( XGINew_2ndP3D4 , 0xA2 , 0x60 ) ; + XGINew_SetReg1( XGINew_2ndP3D4 , 0xA3 , 0x20 ) ; + XGINew_SetReg1( XGINew_2ndP3D4 , 0xA4 , 0x50 ) ; + XGINew_SetReg1( XGINew_2ndP3D4 , 0xA5 , 0x40 ) ; + XGINew_SetReg1( XGINew_2ndP3D4 , 0xA8 , 0x88 ) ; + XGINew_SetReg1( XGINew_2ndP3D4 , 0xA9 , 0x10 ) ; + XGINew_SetReg1( XGINew_2ndP3D4 , 0xAA , 0x80 ) ; + XGINew_SetReg1( XGINew_2ndP3D4 , 0xAB , 0x01 ) ; + XGINew_SetReg1( XGINew_2ndP3D4 , 0xAC , 0xF1 ) ; + XGINew_SetReg1( XGINew_2ndP3D4 , 0xAE , 0x80 ) ; + XGINew_SetReg1( XGINew_2ndP3D4 , 0xAF , 0x45 ) ; + XGINew_SetReg1( XGINew_2ndP3D4 , 0xB7 , 0x24 ) ; + + /* 06/20/2003 [christine] CRT threshold setting request */ + XGINew_SetReg1( pVBInfo->P3d4 , 0x78 , 0x40 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x79 , 0x0C ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x7A , 0x34 ) ; + + /* OpenKey in 2nd chip */ + XGINew_SetReg1( XGINew_2ndP3C4 , 0x05 , 0x86 ) ; + + /* Set PCI registers */ + tempal = (UCHAR)XGINew_GetReg1( pVBInfo->P3c4 , 0x06 ) ; + XGINew_SetReg1( XGINew_2ndP3C4 , 0x06 , tempal ) ; + + for( i = 0x20 ; i <= 0x25 ; i++ ) + { + tempal = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , i ) ; + XGINew_SetReg1( XGINew_2ndP3C4 , i , tempal ) ; + } + for(i = 0x31; i <= 0x32; i++ ) + { + tempal = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , i ) ; + XGINew_SetReg1( XGINew_2ndP3C4 , i , tempal ) ; + } + XGINew_SetDRAMDefaultRegister340( HwDeviceExtension , XGINew_2ndP3D4 , pVBInfo) ; + + for(i = 0x13; i <= 0x14; i++ ) + { + tempal = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , i ) ; + XGINew_SetReg1( XGINew_2ndP3C4 , i , tempal ) ; + } + + /* Close key in 2nd chip */ + XGINew_SetReg1( XGINew_2ndP3C4 , 0x05 , 0x00 ) ; +} + + + + +/* ============== alan ====================== */ + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_Get340DRAMType */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +UCHAR XGINew_Get340DRAMType( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +{ + UCHAR data ; + + if ( HwDeviceExtension->jChipType != XG20 ) + { + if ( *pVBInfo->pSoftSetting & SoftDRAMType ) + { + data = *pVBInfo->pSoftSetting & 0x07 ; + return( data ) ; + } + else + { + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x39 ) & 0x02 ; + + if ( data == 0 ) + data = ( XGINew_GetReg1( pVBInfo->P3c4 , 0x3A ) & 0x02 ) >> 1 ; + + return( data ) ; + } + } + else + { + data = XGINew_GetReg1( pVBInfo->P3d4 , 0x97 ) & 0x01 ; + + if ( data == 1 ) + data ++ ; + + return( data ); + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_Get310DRAMType */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static UCHAR XGINew_Get310DRAMType(PVB_DEVICE_INFO pVBInfo) +{ + UCHAR data ; + + /* index = XGINew_GetReg1( pVBInfo->P3c4 , 0x1A ) ; */ + /* index &= 07 ; */ + + if ( *pVBInfo->pSoftSetting & SoftDRAMType ) + data = *pVBInfo->pSoftSetting & 0x03 ; + else + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x3a ) & 0x03 ; + + return( data ) ; +} + + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_Delay15us */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +/* +void XGINew_Delay15us(ULONG ulMicrsoSec) +{ +} +*/ + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SDR_MRS */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGINew_SDR_MRS( PVB_DEVICE_INFO pVBInfo ) +{ + USHORT data ; + + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x16 ) ; + data &= 0x3F ; /* SR16 D7=0,D6=0 */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x16 , data ) ; /* enable mode register set(MRS) low */ + /* XGINew_Delay15us( 0x100 ) ; */ + data |= 0x80 ; /* SR16 D7=1,D6=0 */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x16 , data ) ; /* enable mode register set(MRS) high */ + /* XGINew_Delay15us( 0x100 ) ; */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DDR1x_MRS_340 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGINew_DDR1x_MRS_340( USHORT P3c4 , PVB_DEVICE_INFO pVBInfo) +{ + XGINew_SetReg1( P3c4 , 0x18 , 0x01 ) ; + XGINew_SetReg1( P3c4 , 0x19 , 0x20 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x80 ) ; + + if ( *pVBInfo->pXGINew_DRAMTypeDefinition != 0x0C ) /* Samsung F Die */ + { + XGIDelayUS( 3000 ) ; /* Delay 67 x 3 Delay15us */ + XGINew_SetReg1( P3c4 , 0x18 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x19 , 0x20 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x80 ) ; + } + + XGIDelayUS( 60 ) ; + XGINew_SetReg1( P3c4 , 0x18 , pVBInfo->SR15[ 2 ][ XGINew_RAMType ] ) ; /* SR18 */ + XGINew_SetReg1( P3c4 , 0x19 , 0x01 ) ; + XGINew_SetReg1( P3c4 , 0x16 , pVBInfo->SR16[ 0 ] ) ; + XGINew_SetReg1( P3c4 , 0x16 , pVBInfo->SR16[ 1 ] ) ; + XGIDelayUS( 1000 ) ; + XGINew_SetReg1( P3c4 , 0x1B , 0x03 ) ; + XGIDelayUS( 500 ) ; + XGINew_SetReg1( P3c4 , 0x18 , pVBInfo->SR15[ 2 ][ XGINew_RAMType ] ) ; /* SR18 */ + XGINew_SetReg1( P3c4 , 0x19 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x16 , pVBInfo->SR16[ 2 ] ) ; + XGINew_SetReg1( P3c4 , 0x16 , pVBInfo->SR16[ 3 ] ) ; + XGINew_SetReg1( P3c4 , 0x1B , 0x00 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DDR2x_MRS_340 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGINew_DDR2x_MRS_340( USHORT P3c4 , PVB_DEVICE_INFO pVBInfo) +{ + XGINew_SetReg1( P3c4 , 0x18 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x19 , 0x20 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x80 ) ; + XGIDelayUS( 60 ) ; + XGINew_SetReg1( P3c4 , 0x18 , pVBInfo->SR15[ 2 ][ XGINew_RAMType ] ) ; /* SR18 */ + /* XGINew_SetReg1( P3c4 , 0x18 , 0x31 ) ; */ + XGINew_SetReg1( P3c4 , 0x19 , 0x01 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x05 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x85 ) ; + XGIDelayUS( 1000 ) ; + XGINew_SetReg1( P3c4 , 0x1B , 0x03 ) ; + XGIDelayUS( 500 ) ; + /* XGINew_SetReg1( P3c4 , 0x18 , 0x31 ) ; */ + XGINew_SetReg1( P3c4 , 0x18 , pVBInfo->SR15[ 2 ][ XGINew_RAMType ] ) ; /* SR18 */ + XGINew_SetReg1( P3c4 , 0x19 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x05 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x85 ) ; + XGINew_SetReg1( P3c4 , 0x1B , 0x00 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DDR2_MRS_340 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGINew_DDR2_MRS_340( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT P3c4 , PVB_DEVICE_INFO pVBInfo) +{ + USHORT P3d4 = P3c4 + 0x10 ; + UCHAR data ; + + XGINew_SetReg1( P3c4 , 0x28 , 0x64 ) ; /* SR28 */ + XGINew_SetReg1( P3c4 , 0x29 , 0x63 ) ; /* SR29 */ + XGIDelayUS( 200 ) ; + XGINew_SetReg1( P3c4 , 0x18 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x19 , 0x20 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x80 ) ; + XGINew_SetReg1( P3c4 , 0x18 , 0xC5 ) ; + XGINew_SetReg1( P3c4 , 0x19 , 0x23 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x80 ) ; + XGIDelayUS( 2 ) ; + XGINew_SetReg1( P3d4 , 0x97 , 0x11 ) ; /* CR97 */ + + if( P3c4 != pVBInfo->P3c4 ) + { + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x28 ) ; + XGINew_SetReg1( P3c4 , 0x28 , data ) ; /* SR28 */ + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x29 ) ; + XGINew_SetReg1( P3c4 , 0x29 , data ) ; /* SR29 */ + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x2A ) ; + XGINew_SetReg1( P3c4 , 0x2A , data ) ; /* SR2A */ + + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x2E ) ; + XGINew_SetReg1( P3c4 , 0x2e , data ) ; /* SR2E */ + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x2F ) ; + XGINew_SetReg1( P3c4 , 0x2f , data ) ; /* SR2F */ + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x30 ) ; + XGINew_SetReg1( P3c4 , 0x30 , data ) ; /* SR30 */ + } + else + XGINew_SetMemoryClock( HwDeviceExtension , pVBInfo ) ; + + XGIDelayUS( 1000 ) ; + XGINew_SetReg1( P3c4 , 0x18 , 0xC5 ) ; + XGINew_SetReg1( P3c4 , 0x19 , 0x23 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x80 ) ; + XGIDelayUS( 1 ) ; + XGINew_SetReg1( P3c4 , 0x1B , 0x04 ) ; /* SR1B */ + XGIDelayUS( 5) ; + XGINew_SetReg1( P3c4 , 0x1B , 0x00 ) ; /* SR1B */ + XGIDelayUS( 5 ) ; + /* XGINew_SetReg1( P3c4 , 0x18 , 0x72 ) ; */ + XGINew_SetReg1( P3c4 , 0x18 , pVBInfo->SR15[ 2 ][ XGINew_RAMType ] ) ; /* SR18 */ + XGINew_SetReg1( P3c4 , 0x19 , 0x06 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x05 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x85 ) ; + XGIDelayUS( 1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DDR1x_DefaultRegister */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGINew_DDR1x_DefaultRegister( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT Port , PVB_DEVICE_INFO pVBInfo) +{ + USHORT P3d4 = Port , + P3c4 = Port - 0x10 ; + +/* UCHAR data ; */ + + if ( HwDeviceExtension->jChipType == XG20 ) + { + XGINew_SetMemoryClock( HwDeviceExtension , pVBInfo ) ; + XGINew_SetReg1( P3d4 , 0x82 , pVBInfo->CR40[ 11 ][ XGINew_RAMType ] ) ; /* CR82 */ + XGINew_SetReg1( P3d4 , 0x85 , pVBInfo->CR40[ 12 ][ XGINew_RAMType ] ) ; /* CR85 */ + XGINew_SetReg1( P3d4 , 0x86 , pVBInfo->CR40[ 13 ][ XGINew_RAMType ] ) ; /* CR86 */ + + XGINew_SetReg1( P3d4 , 0x98 , 0x01 ) ; + XGINew_SetReg1( P3d4 , 0x9A , 0x02 ) ; + + XGINew_DDR1x_MRS_XG20( P3c4 , pVBInfo) ; + } + else + { + XGINew_SetMemoryClock( HwDeviceExtension , pVBInfo ) ; + + switch( HwDeviceExtension->jChipType ) + { + case XG41: + case XG42: + XGINew_SetReg1( P3d4 , 0x82 , pVBInfo->CR40[ 11 ][ XGINew_RAMType ] ) ; /* CR82 */ + XGINew_SetReg1( P3d4 , 0x85 , pVBInfo->CR40[ 12 ][ XGINew_RAMType ] ) ; /* CR85 */ + XGINew_SetReg1( P3d4 , 0x86 , pVBInfo->CR40[ 13 ][ XGINew_RAMType ] ) ; /* CR86 */ + break ; + default: + XGINew_SetReg1( P3d4 , 0x82 , 0x88 ) ; + XGINew_SetReg1( P3d4 , 0x86 , 0x00 ) ; + XGINew_GetReg1( P3d4 , 0x86 ) ; /* Insert read command for delay */ + XGINew_SetReg1( P3d4 , 0x86 , 0x88 ) ; + XGINew_GetReg1( P3d4 , 0x86 ) ; + XGINew_SetReg1( P3d4 , 0x86 , pVBInfo->CR40[ 13 ][ XGINew_RAMType ] ) ; + XGINew_SetReg1( P3d4 , 0x82 , 0x77 ) ; + XGINew_SetReg1( P3d4 , 0x85 , 0x00 ) ; + XGINew_GetReg1( P3d4 , 0x85 ) ; /* Insert read command for delay */ + XGINew_SetReg1( P3d4 , 0x85 , 0x88 ) ; + XGINew_GetReg1( P3d4 , 0x85 ) ; /* Insert read command for delay */ + XGINew_SetReg1( P3d4 , 0x85 , pVBInfo->CR40[ 12 ][ XGINew_RAMType ] ) ; /* CR85 */ + XGINew_SetReg1( P3d4 , 0x82 , pVBInfo->CR40[ 11 ][ XGINew_RAMType ] ) ; /* CR82 */ + break ; + } + + XGINew_SetReg1( P3d4 , 0x97 , 0x00 ) ; + XGINew_SetReg1( P3d4 , 0x98 , 0x01 ) ; + XGINew_SetReg1( P3d4 , 0x9A , 0x02 ) ; + XGINew_DDR1x_MRS_340( P3c4 , pVBInfo ) ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DDR2x_DefaultRegister */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGINew_DDR2x_DefaultRegister( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT Port ,PVB_DEVICE_INFO pVBInfo) +{ + USHORT P3d4 = Port , + P3c4 = Port - 0x10 ; + +/* UCHAR data ; */ + + XGINew_SetMemoryClock( HwDeviceExtension , pVBInfo ) ; + + /* 20040906 Hsuan modify CR82, CR85, CR86 for XG42 */ + switch( HwDeviceExtension->jChipType ) + { + case XG41: + case XG42: + XGINew_SetReg1( P3d4 , 0x82 , pVBInfo->CR40[ 11 ][ XGINew_RAMType ] ) ; /* CR82 */ + XGINew_SetReg1( P3d4 , 0x85 , pVBInfo->CR40[ 12 ][ XGINew_RAMType ] ) ; /* CR85 */ + XGINew_SetReg1( P3d4 , 0x86 , pVBInfo->CR40[ 13 ][ XGINew_RAMType ] ) ; /* CR86 */ + break ; + default: + /* keep following setting sequence, each setting in the same reg insert idle */ + XGINew_SetReg1( P3d4 , 0x82 , 0x88 ) ; + XGINew_SetReg1( P3d4 , 0x86 , 0x00 ) ; + XGINew_GetReg1( P3d4 , 0x86 ) ; /* Insert read command for delay */ + XGINew_SetReg1( P3d4 , 0x86 , 0x88 ) ; + XGINew_SetReg1( P3d4 , 0x82 , 0x77 ) ; + XGINew_SetReg1( P3d4 , 0x85 , 0x00 ) ; + XGINew_GetReg1( P3d4 , 0x85 ) ; /* Insert read command for delay */ + XGINew_SetReg1( P3d4 , 0x85 , 0x88 ) ; + XGINew_GetReg1( P3d4 , 0x85 ) ; /* Insert read command for delay */ + XGINew_SetReg1( P3d4 , 0x85 , pVBInfo->CR40[ 12 ][ XGINew_RAMType ] ) ; /* CR85 */ + XGINew_SetReg1( P3d4 , 0x82 , pVBInfo->CR40[ 11 ][ XGINew_RAMType ] ) ; /* CR82 */ + } + XGINew_SetReg1( P3d4 , 0x97 , 0x11 ) ; + if ( HwDeviceExtension->jChipType == XG42 ) + { + XGINew_SetReg1( P3d4 , 0x98 , 0x01 ) ; + } + else + { + XGINew_SetReg1( P3d4 , 0x98 , 0x03 ) ; + } + XGINew_SetReg1( P3d4 , 0x9A , 0x02 ) ; + + XGINew_DDR2x_MRS_340( P3c4 , pVBInfo ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DDR2_DefaultRegister */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGINew_DDR2_DefaultRegister( PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT Port , PVB_DEVICE_INFO pVBInfo) +{ + USHORT P3d4 = Port , + P3c4 = Port - 0x10 ; + + /* keep following setting sequence, each setting in the same reg insert idle */ + XGINew_SetReg1( P3d4 , 0x82 , 0x77 ) ; + XGINew_SetReg1( P3d4 , 0x86 , 0x00 ) ; + XGINew_GetReg1( P3d4 , 0x86 ) ; /* Insert read command for delay */ + XGINew_SetReg1( P3d4 , 0x86 , 0x88 ) ; + XGINew_GetReg1( P3d4 , 0x86 ) ; /* Insert read command for delay */ + XGINew_SetReg1( P3d4 , 0x86 , pVBInfo->CR40[ 13 ][ XGINew_RAMType ] ) ; /* CR86 */ + XGINew_SetReg1( P3d4 , 0x82 , 0x77 ) ; + XGINew_SetReg1( P3d4 , 0x85 , 0x00 ) ; + XGINew_GetReg1( P3d4 , 0x85 ) ; /* Insert read command for delay */ + XGINew_SetReg1( P3d4 , 0x85 , 0x88 ) ; + XGINew_GetReg1( P3d4 , 0x85 ) ; /* Insert read command for delay */ + XGINew_SetReg1( P3d4 , 0x85 , pVBInfo->CR40[ 12 ][ XGINew_RAMType ] ) ; /* CR85 */ + XGINew_SetReg1( P3d4 , 0x82 , pVBInfo->CR40[ 11 ][ XGINew_RAMType ] ) ; /* CR82 */ + + XGINew_SetReg1( P3d4 , 0x98 , 0x03 ) ; + XGINew_SetReg1( P3d4 , 0x9A , 0x02 ) ; + XGINew_DDR2_MRS_340( HwDeviceExtension , P3c4, pVBInfo ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SetDRAMDefaultRegister340 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_SetDRAMDefaultRegister340( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT Port , PVB_DEVICE_INFO pVBInfo) +{ + UCHAR temp , temp1 , temp2 , temp3 , + i , j , k ; + + USHORT P3d4 = Port , + P3c4 = Port - 0x10 ; + + XGINew_SetReg1( P3d4 , 0x6D , pVBInfo->CR40[ 8 ][ XGINew_RAMType ] ) ; + XGINew_SetReg1( P3d4 , 0x68 , pVBInfo->CR40[ 5 ][ XGINew_RAMType ] ) ; + XGINew_SetReg1( P3d4 , 0x69 , pVBInfo->CR40[ 6 ][ XGINew_RAMType ] ) ; + XGINew_SetReg1( P3d4 , 0x6A , pVBInfo->CR40[ 7 ][ XGINew_RAMType ] ) ; + + temp2 = 0 ; + for( i = 0 ; i < 4 ; i++ ) + { + temp = pVBInfo->CR6B[ XGINew_RAMType ][ i ] ; /* CR6B DQS fine tune delay */ + for( j = 0 ; j < 4 ; j++ ) + { + temp1 = ( ( temp >> ( 2 * j ) ) & 0x03 ) << 2 ; + temp2 |= temp1 ; + XGINew_SetReg1( P3d4 , 0x6B , temp2 ) ; + XGINew_GetReg1( P3d4 , 0x6B ) ; /* Insert read command for delay */ + temp2 &= 0xF0 ; + temp2 += 0x10 ; + } + } + + temp2 = 0 ; + for( i = 0 ; i < 4 ; i++ ) + { + temp = pVBInfo->CR6E[ XGINew_RAMType ][ i ] ; /* CR6E DQM fine tune delay */ + for( j = 0 ; j < 4 ; j++ ) + { + temp1 = ( ( temp >> ( 2 * j ) ) & 0x03 ) << 2 ; + temp2 |= temp1 ; + XGINew_SetReg1( P3d4 , 0x6E , temp2 ) ; + XGINew_GetReg1( P3d4 , 0x6E ) ; /* Insert read command for delay */ + temp2 &= 0xF0 ; + temp2 += 0x10 ; + } + } + + temp3 = 0 ; + for( k = 0 ; k < 4 ; k++ ) + { + XGINew_SetRegANDOR( P3d4 , 0x6E , 0xFC , temp3 ) ; /* CR6E_D[1:0] select channel */ + temp2 = 0 ; + for( i = 0 ; i < 8 ; i++ ) + { + temp = pVBInfo->CR6F[ XGINew_RAMType ][ 8 * k + i ] ; /* CR6F DQ fine tune delay */ + for( j = 0 ; j < 4 ; j++ ) + { + temp1 = ( temp >> ( 2 * j ) ) & 0x03 ; + temp2 |= temp1 ; + XGINew_SetReg1( P3d4 , 0x6F , temp2 ) ; + XGINew_GetReg1( P3d4 , 0x6F ) ; /* Insert read command for delay */ + temp2 &= 0xF8 ; + temp2 += 0x08 ; + } + } + temp3 += 0x01 ; + } + + XGINew_SetReg1( P3d4 , 0x80 , pVBInfo->CR40[ 9 ][ XGINew_RAMType ] ) ; /* CR80 */ + XGINew_SetReg1( P3d4 , 0x81 , pVBInfo->CR40[ 10 ][ XGINew_RAMType ] ) ; /* CR81 */ + + temp2 = 0x80 ; + temp = pVBInfo->CR89[ XGINew_RAMType ][ 0 ] ; /* CR89 terminator type select */ + for( j = 0 ; j < 4 ; j++ ) + { + temp1 = ( temp >> ( 2 * j ) ) & 0x03 ; + temp2 |= temp1 ; + XGINew_SetReg1( P3d4 , 0x89 , temp2 ) ; + XGINew_GetReg1( P3d4 , 0x89 ) ; /* Insert read command for delay */ + temp2 &= 0xF0 ; + temp2 += 0x10 ; + } + + temp = pVBInfo->CR89[ XGINew_RAMType ][ 1 ] ; + temp1 = temp & 0x03 ; + temp2 |= temp1 ; + XGINew_SetReg1( P3d4 , 0x89 , temp2 ) ; + + temp = pVBInfo->CR40[ 3 ][ XGINew_RAMType ] ; + temp1 = temp & 0x0F ; + temp2 = ( temp >> 4 ) & 0x07 ; + temp3 = temp & 0x80 ; + XGINew_SetReg1( P3d4 , 0x45 , temp1 ) ; /* CR45 */ + XGINew_SetReg1( P3d4 , 0x99 , temp2 ) ; /* CR99 */ + XGINew_SetRegOR( P3d4 , 0x40 , temp3 ) ; /* CR40_D[7] */ + XGINew_SetReg1( P3d4 , 0x41 , pVBInfo->CR40[ 0 ][ XGINew_RAMType ] ) ; /* CR41 */ + + for( j = 0 ; j <= 6 ; j++ ) + XGINew_SetReg1( P3d4 , ( 0x90 + j ) , pVBInfo->CR40[ 14 + j ][ XGINew_RAMType ] ) ; /* CR90 - CR96 */ + + for( j = 0 ; j <= 2 ; j++ ) + XGINew_SetReg1( P3d4 , ( 0xC3 + j ) , pVBInfo->CR40[ 21 + j ][ XGINew_RAMType ] ) ; /* CRC3 - CRC5 */ + + for( j = 0 ; j < 2 ; j++ ) + XGINew_SetReg1( P3d4 , ( 0x8A + j ) , pVBInfo->CR40[ 1 + j ][ XGINew_RAMType ] ) ; /* CR8A - CR8B */ + + if ( ( HwDeviceExtension->jChipType == XG41 ) || ( HwDeviceExtension->jChipType == XG42 ) ) + XGINew_SetReg1( P3d4 , 0x8C , 0x87 ) ; + + XGINew_SetReg1( P3d4 , 0x59 , pVBInfo->CR40[ 4 ][ XGINew_RAMType ] ) ; /* CR59 */ + + XGINew_SetReg1( P3d4 , 0x83 , 0x09 ) ; /* CR83 */ + XGINew_SetReg1( P3d4 , 0x87 , 0x00 ) ; /* CR87 */ + XGINew_SetReg1( P3d4 , 0xCF , *pVBInfo->pCRCF ) ; /* CRCF */ + XGINew_SetReg1( P3c4 , 0x1A , 0x87 ) ; /* SR1A */ + + temp = XGINew_Get340DRAMType( HwDeviceExtension, pVBInfo) ; + if( temp == 0 ) + XGINew_DDR1x_DefaultRegister( HwDeviceExtension, P3d4, pVBInfo ) ; + else if ( temp == 0x02 ) + XGINew_DDR2x_DefaultRegister( HwDeviceExtension, P3d4, pVBInfo ) ; + else + XGINew_DDR2_DefaultRegister( HwDeviceExtension, P3d4, pVBInfo ) ; + + XGINew_SetReg1( P3c4 , 0x1B , pVBInfo->SR15[ 3 ][ XGINew_RAMType ] ) ; /* SR1B */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DDR_MRS */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGINew_DDR_MRS(PVB_DEVICE_INFO pVBInfo) +{ + USHORT data ; + + PUCHAR volatile pVideoMemory = ( PUCHAR )pVBInfo->ROMAddr ; + + /* SR16 <- 1F,DF,2F,AF */ + /* yriver modified SR16 <- 0F,DF,0F,AF */ + /* enable DLL of DDR SD/SGRAM , SR16 D4=1 */ + data = pVideoMemory[ 0xFB ] ; + /* data = XGINew_GetReg1( pVBInfo->P3c4 , 0x16 ) ; */ + + data &= 0x0F ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x16 , data ) ; + data |= 0xC0 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x16 , data ) ; + data &= 0x0F ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x16 , data ) ; + data |= 0x80 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x16 , data ) ; + data &= 0x0F ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x16 , data ) ; + data |= 0xD0 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x16 , data ) ; + data &= 0x0F ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x16 , data ) ; + data |= 0xA0 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x16 , data ) ; +/* + else { + data &= 0x0F; + data |= 0x10; + XGINew_SetReg1(pVBInfo->P3c4,0x16,data); + + if (!(pVBInfo->SR15[1][XGINew_RAMType] & 0x10)) + { + data &= 0x0F; + } + + data |= 0xC0; + XGINew_SetReg1(pVBInfo->P3c4,0x16,data); + + + data &= 0x0F; + data |= 0x20; + XGINew_SetReg1(pVBInfo->P3c4,0x16,data); + if (!(pVBInfo->SR15[1][XGINew_RAMType] & 0x10)) + { + data &= 0x0F; + } + + data |= 0x80; + XGINew_SetReg1(pVBInfo->P3c4,0x16,data); + } +*/ +} + + +/* check if read cache pointer is correct */ + + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_VerifyMclk */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGINew_VerifyMclk( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +{ + PUCHAR pVideoMemory = pVBInfo->FBAddr ; + UCHAR i , j ; + USHORT Temp , SR21 ; + + pVideoMemory[ 0 ] = 0xaa ; /* alan */ + pVideoMemory[ 16 ] = 0x55 ; /* note: PCI read cache is off */ + + if ( ( pVideoMemory[ 0 ] != 0xaa ) || ( pVideoMemory[ 16 ] != 0x55 ) ) + { + for( i = 0 , j = 16 ; i < 2 ; i++ , j += 16 ) + { + SR21 = XGINew_GetReg1( pVBInfo->P3c4 , 0x21 ) ; + Temp = SR21 & 0xFB ; /* disable PCI post write buffer empty gating */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x21 , Temp ) ; + + Temp = XGINew_GetReg1( pVBInfo->P3c4 , 0x3C ) ; + Temp |= 0x01 ; /* MCLK reset */ + + + Temp = XGINew_GetReg1( pVBInfo->P3c4 , 0x3C ) ; + Temp &= 0xFE ; /* MCLK normal operation */ + + XGINew_SetReg1( pVBInfo->P3c4 , 0x21 , SR21 ) ; + + pVideoMemory[ 16 + j ] = j ; + if ( pVideoMemory[ 16 + j ] == j ) + { + pVideoMemory[ j ] = j ; + break ; + } + } + } +} + + + + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SetDRAMSize_340 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_SetDRAMSize_340( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +{ + USHORT data ; + + pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; + pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; + XGISetModeNew( HwDeviceExtension , 0x2e ) ; + + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x21 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x21 , ( USHORT )( data & 0xDF ) ) ; /* disable read cache */ + + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x1 ) ; + data |= 0x20 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x01 , data ) ; /* Turn OFF Display */ + + XGINew_DDRSizing340( HwDeviceExtension, pVBInfo ) ; + + data=XGINew_GetReg1( pVBInfo->P3c4 , 0x21 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x21 , ( USHORT )( data | 0x20 ) ) ; /* enable read cache */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_SetDRAMSize_310( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +{ + + +/* ULONG UMASize = 0 ; + UCHAR tempah ; */ + USHORT data ; + pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase , + pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; +#ifdef XGI301 + /* XGINew_SetReg1( pVBInfo->P3d4 , 0x30 , 0x40 ) ; */ +#endif + +#ifdef XGI302 /* alan,should change value */ + XGINew_SetReg1( pVBInfo->P3d4 , 0x30 , 0x4D ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x31 , 0xc0 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x34 , 0x3F ) ; +#endif + + XGISetModeNew( HwDeviceExtension , 0x2e ) ; + + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x21 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x21 , ( USHORT )( data & 0xDF ) ) ; /* disable read cache */ + + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x1 ) ; + data |= 0x20 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x01 , data ) ; /* Turn OFF Display */ + + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x16 ) ; + + + XGINew_SetReg1( pVBInfo->P3c4 , 0x16 , ( USHORT )( data | 0x0F ) ) ; /* assume lowest speed DRAM */ + + XGINew_SetDRAMModeRegister( pVBInfo ) ; + XGINew_DisableRefresh( HwDeviceExtension, pVBInfo ) ; + XGINew_CheckBusWidth_310( pVBInfo) ; + XGINew_VerifyMclk( HwDeviceExtension, pVBInfo ) ; /* alan 2000/7/3 */ + + + + if ( XGINew_Get310DRAMType( pVBInfo ) < 2 ) + { + XGINew_SDRSizing( pVBInfo ) ; + } + else + { + XGINew_DDRSizing( pVBInfo) ; + } + + + + + XGINew_SetReg1( pVBInfo->P3c4 , 0x16 , pVBInfo->SR15[ 1 ][ XGINew_RAMType ] ) ; /* restore SR16 */ + + XGINew_EnableRefresh( HwDeviceExtension, pVBInfo ) ; + data=XGINew_GetReg1( pVBInfo->P3c4 ,0x21 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x21 , ( USHORT )( data | 0x20 ) ) ; /* enable read cache */ +} + + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SetDRAMModeRegister340 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ + +void XGINew_SetDRAMModeRegister340( PXGI_HW_DEVICE_INFO HwDeviceExtension ) +{ + UCHAR data ; + VB_DEVICE_INFO VBINF; + PVB_DEVICE_INFO pVBInfo = &VBINF; + pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; + pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; + pVBInfo->BaseAddr = ( USHORT )HwDeviceExtension->pjIOAddress ; + pVBInfo->ISXPDOS = 0 ; + + pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ; + pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24 ; + pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10 ; + pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e ; + pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12 ; + pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a ; + pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16 ; + pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17 ; + pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18 ; + pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19 ; + pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A ; + pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00 ; + pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04 ; + pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10 ; + pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12 ; + pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 ; + pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2 ; + + XGI_GetVBType( pVBInfo ) ; /* Run XGI_GetVBType before XGI_InitTo330Pointer */ + + XGI_InitTo330Pointer(HwDeviceExtension->jChipType,pVBInfo); + + XGI_ReadVBIOSTablData( HwDeviceExtension->jChipType , pVBInfo) ; + + if ( XGINew_Get340DRAMType( HwDeviceExtension, pVBInfo) == 0 ) + { + data = ( XGINew_GetReg1( pVBInfo->P3c4 , 0x39 ) & 0x02 ) >> 1 ; + if ( data == 0x01 ) + XGINew_DDR2x_MRS_340( pVBInfo->P3c4, pVBInfo ) ; + else + XGINew_DDR1x_MRS_340( pVBInfo->P3c4, pVBInfo ) ; + } + else + XGINew_DDR2_MRS_340( HwDeviceExtension, pVBInfo->P3c4, pVBInfo); + + XGINew_SetReg1( pVBInfo->P3c4 , 0x1B , 0x03 ) ; +} + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SetDRAMModeRegister */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_SetDRAMModeRegister( PVB_DEVICE_INFO pVBInfo) +{ + if ( XGINew_Get310DRAMType( pVBInfo ) < 2 ) + { + XGINew_SDR_MRS(pVBInfo ) ; + } + else + { + /* SR16 <- 0F,CF,0F,8F */ + XGINew_DDR_MRS( pVBInfo ) ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DisableRefresh */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_DisableRefresh( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +{ + USHORT data ; + + + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x1B ) ; + data &= 0xF8 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x1B , data ) ; + +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_EnableRefresh */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_EnableRefresh( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +{ + + XGINew_SetReg1( pVBInfo->P3c4 , 0x1B , pVBInfo->SR15[ 3 ][ XGINew_RAMType ] ) ; /* SR1B */ + + +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DisableChannelInterleaving */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGINew_DisableChannelInterleaving( int index , USHORT XGINew_DDRDRAM_TYPE[][ 5 ] , PVB_DEVICE_INFO pVBInfo) +{ + USHORT data ; + + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x15 ) ; + data &= 0x1F ; + + switch( XGINew_DDRDRAM_TYPE[ index ][ 3 ] ) + { + case 64: + data |= 0 ; + break ; + case 32: + data |= 0x20 ; + break ; + case 16: + data |= 0x40 ; + break ; + case 4: + data |= 0x60 ; + break ; + default: + break ; + } + XGINew_SetReg1( pVBInfo->P3c4 , 0x15 , data ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SetDRAMSizingType */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGINew_SetDRAMSizingType( int index , USHORT DRAMTYPE_TABLE[][ 5 ] ,PVB_DEVICE_INFO pVBInfo) +{ + USHORT data ; + + data = DRAMTYPE_TABLE[ index ][ 4 ] ; + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x13 , 0x80 , data ) ; + XGIDelayUS( 15 ) ; + /* should delay 50 ns */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_CheckBusWidth_310 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_CheckBusWidth_310( PVB_DEVICE_INFO pVBInfo) +{ + USHORT data ; + PULONG volatile pVideoMemory ; + + pVideoMemory = (PULONG) pVBInfo->FBAddr; + + if ( XGINew_Get310DRAMType( pVBInfo ) < 2 ) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0x00 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x12 ) ; + /* should delay */ + XGINew_SDR_MRS( pVBInfo ) ; + + XGINew_ChannelAB = 0 ; + XGINew_DataBusWidth = 128 ; + pVideoMemory[ 0 ] = 0x01234567L ; + pVideoMemory[ 1 ] = 0x456789ABL ; + pVideoMemory[ 2 ] = 0x89ABCDEFL ; + pVideoMemory[ 3 ] = 0xCDEF0123L ; + pVideoMemory[ 4 ] = 0x55555555L ; + pVideoMemory[ 5 ] = 0x55555555L ; + pVideoMemory[ 6 ] = 0xFFFFFFFFL ; + pVideoMemory[ 7 ] = 0xFFFFFFFFL ; + + if ( ( pVideoMemory[ 3 ] != 0xCDEF0123L ) || ( pVideoMemory[ 2 ] != 0x89ABCDEFL ) ) + { + /* ChannelA64Bit */ + XGINew_DataBusWidth = 64 ; + XGINew_ChannelAB = 0 ; + data=XGINew_GetReg1( pVBInfo->P3c4 , 0x14 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , ( USHORT )( data & 0xFD ) ) ; + } + + if ( ( pVideoMemory[ 1 ] != 0x456789ABL ) || ( pVideoMemory[ 0 ] != 0x01234567L ) ) + { + /* ChannelB64Bit */ + XGINew_DataBusWidth = 64 ; + XGINew_ChannelAB = 1 ; + data=XGINew_GetReg1( pVBInfo->P3c4 , 0x14 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , ( USHORT )( ( data & 0xFD ) | 0x01 ) ) ; + } + + return ; + } + else + { + /* DDR Dual channel */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0x00 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x02 ) ; /* Channel A, 64bit */ + /* should delay */ + XGINew_DDR_MRS( pVBInfo ) ; + + XGINew_ChannelAB = 0 ; + XGINew_DataBusWidth = 64 ; + pVideoMemory[ 0 ] = 0x01234567L ; + pVideoMemory[ 1 ] = 0x456789ABL ; + pVideoMemory[ 2 ] = 0x89ABCDEFL ; + pVideoMemory[ 3 ] = 0xCDEF0123L ; + pVideoMemory[ 4 ] = 0x55555555L ; + pVideoMemory[ 5 ] = 0x55555555L ; + pVideoMemory[ 6 ] = 0xAAAAAAAAL ; + pVideoMemory[ 7 ] = 0xAAAAAAAAL ; + + if ( pVideoMemory[ 1 ] == 0x456789ABL ) + { + if ( pVideoMemory[ 0 ] == 0x01234567L ) + { + /* Channel A 64bit */ + return ; + } + } + else + { + if ( pVideoMemory[ 0 ] == 0x01234567L ) + { + /* Channel A 32bit */ + XGINew_DataBusWidth = 32 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x00 ) ; + return ; + } + } + + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x03 ) ; /* Channel B, 64bit */ + XGINew_DDR_MRS( pVBInfo); + + XGINew_ChannelAB = 1 ; + XGINew_DataBusWidth = 64 ; + pVideoMemory[ 0 ] = 0x01234567L ; + pVideoMemory[ 1 ] = 0x456789ABL ; + pVideoMemory[ 2 ] = 0x89ABCDEFL ; + pVideoMemory[ 3 ] = 0xCDEF0123L ; + pVideoMemory[ 4 ] = 0x55555555L ; + pVideoMemory[ 5 ] = 0x55555555L ; + pVideoMemory[ 6 ] = 0xAAAAAAAAL ; + pVideoMemory[ 7 ] = 0xAAAAAAAAL ; + + if ( pVideoMemory[ 1 ] == 0x456789ABL ) + { + /* Channel B 64 */ + if ( pVideoMemory[ 0 ] == 0x01234567L ) + { + /* Channel B 64bit */ + return ; + } + else + { + /* error */ + } + } + else + { + if ( pVideoMemory[ 0 ] == 0x01234567L ) + { + /* Channel B 32 */ + XGINew_DataBusWidth = 32 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x01 ) ; + } + else + { + /* error */ + } + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SetRank */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static int XGINew_SetRank( int index , UCHAR RankNo , UCHAR XGINew_ChannelAB , USHORT DRAMTYPE_TABLE[][ 5 ] , PVB_DEVICE_INFO pVBInfo) +{ + USHORT data ; + int RankSize ; + + if ( ( RankNo == 2 ) && ( DRAMTYPE_TABLE[ index ][ 0 ] == 2 ) ) + return 0 ; + + RankSize = DRAMTYPE_TABLE[ index ][ 3 ] / 2 * XGINew_DataBusWidth / 32 ; + + if ( ( RankNo * RankSize ) <= 128 ) + { + data = 0 ; + + while( ( RankSize >>= 1 ) > 0 ) + { + data += 0x10 ; + } + data |= ( RankNo - 1 ) << 2 ; + data |= ( XGINew_DataBusWidth / 64 ) & 2 ; + data |= XGINew_ChannelAB ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , data ) ; + /* should delay */ + XGINew_SDR_MRS( pVBInfo ) ; + return( 1 ) ; + } + else + return( 0 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SetDDRChannel */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static int XGINew_SetDDRChannel( int index , UCHAR ChannelNo , UCHAR XGINew_ChannelAB , USHORT DRAMTYPE_TABLE[][ 5 ] , PVB_DEVICE_INFO pVBInfo) +{ + USHORT data ; + int RankSize ; + + RankSize = DRAMTYPE_TABLE[index][3]/2 * XGINew_DataBusWidth/32; + /* RankSize = DRAMTYPE_TABLE[ index ][ 3 ] ; */ + if ( ChannelNo * RankSize <= 128 ) + { + data = 0 ; + while( ( RankSize >>= 1 ) > 0 ) + { + data += 0x10 ; + } + + if ( ChannelNo == 2 ) + data |= 0x0C ; + + data |= ( XGINew_DataBusWidth / 32 ) & 2 ; + data |= XGINew_ChannelAB ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , data ) ; + /* should delay */ + XGINew_DDR_MRS( pVBInfo ) ; + return( 1 ) ; + } + else + return( 0 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_CheckColumn */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static int XGINew_CheckColumn( int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +{ + int i ; + ULONG Increment , Position ; + + /* Increment = 1 << ( DRAMTYPE_TABLE[ index ][ 2 ] + XGINew_DataBusWidth / 64 + 1 ) ; */ + Increment = 1 << ( 10 + XGINew_DataBusWidth / 64 ) ; + + for( i = 0 , Position = 0 ; i < 2 ; i++ ) + { + *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; + Position += Increment ; + } + +#ifdef WIN2000 /* chiawen for linux solution */ + XGIDelayUS( 100 ) ; +#endif + + for( i = 0 , Position = 0 ; i < 2 ; i++ ) + { + /* if ( pVBInfo->FBAddr[ Position ] != Position ) */ + if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) + return( 0 ) ; + Position += Increment ; + } + return( 1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_CheckBanks */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static int XGINew_CheckBanks( int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +{ + int i ; + ULONG Increment , Position ; + + Increment = 1 << ( DRAMTYPE_TABLE[ index ][ 2 ] + XGINew_DataBusWidth / 64 + 2 ) ; + + for( i = 0 , Position = 0 ; i < 4 ; i++ ) + { + /* pVBInfo->FBAddr[ Position ] = Position ; */ + *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; + Position += Increment ; + } + + for( i = 0 , Position = 0 ; i < 4 ; i++ ) + { + /* if (pVBInfo->FBAddr[ Position ] != Position ) */ + if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) + return( 0 ) ; + Position += Increment ; + } + return( 1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_CheckRank */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static int XGINew_CheckRank( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +{ + int i ; + ULONG Increment , Position ; + + Increment = 1 << ( DRAMTYPE_TABLE[ index ][ 2 ] + DRAMTYPE_TABLE[ index ][ 1 ] + + DRAMTYPE_TABLE[ index ][ 0 ] + XGINew_DataBusWidth / 64 + RankNo ) ; + + for( i = 0 , Position = 0 ; i < 2 ; i++ ) + { + /* pVBInfo->FBAddr[ Position ] = Position ; */ + /* *( ( PULONG )( pVBInfo->FBAddr ) ) = Position ; */ + *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; + Position += Increment ; + } + + for( i = 0 , Position = 0 ; i < 2 ; i++ ) + { + /* if ( pVBInfo->FBAddr[ Position ] != Position ) */ + /* if ( ( *( PULONG )( pVBInfo->FBAddr ) ) != Position ) */ + if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) + return( 0 ) ; + Position += Increment ; + } + return( 1 ); +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_CheckDDRRank */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static int XGINew_CheckDDRRank( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +{ + ULONG Increment , Position ; + USHORT data ; + + Increment = 1 << ( DRAMTYPE_TABLE[ index ][ 2 ] + DRAMTYPE_TABLE[ index ][ 1 ] + + DRAMTYPE_TABLE[ index ][ 0 ] + XGINew_DataBusWidth / 64 + RankNo ) ; + + Increment += Increment / 2 ; + + Position = 0; + *( ( PULONG )( pVBInfo->FBAddr + Position + 0 ) ) = 0x01234567 ; + *( ( PULONG )( pVBInfo->FBAddr + Position + 1 ) ) = 0x456789AB ; + *( ( PULONG )( pVBInfo->FBAddr + Position + 2 ) ) = 0x55555555 ; + *( ( PULONG )( pVBInfo->FBAddr + Position + 3 ) ) = 0x55555555 ; + *( ( PULONG )( pVBInfo->FBAddr + Position + 4 ) ) = 0xAAAAAAAA ; + *( ( PULONG )( pVBInfo->FBAddr + Position + 5 ) ) = 0xAAAAAAAA ; + + if ( ( *( PULONG )( pVBInfo->FBAddr + 1 ) ) == 0x456789AB ) + return( 1 ) ; + + if ( ( *( PULONG )( pVBInfo->FBAddr + 0 ) ) == 0x01234567 ) + return( 0 ) ; + + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x14 ) ; + data &= 0xF3 ; + data |= 0x0E ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , data ) ; + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x15 ) ; + data += 0x20 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x15 , data ) ; + + return( 1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_CheckRanks */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static int XGINew_CheckRanks( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +{ + int r ; + + for( r = RankNo ; r >= 1 ; r-- ) + { + if ( !XGINew_CheckRank( r , index , DRAMTYPE_TABLE, pVBInfo ) ) + return( 0 ) ; + } + + if ( !XGINew_CheckBanks( index , DRAMTYPE_TABLE, pVBInfo ) ) + return( 0 ) ; + + if ( !XGINew_CheckColumn( index , DRAMTYPE_TABLE, pVBInfo ) ) + return( 0 ) ; + + return( 1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_CheckDDRRanks */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static int XGINew_CheckDDRRanks( int RankNo , int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +{ + int r ; + + for( r = RankNo ; r >= 1 ; r-- ) + { + if ( !XGINew_CheckDDRRank( r , index , DRAMTYPE_TABLE, pVBInfo ) ) + return( 0 ) ; + } + + if ( !XGINew_CheckBanks( index , DRAMTYPE_TABLE, pVBInfo ) ) + return( 0 ) ; + + if ( !XGINew_CheckColumn( index , DRAMTYPE_TABLE, pVBInfo ) ) + return( 0 ) ; + + return( 1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +int XGINew_SDRSizing(PVB_DEVICE_INFO pVBInfo) +{ + int i ; + UCHAR j ; + + for( i = 0 ; i < 13 ; i++ ) + { + XGINew_SetDRAMSizingType( i , XGINew_SDRDRAM_TYPE , pVBInfo) ; + + for( j = 2 ; j > 0 ; j-- ) + { + if ( !XGINew_SetRank( i , ( UCHAR )j , XGINew_ChannelAB , XGINew_SDRDRAM_TYPE , pVBInfo) ) + continue ; + else + { + if ( XGINew_CheckRanks( j , i , XGINew_SDRDRAM_TYPE, pVBInfo) ) + return( 1 ) ; + } + } + } + return( 0 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SetDRAMSizeReg */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static USHORT XGINew_SetDRAMSizeReg( int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +{ + USHORT data = 0 , memsize = 0 ; + int RankSize ; + UCHAR ChannelNo ; + + RankSize = DRAMTYPE_TABLE[ index ][ 3 ] * XGINew_DataBusWidth / 32 ; + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x13 ) ; + data &= 0x80 ; + + if ( data == 0x80 ) + RankSize *= 2 ; + + data = 0 ; + + if( XGINew_ChannelAB == 3 ) + ChannelNo = 4 ; + else + ChannelNo = XGINew_ChannelAB ; + + if ( ChannelNo * RankSize <= 256 ) + { + while( ( RankSize >>= 1 ) > 0 ) + { + data += 0x10 ; + } + + memsize = data >> 4 ; + + /* [2004/03/25] Vicent, Fix DRAM Sizing Error */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , ( XGINew_GetReg1( pVBInfo->P3c4 , 0x14 ) & 0x0F ) | ( data & 0xF0 ) ) ; + + /* data |= XGINew_ChannelAB << 2 ; */ + /* data |= ( XGINew_DataBusWidth / 64 ) << 1 ; */ + /* XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , data ) ; */ + + /* should delay */ + /* XGINew_SetDRAMModeRegister340( pVBInfo ) ; */ + } + return( memsize ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SetDRAMSize20Reg */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static USHORT XGINew_SetDRAMSize20Reg( int index , USHORT DRAMTYPE_TABLE[][ 5 ], PVB_DEVICE_INFO pVBInfo) +{ + USHORT data = 0 , memsize = 0 ; + int RankSize ; + UCHAR ChannelNo ; + + RankSize = DRAMTYPE_TABLE[ index ][ 3 ] * XGINew_DataBusWidth / 8 ; + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x13 ) ; + data &= 0x80 ; + + if ( data == 0x80 ) + RankSize *= 2 ; + + data = 0 ; + + if( XGINew_ChannelAB == 3 ) + ChannelNo = 4 ; + else + ChannelNo = XGINew_ChannelAB ; + + if ( ChannelNo * RankSize <= 256 ) + { + while( ( RankSize >>= 1 ) > 0 ) + { + data += 0x10 ; + } + + memsize = data >> 4 ; + + /* [2004/03/25] Vicent, Fix DRAM Sizing Error */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , ( XGINew_GetReg1( pVBInfo->P3c4 , 0x14 ) & 0x0F ) | ( data & 0xF0 ) ) ; + XGIDelayUS( 15 ) ; + + /* data |= XGINew_ChannelAB << 2 ; */ + /* data |= ( XGINew_DataBusWidth / 64 ) << 1 ; */ + /* XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , data ) ; */ + + /* should delay */ + /* XGINew_SetDRAMModeRegister340( pVBInfo ) ; */ + } + return( memsize ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_ReadWriteRest */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static int XGINew_ReadWriteRest( USHORT StopAddr , USHORT StartAddr, PVB_DEVICE_INFO pVBInfo) +{ + int i ; + ULONG Position = 0 ; + + *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; + + for( i = StartAddr ; i <= StopAddr ; i++ ) + { + Position = 1 << i ; + *( ( PULONG )( pVBInfo->FBAddr + Position ) ) = Position ; + } + + XGIDelayUS( 500 ) ; /* [Vicent] 2004/04/16. Fix #1759 Memory Size error in Multi-Adapter. */ + + Position = 0 ; + + if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) + return( 0 ) ; + + for( i = StartAddr ; i <= StopAddr ; i++ ) + { + Position = 1 << i ; + if ( ( *( PULONG )( pVBInfo->FBAddr + Position ) ) != Position ) + return( 0 ) ; + } + return( 1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_CheckFrequence */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static UCHAR XGINew_CheckFrequence( PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR data ; + + data = XGINew_GetReg1( pVBInfo->P3d4 , 0x97 ) ; + + if ( ( data & 0x10 ) == 0 ) + { + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x39 ) ; + data = ( data & 0x02 ) >> 1 ; + return( data ) ; + } + else + return( data & 0x01 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_CheckChannel */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGINew_CheckChannel( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +{ + UCHAR data; + + switch( HwDeviceExtension->jChipType ) + { + case XG20: + data = XGINew_GetReg1( pVBInfo->P3d4 , 0x97 ) ; + data = data & 0x01; + XGINew_ChannelAB = 1 ; /* XG20 "JUST" one channel */ + + if ( data == 0 ) /* Single_32_16 */ + { + + if (( HwDeviceExtension->ulVideoMemorySize - 1 ) > 0x1000000) + { + + XGINew_DataBusWidth = 32 ; /* 32 bits */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0xB1 ) ; /* 22bit + 2 rank + 32bit */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x52 ) ; + XGIDelayUS( 15 ) ; + + if ( XGINew_ReadWriteRest( 24 , 23 , pVBInfo ) == 1 ) + return ; + + if (( HwDeviceExtension->ulVideoMemorySize - 1 ) > 0x800000) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0x31 ) ; /* 22bit + 1 rank + 32bit */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x42 ) ; + XGIDelayUS( 15 ) ; + + if ( XGINew_ReadWriteRest( 23 , 23 , pVBInfo ) == 1 ) + return ; + } + } + + if (( HwDeviceExtension->ulVideoMemorySize - 1 ) > 0x800000) + { + XGINew_DataBusWidth = 16 ; /* 16 bits */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0xB1 ) ; /* 22bit + 2 rank + 16bit */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x41 ) ; + XGIDelayUS( 15 ) ; + + if ( XGINew_ReadWriteRest( 23 , 22 , pVBInfo ) == 1 ) + return ; + else + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0x31 ) ; + XGIDelayUS( 15 ) ; + } + + } + else /* Dual_16_8 */ + { + if (( HwDeviceExtension->ulVideoMemorySize - 1 ) > 0x800000) + { + + XGINew_DataBusWidth = 16 ; /* 16 bits */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0xB1 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x41 ) ; + XGIDelayUS( 15 ) ; + + if ( XGINew_ReadWriteRest( 23 , 22 , pVBInfo ) == 1 ) + return ; + + if (( HwDeviceExtension->ulVideoMemorySize - 1 ) > 0x400000) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0x31 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x31 ) ; + XGIDelayUS( 15 ) ; + + if ( XGINew_ReadWriteRest( 22 , 22 , pVBInfo ) == 1 ) + return ; + } + } + + + if (( HwDeviceExtension->ulVideoMemorySize - 1 ) > 0x400000) + { + XGINew_DataBusWidth = 8 ; /* 8 bits */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0xB1 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x30 ) ; + XGIDelayUS( 15 ) ; + + if ( XGINew_ReadWriteRest( 22 , 21 , pVBInfo ) == 1 ) + return ; + else + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0x31 ) ; + XGIDelayUS( 15 ) ; + } + } + break ; + + case XG41: + if ( XGINew_CheckFrequence(pVBInfo) == 1 ) + { + XGINew_DataBusWidth = 32 ; /* 32 bits */ + XGINew_ChannelAB = 3 ; /* Quad Channel */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0xA1 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x4C ) ; + + if ( XGINew_ReadWriteRest( 25 , 23 , pVBInfo ) == 1 ) + return ; + + XGINew_ChannelAB = 2 ; /* Dual channels */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x48 ) ; + + if ( XGINew_ReadWriteRest( 24 , 23 , pVBInfo ) == 1 ) + return ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x49 ) ; + + if ( XGINew_ReadWriteRest( 24 , 23 , pVBInfo ) == 1 ) + return ; + + XGINew_ChannelAB = 3 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0x21 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x3C ) ; + + if ( XGINew_ReadWriteRest( 24 , 23 , pVBInfo ) == 1 ) + return ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x38 ) ; + + if ( XGINew_ReadWriteRest( 8 , 4 , pVBInfo ) == 1 ) + return ; + else + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x39 ) ; + } + else + { /* DDR */ + XGINew_DataBusWidth = 64 ; /* 64 bits */ + XGINew_ChannelAB = 2 ; /* Dual channels */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0xA1 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x5A ) ; + + if ( XGINew_ReadWriteRest( 25 , 24 , pVBInfo ) == 1 ) + return ; + + XGINew_ChannelAB = 1 ; /* Single channels */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x52 ) ; + + if ( XGINew_ReadWriteRest( 24 , 23 , pVBInfo ) == 1 ) + return ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x53 ) ; + + if ( XGINew_ReadWriteRest( 24 , 23 , pVBInfo ) == 1 ) + return ; + + XGINew_ChannelAB = 2 ; /* Dual channels */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0x21 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x4A ) ; + + if ( XGINew_ReadWriteRest( 24 , 23 , pVBInfo ) == 1 ) + return ; + + XGINew_ChannelAB = 1 ; /* Single channels */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x42 ) ; + + if ( XGINew_ReadWriteRest( 8 , 4 , pVBInfo ) == 1 ) + return ; + else + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x43 ) ; + } + + break ; + + case XG42: +/* + XG42 SR14 D[3] Reserve + D[2] = 1, Dual Channel + = 0, Single Channel + + It's Different from Other XG40 Series. +*/ + if ( XGINew_CheckFrequence(pVBInfo) == 1 ) /* DDRII, DDR2x */ + { + XGINew_DataBusWidth = 32 ; /* 32 bits */ + XGINew_ChannelAB = 2 ; /* 2 Channel */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0xA1 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x44 ) ; + + if ( XGINew_ReadWriteRest( 24 , 23 , pVBInfo ) == 1 ) + return ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0x21 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x34 ) ; + if ( XGINew_ReadWriteRest( 23 , 22 , pVBInfo ) == 1 ) + return ; + + XGINew_ChannelAB = 1 ; /* Single Channel */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0xA1 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x40 ) ; + + if ( XGINew_ReadWriteRest( 23 , 22 , pVBInfo ) == 1 ) + return ; + else + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0x21 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x30 ) ; + } + } + else + { /* DDR */ + XGINew_DataBusWidth = 64 ; /* 64 bits */ + XGINew_ChannelAB = 1 ; /* 1 channels */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0xA1 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x52 ) ; + + if ( XGINew_ReadWriteRest( 24 , 23 , pVBInfo ) == 1 ) + return ; + else + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0x21 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x42 ) ; + } + } + + break ; + + default: /* XG40 */ + + if ( XGINew_CheckFrequence(pVBInfo) == 1 ) /* DDRII */ + { + XGINew_DataBusWidth = 32 ; /* 32 bits */ + XGINew_ChannelAB = 3 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0xA1 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x4C ) ; + + if ( XGINew_ReadWriteRest( 25 , 23 , pVBInfo ) == 1 ) + return ; + + XGINew_ChannelAB = 2 ; /* 2 channels */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x48 ) ; + + if ( XGINew_ReadWriteRest( 24 , 23 , pVBInfo ) == 1 ) + return ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0x21 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x3C ) ; + + if ( XGINew_ReadWriteRest( 24 , 23 , pVBInfo ) == 1 ) + XGINew_ChannelAB = 3 ; /* 4 channels */ + else + { + XGINew_ChannelAB = 2 ; /* 2 channels */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x38 ) ; + } + } + else + { /* DDR */ + XGINew_DataBusWidth = 64 ; /* 64 bits */ + XGINew_ChannelAB = 2 ; /* 2 channels */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0xA1 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x5A ) ; + + if ( XGINew_ReadWriteRest( 25 , 24 , pVBInfo ) == 1 ) + return ; + else + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x13 , 0x21 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x14 , 0x4A ) ; + } + } + break ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DDRSizing340 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +int XGINew_DDRSizing340( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +{ + int i ; + USHORT memsize , addr ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x15 , 0x00 ) ; /* noninterleaving */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x1C , 0x00 ) ; /* nontiling */ + XGINew_CheckChannel( HwDeviceExtension, pVBInfo ) ; + + + if ( HwDeviceExtension->jChipType == XG20 ) + { + for( i = 0 ; i < 12 ; i++ ) + { + XGINew_SetDRAMSizingType( i , XGINew_DDRDRAM_TYPE20, pVBInfo ) ; + memsize = XGINew_SetDRAMSize20Reg( i , XGINew_DDRDRAM_TYPE20, pVBInfo ) ; + if ( memsize == 0 ) + continue ; + + addr = memsize + ( XGINew_ChannelAB - 2 ) + 20 ; + if ( ( HwDeviceExtension->ulVideoMemorySize - 1 ) < ( ULONG )( 1 << addr ) ) + continue ; + + if ( XGINew_ReadWriteRest( addr , 5, pVBInfo ) == 1 ) + return( 1 ) ; + } + } + else + { + for( i = 0 ; i < 4 ; i++ ) + { + XGINew_SetDRAMSizingType( i , XGINew_DDRDRAM_TYPE340, pVBInfo ) ; + memsize = XGINew_SetDRAMSizeReg( i , XGINew_DDRDRAM_TYPE340, pVBInfo ) ; + + if ( memsize == 0 ) + continue ; + + addr = memsize + ( XGINew_ChannelAB - 2 ) + 20 ; + if ( ( HwDeviceExtension->ulVideoMemorySize - 1 ) < ( ULONG )( 1 << addr ) ) + continue ; + + if ( XGINew_ReadWriteRest( addr , 9, pVBInfo ) == 1 ) + return( 1 ) ; + } + } + return( 0 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DDRSizing */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +int XGINew_DDRSizing(PVB_DEVICE_INFO pVBInfo) +{ + int i ; + UCHAR j ; + + for( i = 0 ; i < 4 ; i++ ) + { + XGINew_SetDRAMSizingType( i , XGINew_DDRDRAM_TYPE, pVBInfo ) ; + XGINew_DisableChannelInterleaving( i , XGINew_DDRDRAM_TYPE , pVBInfo) ; + for( j = 2 ; j > 0 ; j-- ) + { + XGINew_SetDDRChannel( i , j , XGINew_ChannelAB , XGINew_DDRDRAM_TYPE , pVBInfo ) ; + if ( !XGINew_SetRank( i , ( UCHAR )j , XGINew_ChannelAB , XGINew_DDRDRAM_TYPE, pVBInfo ) ) + continue ; + else + { + if ( XGINew_CheckDDRRanks( j , i , XGINew_DDRDRAM_TYPE, pVBInfo ) ) + return( 1 ) ; + } + } + } + return( 0 ) ; +} + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SetMemoryClock */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_SetMemoryClock( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +{ +/* UCHAR tempal ; */ + + + XGINew_SetReg1( pVBInfo->P3c4 , 0x28 , pVBInfo->MCLKData[ XGINew_RAMType ].SR28 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x29 , pVBInfo->MCLKData[ XGINew_RAMType ].SR29 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2A , pVBInfo->MCLKData[ XGINew_RAMType ].SR2A ) ; + + + + XGINew_SetReg1( pVBInfo->P3c4 , 0x2E , pVBInfo->ECLKData[ XGINew_RAMType ].SR2E ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2F , pVBInfo->ECLKData[ XGINew_RAMType ].SR2F ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x30 , pVBInfo->ECLKData[ XGINew_RAMType ].SR30 ) ; + + /* [Vicent] 2004/07/07, When XG42 ECLK = MCLK = 207MHz, Set SR32 D[1:0] = 10b */ + /* [Hsuan] 2004/08/20, Modify SR32 value, when MCLK=207MHZ, ELCK=250MHz, Set SR32 D[1:0] = 10b */ + if ( HwDeviceExtension->jChipType == XG42 ) + { + if ( ( pVBInfo->MCLKData[ XGINew_RAMType ].SR28 == 0x1C ) && ( pVBInfo->MCLKData[ XGINew_RAMType ].SR29 == 0x01 ) + && ( (( pVBInfo->ECLKData[ XGINew_RAMType ].SR2E == 0x1C ) && ( pVBInfo->ECLKData[ XGINew_RAMType ].SR2F == 0x01 )) + || (( pVBInfo->ECLKData[ XGINew_RAMType ].SR2E == 0x22 ) && ( pVBInfo->ECLKData[ XGINew_RAMType ].SR2F == 0x01 )) ) ) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x32 , ( ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x32 ) & 0xFC ) | 0x02 ) ; + } + } +} + + +#if 0 +/* --------------------------------------------------------------------- */ +/* Function : ChkLFB */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static BOOLEAN ChkLFB( PVB_DEVICE_INFO pVBInfo ) +{ + if ( LFBDRAMTrap & XGINew_GetReg1( pVBInfo->P3d4 , 0x78 ) ) + return( TRUE ) ; + else + return( FALSE ); +} +#endif + + +/* --------------------------------------------------------------------- */ +/* input : dx ,valid value : CR or second chip's CR */ +/* */ +/* SetPowerConsume : */ +/* Description: reduce 40/43 power consumption in first chip or */ +/* in second chip, assume CR A1 D[6]="1" in this case */ +/* output : none */ +/* --------------------------------------------------------------------- */ +static void SetPowerConsume ( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT XGI_P3d4Port ) +{ + ULONG lTemp ; + UCHAR bTemp; + + HwDeviceExtension->pQueryVGAConfigSpace( HwDeviceExtension , 0x08 , 0 , &lTemp ) ; /* Get */ + if ((lTemp&0xFF)==0) + { + /* set CR58 D[5]=0 D[3]=0 */ + XGINew_SetRegAND( XGI_P3d4Port , 0x58 , 0xD7 ) ; + bTemp = (UCHAR) XGINew_GetReg1( XGI_P3d4Port , 0xCB ) ; + if (bTemp&0x20) + { + if (!(bTemp&0x10)) + { + XGINew_SetRegANDOR( XGI_P3d4Port , 0x58 , 0xD7 , 0x20 ) ; /* CR58 D[5]=1 D[3]=0 */ + } + else + { + XGINew_SetRegANDOR( XGI_P3d4Port , 0x58 , 0xD7 , 0x08 ) ; /* CR58 D[5]=0 D[3]=1 */ + } + + } + + } +} + + + +#if defined(LINUX_XF86)||defined(LINUX_KERNEL) +void XGINew_InitVBIOSData(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +{ + + /* ULONG ROMAddr = (ULONG)HwDeviceExtension->pjVirtualRomBase; */ + pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; + pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; + pVBInfo->BaseAddr = ( USHORT )HwDeviceExtension->pjIOAddress ; + pVBInfo->ISXPDOS = 0 ; + + pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ; + pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24 ; + pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10 ; + pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e ; + pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12 ; + pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a ; + pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16 ; + pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17 ; + pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18 ; + pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19 ; + pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A ; + pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00 ; + pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04 ; + pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10 ; + pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12 ; + pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 ; + pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2 ; + + XGI_GetVBType( pVBInfo ) ; /* Run XGI_GetVBType before XGI_InitTo330Pointer */ + + switch(HwDeviceExtension->jChipType) + { + case XG40: + case XG41: + case XG42: + case XG20: + default: + XGI_InitTo330Pointer(HwDeviceExtension->jChipType,pVBInfo); + return ; + } + +} +#endif /* For Linux */ + +/* --------------------------------------------------------------------- */ +/* Function : XGI_ReadVBIOSTablData */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_ReadVBIOSTablData( UCHAR ChipType , PVB_DEVICE_INFO pVBInfo) +{ + PUCHAR volatile pVideoMemory = ( PUCHAR )pVBInfo->ROMAddr ; + ULONG i ; + UCHAR j , k ; + ULONG ii , jj ; + + i = pVideoMemory[ 0x1CF ] | ( pVideoMemory[ 0x1D0 ] << 8 ) ; /* UniROM */ + if ( i != 0 ) + UNIROM = 1 ; + + ii = 0x90 ; + for( jj = 0x00 ; jj < 0x08 ; jj++ ) + { + pVBInfo->MCLKData[ jj ].SR28 = pVideoMemory[ ii ] ; + pVBInfo->MCLKData[ jj ].SR29 = pVideoMemory[ ii + 1] ; + pVBInfo->MCLKData[ jj ].SR2A = pVideoMemory[ ii + 2] ; + pVBInfo->MCLKData[ jj ].CLOCK = pVideoMemory[ ii + 3 ] | ( pVideoMemory[ ii + 4 ] << 8 ) ; + ii += 0x05 ; + } + + ii = 0xB8 ; + for( jj = 0x00 ; jj < 0x08 ; jj++ ) + { + pVBInfo->ECLKData[ jj ].SR2E = pVideoMemory[ ii ] ; + pVBInfo->ECLKData[ jj ].SR2F=pVideoMemory[ ii + 1 ] ; + pVBInfo->ECLKData[ jj ].SR30= pVideoMemory[ ii + 2 ] ; + pVBInfo->ECLKData[ jj ].CLOCK= pVideoMemory[ ii + 3 ] | ( pVideoMemory[ ii + 4 ] << 8 ) ; + ii += 0x05 ; + } + + /* Volari customize data area start */ + /* if ( ChipType == XG40 ) */ + if ( ChipType >= XG40 ) + { + ii = 0xE0 ; + for( jj = 0x00 ; jj < 0x03 ; jj++ ) + { + pVBInfo->SR15[ jj ][ 0 ] = pVideoMemory[ ii ] ; /* SR13, SR14, and SR18 */ + pVBInfo->SR15[ jj ][ 1 ] = pVideoMemory[ ii + 1 ] ; + pVBInfo->SR15[ jj ][ 2 ] = pVideoMemory[ ii + 2 ] ; + pVBInfo->SR15[ jj ][ 3 ] = pVideoMemory[ ii + 3 ] ; + pVBInfo->SR15[ jj ][ 4 ] = pVideoMemory[ ii + 4 ] ; + pVBInfo->SR15[ jj ][ 5 ] = pVideoMemory[ ii + 5 ] ; + pVBInfo->SR15[ jj ][ 6 ] = pVideoMemory[ ii + 6 ] ; + pVBInfo->SR15[ jj ][ 7 ] = pVideoMemory[ ii + 7 ] ; + ii += 0x08 ; + } + ii = 0x110 ; + jj = 0x03 ; + pVBInfo->SR15[ jj ][ 0 ] = pVideoMemory[ ii ] ; /* SR1B */ + pVBInfo->SR15[ jj ][ 1 ] = pVideoMemory[ ii + 1 ] ; + pVBInfo->SR15[ jj ][ 2 ] = pVideoMemory[ ii + 2 ] ; + pVBInfo->SR15[ jj ][ 3 ] = pVideoMemory[ ii + 3 ] ; + pVBInfo->SR15[ jj ][ 4 ] = pVideoMemory[ ii + 4 ] ; + pVBInfo->SR15[ jj ][ 5 ] = pVideoMemory[ ii + 5 ] ; + pVBInfo->SR15[ jj ][ 6 ] = pVideoMemory[ ii + 6 ] ; + pVBInfo->SR15[ jj ][ 7 ] = pVideoMemory[ ii + 7 ] ; + + *pVBInfo->pSR07 = pVideoMemory[ 0x74 ] ; + *pVBInfo->pSR1F = pVideoMemory[ 0x75 ] ; + *pVBInfo->pSR21 = pVideoMemory[ 0x76 ] ; + *pVBInfo->pSR22 = pVideoMemory[ 0x77 ] ; + *pVBInfo->pSR23 = pVideoMemory[ 0x78 ] ; + *pVBInfo->pSR24 = pVideoMemory[ 0x79 ] ; + pVBInfo->SR25[ 0 ] = pVideoMemory[ 0x7A ] ; + *pVBInfo->pSR31 = pVideoMemory[ 0x7B ] ; + *pVBInfo->pSR32 = pVideoMemory[ 0x7C ] ; + *pVBInfo->pSR33 = pVideoMemory[ 0x7D ] ; + ii = 0xF8 ; + + for( jj = 0 ; jj < 3 ; jj++ ) + { + pVBInfo->CR40[ jj ][ 0 ] = pVideoMemory[ ii ] ; + pVBInfo->CR40[ jj ][ 1 ] = pVideoMemory[ ii + 1 ] ; + pVBInfo->CR40[ jj ][ 2 ] = pVideoMemory[ ii + 2 ] ; + pVBInfo->CR40[ jj ][ 3 ] = pVideoMemory[ ii + 3 ] ; + pVBInfo->CR40[ jj ][ 4 ] = pVideoMemory[ ii + 4 ] ; + pVBInfo->CR40[ jj ][ 5 ] = pVideoMemory[ ii + 5 ] ; + pVBInfo->CR40[ jj ][ 6 ] = pVideoMemory[ ii + 6 ] ; + pVBInfo->CR40[ jj ][ 7 ] = pVideoMemory[ ii + 7 ] ; + ii += 0x08 ; + } + + ii = 0x118 ; + for( j = 3 ; j < 24 ; j++ ) + { + pVBInfo->CR40[ j ][ 0 ] = pVideoMemory[ ii ] ; + pVBInfo->CR40[ j ][ 1 ] = pVideoMemory[ ii + 1 ] ; + pVBInfo->CR40[ j ][ 2 ] = pVideoMemory[ ii + 2 ] ; + pVBInfo->CR40[ j ][ 3 ] = pVideoMemory[ ii + 3 ] ; + pVBInfo->CR40[ j ][ 4 ] = pVideoMemory[ ii + 4 ] ; + pVBInfo->CR40[ j ][ 5 ] = pVideoMemory[ ii + 5 ] ; + pVBInfo->CR40[ j ][ 6 ] = pVideoMemory[ ii + 6 ] ; + pVBInfo->CR40[ j ][ 7 ] = pVideoMemory[ ii + 7 ] ; + ii += 0x08 ; + } + + i = pVideoMemory[ 0x1C0 ] | ( pVideoMemory[ 0x1C1 ] << 8 ) ; + + for( j = 0 ; j < 8 ; j++ ) + { + for( k = 0 ; k < 4 ; k++ ) + pVBInfo->CR6B[ j ][ k ] = pVideoMemory[ i + 4 * j + k ] ; + } + + i = pVideoMemory[ 0x1C2 ] | ( pVideoMemory[ 0x1C3 ] << 8 ) ; + + for( j = 0 ; j < 8 ; j++ ) + { + for( k = 0 ; k < 4 ; k++ ) + pVBInfo->CR6E[ j ][ k ] = pVideoMemory[ i + 4 * j + k ] ; + } + + i = pVideoMemory[ 0x1C4 ] | ( pVideoMemory[ 0x1C5 ] << 8 ) ; + for( j = 0 ; j < 8 ; j++ ) + { + for( k = 0 ; k < 32 ; k++ ) + pVBInfo->CR6F[ j ][ k ] = pVideoMemory[ i + 32 * j + k ] ; + } + + i = pVideoMemory[ 0x1C6 ] | ( pVideoMemory[ 0x1C7 ] << 8 ) ; + + for( j = 0 ; j < 8 ; j++ ) + { + for( k = 0 ; k < 2 ; k++ ) + pVBInfo->CR89[ j ][ k ] = pVideoMemory[ i + 2 * j + k ] ; + } + + i = pVideoMemory[ 0x1C8 ] | ( pVideoMemory[ 0x1C9 ] << 8 ) ; + for( j = 0 ; j < 12 ; j++ ) + pVBInfo->AGPReg[ j ] = pVideoMemory[ i + j ] ; + + i = pVideoMemory[ 0x1CF ] | ( pVideoMemory[ 0x1D0 ] << 8 ) ; + for( j = 0 ; j < 4 ; j++ ) + pVBInfo->SR16[ j ] = pVideoMemory[ i + j ] ; + + *pVBInfo->pCRCF = pVideoMemory[ 0x1CA ] ; + *pVBInfo->pXGINew_DRAMTypeDefinition = pVideoMemory[ 0x1CB ] ; + *pVBInfo->pXGINew_I2CDefinition = pVideoMemory[ 0x1D1 ] ; + if ( ChipType == XG20 ) + *pVBInfo->pXGINew_CR97 = pVideoMemory[ 0x1D2 ] ; + } + /* Volari customize data area end */ +} + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DDR1x_MRS_XG20 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_DDR1x_MRS_XG20( USHORT P3c4 , PVB_DEVICE_INFO pVBInfo) +{ + + XGINew_SetReg1( P3c4 , 0x18 , 0x01 ) ; + XGINew_SetReg1( P3c4 , 0x19 , 0x40 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x80 ) ; + XGIDelayUS( 60 ) ; + + XGINew_SetReg1( P3c4 , 0x18 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x19 , 0x40 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x80 ) ; + XGIDelayUS( 60 ) ; + XGINew_SetReg1( P3c4 , 0x18 , pVBInfo->SR15[ 2 ][ XGINew_RAMType ] ) ; /* SR18 */ + /* XGINew_SetReg1( P3c4 , 0x18 , 0x31 ) ; */ + XGINew_SetReg1( P3c4 , 0x19 , 0x01 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x03 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x83 ) ; + XGIDelayUS( 1000 ) ; + XGINew_SetReg1( P3c4 , 0x1B , 0x03 ) ; + XGIDelayUS( 500 ) ; + /* XGINew_SetReg1( P3c4 , 0x18 , 0x31 ) ; */ + XGINew_SetReg1( P3c4 , 0x18 , pVBInfo->SR15[ 2 ][ XGINew_RAMType ] ) ; /* SR18 */ + XGINew_SetReg1( P3c4 , 0x19 , 0x00 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x03 ) ; + XGINew_SetReg1( P3c4 , 0x16 , 0x83 ) ; + XGINew_SetReg1( P3c4 , 0x1B , 0x00 ) ; +} + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SetDRAMModeRegister_XG20 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_SetDRAMModeRegister_XG20( PXGI_HW_DEVICE_INFO HwDeviceExtension ) +{ +/* UCHAR data ; */ + VB_DEVICE_INFO VBINF; + PVB_DEVICE_INFO pVBInfo = &VBINF; + pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; + pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; + pVBInfo->BaseAddr = ( USHORT )HwDeviceExtension->pjIOAddress ; + pVBInfo->ISXPDOS = 0 ; + + pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ; + pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24 ; + pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10 ; + pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e ; + pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12 ; + pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a ; + pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16 ; + pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17 ; + pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18 ; + pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19 ; + pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A ; + pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00 ; + pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04 ; + pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10 ; + pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12 ; + pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 ; + pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2 ; + + XGI_InitTo330Pointer(HwDeviceExtension->jChipType,pVBInfo); + + XGI_ReadVBIOSTablData( HwDeviceExtension->jChipType , pVBInfo) ; + + if ( XGINew_Get340DRAMType( HwDeviceExtension, pVBInfo) == 0 ) + XGINew_DDR1x_MRS_XG20( pVBInfo->P3c4, pVBInfo ) ; + else + XGINew_DDR2x_MRS_340( pVBInfo->P3c4, pVBInfo ) ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x1B , 0x03 ) ; +} + +/* -------------------------------------------------------- */ +/* Function : XGINew_ChkSenseStatus */ +/* Input : */ +/* Output : */ +/* Description : */ +/* -------------------------------------------------------- */ +void XGINew_ChkSenseStatus ( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +{ + USHORT tempbx=0 , temp , tempcx , CR3CData; + + temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x32 ) ; + + if ( temp & Monitor1Sense ) + tempbx |= ActiveCRT1 ; + if ( temp & LCDSense ) + tempbx |= ActiveLCD ; + if ( temp & Monitor2Sense ) + tempbx |= ActiveCRT2 ; + if ( temp & TVSense ) + { + tempbx |= ActiveTV ; + if ( temp & AVIDEOSense ) + tempbx |= ( ActiveAVideo << 8 ); + if ( temp & SVIDEOSense ) + tempbx |= ( ActiveSVideo << 8 ); + if ( temp & SCARTSense ) + tempbx |= ( ActiveSCART << 8 ); + if ( temp & HiTVSense ) + tempbx |= ( ActiveHiTV << 8 ); + if ( temp & YPbPrSense ) + tempbx |= ( ActiveYPbPr << 8 ); + } + + tempcx = XGINew_GetReg1( pVBInfo->P3d4 , 0x3d ) ; + tempcx |= ( XGINew_GetReg1( pVBInfo->P3d4 , 0x3e ) << 8 ) ; + + if ( tempbx & tempcx ) + { + CR3CData = XGINew_GetReg1( pVBInfo->P3d4 , 0x3c ) ; + if ( !( CR3CData & DisplayDeviceFromCMOS ) ) + { + tempcx = 0x1FF0 ; + if ( *pVBInfo->pSoftSetting & ModeSoftSetting ) + { + tempbx = 0x1FF0 ; + } + } + } + else + { + tempcx = 0x1FF0 ; + if ( *pVBInfo->pSoftSetting & ModeSoftSetting ) + { + tempbx = 0x1FF0 ; + } + } + + tempbx &= tempcx ; + XGINew_SetReg1( pVBInfo->P3d4, 0x3d , ( tempbx & 0x00FF ) ) ; + XGINew_SetReg1( pVBInfo->P3d4, 0x3e , ( ( tempbx & 0xFF00 ) >> 8 )) ; +} +/* -------------------------------------------------------- */ +/* Function : XGINew_SetModeScratch */ +/* Input : */ +/* Output : */ +/* Description : */ +/* -------------------------------------------------------- */ +void XGINew_SetModeScratch ( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ) +{ + USHORT temp , tempcl = 0 , tempch = 0 , CR31Data , CR38Data; + + temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x3d ) ; + temp |= XGINew_GetReg1( pVBInfo->P3d4 , 0x3e ) << 8 ; + temp |= ( XGINew_GetReg1( pVBInfo->P3d4 , 0x31 ) & ( DriverMode >> 8) ) << 8 ; + + if ( pVBInfo->IF_DEF_CRT2Monitor == 1) + { + if ( temp & ActiveCRT2 ) + tempcl = SetCRT2ToRAMDAC ; + } + + if ( temp & ActiveLCD ) + { + tempcl |= SetCRT2ToLCD ; + if ( temp & DriverMode ) + { + if ( temp & ActiveTV ) + { + tempch = SetToLCDA | EnableDualEdge ; + temp ^= SetCRT2ToLCD ; + + if ( ( temp >> 8 ) & ActiveAVideo ) + tempcl |= SetCRT2ToAVIDEO ; + if ( ( temp >> 8 ) & ActiveSVideo ) + tempcl |= SetCRT2ToSVIDEO ; + if ( ( temp >> 8 ) & ActiveSCART ) + tempcl |= SetCRT2ToSCART ; + + if ( pVBInfo->IF_DEF_HiVision == 1 ) + { + if ( ( temp >> 8 ) & ActiveHiTV ) + tempcl |= SetCRT2ToHiVisionTV ; + } + + if ( pVBInfo->IF_DEF_YPbPr == 1 ) + { + if ( ( temp >> 8 ) & ActiveYPbPr ) + tempch |= SetYPbPr ; + } + } + } + } + else + { + if ( ( temp >> 8 ) & ActiveAVideo ) + tempcl |= SetCRT2ToAVIDEO ; + if ( ( temp >> 8 ) & ActiveSVideo ) + tempcl |= SetCRT2ToSVIDEO ; + if ( ( temp >> 8 ) & ActiveSCART ) + tempcl |= SetCRT2ToSCART ; + + if ( pVBInfo->IF_DEF_HiVision == 1 ) + { + if ( ( temp >> 8 ) & ActiveHiTV ) + tempcl |= SetCRT2ToHiVisionTV ; + } + + if ( pVBInfo->IF_DEF_YPbPr == 1 ) + { + if ( ( temp >> 8 ) & ActiveYPbPr ) + tempch |= SetYPbPr ; + } + } + + + tempcl |= SetSimuScanMode ; + if ( (!( temp & ActiveCRT1 )) && ( ( temp & ActiveLCD ) || ( temp & ActiveTV ) || ( temp & ActiveCRT2 ) ) ) + tempcl ^= ( SetSimuScanMode | SwitchToCRT2 ) ; + if ( ( temp & ActiveLCD ) && ( temp & ActiveTV ) ) + tempcl ^= ( SetSimuScanMode | SwitchToCRT2 ) ; + XGINew_SetReg1( pVBInfo->P3d4, 0x30 , tempcl ) ; + + CR31Data = XGINew_GetReg1( pVBInfo->P3d4 , 0x31 ) ; + CR31Data &= ~( SetNotSimuMode >> 8 ) ; + if ( !( temp & ActiveCRT1 ) ) + CR31Data |= ( SetNotSimuMode >> 8 ) ; + CR31Data &= ~( DisableCRT2Display >> 8 ) ; + if (!( ( temp & ActiveLCD ) || ( temp & ActiveTV ) || ( temp & ActiveCRT2 ) ) ) + CR31Data |= ( DisableCRT2Display >> 8 ) ; + XGINew_SetReg1( pVBInfo->P3d4, 0x31 , CR31Data ) ; + + CR38Data = XGINew_GetReg1( pVBInfo->P3d4 , 0x38 ) ; + CR38Data &= ~SetYPbPr ; + CR38Data |= tempch ; + XGINew_SetReg1( pVBInfo->P3d4, 0x38 , CR38Data ) ; + +} Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_init.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_init.h:1.1 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_init.h Mon May 2 09:28:02 2005 @@ -0,0 +1,8 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_init.h,v 1.1 2005/05/02 13:28:02 dawes Exp $ */ + +#ifndef _VBINIT_ +#define _VBINIT_ +extern BOOLEAN XGIInitNew( PXGI_HW_DEVICE_INFO HwDeviceExtension ) ; + +#endif + Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_inta.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_inta.c:1.1 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_inta.c Mon May 2 09:28:02 2005 @@ -0,0 +1,1971 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_inta.c,v 1.1 2005/05/02 13:28:02 dawes Exp $ */ + +/* #ifdef WIN2000 // INTA solution for WIN2000 */ + +#include <dderror.h> +#include <devioctl.h> +#include <miniport.h> +#include <ntddvdeo.h> +#include <video.h> + +#include "osdef.h" +#include "vb_def.h" +#include "vgatypes.h" +#include "vb_struct.h" + +#include "xgiv.h" +#include "dd_i2c.h" +#include "tools.h" + +#include "vb_util.h" +#include "vb_setmode.h" + +void SiSLVDSCH7019ControlCallback(PHW_DEVICE_EXTENSION pHWDE,PVOID Context); +void SiSTVCH7019ControlCallback(PHW_DEVICE_EXTENSION pHWDE, PVOID Context); +void XGINew_ExternalToBackup(PHW_DEVICE_EXTENSION pHWDE); +void XGINew_SetReadExternal(PHW_DEVICE_EXTENSION pHWDE); +void XGINew_SetReadInternal(PHW_DEVICE_EXTENSION pHWDE); +void XGINew_DisableWriteBackup(PHW_DEVICE_EXTENSION pHWDE); +void XGINew_EnableWriteBackup(PHW_DEVICE_EXTENSION pHWDE); +void XGINew_TurnOnBacklight(PHW_DEVICE_EXTENSION pHWDE); +int XGINew_WantToSetMode(PHW_DEVICE_EXTENSION pHWDE); +int XGINew_WantToChangeTimingRegister(PHW_DEVICE_EXTENSION pHWDE); +int XGINew_ReSet301VBTiming(PHW_DEVICE_EXTENSION pHWDE, PVB_DEVICE_INFO ); +void XGINew_TurnOffBacklight(PHW_DEVICE_EXTENSION pHWDE); +void XGINew_EnableWriteInternal(PHW_DEVICE_EXTENSION pHWDE); +void XGINew_DisableWriteInternal(PHW_DEVICE_EXTENSION pHWDE); +void XGINew_EnableWriteExternal(PHW_DEVICE_EXTENSION pHWDE); +void XGINew_DisableWriteExternal(PHW_DEVICE_EXTENSION pHWDE); +void XGINew_GRandAR13Changed(PHW_DEVICE_EXTENSION pHWDE); +BOOLEAN XGINew_IsVAMode(PVB_DEVICE_INFO pVBInfo ); +BOOLEAN XGINew_IsDualEdge(PVB_DEVICE_INFO pVBInfo); + + +/* --------------------------------------------------------------------- */ +/* Function : bVBIOSCanWorkWithINTA */ +/* Input : */ +/* Output : */ +/* Description : add INTA 03/18/03 */ +/* --------------------------------------------------------------------- */ +BOOLEAN bVBIOSCanWorkWithINTA(PXGI_HW_DEVICE_INFO pXGIHWDE) +{ + PUCHAR XGI_P3d4; + UCHAR bCR40,bCR41,bCR7D,bCR7E,bCR3A; + UCHAR bSaved3D4; + UCHAR temp; + + XGI_P3d4 = (PUCHAR) (pXGIHWDE->pjIOAddress); + XGI_P3d4 += CRTC_ADDRESS_PORT_COLOR; + + bSaved3D4 = VideoPortReadPortUchar(XGI_P3d4); + + if (pXGIHWDE->jChipType >= XG40) + { + VideoPortWritePortUchar(XGI_P3d4,0x7D); + bCR7D = VideoPortReadPortUchar(XGI_P3d4+1); + VideoPortWritePortUchar(XGI_P3d4,0x7E); + bCR7E = VideoPortReadPortUchar(XGI_P3d4+1); + } + else + { + VideoPortWritePortUchar(XGI_P3d4,0x40); + bCR40 = VideoPortReadPortUchar(XGI_P3d4+1); + VideoPortWritePortUchar(XGI_P3d4,0x41); + bCR41 = VideoPortReadPortUchar(XGI_P3d4+1); + } + VideoPortWritePortUchar(XGI_P3d4,0x3A); + bCR3A = VideoPortReadPortUchar(XGI_P3d4+1); + + VideoPortWritePortUchar(XGI_P3d4, bSaved3D4); + + if(pXGIHWDE->jChipType == SIS_330) + return FALSE; + if(bCR3A & 0x20) /* SMI??? */ + return FALSE; + + if (pXGIHWDE->jChipType >= XG40) + { + if ((bCR7D==0xFE)&&((bCR7E&0x0F)==0x0F)) + { + return TRUE; + } + else + { + return FALSE; + } + } + + if ((bCR40==0xFE)&&((bCR41&0xF0)==0xF0)) + { /* close CRTC */ + if((pXGIHWDE->jChipType == SIS_660)||(pXGIHWDE->jChipType == SIS_661)||(pXGIHWDE->jChipType == SIS_650M)||(pXGIHWDE->jChipType == SIS_760)) + { + VideoPortWritePortUchar(XGI_P3d4,0x51); + temp = VideoPortReadPortUchar(XGI_P3d4+1); + temp = (temp & (~0xE0)|0xA0); + VideoPortWritePortUchar(XGI_P3d4+1,temp); /* set write permitted */ + + VideoPortWritePortUchar(XGI_P3d4,0x56); + temp = VideoPortReadPortUchar(XGI_P3d4+1); + temp = (temp & (~0x18)|0x08); + VideoPortWritePortUchar(XGI_P3d4+1,temp); /* set read permitted */ + + } + return TRUE; + } + else + return FALSE; +} + +/* --------------------------------------------------------------------- */ +/* Function : DisableTimingRegWriteProtectINTA */ +/* Input : */ +/* Output : */ +/* Description : add INTA 03/18/03 */ +/* --------------------------------------------------------------------- */ +VOID DisableTimingRegWriteProtectINTA(PHW_DEVICE_EXTENSION pHWDE) +{ + PUCHAR XGI_P3d4; + UCHAR bCR51,bCR56,bCR61; + UCHAR bSaved3D4; + + XGI_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR; + + bSaved3D4 = VideoPortReadPortUchar(XGI_P3d4); + + VideoPortWritePortUchar(XGI_P3d4,0x61); + bCR61 = VideoPortReadPortUchar(XGI_P3d4+1); + VideoPortWritePortUchar(XGI_P3d4+1,(UCHAR)(bCR61&0xF7)); + + VideoPortWritePortUchar(XGI_P3d4,0x56); + bCR56 = VideoPortReadPortUchar(XGI_P3d4+1); + VideoPortWritePortUchar(XGI_P3d4+1,(UCHAR)(bCR56&0xE7)); + + VideoPortWritePortUchar(XGI_P3d4,0x51); + bCR51 = VideoPortReadPortUchar(XGI_P3d4+1); + VideoPortWritePortUchar(XGI_P3d4+1,(UCHAR)(bCR51&0x1F)); + + VideoPortWritePortUchar(XGI_P3d4, bSaved3D4); +} + +/* --------------------------------------------------------------------- */ +/* Function : EnableTimingRegWriteProtectINTA */ +/* Input : */ +/* Output : */ +/* Description : add INTA 03/18/03 */ +/* --------------------------------------------------------------------- */ +VOID EnableTimingRegWriteProtectINTA(PHW_DEVICE_EXTENSION pHWDE) +{ + + PUCHAR XGI_P3d4; + UCHAR bCR40,bCR41,bCR7D,bCR7E; + UCHAR bCR51,bCR56,bCR61; + UCHAR bSaved3D4; + + XGI_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR; + + bSaved3D4 = VideoPortReadPortUchar(XGI_P3d4); + + if (pHWDE->jChipID >= XG40) + { + VideoPortWritePortUchar(XGI_P3d4,0x7D); + bCR7D = VideoPortReadPortUchar(XGI_P3d4+1); + VideoPortWritePortUchar(XGI_P3d4,0x7E); + bCR7E = VideoPortReadPortUchar(XGI_P3d4+1); + + if ((bCR7D==0x00)&&((bCR7E&0x0F)==0x00)) + { + VideoPortWritePortUchar(XGI_P3d4,0x7D); + VideoPortWritePortUchar(XGI_P3d4+1,0xFF); + VideoPortWritePortUchar(XGI_P3d4,0x7E); + VideoPortWritePortUchar(XGI_P3d4+1,(UCHAR)(VideoPortReadPortUchar(XGI_P3d4+1)|0x0F)); + } + } + else + { + VideoPortWritePortUchar(XGI_P3d4,0x40); + bCR40 = VideoPortReadPortUchar(XGI_P3d4+1); + VideoPortWritePortUchar(XGI_P3d4,0x41); + bCR41 = VideoPortReadPortUchar(XGI_P3d4+1); + + if ((bCR40==0x00)&&((bCR41&0xF0)==0x00)) + { + VideoPortWritePortUchar(XGI_P3d4,0x40); + VideoPortWritePortUchar(XGI_P3d4+1,0xFF); + VideoPortWritePortUchar(XGI_P3d4,0x41); + VideoPortWritePortUchar(XGI_P3d4+1,(UCHAR)(VideoPortReadPortUchar(XGI_P3d4+1)|0xF0)); + } + } + + + VideoPortWritePortUchar(XGI_P3d4,0x61); + bCR61 = VideoPortReadPortUchar(XGI_P3d4+1); + VideoPortWritePortUchar(XGI_P3d4+1,(UCHAR)(bCR61|0x08)); + + VideoPortWritePortUchar(XGI_P3d4,0x56); + bCR56 = VideoPortReadPortUchar(XGI_P3d4+1); + VideoPortWritePortUchar(XGI_P3d4+1,(UCHAR)((bCR56&0xE7)|0x8)); + + VideoPortWritePortUchar(XGI_P3d4,0x51); + bCR51 = VideoPortReadPortUchar(XGI_P3d4+1); + VideoPortWritePortUchar(XGI_P3d4+1,(UCHAR)((bCR51&0x1F)|0xA0)); + + VideoPortWritePortUchar(XGI_P3d4, bSaved3D4); +} + +/* --------------------------------------------------------------------- */ +/* Function : vModifyLCDTiming301LVDS_INTANew */ +/* Input : */ +/* Output : */ +/* Description : add INTA 03/18/03 bainy */ +/* --------------------------------------------------------------------- */ +VOID vModifyLCDTiming301LVDS_INTANew( PHW_DEVICE_EXTENSION pHWDE ) +{ + PUCHAR XGINew_P3c4 , XGINew_P3d4 ; + UCHAR bSaved3C4 , bSaved3D4,temp ; + VB_DEVICE_INFO VBINF; + PVB_DEVICE_INFO pVBInfo = &VBINF; + XGINew_P3c4 = pHWDE->pjIOAddress + SEQ_ADDRESS_PORT ; + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + + VideoDebugPrint( ( 0 , "vModifyLCDTiming301LVDS_INTA: pHWDE->ulMonitorPowerState=%lx\n" , pHWDE->ulMonitorPowerState ) ) ; + VideoDebugPrint( ( 0 , "vModifyLCDTiming301LVDS_INTA: pHWDE->bMonitorPoweredOn=%x\n" , pHWDE->bMonitorPoweredOn ) ) ; + if ( pHWDE->ulMonitorPowerState == VideoPowerHibernate ) + return ; + + if ( !( pHWDE->bMonitorPoweredOn ) ) + return ; + + bSaved3C4 = VideoPortReadPortUchar( XGINew_P3c4 ) ; + bSaved3D4 = VideoPortReadPortUchar( XGINew_P3d4 ) ; + + + if ( XGINew_WantToSetMode( pHWDE ) ) + { + XGI_Newdebugcode( 0x66 ) ; + XGINew_TurnOffBacklight( pHWDE ) ; + XGI_DisplayOff(pVBInfo) ; + pHWDE->bCR34 = 0xFF ; + } + else + { + if ( XGINew_WantToChangeTimingRegister( pHWDE ) ) + { + XGI_Newdebugcode( 0x55 ) ; + XGINew_DisableWriteExternal( pHWDE ) ; + XGINew_EnableWriteInternal( pHWDE ) ; + XGINew_DisableWriteBackup( pHWDE ) ; + XGINew_SetReadInternal( pHWDE ) ; + VideoDebugPrint( ( 0 , "start ModifyLCD: %lx\n" , pHWDE->ulMonitorPowerState ) ) ; + XGINew_ReSet301VBTiming( pHWDE, pVBInfo ) ; + XGI_DisplayOn(pVBInfo) ; /* alan 2003/10/01 */ + XGINew_ExternalToBackup( pHWDE ) ; + XGINew_SetReadExternal( pHWDE ) ; + XGINew_DisableWriteInternal( pHWDE ) ; + XGINew_EnableWriteExternal( pHWDE ) ; + XGINew_DisableWriteBackup( pHWDE ) ; + XGINew_TurnOnBacklight( pHWDE ) ; + } + } + + VideoPortWritePortUchar( XGINew_P3c4 , bSaved3C4 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , bSaved3D4 ) ; + + XGINew_GRandAR13Changed( pHWDE ) ; + + + bSaved3C4 = VideoPortReadPortUchar( XGINew_P3c4) ; + bSaved3D4 = VideoPortReadPortUchar( XGINew_P3d4 ) ; + + VideoPortWritePortUchar( XGINew_P3c4 , bSaved3C4 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , bSaved3D4 ) ; + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyLCDTiming301B_INTANew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyLCDTiming301B_INTANew( PHW_DEVICE_EXTENSION pHWDE ) +{ + PUCHAR XGINew_P3c4 , XGINew_P3d4 ; + UCHAR bSaved3C4 , bSaved3D4,temp ; + VB_DEVICE_INFO VBINF; + PVB_DEVICE_INFO pVBInfo = &VBINF; + XGINew_P3c4 = pHWDE->pjIOAddress + SEQ_ADDRESS_PORT ; + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + + VideoDebugPrint( ( 0 , "vModifyLCDTiming301B_INTANew: pHWDE->ulMonitorPowerState=%lx\n" , pHWDE->ulMonitorPowerState ) ) ; + VideoDebugPrint( ( 0 , "vModifyLCDTiming301B_INTANew: pHWDE->bMonitorPoweredOn=%x\n" , pHWDE->bMonitorPoweredOn ) ) ; + if ( pHWDE->ulMonitorPowerState == VideoPowerHibernate ) + return ; + + if ( !( pHWDE->bMonitorPoweredOn ) ) + return ; + + bSaved3C4 = VideoPortReadPortUchar( XGINew_P3c4) ; + bSaved3D4 = VideoPortReadPortUchar( XGINew_P3d4 ) ; + + + if ( XGINew_WantToSetMode( pHWDE ) ) + { + XGI_Newdebugcode( 0x66 ) ; + XGINew_TurnOffBacklight( pHWDE ) ; + XGI_DisplayOff(pVBInfo) ; + pHWDE->bCR34 = 0xFF ; + } + else + { + if ( XGINew_WantToChangeTimingRegister( pHWDE ) ) + { + XGI_Newdebugcode( 0x55 ) ; + XGINew_DisableWriteExternal( pHWDE ) ; + XGINew_EnableWriteInternal( pHWDE ) ; + XGINew_DisableWriteBackup( pHWDE ) ; + XGINew_SetReadInternal( pHWDE ) ; + VideoDebugPrint( ( 0 , "start ModifyLCD: %lx\n" , pHWDE->ulMonitorPowerState ) ) ; + XGINew_ReSet301VBTiming( pHWDE, pVBInfo ) ; + XGI_DisplayOn(pVBInfo) ; /* alan 2003/10/01 */ + XGINew_ExternalToBackup( pHWDE ) ; + XGINew_SetReadExternal( pHWDE ) ; + XGINew_DisableWriteInternal( pHWDE ) ; + XGINew_EnableWriteExternal( pHWDE ) ; + XGINew_DisableWriteBackup( pHWDE ) ; + XGINew_TurnOnBacklight( pHWDE ) ; + } + } + + VideoPortWritePortUchar( XGINew_P3c4 , bSaved3C4 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , bSaved3D4 ) ; + + XGINew_GRandAR13Changed( pHWDE ) ; + + + bSaved3C4 = VideoPortReadPortUchar( XGINew_P3c4 ) ; + bSaved3D4 = VideoPortReadPortUchar( XGINew_P3d4 ) ; + + VideoPortWritePortUchar( XGINew_P3c4 , bSaved3C4 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , bSaved3D4 ) ; + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyCRT1Timing301LVDS_INTANew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyCRT1Timing301LVDS_INTANew( PHW_DEVICE_EXTENSION pHWDE ) +{ + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyTVTiming301LVDS_INTANew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyTVTiming301LVDS_INTANew( PHW_DEVICE_EXTENSION pHWDE ) +{ + PUCHAR XGINew_P3c4 , XGINew_P3d4 ; + UCHAR bSaved3C4 , bSaved3D4 , temp ; + VB_DEVICE_INFO VBINF; + PVB_DEVICE_INFO pVBInfo = &VBINF; + XGINew_P3c4 = pHWDE->pjIOAddress + SEQ_ADDRESS_PORT ; + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + + VideoDebugPrint( ( 0 , "vModifyTVTiming301LVDS_INTA: pHWDE->ulMonitorPowerState=%lx\n" , pHWDE->ulMonitorPowerState ) ) ; + VideoDebugPrint( ( 0 , "vModifyTVTiming301LVDS_INTA: pHWDE->bMonitorPoweredOn=%x\n" , pHWDE->bMonitorPoweredOn ) ) ; + if ( pHWDE->ulMonitorPowerState == VideoPowerHibernate ) + return ; + + if ( !( pHWDE->bMonitorPoweredOn ) ) + return; + + bSaved3C4 = VideoPortReadPortUchar( XGINew_P3c4 ) ; + bSaved3D4 = VideoPortReadPortUchar( XGINew_P3d4 ) ; + + + if ( XGINew_WantToSetMode( pHWDE ) ) + { + XGI_Newdebugcode( 0x66 ) ; + XGINew_TurnOffBacklight( pHWDE ) ; + XGI_DisplayOff(pVBInfo) ; + pHWDE->bCR34 = 0xFF ; + } + else + { + if ( XGINew_WantToChangeTimingRegister( pHWDE ) ) + { + XGI_Newdebugcode( 0x55 ) ; + XGINew_DisableWriteExternal( pHWDE ) ; + XGINew_EnableWriteInternal( pHWDE ) ; + XGINew_DisableWriteBackup( pHWDE ) ; + XGINew_SetReadInternal( pHWDE ) ; + VideoDebugPrint( ( 0 , "start ModifyLCD: %lx\n" , pHWDE->ulMonitorPowerState ) ) ; + XGINew_ReSet301VBTiming( pHWDE, pVBInfo ) ; + XGI_DisplayOn(pVBInfo) ; /* alan 2003/10/01 */ + XGINew_ExternalToBackup( pHWDE ) ; + XGINew_SetReadExternal( pHWDE ) ; + XGINew_DisableWriteInternal( pHWDE ) ; + XGINew_EnableWriteExternal( pHWDE ) ; + XGINew_DisableWriteBackup( pHWDE ) ; + XGINew_TurnOnBacklight(pHWDE) ; + } + } + + VideoPortWritePortUchar( XGINew_P3c4 , bSaved3C4 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , bSaved3D4 ) ; + + /* XGINew_GRandAR13Changed(pHWDE) ; */ + + bSaved3C4 = VideoPortReadPortUchar( XGINew_P3c4 ) ; + bSaved3D4 = VideoPortReadPortUchar( XGINew_P3d4 ) ; + + VideoPortWritePortUchar( XGINew_P3c4 , bSaved3C4 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , bSaved3D4 ) ; + XGIDelayUS( 1000 ) ; /* for CRT+TV quit debug in winxp dos. */ + + return ; +} + +/* --------------------------------------------------------------------- */ +/* Function : vModifyTVTiming301B_INTANew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyTVTiming301B_INTANew( PHW_DEVICE_EXTENSION pHWDE ) +{ + PUCHAR XGINew_P3c4 , XGINew_P3d4 ; + UCHAR bSaved3C4 , bSaved3D4 , temp ; + VB_DEVICE_INFO VBINF; + PVB_DEVICE_INFO pVBInfo = &VBINF; + XGINew_P3c4 = pHWDE->pjIOAddress + SEQ_ADDRESS_PORT ; + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + + VideoDebugPrint( ( 0 , "vModifyTVTiming301LVDS_INTA: pHWDE->ulMonitorPowerState=%lx\n" , pHWDE->ulMonitorPowerState ) ) ; + VideoDebugPrint( ( 0 , "vModifyTVTiming301LVDS_INTA: pHWDE->bMonitorPoweredOn=%x\n" , pHWDE->bMonitorPoweredOn ) ) ; + if ( pHWDE->ulMonitorPowerState == VideoPowerHibernate ) + return ; + + if ( !( pHWDE->bMonitorPoweredOn ) ) + return; + + bSaved3C4 = VideoPortReadPortUchar( XGINew_P3c4 ) ; + bSaved3D4 = VideoPortReadPortUchar( XGINew_P3d4 ) ; + + + if ( XGINew_WantToSetMode( pHWDE ) ) + { + XGI_Newdebugcode( 0x66 ) ; + XGINew_TurnOffBacklight( pHWDE ) ; + XGI_DisplayOff(pVBInfo) ; + pHWDE->bCR34 = 0xFF ; + } + else + { + if ( XGINew_WantToChangeTimingRegister( pHWDE ) ) + { + XGI_Newdebugcode( 0x55 ) ; + XGINew_DisableWriteExternal( pHWDE ) ; + XGINew_EnableWriteInternal( pHWDE ) ; + XGINew_DisableWriteBackup( pHWDE ) ; + XGINew_SetReadInternal( pHWDE ) ; + VideoDebugPrint( ( 0 , "start ModifyLCD: %lx\n" , pHWDE->ulMonitorPowerState ) ) ; + XGINew_ReSet301VBTiming( pHWDE, pVBInfo ) ; + XGI_DisplayOn(pVBInfo) ; /* alan 2003/10/01 */ + XGINew_ExternalToBackup( pHWDE ) ; + XGINew_SetReadExternal( pHWDE ) ; + XGINew_DisableWriteInternal( pHWDE ) ; + XGINew_EnableWriteExternal( pHWDE ) ; + XGINew_DisableWriteBackup( pHWDE ) ; + XGINew_TurnOnBacklight(pHWDE) ; + } + } + + VideoPortWritePortUchar( XGINew_P3c4 , bSaved3C4 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , bSaved3D4 ) ; + + /* XGINew_GRandAR13Changed(pHWDE) ; */ + + bSaved3C4 = VideoPortReadPortUchar( XGINew_P3c4 ) ; + bSaved3D4 = VideoPortReadPortUchar( XGINew_P3d4 ) ; + + VideoPortWritePortUchar( XGINew_P3c4 , bSaved3C4 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , bSaved3D4 ) ; + XGIDelayUS( 1000 ) ; /* for CRT+TV quit debug in winxp dos. */ + + +} + +/* --------------------------------------------------------------------- */ +/* Function : vModifyLCDTimingLVDSNew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyLCDTimingLVDSNew( PHW_DEVICE_EXTENSION pHWDE ) +{ +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyCRT1TimingLVDSNew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyCRT1TimingLVDSNew( PHW_DEVICE_EXTENSION pHWDE ) +{ +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyCRT1TimingLVDS_INTANew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyCRT1TimingLVDS_INTANew(PHW_DEVICE_EXTENSION pHWDE) +{ + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyLCDTimingLVDS_INTANew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyLCDTimingLVDS_INTANew(PHW_DEVICE_EXTENSION pHWDE) +{ + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyTVTimingLVDS_INTANew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyTVTimingLVDS_INTANew(PHW_DEVICE_EXTENSION pHWDE) +{ + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyCRT1TimingCH7019New */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyCRT1TimingCH7019New(PHW_DEVICE_EXTENSION pHWDE) +{ +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyCRT1TimingCH7019_INTANew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyCRT1TimingCH7019_INTANew(PHW_DEVICE_EXTENSION pHWDE) +{ + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyLCDTimingCH7019_INTANew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyLCDTimingCH7019_INTANew(PHW_DEVICE_EXTENSION pHWDE) +{ + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyLCDTimingCH7019New */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyLCDTimingCH7019New(PHW_DEVICE_EXTENSION pHWDE) +{ + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyTVTimingCH7019_INTANew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyTVTimingCH7019_INTANew(PHW_DEVICE_EXTENSION pHWDE) +{ + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyTVTimingCH7019New */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyTVTimingCH7019New(PHW_DEVICE_EXTENSION pHWDE) +{ + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyLCDTiming301BNew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyLCDTiming301BNew(PHW_DEVICE_EXTENSION pHWDE) +{ + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyCRT1Timing301LVDSNew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyCRT1Timing301LVDSNew(PHW_DEVICE_EXTENSION pHWDE) +{ + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyLCDTiming301LVDSNew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyLCDTiming301LVDSNew(PHW_DEVICE_EXTENSION pHWDE) +{ + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : vModifyTVTiming301LVDSNew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +VOID vModifyTVTiming301LVDSNew(PHW_DEVICE_EXTENSION pHWDE) +{ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_WantToSetMode */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +int XGINew_WantToSetMode(PHW_DEVICE_EXTENSION pHWDE) +{ + PUCHAR XGINew_P3d4 ; + + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x3A ) ; + if ( VideoPortReadPortUchar( XGINew_P3d4 + 1 ) & 8 ) + return( 1 ) ; + else + return( 0 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_WantToChangeTimingRegister */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +int XGINew_WantToChangeTimingRegister(PHW_DEVICE_EXTENSION pHWDE) +{ + PUCHAR XGINew_P3c2 , XGINew_P3cc , XGINew_P3c4 , XGINew_P3d4 , XGINew_P3da , XGINew_P3c0 ; + UCHAR bCR56 ; + UCHAR temp , temp1 ; + UCHAR bCR0 , bCR1 , bCR2 , bCR3 , bCR4 , bCR5 , bCR6 , bCR7 ; + UCHAR bCR9 , bCR10 , bCR11 , bCR12 , bCR13 , bCR15 , bCR16 , bCR34 ; + UCHAR bSR0A , bSR0B , bSR0C ; + /* UCHAR bSR1 ; */ + UCHAR b3CC ; + /* UCHAR bAR13 ; */ + UCHAR Key ; + ULONG VGAHDE0 , VGAVDE0 , VGAHDE1 , VGAVDE1 ; + BOOL bWantToChange = 0 ; + + XGINew_P3c4 = pHWDE->pjIOAddress + SEQ_ADDRESS_PORT ; + XGINew_P3c2 = pHWDE->pjIOAddress + MISC_OUTPUT_REG_WRITE_PORT ; + XGINew_P3cc = pHWDE->pjIOAddress + MISC_OUTPUT_REG_READ_PORT ; + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + XGINew_P3da = pHWDE->pjIOAddress + 0x2A ; + XGINew_P3c0 = pHWDE->pjIOAddress + ATT_ADDRESS_PORT ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + bCR56 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x00 ) ; + bCR0 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x00 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + + if ( ( bCR0 != temp ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + + pHWDE->bCR0 = bCR0 ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x01 ) ; + bCR1 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x01 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + + VGAHDE0 = temp ; + if ( ( bCR1 != temp ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + + pHWDE->bCR1 = bCR1 ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56&0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x02 ) ; + bCR2 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x02 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + + if ( ( bCR2 != temp ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + pHWDE->bCR2 = bCR2 ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x03 ) ; + bCR3 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x03 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + if ( ( ( bCR3 & 0x1F ) != ( temp & 0x1F ) ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + pHWDE->bCR3 = bCR3 ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x04 ) ; + bCR4 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x04 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + if ( ( bCR4 != temp ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + pHWDE->bCR4 = bCR4 ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x05 ) ; + bCR5 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x05 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + if ( ( bCR5 != temp ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + pHWDE->bCR5 = bCR5 ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4+1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x06 ) ; + bCR6 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x06 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + if ( ( bCR6 != temp ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + pHWDE->bCR6 = bCR6 ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x12 ) ; + bCR12 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x012 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VGAVDE0 = temp ; + if ( ( bCR12 != temp ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + pHWDE->bCR12 = bCR12 ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; /* CR13 is not in INTA protect but the hardware do protect */ + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x13 ) ; + bCR13 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x13 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + + if ( bCR13 != temp ) + { + VideoDebugPrint( ( 0 , "modify CR13\n" ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x51 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; /* save cr51 */ + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( 0x60 ) ) ; /* write permitted */ + VideoPortWritePortUchar( XGINew_P3d4 , 0x13 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , bCR13 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x51 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , temp ) ; /* restore cr51 */ + } + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x07 ) ; + bCR7 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x07 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VGAVDE0 |= ( ( temp & 0x02 ) << 7 ) ; + VGAVDE0 |= ( ( temp & 0x40 ) << 3 ) ; + if ( ( ( bCR7 & 0xEF ) != ( temp & 0xEF ) ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + pHWDE->bCR7 = bCR7 ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x09 ) ; + bCR9 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x09 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + if ( ( ( bCR9 & 0x20 ) != ( temp & 0x20 ) ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + pHWDE->bCR9 = bCR9 ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x10 ) ; + bCR10 = VideoPortReadPortUchar(XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x010 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + if ( ( bCR10 != temp ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + pHWDE->bCR10 = bCR10 ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x11 ) ; + bCR11 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x011 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + if ( ( ( bCR11 & 0xF ) != ( temp & 0xF ) ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + pHWDE->bCR11 = bCR11 ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x15 ) ; + bCR15 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x015 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + if ( ( bCR15 != temp ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + + pHWDE->bCR15 = bCR15 ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x16 ) ; + bCR16 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x016 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + if ( ( bCR16!= temp ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + pHWDE->bCR16 = bCR16 ; + + VideoPortWritePortUchar( XGINew_P3c4 , 0x5 ) ; + Key = VideoPortReadPortUchar( XGINew_P3c4 + 1 ) ; + VideoPortWritePortUshort( ( PUSHORT )XGINew_P3c4 , 0x8605 ) ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3c4 , 0x0A ) ; + bSR0A = VideoPortReadPortUchar( XGINew_P3c4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3c4 , 0x0A ) ; + temp = VideoPortReadPortUchar( XGINew_P3c4 + 1 ) ; + VGAVDE0 |= ( (temp & 0x02 ) << 9 ) ; + if ( ( bSR0A != temp ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + pHWDE->bSR0A = bSR0A ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3c4,0x0B ) ; + bSR0B = VideoPortReadPortUchar( XGINew_P3c4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 ,( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3c4 , 0x0B ) ; + temp = VideoPortReadPortUchar( XGINew_P3c4 + 1 ) ; + VGAHDE0 |= ( ( temp & 0x0C ) << 6 ) ; + if ( ( bSR0B!= temp ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + pHWDE->bSR0B = bSR0B ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3c4 , 0x0C ) ; + bSR0C = VideoPortReadPortUchar( XGINew_P3c4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3c4,0x0C); + temp = VideoPortReadPortUchar( XGINew_P3c4 + 1 ) ; + if ( ( bSR0C != temp ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + pHWDE->bSR0C = bSR0C ; + + if ( Key != 0xA1 ) + VideoPortWritePortUshort( ( PUSHORT )XGINew_P3c4 , 0x0005 ) ; + +/* + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + VideoPortWritePortUchar( XGINew_P3c4 , 0x01 ) ; + bSR1 = VideoPortReadPortUchar( XGINew_P3c4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + VideoPortWritePortUchar( XGINew_P3c4 , 0x01 ) ; + temp = VideoPortReadPortUchar( XGINew_P3c4 + 1 ) ; + if( ( bSR1 & 0x01 ) != ( temp & 0x01 ) ) + { + VideoDebugPrint( ( 0 , "modify SR01 %x to %x \n" , temp , bSR1 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x51 ) ; + temp = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; // save cr51 + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( 0x60 ) ) ; //write permitted + VideoPortWritePortUchar( XGINew_P3c4 , 0x01 ) ; + temp1 = VideoPortReadPortUchar( XGINew_P3c4 + 1 ) ; + temp1 = ( ( temp1 & 0xFE ) | ( bSR1 & 0x01) ) ; + VideoPortWritePortUchar( XGINew_P3c4 + 1 , temp1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x51 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , temp ) ; //restore cr51 + } + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; //E + bAR13 = VideoPortReadPortUchar( XGINew_P3da ) ; + VideoPortWritePortUchar( XGINew_P3c0 , 0x33 ) ; + bAR13 = VideoPortReadPortUchar( XGINew_P3c0 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; //I + temp = VideoPortReadPortUchar( XGINew_P3da ) ; + VideoPortWritePortUchar( XGINew_P3c0 , 0x33 ) ; + temp = VideoPortReadPortUchar( XGINew_P3c0 + 1 ) ; + if ( bAR13 != temp ) + { + VideoDebugPrint( ( 0 , "modify AR13 %x to %x\n" , temp , bAR13 ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x51 ) ; + temp1 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; // save cr51 + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( 0x60 ) ) ; //write permitted + bAR13 = VideoPortReadPortUchar( XGINew_P3da ) ; + VideoPortWritePortUchar( XGINew_P3c0 , 0x33 ) ; + VideoPortWritePortUchar( XGINew_P3c0 + 1 , bAR13 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x51 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , temp ) ; //restore cr51 + } +*/ + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + b3CC = VideoPortReadPortUchar( XGINew_P3cc ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x00 ) ) ; + temp = VideoPortReadPortUchar( XGINew_P3cc ) ; + if ( ( ( b3CC & 0x0C ) != ( temp & 0x0C ) ) || ( pHWDE->bCR34 == 0xFF ) ) + { + bWantToChange = 1 ; + } + + pHWDE->b3CC = b3CC ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x34 ) ; + bCR34 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + + bWantToChange = 0 ; /* we hope that change timing as little as possible */ + if ( bCR34!=pHWDE->bCR34 ) + { + bWantToChange = 1 ; + } + + pHWDE->bCR34 = bCR34 ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , bCR56 ) ; + + VGAHDE1 = ( pHWDE->bCR1 ) | ( ( pHWDE->bSR0B & 0x0C ) << 6 ) ; + VGAVDE1 = ( pHWDE->bCR12) | ( ( pHWDE->bCR7 & 0x02 ) << 7 ) | ( ( pHWDE->bCR7 & 0x40 ) << 3 ) | ( ( pHWDE->bSR0A & 0x02 ) << 9 ) ; + + if ( VGAHDE0 != VGAHDE1 ) + { + bWantToChange = 1 ; + } + if (VGAVDE0!=VGAVDE1) + { + bWantToChange = 1 ; + } + + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; + + return( bWantToChange ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SetVBInfobyCR */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGINew_SetVBInfobyCR( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +{ + + UCHAR temp ; + UCHAR bCR30 , bCR31 , ModeNo , bpart1_13 ; + USHORT ModeIdIndex , RefreshRateTableIndex ; + pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; + pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; + pVBInfo->BaseAddr = (USHORT)HwDeviceExtension->pjIOAddress ; + + if ( pVBInfo->FBAddr == 0 ) + return( FALSE ) ; + + if ( pVBInfo->BaseAddr == 0 ) + return( FALSE ) ; + + pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ; + pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24 ; + pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10 ; + pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e ; + pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12 ; + pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a ; + pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16 ; + pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17 ; + pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18 ; + pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19 ; + pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A ; + pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00 ; + pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04 ; + pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10 ; + pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12 ; + pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 ; + pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2 ; + XGI_GetVBType(pVBInfo) ; + XGI_InitTo330Pointer( HwDeviceExtension->jChipType, pVBInfo ) ; + + bCR30 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x30 ) ; + bCR31 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x31 ) ; + + XGI_UnLockCRT2( HwDeviceExtension, pVBInfo) ; + pVBInfo->VBInfo = bCR30 + ( bCR31 << 8 ) ; + + pVBInfo->IF_DEF_LCDA = 1 ; /* alan 09/10/2003 */ + pVBInfo->IF_DEF_LVDS = 0 ; + pVBInfo->IF_DEF_CH7005 = 0 ; + pVBInfo->IF_DEF_HiVision = 0 ; +/* pVBInfo->IF_DEF_FSTN = 0 ; */ + pVBInfo->IF_DEF_YPbPr = 0 ; + + ModeNo = (UCHAR)XGINew_GetReg1( pVBInfo->P3d4 , 0x34 ) ; + temp = XGI_SearchModeID( ModeNo , &ModeIdIndex, pVBInfo ) ; /* 2.Get ModeID Table */ + if ( temp == 0 ) + return( 0 ) ; + XGI_GetVGAType( HwDeviceExtension, pVBInfo ) ; /* alan 09/12/2003 */ + XGI_GetVBType( pVBInfo ) ; /* alan 09/12/2003 */ + XGI_GetVBInfo( ModeNo , ModeIdIndex , HwDeviceExtension, pVBInfo ) ; + XGI_GetTVInfo( ModeNo , ModeIdIndex, pVBInfo ) ; + XGI_GetLCDInfo( ModeNo , ModeIdIndex, pVBInfo ) ; + + return( 1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_ModLCDALockMode */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_ModLCDALockMode( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex , + PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT HDE,USHORT VDE ) +{ + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_IsVAMode */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGINew_IsVAMode( PVB_DEVICE_INFO pVBInfo ) +{ + USHORT flag ; + + flag = XGINew_GetReg1( pVBInfo->P3d4 , 0x38 ) ; + +#ifdef XGI315H + if ( ( flag & EnableDualEdge ) && ( flag & SetToLCDA ) ) + return( 0 ) ; + else + return( 1 ) ; +#endif + return( 1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_IsDualEdge */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGINew_IsDualEdge( PVB_DEVICE_INFO pVBInfo ) +{ + USHORT flag ; + +#ifdef XGI315H + flag = XGINew_GetReg1( pVBInfo->P3d4 , 0x38 ) ; + if ( flag & EnableDualEdge ) + return( 0 ) ; + else + return( 1 ) ; +#endif + return( 1 ) ; +} + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_ReSet301VBTiming */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +int XGINew_ReSet301VBTiming( PHW_DEVICE_EXTENSION pHWDE, PVB_DEVICE_INFO pVBInfo ) +{ + BOOLEAN bReturn , bCHA ; + UCHAR ModeNo , temp , bCR12 , bCR39 , Part1_13 ; + USHORT HDE , VDE ; + USHORT ModeIdIndex , RefreshRateTableIndex ; + + PXGI_HW_DEVICE_INFO HwDeviceExtension = pHWDE->pXGIHWDE ; + pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; + pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; + pVBInfo->BaseAddr = ( USHORT )HwDeviceExtension->pjIOAddress ; + +#ifdef WIN2000 + pVBInfo->ISXPDOS = 1 ; +#endif + bReturn = XGINew_SetVBInfobyCR( HwDeviceExtension,pVBInfo ) ; + if ( bReturn == 0 ) + return( ERROR_INVALID_PARAMETER ) ; + + bCR39 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x39 ) ; + ModeNo = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x34 ) ; + bCR12 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x12 ) ; + Part1_13 = ( UCHAR )XGINew_GetReg1( pVBInfo->Part1Port , 0x13 ) ; + bCHA = Part1_13 & 0x04; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x05 , 0x86 ) ; + + /* alan reset vb */ + if(pVBInfo->VBInfo & SetCRT2ToTV ) + { + temp = XGI_SearchModeID( ModeNo , &ModeIdIndex, pVBInfo ) ; + if ( temp != 0 ) + { + RefreshRateTableIndex = XGI_GetRatePtrCRT2( ModeNo , ModeIdIndex, pVBInfo ) ; + if ( RefreshRateTableIndex != 0xFFFF ) + { + XGINew_SetRegANDOR(pVBInfo->P3c4,0x06,~0x020,0x00); + XGI_SetCRT1Offset( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; + } + bReturn = XGI_SetCRT2Group301( ModeNo , HwDeviceExtension, pVBInfo ) ; /* add for CRT2 */ + XGI_SetCRT2ModeRegs( ModeNo , HwDeviceExtension, pVBInfo ) ; + XGI_EnableBridge( HwDeviceExtension, pVBInfo ) ; + if ( bCR12 == 0xDA ) + { + XGINew_SetReg1( pVBInfo->Part1Port , 0x2F , 0x01 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0E , bCR12 ) ; + } + } + } + else /* lcd */ + { + if ( !XGINew_IsDualEdge( pVBInfo ) ) + { + if ( !XGINew_IsVAMode(pVBInfo) ) + temp = 0x7F ; + else + temp = 0xBF ; + } + else + { + temp = 0x3F ; + } + XGINew_SetRegAND ( pVBInfo->Part4Port , 0x1F , temp ) ; + + HDE = 1024 ; + VDE = 768 ; + + switch( pVBInfo->LCDResInfo ) + { + case 0: + HDE = 1024 ; + VDE=768 ; + if( !bCHA ) + { + temp = XGI_SearchModeID( ModeNo , &ModeIdIndex , pVBInfo) ; + if ( temp != 0 ) + { + RefreshRateTableIndex = XGI_GetRatePtrCRT2( ModeNo , ModeIdIndex, pVBInfo ) ; + if ( RefreshRateTableIndex != 0xFFFF ) + { + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x06 , ~0x020 , 0x00 ) ; + XGI_SetCRT1Offset( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; + } + bReturn = XGI_SetCRT2Group301( ModeNo , HwDeviceExtension, pVBInfo ) ; /*add for CRT2 */ + XGI_SetCRT2ModeRegs( ModeNo , HwDeviceExtension, pVBInfo ) ; + XGI_EnableBridge( HwDeviceExtension, pVBInfo ) ; + if ( bCR12 == 0xDA ) + { + XGINew_SetReg1( pVBInfo->Part1Port , 0x2F , 0x01 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0E , bCR12 ) ; + } + } + } + break ; + + case 1: + HDE = 800 ; + VDE = 600 ; + break ; + + case 2: + HDE = 1024 ; + VDE = 768 ; + if( !bCHA ) + { + temp = XGI_SearchModeID( ModeNo , &ModeIdIndex, pVBInfo ) ; /* 2.Get ModeID Table */ + if ( temp != 0 ) + { + RefreshRateTableIndex = XGI_GetRatePtrCRT2( ModeNo , ModeIdIndex, pVBInfo ) ; + if ( RefreshRateTableIndex != 0xFFFF ) + { + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x06 , ~0x020 , 0x00 ) ; + XGI_SetCRT1Offset( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; + } + bReturn = XGI_SetCRT2Group301( ModeNo , HwDeviceExtension, pVBInfo ) ; /* add for CRT2 */ + XGI_SetCRT2ModeRegs( ModeNo , HwDeviceExtension, pVBInfo ) ; + XGI_EnableBridge( HwDeviceExtension, pVBInfo ) ; + if ( bCR12 == 0xDA ) + { + XGINew_SetReg1( pVBInfo->Part1Port , 0x2F , 0x01 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0E , bCR12 ) ; + } + } + } + break ; + + case 3: + HDE = 1280 ; + VDE = 1024 ; + XGINew_SetReg1(pVBInfo->P3d4 , 0x39 , ( UCHAR )( bCR39 | 0x04 ) ) ; + /* pVBInfo->VBInfo = XGINew_VBInfo | SetCRT2ToLCDA ; // alan 09/12/2003 */ + temp = XGI_SearchModeID( ModeNo , &ModeIdIndex, pVBInfo ) ; /* 2.Get ModeID Table */ + if ( temp != 0 ) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x2B , pHWDE->bSR2B ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2C , pHWDE->bSR2C ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2D , 0x01 ) ; + RefreshRateTableIndex = XGI_GetRatePtrCRT2( ModeNo , ModeIdIndex, pVBInfo ) ; + if ( RefreshRateTableIndex != 0xFFFF ) + { + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x06 , ~0x020 , 0x00 ) ; + XGI_SetCRT1Offset( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; + } + if (pVBInfo->VBInfo & SetCRT2ToLCDA) /* alan 09/12/2003 */ + { + XGI_SetLCDAGroup( ModeNo , ModeIdIndex , HwDeviceExtension, pVBInfo ) ; + if ( bCR12 == 0xDA ) + XGINew_SetReg1( pVBInfo->P3d4 , 0x12 , bCR12 ) ; + } + else + { + bReturn = XGI_SetCRT2Group301( ModeNo , HwDeviceExtension, pVBInfo ) ; /* add for CRT2 */ + XGI_SetCRT2ModeRegs( ModeNo , HwDeviceExtension, pVBInfo ) ; + XGI_EnableBridge( HwDeviceExtension, pVBInfo ) ; + if ( bCR12 == 0xDA ) + { + XGINew_SetReg1( pVBInfo->Part1Port , 0x2F , 0x01 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0E , bCR12 ) ; + } + } + + bReturn = 1 ; + } + else + bReturn = 0 ; + break ; + + case 4: + break ; + case 5: + break ; + case 6: + break ; + case 7: + break ; + case 8: + break ; + + case 9: + HDE = 1400 ; + VDE = 1050 ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x39 , ( UCHAR )( bCR39 | 0x04 ) ) ; + /* if ( HwDeviceExtension->jChipType == SIS_650M ) */ + /* XGINew_1400x1050Des_2 = ( XGI_LVDSDesStruct * )XGI651_1400x1050Des_2 ; */ + pVBInfo->VBInfo |= SetCRT2ToLCDA ; + temp = XGI_SearchModeID( ModeNo , &ModeIdIndex, pVBInfo ) ; /* 2.Get ModeID Table */ + if ( temp != 0 ) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x2B , pHWDE->bSR2B ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2C , pHWDE->bSR2C ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2D , 0x01 ) ; + RefreshRateTableIndex = XGI_GetRatePtrCRT2( ModeNo , ModeIdIndex, pVBInfo ) ; + if ( RefreshRateTableIndex != 0xFFFF ) + { + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x06 , ~0x020 , 0x00 ) ; + XGI_SetCRT1Offset( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; + } + XGI_SetLCDAGroup( ModeNo , ModeIdIndex , HwDeviceExtension, pVBInfo ) ; + if ( bCR12 == 0xDA ) + XGINew_SetReg1( pVBInfo->P3d4 , 0x12 , bCR12 ) ; + bReturn = 1 ; + } + else + bReturn = 0; + /* XGINew_SetReg1( pVBInfo->P3d4 , 0x39 , ( UCHAR )( bCR39 | 0x04 ) ) ; */ + break ; + + case 10: + HDE = 1280 ; + VDE = 768 ; + pVBInfo->VBInfo |= SetCRT2ToLCDA ; + temp = XGI_SearchModeID( ModeNo , &ModeIdIndex, pVBInfo ) ; /* 2.Get ModeID Table */ + if ( temp != 0 ) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x2B , pHWDE->bSR2B ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2C , pHWDE->bSR2C ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2D , 0x01 ) ; + RefreshRateTableIndex = XGI_GetRatePtrCRT2( ModeNo , ModeIdIndex, pVBInfo ) ; + if ( RefreshRateTableIndex != 0xFFFF ) + { + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x06 , ~0x020 , 0x00 ) ; + XGI_SetCRT1Offset( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; + } + XGI_SetLCDAGroup( ModeNo , ModeIdIndex , HwDeviceExtension, pVBInfo ) ; + if ( bCR12 == 0xDA ) + XGINew_SetReg1( pVBInfo->P3d4 , 0x12 , bCR12 ) ; + + bReturn = 1 ; + } + else + bReturn = 0 ; + + break ; + + case 11: + HDE = 1600 ; + VDE = 1200 ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x39 , ( UCHAR )( bCR39 | 0x04 ) ) ; + temp = XGI_SearchModeID( ModeNo , &ModeIdIndex, pVBInfo ) ; /* 2.Get ModeID Table */ + if ( temp != 0 ) + { + RefreshRateTableIndex = XGI_GetRatePtrCRT2( ModeNo , ModeIdIndex, pVBInfo ) ; + if ( RefreshRateTableIndex != 0xFFFF ) + { + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x06 , ~0x020 , 0x00 ) ; + XGI_SetCRT1Offset( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; + } + bReturn = XGI_SetCRT2Group301(ModeNo , HwDeviceExtension, pVBInfo ) ; /* add for CRT2 */ + XGI_SetCRT2ModeRegs( ModeNo , HwDeviceExtension, pVBInfo ) ; + XGI_EnableBridge( HwDeviceExtension, pVBInfo ) ; + if ( bCR12 == 0xDA ) + { + XGINew_SetReg1( pVBInfo->Part1Port , 0x2F , 0x01 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0E , bCR12 ) ; + } + } + break ; + + default: + break ; + } + + /* alan reset vb */ + + if ( !XGINew_IsDualEdge( pVBInfo ) ) + { + if ( !XGINew_IsVAMode( pVBInfo) ) + temp = 0x80 ; + else + temp = 0x40 ; + } + else + { + temp = 0xC0 ; + } + } + + XGINew_SetRegOR( pVBInfo->Part4Port , 0x1F , temp ) ; + + if ( bReturn == 0 ) + return( ERROR_INVALID_PARAMETER ) ; + else + return( 1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_TurnOffBacklight */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_TurnOffBacklight( PHW_DEVICE_EXTENSION pHWDE ) +{ + VIDEO_X86_BIOS_ARGUMENTS BIOSArguments ; + ULONG ultemp ; + PUCHAR pjCRTAddrPort , pjSeqAddrPort , pjCRT2Part1Port , pjCRT2Part4Port ; + VP_STATUS VPStatus ; + + pjCRTAddrPort = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + pjSeqAddrPort = pHWDE->pjIOAddress + SEQ_ADDRESS_PORT ; + pjCRT2Part1Port = pHWDE->pjIOAddress + VB_PART1_OFFSET_04 ; + pjCRT2Part4Port = pHWDE->pjIOAddress + VB_PART4_OFFSET_14 ; + + /* Turn-off LVDS panel backlight */ + if ( pHWDE->ulDispActualState & MASK_OUTPUTSTATE_LCD ) + { + switch( pHWDE->bHasVB ) + { + case VB2_301: + switch( pHWDE->ujVBRevID ) + { + case 0xd0: /* 301LV */ + case 0xd1: + case 0xe0: /* 302LV */ + case 0xe1: + ExtPortSet( pjCRT2Part4Port , 0x26 , 0xFE , 0 ) ; + break ; + + default: + break ; + } + break ; + + case VB_LVDS: /* External LVDS chip */ + ExtPortSet( pjSeqAddrPort , IND_SR11_DDC_REG , 0xF7 , 0x08 ) ; + break ; + + case VB2_Chrontel: /* Chrontel LVDS */ + VideoPortZeroMemory( &BIOSArguments , sizeof( VIDEO_X86_BIOS_ARGUMENTS ) ) ; + BIOSArguments.Eax = 0x140B; + BIOSArguments.Ebx = 0x01; + /* VPStatus = VideoPortInt10( pHWDE , &BIOSArguments ) ; */ + break ; + + default: + break ; + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_TurnOnBacklight */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_TurnOnBacklight( PHW_DEVICE_EXTENSION pHWDE ) +{ + VIDEO_X86_BIOS_ARGUMENTS BIOSArguments ; + ULONG ultemp ; + PUCHAR pjCRTAddrPort , pjSeqAddrPort , pjCRT2Part1Port , pjCRT2Part4Port ; + VP_STATUS VPStatus ; + + pjCRTAddrPort = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + pjSeqAddrPort = pHWDE->pjIOAddress + SEQ_ADDRESS_PORT ; + pjCRT2Part1Port = pHWDE->pjIOAddress + VB_PART1_OFFSET_04 ; + pjCRT2Part4Port = pHWDE->pjIOAddress + VB_PART4_OFFSET_14 ; + + if ( pHWDE->bMonitorPoweredOn ) + { + /* Turn-on LVDS panel backlight */ + if ( pHWDE->ulDispActualState & MASK_OUTPUTSTATE_LCD ) + { + switch (pHWDE->bHasVB) + { + case VB2_301: + switch( pHWDE->ujVBRevID ) + { + case 0xd0: /* 301LV */ + case 0xd1: + case 0xe0: /* 302LV */ + case 0xe1: + for( ultemp = 0 ; ultemp < 0x10000 ; ultemp++ ) + { + ExtPortIn( pjSeqAddrPort , 0x05 ) ; + } + ExtPortSet( pjCRT2Part4Port , 0x26 , 0xFF , 0x01 ) ; + break ; + + default: + break ; + } + break; + + case VB_LVDS: /* External LVDS chip */ + ExtPortSet( pjSeqAddrPort , IND_SR11_DDC_REG , 0xF7 , 0x00 ) ; + break ; + + case VB2_Chrontel: /* Chrontel LVDS */ + VideoPortZeroMemory(&BIOSArguments, sizeof( VIDEO_X86_BIOS_ARGUMENTS ) ) ; + BIOSArguments.Eax = 0x140B ; + BIOSArguments.Ebx = 0x0 ; + /* VPStatus = VideoPortInt10( pHWDE , &BIOSArguments ) ; */ + break ; + + default: + break ; + } + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_EnableWriteInternal */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_EnableWriteInternal( PHW_DEVICE_EXTENSION pHWDE ) +{ + PUCHAR XGINew_P3d4 ; + UCHAR bCR51 , bCR56 ; + + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x51 ) ; + bCR51 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( bCR51 & 0x7F ) ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DisableWriteInternal */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_DisableWriteInternal( PHW_DEVICE_EXTENSION pHWDE ) +{ + PUCHAR XGINew_P3d4 ; + UCHAR bCR51 , bCR56 ; + + + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x51 ) ; + bCR51 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( bCR51 | 0x80 ) ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_EnableWriteExternal */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_EnableWriteExternal( PHW_DEVICE_EXTENSION pHWDE ) +{ + PUCHAR XGINew_P3c2 , XGINew_P3cc , XGINew_P3c4 , XGINew_P3d4 ; + UCHAR bCR51 , bCR56 ; + + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x51 ) ; + bCR51 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( bCR51 & 0xBF ) ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DisableWriteExternal */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_DisableWriteExternal( PHW_DEVICE_EXTENSION pHWDE ) +{ + PUCHAR XGINew_P3c2 , XGINew_P3cc , XGINew_P3c4 , XGINew_P3d4 ; + UCHAR bCR51 , bCR56 ; + + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x51 ) ; + bCR51 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( bCR51 | 0x40 ) ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_EnableWriteBackup */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_EnableWriteBackup( PHW_DEVICE_EXTENSION pHWDE ) +{ + PUCHAR XGINew_P3d4 ; + UCHAR bCR51 , bCR56 ; + + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x51 ) ; + bCR51 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( bCR51 & 0xDF ) ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_DisableWriteBackup */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_DisableWriteBackup( PHW_DEVICE_EXTENSION pHWDE ) +{ + PUCHAR XGINew_P3d4 ; + UCHAR bCR51 , bCR56 ; + + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x51 ) ; + bCR51 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( bCR51 | 0x20 ) ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_SetReadInternal */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_SetReadInternal( PHW_DEVICE_EXTENSION pHWDE ) +{ + PUCHAR XGINew_P3d4 ; + UCHAR bCR51 , bCR56 ; + + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + bCR56 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( bCR56 & 0xE7 ) ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_SetReadExternal( PHW_DEVICE_EXTENSION pHWDE ) +{ + PUCHAR XGINew_P3d4 ; + UCHAR bCR51 , bCR56 ; + + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + bCR56 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x08 ) ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_ExternalToBackup */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_ExternalToBackup( PHW_DEVICE_EXTENSION pHWDE ) +{ + PUCHAR XGINew_P3c2 , XGINew_P3cc , XGINew_P3c4 , XGINew_P3d4 ; + UCHAR bCR56 , bCR51 ; + UCHAR temp ; + UCHAR bCR0 , bCR1 , bCR2 , bCR3 , bCR4 , bCR5 , bCR6 , bCR7 ; + UCHAR bCR9 , bCR10 , bCR11 , bCR12 , bCR15 , bCR16 , bCR34 ; + UCHAR bSR0A , bSR0B , bSR0C ; + UCHAR bSR1 ; + UCHAR b3CC ; + UCHAR Key ; + + XGINew_P3c4 = pHWDE->pjIOAddress + SEQ_ADDRESS_PORT ; + XGINew_P3c2 = pHWDE->pjIOAddress + MISC_OUTPUT_REG_WRITE_PORT ; + XGINew_P3cc = pHWDE->pjIOAddress + MISC_OUTPUT_REG_READ_PORT ; + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + bCR56 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR56 & 0xE7 ) | 0x10 ) ) ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x51 ) ; + bCR51 = VideoPortReadPortUchar( XGINew_P3d4 + 1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( bCR51 & 0xDF ) | 0xC0 ) ) ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x34 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , pHWDE->bCR34 ) ; + + VideoPortWritePortUchar( XGINew_P3d4 ,0x11); + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( VideoPortReadPortUchar( XGINew_P3d4 + 1 ) & 0x7F ) ) ) ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x0 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , pHWDE->bCR0 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , pHWDE->bCR1 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x2 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , pHWDE->bCR2 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x3 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , pHWDE->bCR3 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x4 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , pHWDE->bCR4 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x5 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , pHWDE->bCR5 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x6 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , pHWDE->bCR6 ) ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x7 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( VideoPortReadPortUchar( XGINew_P3d4 + 1 ) & 0x10 ) | ( ( pHWDE->bCR7 ) & 0xEF ) ) ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x9 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( VideoPortReadPortUchar( XGINew_P3d4 + 1 ) & 0x5F ) | ( ( pHWDE->bCR9 ) & 0xA0 ) ) ) ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x10 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , pHWDE->bCR10 ) ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x11 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , ( UCHAR )( ( VideoPortReadPortUchar( XGINew_P3d4 + 1 ) & 0xF0 ) | ( ( pHWDE->bCR11 ) & 0x0F ) ) ) ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x12 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , pHWDE->bCR12 ) ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x15 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , pHWDE->bCR15 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x16 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , pHWDE->bCR16 ) ; + + + VideoPortWritePortUchar( XGINew_P3c2 , ( UCHAR )( ( VideoPortReadPortUchar( XGINew_P3cc ) & 0x33 ) | ( ( pHWDE->b3CC ) & 0xCC ) ) ) ; + + VideoPortWritePortUchar( XGINew_P3c4 , 0x5 ) ; + Key = VideoPortReadPortUchar( XGINew_P3c4 + 1 ) ; + VideoPortWritePortUshort( ( PUSHORT )XGINew_P3c4 , 0x8605 ) ; + + VideoPortWritePortUchar( XGINew_P3c4 , 0x0A ) ; + VideoPortWritePortUchar( XGINew_P3c4 + 1 , pHWDE->bSR0A ) ; + VideoPortWritePortUchar( XGINew_P3c4 , 0x0B ) ; + VideoPortWritePortUchar( XGINew_P3c4 + 1 , pHWDE->bSR0B ) ; + VideoPortWritePortUchar( XGINew_P3c4 , 0x0C ) ; + VideoPortWritePortUchar( XGINew_P3c4 + 1 , ( UCHAR )( ( VideoPortReadPortUchar( XGINew_P3c4 + 1 ) & 0xF8 ) | ( ( pHWDE->bSR0C ) & 0x07 ) ) ) ; + + if ( Key != 0xA1 ) + VideoPortWritePortUshort( ( PUSHORT )XGINew_P3c4 , 0x0005 ) ; + + VideoPortWritePortUchar( XGINew_P3d4 , 0x51 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , bCR51 ) ; + VideoPortWritePortUchar( XGINew_P3d4 , 0x56 ) ; + VideoPortWritePortUchar( XGINew_P3d4 + 1 , bCR56 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_GRandAR13Changed */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_GRandAR13Changed(PHW_DEVICE_EXTENSION pHWDE ) +{ + PUCHAR XGINew_P3ce , XGINew_P3da , XGINew_P3c0 , XGINew_P3d4 , XGINew_P3c4 ; + UCHAR AR13 , GR6 , ModeNo , GRdata , temp , SRdata ; + USHORT ModeIdIndex , i , modeflag , index ; + BOOL bTimingChanged = 0 ; + +/* + PXGI_HW_DEVICE_INFO HwDeviceExtension = pHWDE->pXGIHWDE; + PUCHAR pVBInfo->ROMAddr = (ULONG)HwDeviceExtension->pjVirtualRomBase; + + XGINew_SModeIDTable = (XGI_StStruct *) XGI310_SModeIDTable; + XGINew_StandTable = (XGI_StandTableStruct *) XGI310_StandTable; + XGINew_EModeIDTable = (XGI_ExtStruct *) XGI310_EModeIDTable; + + XGINew_P3ce = pHWDE->pjIOAddress + GRAPH_ADDRESS_PORT; + XGINew_P3da = pHWDE->pjIOAddress + 0x2A; + XGINew_P3c0 = pHWDE->pjIOAddress + ATT_ADDRESS_PORT; + XGINew_P3c4 = pHWDE->pjIOAddress + SEQ_ADDRESS_PORT; + XGINew_P3d4 = pHWDE->pjIOAddress + CRTC_ADDRESS_PORT_COLOR; + + VideoPortWritePortUchar(XGINew_P3d4,0x34); + ModeNo = VideoPortReadPortUchar(XGINew_P3d4+1); + temp = XGI_SearchModeID(pVBInfo->ROMAddr,ModeNo,&ModeIdIndex, pVBInfo); + if(temp!=0) + { + if (ModeNo<=0x13) + { + index = XGINew_SModeIDTable[ModeIdIndex].St_StTableIndex; + modeflag = XGINew_SModeIDTable[ModeIdIndex].St_ModeFlag; + modeflag = modeflag&ModeInfoFlag; + } + else + { + modeflag = XGINew_EModeIDTable[ModeIdIndex].Ext_ModeFlag; + modeflag = modeflag&ModeInfoFlag; + if ( modeflag <= 0x02 ) + index=0x1B; + else + index=0x0F; + } + VideoPortWritePortUchar(XGINew_P3ce,0x06); + GR6 = VideoPortReadPortUchar(XGINew_P3ce+1); + GRdata = XGINew_StandTable[index].GRC[6]; + + if ( GR6 != GRdata ) + { + for(i=0;i<=0x08;i++) + { + GRdata = XGINew_StandTable[index].GRC[i]; + VideoPortWritePortUchar(XGINew_P3ce,(UCHAR)i); + VideoPortWritePortUchar(XGINew_P3ce+1,GRdata); + } + if(modeflag>ModeVGA) + { + VideoPortWritePortUchar(XGINew_P3ce,0x05); + GRdata = VideoPortReadPortUchar(XGINew_P3ce+1); + GRdata = GRdata&0xBF; + VideoPortWritePortUchar(XGINew_P3ce+1,GRdata); + } + + for(i=02;i<=04;i++) + { + SRdata=XGINew_StandTable[index].SR[i-1]; + VideoPortWritePortUchar(XGINew_P3c4,(UCHAR)i); + VideoPortWritePortUchar(XGINew_P3c4+1,SRdata); + } + } + } + + if(pHWDE->bAR13==0) + { + AR13 = VideoPortReadPortUchar(XGINew_P3da); + VideoPortWritePortUchar(XGINew_P3c0,0x33); + AR13 = VideoPortReadPortUchar(XGINew_P3c0+1); + if (AR13!=0) + { + AR13 = VideoPortReadPortUchar(XGINew_P3da); + VideoPortWritePortUchar(XGINew_P3c0,0x33); + VideoPortWritePortUchar(XGINew_P3c0,0x00); + } + } +*/ +} + +/* #endif WIN2000 INTA solution for WIN2000 */ Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_inta.h diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_inta.h:1.1 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_inta.h Mon May 2 09:28:02 2005 @@ -0,0 +1,25 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_inta.h,v 1.1 2005/05/02 13:28:02 dawes Exp $ */ + +#ifndef _VBINTA_ +#define _VBINTA_ + +extern void SiSLVDSCH7019ControlCallback(PHW_DEVICE_EXTENSION pHWDE,PVOID Context); +extern void SiSTVCH7019ControlCallback(PHW_DEVICE_EXTENSION pHWDE, PVOID Context); +extern void XGINew_ExternalToBackup(PHW_DEVICE_EXTENSION pHWDE); +extern void XGINew_SetReadExternal(PHW_DEVICE_EXTENSION pHWDE); +extern void XGINew_SetReadInternal(PHW_DEVICE_EXTENSION pHWDE); +extern void XGINew_DisableWriteBackup(PHW_DEVICE_EXTENSION pHWDE); +extern void XGINew_EnableWriteBackup(PHW_DEVICE_EXTENSION pHWDE); +extern void XGINew_TurnOnBacklight(PHW_DEVICE_EXTENSION pHWDE); +extern int XGINew_WantToSetMode(PHW_DEVICE_EXTENSION pHWDE); +extern int XGINew_WantToChangeTimingRegister(PHW_DEVICE_EXTENSION pHWDE); +extern int XGINew_ReSet301VBTiming(PHW_DEVICE_EXTENSION pHWDE); +extern void XGINew_TurnOffBacklight(PHW_DEVICE_EXTENSION pHWDE); +extern void XGINew_EnableWriteInternal(PHW_DEVICE_EXTENSION pHWDE); +extern void XGINew_DisableWriteInternal(PHW_DEVICE_EXTENSION pHWDE); +extern void XGINew_EnableWriteExternal(PHW_DEVICE_EXTENSION pHWDE); +extern void XGINew_DisableWriteExternal(PHW_DEVICE_EXTENSION pHWDE); +extern void XGINew_GRandAR13Changed(PHW_DEVICE_EXTENSION pHWDE); +extern BOOLEAN XGINew_IsVAMode(PVB_DEVICE_INFO pVBInfo); + +#endif Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_release.txt diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_release.txt:1.1 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_release.txt Mon May 2 09:28:02 2005 @@ -0,0 +1,47 @@ +[2004/08/18] +1. Merge XG20 and XG4x C Code + +[2004/08/20] +1. Code modify : Add CR97 in header and reference DDR/DDR2x according to this byte +2. Dram Size setting from the data which read from VBIOS + +[2004/08/20] XG42 by Hsuan +1. Add auto over driver in XG42. +2. When MCLK=207MHz, ECLK=207 or 250MHz, SR32 D[1:0] set 10b. + +[2004/9/03] XG42 by Vicent +1. New Feature: #41, XG42 solve 32-bit boot to Widnows hang issue + - Modify: vb_init.c + Modify XG42 SR1F, SR31, SR32, and SR33 for HW request. + +[2004/09/08] XG42 by Hsuan +1. Feature Modify: Modify XGINew DDR2x default registers. (XG42 #473, #488) + - Modify: vb_init.c + Modify CR82, CR85, CR86, CR98 in XG42. + +[2004/09/08] XG4x by Vicent +1. Feature Modify: Add ReadVBIOSTablData function in XGINew_SetDRAMModeRegister340. (XG42 #473, #488) + - Modify: vb_init.c + Add ReadVBIOSTablData function in XGINew_SetDRAMModeRegister340. + +[2004/09/15] XG20 by kuku +1. Feature Modify: To set CR51, CR52 value for XG20 + - Modify: vb_setmode.c + In XGI_SetCRT1ModeRegs() , set CR51=0x02 and CR52=0x33 when driver mode , CR52=0x73 when dos mode for XG20 + +[2004/09/16] XG4X by Hsuan +1. Bug Fixed: #524 Multi adapter dos full screen sometimes, CRT have green screen. + - Modify: vb_setmode.c + In XGI_SetCRT1ModeRegs(), it can't set SR3F D[7:6] = 00b. + The DPMS is handled by 2D. + +[2004/10/01] XG42 by kuku +1. Bug Fixed: #530 [32-32] Enable "Overscan" and do Dos prompt switch, the screen shift + - Modify: xgiv.h, vb,c, tv301.c + In xgiv.h add globel parameter. When enable "Overscan" , parameter will be "1" + And lTVPosTempShift will be "0" +2. Move down the screen and change mode to another mode, the display is not default(The screen move up). + The solution is the same as above. + + +$XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_release.txt,v 1.1 2005/05/02 13:28:02 dawes Exp $ Index: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_setmode.c diff -u /dev/null xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_setmode.c:1.2 --- /dev/null Tue May 9 21:57:01 2006 +++ xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_setmode.c Mon Jun 6 21:33:39 2005 @@ -0,0 +1,9173 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/xgi/vb_setmode.c,v 1.2 2005/06/07 01:33:39 tsi Exp $ */ + +#include "osdef.h" + +#ifdef TC +#include <stdio.h> +#include <string.h> +#include <conio.h> +#include <dos.h> +#endif + + +#ifdef LINUX_XF86 +#include "xf86.h" +#include "xf86PciInfo.h" +#include "xgi.h" +#include "xgi_regs.h" +#endif + +#ifdef LINUX_KERNEL +#include <asm/io.h> +#include <linux/types.h> +#include <linux/version.h> +#include "XGIfb.h" +/*#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) +#include <video/XGIfb.h> +#else +#include <linux/XGIfb.h> +#endif*/ +#endif + +#ifdef WIN2000 +#include <dderror.h> +#include <devioctl.h> +#include <miniport.h> +#include <ntddvdeo.h> +#include <video.h> + +#include "xgiv.h" +#include "dd_i2c.h" +#include "tools.h" +#endif + +#include "vb_def.h" +#include "vgatypes.h" +#include "vb_struct.h" +#include "vb_util.h" +#include "vb_table.h" +#include "vb_setmode.h" + + + +#define IndexMask 0xff +#ifndef XGI_MASK_DUAL_CHIP +#define XGI_MASK_DUAL_CHIP 0x04 /* SR3A */ +#endif + + +BOOLEAN XGI_IsLCDDualLink(PVB_DEVICE_INFO pVBInfo); +BOOLEAN XGI_BacklightByDrv(PVB_DEVICE_INFO pVBInfo); + +BOOLEAN XGI_IsLCDON(PVB_DEVICE_INFO pVBInfo); +BOOLEAN XGI_DisableChISLCD(PVB_DEVICE_INFO pVBInfo); +BOOLEAN XGI_EnableChISLCD(PVB_DEVICE_INFO pVBInfo); +BOOLEAN XGI_AjustCRT2Rate(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,USHORT *i, PVB_DEVICE_INFO pVBInfo); +UCHAR XGI_GetModePtr( USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo); +USHORT XGI_GetOffset(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo); +USHORT XGI_GetResInfo(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); +USHORT XGI_GetColorDepth(USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo); +USHORT XGI_GetVGAHT2(PVB_DEVICE_INFO pVBInfo); +USHORT XGI_GetVCLK2Ptr(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo); +void XGI_VBLongWait(PVB_DEVICE_INFO pVBInfo); +void XGI_SaveCRT2Info(USHORT ModeNo, PVB_DEVICE_INFO pVBInfo); +void XGI_GetCRT2Data(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_GetCRT2ResInfo(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_PreSetGroup1(USHORT ModeNo,USHORT ModeIdIndex, PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_SetGroup1(USHORT ModeNo,USHORT ModeIdIndex, PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_SetLockRegs(USHORT ModeNo,USHORT ModeIdIndex, PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_SetLCDRegs(USHORT ModeNo,USHORT ModeIdIndex, PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_SetGroup2(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo); +void XGI_SetGroup3(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_SetGroup4(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo); +void XGI_SetGroup5(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); +void* XGI_GetLcdPtr(USHORT BX, USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); +void* XGI_GetTVPtr(USHORT BX, USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_FirePWDEnable(PVB_DEVICE_INFO pVBInfo); +void XGI_EnableGatingCRT(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo); +void XGI_DisableGatingCRT(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo); +void XGI_SetPanelDelay(USHORT tempbl, PVB_DEVICE_INFO pVBInfo); +void XGI_SetPanelPower(USHORT tempah,USHORT tempbl, PVB_DEVICE_INFO pVBInfo); +void XGI_EnablePWD( PVB_DEVICE_INFO pVBInfo); +void XGI_DisablePWD( PVB_DEVICE_INFO pVBInfo); +void XGI_AutoThreshold( PVB_DEVICE_INFO pVBInfo); +void XGI_SetTap4Regs( PVB_DEVICE_INFO pVBInfo); +static void SetDualChipRegs(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO pVBInfo); +void XGI_SetCRT1Group(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo); +void XGI_SetSeqRegs(USHORT ModeNo,USHORT StandTableIndex,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo); +void XGI_SetMiscRegs(USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_SetCRTCRegs(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_SetATTRegs(USHORT ModeNo,USHORT StandTableIndex,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo ); +void XGI_SetGRCRegs(USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_ClearExt1Regs(PVB_DEVICE_INFO pVBInfo); + +void XGI_SetSync(USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo); +void XGI_SetCRT1CRTC(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo,PXGI_HW_DEVICE_INFO HwDeviceExtension); +void XGI_SetCRT1Timing_H(PVB_DEVICE_INFO pVBInfo,PXGI_HW_DEVICE_INFO HwDeviceExtension); +void XGI_SetCRT1Timing_V(USHORT ModeIdIndex,USHORT ModeNo,PVB_DEVICE_INFO pVBInfo); +void XGI_SetCRT1DE(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo); +void XGI_SetCRT1VCLK(USHORT ModeNo,USHORT ModeIdIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_SetCRT1FIFO(USHORT ModeNo,PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo); +void XGI_SetCRT1ModeRegs(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo); +void XGI_SetVCLKState(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo,USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo); + +void XGI_LoadDAC(USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo); +void XGI_WriteDAC(USHORT dl, USHORT ah, USHORT al, USHORT dh, PVB_DEVICE_INFO pVBInfo); +void XGI_ClearBuffer(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo,PVB_DEVICE_INFO pVBInfo); +void XGI_GetLVDSResInfo( USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo); +void XGI_GetLVDSData(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo); +void XGI_ModCRT1Regs(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo); +void XGI_SetLVDSRegs(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo); +void XGI_UpdateModeInfo(PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo); +void XGI_SetCRT2ECLK( USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo); +void XGI_GetLCDSync(USHORT* HSyncWidth, USHORT* VSyncWidth, PVB_DEVICE_INFO pVBInfo); +void XGI_SetCRT2VCLK(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_OEM310Setting(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_SetDelayComp(PVB_DEVICE_INFO pVBInfo); +void XGI_SetLCDCap(PVB_DEVICE_INFO pVBInfo); +void XGI_SetLCDCap_A(USHORT tempcx,PVB_DEVICE_INFO pVBInfo); +void XGI_SetLCDCap_B(USHORT tempcx,PVB_DEVICE_INFO pVBInfo); +static void SetSpectrum(PVB_DEVICE_INFO pVBInfo); +void XGI_SetAntiFlicker(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_SetEdgeEnhance(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_SetPhaseIncr(PVB_DEVICE_INFO pVBInfo); +void XGI_SetYFilter(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_GetTVPtrIndex2(USHORT* tempbx,UCHAR* tempcl,UCHAR* tempch, PVB_DEVICE_INFO pVBInfo); +USHORT XGI_GetTVPtrIndex( PVB_DEVICE_INFO pVBInfo ); +void XGI_CloseCRTC(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO pVBInfo); +void XGI_OpenCRTC(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO pVBInfo); +void XGI_GetRAMDAC2DATA(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); +void XGINew_EnableCRT2(PVB_DEVICE_INFO pVBInfo); +void XGINew_LCD_Wait_Time(UCHAR DelayTime, PVB_DEVICE_INFO pVBInfo); +void XGI_GetLCDVCLKPtr(UCHAR* di_0,UCHAR *di_1, PVB_DEVICE_INFO pVBInfo); +UCHAR XGI_GetVCLKPtr(USHORT RefreshRateTableIndex,USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); +void XGI_GetVCLKLen(UCHAR tempal,UCHAR* di_0,UCHAR* di_1, PVB_DEVICE_INFO pVBInfo); +USHORT XGI_GetLCDCapPtr(PVB_DEVICE_INFO pVBInfo); +USHORT XGI_GetLCDCapPtr1(PVB_DEVICE_INFO pVBInfo); +XGI301C_Tap4TimingStruct* XGI_GetTap4Ptr(USHORT tempcx, PVB_DEVICE_INFO pVBInfo); + + + + +/* USHORT XGINew_flag_clearbuffer; 0: no clear frame buffer 1:clear frame buffer */ + + + + + +static USHORT XGINew_MDA_DAC[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, + 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, + 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, + 0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15, + 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F}; + +static USHORT XGINew_CGA_DAC[]={0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, + 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, + 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F, + 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F, + 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, + 0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, + 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F, + 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F}; + +static USHORT XGINew_EGA_DAC[]={0x00,0x10,0x04,0x14,0x01,0x11,0x05,0x15, + 0x20,0x30,0x24,0x34,0x21,0x31,0x25,0x35, + 0x08,0x18,0x0C,0x1C,0x09,0x19,0x0D,0x1D, + 0x28,0x38,0x2C,0x3C,0x29,0x39,0x2D,0x3D, + 0x02,0x12,0x06,0x16,0x03,0x13,0x07,0x17, + 0x22,0x32,0x26,0x36,0x23,0x33,0x27,0x37, + 0x0A,0x1A,0x0E,0x1E,0x0B,0x1B,0x0F,0x1F, + 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F}; + +static USHORT XGINew_VGA_DAC[]={0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15, + 0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F, + 0x00,0x05,0x08,0x0B,0x0E,0x11,0x14,0x18, + 0x1C,0x20,0x24,0x28,0x2D,0x32,0x38,0x3F, + + 0x00,0x10,0x1F,0x2F,0x3F,0x1F,0x27,0x2F, + 0x37,0x3F,0x2D,0x31,0x36,0x3A,0x3F,0x00, + 0x07,0x0E,0x15,0x1C,0x0E,0x11,0x15,0x18, + 0x1C,0x14,0x16,0x18,0x1A,0x1C,0x00,0x04, + 0x08,0x0C,0x10,0x08,0x0A,0x0C,0x0E,0x10, + 0x0B,0x0C,0x0D,0x0F,0x10}; + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_InitTo330Pointer */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_InitTo330Pointer( UCHAR ChipType ,PVB_DEVICE_INFO pVBInfo) +{ + pVBInfo->SModeIDTable = (XGI_StStruct *) XGI330_SModeIDTable ; + pVBInfo->StandTable = (XGI_StandTableStruct *) XGI330_StandTable ; + pVBInfo->EModeIDTable = (XGI_ExtStruct *) XGI330_EModeIDTable ; + pVBInfo->RefIndex = (XGI_Ext2Struct *) XGI330_RefIndex ; + pVBInfo->XGINEWUB_CRT1Table = (XGI_CRT1TableStruct *) XGI_CRT1Table ; + + /* add for new UNIVGABIOS */ + /* XGINew_UBLCDDataTable = (XGI_LCDDataTablStruct *) XGI_LCDDataTable ; */ + /* XGINew_UBTVDataTable = (XGI_TVDataTablStruct *) XGI_TVDataTable ; */ + + + if ( ChipType >= XG40 ) + { + pVBInfo->MCLKData = (XGI_MCLKDataStruct *) XGI340New_MCLKData ; + pVBInfo->ECLKData = (XGI_ECLKDataStruct *) XGI340_ECLKData ; + } + else + { + pVBInfo->MCLKData = (XGI_MCLKDataStruct *) XGI330New_MCLKData ; + pVBInfo->ECLKData = (XGI_ECLKDataStruct *) XGI330_ECLKData ; + } + + pVBInfo->VCLKData = (XGI_VCLKDataStruct *) XGI_VCLKData ; + pVBInfo->VBVCLKData = (XGI_VBVCLKDataStruct *) XGI_VBVCLKData ; + pVBInfo->ScreenOffset = XGI330_ScreenOffset ; + pVBInfo->StResInfo = (XGI_StResInfoStruct *) XGI330_StResInfo ; + pVBInfo->ModeResInfo = (XGI_ModeResInfoStruct *) XGI330_ModeResInfo ; + + pVBInfo->pOutputSelect = &XGI330_OutputSelect ; + pVBInfo->pSoftSetting = &XGI330_SoftSetting ; + pVBInfo->pSR07 = &XGI330_SR07 ; + pVBInfo->LCDResInfo = 0 ; + pVBInfo->LCDTypeInfo = 0 ; + pVBInfo->LCDInfo = 0 ; + pVBInfo->VBInfo = 0 ; + pVBInfo->TVInfo = 0; + + + pVBInfo->SR15 = XGI340_SR13 ; + pVBInfo->CR40 = XGI340_cr41 ; + pVBInfo->SR25 = XGI330_sr25 ; + pVBInfo->pSR31 = &XGI330_sr31 ; + pVBInfo->pSR32 = &XGI330_sr32 ; + pVBInfo->CR6B = XGI340_CR6B ; + pVBInfo->CR6E = XGI340_CR6E ; + pVBInfo->CR6F = XGI340_CR6F ; + pVBInfo->CR89 = XGI340_CR89 ; + pVBInfo->AGPReg = XGI340_AGPReg ; + pVBInfo->SR16 = XGI340_SR16 ; + pVBInfo->pCRCF = &XG40_CRCF ; + pVBInfo->pXGINew_DRAMTypeDefinition = &XG40_DRAMTypeDefinition ; + + + pVBInfo->CR49 = XGI330_CR49 ; + pVBInfo->pSR1F = &XGI330_SR1F ; + pVBInfo->pSR21 = &XGI330_SR21 ; + pVBInfo->pSR22 = &XGI330_SR22 ; + pVBInfo->pSR23 = &XGI330_SR23 ; + pVBInfo->pSR24 = &XGI330_SR24 ; + pVBInfo->pSR33 = &XGI330_SR33 ; + + + + pVBInfo->pCRT2Data_1_2 = &XGI330_CRT2Data_1_2 ; + pVBInfo->pCRT2Data_4_D = &XGI330_CRT2Data_4_D ; + pVBInfo->pCRT2Data_4_E = &XGI330_CRT2Data_4_E ; + pVBInfo->pCRT2Data_4_10 = &XGI330_CRT2Data_4_10 ; + pVBInfo->pRGBSenseData = &XGI330_RGBSenseData ; + pVBInfo->pVideoSenseData = &XGI330_VideoSenseData ; + pVBInfo->pYCSenseData = &XGI330_YCSenseData ; + pVBInfo->pRGBSenseData2 = &XGI330_RGBSenseData2 ; + pVBInfo->pVideoSenseData2 = &XGI330_VideoSenseData2 ; + pVBInfo->pYCSenseData2 = &XGI330_YCSenseData2 ; + + pVBInfo->NTSCTiming = XGI330_NTSCTiming ; + pVBInfo->PALTiming = XGI330_PALTiming ; + pVBInfo->HiTVExtTiming = XGI330_HiTVExtTiming ; + pVBInfo->HiTVSt1Timing = XGI330_HiTVSt1Timing ; + pVBInfo->HiTVSt2Timing = XGI330_HiTVSt2Timing ; + pVBInfo->HiTVTextTiming = XGI330_HiTVTextTiming ; + pVBInfo->YPbPr750pTiming = XGI330_YPbPr750pTiming ; + pVBInfo->YPbPr525pTiming = XGI330_YPbPr525pTiming ; + pVBInfo->YPbPr525iTiming = XGI330_YPbPr525iTiming ; + pVBInfo->HiTVGroup3Data = XGI330_HiTVGroup3Data ; + pVBInfo->HiTVGroup3Simu = XGI330_HiTVGroup3Simu ; + pVBInfo->HiTVGroup3Text = XGI330_HiTVGroup3Text ; + pVBInfo->Ren525pGroup3 = XGI330_Ren525pGroup3 ; + pVBInfo->Ren750pGroup3 = XGI330_Ren750pGroup3 ; + + + pVBInfo->TimingH = (XGI_TimingHStruct *) XGI_TimingH ; + pVBInfo->TimingV = (XGI_TimingVStruct *) XGI_TimingV ; + + pVBInfo->CHTVVCLKUNTSC = XGI330_CHTVVCLKUNTSC ; + pVBInfo->CHTVVCLKONTSC = XGI330_CHTVVCLKONTSC ; + pVBInfo->CHTVVCLKUPAL = XGI330_CHTVVCLKUPAL ; + pVBInfo->CHTVVCLKOPAL = XGI330_CHTVVCLKOPAL ; + + /* 310 customization related */ + if ( ( pVBInfo->VBType & VB_XGI301LV ) || ( pVBInfo->VBType & VB_XGI302LV ) ) + pVBInfo->LCDCapList = XGI_LCDDLCapList ; + else + pVBInfo->LCDCapList = XGI_LCDCapList ; + + pVBInfo->XGI_TVDelayList = XGI301TVDelayList ; + pVBInfo->XGI_TVDelayList2 = XGI301TVDelayList2 ; + + + pVBInfo->pXGINew_I2CDefinition = &XG40_I2CDefinition ; + + if ( ChipType == XG20 ) + pVBInfo->pXGINew_CR97 = &XG20_CR97 ; +} + + + + + + +/* --------------------------------------------------------------------- */ +/* Function : XGISetModeNew */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGISetModeNew( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo ) +{ +/* ULONG temp ; */ + USHORT ModeIdIndex ; + /* PUCHAR pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; */ + VB_DEVICE_INFO VBINF; + PVB_DEVICE_INFO pVBInfo = &VBINF; + pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; + pVBInfo->BaseAddr = ( USHORT )HwDeviceExtension->pjIOAddress ; + pVBInfo->IF_DEF_LVDS = 0 ; + pVBInfo->IF_DEF_CH7005 = 0 ; + pVBInfo->IF_DEF_LCDA = 1 ; + pVBInfo->IF_DEF_CH7017 = 0 ; + pVBInfo->IF_DEF_VideoCapture = 0 ; + pVBInfo->IF_DEF_ScaleLCD = 0 ; + pVBInfo->IF_DEF_OEMUtil = 0 ; + pVBInfo->IF_DEF_PWD = 0 ; + + + if ( HwDeviceExtension->jChipType == XG20 ) /* kuku 2004/06/25 */ + { + pVBInfo->IF_DEF_YPbPr = 0 ; + pVBInfo->IF_DEF_HiVision = 0 ; + pVBInfo->IF_DEF_CRT2Monitor = 0 ; + } + else if ( HwDeviceExtension->jChipType >= XG40 ) + { + pVBInfo->IF_DEF_YPbPr = 1 ; + pVBInfo->IF_DEF_HiVision = 1 ; + pVBInfo->IF_DEF_CRT2Monitor = 1 ; + } + else + { + pVBInfo->IF_DEF_YPbPr = 1 ; + pVBInfo->IF_DEF_HiVision = 1 ; + pVBInfo->IF_DEF_CRT2Monitor = 0 ; + } + + pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ; + pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24 ; + pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10 ; + pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e ; + pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12 ; + pVBInfo->P3cc = pVBInfo->BaseAddr + 0x1C ; + pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a ; + pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16 ; + pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17 ; + pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18 ; + pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19 ; + pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A ; + pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00 ; + pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04 ; + pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10 ; + pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12 ; + pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 ; + pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2 ; + + if ( HwDeviceExtension->jChipType != XG20 ) /* kuku 2004/06/25 */ + XGI_GetVBType( pVBInfo ) ; + + XGI_InitTo330Pointer( HwDeviceExtension->jChipType, pVBInfo ) ; + + if ( ModeNo & 0x80 ) + { + ModeNo = ModeNo & 0x7F ; +/* XGINew_flag_clearbuffer = 0 ; */ + } +/* else + { + XGINew_flag_clearbuffer = 1 ; + } +*/ + XGINew_SetReg1( pVBInfo->P3c4 , 0x05 , 0x86 ) ; + + if ( HwDeviceExtension->jChipType != XG20 ) /* kuku 2004/06/25 1.Openkey */ + XGI_UnLockCRT2( HwDeviceExtension , pVBInfo ) ; + + XGI_SearchModeID( ModeNo , &ModeIdIndex, pVBInfo ) ; + + XGI_GetVGAType(HwDeviceExtension, pVBInfo) ; + if ( HwDeviceExtension->jChipType != XG20 ) /* kuku 2004/06/25 */ + { + XGI_GetVBInfo(ModeNo , ModeIdIndex , HwDeviceExtension, pVBInfo ) ; + XGI_GetTVInfo(ModeNo , ModeIdIndex, pVBInfo ) ; + XGI_GetLCDInfo(ModeNo , ModeIdIndex, pVBInfo ) ; + XGI_DisableBridge( HwDeviceExtension,pVBInfo ) ; +/* XGI_OpenCRTC( HwDeviceExtension, pVBInfo ) ; */ + + if ( pVBInfo->VBInfo & ( SetSimuScanMode | SetCRT2ToLCDA ) ) + { + XGI_SetCRT1Group(HwDeviceExtension , ModeNo , ModeIdIndex, pVBInfo ) ; + + if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) + { + XGI_SetLCDAGroup(ModeNo , ModeIdIndex , HwDeviceExtension, pVBInfo ) ; + } + } + else + { + if ( !( pVBInfo->VBInfo & SwitchToCRT2) ) + { + XGI_SetCRT1Group( HwDeviceExtension , ModeNo , ModeIdIndex, pVBInfo ) ; + if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) + { + XGI_SetLCDAGroup( ModeNo , ModeIdIndex , HwDeviceExtension, pVBInfo ) ; + } + } + } + + if ( pVBInfo->VBInfo & ( SetSimuScanMode | SwitchToCRT2 ) ) + { + switch( HwDeviceExtension->ujVBChipID ) + { + case VB_CHIP_301: + XGI_SetCRT2Group301( ModeNo , HwDeviceExtension, pVBInfo ) ; /*add for CRT2 */ + break ; + + case VB_CHIP_302: + XGI_SetCRT2Group301(ModeNo , HwDeviceExtension, pVBInfo ) ; /*add for CRT2 */ + break ; + + default: + break ; + } + } + + XGI_SetCRT2ModeRegs( ModeNo, HwDeviceExtension,pVBInfo ) ; + XGI_OEM310Setting( ModeNo, ModeIdIndex,pVBInfo ) ; /*0212*/ + XGI_CloseCRTC( HwDeviceExtension, pVBInfo ) ; + XGI_EnableBridge( HwDeviceExtension ,pVBInfo) ; + } /* !XG20 */ + else + { + if ( ModeNo <= 0x13 ) + { + pVBInfo->ModeType = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag & ModeInfoFlag; + } + else + { + pVBInfo->ModeType = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag & ModeInfoFlag; + } + pVBInfo->SetFlag = 0 ; + pVBInfo->VBInfo = DisableCRT2Display ; + XGI_DisplayOff(pVBInfo) ; + XGI_SetCRT1Group(HwDeviceExtension , ModeNo , ModeIdIndex, pVBInfo ) ; + XGI_DisplayOn(pVBInfo) ; + } + +/* + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + } + pVBInfo->ModeType = modeflag&ModeInfoFlag ; + pVBInfo->SetFlag = 0x00 ; + pVBInfo->VBInfo = DisableCRT2Display ; + temp = XGINew_CheckMemorySize( HwDeviceExtension , ModeNo , ModeIdIndex, pVBInfo ) ; + + if ( temp == 0 ) + return( 0 ) ; + + XGI_DisplayOff( pVBInfo) ; + XGI_SetCRT1Group( HwDeviceExtension , ModeNo , ModeIdIndex, pVBInfo ) ; + XGI_DisplayOn( pVBInfo) ; +*/ + + XGI_UpdateModeInfo( HwDeviceExtension, pVBInfo ) ; + + if ( HwDeviceExtension->jChipType != XG20 ) /* kuku 2004/06/25 */ + XGI_LockCRT2( HwDeviceExtension, pVBInfo ) ; + + return( TRUE ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT1Group */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetCRT1Group( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT StandTableIndex , + RefreshRateTableIndex , + b3CC , + temp ; + + USHORT XGINew_P3cc = pVBInfo->P3cc; + /* XGINew_P3c2 = pVBInfo->P3c2; */ + + /* XGINew_CRT1Mode = ModeNo ; // SaveModeID */ + StandTableIndex = XGI_GetModePtr( ModeNo , ModeIdIndex, pVBInfo ) ; + /* XGI_SetBIOSData(ModeNo , ModeIdIndex ) ; */ + /* XGI_ClearBankRegs( ModeNo , ModeIdIndex ) ; */ + XGI_SetSeqRegs( ModeNo , StandTableIndex , ModeIdIndex, pVBInfo ) ; + XGI_SetMiscRegs( StandTableIndex, pVBInfo ) ; + XGI_SetCRTCRegs( HwDeviceExtension , StandTableIndex, pVBInfo) ; + XGI_SetATTRegs( ModeNo , StandTableIndex , ModeIdIndex, pVBInfo ) ; + XGI_SetGRCRegs( StandTableIndex, pVBInfo ) ; + XGI_ClearExt1Regs(pVBInfo) ; + +/* if ( pVBInfo->IF_DEF_ExpLink ) */ +/* XGI_SetDefaultVCLK() ; */ + + temp = ~ProgrammingCRT2 ; + pVBInfo->SetFlag &= temp ; + pVBInfo->SelectCRT2Rate = 0 ; + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + if ( pVBInfo->VBInfo & ( SetSimuScanMode | SetCRT2ToLCDA | SetInSlaveMode ) ) + { + pVBInfo->SetFlag |= ProgrammingCRT2 ; + } + } + + RefreshRateTableIndex = XGI_GetRatePtrCRT2( ModeNo , ModeIdIndex, pVBInfo ) ; + + if ( RefreshRateTableIndex != 0xFFFF ) + { + XGI_SetSync( RefreshRateTableIndex, pVBInfo ) ; + XGI_SetCRT1CRTC( ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo, HwDeviceExtension ) ; + XGI_SetCRT1DE( HwDeviceExtension , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + XGI_SetCRT1Offset( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; + XGI_SetCRT1VCLK( ModeNo , ModeIdIndex , HwDeviceExtension , RefreshRateTableIndex, pVBInfo ) ; + } + + if ( HwDeviceExtension->jChipType == XG20 ) + { + if ( ( ModeNo == 0x00 ) | (ModeNo == 0x01) ) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x2B , 0x4E) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2C , 0xE9) ; + b3CC =(UCHAR) XGINew_GetReg2(XGINew_P3cc) ; + XGINew_SetReg3(XGINew_P3cc , (b3CC |= 0x0C) ) ; + } + else if ( ( ModeNo == 0x04) | ( ModeNo == 0x05) | ( ModeNo == 0x0D) ) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x2B , 0x1B) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2C , 0xE3) ; + b3CC = (UCHAR)XGINew_GetReg2(XGINew_P3cc) ; + XGINew_SetReg3(XGINew_P3cc , (b3CC |= 0x0C) ) ; + } + } + + pVBInfo->SetFlag &= ( ~ProgrammingCRT2 ) ; + XGI_SetCRT1FIFO( ModeNo , HwDeviceExtension, pVBInfo ) ; + XGI_SetCRT1ModeRegs( HwDeviceExtension , ModeNo , ModeIdIndex , RefreshRateTableIndex , pVBInfo) ; + + if ( HwDeviceExtension->jChipType == XG40 ) /* Copy reg settings to 2nd chip */ + { + if ( XGI_CheckDualChip( pVBInfo) ) + SetDualChipRegs( HwDeviceExtension, pVBInfo ) ; + } + + /* XGI_LoadCharacter(); //dif ifdef TVFont */ + + XGI_LoadDAC( ModeNo , ModeIdIndex, pVBInfo ) ; + XGI_ClearBuffer( HwDeviceExtension , ModeNo, pVBInfo ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetModePtr */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +UCHAR XGI_GetModePtr( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR index ; + + if ( ModeNo <= 0x13 ) + index = pVBInfo->SModeIDTable[ ModeIdIndex ].St_StTableIndex ; + else + { + if ( pVBInfo->ModeType <= 0x02 ) + index = 0x1B ; /* 02 -> ModeEGA */ + else + index = 0x0F ; + } + return( index ) ; /* Get pVBInfo->StandTable index */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetBIOSData */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +/*UCHAR XGI_SetBIOSData( USHORT ModeNo , USHORT ModeIdIndex ) +{ + return( 0 ) ; +} +*/ + +/* --------------------------------------------------------------------- */ +/* Function : XGI_ClearBankRegs */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +/*UCHAR XGI_ClearBankRegs( USHORT ModeNo , USHORT ModeIdIndex ) +{ + return( 0 ) ; +} +*/ + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetSeqRegs */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetSeqRegs( USHORT ModeNo , USHORT StandTableIndex , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR tempah , + SRdata ; + + USHORT i ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x00 , 0x03 ) ; /* Set SR0 */ + tempah=pVBInfo->StandTable[ StandTableIndex ].SR[ 0 ] ; + + i = SetCRT2ToLCDA ; + if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) + { + tempah |= 0x01 ; + } + else + { + if ( pVBInfo->VBInfo & ( SetCRT2ToTV | SetCRT2ToLCD ) ) + { + if ( pVBInfo->VBInfo & SetInSlaveMode ) + tempah |= 0x01 ; + } + } + + tempah |= 0x20 ; /* screen off */ + XGINew_SetReg1( pVBInfo->P3c4 , 0x01 , tempah ) ; /* Set SR1 */ + + for( i = 02 ; i <= 04 ; i++ ) + { + SRdata = pVBInfo->StandTable[ StandTableIndex ].SR[ i - 1 ] ; /* Get SR2,3,4 from file */ + XGINew_SetReg1( pVBInfo->P3c4 , i , SRdata ) ; /* Set SR2 3 4 */ + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetMiscRegs */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetMiscRegs( USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR Miscdata ; + + Miscdata = pVBInfo->StandTable[ StandTableIndex ].MISC ; /* Get Misc from file */ +/* + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) + { + Miscdata |= 0x0C ; + } + } +*/ + + XGINew_SetReg3( pVBInfo->P3c2 , Miscdata ) ; /* Set Misc(3c2) */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRTCRegs */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetCRTCRegs( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR CRTCdata ; + USHORT i ; + + CRTCdata = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x11 ) ; + CRTCdata &= 0x7f ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x11 , CRTCdata ) ; /* Unlock CRTC */ + + for( i = 0 ; i <= 0x18 ; i++ ) + { + CRTCdata = pVBInfo->StandTable[ StandTableIndex ].CRTC[ i ] ; /* Get CRTC from file */ + XGINew_SetReg1( pVBInfo->P3d4 , i , CRTCdata ) ; /* Set CRTC( 3d4 ) */ + } +/* + if ( ( HwDeviceExtension->jChipType == XGI_630 )&& ( HwDeviceExtension->jChipRevision == 0x30 ) ) + { + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToTV ) ) + { + XGINew_SetReg1( pVBInfo->P3d4 , 0x18 , 0xFE ) ; + } + } + } +*/ +} + + +/* --------------------------------------------------------------------- */ +/* Function : */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetATTRegs( USHORT ModeNo , USHORT StandTableIndex , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR ARdata ; + USHORT i , + modeflag ; + + if ( ModeNo <= 0x13 ) + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + else + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + + for( i = 0 ; i <= 0x13 ; i++ ) + { + ARdata = pVBInfo->StandTable[ StandTableIndex ].ATTR[ i ] ; + if ( modeflag & Charx8Dot ) /* ifndef Dot9 */ + { + if ( i == 0x13 ) + { + if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) + ARdata = 0 ; + else + { + if ( pVBInfo->VBInfo & ( SetCRT2ToTV | SetCRT2ToLCD ) ) + { + if ( pVBInfo->VBInfo & SetInSlaveMode ) + ARdata = 0 ; + } + } + } + } + + XGINew_GetReg2( pVBInfo->P3da ) ; /* reset 3da */ + XGINew_SetReg3( pVBInfo->P3c0 , i ) ; /* set index */ + XGINew_SetReg3( pVBInfo->P3c0 , ARdata ) ; /* set data */ + } + + XGINew_GetReg2( pVBInfo->P3da ) ; /* reset 3da */ + XGINew_SetReg3( pVBInfo->P3c0 , 0x14 ) ; /* set index */ + XGINew_SetReg3( pVBInfo->P3c0 , 0x00 ) ; /* set data */ + XGINew_GetReg2( pVBInfo->P3da ) ; /* Enable Attribute */ + XGINew_SetReg3( pVBInfo->P3c0 , 0x20 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetGRCRegs */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetGRCRegs( USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR GRdata ; + USHORT i ; + + for( i = 0 ; i <= 0x08 ; i++ ) + { + GRdata = pVBInfo->StandTable[ StandTableIndex ].GRC[ i ] ; /* Get GR from file */ + XGINew_SetReg1( pVBInfo->P3ce , i , GRdata ) ; /* Set GR(3ce) */ + } + + if ( pVBInfo->ModeType > ModeVGA ) + { + GRdata = ( UCHAR )XGINew_GetReg1( pVBInfo->P3ce , 0x05 ) ; + GRdata &= 0xBF ; /* 256 color disable */ + XGINew_SetReg1( pVBInfo->P3ce , 0x05 , GRdata ) ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_ClearExt1Regs */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_ClearExt1Regs(PVB_DEVICE_INFO pVBInfo) +{ + USHORT i ; + + for( i = 0x0A ; i <= 0x0E ; i++ ) + XGINew_SetReg1( pVBInfo->P3c4 , i , 0x00 ) ; /* Clear SR0A-SR0E */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetDefaultVCLK */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +/*UCHAR XGI_SetDefaultVCLK( void ) +{ + return( 0 ) ; +}*/ + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetRatePtrCRT2 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +USHORT XGI_GetRatePtrCRT2( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +{ + SHORT LCDRefreshIndex[] = { 0x00 , 0x00 , 0x03 , 0x01 } , + LCDARefreshIndex[] = { 0x00 , 0x00 , 0x03 , 0x01 , 0x01 , 0x01 , 0x01 } ; + + USHORT RefreshRateTableIndex , i , + modeflag , index , temp ; + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + } + + if ( pVBInfo->IF_DEF_CH7005 == 1 ) + { + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + if ( modeflag & HalfDCLK ) + return( 0 ) ; + } + } + + if ( ModeNo < 0x14 ) + return( 0xFFFF ) ; + + index = XGINew_GetReg1( pVBInfo->P3d4 , 0x33 ) ; + index = index >> pVBInfo->SelectCRT2Rate ; + index &= 0x0F ; + + if ( pVBInfo->LCDInfo & LCDNonExpanding ) + index = 0 ; + + if ( index > 0 ) + index-- ; + + if ( pVBInfo->SetFlag & ProgrammingCRT2 ) + { + if ( pVBInfo->IF_DEF_CH7005 == 1 ) + { + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + index = 0 ; + } + } + + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) + { + if( pVBInfo->IF_DEF_LVDS == 0 ) + { + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + temp = LCDARefreshIndex[ pVBInfo->LCDResInfo & 0x0F ] ; /* 301b */ + else + temp = LCDRefreshIndex[ pVBInfo->LCDResInfo & 0x0F ] ; + + if ( index > temp ) + { + index = temp ; + } + } + else + { + index = 0 ; + } + } + } + + RefreshRateTableIndex = pVBInfo->EModeIDTable[ ModeIdIndex ].REFindex ; + ModeNo = pVBInfo->RefIndex[ RefreshRateTableIndex ].ModeID ; + i = 0 ; + + do + { + if ( pVBInfo->RefIndex[ RefreshRateTableIndex + i ].ModeID != ModeNo ) + break ; + temp = pVBInfo->RefIndex[ RefreshRateTableIndex + i ].Ext_InfoFlag ; + temp &= ModeInfoFlag ; + if ( temp < pVBInfo->ModeType ) + break ; + + i++ ; + index-- ; + + } while( index != 0xFFFF ) ; + + if ( !( pVBInfo->VBInfo & SetCRT2ToRAMDAC ) ) + { + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + temp = pVBInfo->RefIndex[ RefreshRateTableIndex + i - 1 ].Ext_InfoFlag ; + if ( temp & InterlaceMode ) + { + i++ ; + } + } + } + + i-- ; + if ( ( pVBInfo->SetFlag & ProgrammingCRT2 ) ) + { + temp = XGI_AjustCRT2Rate( ModeNo , ModeIdIndex , RefreshRateTableIndex , &i, pVBInfo) ; + } + return( RefreshRateTableIndex + i ) ; /*return(0x01|(temp1<<1)); */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_AjustCRT2Rate */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGI_AjustCRT2Rate( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex , USHORT *i, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempax , + tempbx , + resinfo , + modeflag , + infoflag ; + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; /* si+St_ModeFlag */ + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + } + + resinfo = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_RESINFO ; + tempbx = pVBInfo->RefIndex[ RefreshRateTableIndex + ( *i ) ].ModeID ; + tempax = 0 ; + + if ( pVBInfo->IF_DEF_LVDS == 0 ) + { + if ( pVBInfo->VBInfo & SetCRT2ToRAMDAC ) + { + tempax |= SupportRAMDAC2 ; + + if ( pVBInfo->VBType & VB_XGI301C ) + tempax |= SupportCRT2in301C ; + } + + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) /* 301b */ + { + tempax |= SupportLCD ; + + if ( pVBInfo->LCDResInfo != Panel1280x1024 ) + { + if ( pVBInfo->LCDResInfo != Panel1280x960 ) + { + if ( pVBInfo->LCDInfo & LCDNonExpanding ) + { + if ( resinfo >= 9 ) + { + tempax = 0 ; + return( 0 ) ; + } + } + } + } + } + + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) /* for HiTV */ + { + if ( ( pVBInfo->VBType & VB_XGI301LV ) && ( pVBInfo->VBExtInfo == VB_YPbPr1080i ) ) + { + tempax |= SupportYPbPr ; + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + if ( resinfo == 4 ) + return( 0 ) ; + + if ( resinfo == 3 ) + return( 0 ) ; + + if ( resinfo > 7 ) + return( 0 ) ; + } + } + else + { + tempax |= SupportHiVisionTV ; + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + if ( resinfo == 4 ) + return( 0 ) ; + + if ( resinfo == 3 ) + { + if ( pVBInfo->SetFlag & TVSimuMode ) + return( 0 ) ; + } + + if ( resinfo > 7 ) + return( 0 ) ; + } + } + } + else + { + if ( pVBInfo->VBInfo & ( SetCRT2ToAVIDEO | SetCRT2ToSVIDEO | SetCRT2ToSCART | SetCRT2ToYPbPr | SetCRT2ToHiVisionTV ) ) + { + tempax |= SupportTV ; + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + tempax |= SupportTV1024 ; + } + + if ( !( pVBInfo->VBInfo & SetPALTV ) ) + { + if ( modeflag & NoSupportSimuTV ) + { + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + if ( !( pVBInfo->VBInfo & SetNotSimuMode ) ) + { + return( 0 ) ; + } + } + } + } + } + } + } + else /* for LVDS */ + { + if ( pVBInfo->IF_DEF_CH7005 == 1 ) + { + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + tempax |= SupportCHTV ; + } + } + + if ( pVBInfo->VBInfo & SetCRT2ToLCD ) + { + tempax |= SupportLCD ; + + if ( resinfo > 0x08 ) + return( 0 ) ; /* 1024x768 */ + + if ( pVBInfo->LCDResInfo < Panel1024x768 ) + { + if ( resinfo > 0x07 ) + return( 0 ) ; /* 800x600 */ + + if ( resinfo == 0x04 ) + return( 0 ) ; /* 512x384 */ + } + } + } + + for( ; pVBInfo->RefIndex[ RefreshRateTableIndex + ( *i ) ].ModeID == tempbx ; ( *i )-- ) + { + infoflag = pVBInfo->RefIndex[ RefreshRateTableIndex + ( *i ) ].Ext_InfoFlag ; + if ( infoflag & tempax ) + { + return( 1 ) ; + } + if ( ( *i ) == 0 ) + break ; + } + + for( ( *i ) = 0 ; ; ( *i )++ ) + { + infoflag = pVBInfo->RefIndex[ RefreshRateTableIndex + ( *i ) ].Ext_InfoFlag ; + if ( pVBInfo->RefIndex[ RefreshRateTableIndex + ( *i ) ].ModeID != tempbx ) + { + return( 0 ) ; + } + + if ( infoflag & tempax ) + { + return( 1 ) ; + } + } + return( 1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetSync */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetSync(USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT sync , + temp ; + + sync = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_InfoFlag >> 8 ; /* di+0x00 */ + sync &= 0xC0 ; + temp = 0x2F ; + temp |= sync ; + XGINew_SetReg3( pVBInfo->P3c2 , temp ) ; /* Set Misc(3c2) */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT1CRTC */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetCRT1CRTC( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo, PXGI_HW_DEVICE_INFO HwDeviceExtension ) +{ + UCHAR index , + data ; + + USHORT i ; + + + + + + + index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT1CRTC ; /* Get index */ + index = index&IndexMask ; + + data =( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x11 ) ; + data &= 0x7F ; + XGINew_SetReg1(pVBInfo->P3d4,0x11,data); /* Unlock CRTC */ + + for( i = 0 ; i < 8 ; i++ ) + pVBInfo->TimingH[ 0 ].data[ i ] = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ i ] ; + + for( i = 0 ; i < 7 ; i++ ) + pVBInfo->TimingV[ 0 ].data[ i ] = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ i + 8 ] ; + + XGI_SetCRT1Timing_H( pVBInfo, HwDeviceExtension ) ; + + + + XGI_SetCRT1Timing_V( ModeIdIndex , ModeNo, pVBInfo ) ; + + + if( pVBInfo->ModeType > 0x03 ) + XGINew_SetReg1( pVBInfo->P3d4 , 0x14 , 0x4F ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT1Timing_H */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetCRT1Timing_H( PVB_DEVICE_INFO pVBInfo, PXGI_HW_DEVICE_INFO HwDeviceExtension ) +{ + UCHAR data , data1, pushax; + USHORT i , j ; + + /* XGINew_SetReg1( pVBInfo->P3d4 , 0x51 , 0 ) ; */ + /* XGINew_SetReg1( pVBInfo->P3d4 , 0x56 , 0 ) ; */ + /* XGINew_SetRegANDOR( pVBInfo->P3d4 ,0x11 , 0x7f , 0x00 ) ; */ + + data = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x11 ) ; /* unlock cr0-7 */ + data &= 0x7F ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x11 , data ) ; + + data = pVBInfo->TimingH[ 0 ].data[ 0 ] ; + XGINew_SetReg1( pVBInfo->P3d4 , 0 , data ) ; + + for( i = 0x01 ; i <= 0x04 ; i++ ) + { + data = pVBInfo->TimingH[ 0 ].data[ i ] ; + XGINew_SetReg1( pVBInfo->P3d4 , ( USHORT )( i + 1 ) , data ) ; + } + + for( i = 0x05 ; i <= 0x06 ; i++ ) + { + data = pVBInfo->TimingH[ 0 ].data[ i ]; + XGINew_SetReg1( pVBInfo->P3c4 ,( USHORT )( i + 6 ) , data ) ; + } + + j = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x0e ) ; + j &= 0x1F ; + data = pVBInfo->TimingH[ 0 ].data[ 7 ] ; + data &= 0xE0 ; + data |= j ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x0e , data ) ; + + if ( HwDeviceExtension->jChipType == XG20 ) + { + data = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x04 ) ; + data = data - 1 ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x04 , data ) ; + data = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x05 ) ; + data1 = data ; + data1 &= 0xE0 ; + data &= 0x1F ; + if ( data == 0 ) + { + pushax = data ; + data = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x0c ) ; + data &= 0xFB ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x0c , data ) ; + data = pushax ; + } + data = data - 1 ; + data |= data1 ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x05 , data ) ; + data = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x0e ) ; + data = data >> 5 ; + data = data + 3 ; + if ( data > 7 ) + data = data - 7 ; + data = data << 5 ; + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x0e , ~0xE0 , data ) ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT1Timing_V */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetCRT1Timing_V( USHORT ModeIdIndex , USHORT ModeNo,PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR data ; + USHORT i , j ; + + /* XGINew_SetReg1( pVBInfo->P3d4 , 0x51 , 0 ) ; */ + /* XGINew_SetReg1( pVBInfo->P3d4 , 0x56 , 0 ) ; */ + /* XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x11 , 0x7f , 0x00 ) ; */ + + for( i = 0x00 ; i <= 0x01 ; i++ ) + { + data = pVBInfo->TimingV[ 0 ].data[ i ] ; + XGINew_SetReg1( pVBInfo->P3d4 , ( USHORT )( i + 6 ) , data ) ; + } + + for( i = 0x02 ; i <= 0x03 ; i++ ) + { + data = pVBInfo->TimingV[ 0 ].data[ i ] ; + XGINew_SetReg1( pVBInfo->P3d4 , ( USHORT )( i + 0x0e ) , data ) ; + } + + for( i = 0x04 ; i <= 0x05 ; i++ ) + { + data = pVBInfo->TimingV[ 0 ].data[ i ] ; + XGINew_SetReg1( pVBInfo->P3d4 , ( USHORT )( i + 0x11 ) , data ) ; + } + + j = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x0a ) ; + j &= 0xC0 ; + data = pVBInfo->TimingV[ 0 ].data[ 6 ] ; + data &= 0x3F ; + data |= j ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x0a , data ) ; + + data = pVBInfo->TimingV[ 0 ].data[ 6 ] ; + data &= 0x80 ; + data = data >> 2 ; + + if ( ModeNo <= 0x13 ) + i = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + else + i = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + + i &= DoubleScanMode ; + if ( i ) + data |= 0x80 ; + + j = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x09 ) ; + j &= 0x5F ; + data |= j ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x09 , data ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT1DE */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetCRT1DE( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo,USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT resindex , + tempax , + tempbx , + tempcx , + temp , + modeflag ; + + UCHAR data ; + + resindex = XGI_GetResInfo( ModeNo , ModeIdIndex, pVBInfo ) ; + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + tempax = pVBInfo->StResInfo[ resindex ].HTotal ; + tempbx = pVBInfo->StResInfo[ resindex ].VTotal ; + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + tempax = pVBInfo->ModeResInfo[ resindex ].HTotal ; + tempbx = pVBInfo->ModeResInfo[ resindex ].VTotal ; + } + + if ( modeflag & HalfDCLK ) + tempax = tempax >> 1 ; + + if ( ModeNo > 0x13 ) + { + if ( modeflag & HalfDCLK ) + tempax = tempax << 1 ; + + temp = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_InfoFlag ; + + if ( temp & InterlaceMode ) + tempbx = tempbx >> 1 ; + + if ( modeflag & DoubleScanMode ) + tempbx = tempbx << 1 ; + } + + tempcx = 8 ; + + /* if ( !( modeflag & Charx8Dot ) ) */ + /* tempcx = 9 ; */ + + tempax /= tempcx ; + tempax -= 1 ; + tempbx -= 1 ; + tempcx = tempax ; + temp = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x11 ) ; + data = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x11 ) ; + data &= 0x7F ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x11 , data ) ; /* Unlock CRTC */ + XGINew_SetReg1( pVBInfo->P3d4 , 0x01 , ( USHORT )( tempcx & 0xff ) ) ; + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x0b , ~0x0c , ( USHORT )( ( tempcx & 0x0ff00 ) >> 10 ) ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x12 , ( USHORT )( tempbx & 0xff ) ) ; + tempax = 0 ; + tempbx = tempbx >> 8 ; + + if ( tempbx & 0x01 ) + tempax |= 0x02 ; + + if ( tempbx & 0x02 ) + tempax |= 0x40 ; + + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x07 , ~0x42 , tempax ) ; + data =( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x07 ) ; + data &= 0xFF ; + tempax = 0 ; + + if ( tempbx & 0x04 ) + tempax |= 0x02 ; + + XGINew_SetRegANDOR( pVBInfo->P3d4 ,0x0a , ~0x02 , tempax ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x11 , temp ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetResInfo */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +USHORT XGI_GetResInfo(USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT resindex ; + + if ( ModeNo <= 0x13 ) + { + resindex = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ResInfo ; /* si+St_ResInfo */ + } + else + { + resindex = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_RESINFO ; /* si+Ext_ResInfo */ + } + return( resindex ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT1Offset */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetCRT1Offset( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex , PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT temp , + ah , + al , + temp2 , + i , + DisplayUnit ; + + /* GetOffset */ + temp = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeInfo ; + temp = temp >> 8 ; + temp = pVBInfo->ScreenOffset[ temp ] ; + + temp2 = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_InfoFlag ; + temp2 &= InterlaceMode ; + + if ( temp2 ) + temp = temp << 1; + + temp2 = pVBInfo->ModeType - ModeEGA ; + + switch( temp2 ) + { + case 0: + temp2 = 1 ; + break ; + case 1: + temp2 = 2 ; + break ; + case 2: + temp2 = 4 ; + break ; + case 3: + temp2 = 4 ; + break ; + case 4: + temp2 = 6 ; + break; + case 5: + temp2 = 8 ; + break ; + default: + break ; + } + + if ( ( ModeNo >= 0x26 ) && ( ModeNo <= 0x28 ) ) + temp = temp * temp2 + temp2 / 2 ; + else + temp *= temp2 ; + + /* SetOffset */ + DisplayUnit = temp ; + temp2 = temp ; + temp = temp >> 8 ; /* ah */ + temp &= 0x0F ; + i = XGINew_GetReg1( pVBInfo->P3c4 , 0x0E ) ; + i &= 0xF0 ; + i |= temp ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x0E , i ) ; + + temp =( UCHAR )temp2 ; + temp &= 0xFF ; /* al */ + XGINew_SetReg1( pVBInfo->P3d4 , 0x13 , temp ) ; + + /* SetDisplayUnit */ + temp2 = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_InfoFlag ; + temp2 &= InterlaceMode ; + if ( temp2 ) + DisplayUnit >>= 1 ; + + DisplayUnit = DisplayUnit << 5 ; + ah = ( DisplayUnit & 0xff00 ) >> 8 ; + al = DisplayUnit & 0x00ff ; + if ( al == 0 ) + ah += 1 ; + else + ah += 2 ; + + if ( HwDeviceExtension->jChipType == XG20 ) + if ( ( ModeNo == 0x4A ) | (ModeNo == 0x49 ) ) + ah -= 1 ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x10 , ah ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT1VCLK */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetCRT1VCLK( USHORT ModeNo , USHORT ModeIdIndex , + PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR index , data ; + USHORT vclkindex ; + + if ( pVBInfo->IF_DEF_LVDS == 1 ) + { + index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRTVCLK ; + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x31 ) & 0xCF ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x31 , data ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2B , pVBInfo->VCLKData[ index ].SR2B ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2C , pVBInfo->VCLKData[ index ].SR2C ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2D , 0x01 ) ; + } + else if ( ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) && ( pVBInfo->VBInfo & SetCRT2ToLCDA ) ) + { + vclkindex = XGI_GetVCLK2Ptr( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x31 ) & 0xCF ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x31 , data ) ; + data = pVBInfo->VBVCLKData[ vclkindex ].Part4_A ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2B , data ) ; + data = pVBInfo->VBVCLKData[ vclkindex ].Part4_B ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2C , data ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2D , 0x01 ) ; + } + else + { + index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRTVCLK ; + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x31 ) & 0xCF ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x31 , data ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2B , pVBInfo->VCLKData[ index ].SR2B ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2C , pVBInfo->VCLKData[ index ].SR2C ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2D , 0x01 ) ; + } + + if ( HwDeviceExtension->jChipType == XG20 ) + { + if ( pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag & HalfDCLK ) + { + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x2B ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2B , data ) ; + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x2C ) ; + index = data ; + index &= 0xE0 ; + data &= 0x1F ; + data = data << 1 ; + data += 1 ; + data |= index ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2C , data ) ; + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT1FIFO */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetCRT1FIFO( USHORT ModeNo , PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo ) +{ + USHORT data ; + + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x3D ) ; + data &= 0xfe ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x3D , data ) ; /* diable auto-threshold */ + + if ( ModeNo > 0x13 ) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x08 , 0x34 ) ; + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x09 ) ; + data &= 0xF0 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x09 , data ) ; + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x3D ) ; + data |= 0x01 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x3D , data ) ; + } + else + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x08 , 0xAE ) ; + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x09 ) ; + data &= 0xF0 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x09 , data ) ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT1ModeRegs */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetCRT1ModeRegs( PXGI_HW_DEVICE_INFO HwDeviceExtension , + USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo ) +{ + USHORT data , + data2 , + data3 , + infoflag = 0 , + modeflag , + resindex , + xres ; + + if ( ModeNo > 0x13 ) + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + infoflag = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_InfoFlag ; + } + else + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; /* si+St_ModeFlag */ + + if ( XGINew_GetReg1( pVBInfo->P3d4 , 0x31 ) & 0x01 ) + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x1F , 0x3F , 0x00 ) ; + + if ( ModeNo > 0x13 ) + data = infoflag ; + else + data = 0 ; + + data2 = 0 ; + + if ( ModeNo > 0x13 ) + { + if ( pVBInfo->ModeType > 0x02 ) + { + data2 |= 0x02 ; + data3 = pVBInfo->ModeType - ModeVGA ; + data3 = data3 << 2 ; + data2 |= data3 ; + } + } + + data &= InterlaceMode ; + + if ( data ) + data2 |= 0x20 ; + + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x06 , ~0x3F , data2 ) ; + /* XGINew_SetReg1(pVBInfo->P3c4,0x06,data2); */ + resindex = XGI_GetResInfo( ModeNo , ModeIdIndex, pVBInfo ) ; + if ( ModeNo <= 0x13 ) + xres = pVBInfo->StResInfo[ resindex ].HTotal ; + else + xres = pVBInfo->ModeResInfo[ resindex ].HTotal ; /* xres->ax */ + + data = 0x0000 ; + if ( infoflag & InterlaceMode ) + { + if ( xres == 1024 ) + data = 0x0035 ; + else if ( xres == 1280 ) + data = 0x0048 ; + } + + data2 = data & 0x00FF ; + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x19 , 0xFF , data2 ) ; + data2 = ( data & 0xFF00 ) >> 8 ; + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x19 , 0xFC , data2 ) ; + + if( modeflag & HalfDCLK ) + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x01 , 0xF7 , 0x08 ) ; + + data2 = 0 ; + + if ( modeflag & LineCompareOff ) + data2 |= 0x08 ; + + if ( ModeNo > 0x13 ) + { + if ( pVBInfo->ModeType == ModeEGA ) + data2 |= 0x40 ; + } + + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x0F , ~0x48 , data2 ) ; + data = 0x60 ; + if ( pVBInfo->ModeType != ModeText ) + { + data = data ^ 0x60 ; + if ( pVBInfo->ModeType != ModeEGA ) + { + data = data ^ 0xA0 ; + } + } + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x21 , 0x1F , data ) ; + + XGI_SetVCLKState( HwDeviceExtension , ModeNo , RefreshRateTableIndex, pVBInfo) ; + + /* if(modeflag&HalfDCLK)//030305 fix lowresolution bug */ + /* if(XGINew_IF_DEF_NEW_LOWRES) */ + /* XGI_VesaLowResolution(ModeNo,ModeIdIndex);//030305 fix lowresolution bug */ + + data=XGINew_GetReg1( pVBInfo->P3d4 , 0x31 ) ; + + if (HwDeviceExtension->jChipType == XG20 ) + { + if ( data & 0x40 ) + data = 0x33 ; + else + data = 0x73 ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x52 , data ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x51 , 0x02 ) ; + } + else + { + if ( data & 0x40 ) + data = 0x2c ; + else + data = 0x6c ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x52 , data ) ; + } + +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetVCLKState */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetVCLKState( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo , USHORT RefreshRateTableIndex,PVB_DEVICE_INFO pVBInfo ) +{ + unsigned int data , + data2 = 0 ; + int VCLK ; + + UCHAR index ; + + if ( ModeNo <= 0x13 ) + VCLK = 0 ; + else + { + index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRTVCLK ; + index &= IndexMask ; + VCLK = pVBInfo->VCLKData[ index ].CLOCK ; + } + + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x32 ) ; + data &= 0xf3 ; + if ( VCLK >= 200 ) + data |= 0x0c ; /* VCLK > 200 */ + + if ( HwDeviceExtension->jChipType == XG20 ) + data &= ~0x04 ; /* 2 pixel mode */ + + XGINew_SetReg1( pVBInfo->P3c4 , 0x32 , data ) ; + + if ( HwDeviceExtension->jChipType != XG20 ) + { + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x1F ) ; + data &= 0xE7 ; + if ( VCLK < 200 ) + data |= 0x10 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x1F , data ) ; + } + + if ( ( VCLK >= 0 ) && ( VCLK < 135 ) ) + data2 = 0x03 ; + else if ( ( VCLK >= 135 ) && ( VCLK < 160 ) ) + data2 = 0x02 ; + else if ( ( VCLK >= 160 ) && ( VCLK < 260 ) ) + data2 = 0x01 ; + else if ( VCLK > 260 ) + data2 = 0x00 ; + + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x07 , 0xFC , data2 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_VesaLowResolution */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +/*void XGI_VesaLowResolution( USHORT ModeNo , USHORT ModeIdIndex ,PVB_DEVICE_INFO pVBInfo) +{ + USHORT modeflag; + + if ( ModeNo > 0x13 ) + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + else + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + + if ( ModeNo > 0x13 ) + { + if ( modeflag & DoubleScanMode ) + { + if ( modeflag & HalfDCLK ) + { + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + if ( !( pVBInfo->VBInfo & SetCRT2ToRAMDAC ) ) + { + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x01 , 0xf7 , 0x00 ) ; + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x0f , 0x7f , 0x00 ) ; + return ; + } + } + } + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x0f , 0xff , 0x80 ) ; + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x01 , 0xf7 , 0x00 ) ; + return ; + } + } + } + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x0f , 0x7f , 0x00 ) ; +} +*/ + +/* --------------------------------------------------------------------- */ +/* Function : XGI_LoadDAC */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_LoadDAC( USHORT ModeNo , USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo ) +{ + USHORT data , data2 , time , + i , j , k , m , n , o , + si , di , bx , dl , al , ah , dh , + *table = NULL ; + + if ( ModeNo <= 0x13 ) + data = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + else + data = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + + data &= DACInfoFlag ; + time = 64 ; + + if ( data == 0x00 ) + table = XGINew_MDA_DAC ; + else if ( data == 0x08 ) + table = XGINew_CGA_DAC ; + else if ( data == 0x10 ) + table = XGINew_EGA_DAC ; + else if ( data == 0x18 ) + { + time = 256 ; + table = XGINew_VGA_DAC ; + } + + if ( time == 256 ) + j = 16 ; + else + j = time ; + + XGINew_SetReg3( pVBInfo->P3c6 , 0xFF ) ; + XGINew_SetReg3( pVBInfo->P3c8 , 0x00 ) ; + + for( i = 0 ; i < j ; i++ ) + { + data = table[ i ] ; + + for( k = 0 ; k < 3 ; k++ ) + { + data2 = 0 ; + + if ( data & 0x01 ) + data2 = 0x2A ; + + if ( data & 0x02 ) + data2 += 0x15 ; + + XGINew_SetReg3( pVBInfo->P3c9 , data2 ) ; + data = data >> 2 ; + } + } + + if ( time == 256 ) + { + for( i = 16 ; i < 32 ; i++ ) + { + data = table[ i ] ; + + for( k = 0 ; k < 3 ; k++ ) + XGINew_SetReg3( pVBInfo->P3c9 , data ) ; + } + + si = 32 ; + + for( m = 0 ; m < 9 ; m++ ) + { + di = si ; + bx = si + 0x04 ; + dl = 0 ; + + for( n = 0 ; n < 3 ; n++ ) + { + for( o = 0 ; o < 5 ; o++ ) + { + dh = table[ si ] ; + ah = table[ di ] ; + al = table[ bx ] ; + si++ ; + XGI_WriteDAC( dl , ah , al , dh, pVBInfo ) ; + } + + si -= 2 ; + + for( o = 0 ; o < 3 ; o++ ) + { + dh = table[ bx ] ; + ah = table[ di ] ; + al = table[ si ] ; + si-- ; + XGI_WriteDAC( dl , ah , al , dh, pVBInfo ) ; + } + + dl++ ; + } + + si += 5 ; + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_WriteDAC */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_WriteDAC( USHORT dl , USHORT ah , USHORT al , USHORT dh,PVB_DEVICE_INFO pVBInfo ) +{ + USHORT temp , bh , bl ; + + bh = ah ; + bl = al ; + + if ( dl != 0 ) + { + temp = bh ; + bh = dh ; + dh = temp ; + if ( dl == 1 ) + { + temp = bl ; + bl = dh ; + dh = temp ; + } + else + { + temp = bl ; + bl = bh ; + bh = temp ; + } + } + XGINew_SetReg3( pVBInfo->P3c9 , ( USHORT )dh ) ; + XGINew_SetReg3( pVBInfo->P3c9 , ( USHORT )bh ) ; + XGINew_SetReg3( pVBInfo->P3c9 , ( USHORT )bl ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_ClearBuffer */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_ClearBuffer( PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT ModeNo, PVB_DEVICE_INFO pVBInfo) +{ + PVOID VideoMemoryAddress = ( PVOID )HwDeviceExtension->pjVideoMemoryAddress ; + ULONG AdapterMemorySize = ( ULONG )HwDeviceExtension->ulVideoMemorySize ; + /* PUSHORT pBuffer ; */ + /* int i ; */ + + if ( pVBInfo->ModeType >= ModeEGA ) + { + if ( ModeNo > 0x13 ) + { + AdapterMemorySize = 0x40000 ; /* clear 256k */ + /* GetDRAMSize( HwDeviceExtension ) ; */ + XGI_SetMemory( VideoMemoryAddress , AdapterMemorySize , 0 ) ; + } + else + { +/* + pBuffer = VideoMemoryAddress ; + for( i = 0 ; i < 0x4000 ; i++ ) + pBuffer[ i ] = 0x0000 ; +*/ + } + } + else + { + if ( pVBInfo->ModeType < ModeCGA ) + { +/* + pBuffer = VideoMemoryAddress ; + for ( i = 0 ; i < 0x4000 ; i++ ) + pBuffer[ i ] = 0x0720 ; +*/ + } + else + XGI_SetMemory( VideoMemoryAddress , 0x8000 , 0 ) ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetLCDAGroup */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetLCDAGroup( USHORT ModeNo , USHORT ModeIdIndex , PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT RefreshRateTableIndex ; + /* USHORT temp ; */ + + /* pVBInfo->SelectCRT2Rate = 0 ; */ + + pVBInfo->SetFlag |= ProgrammingCRT2 ; + RefreshRateTableIndex = XGI_GetRatePtrCRT2( ModeNo , ModeIdIndex, pVBInfo ) ; + XGI_GetLVDSResInfo( ModeNo , ModeIdIndex, pVBInfo ) ; + XGI_GetLVDSData( ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo); + XGI_ModCRT1Regs( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; + XGI_SetLVDSRegs( ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + XGI_SetCRT2ECLK( ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetLVDSResInfo */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_GetLVDSResInfo( USHORT ModeNo , USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo ) +{ + USHORT resindex , xres , yres , modeflag ; + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ResInfo ; /* si+St_ResInfo */ + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_RESINFO ; /* si+Ext_ResInfo */ + } + + + /* if ( ModeNo > 0x13 ) */ + /* modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; */ + /* else */ + /* modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; */ + + if ( ModeNo <= 0x13 ) + { + resindex = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ResInfo ; /* si+St_ResInfo */ + } + else + { + resindex = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_RESINFO ; /* si+Ext_ResInfo */ + } + + /* resindex = XGI_GetResInfo( ModeNo , ModeIdIndex, pVBInfo ) ; */ + + if ( ModeNo <= 0x13 ) + { + xres = pVBInfo->StResInfo[ resindex ].HTotal ; + yres = pVBInfo->StResInfo[ resindex ].VTotal ; + } + else + { + xres = pVBInfo->ModeResInfo[ resindex ].HTotal ; + yres = pVBInfo->ModeResInfo[ resindex ].VTotal ; + } + if ( ModeNo > 0x13 ) + { + if ( modeflag & HalfDCLK ) + xres = xres << 1 ; + + if ( modeflag & DoubleScanMode ) + yres = yres << 1 ; + } + /* if ( modeflag & Charx8Dot ) */ + /* { */ + + if ( xres == 720 ) + xres = 640 ; + + /* } */ + pVBInfo->VGAHDE = xres ; + pVBInfo->HDE = xres ; + pVBInfo->VGAVDE = yres ; + pVBInfo->VDE = yres ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetLVDSData */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_GetLVDSData( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempbx ; + XGI330_LVDSDataStruct *LCDPtr = NULL ; + XGI330_CHTVDataStruct *TVPtr = NULL ; + + tempbx = 2 ; + + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) + { + LCDPtr = ( XGI330_LVDSDataStruct * )XGI_GetLcdPtr( tempbx, ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo) ; + pVBInfo->VGAHT = LCDPtr->VGAHT ; + pVBInfo->VGAVT = LCDPtr->VGAVT ; + pVBInfo->HT = LCDPtr->LCDHT ; + pVBInfo->VT = LCDPtr->LCDVT ; + } + if ( pVBInfo->IF_DEF_CH7017 == 1 ) + { + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + TVPtr = ( XGI330_CHTVDataStruct * )XGI_GetTVPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + pVBInfo->VGAHT = TVPtr->VGAHT ; + pVBInfo->VGAVT = TVPtr->VGAVT ; + pVBInfo->HT = TVPtr->LCDHT ; + pVBInfo->VT = TVPtr->LCDVT ; + } + } + + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) + { + if ( !( pVBInfo->LCDInfo & ( SetLCDtoNonExpanding | EnableScalingLCD ) ) ) + { + if ( ( pVBInfo->LCDResInfo == Panel1024x768 ) || ( pVBInfo->LCDResInfo == Panel1024x768x75 ) ) + { + pVBInfo->HDE = 1024 ; + pVBInfo->VDE = 768 ; + } + else if ( ( pVBInfo->LCDResInfo == Panel1280x1024 ) || ( pVBInfo->LCDResInfo == Panel1280x1024x75 ) ) + { + pVBInfo->HDE = 1280 ; + pVBInfo->VDE = 1024 ; + } + else if ( pVBInfo->LCDResInfo == Panel1400x1050 ) + { + pVBInfo->HDE = 1400 ; + pVBInfo->VDE = 1050 ; + } + else + { + pVBInfo->HDE = 1600 ; + pVBInfo->VDE = 1200 ; + } + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_ModCRT1Regs */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_ModCRT1Regs( USHORT ModeNo , USHORT ModeIdIndex , + USHORT RefreshRateTableIndex , PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR index ; + USHORT tempbx , i ; + XGI_LVDSCRT1HDataStruct *LCDPtr = NULL ; + XGI_LVDSCRT1VDataStruct *LCDPtr1 =NULL ; + /* XGI330_CHTVDataStruct *TVPtr = NULL ; */ + + if( ModeNo <= 0x13 ) + index = pVBInfo->SModeIDTable[ ModeIdIndex ].St_CRT2CRTC ; + else + index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; + + index= index & IndexMask ; + + if ( ( pVBInfo->IF_DEF_ScaleLCD == 0 ) || ( ( pVBInfo->IF_DEF_ScaleLCD == 1 ) && ( !( pVBInfo->LCDInfo & EnableScalingLCD ) ) ) ) + { + tempbx = 0 ; + + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) + { + LCDPtr = ( XGI_LVDSCRT1HDataStruct * )XGI_GetLcdPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + + for( i = 0 ; i < 8 ; i++ ) + pVBInfo->TimingH[ 0 ].data[ i ] = LCDPtr[ 0 ].Reg[ i ] ; + } + + /* if ( pVBInfo->IF_DEF_CH7017 == 1 ) + { + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + TVPtr = ( XGI330_CHTVDataStruct *)XGI_GetTVPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + } */ + + XGI_SetCRT1Timing_H(pVBInfo,HwDeviceExtension) ; + + tempbx = 1 ; + + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) + { + LCDPtr1 = ( XGI_LVDSCRT1VDataStruct * )XGI_GetLcdPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + for( i = 0 ; i < 7 ; i++ ) + pVBInfo->TimingV[ 0 ].data[ i ] = LCDPtr1[ 0 ].Reg[ i ] ; + } + + /* if ( pVBInfo->IF_DEF_CH7017 == 1 ) + { + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + TVPtr = ( XGI330_CHTVDataStruct *)XGI_GetTVPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + } */ + + XGI_SetCRT1Timing_V( ModeIdIndex , ModeNo , pVBInfo) ; + } +} + + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetLVDSRegs */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetLVDSRegs( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempbx , tempax , tempcx , tempdx , push1 , push2 , modeflag ; + unsigned long temp , temp1 , temp2 , temp3 , push3 ; + XGI330_LCDDataDesStruct *LCDPtr = NULL ; + XGI330_LCDDataDesStruct2 *LCDPtr1 = NULL ; + + if ( ModeNo > 0x13 ) + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + else + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + + if ( !( pVBInfo->SetFlag & Win9xDOSMode ) ) + { + if ( ( pVBInfo->IF_DEF_CH7017 == 0 ) || ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) ) + { + if ( pVBInfo->IF_DEF_OEMUtil == 1 ) + { + tempbx = 8 ; + LCDPtr = ( XGI330_LCDDataDesStruct * )XGI_GetLcdPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + } + + if ( ( pVBInfo->IF_DEF_OEMUtil == 0 ) || ( LCDPtr == 0 ) ) + { + tempbx = 3 ; + if ( pVBInfo->LCDInfo & EnableScalingLCD ) + LCDPtr1 = ( XGI330_LCDDataDesStruct2 * )XGI_GetLcdPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + else + LCDPtr = ( XGI330_LCDDataDesStruct * )XGI_GetLcdPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + } + + XGI_GetLCDSync( &tempax , &tempbx ,pVBInfo) ; + push1 = tempbx ; + push2 = tempax ; + + /* GetLCDResInfo */ + if ( ( pVBInfo->LCDResInfo == Panel1024x768 ) || ( pVBInfo->LCDResInfo == Panel1024x768x75 ) ) + { + tempax = 1024 ; + tempbx = 768 ; + } + else if ( ( pVBInfo->LCDResInfo == Panel1280x1024 ) || ( pVBInfo->LCDResInfo == Panel1280x1024x75 ) ) + { + tempax = 1280 ; + tempbx = 1024 ; + } + else if ( pVBInfo->LCDResInfo == Panel1400x1050 ) + { + tempax = 1400 ; + tempbx = 1050 ; + } + else + { + tempax = 1600 ; + tempbx = 1200 ; + } + + if ( pVBInfo->LCDInfo & SetLCDtoNonExpanding ) + { + pVBInfo->HDE=tempax; + pVBInfo->VDE=tempbx; + pVBInfo->VGAHDE=tempax; + pVBInfo->VGAVDE=tempbx; + } + + if ( ( pVBInfo->IF_DEF_ScaleLCD == 1 ) && ( pVBInfo->LCDInfo & EnableScalingLCD ) ) + { + tempax=pVBInfo->HDE; + tempbx=pVBInfo->VDE; + } + + tempax = pVBInfo->HT ; + + if ( pVBInfo->LCDInfo & EnableScalingLCD ) + tempbx = LCDPtr1->LCDHDES ; + else + tempbx = LCDPtr->LCDHDES ; + + tempcx = pVBInfo->HDE ; + tempbx = tempbx & 0x0fff ; + tempcx += tempbx ; + + if ( tempcx >= tempax ) + tempcx -= tempax ; + + XGINew_SetReg1( pVBInfo->Part1Port , 0x1A , tempbx & 0x07 ) ; + + tempcx = tempcx >> 3 ; + tempbx = tempbx >> 3 ; + + XGINew_SetReg1( pVBInfo->Part1Port , 0x16 , ( USHORT )( tempbx & 0xff ) ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x17 , ( USHORT )( tempcx & 0xff ) ) ; + + tempax = pVBInfo->HT ; + + if ( pVBInfo->LCDInfo & EnableScalingLCD ) + tempbx = LCDPtr1->LCDHRS ; + else + tempbx = LCDPtr->LCDHRS ; + + tempcx = push2 ; + + if ( pVBInfo->LCDInfo & EnableScalingLCD ) + tempcx = LCDPtr1->LCDHSync ; + + tempcx += tempbx ; + + if ( tempcx >= tempax ) + tempcx -= tempax ; + + tempax = tempbx & 0x07 ; + tempax = tempax >> 5 ; + tempcx = tempcx >> 3 ; + tempbx = tempbx >> 3 ; + + tempcx &= 0x1f ; + tempax |= tempcx ; + + XGINew_SetReg1( pVBInfo->Part1Port , 0x15 , tempax ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x14 , ( USHORT )( tempbx & 0xff ) ) ; + + tempax = pVBInfo->VT ; + if ( pVBInfo->LCDInfo & EnableScalingLCD ) + tempbx = LCDPtr1->LCDVDES ; + else + tempbx = LCDPtr->LCDVDES ; + tempcx = pVBInfo->VDE ; + + tempbx = tempbx & 0x0fff ; + tempcx += tempbx ; + if ( tempcx >= tempax ) + tempcx -= tempax ; + + XGINew_SetReg1( pVBInfo->Part1Port , 0x1b , ( USHORT )( tempbx & 0xff ) ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x1c , ( USHORT )( tempcx & 0xff ) ) ; + + tempbx = ( tempbx >> 8 ) & 0x07 ; + tempcx = ( tempcx >> 8 ) & 0x07 ; + + XGINew_SetReg1( pVBInfo->Part1Port , 0x1d , ( USHORT )( ( tempcx << 3 ) | tempbx ) ) ; + + tempax = pVBInfo->VT ; + if ( pVBInfo->LCDInfo & EnableScalingLCD ) + tempbx = LCDPtr1->LCDVRS ; + else + tempbx = LCDPtr->LCDVRS ; + + /* tempbx = tempbx >> 4 ; */ + tempcx = push1 ; + + if ( pVBInfo->LCDInfo & EnableScalingLCD ) + tempcx = LCDPtr1->LCDVSync ; + + tempcx += tempbx ; + if ( tempcx >= tempax ) + tempcx -= tempax ; + + XGINew_SetReg1( pVBInfo->Part1Port , 0x18 , ( USHORT )( tempbx & 0xff ) ) ; + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x19 , ~0x0f , ( USHORT )( tempcx & 0x0f ) ) ; + + tempax = ( ( tempbx >> 8 ) & 0x07 ) << 3 ; + + tempbx = pVBInfo->VGAVDE ; + if ( tempbx != pVBInfo->VDE ) + tempax |= 0x40 ; + + if ( pVBInfo->LCDInfo & EnableLVDSDDA ) + tempax |= 0x40 ; + + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x1a , 0x07 , tempax ) ; + + tempcx = pVBInfo->VGAVT ; + tempbx = pVBInfo->VDE ; + tempax = pVBInfo->VGAVDE ; + tempcx -= tempax ; + + temp = tempax ; /* 0430 ylshieh */ + temp1 = ( temp << 18 ) / tempbx ; + + tempdx = ( USHORT )( ( temp << 18 ) % tempbx ) ; + + if ( tempdx != 0 ) + temp1 += 1 ; + + temp2 = temp1 ; + push3 = temp2 ; + + XGINew_SetReg1( pVBInfo->Part1Port , 0x37 , ( USHORT )( temp2 & 0xff ) ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x36 , ( USHORT )( ( temp2 >> 8 ) & 0xff ) ) ; + + tempbx = ( USHORT )( temp2 >> 16 ) ; + tempax = tempbx & 0x03 ; + + tempbx = pVBInfo->VGAVDE ; + if ( tempbx == pVBInfo->VDE ) + tempax |= 0x04 ; + + XGINew_SetReg1( pVBInfo->Part1Port , 0x35 , tempax ) ; + + if ( pVBInfo->VBType & VB_XGI301C ) + { + temp2 = push3 ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x3c , ( USHORT )( temp2 & 0xff ) ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x3b , ( USHORT )( ( temp2 >> 8 ) & 0xff ) ) ; + tempbx = ( USHORT )( temp2 >> 16 ) ; + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x3a , ~0xc0 , ( USHORT )( ( tempbx & 0xff ) << 6 ) ) ; + + tempcx = pVBInfo->VGAVDE ; + if ( tempcx == pVBInfo->VDE ) + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x30 , ~0x0c , 0x00 ) ; + else + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x30 , ~0x0c , 0x08 ) ; + } + + tempcx = pVBInfo->VGAHDE ; + tempbx = pVBInfo->HDE ; + + temp1 = tempcx << 16 ; + + tempax = ( USHORT )( temp1 / tempbx ) ; + + if ( ( tempbx & 0xffff ) == ( tempcx & 0xffff ) ) + tempax = 65535 ; + + temp3 = tempax ; + temp1 = pVBInfo->VGAHDE << 16 ; + + temp1 /= temp3 ; + temp3 = temp3 << 16 ; + temp1 -= 1 ; + + temp3 = ( temp3 & 0xffff0000 ) + ( temp1 & 0xffff ) ; + + tempax = ( USHORT )( temp3 & 0xff ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x1f , tempax ) ; + + temp1 = pVBInfo->VGAVDE << 18 ; + temp1 = temp1 / push3 ; + tempbx = ( USHORT )( temp1 & 0xffff ) ; + + if ( pVBInfo->LCDResInfo == Panel1024x768 ) + tempbx -= 1 ; + + tempax = ( ( tempbx >> 8 ) & 0xff ) << 3 ; + tempax |= ( USHORT )( ( temp3 >> 8 ) & 0x07 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x20 , ( USHORT )( tempax & 0xff ) ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x21 , ( USHORT )( tempbx & 0xff ) ) ; + + temp3 = temp3 >> 16 ; + + if ( modeflag & HalfDCLK ) + temp3 = temp3 >> 1 ; + + XGINew_SetReg1(pVBInfo->Part1Port , 0x22 , ( USHORT )( ( temp3 >> 8 ) & 0xff ) ) ; + XGINew_SetReg1(pVBInfo->Part1Port , 0x23 , ( USHORT )( temp3 & 0xff ) ) ; + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT2ECLK */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetCRT2ECLK( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR di_0 , di_1 , tempal ; + int i ; + + tempal = XGI_GetVCLKPtr( RefreshRateTableIndex , ModeNo , ModeIdIndex, pVBInfo ) ; + XGI_GetVCLKLen( tempal , &di_0 , &di_1, pVBInfo ) ; + XGI_GetLCDVCLKPtr( &di_0 , &di_1, pVBInfo ) ; + + for( i = 0 ; i < 4 ; i++ ) + { + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x31 , ~0x30 , ( USHORT )( 0x10 * i ) ) ; + if ( ( !( pVBInfo->VBInfo & SetCRT2ToLCDA ) ) && ( !( pVBInfo->VBInfo & SetInSlaveMode ) ) ) + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x2e , di_0 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2f , di_1 ) ; + } + else + { + XGINew_SetReg1( pVBInfo->P3c4 , 0x2b , di_0 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2c , di_1 ) ; + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_UpdateModeInfo */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_UpdateModeInfo( PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempcl , + tempch , + temp , + tempbl , + tempax ; + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + tempcl = 0 ; + tempch = 0 ; + temp = XGINew_GetReg1( pVBInfo->P3c4 , 0x01 ) ; + + if ( !( temp & 0x20 ) ) + { + temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x17 ) ; + if ( temp & 0x80 ) + { + if ( ( HwDeviceExtension->jChipType == XG20 ) || ( HwDeviceExtension->jChipType >= XG40 ) ) + temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x53 ) ; + else + temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x63 ) ; + + if ( !( temp & 0x40 ) ) + tempcl |= ActiveCRT1 ; + } + } + + temp = XGINew_GetReg1( pVBInfo->Part1Port , 0x2e ) ; + temp &= 0x0f ; + + if ( !( temp == 0x08 ) ) + { + tempax = XGINew_GetReg1( pVBInfo->Part1Port , 0x13 ) ; /* Check ChannelA by Part1_13 [2003/10/03] */ + if ( tempax & 0x04 ) + tempcl = tempcl | ActiveLCD ; + + temp &= 0x05 ; + + if ( !( tempcl & ActiveLCD ) ) + if ( temp == 0x01 ) + tempcl |= ActiveCRT2 ; + + if ( temp == 0x04 ) + tempcl |= ActiveLCD ; + + if ( temp == 0x05 ) + { + temp = XGINew_GetReg1( pVBInfo->Part2Port , 0x00 ) ; + + if( !( temp & 0x08 ) ) + tempch |= ActiveAVideo ; + + if ( !( temp & 0x04 ) ) + tempch |= ActiveSVideo ; + + if ( temp & 0x02 ) + tempch |= ActiveSCART ; + + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { + if ( temp & 0x01 ) + tempch |= ActiveHiTV ; + } + + if ( pVBInfo->VBInfo & SetCRT2ToYPbPr ) + { + temp = XGINew_GetReg1( pVBInfo->Part2Port , 0x4d ) ; + + if ( temp & 0x10 ) + tempch |= ActiveYPbPr ; + } + + if ( tempch != 0 ) + tempcl |= ActiveTV ; + } + } + + temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x3d ) ; + if ( tempcl & ActiveLCD ) + { + if ( ( pVBInfo->SetFlag & ReserveTVOption ) ) + { + if ( temp & ActiveTV ) + tempcl |= ActiveTV ; + } + } + temp = tempcl ; + tempbl = ~ModeSwitchStatus ; + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x3d , tempbl , temp ) ; + + if ( !( pVBInfo->SetFlag & ReserveTVOption ) ) + XGINew_SetReg1( pVBInfo->P3d4 , 0x3e , tempch ) ; + } + else + { + return ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetVGAType */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_GetVGAType( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +{ +/* USHORT tempbx , + tempah ; */ + + if ( HwDeviceExtension->jChipType == XG20 ) + { + pVBInfo->Set_VGAType = XG20; + } + else if ( HwDeviceExtension->jChipType >= XG40 ) + { + pVBInfo->Set_VGAType = VGA_XGI340 ; + } + + +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetVBType */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_GetVBType(PVB_DEVICE_INFO pVBInfo) +{ + USHORT flag , tempbx , tempah ; + + if ( pVBInfo->IF_DEF_LVDS == 0 ) + { + tempbx = VB_XGI302B ; + flag = XGINew_GetReg1( pVBInfo->Part4Port , 0x00 ) ; + if ( flag != 0x02 ) + { + tempbx = VB_XGI301 ; + flag = XGINew_GetReg1( pVBInfo->Part4Port , 0x01 ) ; + if ( flag >= 0xB0 ) + { + tempbx = VB_XGI301B ; + if ( flag >= 0xC0 ) + { + tempbx = VB_XGI301C ; + if ( flag >= 0xD0 ) + { + tempbx = VB_XGI301LV ; + if ( flag >= 0xE0 ) + { + tempbx = VB_XGI302LV ; + tempah = XGINew_GetReg1( pVBInfo->Part4Port , 0x39 ) ; + if ( tempah != 0xFF ) + tempbx = VB_XGI301C ; + } + } + } + + if ( tempbx & ( VB_XGI301B | VB_XGI302B ) ) + { + flag = XGINew_GetReg1( pVBInfo->Part4Port , 0x23 ) ; + + if ( !( flag & 0x02 ) ) + tempbx = tempbx | VB_NoLCD ; + } + } + } + pVBInfo->VBType = tempbx ; + } +/* + else if ( pVBInfo->IF_DEF_CH7017 == 1 ) + pVBInfo->VBType = VB_CH7017 ; + else //LVDS + pVBInfo->VBType = VB_LVDS_NS ; +*/ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetVBInfo */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_GetVBInfo( USHORT ModeNo , USHORT ModeIdIndex , PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempax , + push , + tempbx , + temp , + modeflag ; + +/* UCHAR OutputSelect = *pVBInfo->pOutputSelect ; */ + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + } + + pVBInfo->SetFlag = 0 ; + pVBInfo->ModeType = modeflag & ModeInfoFlag ; + tempbx = 0 ; + + if ( pVBInfo->VBType & 0xFFFF ) + { + temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x30 ) ; /* Check Display Device */ + tempbx = tempbx | temp ; + temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x31 ) ; + push = temp ; + push = push << 8 ; + tempax = temp << 8 ; + tempbx = tempbx | tempax ; + temp = ( SetCRT2ToDualEdge | SetCRT2ToYPbPr | SetCRT2ToLCDA | SetInSlaveMode | DisableCRT2Display ) ; + temp = 0xFFFF ^ temp ; + tempbx &= temp ; + + temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x38 ) ; + + if ( pVBInfo->IF_DEF_LCDA == 1 ) + { + + if ( ( pVBInfo->Set_VGAType == XG20 ) || ( pVBInfo->Set_VGAType >= XG40 )) + { + if ( pVBInfo->IF_DEF_LVDS == 0 ) + { + /* if ( ( pVBInfo->VBType & VB_XGI302B ) || ( pVBInfo->VBType & VB_XGI301LV ) || ( pVBInfo->VBType & VB_XGI302LV ) || ( pVBInfo->VBType & VB_XGI301C ) ) */ + if ( pVBInfo->VBType & ( VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + if ( temp & EnableDualEdge ) + { + tempbx |= SetCRT2ToDualEdge ; + + if ( temp & SetToLCDA ) + tempbx |= SetCRT2ToLCDA ; + } + } + } + else if ( pVBInfo->IF_DEF_CH7017 == 1 ) + { + if ( pVBInfo->VBType & VB_CH7017 ) + { + if ( temp & EnableDualEdge ) + { + tempbx |= SetCRT2ToDualEdge ; + + if ( temp & SetToLCDA ) + tempbx |= SetCRT2ToLCDA ; + } + } + } + } + } + + if ( pVBInfo->IF_DEF_YPbPr == 1 ) + { + if ( ( ( pVBInfo->IF_DEF_LVDS == 0 ) && ( ( pVBInfo->VBType & VB_XGI301LV ) || ( pVBInfo->VBType & VB_XGI302LV ) || ( pVBInfo->VBType & VB_XGI301C ) ) ) + || ( ( pVBInfo->IF_DEF_CH7017 == 1 ) && ( pVBInfo->VBType&VB_CH7017 ) ) ) + { + if ( temp & SetYPbPr ) /* temp = CR38 */ + { + if ( pVBInfo->IF_DEF_HiVision == 1 ) + { + temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x35 ) ; /* shampoo add for new scratch */ + temp &= YPbPrMode ; + tempbx |= SetCRT2ToHiVisionTV ; + + if ( temp != YPbPrMode1080i ) { + tempbx &= ( ~SetCRT2ToHiVisionTV ) ; + tempbx |= SetCRT2ToYPbPr ; } + } + + /* tempbx |= SetCRT2ToYPbPr ; */ + } + } + } + + tempax = push ; /* restore CR31 */ + + if ( pVBInfo->IF_DEF_LVDS == 0 ) + { + if ( pVBInfo->IF_DEF_YPbPr == 1 ) + { + if ( pVBInfo->IF_DEF_HiVision == 1 ) + temp = 0x09FC ; + else + temp = 0x097C ; + } + else + { + if ( pVBInfo->IF_DEF_HiVision == 1 ) + temp = 0x01FC ; + else + temp = 0x017C ; + } + } + else /* 3nd party chip */ + { + if ( pVBInfo->IF_DEF_CH7017 == 1 ) + temp = ( SetCRT2ToTV | SetCRT2ToLCD | SetCRT2ToLCDA ) ; + else + temp = SetCRT2ToLCD ; + } + + if ( !( tempbx & temp ) ) + { + tempax |= DisableCRT2Display ; + tempbx = 0 ; + } + + if ( pVBInfo->IF_DEF_LCDA == 1 ) /* Select Display Device */ + { + if ( !( pVBInfo->VBType & VB_NoLCD ) ) + { + if ( tempbx & SetCRT2ToLCDA ) + { + if ( tempbx & SetSimuScanMode ) + tempbx &= ( ~( SetCRT2ToLCD | SetCRT2ToRAMDAC | SwitchToCRT2 ) ) ; + else + tempbx &= ( ~( SetCRT2ToLCD | SetCRT2ToRAMDAC | SetCRT2ToTV | SwitchToCRT2 ) ) ; + } + } + } + + /* shampoo add */ + if ( !( tempbx & ( SwitchToCRT2 | SetSimuScanMode ) ) ) /* for driver abnormal */ + { + if ( pVBInfo->IF_DEF_CRT2Monitor == 1 ) + { + if ( tempbx & SetCRT2ToRAMDAC ) + { + tempbx &= ( 0xFF00 | SetCRT2ToRAMDAC | SwitchToCRT2 | SetSimuScanMode ) ; + tempbx &= ( 0x00FF | ( ~SetCRT2ToYPbPr ) ) ; + } + } + else + tempbx &= ( ~( SetCRT2ToRAMDAC | SetCRT2ToLCD | SetCRT2ToTV ) ) ; + } + + if ( !( pVBInfo->VBType & VB_NoLCD ) ) + { + if ( tempbx & SetCRT2ToLCD ) + { + tempbx &= ( 0xFF00 | SetCRT2ToLCD | SwitchToCRT2 | SetSimuScanMode ) ; + tempbx &= ( 0x00FF | ( ~SetCRT2ToYPbPr ) ) ; + } + } + + if ( tempbx & SetCRT2ToSCART ) + { + tempbx &= ( 0xFF00 | SetCRT2ToSCART | SwitchToCRT2 | SetSimuScanMode ) ; + tempbx &= ( 0x00FF | ( ~SetCRT2ToYPbPr ) ) ; + } + + if ( pVBInfo->IF_DEF_YPbPr == 1 ) + { + if ( tempbx & SetCRT2ToYPbPr ) + tempbx &= ( 0xFF00 | SwitchToCRT2 | SetSimuScanMode ) ; + } + + if ( pVBInfo->IF_DEF_HiVision == 1 ) + { + if ( tempbx & SetCRT2ToHiVisionTV ) + tempbx &= ( 0xFF00 | SetCRT2ToHiVisionTV | SwitchToCRT2 | SetSimuScanMode ) ; + } + + if ( tempax & DisableCRT2Display ) /* Set Display Device Info */ + { + if ( !( tempbx & ( SwitchToCRT2 | SetSimuScanMode ) ) ) + tempbx = DisableCRT2Display ; + } + + if ( !( tempbx & DisableCRT2Display ) ) + { + if ( ( !( tempbx & DriverMode ) ) || ( !( modeflag & CRT2Mode ) ) ) + { + if ( pVBInfo->IF_DEF_LCDA == 1 ) + { + if ( !( tempbx & SetCRT2ToLCDA ) ) + tempbx |= ( SetInSlaveMode | SetSimuScanMode ) ; + } + + if ( pVBInfo->IF_DEF_VideoCapture == 1 ) + { + if ( ( ( HwDeviceExtension->jChipType == XG40 ) && ( pVBInfo->Set_VGAType == XG40 ) ) + || ( ( HwDeviceExtension->jChipType == XG41 ) && ( pVBInfo->Set_VGAType == XG41 ) ) + || ( ( HwDeviceExtension->jChipType == XG42 ) && ( pVBInfo->Set_VGAType == XG42 ) ) + || ( ( HwDeviceExtension->jChipType == XG45 ) && ( pVBInfo->Set_VGAType == XG45 ) ) ) + { + if ( ModeNo <= 13 ) + { + if ( !( tempbx & SetCRT2ToRAMDAC ) ) /*CRT2 not need to support*/ + { + tempbx &= ( 0x00FF | ( ~SetInSlaveMode ) ) ; + pVBInfo->SetFlag |= EnableVCMode ; + } + } + } + } + } + + /*LCD+TV can't support in slave mode (Force LCDA+TV->LCDB)*/ + if ( ( tempbx & SetInSlaveMode ) && ( tempbx & SetCRT2ToLCDA ) ) + { + tempbx ^= ( SetCRT2ToLCD | SetCRT2ToLCDA | SetCRT2ToDualEdge ) ; + pVBInfo->SetFlag |= ReserveTVOption ; + } + } + } + + pVBInfo->VBInfo = tempbx ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetTVInfo */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_GetTVInfo( USHORT ModeNo , USHORT ModeIdIndex ,PVB_DEVICE_INFO pVBInfo ) +{ + USHORT temp , + tempbx = 0 , + resinfo = 0 , + modeflag , + index1 ; +/* temp2 , + OutputSelect = *pVBInfo->pOutputSelect ; */ + + tempbx = 0 ; + resinfo = 0 ; + + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; /* si+St_ModeFlag */ + resinfo = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ResInfo ; /* si+St_ResInfo */ + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + resinfo = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_RESINFO ; /* si+Ext_ResInfo */ + } + + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x35 ) ; + tempbx = temp; + if ( tempbx & SetPALTV ) + { + tempbx &= ( SetCHTVOverScan | SetPALMTV | SetPALNTV | SetPALTV ) ; + if ( tempbx & SetPALMTV ) + tempbx &= ~SetPALTV ; /* set to NTSC if PAL-M */ + } + else + tempbx &= ( SetCHTVOverScan | SetNTSCJ | SetPALTV ) ; +/* + if ( pVBInfo->IF_DEF_LVDS == 0 ) + { + index1 = XGINew_GetReg1( pVBInfo->P3d4 , 0x38 ) ; //PAL-M/PAL-N Info + temp2 = ( index1 & 0xC0 ) >> 5 ; //00:PAL, 01:PAL-M, 10:PAL-N + tempbx |= temp2 ; + if ( temp2 & 0x02 ) //PAL-M + tempbx &= ( ~SetPALTV ) ; + } +*/ + } + + if ( pVBInfo->IF_DEF_CH7017 == 1 ) + { + tempbx = XGINew_GetReg1( pVBInfo->P3d4 , 0x35 ) ; + + if ( tempbx & TVOverScan ) + tempbx |= SetCHTVOverScan ; + } + + if ( pVBInfo->IF_DEF_LVDS == 0 ) + { + if ( pVBInfo->VBInfo & SetCRT2ToSCART ) + tempbx |= SetPALTV ; + } + + if ( pVBInfo->IF_DEF_YPbPr == 1 ) + { + if ( pVBInfo->VBInfo & SetCRT2ToYPbPr ) + { + index1 = XGINew_GetReg1( pVBInfo->P3d4 , 0x35 ) ; + index1 &= YPbPrMode ; + + if ( index1 == YPbPrMode525i ) + tempbx |= SetYPbPrMode525i ; + + if ( index1 == YPbPrMode525p ) + tempbx = tempbx | SetYPbPrMode525p; + if ( index1 == YPbPrMode750p) + tempbx = tempbx | SetYPbPrMode750p; + } + } + + if ( pVBInfo->IF_DEF_HiVision == 1 ) + { + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { + tempbx = tempbx | SetYPbPrMode1080i | SetPALTV ; + } + } + + if ( pVBInfo->IF_DEF_LVDS == 0 ) + { /* shampoo */ + if ( ( pVBInfo->VBInfo & SetInSlaveMode ) && ( !( pVBInfo->VBInfo & SetNotSimuMode ) ) ) + tempbx |= TVSimuMode ; + + if ( !( tempbx & SetPALTV ) && ( modeflag > 13 ) && ( resinfo == 8 ) ) /* NTSC 1024x768, */ + tempbx |= NTSC1024x768 ; + + tempbx |= RPLLDIV2XO ; + + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { + if ( pVBInfo->VBInfo & SetInSlaveMode ) + tempbx &=( ~RPLLDIV2XO ) ; + } + else + { + if ( tempbx & ( SetYPbPrMode525p | SetYPbPrMode750p ) ) + tempbx &= ( ~RPLLDIV2XO ) ; + else if ( !( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) ) + { + if ( tempbx & TVSimuMode ) + tempbx &= ( ~RPLLDIV2XO ) ; + } + } + } + } + pVBInfo->TVInfo = tempbx ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetLCDInfo */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGI_GetLCDInfo( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) +{ + USHORT temp , + tempax , + tempbx , + modeflag , + resinfo = 0 , + LCDIdIndex ; + + pVBInfo->LCDResInfo = 0 ; + pVBInfo->LCDTypeInfo = 0 ; + pVBInfo->LCDInfo = 0 ; + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; /* si+St_ModeFlag // */ + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + resinfo = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_RESINFO ; /* si+Ext_ResInfo// */ + } + + temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x36 ) ; /* Get LCD Res.Info */ + tempbx = temp & 0x0F ; + + if ( tempbx == 0 ) + tempbx = Panel1024x768 ; /* default */ + + /* LCD75 [2003/8/22] Vicent */ + if ( ( tempbx == Panel1024x768 ) || ( tempbx == Panel1280x1024 ) ) + { + if ( pVBInfo->VBInfo & DriverMode ) + { + tempax = XGINew_GetReg1( pVBInfo->P3d4 , 0x33 ) ; + if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) + tempax &= 0x0F ; + else + tempax = tempax >> 4 ; + + if ( ( resinfo == 6 ) || ( resinfo == 9 ) ) + { + if ( tempax >= 3 ) + tempbx |= PanelRef75Hz ; + } + else if ( ( resinfo == 7 ) || ( resinfo == 8 ) ) + { + if ( tempax >= 4 ) + tempbx |= PanelRef75Hz ; + } + } + } + + pVBInfo->LCDResInfo = tempbx ; + + /* End of LCD75 */ + + if( pVBInfo->IF_DEF_OEMUtil == 1 ) + { + pVBInfo->LCDTypeInfo = ( temp & 0xf0 ) >> 4 ; + } + + if ( !( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) ) + { + return 0; + } + + tempbx = 0 ; + + temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x37 ) ; + + temp &= ( ScalingLCD | LCDNonExpanding | LCDSyncBit | SetPWDEnable ) ; + + if ( ( pVBInfo->IF_DEF_ScaleLCD == 1 ) && ( temp & LCDNonExpanding ) ) + temp &= ~EnableScalingLCD ; + + tempbx |= temp ; + + LCDIdIndex = XGI_GetLCDCapPtr1(pVBInfo) ; + + tempax = pVBInfo->LCDCapList[ LCDIdIndex ].LCD_Capability ; + + if ( pVBInfo->IF_DEF_LVDS == 0 ) /* shampoo */ + { + if ( ( ( pVBInfo->VBType & VB_XGI302LV ) || ( pVBInfo->VBType & VB_XGI301C ) ) && ( tempax & LCDDualLink ) ) + { + tempbx |= SetLCDDualLink ; + } + } + + if ( pVBInfo->IF_DEF_CH7017 == 1 ) + { + if ( tempax & LCDDualLink ) + { + tempbx |= SetLCDDualLink ; + } + } + + if ( pVBInfo->IF_DEF_LVDS == 0 ) + { + if ( ( pVBInfo->LCDResInfo == Panel1400x1050 ) && ( pVBInfo->VBInfo & SetCRT2ToLCD ) && ( ModeNo > 0x13 ) && ( resinfo == 9 ) && ( !( tempbx & EnableScalingLCD ) ) ) + tempbx |= SetLCDtoNonExpanding ; /* set to center in 1280x1024 LCDB for Panel1400x1050 */ + } + +/* + if ( tempax & LCDBToA ) + { + tempbx |= SetLCDBToA ; + } +*/ + + if ( pVBInfo->IF_DEF_ExpLink == 1 ) + { + if ( modeflag & HalfDCLK ) + { + /* if ( !( pVBInfo->LCDInfo&LCDNonExpanding ) ) */ + if ( !( tempbx & SetLCDtoNonExpanding ) ) + { + tempbx |= EnableLVDSDDA ; + } + else + { + if ( ModeNo > 0x13 ) + { + if ( pVBInfo->LCDResInfo == Panel1024x768 ) + { + if ( resinfo == 4 ) + { /* 512x384 */ + tempbx |= EnableLVDSDDA ; + } + } + } + } + } + } + + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + if ( pVBInfo->VBInfo & SetNotSimuMode ) + { + tempbx |= LCDVESATiming ; + } + } + else + { + tempbx |= LCDVESATiming ; + } + + pVBInfo->LCDInfo = tempbx ; + + if ( pVBInfo->IF_DEF_PWD == 1 ) + { + if ( pVBInfo->LCDInfo & SetPWDEnable ) + { + if ( ( pVBInfo->VBType & VB_XGI302LV ) || ( pVBInfo->VBType & VB_XGI301C ) ) + { + if ( !( tempax & PWDEnable ) ) + { + pVBInfo->LCDInfo &= ~SetPWDEnable ; + } + } + } + } + + if ( pVBInfo->IF_DEF_LVDS == 0 ) + { + if ( tempax & ( LockLCDBToA | StLCDBToA ) ) + { + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + if ( !( tempax & LockLCDBToA ) ) + { + if ( ModeNo <= 0x13 ) + { + pVBInfo->VBInfo &= ~( SetSimuScanMode | SetInSlaveMode | SetCRT2ToLCD ) ; + pVBInfo->VBInfo |= SetCRT2ToLCDA | SetCRT2ToDualEdge ; + } + } + } + } + } + +/* + if ( pVBInfo->IF_DEF_LVDS == 0 ) + { + if ( tempax & ( LockLCDBToA | StLCDBToA ) ) + { + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + if ( !( ( !( tempax & LockLCDBToA ) ) && ( ModeNo > 0x13 ) ) ) + { + pVBInfo->VBInfo&=~(SetSimuScanMode|SetInSlaveMode|SetCRT2ToLCD); + pVBInfo->VBInfo|=SetCRT2ToLCDA|SetCRT2ToDualEdge; + } + } + } + } +*/ + + return( 1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SearchModeID */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGI_SearchModeID( USHORT ModeNo , USHORT *ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +{ + /* PUCHAR VGA_INFO = "\0x11" ; */ + +#ifdef TC + + if ( ModeNo <= 5 ) + ModeNo |= 1 ; + + if ( ModeNo <= 0x13 ) + { + /* for (*ModeIdIndex=0;*ModeIdIndex<sizeof(pVBInfo->SModeIDTable)/sizeof(XGI_StStruct);(*ModeIdIndex)++) */ + for( *ModeIdIndex = 0 ; ; ( *ModeIdIndex )++ ) + { + if ( pVBInfo->SModeIDTable[ *ModeIdIndex ].St_ModeID == ModeNo ) + break ; + if ( pVBInfo->SModeIDTable[ *ModeIdIndex ].St_ModeID == 0xFF ) + return( FALSE ) ; + } + + VGA_INFO = ( PUCHAR )MK_FP( 0 , 0x489 ) ; + + if ( ModeNo == 0x07 ) + { + if ( ( *VGA_INFO & 0x10 ) != 0 ) + ( *ModeIdIndex )++ ; /* 400 lines */ + /* else 350 lines */ + } + + if ( ModeNo <= 3 ) + { + if ( ( *VGA_INFO & 0x80 ) == 0 ) + { + ( *ModeIdIndex )++ ; + if ( ( *VGA_INFO & 0x10 ) != 0 ) + ( *ModeIdIndex )++ ; /* 400 lines */ + /* else 350 lines */ + } + /* else 200 lines */ + } + } + else + { + /* for (*ModeIdIndex=0;*ModeIdIndex<sizeof(pVBInfo->EModeIDTable)/sizeof(XGI_ExtStruct);(*ModeIdIndex)++) */ + for( *ModeIdIndex = 0 ; ; ( *ModeIdIndex )++ ) + { + if ( pVBInfo->EModeIDTable[ *ModeIdIndex ].Ext_ModeID == ModeNo ) + break ; + if ( pVBInfo->EModeIDTable[ *ModeIdIndex ].Ext_ModeID == 0xFF ) + return( FALSE ) ; + } + } + + +#endif + +#ifdef WIN2000 + + if ( ModeNo <= 5 ) + ModeNo |= 1 ; + if ( ModeNo <= 0x13 ) + { + /* for (*ModeIdIndex=0;*ModeIdIndex<sizeof(pVBInfo->SModeIDTable)/sizeof(XGI_StStruct);(*ModeIdIndex)++) */ + for( *ModeIdIndex = 0 ; ; ( *ModeIdIndex )++ ) + { + if ( pVBInfo->SModeIDTable[ *ModeIdIndex ].St_ModeID == ModeNo ) + break ; + if ( pVBInfo->SModeIDTable[ *ModeIdIndex ].St_ModeID == 0xFF ) + return( FALSE ) ; + } + + if ( ModeNo == 0x07 ) + ( *ModeIdIndex )++ ; /* 400 lines */ + + if ( ModeNo <=3 ) + ( *ModeIdIndex ) += 2 ; /* 400 lines */ + /* else 350 lines */ + } + else + { + /* for (*ModeIdIndex=0;*ModeIdIndex<sizeof(pVBInfo->EModeIDTable)/sizeof(XGI_ExtStruct);(*ModeIdIndex)++) */ + for( *ModeIdIndex = 0 ; ; ( *ModeIdIndex )++ ) + { + if ( pVBInfo->EModeIDTable[ *ModeIdIndex ].Ext_ModeID == ModeNo ) + break ; + if ( pVBInfo->EModeIDTable[ *ModeIdIndex ].Ext_ModeID == 0xFF ) + return( FALSE ) ; + } + } + +#endif + +#ifdef LINUX /* chiawen for linux solution */ + + if ( ModeNo <= 5 ) + ModeNo |= 1 ; + if ( ModeNo <= 0x13 ) + { + /* for (*ModeIdIndex=0;*ModeIdIndex<sizeof(pVBInfo->SModeIDTable)/sizeof(XGI_StStruct);(*ModeIdIndex)++) */ + for( *ModeIdIndex = 0 ; ; ( *ModeIdIndex )++ ) + { + if ( pVBInfo->SModeIDTable[ *ModeIdIndex ].St_ModeID == ModeNo ) + break ; + if ( pVBInfo->SModeIDTable[ *ModeIdIndex ].St_ModeID == 0xFF ) + return( FALSE ) ; + } + + if ( ModeNo == 0x07 ) + ( *ModeIdIndex )++ ; /* 400 lines */ + + if ( ModeNo <= 3 ) + ( *ModeIdIndex ) += 2 ; /* 400 lines */ + /* else 350 lines */ + } + else + { + /* for (*ModeIdIndex=0;*ModeIdIndex<sizeof(pVBInfo->EModeIDTable)/sizeof(XGI_ExtStruct);(*ModeIdIndex)++) */ + for( *ModeIdIndex = 0 ; ; ( *ModeIdIndex )++ ) + { + if ( pVBInfo->EModeIDTable[ *ModeIdIndex ].Ext_ModeID == ModeNo ) + break ; + if ( pVBInfo->EModeIDTable[ *ModeIdIndex ].Ext_ModeID == 0xFF ) + return( FALSE ) ; + } + } + +#endif + + return( TRUE ) ; +} + + + + +/* win2000 MM adapter not support standard mode! */ + +#if 0 +/* --------------------------------------------------------------------- */ +/* Function : */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static BOOLEAN XGINew_CheckMemorySize(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo) +{ + USHORT memorysize , + modeflag , + temp , + temp1 , + tmp ; + +/* if ( ( HwDeviceExtension->jChipType == XGI_650 ) || + ( HwDeviceExtension->jChipType == XGI_650M ) ) + { + return( TRUE ) ; + } */ + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + } + else { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + } + + /* ModeType = modeflag&ModeInfoFlag ; // Get mode type */ + + memorysize = modeflag & MemoryInfoFlag ; + memorysize = memorysize > MemorySizeShift ; + memorysize++ ; /* Get memory size */ + + temp = XGINew_GetReg1( pVBInfo->P3c4 , 0x14 ) ; /* Get DRAM Size */ + tmp = temp ; + + if ( HwDeviceExtension->jChipType == XG40 ) + { + temp = 1 << ( ( temp & 0x0F0 ) >> 4 ) ; /* memory size per channel SR14[7:4] */ + if ( ( tmp & 0x0c ) == 0x0C ) /* Qual channels */ + { + temp <<= 2 ; + } + else if ( ( tmp & 0x0c ) == 0x08 ) /* Dual channels */ + { + temp <<= 1 ; + } + } + else if ( HwDeviceExtension->jChipType == XG42 ) + { + temp = 1 << ( ( temp & 0x0F0 ) >> 4 ) ; /* memory size per channel SR14[7:4] */ + if ( ( tmp & 0x04 ) == 0x04 ) /* Dual channels */ + { + temp <<= 1 ; + } + } + else if ( HwDeviceExtension->jChipType == XG45 ) + { + temp = 1 << ( ( temp & 0x0F0 ) >> 4 ) ; /* memory size per channel SR14[7:4] */ + if ( ( tmp & 0x0c ) == 0x0C ) /* Qual channels */ + { + temp <<= 2 ; + } + else if ( ( tmp & 0x0c ) == 0x08 ) /* triple channels */ + { + temp1 = temp ; + temp <<= 1 ; + temp += temp1 ; + } + else if ( ( tmp & 0x0c ) == 0x04 ) /* Dual channels */ + { + temp <<= 1 ; + } + } + if ( temp < memorysize ) + return( FALSE ) ; + else + return( TRUE ) ; +} +#endif + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_IsLowResolution */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +/*void XGINew_IsLowResolution( USHORT ModeNo , USHORT ModeIdIndex, BOOLEAN XGINew_CheckMemorySize(PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo,USHORT ModeIdIndex,PVB_DEVICE_INFO pVBInfo) +{ + USHORT data ; + USHORT ModeFlag ; + + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x0F ) ; + data &= 0x7F ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x0F , data ) ; + + if ( ModeNo > 0x13 ) + { + ModeFlag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + if ( ( ModeFlag & HalfDCLK ) && ( ModeFlag & DoubleScanMode ) ) + { + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x0F ) ; + data |= 0x80 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x0F , data ) ; + data = XGINew_GetReg1( pVBInfo->P3c4 , 0x01 ) ; + data &= 0xF7 ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x01 , data ) ; + } + } +} + +*/ + +/* --------------------------------------------------------------------- */ +/* Function : XGI_DisplayOn */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_DisplayOn( PVB_DEVICE_INFO pVBInfo ) +{ + XGINew_SetRegANDOR(pVBInfo->P3c4,0x01,0xDF,0x00); +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_DisplayOff */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_DisplayOff( PVB_DEVICE_INFO pVBInfo ) +{ + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x01 , 0xDF , 0x20 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_WaitDisply */ +/* Input : */ +/* Output : */ +/* Description : chiawen for sensecrt1 */ +/* --------------------------------------------------------------------- */ +void XGI_WaitDisply( PVB_DEVICE_INFO pVBInfo ) +{ + while( ( XGINew_GetReg2( pVBInfo->P3da ) & 0x01 ) ) + break ; + + while( !( XGINew_GetReg2( pVBInfo->P3da ) & 0x01 ) ) + break ; +} + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SenseCRT1 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ + +void XGI_SenseCRT1( PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR CRTCData[ 17 ] = { 0x5F , 0x4F , 0x50 , 0x82 , 0x55 , 0x81 , + 0x0B , 0x3E , 0xE9 , 0x0B , 0xDF , 0xE7 , + 0x04 , 0x00 , 0x00 , 0x05 , 0x00 } ; + + UCHAR SR01 = 0 , SR1F = 0 , SR07 = 0 , SR06 = 0 ; + + UCHAR CR17 , CR63 , SR31 ; + USHORT temp ; + UCHAR DAC_TEST_PARMS[ 3 ] = { 0x0F , 0x0F , 0x0F } ; + + int i ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x05 , 0x86 ) ; + + /* [2004/05/06] Vicent to fix XG42 single LCD sense to CRT+LCD */ + XGINew_SetReg1( pVBInfo->P3d4 , 0x57 , 0x4A ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x53 , ( UCHAR )( XGINew_GetReg1( pVBInfo->P3d4 , 0x53 ) | 0x02 ) ) ; + + SR31 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x31 ) ; + CR63 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x63 ) ; + SR01 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x01 ) ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x01 , ( UCHAR )( SR01 & 0xDF ) ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x63 , ( UCHAR )( CR63 & 0xBF ) ) ; + + CR17 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x17 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x17 , ( UCHAR )( CR17 | 0x80 ) ) ; + + SR1F = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x1F ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x1F , ( UCHAR )( SR1F | 0x04 ) ) ; + + SR07 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x07 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x07 , ( UCHAR )( SR07 & 0xFB ) ) ; + SR06 = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x06 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x06 , ( UCHAR )( SR06 & 0xC3 ) ) ; + + XGINew_SetReg1( pVBInfo->P3d4 , 0x11 , 0x00 ) ; + + for( i = 0 ; i < 8 ; i++ ) + XGINew_SetReg1( pVBInfo->P3d4 , ( USHORT )i , CRTCData[ i ] ) ; + + for( i = 8 ; i < 11 ; i++ ) + XGINew_SetReg1( pVBInfo->P3d4 , ( USHORT )( i + 8 ) , CRTCData[ i ] ) ; + + for( i = 11 ; i < 13 ; i++ ) + XGINew_SetReg1( pVBInfo->P3d4 , ( USHORT )( i + 4 ) , CRTCData[ i ] ) ; + + for( i = 13 ; i < 16 ; i++ ) + XGINew_SetReg1( pVBInfo->P3c4 , ( USHORT )( i - 3 ) , CRTCData[ i ] ) ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x0E , ( UCHAR )( CRTCData[ 16 ] & 0xE0 ) ) ; + + XGINew_SetReg1( pVBInfo->P3c4 , 0x31 , 0x00 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2B , 0x1B ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x2C , 0xE1 ) ; + + XGINew_SetReg3( pVBInfo->P3c8 , 0x00 ) ; + for( i = 0 ; i < 256 ; i++ ) + { + XGINew_SetReg3( ( USHORT )( pVBInfo->P3c8 + 1 ) , ( UCHAR )DAC_TEST_PARMS[ 0 ] ) ; + XGINew_SetReg3( ( USHORT )( pVBInfo->P3c8 + 1 ) , ( UCHAR )DAC_TEST_PARMS[ 1 ] ) ; + XGINew_SetReg3( ( USHORT )( pVBInfo->P3c8 + 1 ) , ( UCHAR )DAC_TEST_PARMS[ 2 ] ) ; + } + + XGI_VBLongWait( pVBInfo ) ; + XGI_VBLongWait( pVBInfo ) ; + XGI_VBLongWait( pVBInfo ) ; + + XGINew_LCD_Wait_Time( 0x01 , pVBInfo ) ; + XGI_WaitDisply( pVBInfo ) ; + + temp = XGINew_GetReg2( pVBInfo->P3c2 ) ; + if ( temp & 0x10 ) + { + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x32 , 0xDF , 0x20 ) ; + } + else + { + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x32 , 0xDF , 0x00 ) ; + } + + /* alan, avoid display something, set BLACK DAC if not restore DAC */ + XGINew_SetReg3( pVBInfo->P3c8 , 0x00 ) ; + + for( i = 0 ; i < 256 ; i++ ) + { + XGINew_SetReg3( ( USHORT )( pVBInfo->P3c8 + 1 ) , 0 ) ; + XGINew_SetReg3( ( USHORT )( pVBInfo->P3c8 + 1 ) , 0 ) ; + XGINew_SetReg3( ( USHORT )( pVBInfo->P3c8 + 1 ) , 0 ) ; + } + + XGINew_SetReg1( pVBInfo->P3c4 , 0x01 , SR01 ) ; + XGINew_SetReg1( pVBInfo->P3d4 , 0x63 , CR63 ) ; + XGINew_SetReg1( pVBInfo->P3c4 , 0x31 , SR31 ) ; + + /* [2004/05/11] Vicent */ + XGINew_SetReg1( pVBInfo->P3d4 , 0x53 , ( UCHAR )( XGINew_GetReg1( pVBInfo->P3d4 , 0x53 ) & 0xFD ) ) ; +} + + + + + +#ifdef TC +/* --------------------------------------------------------------------- */ +/* Function : INT1AReturnCode */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +int INT1AReturnCode( union REGS regs ) +{ + if ( regs.x.cflag ) + { + /* printf( "Error to find pci device!\n" ) ; */ + return( 1 ) ; + } + + switch(regs.h.ah) + { + case 0: return 0; + break ; + case 0x81: + printf( "Function not support\n" ) ; + break ; + case 0x83: + printf( "bad vendor id\n" ) ; + break ; + case 0x86: + printf( "device not found\n" ) ; + break ; + case 0x87: + printf( "bad register number\n" ) ; + break ; + case 0x88: + printf( "set failed\n" ) ; + break ; + case 0x89: + printf( "buffer too small" ) ; + break ; + default: + break ; + } + return( 1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : FindPCIIOBase */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +unsigned FindPCIIOBase( unsigned index , unsigned deviceid ) +{ + union REGS regs ; + + regs.h.ah = 0xb1 ; /* PCI_FUNCTION_ID */ + regs.h.al = 0x02 ; /* FIND_PCI_DEVICE */ + regs.x.cx = deviceid ; + regs.x.dx = 0x1039 ; + regs.x.si = index ; /* find n-th device */ + + int86( 0x1A , ®s , ®s ) ; + + if ( INT1AReturnCode( regs ) != 0 ) + return( 0 ) ; + + /* regs.h.bh bus number */ + /* regs.h.bl device number */ + regs.h.ah = 0xb1 ; /* PCI_FUNCTION_ID */ + regs.h.al = 0x09 ; /* READ_CONFIG_WORD */ + regs.x.cx = deviceid ; + regs.x.dx = 0x1039 ; + regs.x.di = 0x18 ; /* register number */ + int86( 0x1A , ®s , ®s ) ; + + if ( INT1AReturnCode( regs ) != 0 ) + return( 0 ) ; + + return( regs.x.cx ) ; +} + +#endif + + + +#ifdef TC +/* --------------------------------------------------------------------- */ +/* Function : main */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void main(int argc, char *argv[]) +{ + XGI_HW_DEVICE_INFO HwDeviceExtension ; + USHORT temp ; + USHORT ModeNo ; + + /* HwDeviceExtension.pjVirtualRomBase =(PUCHAR) MK_FP(0xC000,0); */ + /* HwDeviceExtension.pjVideoMemoryAddress = (PUCHAR)MK_FP(0xA000,0); */ + + + HwDeviceExtension.pjIOAddress = ( FindPCIIOBase( 0 ,0x6300 ) & 0xFF80 ) + 0x30 ; + HwDeviceExtension.jChipType = XGI_340 ; + + + + /* HwDeviceExtension.pjIOAddress = ( FindPCIIOBase( 0 , 0x5315 ) & 0xFF80 ) + 0x30 ; */ + + HwDeviceExtension.pjIOAddress = ( FindPCIIOBase( 0 , 0x330 ) & 0xFF80 ) + 0x30 ; + HwDeviceExtension.jChipType = XGI_340 ; + + + HwDeviceExtension.ujVBChipID = VB_CHIP_301 ; + StrCpy(HwDeviceExtension.szVBIOSVer , "0.84" ) ; + HwDeviceExtension.bSkipDramSizing = FALSE ; + HwDeviceExtension.ulVideoMemorySize = 0 ; + + if ( argc == 2 ) + { + ModeNo = atoi( argv[ 1 ] ) ; + } + else + { + ModeNo = 0x2e ; + /* ModeNo = 0x37 ; 1024x768x 4bpp */ + /* ModeNo = 0x38 ; 1024x768x 8bpp */ + /* ModeNo = 0x4A ; 1024x768x 16bpp */ + /* ModeNo = 0x47 ; 800x600x 16bpp */ + } + + /* XGIInitNew( &HwDeviceExtension ) ; */ + XGISetModeNew( &HwDeviceExtension , ModeNo ) ; +} +#endif + + +#if 0 +/* --------------------------------------------------------------------- */ +/* Function : XGI_WaitDisplay */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGI_WaitDisplay( PVB_DEVICE_INFO pVBInfo ) +{ + while( !( XGINew_GetReg2( pVBInfo->P3da ) & 0x01 ) ) ; + + while( XGINew_GetReg2( pVBInfo->P3da ) & 0x01 ) ; +} +#endif + + + + + +/* --------------------------------------------------------------------- */ +/* Function : */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGI_CheckDualChip( PVB_DEVICE_INFO pVBInfo ) +{ + /* Check H/W trap that 2nd chip is present or not. */ + return( ( BOOLEAN )(XGINew_GetReg1( pVBInfo->P3c4 , 0x3A ) & XGI_MASK_DUAL_CHIP ) ) ; +} + + + +/* --------------------------------------------------------------------- */ +/* Function : SetDualChipRegs */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void SetDualChipRegs( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +{ + + USHORT BaseAddr2nd = (USHORT)HwDeviceExtension->pj2ndIOAddress ; + USHORT XGINew_P3CC = pVBInfo->BaseAddr + MISC_OUTPUT_REG_READ_PORT ; + USHORT XGINew_2ndP3CE = BaseAddr2nd + GRAPH_ADDRESS_PORT ; + USHORT XGINew_2ndP3C4 = BaseAddr2nd + SEQ_ADDRESS_PORT ; + USHORT XGINew_2ndP3C2 = BaseAddr2nd + MISC_OUTPUT_REG_WRITE_PORT ; + UCHAR tempal,i; + pVBInfo->BaseAddr = (USHORT)HwDeviceExtension->pjIOAddress ; + for( i = 0x00 ; i <= 0x04 ; i++ ) + { /* SR0 - SR4 */ + tempal = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , i ) ; + XGINew_SetReg1( XGINew_2ndP3C4 , i , tempal ) ; + } + for( i = 0x00 ; i <= 0x08 ; i++ ) + { /* GR0 - GR8 */ + tempal = ( UCHAR )XGINew_GetReg1( pVBInfo->P3ce , i ) ; + XGINew_SetReg1( XGINew_2ndP3CE , i , tempal ) ; + } + /* OpenKey in 2nd chip */ + XGINew_SetReg1( XGINew_2ndP3C4 , 0x05 , 0x86 ) ; + + /* Copy SR06 to 2nd chip */ + tempal = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x06 ) ; + XGINew_SetReg1( XGINew_2ndP3C4 , 0x06 , tempal ) ; + + /* Copy SR21 to 2nd chip */ + tempal = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x21 ) ; + XGINew_SetReg1( XGINew_2ndP3C4 , 0x21 , tempal ) ; + + /* Miscellaneous reg(input port 3cch,output port 3c2h) */ + tempal = ( UCHAR )XGINew_GetReg2( XGINew_P3CC ) ; /* 3cc */ + XGINew_SetReg3( XGINew_2ndP3C2 , tempal ) ; + + /* Close key in 2nd chip */ + XGINew_SetReg1( XGINew_2ndP3C4 , 0x05 , 0x00 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT2Group301 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGI_SetCRT2Group301( USHORT ModeNo , PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT ModeIdIndex , + RefreshRateTableIndex ; + + pVBInfo->SetFlag |= ProgrammingCRT2 ; + XGI_SearchModeID( ModeNo , &ModeIdIndex, pVBInfo ) ; + pVBInfo->SelectCRT2Rate = 4 ; + RefreshRateTableIndex = XGI_GetRatePtrCRT2( ModeNo , ModeIdIndex, pVBInfo ) ; + XGI_SaveCRT2Info( ModeNo, pVBInfo ) ; + XGI_GetCRT2ResInfo( ModeNo , ModeIdIndex, pVBInfo) ; + XGI_GetCRT2Data( ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + XGI_PreSetGroup1( ModeNo , ModeIdIndex , HwDeviceExtension , RefreshRateTableIndex, pVBInfo ) ; + XGI_SetGroup1( ModeNo , ModeIdIndex , HwDeviceExtension , RefreshRateTableIndex, pVBInfo ) ; + XGI_SetLockRegs( ModeNo , ModeIdIndex , HwDeviceExtension , RefreshRateTableIndex, pVBInfo ) ; + XGI_SetGroup2( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; + XGI_SetLCDRegs(ModeNo , ModeIdIndex , HwDeviceExtension , RefreshRateTableIndex, pVBInfo ) ; + XGI_SetTap4Regs(pVBInfo) ; + XGI_SetGroup3(ModeNo, ModeIdIndex, pVBInfo); + XGI_SetGroup4( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; + XGI_SetCRT2VCLK( ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + XGI_SetGroup5( ModeNo , ModeIdIndex, pVBInfo) ; + XGI_AutoThreshold( pVBInfo) ; + return 1 ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_AutoThreshold */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_AutoThreshold( PVB_DEVICE_INFO pVBInfo ) +{ + if ( !( pVBInfo->SetFlag & Win9xDOSMode ) ) + XGINew_SetRegOR( pVBInfo->Part1Port , 0x01 , 0x40 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SaveCRT2Info */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SaveCRT2Info( USHORT ModeNo , PVB_DEVICE_INFO pVBInfo) +{ + USHORT temp1 , + temp2 ; + + XGINew_SetReg1( pVBInfo->P3d4 , 0x34 , ModeNo ) ; /* reserve CR34 for CRT1 Mode No */ + temp1 = ( pVBInfo->VBInfo&SetInSlaveMode ) >> 8 ; + temp2 = ~( SetInSlaveMode >> 8 ) ; + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x31 , temp2 , temp1 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetCRT2ResInfo */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_GetCRT2ResInfo( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT xres , + yres , + modeflag , + resindex ; + + resindex = XGI_GetResInfo( ModeNo , ModeIdIndex, pVBInfo) ; + if ( ModeNo <= 0x13 ) + { + xres = pVBInfo->StResInfo[ resindex ].HTotal ; + yres = pVBInfo->StResInfo[ resindex ].VTotal ; + /* modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; si+St_ResInfo */ + } + else + { + xres = pVBInfo->ModeResInfo[ resindex ].HTotal ; /* xres->ax */ + yres = pVBInfo->ModeResInfo[ resindex ].VTotal ; /* yres->bx */ + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex].Ext_ModeFlag ; /* si+St_ModeFlag */ + +/* if ( pVBInfo->IF_DEF_FSTN ) + { + xres *= 2 ; + yres *= 2 ; + } + else + { +*/ + if ( modeflag & HalfDCLK ) + xres *= 2; + + if ( modeflag & DoubleScanMode ) + yres *= 2 ; +/* } */ + } + + if ( pVBInfo->VBInfo & SetCRT2ToLCD ) + { + if ( pVBInfo->IF_DEF_LVDS == 0 ) + { + if ( pVBInfo->LCDResInfo == Panel1600x1200 ) + { + if ( !( pVBInfo->LCDInfo & LCDVESATiming ) ) + { + if ( yres == 1024 ) + yres = 1056 ; + } + } + + if ( pVBInfo->LCDResInfo == Panel1280x1024 ) + { + if ( yres == 400 ) + yres = 405 ; + else if ( yres == 350 ) + yres = 360 ; + + if ( pVBInfo->LCDInfo & LCDVESATiming ) + { + if ( yres == 360 ) + yres = 375 ; + } + } + + if ( pVBInfo->LCDResInfo == Panel1024x768 ) + { + if ( !( pVBInfo->LCDInfo & LCDVESATiming ) ) + { + if ( !( pVBInfo->LCDInfo & LCDNonExpanding ) ) + { + if ( yres == 350 ) + yres = 357 ; + else if ( yres == 400 ) + yres = 420 ; + else if ( yres == 480 ) + yres = 525 ; + } + } + } + } + + if ( xres == 720 ) + xres = 640 ; + } + + pVBInfo->VGAHDE = xres ; + pVBInfo->HDE = xres ; + pVBInfo->VGAVDE = yres ; + pVBInfo->VDE = yres ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_IsLCDDualLink */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGI_IsLCDDualLink( PVB_DEVICE_INFO pVBInfo ) +{ +/* USHORT flag ; */ + + if ( ( ( (pVBInfo->VBInfo & SetCRT2ToLCD ) | SetCRT2ToLCDA ) ) && ( pVBInfo->LCDInfo & SetLCDDualLink ) ) /* shampoo0129 */ + return ( 1 ) ; + + return( 0 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetCRT2Data */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_GetCRT2Data( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempax = 0, + tempbx , + modeflag , + resinfo ; + /* CRT2Index , + ResIndex ; */ + + XGI_LCDDataStruct *LCDPtr = NULL ; + XGI_TVDataStruct *TVPtr = NULL ; + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; /* si+St_ResInfo */ + resinfo = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ResInfo ; + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; /* si+Ext_ResInfo */ + resinfo = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_RESINFO ; + } + + pVBInfo->NewFlickerMode = 0 ; + pVBInfo->RVBHRS = 50 ; + + if ( pVBInfo->VBInfo & SetCRT2ToRAMDAC ) + { + XGI_GetRAMDAC2DATA( ModeNo , ModeIdIndex , RefreshRateTableIndex,pVBInfo ) ; + return ; + } + + tempbx = 4 ; + + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) + { + LCDPtr = (XGI_LCDDataStruct* )XGI_GetLcdPtr( tempbx, ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + + pVBInfo->RVBHCMAX = LCDPtr->RVBHCMAX ; + pVBInfo->RVBHCFACT = LCDPtr->RVBHCFACT ; + pVBInfo->VGAHT = LCDPtr->VGAHT ; + pVBInfo->VGAVT = LCDPtr->VGAVT ; + pVBInfo->HT = LCDPtr->LCDHT ; + pVBInfo->VT = LCDPtr->LCDVT ; + + if ( pVBInfo->LCDResInfo == Panel1024x768 ) + { + tempax = 1024 ; + tempbx = 768 ; + + if ( !( pVBInfo->LCDInfo & LCDVESATiming ) ) + { + if ( pVBInfo->VGAVDE == 357 ) + tempbx = 527 ; + else if ( pVBInfo->VGAVDE == 420 ) + tempbx = 620 ; + else if ( pVBInfo->VGAVDE == 525 ) + tempbx = 775 ; + else if ( pVBInfo->VGAVDE == 600 ) + tempbx = 775 ; + /* else if(pVBInfo->VGAVDE==350) tempbx=560; */ + /* else if(pVBInfo->VGAVDE==400) tempbx=640; */ + else + tempbx = 768 ; + } + else + tempbx = 768 ; + } + else if ( pVBInfo->LCDResInfo == Panel1024x768x75 ) + { + tempax = 1024 ; + tempbx = 768 ; + } + else if ( pVBInfo->LCDResInfo == Panel1280x1024 ) + { + tempax = 1280 ; + if ( pVBInfo->VGAVDE == 360 ) + tempbx = 768 ; + else if ( pVBInfo->VGAVDE == 375 ) + tempbx = 800 ; + else if ( pVBInfo->VGAVDE == 405 ) + tempbx = 864 ; + else + tempbx = 1024 ; + } + else if ( pVBInfo->LCDResInfo == Panel1280x1024x75 ) + { + tempax = 1280 ; + tempbx = 1024 ; + } + else if ( pVBInfo->LCDResInfo == Panel1280x960 ) + { + tempax = 1280 ; + if ( pVBInfo->VGAVDE == 350 ) + tempbx = 700 ; + else if ( pVBInfo->VGAVDE == 400 ) + tempbx = 800 ; + else if ( pVBInfo->VGAVDE == 1024 ) + tempbx = 960 ; + else + tempbx = 960 ; + } + else if ( pVBInfo->LCDResInfo == Panel1400x1050 ) + { + tempax = 1400 ; + tempbx = 1050 ; + + if ( pVBInfo->VGAVDE == 1024 ) + { + tempax = 1280 ; + tempbx = 1024 ; + } + } + else if ( pVBInfo->LCDResInfo == Panel1600x1200 ) + { + tempax = 1600 ; + tempbx = 1200 ; /* alan 10/14/2003 */ + if ( !( pVBInfo->LCDInfo & LCDVESATiming ) ) + { + if ( pVBInfo->VGAVDE == 350 ) + tempbx = 875 ; + else if ( pVBInfo->VGAVDE == 400 ) + tempbx = 1000 ; + } + } + + if ( pVBInfo->LCDInfo & LCDNonExpanding ) + { + tempax = pVBInfo->VGAHDE ; + tempbx = pVBInfo->VGAVDE ; + } + + pVBInfo->HDE = tempax ; + pVBInfo->VDE = tempbx ; + return ; + } + + if ( pVBInfo->VBInfo & ( SetCRT2ToTV ) ) + { + tempbx = 4 ; + TVPtr = ( XGI_TVDataStruct * )XGI_GetTVPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + + pVBInfo->RVBHCMAX = TVPtr->RVBHCMAX ; + pVBInfo->RVBHCFACT = TVPtr->RVBHCFACT ; + pVBInfo->VGAHT = TVPtr->VGAHT ; + pVBInfo->VGAVT = TVPtr->VGAVT ; + pVBInfo->HDE = TVPtr->TVHDE ; + pVBInfo->VDE = TVPtr->TVVDE ; + pVBInfo->RVBHRS = TVPtr->RVBHRS ; + pVBInfo->NewFlickerMode = TVPtr->FlickerMode ; + + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { + if ( resinfo == 0x08 ) + pVBInfo->NewFlickerMode = 0x40 ; + else if ( resinfo == 0x09 ) + pVBInfo->NewFlickerMode = 0x40 ; + else if ( resinfo == 0x12 ) + pVBInfo->NewFlickerMode = 0x40 ; + + if ( pVBInfo->VGAVDE == 350 ) + pVBInfo->TVInfo |= TVSimuMode ; + + tempax = ExtHiTVHT ; + tempbx = ExtHiTVVT ; + + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + if ( pVBInfo->TVInfo & TVSimuMode ) + { + tempax = StHiTVHT ; + tempbx = StHiTVVT ; + + if ( !( modeflag & Charx8Dot ) ) + { + tempax = StHiTextTVHT ; + tempbx = StHiTextTVVT ; + } + } + } + } + else if ( pVBInfo->VBInfo & SetCRT2ToYPbPr ) + { + if ( pVBInfo->TVInfo & SetYPbPrMode750p ) + { + tempax = YPbPrTV750pHT ; /* Ext750pTVHT */ + tempbx = YPbPrTV750pVT ; /* Ext750pTVVT */ + } + + if ( pVBInfo->TVInfo & SetYPbPrMode525p ) + { + tempax = YPbPrTV525pHT ; /* Ext525pTVHT */ + tempbx = YPbPrTV525pVT ; /* Ext525pTVVT */ + } + else if ( pVBInfo->TVInfo & SetYPbPrMode525i ) + { + tempax = YPbPrTV525iHT ; /* Ext525iTVHT */ + tempbx = YPbPrTV525iVT ; /* Ext525iTVVT */ + if ( pVBInfo->TVInfo & NTSC1024x768 ) + tempax = NTSC1024x768HT ; + } + } + else + { + tempax = PALHT ; + tempbx = PALVT ; + if ( !( pVBInfo->TVInfo & SetPALTV ) ) + { + tempax = NTSCHT ; + tempbx = NTSCVT ; + if ( pVBInfo->TVInfo & NTSC1024x768 ) + tempax = NTSC1024x768HT ; + } + } + + pVBInfo->HT = tempax ; + pVBInfo->VT = tempbx ; + return ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT2VCLK */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetCRT2VCLK( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR di_0 , + di_1 , + tempal ; + + tempal = XGI_GetVCLKPtr( RefreshRateTableIndex , ModeNo , ModeIdIndex, pVBInfo ) ; + XGI_GetVCLKLen( tempal, &di_0 , &di_1, pVBInfo ) ; + XGI_GetLCDVCLKPtr( &di_0 , &di_1, pVBInfo ) ; + + if ( pVBInfo->VBType & VB_XGI301 ) /* shampoo 0129 */ + { /* 301 */ + XGINew_SetReg1(pVBInfo->Part4Port , 0x0A , 0x10 ) ; + XGINew_SetReg1(pVBInfo->Part4Port , 0x0B , di_1 ) ; + XGINew_SetReg1(pVBInfo->Part4Port , 0x0A , di_0 ) ; + } + else + { /* 301b/302b/301lv/302lv */ + XGINew_SetReg1( pVBInfo->Part4Port , 0x0A , di_0 ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x0B , di_1 ) ; + } + + XGINew_SetReg1( pVBInfo->Part4Port , 0x00 , 0x12 ) ; + + if ( pVBInfo->VBInfo & SetCRT2ToRAMDAC ) + XGINew_SetRegOR( pVBInfo->Part4Port , 0x12 , 0x28 ) ; + else + XGINew_SetRegOR( pVBInfo->Part4Port , 0x12 , 0x08 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GETLCDVCLKPtr */ +/* Input : */ +/* Output : al -> VCLK Index */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_GetLCDVCLKPtr( UCHAR* di_0 , UCHAR *di_1, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT index ; + + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) + { + if ( pVBInfo->IF_DEF_ScaleLCD == 1 ) + { + if ( pVBInfo->LCDInfo & EnableScalingLCD ) + return ; + } + + /* index = XGI_GetLCDCapPtr(pVBInfo) ; */ + index = XGI_GetLCDCapPtr1( pVBInfo) ; + + if ( pVBInfo->VBInfo & SetCRT2ToLCD ) + { /* LCDB */ + *di_0 = pVBInfo->LCDCapList[ index ].LCUCHAR_VCLKData1 ; + *di_1 = pVBInfo->LCDCapList[ index ].LCUCHAR_VCLKData2 ; + } + else + { /* LCDA */ + *di_0 = pVBInfo->LCDCapList[ index ].LCDA_VCLKData1 ; + *di_1 = pVBInfo->LCDCapList[ index ].LCDA_VCLKData2 ; + } + } + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetVCLKPtr */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +UCHAR XGI_GetVCLKPtr(USHORT RefreshRateTableIndex,USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) +{ + + USHORT index , + modeflag ; + + + UCHAR tempal ; + + if ( ModeNo <= 0x13 ) + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; /* si+St_ResInfo */ + else + modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag; /* si+Ext_ResInfo */ + + + if ( ( pVBInfo->SetFlag & ProgrammingCRT2 ) && ( !( pVBInfo->LCDInfo & EnableScalingLCD ) ) ) + { /* {LCDA/LCDB} */ + index = XGI_GetLCDCapPtr(pVBInfo) ; + tempal = pVBInfo->LCDCapList[ index ].LCD_VCLK ; + + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) + return tempal ; + + /* {TV} */ + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV| VB_XGI302LV| VB_XGI301C ) ) + { + if(pVBInfo->VBInfo&SetCRT2ToHiVisionTV) + { + tempal = HiTVVCLKDIV2; + if(!(pVBInfo->TVInfo & RPLLDIV2XO)) + tempal = HiTVVCLK; + if(pVBInfo->TVInfo & TVSimuMode) + { + tempal = HiTVSimuVCLK; + if(!(modeflag & Charx8Dot)) + tempal = HiTVTextVCLK; + + } + return tempal; + } + + if ( pVBInfo->TVInfo & SetYPbPrMode750p ) + { + tempal = YPbPr750pVCLK ; + return tempal ; + } + + if ( pVBInfo->TVInfo & SetYPbPrMode525p ) + { + tempal = YPbPr525pVCLK ; + return tempal ; + } + + tempal = NTSC1024VCLK ; + + if ( !( pVBInfo->TVInfo & NTSC1024x768 ) ) + { + tempal = TVVCLKDIV2 ; + if ( !( pVBInfo->TVInfo & RPLLDIV2XO ) ) + tempal = TVVCLK ; + } + + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + return tempal ; + } + /*else + if((pVBInfo->IF_DEF_CH7017==1)&&(pVBInfo->VBType&VB_CH7017)) + { + if(ModeNo<=0x13) + *tempal = pVBInfo->SModeIDTable[ModeIdIndex].St_CRT2CRTC; + else + *tempal = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC; + *tempal = *tempal & 0x1F; + + tempbx = 0; + if(pVBInfo->TVInfo & SetPALTV) + tempbx = tempbx + 2; + if(pVBInfo->TVInfo & SetCHTVOverScan) + tempbx++; + tempbx = tempbx << 1; + } */ + } /* {End of VB} */ + + tempal = ( UCHAR )XGINew_GetReg2( ( USHORT )( pVBInfo->P3ca + 0x02 ) ) ; + tempal = tempal >> 2 ; + tempal &= 0x03 ; + + if ( ( pVBInfo->LCDInfo & EnableScalingLCD ) && ( modeflag & Charx8Dot ) ) /* for Dot8 Scaling LCD */ + tempal = tempal ^ tempal ; /* ; set to VCLK25MHz always */ + + if ( ModeNo <= 0x13 ) + return tempal ; + + tempal = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRTVCLK ; + return tempal ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetVCLKLen */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_GetVCLKLen(UCHAR tempal,UCHAR* di_0,UCHAR* di_1, PVB_DEVICE_INFO pVBInfo) +{ + if ( pVBInfo->VBType & ( VB_XGI301 | VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + if ( ( !( pVBInfo->VBInfo & SetCRT2ToLCDA ) ) && ( pVBInfo->SetFlag & ProgrammingCRT2 ) ) + { + *di_0 = ( UCHAR )XGI_VBVCLKData[ tempal ].SR2B ; + *di_1 = XGI_VBVCLKData[ tempal ].SR2C ; + } + } + else + { + *di_0 = XGI_VCLKData[ tempal ].SR2B ; + *di_1 = XGI_VCLKData[ tempal ].SR2C ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT2Offset */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGI_SetCRT2Offset( USHORT ModeNo , + USHORT ModeIdIndex , USHORT RefreshRateTableIndex , PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT offset ; + UCHAR temp ; + + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + return ; + } + + offset = XGI_GetOffset( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; + temp = ( UCHAR )( offset & 0xFF ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x07 , temp ) ; + temp =( UCHAR)( ( offset & 0xFF00 ) >> 8 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x09 , temp ) ; + temp =( UCHAR )( ( ( offset >> 3 ) & 0xFF ) + 1 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x03 , temp ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetOffset */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +USHORT XGI_GetOffset(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo) +{ + USHORT temp , + colordepth , + modeinfo , + index , + infoflag , + ColorDepth[] = { 0x01 , 0x02 , 0x04 } ; + + modeinfo = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeInfo ; + if ( ModeNo <= 0x14 ) + infoflag = 0 ; + else + infoflag = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_InfoFlag ; + + + index = ( modeinfo >> 8 ) & 0xFF ; + + temp = pVBInfo->ScreenOffset[ index ] ; + + if ( infoflag & InterlaceMode ) + { + temp = temp << 1 ; + } + + colordepth = XGI_GetColorDepth( ModeNo , ModeIdIndex, pVBInfo ) ; + + if ( ( ModeNo >= 0x7C ) && ( ModeNo <= 0x7E ) ) + { + temp = ModeNo - 0x7C ; + colordepth = ColorDepth[ temp ] ; + temp = 0x6B ; + if ( infoflag & InterlaceMode ) + { + temp = temp << 1 ; + } + return( temp * colordepth ) ; + } + else + return( temp * colordepth ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT2FIFO */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void XGI_SetCRT2FIFO( PVB_DEVICE_INFO pVBInfo) +{ + XGINew_SetReg1( pVBInfo->Part1Port , 0x01 , 0x3B ) ; /* threshold high ,disable auto threshold */ + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x02 , ~( 0x3F ) , 0x04 ) ; /* threshold low default 04h */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_PreSetGroup1 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_PreSetGroup1(USHORT ModeNo , USHORT ModeIdIndex ,PXGI_HW_DEVICE_INFO HwDeviceExtension, + USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempcx = 0 , + CRT1Index = 0 ; + + + + + + + if ( ModeNo > 0x13 ) + { + CRT1Index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT1CRTC ; + CRT1Index &= IndexMask ; + } + + XGI_SetCRT2Offset( ModeNo , ModeIdIndex , RefreshRateTableIndex , HwDeviceExtension, pVBInfo ) ; + XGI_SetCRT2FIFO(pVBInfo) ; + /* XGI_SetCRT2Sync(ModeNo,RefreshRateTableIndex); */ + + for( tempcx = 4 ; tempcx < 7 ; tempcx++ ) + { + XGINew_SetReg1( pVBInfo->Part1Port , tempcx , 0x0 ) ; + } + + XGINew_SetReg1( pVBInfo->Part1Port , 0x02 , 0x44 ) ; /* temp 0206 */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetGroup1 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetGroup1( USHORT ModeNo , USHORT ModeIdIndex , + PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT temp = 0 , + tempax = 0 , + tempbx = 0 , + tempcx = 0 , + pushbx = 0 , + CRT1Index = 0 , + modeflag ; + + if ( ModeNo > 0x13 ) + { + CRT1Index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT1CRTC ; + CRT1Index &= IndexMask ; + } + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + } + + /* bainy change table name */ + if ( modeflag & HalfDCLK ) + { + temp = ( pVBInfo->VGAHT / 2 - 1 ) & 0x0FF ; /* BTVGA2HT 0x08,0x09 */ + XGINew_SetReg1( pVBInfo->Part1Port , 0x08 , temp ) ; + temp = ( ( ( pVBInfo->VGAHT / 2 - 1 ) & 0xFF00 ) >> 8 ) << 4 ; + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x09 , ~0x0F0 , temp ) ; + temp = ( pVBInfo->VGAHDE / 2 + 16 ) & 0x0FF ; /* BTVGA2HDEE 0x0A,0x0C */ + XGINew_SetReg1( pVBInfo->Part1Port , 0x0A , temp ) ; + tempcx = ( ( pVBInfo->VGAHT - pVBInfo->VGAHDE ) / 2 ) >> 2 ; + pushbx = pVBInfo->VGAHDE / 2 + 16 ; + tempcx = tempcx >> 1 ; + tempbx = pushbx + tempcx ; /* bx BTVGA@HRS 0x0B,0x0C */ + tempcx += tempbx ; + + if ( pVBInfo->VBInfo & SetCRT2ToRAMDAC ) + { + tempbx = pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 4 ] ; + tempbx |= ( ( pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 14 ] & 0xC0 ) << 2 ) ; + tempbx = ( tempbx - 3 ) << 3 ; /* (VGAHRS-3)*8 */ + tempcx = pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[ 5 ] ; + tempcx &= 0x1F ; + temp = pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 15 ] ; + temp = ( temp & 0x04 ) << ( 5 - 2 ) ; /* VGAHRE D[5] */ + tempcx = ( ( tempcx | temp ) - 3 ) << 3 ; /* (VGAHRE-3)*8 */ + } + + tempbx += 4 ; + tempcx += 4 ; + + if ( tempcx > ( pVBInfo->VGAHT / 2 ) ) + tempcx = pVBInfo->VGAHT / 2 ; + + temp = tempbx & 0x00FF ; + + XGINew_SetReg1( pVBInfo->Part1Port , 0x0B , temp ) ; + } + else + { + temp = ( pVBInfo->VGAHT - 1 ) & 0x0FF ; /* BTVGA2HT 0x08,0x09 */ + XGINew_SetReg1( pVBInfo->Part1Port , 0x08 , temp ) ; + temp = ( ( ( pVBInfo->VGAHT - 1 ) & 0xFF00 ) >> 8 ) << 4 ; + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x09 , ~0x0F0 , temp ) ; + temp = ( pVBInfo->VGAHDE + 16 ) & 0x0FF ; /* BTVGA2HDEE 0x0A,0x0C */ + XGINew_SetReg1( pVBInfo->Part1Port , 0x0A , temp ) ; + tempcx = ( pVBInfo->VGAHT - pVBInfo->VGAHDE ) >> 2 ; /* cx */ + pushbx = pVBInfo->VGAHDE + 16 ; + tempcx = tempcx >> 1 ; + tempbx = pushbx + tempcx ; /* bx BTVGA@HRS 0x0B,0x0C */ + tempcx += tempbx ; + + if ( pVBInfo->VBInfo & SetCRT2ToRAMDAC ) + { + tempbx = pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 3 ] ; + tempbx |= ( ( pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 5 ] & 0xC0 ) << 2 ) ; + tempbx = ( tempbx - 3 ) << 3 ; /* (VGAHRS-3)*8 */ + tempcx = pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 4 ] ; + tempcx &= 0x1F ; + temp = pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 6 ] ; + temp = ( temp & 0x04 ) << ( 5 - 2 ) ; /* VGAHRE D[5] */ + tempcx = ( ( tempcx | temp ) - 3 ) << 3 ; /* (VGAHRE-3)*8 */ + tempbx += 16 ; + tempcx += 16 ; + } + + if ( tempcx > pVBInfo->VGAHT ) + tempcx = pVBInfo->VGAHT ; + + temp = tempbx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0B , temp ) ; + } + + tempax = ( tempax & 0x00FF ) | ( tempbx & 0xFF00 ) ; + tempbx = pushbx ; + tempbx = ( tempbx & 0x00FF ) | ( ( tempbx & 0xFF00 ) << 4 ) ; + tempax |= ( tempbx & 0xFF00 ) ; + temp = ( tempax & 0xFF00 ) >> 8 ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0C , temp ) ; + temp = tempcx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0D , temp ) ; + tempcx = ( pVBInfo->VGAVT - 1 ) ; + temp = tempcx & 0x00FF ; + + if ( pVBInfo->IF_DEF_CH7005 == 1 ) + { + if ( pVBInfo->VBInfo & 0x0C ) + { + temp-- ; + } + } + + XGINew_SetReg1( pVBInfo->Part1Port , 0x0E , temp ) ; + tempbx = pVBInfo->VGAVDE - 1 ; + temp = tempbx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0F , temp ) ; + temp = ( ( tempbx & 0xFF00 ) << 3 ) >> 8 ; + temp |= ( ( tempcx & 0xFF00 ) >> 8 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x12 , temp ) ; + + tempax = pVBInfo->VGAVDE ; + tempbx = pVBInfo->VGAVDE ; + tempcx = pVBInfo->VGAVT ; + tempbx = ( pVBInfo->VGAVT + pVBInfo->VGAVDE ) >> 1 ; /* BTVGA2VRS 0x10,0x11 */ + tempcx = ( ( pVBInfo->VGAVT - pVBInfo->VGAVDE ) >> 4 ) + tempbx + 1 ; /* BTVGA2VRE 0x11 */ + + if ( pVBInfo->VBInfo & SetCRT2ToRAMDAC ) + { + tempbx = pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 10 ] ; + temp = pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 9 ] ; + + if ( temp & 0x04 ) + tempbx |= 0x0100 ; + + if ( temp & 0x080 ) + tempbx |= 0x0200 ; + + temp = pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 14 ] ; + + if ( temp & 0x08 ) + tempbx |= 0x0400 ; + + temp = pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 11 ] ; + tempcx = ( tempcx & 0xFF00 ) | ( temp & 0x00FF ) ; + } + + temp = tempbx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x10 , temp ) ; + temp = ( ( tempbx & 0xFF00 ) >> 8 ) << 4 ; + temp = ( ( tempcx & 0x000F ) | ( temp ) ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x11 , temp ) ; + tempax = 0 ; + + if ( modeflag & DoubleScanMode ) + tempax |= 0x80 ; + + if ( modeflag & HalfDCLK ) + tempax |= 0x40 ; + + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x2C , ~0x0C0 , tempax ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetLockRegs */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetLockRegs( USHORT ModeNo , USHORT ModeIdIndex , + PXGI_HW_DEVICE_INFO HwDeviceExtension , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT push1 , + push2 , + tempax , + tempbx = 0 , + tempcx , + temp , + resinfo , + modeflag , + CRT1Index ; + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; /* si+St_ResInfo */ + resinfo = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ResInfo ; + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; /* si+Ext_ResInfo */ + resinfo = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_RESINFO ; + CRT1Index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT1CRTC ; + CRT1Index &= IndexMask; + } + + if ( !( pVBInfo->VBInfo & SetInSlaveMode ) ) + { + return ; + } + + temp = 0xFF ; /* set MAX HT */ + XGINew_SetReg1( pVBInfo->Part1Port , 0x03 , temp ) ; + /* if ( modeflag & Charx8Dot ) tempcx = 0x08 ; */ + /* else */ + tempcx=0x08; + + if ( pVBInfo->VBType & ( VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + modeflag |= Charx8Dot ; + + tempax = pVBInfo->VGAHDE ; /* 0x04 Horizontal Display End */ + + if ( modeflag & HalfDCLK ) + tempax = tempax >> 1 ; + + tempax = ( tempax / tempcx ) - 1 ; + tempbx |= ( ( tempax & 0x00FF ) << 8 ) ; + temp = tempax & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x04 , temp ) ; + + temp = ( tempbx & 0xFF00 ) >> 8 ; + + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + if ( !( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) ) + temp += 2 ; + + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { + if ( pVBInfo->VBType & VB_XGI301LV ) + { + if ( pVBInfo->VBExtInfo == VB_YPbPr1080i ) + { + if ( resinfo == 7 ) + temp -= 2 ; + } + } + else + if ( resinfo == 7 ) + temp -= 2 ; + } + } + + XGINew_SetReg1( pVBInfo->Part1Port , 0x05 , temp ) ; /* 0x05 Horizontal Display Start */ + XGINew_SetReg1( pVBInfo->Part1Port , 0x06 , 0x03 ) ; /* 0x06 Horizontal Blank end */ + + if ( !( pVBInfo->VBInfo & DisableCRT2Display ) ) + { /* 030226 bainy */ + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + tempax = pVBInfo->VGAHT ; + else + tempax = XGI_GetVGAHT2( pVBInfo) ; + } + + if ( tempax >= pVBInfo->VGAHT ) + { + tempax = pVBInfo->VGAHT ; + } + + if ( modeflag & HalfDCLK ) + { + tempax = tempax >> 1 ; + } + + tempax = ( tempax / tempcx ) - 5 ; + tempcx = tempax ; /* 20030401 0x07 horizontal Retrace Start */ + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { + temp = ( tempbx & 0x00FF ) - 1 ; + if ( !( modeflag & HalfDCLK ) ) + { + temp -= 6 ; + if ( pVBInfo->TVInfo & TVSimuMode ) + { + temp -= 4 ; + if ( ModeNo > 0x13 ) + temp -= 10 ; + } + } + } + else + { + /* tempcx = tempbx & 0x00FF ; */ + tempbx = ( tempbx & 0xFF00 ) >> 8 ; + tempcx = ( tempcx + tempbx ) >> 1 ; + temp = ( tempcx & 0x00FF ) + 2 ; + + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + temp -= 1 ; + if ( !( modeflag & HalfDCLK ) ) + { + if ( ( modeflag & Charx8Dot ) ) + { + temp += 4 ; + if ( pVBInfo->VGAHDE >= 800 ) + { + temp -= 6 ; + } + } + } + } + else + { + if ( !( modeflag & HalfDCLK ) ) + { + temp -= 4 ; + if ( pVBInfo->LCDResInfo != Panel1280x960 ) + { + if( pVBInfo->VGAHDE >= 800 ) + { + temp -= 7 ; + if ( pVBInfo->ModeType == ModeEGA ) + { + if ( pVBInfo->VGAVDE == 1024 ) + { + temp += 15 ; + if ( pVBInfo->LCDResInfo != Panel1280x1024 ) + { + temp += 7 ; + } + } + } + + if ( pVBInfo->VGAHDE >= 1280 ) + { + if ( pVBInfo->LCDResInfo != Panel1280x960 ) + { + if ( pVBInfo->LCDInfo & LCDNonExpanding ) + { + temp += 28 ; + } + } + } + } + } + } + } + } + + XGINew_SetReg1( pVBInfo->Part1Port , 0x07 , temp ) ; /* 0x07 Horizontal Retrace Start */ + XGINew_SetReg1( pVBInfo->Part1Port , 0x08 , 0 ) ; /* 0x08 Horizontal Retrace End */ + + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + if ( pVBInfo->TVInfo & TVSimuMode ) + { + if ( ( ModeNo == 0x06 ) || ( ModeNo == 0x10 ) || ( ModeNo == 0x11 ) || ( ModeNo == 0x13 ) || ( ModeNo == 0x0F ) ) + { + XGINew_SetReg1( pVBInfo->Part1Port , 0x07 , 0x5b ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x08 , 0x03 ) ; + } + + if ( ( ModeNo == 0x00 ) || ( ModeNo == 0x01 ) ) + { + if ( pVBInfo->TVInfo & SetNTSCTV ) + { + XGINew_SetReg1( pVBInfo->Part1Port , 0x07 , 0x2A ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x08 , 0x61 ) ; + } + else + { + XGINew_SetReg1( pVBInfo->Part1Port , 0x07 , 0x2A ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x08 , 0x41 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0C , 0xF0 ) ; + } + } + + if ( ( ModeNo == 0x02 ) || ( ModeNo == 0x03 ) || ( ModeNo == 0x07 ) ) + { + if ( pVBInfo->TVInfo & SetNTSCTV ) + { + XGINew_SetReg1( pVBInfo->Part1Port , 0x07 , 0x54 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x08 , 0x00 ) ; + } + else + { + XGINew_SetReg1( pVBInfo->Part1Port , 0x07 , 0x55 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x08 , 0x00 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0C , 0xF0 ) ; + } + } + + if ( ( ModeNo == 0x04 ) || ( ModeNo == 0x05 ) || ( ModeNo == 0x0D ) || ( ModeNo == 0x50 ) ) + { + if ( pVBInfo->TVInfo & SetNTSCTV ) + { + XGINew_SetReg1( pVBInfo->Part1Port , 0x07 , 0x30 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x08 , 0x03 ) ; + } + else + { + XGINew_SetReg1( pVBInfo->Part1Port , 0x07 , 0x2f ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x08 , 0x02 ) ; + } + } + } + } + + XGINew_SetReg1( pVBInfo->Part1Port , 0x18 , 0x03 ) ; /* 0x18 SR0B */ + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x19 , 0xF0 , 0x00 ) ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x09 , 0xFF ) ; /* 0x09 Set Max VT */ + + tempbx = pVBInfo->VGAVT ; + push1 = tempbx ; + tempcx = 0x121 ; + tempbx = pVBInfo->VGAVDE ; /* 0x0E Virtical Display End */ + + if ( tempbx == 357 ) + tempbx = 350 ; + if ( tempbx == 360 ) + tempbx =350 ; + if ( tempbx == 375 ) + tempbx = 350 ; + if ( tempbx == 405 ) + tempbx = 400 ; + if ( tempbx == 525 ) + tempbx = 480 ; + + push2 = tempbx ; + + if ( pVBInfo->VBInfo & SetCRT2ToLCD ) + { + if ( pVBInfo->LCDResInfo == Panel1024x768 ) + { + if ( !( pVBInfo->LCDInfo & LCDVESATiming ) ) + { + if ( tempbx == 350 ) + tempbx += 5 ; + if ( tempbx == 480 ) + tempbx += 5 ; + } + } + } + tempbx-- ; + temp = tempbx & 0x00FF ; + tempbx-- ; + temp = tempbx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x10 ,temp ) ; /* 0x10 vertical Blank Start */ + tempbx = push2 ; + tempbx-- ; + temp = tempbx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0E , temp ) ; + + if ( tempbx & 0x0100 ) + { + tempcx |= 0x0002 ; + } + + tempax = 0x000B ; + + if ( modeflag & DoubleScanMode ) + { + tempax |= 0x08000 ; + } + + if ( tempbx & 0x0200 ) + { + tempcx |= 0x0040 ; + } + + temp = ( tempax & 0xFF00 ) >> 8 ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0B , temp ) ; + + if ( tempbx & 0x0400 ) + { + tempcx |= 0x0600 ; + } + + XGINew_SetReg1( pVBInfo->Part1Port , 0x11 , 0x00 ) ; /* 0x11 Vertival Blank End */ + + tempax = push1 ; + tempax -= tempbx ; /* 0x0C Vertical Retrace Start */ + tempax = tempax >> 2 ; + push1 = tempax ; /* push ax */ + + if ( resinfo != 0x09 ) + { + tempax = tempax << 1 ; + tempbx += tempax ; + } + + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { + if ( pVBInfo->VBType & VB_XGI301LV ) + { + if ( pVBInfo->TVInfo & SetYPbPrMode1080i ) + tempbx -= 10 ; + else + { + if ( pVBInfo->TVInfo & TVSimuMode ) + { + if ( pVBInfo->TVInfo & SetPALTV ) + { + if ( pVBInfo->VBType & VB_XGI301LV ) + { + if ( !( pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p | SetYPbPrMode1080i ) ) ) + tempbx += 40 ; + } + else + tempbx += 40 ; + } + } + } + } + else + tempbx -= 10 ; + } + else + { + if ( pVBInfo->TVInfo & TVSimuMode ) + { + if ( pVBInfo->TVInfo & SetPALTV ) + { + if ( pVBInfo->VBType & VB_XGI301LV ) + { + if ( !( pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p | SetYPbPrMode1080i ) ) ) + tempbx += 40 ; + } + else + tempbx += 40 ; + } + } + } + tempax = push1 ; + tempax = tempax >> 2 ; + tempax++ ; + tempax += tempbx ; + push1 = tempax ; /* push ax */ + + if ( ( pVBInfo->TVInfo & SetPALTV ) ) + { + if ( tempbx <= 513 ) + { + if ( tempax >= 513 ) + { + tempbx = 513 ; + } + } + } + + temp = tempbx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0C , temp ) ; + tempbx-- ; + temp = tempbx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x10 , temp ) ; + + if ( tempbx & 0x0100 ) + { + tempcx |= 0x0008 ; + } + + if ( tempbx & 0x0200 ) + { + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x0B , 0x0FF , 0x20 ) ; + } + + tempbx++ ; + + if ( tempbx & 0x0100 ) + { + tempcx |= 0x0004 ; + } + + if ( tempbx & 0x0200 ) + { + tempcx |= 0x0080 ; + } + + if ( tempbx & 0x0400 ) + { + tempcx |= 0x0C00 ; + } + + tempbx = push1 ; /* pop ax */ + temp = tempbx & 0x00FF ; + temp &= 0x0F ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0D , temp ) ; /* 0x0D vertical Retrace End */ + + if ( tempbx & 0x0010 ) + { + tempcx |= 0x2000 ; + } + + temp = tempcx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x0A , temp ) ; /* 0x0A CR07 */ + temp = ( tempcx & 0x0FF00 ) >> 8 ; + XGINew_SetReg1( pVBInfo->Part1Port , 0x17 , temp ) ; /* 0x17 SR0A */ + tempax = modeflag ; + temp = ( tempax & 0xFF00 ) >> 8 ; + + temp = ( temp >> 1 ) & 0x09 ; + + if ( pVBInfo->VBType & ( VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + temp |= 0x01 ; + + XGINew_SetReg1( pVBInfo->Part1Port , 0x16 , temp ) ; /* 0x16 SR01 */ + XGINew_SetReg1( pVBInfo->Part1Port , 0x0F , 0 ) ; /* 0x0F CR14 */ + XGINew_SetReg1( pVBInfo->Part1Port , 0x12 , 0 ) ; /* 0x12 CR17 */ + + if ( pVBInfo->LCDInfo & LCDRGB18Bit ) + temp = 0x80 ; + else + temp = 0x00 ; + + XGINew_SetReg1( pVBInfo->Part1Port , 0x1A , temp ) ; /* 0x1A SR0E */ + + return ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetGroup2 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetGroup2( USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, + PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT i , + j , + tempax , + tempbx , + tempcx , + temp , + push1 , + push2 , + modeflag ; + + + + +/* XGINew_RY1COE = 0 , + XGINew_RY2COE = 0 , + XGINew_RY3COE = 0 , + XGINew_RY4COE = 0 , + XGINew_RY5COE = 0 , + XGINew_RY6COE = 0 , + XGINew_RY7COE = 0 ; +*/ + UCHAR *TimingPoint ; + + + ULONG longtemp , + tempeax , + tempebx , + temp2 , + tempecx ; + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; /* si+St_ResInfo */ + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; /* si+Ext_ResInfo */ + } + + tempax = 0 ; + + if ( !( pVBInfo->VBInfo & SetCRT2ToAVIDEO ) ) + tempax |= 0x0800 ; + + if ( !( pVBInfo->VBInfo & SetCRT2ToSVIDEO ) ) + tempax |= 0x0400 ; + + if ( pVBInfo->VBInfo & SetCRT2ToSCART ) + tempax |= 0x0200 ; + + if ( !( pVBInfo->TVInfo & SetPALTV ) ) + tempax |= 0x1000 ; + + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + tempax |= 0x0100 ; + + if ( pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p ) ) + tempax &= 0xfe00 ; + + tempax = ( tempax & 0xff00 ) >> 8 ; + + XGINew_SetReg1( pVBInfo->Part2Port , 0x0 , tempax ) ; + TimingPoint = pVBInfo->NTSCTiming ; + + if ( pVBInfo->TVInfo & SetPALTV ) + { + TimingPoint = pVBInfo->PALTiming ; + } + + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { + TimingPoint = pVBInfo->HiTVExtTiming ; + + if ( pVBInfo->VBInfo & SetInSlaveMode ) + TimingPoint = pVBInfo->HiTVSt2Timing ; + + if ( pVBInfo->SetFlag & TVSimuMode ) + TimingPoint = pVBInfo->HiTVSt1Timing ; + + if ( !(modeflag & Charx8Dot) ) + TimingPoint = pVBInfo->HiTVTextTiming ; + } + + if ( pVBInfo->VBInfo & SetCRT2ToYPbPr ) + { + if ( pVBInfo->TVInfo & SetYPbPrMode525i ) + TimingPoint = pVBInfo->YPbPr525iTiming ; + + if ( pVBInfo->TVInfo & SetYPbPrMode525p ) + TimingPoint = pVBInfo->YPbPr525pTiming ; + + if ( pVBInfo->TVInfo & SetYPbPrMode750p ) + TimingPoint = pVBInfo->YPbPr750pTiming ; + } + + for( i = 0x01 , j = 0 ; i <= 0x2D ; i++ , j++ ) + { + XGINew_SetReg1( pVBInfo->Part2Port , i , TimingPoint[ j ] ) ; + } + + for( i = 0x39 ; i <= 0x45 ; i++ , j++ ) + { + XGINew_SetReg1( pVBInfo->Part2Port , i , TimingPoint[ j ] ) ; /* di->temp2[j] */ + } + + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x3A , 0x1F , 0x00 ) ; + } + + temp = pVBInfo->NewFlickerMode ; + temp &= 0x80 ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x0A , 0xFF , temp ) ; + + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + tempax = 950 ; + + if ( pVBInfo->TVInfo & SetPALTV ) + tempax = 520 ; + else + tempax = 440 ; + + if ( pVBInfo->VDE <= tempax ) + { + tempax -= pVBInfo->VDE ; + tempax = tempax >> 2 ; + tempax = ( tempax & 0x00FF ) | ( ( tempax & 0x00FF ) << 8 ) ; + push1 = tempax ; + temp = ( tempax & 0xFF00 ) >> 8 ; + temp += ( USHORT )TimingPoint[ 0 ] ; + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + if ( pVBInfo->VBInfo & ( SetCRT2ToAVIDEO | SetCRT2ToSVIDEO | SetCRT2ToSCART | SetCRT2ToYPbPr ) ) + { + tempcx=pVBInfo->VGAHDE; + if ( tempcx >= 1024 ) + { + temp = 0x17 ; /* NTSC */ + if ( pVBInfo->TVInfo & SetPALTV ) + temp = 0x19 ; /* PAL */ + } + } + } + + XGINew_SetReg1( pVBInfo->Part2Port , 0x01 , temp ) ; + tempax = push1 ; + temp = ( tempax & 0xFF00 ) >> 8 ; + temp += TimingPoint[ 1 ] ; + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + if ( ( pVBInfo->VBInfo & ( SetCRT2ToAVIDEO | SetCRT2ToSVIDEO | SetCRT2ToSCART | SetCRT2ToYPbPr ) ) ) + { + tempcx = pVBInfo->VGAHDE ; + if ( tempcx >= 1024 ) + { + temp = 0x1D ; /* NTSC */ + if ( pVBInfo->TVInfo & SetPALTV ) + temp = 0x52 ; /* PAL */ + } + } + } + XGINew_SetReg1( pVBInfo->Part2Port , 0x02 , temp ) ; + } + + /* 301b */ + tempcx = pVBInfo->HT ; + + if ( XGI_IsLCDDualLink( pVBInfo ) ) + tempcx = tempcx >> 1 ; + + tempcx -= 2 ; + temp = tempcx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x1B , temp ) ; + + temp = ( tempcx & 0xFF00 ) >> 8 ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x1D , ~0x0F , temp ) ; + + tempcx = pVBInfo->HT >> 1 ; + push1 = tempcx ; /* push cx */ + tempcx += 7 ; + + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { + tempcx -= 4 ; + } + + temp = tempcx & 0x00FF ; + temp = temp << 4 ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x22 , 0x0F , temp ) ; + + tempbx = TimingPoint[ j ] | ( ( TimingPoint[ j + 1 ] ) << 8 ) ; + tempbx += tempcx ; + push2 = tempbx ; + temp = tempbx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x24 , temp ) ; + temp = ( tempbx & 0xFF00 ) >> 8 ; + temp = temp << 4 ; + XGINew_SetRegANDOR(pVBInfo->Part2Port,0x25,0x0F,temp); + + tempbx=push2; + tempbx=tempbx+8; + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { + tempbx=tempbx-4; + tempcx=tempbx; + } + + temp = ( tempbx & 0x00FF ) << 4 ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x29 , 0x0F , temp ) ; + + j += 2 ; + tempcx += ( TimingPoint[ j ] | ( ( TimingPoint[ j + 1 ] ) << 8 ) ) ; + temp = tempcx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x27 , temp ) ; + temp = ( ( tempcx & 0xFF00 ) >> 8 ) << 4 ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x28 , 0x0F , temp ) ; + + tempcx += 8 ; + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { + tempcx -= 4 ; + } + + temp = tempcx & 0xFF ; + temp = temp << 4 ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x2A , 0x0F , temp ) ; + + tempcx = push1 ; /* pop cx */ + j += 2 ; + temp = TimingPoint[ j ] | ( ( TimingPoint[ j + 1 ] ) << 8 ) ; + tempcx -= temp ; + temp = tempcx & 0x00FF ; + temp = temp << 4 ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x2D , 0x0F ,temp ) ; + + tempcx -= 11 ; + + if ( !( pVBInfo->VBInfo & SetCRT2ToTV ) ) + { + tempax = XGI_GetVGAHT2( pVBInfo) ; + tempcx = tempax - 1 ; + } + temp = tempcx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x2E , temp ) ; + + tempbx = pVBInfo->VDE ; + + if ( pVBInfo->VGAVDE == 360 ) + tempbx = 746 ; + if ( pVBInfo->VGAVDE == 375 ) + tempbx = 746 ; + if ( pVBInfo->VGAVDE == 405 ) + tempbx = 853 ; + + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + if ( pVBInfo->VBType & ( VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + if ( !( pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p ) ) ) + tempbx = tempbx >> 1 ; + } + else + tempbx = tempbx >> 1 ; + } + + tempbx -= 2 ; + temp = tempbx & 0x00FF ; + + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { + if ( pVBInfo->VBType & VB_XGI301LV ) + { + if ( pVBInfo->TVInfo & SetYPbPrMode1080i ) + { + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + if ( ModeNo == 0x2f ) + temp += 1 ; + } + } + } + else + { + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + if ( ModeNo == 0x2f ) + temp += 1 ; + } + } + } + + XGINew_SetReg1( pVBInfo->Part2Port , 0x2F , temp ) ; + + temp = ( tempcx & 0xFF00 ) >> 8 ; + temp |= ( ( tempbx & 0xFF00 ) >> 8 ) << 6 ; + + if ( !( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) ) + { + if ( pVBInfo->VBType & VB_XGI301LV ) + { + if ( pVBInfo->TVInfo & SetYPbPrMode1080i ) + { + temp |= 0x10 ; + + if ( !( pVBInfo->VBInfo & SetCRT2ToSVIDEO ) ) + temp |= 0x20 ; + } + } + else + { + temp |= 0x10 ; + if ( !( pVBInfo->VBInfo & SetCRT2ToSVIDEO ) ) + temp |= 0x20 ; + } + } + + XGINew_SetReg1( pVBInfo->Part2Port , 0x30 , temp ) ; + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) /* TV gatingno */ + { + tempbx = pVBInfo->VDE ; + tempcx = tempbx - 2 ; + + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + if ( !( pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p ) ) ) + tempbx = tempbx >> 1 ; + } + + if ( pVBInfo->VBType & ( VB_XGI302LV | VB_XGI301C ) ) + { + temp=0; + if( tempcx & 0x0400 ) + temp |= 0x20 ; + + if ( tempbx & 0x0400 ) + temp |= 0x40 ; + + XGINew_SetReg1( pVBInfo->Part4Port , 0x10 , temp ) ; + } + + temp = ( ( ( tempbx - 3 ) & 0x0300 ) >> 8 ) << 5 ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x46 , temp ) ; + temp = ( tempbx - 3 ) & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x47 , temp ) ; + } + + tempbx = tempbx & 0x00FF ; + + if ( !( modeflag & HalfDCLK ) ) + { + tempcx = pVBInfo->VGAHDE ; + if ( tempcx >= pVBInfo->HDE ) + { + tempbx |= 0x2000 ; + tempax &= 0x00FF ; + } + } + + tempcx = 0x0101 ; + + if( pVBInfo->VBInfo & SetCRT2ToTV ) { /*301b*/ + if(pVBInfo->VGAHDE>=1024) + { + tempcx=0x1920; + if(pVBInfo->VGAHDE>=1280) + { + tempcx=0x1420; + tempbx=tempbx&0xDFFF; + } + } + } + + if ( !( tempbx & 0x2000 ) ) + { + if ( modeflag & HalfDCLK ) + { + tempcx = ( tempcx & 0xFF00 ) | ( ( tempcx & 0x00FF ) << 1 ) ; + } + + push1 = tempbx ; + tempeax = pVBInfo->VGAHDE ; + tempebx = ( tempcx & 0xFF00 ) >> 8 ; + longtemp = tempeax * tempebx ; + tempecx = tempcx & 0x00FF ; + longtemp = longtemp / tempecx ; + + /* 301b */ + tempecx = 8 * 1024 ; + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + tempecx = tempecx * 8 ; + } + + longtemp = longtemp * tempecx ; + tempecx = pVBInfo->HDE ; + temp2 = longtemp % tempecx ; + tempeax = longtemp / tempecx ; + if ( temp2 != 0 ) + { + tempeax += 1 ; + } + + tempax = ( USHORT )tempeax ; + + /* 301b */ + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + tempcx = ( ( tempax & 0xFF00 ) >> 5 ) >> 8 ; + } + /* end 301b */ + + tempbx = push1 ; + tempbx =( USHORT )( ( ( tempeax & 0x0000FF00 ) & 0x1F00 ) | ( tempbx & 0x00FF ) ) ; + tempax =( USHORT )( ( ( tempeax & 0x000000FF ) << 8 ) | ( tempax & 0x00FF ) ) ; + temp = ( tempax & 0xFF00 ) >> 8 ; + } + else + { + temp = ( tempax & 0x00FF ) >> 8 ; + } + + XGINew_SetReg1( pVBInfo->Part2Port , 0x44 , temp ) ; + temp = ( tempbx & 0xFF00 ) >> 8 ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x45 , ~0x03F , temp ) ; + temp = tempcx & 0x00FF ; + + if ( tempbx & 0x2000 ) + temp = 0 ; + + if ( !( pVBInfo->VBInfo & SetCRT2ToLCD ) ) + temp |= 0x18 ; + + XGINew_SetRegANDOR(pVBInfo->Part2Port,0x46,~0x1F,temp); + if ( pVBInfo->TVInfo & SetPALTV ) + { + tempbx = 0x0382 ; + tempcx = 0x007e ; + } + else + { + tempbx = 0x0369 ; + tempcx = 0x0061 ; + } + + temp = tempbx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x4b , temp ) ; + temp = tempcx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x4c , temp ) ; + + temp = ( ( tempcx & 0xFF00 ) >> 8 ) & 0x03 ; + temp = temp << 2 ; + temp |= ( ( tempbx & 0xFF00 ) >> 8 ) & 0x03 ; + + if ( pVBInfo->VBInfo & SetCRT2ToYPbPr ) + { + temp |= 0x10 ; + + if ( pVBInfo->TVInfo & SetYPbPrMode525p ) + temp |= 0x20 ; + + if ( pVBInfo->TVInfo & SetYPbPrMode750p ) + temp |= 0x60 ; + } + + XGINew_SetReg1( pVBInfo->Part2Port , 0x4d , temp ) ; + temp=XGINew_GetReg1( pVBInfo->Part2Port , 0x43 ) ; /* 301b change */ + XGINew_SetReg1( pVBInfo->Part2Port , 0x43 , ( USHORT )( temp - 3 ) ) ; + + if ( !( pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p ) ) ) + { + if ( pVBInfo->TVInfo & NTSC1024x768 ) + { + TimingPoint = XGI_NTSC1024AdjTime ; + for( i = 0x1c , j = 0 ; i <= 0x30 ; i++ , j++ ) + { + XGINew_SetReg1( pVBInfo->Part2Port , i , TimingPoint[ j ] ) ; + } + XGINew_SetReg1( pVBInfo->Part2Port , 0x43 , 0x72 ) ; + } + } + + /* [ycchen] 01/14/03 Modify for 301C PALM Support */ + if ( pVBInfo->VBType & VB_XGI301C ) + { + if ( pVBInfo->TVInfo & SetPALMTV ) + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x4E , ~0x08 , 0x08 ) ; /* PALM Mode */ + } + + if ( pVBInfo->TVInfo & SetPALMTV ) + { + tempax = ( UCHAR )XGINew_GetReg1( pVBInfo->Part2Port , 0x01 ) ; + tempax-- ; + XGINew_SetRegAND( pVBInfo->Part2Port , 0x01 , tempax ) ; + + /* if ( !( pVBInfo->VBType & VB_XGI301C ) ) */ + XGINew_SetRegAND( pVBInfo->Part2Port , 0x00 , 0xEF ) ; + } + + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { + if ( !( pVBInfo->VBInfo & SetInSlaveMode ) ) + { + XGINew_SetReg1( pVBInfo->Part2Port , 0x0B , 0x00 ) ; + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetLCDRegs */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetLCDRegs(USHORT ModeNo,USHORT ModeIdIndex, PXGI_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo) +{ + USHORT pushbx , + tempax , + tempbx , + tempcx , + temp , + tempah , + tempbh , + tempch , + CRT1Index ; + + XGI_LCDDesStruct *LCDBDesPtr = NULL ; + + + if ( ModeNo >= 0x13 ) + { + CRT1Index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT1CRTC ; + CRT1Index &= IndexMask ; + } + + if ( !( pVBInfo->VBInfo & SetCRT2ToLCD ) ) + { + return ; + } + + tempbx = pVBInfo->HDE ; /* RHACTE=HDE-1 */ + + if ( XGI_IsLCDDualLink( pVBInfo ) ) + tempbx = tempbx >> 1 ; + + tempbx -= 1 ; + temp = tempbx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x2C , temp ) ; + temp = ( tempbx & 0xFF00 ) >> 8 ; + temp = temp << 4 ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x2B , 0x0F , temp ) ; + temp = 0x01 ; + + if ( pVBInfo->LCDResInfo == Panel1280x1024 ) + { + if ( pVBInfo->ModeType == ModeEGA ) + { + if ( pVBInfo->VGAHDE >= 1024 ) + { + temp = 0x02 ; + if ( pVBInfo->LCDInfo & LCDVESATiming ) + temp = 0x01 ; + } + } + } + + XGINew_SetReg1( pVBInfo->Part2Port , 0x0B , temp ) ; + tempbx = pVBInfo->VDE ; /* RTVACTEO=(VDE-1)&0xFF */ + tempbx-- ; + temp = tempbx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x03 , temp ) ; + temp = ( ( tempbx & 0xFF00 ) >> 8 ) & 0x07 ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x0C , ~0x07 , temp ) ; + + tempcx = pVBInfo->VT - 1 ; + temp = tempcx & 0x00FF ; /* RVTVT=VT-1 */ + XGINew_SetReg1( pVBInfo->Part2Port , 0x19 , temp ) ; + temp = ( tempcx & 0xFF00 ) >> 8 ; + temp = temp << 5 ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x1A , temp ) ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x09 , 0xF0 , 0x00 ) ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x0A , 0xF0 , 0x00 ) ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x17 , 0xFB , 0x00 ) ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x18 , 0xDF , 0x00 ) ; + + /* Customized LCDB Des no add */ + tempbx = 5 ; + LCDBDesPtr = ( XGI_LCDDesStruct * )XGI_GetLcdPtr( tempbx , ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; + tempah = pVBInfo->LCDResInfo ; + tempah &= PanelResInfo ; + + if ( ( tempah == Panel1024x768 ) || ( tempah == Panel1024x768x75 ) ) + { + tempbx = 1024 ; + tempcx = 768 ; + } + else if ( ( tempah == Panel1280x1024 ) || ( tempah == Panel1280x1024x75 ) ) + { + tempbx = 1280 ; + tempcx = 1024 ; + } + else if ( tempah == Panel1400x1050 ) + { + tempbx = 1400 ; + tempcx = 1050 ; + } + else + { + tempbx = 1600 ; + tempcx = 1200 ; + } + + if ( pVBInfo->LCDInfo & EnableScalingLCD ) + { + tempbx = pVBInfo->HDE ; + tempcx = pVBInfo->VDE ; + } + + pushbx = tempbx ; + tempax = pVBInfo->VT ; + pVBInfo->LCDHDES = LCDBDesPtr->LCDHDES ; + pVBInfo->LCDHRS = LCDBDesPtr->LCDHRS ; + pVBInfo->LCDVDES = LCDBDesPtr->LCDVDES ; + pVBInfo->LCDVRS = LCDBDesPtr->LCDVRS ; + tempbx = pVBInfo->LCDVDES ; + tempcx += tempbx ; + + if ( tempcx >= tempax ) + tempcx -= tempax ; /* lcdvdes */ + + temp = tempbx & 0x00FF ; /* RVEQ1EQ=lcdvdes */ + XGINew_SetReg1( pVBInfo->Part2Port , 0x05 , temp ) ; + temp = tempcx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x06 , temp ) ; + tempch = ( ( tempcx & 0xFF00 ) >> 8 ) & 0x07 ; + tempbh = ( ( tempbx & 0xFF00 ) >> 8 ) & 0x07 ; + tempah = tempch ; + tempah = tempah << 3 ; + tempah |= tempbh ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x02 , tempah ) ; + + /* getlcdsync() */ + XGI_GetLCDSync( &tempax , &tempbx,pVBInfo ) ; + tempcx = tempbx ; + tempax = pVBInfo->VT ; + tempbx = pVBInfo->LCDVRS ; + + /* if ( SetLCD_Info & EnableScalingLCD ) */ + tempcx += tempbx ; + if ( tempcx >= tempax ) + tempcx -= tempax ; + + temp = tempbx & 0x00FF ; /* RTVACTEE=lcdvrs */ + XGINew_SetReg1( pVBInfo->Part2Port , 0x04 , temp ) ; + temp = ( tempbx & 0xFF00 ) >> 8 ; + temp = temp << 4 ; + temp |= ( tempcx & 0x000F ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x01 , temp ) ; + tempcx = pushbx ; + tempax = pVBInfo->HT ; + tempbx = pVBInfo->LCDHDES ; + tempbx &= 0x0FFF ; + + if ( XGI_IsLCDDualLink( pVBInfo ) ) + { + tempax = tempax >> 1 ; + tempbx = tempbx >> 1 ; + tempcx = tempcx >> 1 ; + } + + if ( pVBInfo->VBType & VB_XGI302LV ) + tempbx += 1 ; + + if ( pVBInfo->VBType & VB_XGI301C ) /* tap4 */ + tempbx += 1 ; + + tempcx += tempbx ; + + if ( tempcx >= tempax ) + tempcx -= tempax ; + + temp = tempbx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x1F , temp ) ; /* RHBLKE=lcdhdes */ + temp = ( ( tempbx & 0xFF00 ) >> 8 ) << 4 ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x20 , temp ) ; + temp = tempcx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x23 , temp ) ; /* RHEQPLE=lcdhdee */ + temp = ( tempcx & 0xFF00 ) >> 8 ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x25 , temp ) ; + + /* getlcdsync() */ + XGI_GetLCDSync( &tempax , &tempbx ,pVBInfo) ; + tempcx = tempax ; + tempax = pVBInfo->HT ; + tempbx = pVBInfo->LCDHRS ; + /* if ( SetLCD_Info & EnableScalingLCD) */ + if ( XGI_IsLCDDualLink( pVBInfo) ) + { + tempax = tempax >> 1 ; + tempbx = tempbx >> 1 ; + tempcx = tempcx >> 1 ; + } + + if ( pVBInfo->VBType & VB_XGI302LV ) + tempbx += 1 ; + + tempcx += tempbx ; + + if ( tempcx >= tempax ) + tempcx -= tempax ; + + temp = tempbx & 0x00FF ; /* RHBURSTS=lcdhrs */ + XGINew_SetReg1( pVBInfo->Part2Port , 0x1C , temp ) ; + + temp = ( tempbx & 0xFF00 ) >> 8 ; + temp = temp << 4 ; + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x1D , ~0x0F0 , temp ) ; + temp = tempcx & 0x00FF ; /* RHSYEXP2S=lcdhre */ + XGINew_SetReg1( pVBInfo->Part2Port , 0x21 , temp ) ; + + if ( !( pVBInfo->LCDInfo & LCDVESATiming ) ) + { + if ( pVBInfo->VGAVDE == 525 ) + { + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + temp = 0xC6 ; + } + else + temp = 0xC4 ; + + XGINew_SetReg1( pVBInfo->Part2Port , 0x2f , temp ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x30 , 0xB3 ) ; + } + + if ( pVBInfo->VGAVDE == 420 ) + { + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + temp = 0x4F ; + } + else + temp = 0x4E ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x2f , temp ) ; + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetTap4Ptr */ +/* Input : */ +/* Output : di -> Tap4 Reg. Setting Pointer */ +/* Description : */ +/* --------------------------------------------------------------------- */ +XGI301C_Tap4TimingStruct* XGI_GetTap4Ptr(USHORT tempcx, PVB_DEVICE_INFO pVBInfo) +{ + USHORT tempax , + tempbx , + i ; + + XGI301C_Tap4TimingStruct *Tap4TimingPtr ; + + if ( tempcx == 0 ) + { + tempax = pVBInfo->VGAHDE ; + tempbx = pVBInfo->HDE ; + } + else + { + tempax = pVBInfo->VGAVDE ; + tempbx = pVBInfo->VDE ; + } + + if ( tempax < tempbx ) + return &EnlargeTap4Timing[ 0 ] ; + else if( tempax == tempbx ) + return &NoScaleTap4Timing[ 0 ] ; /* 1:1 */ + else + Tap4TimingPtr = NTSCTap4Timing ; /* NTSC */ + + if ( pVBInfo->TVInfo & SetPALTV ) + Tap4TimingPtr = PALTap4Timing ; + + + if ( pVBInfo->VBInfo & SetCRT2ToYPbPr ) + { + if ( pVBInfo->TVInfo & SetYPbPrMode525i ) + Tap4TimingPtr = YPbPr525iTap4Timing ; + if ( pVBInfo->TVInfo & SetYPbPrMode525p ) + Tap4TimingPtr = YPbPr525pTap4Timing ; + if ( pVBInfo->TVInfo & SetYPbPrMode750p ) + Tap4TimingPtr = YPbPr750pTap4Timing ; + } + + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + Tap4TimingPtr = HiTVTap4Timing ; + + i = 0 ; + while( Tap4TimingPtr[ i ].DE != 0xFFFF ) + { + if ( Tap4TimingPtr[ i ].DE == tempax ) + break ; + i++ ; + } + return &Tap4TimingPtr[ i ] ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetTap4Regs */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetTap4Regs( PVB_DEVICE_INFO pVBInfo) +{ + USHORT i , + j ; + + + XGI301C_Tap4TimingStruct *Tap4TimingPtr ; + + if ( !( pVBInfo->VBType & VB_XGI301C ) ) + return ; + +#ifndef Tap4 + XGINew_SetRegAND( pVBInfo->Part2Port , 0x4E , 0xEB ) ; /* Disable Tap4 */ +#else /* Tap4 Setting */ + + Tap4TimingPtr = XGI_GetTap4Ptr( 0 , pVBInfo) ; /* Set Horizontal Scaling */ + for( i = 0x80 , j = 0 ; i <= 0xBF ; i++ , j++ ) + XGINew_SetReg1( pVBInfo->Part2Port , i , Tap4TimingPtr->Reg[ j ] ) ; + + if ( ( pVBInfo->VBInfo & SetCRT2ToTV ) && ( !( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) ) ) + { + Tap4TimingPtr = XGI_GetTap4Ptr( 1 , pVBInfo); /* Set Vertical Scaling */ + for( i = 0xC0 , j = 0 ; i < 0xFF ; i++ , j++ ) + XGINew_SetReg1( pVBInfo->Part2Port , i , Tap4TimingPtr->Reg[ j ] ) ; + } + + if ( ( pVBInfo->VBInfo & SetCRT2ToTV ) && ( !( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) ) ) + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x4E , ~0x14 , 0x04 ) ; /* Enable V.Scaling */ + else + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x4E , ~0x14 , 0x10 ) ; /* Enable H.Scaling */ +#endif +} + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetGroup3 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetGroup3(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) +{ + USHORT i; + UCHAR *tempdi; + USHORT modeflag; + + if(ModeNo<=0x13) + { + modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ResInfo */ + } + else + { + modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag; /* si+Ext_ResInfo */ + } + + + XGINew_SetReg1(pVBInfo->Part3Port,0x00,0x00); + if(pVBInfo->TVInfo&SetPALTV) + { + XGINew_SetReg1(pVBInfo->Part3Port,0x13,0xFA); + XGINew_SetReg1(pVBInfo->Part3Port,0x14,0xC8); + } + else + { + XGINew_SetReg1(pVBInfo->Part3Port,0x13,0xF5); + XGINew_SetReg1(pVBInfo->Part3Port,0x14,0xB7); + } + + if(!(pVBInfo->VBInfo&SetCRT2ToTV)) + { + return; + } + + if(pVBInfo->TVInfo&SetPALMTV) + { + XGINew_SetReg1(pVBInfo->Part3Port,0x13,0xFA); + XGINew_SetReg1(pVBInfo->Part3Port,0x14,0xC8); + XGINew_SetReg1(pVBInfo->Part3Port,0x3D,0xA8); + } + + if((pVBInfo->VBInfo&SetCRT2ToHiVisionTV)|| (pVBInfo->VBInfo&SetCRT2ToYPbPr)) + { + if(pVBInfo->TVInfo & SetYPbPrMode525i) + { + return; + } + tempdi=pVBInfo->HiTVGroup3Data; + if(pVBInfo->SetFlag&TVSimuMode) + { + tempdi=pVBInfo->HiTVGroup3Simu; + if(!(modeflag&Charx8Dot)) + { + tempdi=pVBInfo->HiTVGroup3Text; + } + } + + if(pVBInfo->TVInfo & SetYPbPrMode525p) + { + tempdi=pVBInfo->Ren525pGroup3; + } + if(pVBInfo->TVInfo & SetYPbPrMode750p) + { + tempdi=pVBInfo->Ren750pGroup3; + } + + for(i=0;i<=0x3E;i++) + { + XGINew_SetReg1(pVBInfo->Part3Port,i,tempdi[i]); + } + if(pVBInfo->VBType&VB_XGI301C) /* Marcovision */ + { + if(pVBInfo->TVInfo & SetYPbPrMode525p) + { + XGINew_SetReg1(pVBInfo->Part3Port,0x28,0x3f); + } + } + } + return; +} /* {end of XGI_SetGroup3} */ + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetGroup4 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetGroup4(USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +{ + USHORT tempax , + tempcx , + tempbx , + modeflag , + temp , + temp2 ; + + + ULONG tempebx , + tempeax , + templong ; + + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; /* si+St_ResInfo */ + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; /* si+Ext_ResInfo */ + } + + temp = pVBInfo->RVBHCFACT ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x13 , temp ) ; + + tempbx = pVBInfo->RVBHCMAX ; + temp = tempbx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x14 , temp ) ; + temp2 = ( ( tempbx & 0xFF00 ) >> 8 ) << 7 ; + tempcx = pVBInfo->VGAHT - 1 ; + temp = tempcx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x16 , temp ) ; + + temp =( ( tempcx & 0xFF00 ) >> 8 ) << 3 ; + temp2 |= temp ; + + tempcx = pVBInfo->VGAVT - 1 ; + if ( !( pVBInfo->VBInfo & SetCRT2ToTV ) ) + { + tempcx -= 5 ; + } + + temp = tempcx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x17 , temp ) ; + temp = temp2 | ( ( tempcx & 0xFF00 ) >> 8 ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x15 , temp ) ; + XGINew_SetRegOR( pVBInfo->Part4Port , 0x0D , 0x08 ) ; + tempcx = pVBInfo->VBInfo ; + tempbx = pVBInfo->VGAHDE ; + + if ( modeflag & HalfDCLK ) + { + tempbx = tempbx >> 1 ; + } + + if ( XGI_IsLCDDualLink( pVBInfo ) ) + tempbx = tempbx >> 1 ; + + if(tempcx&SetCRT2ToHiVisionTV) + { + temp=0; + if(tempbx<=1024) + temp=0xA0; + if(tempbx == 1280) + temp = 0xC0; + } + else if(tempcx&SetCRT2ToTV) + { + temp=0xA0; + if(tempbx <= 800) + temp=0x80; + } + else + { + temp=0x80; + if(pVBInfo->VBInfo&SetCRT2ToLCD) + { + temp=0; + if(tempbx>800) + temp=0x60; + } + } + + if ( pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p ) ) + { + temp = 0x00 ; + if ( pVBInfo->VGAHDE == 1280 ) + temp = 0x40 ; + if ( pVBInfo->VGAHDE == 1024 ) + temp = 0x20 ; + } + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x0E , ~0xEF , temp ) ; + + tempebx = pVBInfo->VDE ; + + if ( tempcx & SetCRT2ToHiVisionTV ) + { + if ( !( temp & 0xE000 ) ) + tempbx = tempbx >> 1 ; + } + + tempcx = pVBInfo->RVBHRS ; + temp = tempcx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x18 , temp ); + + tempeax = pVBInfo->VGAVDE ; + tempcx |= 0x04000 ; + + + if ( tempeax <= tempebx ) + { + tempcx=(tempcx&(~0x4000)); + tempeax = pVBInfo->VGAVDE ; + } + else + { + tempeax -= tempebx ; + } + + + templong = ( tempeax * 256 * 1024 ) % tempebx ; + tempeax = ( tempeax * 256 * 1024 ) / tempebx ; + tempebx = tempeax ; + + if ( templong != 0 ) + { + tempebx++ ; + } + + + temp = ( USHORT )( tempebx & 0x000000FF ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x1B , temp ) ; + + temp = ( USHORT )( ( tempebx & 0x0000FF00 ) >> 8 ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x1A , temp ) ; + tempbx = ( USHORT )( tempebx >> 16 ) ; + temp = tempbx & 0x00FF ; + temp = temp << 4 ; + temp |= ( ( tempcx & 0xFF00 ) >> 8 ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x19 , temp ) ; + + /* 301b */ + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + temp = 0x0028 ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x1C , temp ) ; + tempax = pVBInfo->VGAHDE ; + if ( modeflag & HalfDCLK ) + { + tempax = tempax >> 1 ; + } + + if ( XGI_IsLCDDualLink( pVBInfo ) ) + tempax = tempax >> 1 ; + + /* if((pVBInfo->VBInfo&(SetCRT2ToLCD))||((pVBInfo->TVInfo&SetYPbPrMode525p)||(pVBInfo->TVInfo&SetYPbPrMode750p))) { */ + if ( pVBInfo->VBInfo & SetCRT2ToLCD ) + { + if ( tempax > 800 ) + tempax -= 800 ; + } + else + { + if ( pVBInfo->VGAHDE > 800 ) + { + if ( pVBInfo->VGAHDE == 1024 ) + tempax = ( tempax * 25 / 32 ) - 1 ; + else + tempax = ( tempax * 20 / 32 ) - 1 ; + } + } + tempax -= 1 ; + +/* + if ( pVBInfo->VBInfo & ( SetCRT2ToTV | SetCRT2ToHiVisionTV ) ) + { + if ( pVBInfo->VBType & VB_XGI301LV ) + { + if ( !( pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p | SetYPbPrMode1080i ) ) ) + { + if ( pVBInfo->VGAHDE > 800 ) + { + if ( pVBInfo->VGAHDE == 1024 ) + tempax = ( tempax * 25 / 32 ) - 1 ; + else + tempax = ( tempax * 20 / 32 ) - 1 ; + } + } + } + else + { + if ( pVBInfo->VGAHDE > 800 ) + { + if ( pVBInfo->VGAHDE == 1024 ) + tempax = ( tempax * 25 / 32 ) - 1 ; + else + tempax = ( tempax * 20 / 32 ) - 1 ; + } + } + } +*/ + + temp = ( tempax & 0xFF00 ) >> 8 ; + temp = ( ( temp & 0x0003 ) << 4 ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x1E , temp ) ; + temp = ( tempax & 0x00FF ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x1D , temp ) ; + + if ( pVBInfo->VBInfo & ( SetCRT2ToTV | SetCRT2ToHiVisionTV ) ) + { + if ( pVBInfo->VGAHDE > 800 ) + { + XGINew_SetRegOR( pVBInfo->Part4Port , 0x1E , 0x08 ) ; + } + } + temp = 0x0036 ; + + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + if ( !( pVBInfo->TVInfo & ( NTSC1024x768 | SetYPbPrMode525p | SetYPbPrMode750p | SetYPbPrMode1080i ) ) ) + { + temp |= 0x0001 ; + if ( ( pVBInfo->VBInfo & SetInSlaveMode ) && ( !( pVBInfo->TVInfo & TVSimuMode ) ) ) + temp &= ( ~0x0001 ) ; + } + } + + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x1F , 0x00C0 , temp ) ; + tempbx = pVBInfo->HT ; + if ( XGI_IsLCDDualLink( pVBInfo ) ) + tempbx = tempbx >> 1 ; + tempbx = ( tempbx >> 1 ) - 2 ; + temp = ( ( tempbx & 0x0700 ) >> 8 ) << 3 ; + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x21 , 0x00C0 , temp ) ; + temp = tempbx & 0x00FF ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x22 , temp ) ; + } + /* end 301b */ + + if ( pVBInfo->ISXPDOS == 0 ) + XGI_SetCRT2VCLK( ModeNo , ModeIdIndex , RefreshRateTableIndex, pVBInfo ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetGroup5 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetGroup5( USHORT ModeNo , USHORT ModeIdIndex , PVB_DEVICE_INFO pVBInfo) +{ + if ( pVBInfo->ModeType == ModeVGA ) + { + if ( !( pVBInfo->VBInfo & ( SetInSlaveMode | LoadDACFlag | CRT2DisplayFlag ) ) ) + { + XGINew_EnableCRT2(pVBInfo) ; + /* LoadDAC2(pVBInfo->Part5Port,ModeNo,ModeIdIndex); */ + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetLcdPtr */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void* XGI_GetLcdPtr( USHORT BX , USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT i , + tempdx , + tempbx , + tempal , + modeflag , + table ; + + XGI330_LCDDataTablStruct *tempdi = 0 ; + + + tempbx = BX; + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + tempal = pVBInfo->SModeIDTable[ ModeIdIndex ].St_CRT2CRTC ; + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + tempal = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT2CRTC ; + } + + tempal = tempal & 0x0f ; + + if ( tempbx <= 1 ) /* ExpLink */ + { + if ( ModeNo <= 0x13 ) + { + tempal = pVBInfo->SModeIDTable[ ModeIdIndex ].St_CRT2CRTC ; /* find no Ext_CRT2CRTC2 */ + } + else + { + tempal= pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT2CRTC ; + } + + if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) + { + if ( ModeNo <= 0x13 ) + tempal = pVBInfo->SModeIDTable[ ModeIdIndex ].St_CRT2CRTC2 ; + else + tempal= pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT2CRTC2 ; + } + + if ( tempbx & 0x01 ) + tempal = ( tempal >> 4 ) ; + + tempal = ( tempal & 0x0f ) ; + } + + /* mov di, word ptr cs:LCDDataList[bx] */ + /* tempdi=pVideoMemory[LCDDataList+tempbx*2]|(pVideoMemory[LCDDataList+tempbx*2+1]<<8); */ + + switch( tempbx ) + { + case 0: + tempdi = XGI_EPLLCDCRT1Ptr_H ; + break ; + case 1: + tempdi = XGI_EPLLCDCRT1Ptr_V ; + break ; + case 2: + tempdi = XGI_EPLLCDDataPtr ; + break ; + case 3: + tempdi = XGI_EPLLCDDesDataPtr ; + break ; + case 4: + tempdi = XGI_LCDDataTable ; + break ; + case 5: + tempdi = XGI_LCDDesDataTable ; + break ; + case 6: + tempdi = XGI_EPLCHLCDRegPtr ; + break ; + case 7: + case 8: + case 9: + tempdi = 0 ; + break ; + default: + break ; + } + + if ( tempdi == 0x00 ) /* OEMUtil */ + return 0 ; + + table = tempbx ; + i = 0 ; + + while( tempdi[ i ].PANELID != 0xff ) + { + tempdx = pVBInfo->LCDResInfo ; + if ( tempbx & 0x0080 ) /* OEMUtil */ + { + tempbx &= ( ~0x0080 ) ; + tempdx = pVBInfo->LCDTypeInfo ; + } + + if ( pVBInfo->LCDInfo & EnableScalingLCD ) + tempdx &= ( ~PanelResInfo ) ; + + if ( tempdi[ i ].PANELID == tempdx ) + { + tempbx = tempdi[ i ].MASK ; + tempdx = pVBInfo->LCDInfo ; + + if ( ModeNo <= 0x13 ) /* alan 09/10/2003 */ + tempdx |= SetLCDStdMode ; + + if ( modeflag & HalfDCLK ) + tempdx |= SetLCDLowResolution ; + + tempbx &= tempdx; + if ( tempbx == tempdi[ i ].CAP ) + break ; + } + i++ ; + } + + if ( table == 0 ) + { + switch( tempdi[ i ].DATAPTR ) + { + case 0: + return &XGI_LVDSCRT11024x768_1_H[ tempal ] ; + break ; + case 1: + return &XGI_LVDSCRT11024x768_2_H[ tempal ] ; + break ; + case 2: + return &XGI_LVDSCRT11280x1024_1_H[ tempal ] ; + break ; + case 3: + return &XGI_LVDSCRT11280x1024_2_H[ tempal ] ; + break ; + case 4: + return &XGI_LVDSCRT11400x1050_1_H[ tempal ] ; + break ; + case 5: + return &XGI_LVDSCRT11400x1050_2_H[ tempal ] ; + break ; + case 6: + return &XGI_LVDSCRT11600x1200_1_H[ tempal ] ; + break ; + case 7: + return &XGI_LVDSCRT11024x768_1_Hx75[ tempal ] ; + break ; + case 8: + return &XGI_LVDSCRT11024x768_2_Hx75[ tempal ] ; + break ; + case 9: + return &XGI_LVDSCRT11280x1024_1_Hx75[ tempal ] ; + break ; + case 10: + return &XGI_LVDSCRT11280x1024_2_Hx75[ tempal ] ; + break ; + default: + break ; + } + } + else if ( table == 1 ) + { + switch( tempdi[ i ].DATAPTR ) + { + case 0: + return &XGI_LVDSCRT11024x768_1_V[ tempal ] ; + break ; + case 1: + return &XGI_LVDSCRT11024x768_2_V[ tempal ] ; + break ; + case 2: + return &XGI_LVDSCRT11280x1024_1_V[ tempal ] ; + break ; + case 3: + return &XGI_LVDSCRT11280x1024_2_V[ tempal ] ; + break ; + case 4: + return &XGI_LVDSCRT11400x1050_1_V[ tempal ] ; + break ; + case 5: + return &XGI_LVDSCRT11400x1050_2_V[ tempal ] ; + break ; + case 6: + return &XGI_LVDSCRT11600x1200_1_V[ tempal ] ; + break ; + case 7: + return &XGI_LVDSCRT11024x768_1_Vx75[ tempal ] ; + break ; + case 8: + return &XGI_LVDSCRT11024x768_2_Vx75[ tempal ] ; + break ; + case 9: + return &XGI_LVDSCRT11280x1024_1_Vx75[ tempal ] ; + break ; + case 10: + return &XGI_LVDSCRT11280x1024_2_Vx75[ tempal ] ; + break ; + default: + break ; + } + } + else if ( table == 2 ) + { + switch( tempdi[ i ].DATAPTR ) + { + case 0: + return &XGI_LVDS1024x768Data_1[ tempal ] ; + break ; + case 1: + return &XGI_LVDS1024x768Data_2[ tempal ] ; + break ; + case 2: + return &XGI_LVDS1280x1024Data_1[ tempal ] ; + break ; + case 3: + return &XGI_LVDS1280x1024Data_2[ tempal ] ; + break ; + case 4: + return &XGI_LVDS1400x1050Data_1[ tempal ] ; + break ; + case 5: + return &XGI_LVDS1400x1050Data_2[ tempal ] ; + break ; + case 6: + return &XGI_LVDS1600x1200Data_1[ tempal ] ; + break ; + case 7: + return &XGI_LVDSNoScalingData[ tempal ] ; + break ; + case 8: + return &XGI_LVDS1024x768Data_1x75[ tempal ] ; + break ; + case 9: + return &XGI_LVDS1024x768Data_2x75[ tempal ] ; + break ; + case 10: + return &XGI_LVDS1280x1024Data_1x75[ tempal ] ; + break ; + case 11: + return &XGI_LVDS1280x1024Data_2x75[ tempal ] ; + break ; + case 12: + return &XGI_LVDSNoScalingDatax75[ tempal ] ; + break ; + default: + break ; + } + } + else if ( table == 3 ) + { + switch( tempdi[ i ].DATAPTR ) + { + case 0: + return &XGI_LVDS1024x768Des_1[ tempal ] ; + break ; + case 1: + return &XGI_LVDS1024x768Des_3[ tempal ] ; + break ; + case 2: + return &XGI_LVDS1024x768Des_2[ tempal ] ; + break ; + case 3: + return &XGI_LVDS1280x1024Des_1[ tempal ] ; + break ; + case 4: + return &XGI_LVDS1280x1024Des_2[ tempal ] ; + break ; + case 5: + return &XGI_LVDS1400x1050Des_1[ tempal ] ; + break ; + case 6: + return &XGI_LVDS1400x1050Des_2[ tempal ] ; + break ; + case 7: + return &XGI_LVDS1600x1200Des_1[ tempal ] ; + break ; + case 8: + return &XGI_LVDSNoScalingDesData[ tempal ] ; + break ; + case 9: + return &XGI_LVDS1024x768Des_1x75[ tempal ] ; + break ; + case 10: + return &XGI_LVDS1024x768Des_3x75[ tempal ] ; + break ; + case 11: + return &XGI_LVDS1024x768Des_2x75[ tempal ] ; + break; + case 12: + return &XGI_LVDS1280x1024Des_1x75[ tempal ] ; + break ; + case 13: + return &XGI_LVDS1280x1024Des_2x75[ tempal ] ; + break ; + case 14: + return &XGI_LVDSNoScalingDesDatax75[ tempal ] ; + break ; + default: + break ; + } + } + else if ( table == 4 ) + { + switch( tempdi[ i ].DATAPTR ) + { + case 0: + return &XGI_ExtLCD1024x768Data[ tempal ] ; + break ; + case 1: + return &XGI_StLCD1024x768Data[ tempal ] ; + break ; + case 2: + return &XGI_CetLCD1024x768Data[ tempal ] ; + break ; + case 3: + return &XGI_ExtLCD1280x1024Data[ tempal ] ; + break ; + case 4: + return &XGI_StLCD1280x1024Data[ tempal ] ; + break ; + case 5: + return &XGI_CetLCD1280x1024Data[ tempal ] ; + break ; + case 6: + return &XGI_ExtLCD1400x1050Data[ tempal ] ; + break ; + case 7: + return &XGI_StLCD1400x1050Data[ tempal ] ; + break ; + case 8: + return &XGI_CetLCD1400x1050Data[ tempal ] ; + break ; + case 9: + return &XGI_ExtLCD1600x1200Data[ tempal ] ; + break ; + case 10: + return &XGI_StLCD1600x1200Data[ tempal ] ; + break ; + case 11: + return &XGI_NoScalingData[ tempal ] ; + break ; + case 12: + return &XGI_ExtLCD1024x768x75Data[ tempal ] ; + break ; + case 13: + return &XGI_ExtLCD1024x768x75Data[ tempal ] ; + break ; + case 14: + return &XGI_CetLCD1024x768x75Data[ tempal ] ; + break ; + case 15: + return &XGI_ExtLCD1280x1024x75Data[ tempal ] ; + break ; + case 16: + return &XGI_StLCD1280x1024x75Data[ tempal ] ; + break; + case 17: + return &XGI_CetLCD1280x1024x75Data[ tempal ] ; + break; + case 18: + return &XGI_NoScalingDatax75[ tempal ] ; + break ; + default: + break ; + } + } + else if ( table == 5 ) + { + switch( tempdi[ i ].DATAPTR ) + { + case 0: + return &XGI_ExtLCDDes1024x768Data[ tempal ] ; + break ; + case 1: + return &XGI_StLCDDes1024x768Data[ tempal ] ; + break ; + case 2: + return &XGI_CetLCDDes1024x768Data[ tempal ] ; + break ; + case 3: + if ( ( pVBInfo->VBType & VB_XGI301LV ) || ( pVBInfo->VBType & VB_XGI302LV ) ) + return &XGI_ExtLCDDLDes1280x1024Data[ tempal ] ; + else + return &XGI_ExtLCDDes1280x1024Data[ tempal ] ; + break ; + case 4: + if ( ( pVBInfo->VBType & VB_XGI301LV ) || ( pVBInfo->VBType & VB_XGI302LV ) ) + return &XGI_StLCDDLDes1280x1024Data[ tempal ] ; + else + return &XGI_StLCDDes1280x1024Data[ tempal ] ; + break ; + case 5: + if ( ( pVBInfo->VBType & VB_XGI301LV ) || ( pVBInfo->VBType & VB_XGI302LV ) ) + return &XGI_CetLCDDLDes1280x1024Data[ tempal ] ; + else + return &XGI_CetLCDDes1280x1024Data[ tempal ] ; + break ; + case 6: + if ( ( pVBInfo->VBType & VB_XGI301LV ) || ( pVBInfo->VBType & VB_XGI302LV ) ) + return &XGI_ExtLCDDLDes1400x1050Data[ tempal ] ; + else + return &XGI_ExtLCDDes1400x1050Data[ tempal ] ; + break ; + case 7: + if ( ( pVBInfo->VBType & VB_XGI301LV ) || ( pVBInfo->VBType & VB_XGI302LV ) ) + return &XGI_StLCDDLDes1400x1050Data[ tempal ] ; + else + return &XGI_StLCDDes1400x1050Data[ tempal ] ; + break ; + case 8: + return &XGI_CetLCDDes1400x1050Data[ tempal ] ; + break ; + case 9: + return &XGI_CetLCDDes1400x1050Data2[ tempal ] ; + break ; + case 10: + if ( ( pVBInfo->VBType & VB_XGI301LV ) || ( pVBInfo->VBType & VB_XGI302LV ) ) + return &XGI_ExtLCDDLDes1600x1200Data[ tempal ] ; + else + return &XGI_ExtLCDDes1600x1200Data[ tempal ] ; + break ; + case 11: + if ( ( pVBInfo->VBType & VB_XGI301LV ) || ( pVBInfo->VBType & VB_XGI302LV ) ) + return &XGI_StLCDDLDes1600x1200Data[ tempal ] ; + else + return &XGI_StLCDDes1600x1200Data[ tempal ] ; + break ; + case 12: + return &XGI_NoScalingDesData[ tempal ] ; + break; + case 13: + return &XGI_ExtLCDDes1024x768x75Data[ tempal ] ; + break ; + case 14: + return &XGI_StLCDDes1024x768x75Data[ tempal ] ; + break ; + case 15: + return &XGI_CetLCDDes1024x768x75Data[ tempal ] ; + break ; + case 16: + if ( ( pVBInfo->VBType & VB_XGI301LV ) || ( pVBInfo->VBType & VB_XGI302LV ) ) + return &XGI_ExtLCDDLDes1280x1024x75Data[ tempal ] ; + else + return &XGI_ExtLCDDes1280x1024x75Data[ tempal ] ; + break ; + case 17: + if ( ( pVBInfo->VBType & VB_XGI301LV ) || ( pVBInfo->VBType & VB_XGI302LV ) ) + return &XGI_StLCDDLDes1280x1024x75Data[ tempal ] ; + else + return &XGI_StLCDDes1280x1024x75Data[ tempal ] ; + break ; + case 18: + if ( ( pVBInfo->VBType & VB_XGI301LV ) || ( pVBInfo->VBType & VB_XGI302LV ) ) + return &XGI_CetLCDDLDes1280x1024x75Data[ tempal ] ; + else + return &XGI_CetLCDDes1280x1024x75Data[ tempal ] ; + break ; + case 19: + return &XGI_NoScalingDesDatax75[ tempal ] ; + break ; + default: + break ; + } + } + else if ( table == 6 ) + { + switch( tempdi[ i ].DATAPTR ) + { + case 0: + return &XGI_CH7017LV1024x768[ tempal ] ; + break ; + case 1: + return &XGI_CH7017LV1400x1050[ tempal ] ; + break ; + default: + break ; + } + } + return 0 ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetTVPtr */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void* XGI_GetTVPtr (USHORT BX,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT i , tempdx , tempbx , tempal , modeflag , table ; + XGI330_TVDataTablStruct *tempdi = 0 ; + + tempbx = BX ; + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + tempal = pVBInfo->SModeIDTable[ ModeIdIndex ].St_CRT2CRTC ; + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + tempal = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT2CRTC ; + } + + tempal = tempal & 0x3f ; + table = tempbx ; + + switch( tempbx ) + { + case 0: + tempdi = 0 ; /*EPLCHTVCRT1Ptr_H;*/ + break ; + case 1: + tempdi = 0 ; /*EPLCHTVCRT1Ptr_V;*/ + break ; + case 2: + tempdi = XGI_EPLCHTVDataPtr ; + break ; + case 3: + tempdi = 0 ; + break ; + case 4: + tempdi = XGI_TVDataTable ; + break ; + case 5: + tempdi = 0 ; + break ; + case 6: + tempdi = XGI_EPLCHTVRegPtr ; + break ; + default: + break ; + } + + if ( tempdi == 0x00 ) /* OEMUtil */ + return( 0 ) ; + + tempdx = pVBInfo->TVInfo ; + + if ( pVBInfo->VBInfo & SetInSlaveMode ) + tempdx = tempdx | SetTVLockMode ; + + if ( modeflag & HalfDCLK ) + tempdx = tempdx | SetTVLowResolution ; + + i = 0 ; + + while( tempdi[ i ].MASK != 0xffff ) + { + if ( ( tempdx & tempdi[ i ].MASK ) == tempdi[ i ].CAP ) + break ; + i++ ; + } + + if ( table == 0x04 ) + { + switch( tempdi[ i ].DATAPTR ) + { + case 0: + return &XGI_ExtPALData[ tempal ] ; + break ; + case 1: + return &XGI_ExtNTSCData[ tempal ] ; + break ; + case 2: + return &XGI_StPALData[ tempal ] ; + break ; + case 3: + return &XGI_StNTSCData[ tempal ] ; + break ; + case 4: + return &XGI_ExtHiTVData[ tempal ] ; + break ; + case 5: + return &XGI_St2HiTVData[ tempal ] ; + break ; + case 6: + return &XGI_ExtYPbPr525iData[ tempal ] ; + break ; + case 7: + return &XGI_ExtYPbPr525pData[ tempal ] ; + break ; + case 8: + return &XGI_ExtYPbPr750pData[ tempal ] ; + break ; + case 9: + return &XGI_StYPbPr525iData[ tempal ] ; + break ; + case 10: + return &XGI_StYPbPr525pData[ tempal ] ; + break ; + case 11: + return &XGI_StYPbPr750pData[ tempal ] ; + break; + case 12: /* avoid system hang */ + return &XGI_ExtNTSCData[ tempal ] ; + break ; + case 13: + return &XGI_St1HiTVData[ tempal ] ; + break ; + default: + break ; + } + } + else if( table == 0x02 ) + { + switch( tempdi[ i ].DATAPTR ) + { + case 0: + return &XGI_CHTVUNTSCData[ tempal ] ; + break ; + case 1: + return &XGI_CHTVONTSCData[ tempal ] ; + break ; + case 2: + return &XGI_CHTVUPALData[ tempal ] ; + break ; + case 3: + return &XGI_CHTVOPALData[ tempal ] ; + break ; + default: + break ; + } + } + else if( table == 0x06 ) + { + switch( tempdi[ i ].DATAPTR ) + { + case 0: + return &XGI_CHTVRegUNTSC[ tempal ] ; + break ; + case 1: + return &XGI_CHTVRegONTSC[ tempal ] ; + break ; + case 2: + return &XGI_CHTVRegUPAL[ tempal ] ; + break ; + case 3: + return &XGI_CHTVRegOPAL[ tempal ] ; + break ; + default: + break ; + } + } + return( 0 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_BacklightByDrv */ +/* Input : */ +/* Output : TRUE -> Skip backlight control */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGI_BacklightByDrv( PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR tempah ; + + tempah = ( UCHAR )XGINew_GetReg1( pVBInfo->P3d4 , 0x3A ) ; + if ( tempah & BacklightControlBit ) + return TRUE ; + else + return FALSE ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_FirePWDDisable */ +/* Input : */ +/* Output : */ +/* Description : Turn off VDD & Backlight : Fire disable procedure */ +/* --------------------------------------------------------------------- */ +/* +void XGI_FirePWDDisable( PVB_DEVICE_INFO pVBInfo ) +{ + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x26 , 0x00 , 0xFC ) ; +} +*/ + +/* --------------------------------------------------------------------- */ +/* Function : XGI_FirePWDEnable */ +/* Input : */ +/* Output : */ +/* Description : Turn on VDD & Backlight : Fire enable procedure */ +/* --------------------------------------------------------------------- */ +void XGI_FirePWDEnable(PVB_DEVICE_INFO pVBInfo ) +{ + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x26 , 0x03 , 0xFC ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_EnableGatingCRT */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_EnableGatingCRT(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +{ + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x63 , 0xBF , 0x40 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_DisableGatingCRT */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_DisableGatingCRT(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +{ + + XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x63 , 0xBF , 0x00 ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetPanelDelay */ +/* Input : */ +/* Output : */ +/* Description : */ +/* I/P : bl : 1 ; T1 : the duration between CPL on and signal on */ +/* : bl : 2 ; T2 : the duration signal on and Vdd on */ +/* : bl : 3 ; T3 : the duration between CPL off and signal off */ +/* : bl : 4 ; T4 : the duration signal off and Vdd off */ +/* --------------------------------------------------------------------- */ +void XGI_SetPanelDelay(USHORT tempbl, PVB_DEVICE_INFO pVBInfo) +{ + USHORT index ; + + + index = XGI_GetLCDCapPtr(pVBInfo) ; + + if ( tempbl == 1 ) + XGINew_LCD_Wait_Time( pVBInfo->LCDCapList[ index ].PSC_S1, pVBInfo ) ; + + if ( tempbl == 2 ) + XGINew_LCD_Wait_Time( pVBInfo->LCDCapList[ index ].PSC_S2, pVBInfo ) ; + + if ( tempbl == 3 ) + XGINew_LCD_Wait_Time( pVBInfo->LCDCapList[ index ].PSC_S3, pVBInfo ) ; + + if ( tempbl == 4 ) + XGINew_LCD_Wait_Time( pVBInfo->LCDCapList[ index ].PSC_S4, pVBInfo ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetPanelPower */ +/* Input : */ +/* Output : */ +/* Description : */ +/* I/O : ah = 0011b = 03h ; Backlight on, Power on */ +/* = 0111b = 07h ; Backlight on, Power off */ +/* = 1011b = 0Bh ; Backlight off, Power on */ +/* = 1111b = 0Fh ; Backlight off, Power off */ +/* --------------------------------------------------------------------- */ +void XGI_SetPanelPower(USHORT tempah,USHORT tempbl, PVB_DEVICE_INFO pVBInfo) +{ + if ( pVBInfo->VBType & ( VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x26 , tempbl , tempah ) ; + else + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x11 , tempbl , tempah ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_IsLCDON */ +/* Input : */ +/* Output : FALSE : Skip PSC Control */ +/* TRUE: Disable PSC */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGI_IsLCDON(PVB_DEVICE_INFO pVBInfo) +{ + USHORT tempax ; + + tempax = pVBInfo->VBInfo ; + if ( tempax & SetCRT2ToDualEdge ) + return FALSE ; + else if ( tempax & ( DisableCRT2Display | SwitchToCRT2 | SetSimuScanMode ) ) + return TRUE ; + + return FALSE ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_EnablePWD */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_EnablePWD( PVB_DEVICE_INFO pVBInfo ) +{ + USHORT index , + temp ; + + index = XGI_GetLCDCapPtr(pVBInfo) ; + temp = pVBInfo->LCDCapList[ index ].PWD_2B ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x2B , temp ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x2C , pVBInfo->LCDCapList[ index ].PWD_2C ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x2D , pVBInfo->LCDCapList[ index ].PWD_2D ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x2E , pVBInfo->LCDCapList[ index ].PWD_2E ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x2F , pVBInfo->LCDCapList[ index ].PWD_2F ) ; + XGINew_SetRegOR( pVBInfo->Part4Port , 0x27 , 0x80 ) ; /* enable PWD */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_DisablePWD */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_DisablePWD( PVB_DEVICE_INFO pVBInfo ) +{ + XGINew_SetRegAND( pVBInfo->Part4Port , 0x27 , 0x7F ) ; /* disable PWD */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_DisableChISLCD */ +/* Input : */ +/* Output : FALSE -> Not LCD Mode */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGI_DisableChISLCD(PVB_DEVICE_INFO pVBInfo) +{ + USHORT tempbx , + tempah ; + + tempbx = pVBInfo->SetFlag & ( DisableChA | DisableChB ) ; + tempah = ~( ( USHORT )XGINew_GetReg1( pVBInfo->Part1Port , 0x2E ) ) ; + + if ( tempbx & ( EnableChA | DisableChA ) ) + { + if ( !( tempah & 0x08 ) ) /* Chk LCDA Mode */ + return FALSE ; + } + + if ( !( tempbx & ( EnableChB | DisableChB ) ) ) + return FALSE ; + + if ( tempah & 0x01 ) /* Chk LCDB Mode */ + return TRUE ; + + return FALSE ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_EnableChISLCD */ +/* Input : */ +/* Output : 0 -> Not LCD mode */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGI_EnableChISLCD(PVB_DEVICE_INFO pVBInfo) +{ + USHORT tempbx , + tempah ; + + + tempbx = pVBInfo->SetFlag & ( EnableChA | EnableChB ) ; + tempah = ~( ( USHORT )XGINew_GetReg1( pVBInfo->Part1Port , 0x2E ) ) ; + + if ( tempbx & ( EnableChA | DisableChA ) ) + { + if ( !( tempah & 0x08 ) ) /* Chk LCDA Mode */ + return FALSE ; + } + + if ( !( tempbx & ( EnableChB | DisableChB ) ) ) + return FALSE ; + + if ( tempah & 0x01 ) /* Chk LCDB Mode */ + return TRUE ; + + return FALSE ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetLCDCapPtr */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +USHORT XGI_GetLCDCapPtr( PVB_DEVICE_INFO pVBInfo ) +{ + UCHAR tempal , + tempah , + tempbl , + i ; + + tempah = XGINew_GetReg1( pVBInfo->P3d4 , 0x36 ) ; + tempal = tempah & 0x0F ; + tempah = tempah & 0xF0 ; + i = 0 ; + tempbl = pVBInfo->LCDCapList[ i ].LCD_ID ; + + while( tempbl != 0xFF ) + { + if ( tempbl & 0x80 ) /* OEMUtil */ + { + tempal = tempah ; + tempbl = tempbl & ~( 0x80 ) ; + } + + if ( tempal == tempbl ) + break ; + + i++ ; + + tempbl = pVBInfo->LCDCapList[ i ].LCD_ID ; + } + + return i ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetLCDCapPtr1 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +USHORT XGI_GetLCDCapPtr1( PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempah , + tempal , + tempbl , + i ; + + tempal = pVBInfo->LCDResInfo ; + tempah = pVBInfo->LCDTypeInfo ; + + i = 0 ; + tempbl = pVBInfo->LCDCapList[ i ].LCD_ID; + + while( tempbl != 0xFF ) + { + if ( ( tempbl & 0x80 ) && ( tempbl != 0x80 ) ) + { + tempal = tempah ; + tempbl &= ~0x80 ; + } + + if ( tempal == tempbl ) + break ; + + i++ ; + tempbl = pVBInfo->LCDCapList[ i ].LCD_ID ; + } + + if ( tempbl == 0xFF ) + { + pVBInfo->LCDResInfo = Panel1024x768 ; + pVBInfo->LCDTypeInfo = 0 ; + i = 0 ; + } + + return i ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetLCDSync */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_GetLCDSync( USHORT* HSyncWidth , USHORT* VSyncWidth, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT Index ; + + Index = XGI_GetLCDCapPtr(pVBInfo) ; + *HSyncWidth = pVBInfo->LCDCapList[ Index ].LCD_HSyncWidth ; + *VSyncWidth = pVBInfo->LCDCapList[ Index ].LCD_VSyncWidth ; + + return ; +} + + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_EnableBridge */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_EnableBridge( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) +{ + USHORT tempbl , + tempah ; + + + if ( pVBInfo->SetFlag == Win9xDOSMode ) + { + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + XGI_DisplayOn( pVBInfo) ; + return ; + } + else /* LVDS or CH7017 */ + return ; + } + + + if ( HwDeviceExtension->jChipType < XG40 ) + { + if ( !XGI_DisableChISLCD(pVBInfo) ) + { + if ( ( XGI_EnableChISLCD(pVBInfo) ) || ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) ) + { + if ( pVBInfo->LCDInfo & SetPWDEnable ) + { + XGI_EnablePWD( pVBInfo); + } + else + { + pVBInfo->LCDInfo &= ( ~SetPWDEnable ) ; + if ( pVBInfo->VBType & ( VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + tempbl = 0xFD ; + tempah = 0x02 ; + } + else + { + tempbl = 0xFB ; + tempah = 0x00 ; + } + + XGI_SetPanelPower( tempah , tempbl, pVBInfo ) ; + XGI_SetPanelDelay( 1,pVBInfo ) ; + } + } + } + } /* Not 340 */ + + + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + if ( !( pVBInfo->SetFlag & DisableChA ) ) + { + if ( pVBInfo->SetFlag & EnableChA ) + { + XGINew_SetReg1( pVBInfo->Part1Port , 0x1E , 0x20 ) ; /* Power on */ + } + else + { + if ( pVBInfo->VBInfo & SetCRT2ToDualEdge ) /* SetCRT2ToLCDA ) */ + { + XGINew_SetReg1(pVBInfo->Part1Port,0x1E,0x20); /* Power on */ + } + } + } + + if ( !( pVBInfo->SetFlag & DisableChB ) ) + { + if ( ( pVBInfo->SetFlag & EnableChB ) || ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToTV | SetCRT2ToRAMDAC ) ) ) + { + tempah = ( UCHAR )XGINew_GetReg1( pVBInfo->P3c4 , 0x32 ) ; + tempah &= 0xDF; + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + if ( !( pVBInfo->VBInfo & SetCRT2ToRAMDAC ) ) + tempah |= 0x20 ; + } + XGINew_SetReg1( pVBInfo->P3c4 , 0x32 , tempah ) ; + XGINew_SetRegOR( pVBInfo->P3c4 , 0x1E , 0x20 ) ; + + + tempah = ( UCHAR )XGINew_GetReg1( pVBInfo->Part1Port , 0x2E ) ; + + if ( !( tempah & 0x80 ) ) + XGINew_SetRegOR( pVBInfo->Part1Port , 0x2E , 0x80 ) ; /* BVBDOENABLE = 1 */ + + XGINew_SetRegAND( pVBInfo->Part1Port , 0x00 , 0x7F ) ; /* BScreenOFF = 0 */ + } + } + + if ( ( pVBInfo->SetFlag & ( EnableChA | EnableChB ) ) || ( !( pVBInfo->VBInfo & DisableCRT2Display ) ) ) + { + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x00 , ~0xE0 , 0x20 ) ; /* shampoo 0129 */ + if ( pVBInfo->VBType & ( VB_XGI302LV | VB_XGI301C ) ) + { + if ( !XGI_DisableChISLCD(pVBInfo) ) + { + if ( XGI_EnableChISLCD( pVBInfo) || ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) ) + XGINew_SetRegAND( pVBInfo->Part4Port ,0x2A , 0x7F ) ; /* LVDS PLL power on */ + } + XGINew_SetRegAND( pVBInfo->Part4Port , 0x30 , 0x7F ) ; /* LVDS Driver power on */ + } + } + + tempah = 0x00 ; + + if ( !( pVBInfo->VBInfo & DisableCRT2Display ) ) + { + tempah = 0xc0 ; + + if ( !( pVBInfo->VBInfo & SetSimuScanMode ) ) + { + if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) + { + if ( pVBInfo->VBInfo & SetCRT2ToDualEdge ) + { + tempah = tempah & 0x40; + if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) + tempah = tempah ^ 0xC0 ; + + if ( pVBInfo->SetFlag & DisableChB ) + tempah &= 0xBF ; + + if ( pVBInfo->SetFlag & DisableChA ) + tempah &= 0x7F ; + + if ( pVBInfo->SetFlag & EnableChB ) + tempah |= 0x40 ; + + if ( pVBInfo->SetFlag & EnableChA ) + tempah |= 0x80 ; + } + } + } + } + + XGINew_SetRegOR( pVBInfo->Part4Port , 0x1F , tempah ) ; /* EnablePart4_1F */ + + if ( pVBInfo->SetFlag & Win9xDOSMode ) + { + XGI_DisplayOn( pVBInfo) ; + return ; + } + + if ( !( pVBInfo->SetFlag & DisableChA ) ) + { + XGI_VBLongWait( pVBInfo) ; + if ( !( pVBInfo->SetFlag & GatingCRT ) ) + { + XGI_DisableGatingCRT( HwDeviceExtension, pVBInfo ) ; + XGI_DisplayOn( pVBInfo) ; + XGI_VBLongWait( pVBInfo) ; + } + } + } /* 301 */ + else /* LVDS */ + { + if ( pVBInfo->VBInfo & ( SetCRT2ToTV | SetCRT2ToLCD | SetCRT2ToLCDA ) ) + XGINew_SetRegOR( pVBInfo->Part1Port , 0x1E , 0x20 ) ; /* enable CRT2 */ + + + + tempah = ( UCHAR )XGINew_GetReg1( pVBInfo->Part1Port , 0x2E ) ; + if ( !( tempah & 0x80 ) ) + XGINew_SetRegOR( pVBInfo->Part1Port , 0x2E , 0x80 ) ; /* BVBDOENABLE = 1 */ + + XGINew_SetRegAND(pVBInfo->Part1Port,0x00,0x7F); + XGI_DisplayOn( pVBInfo); + } /* End of VB */ + + + if ( HwDeviceExtension->jChipType < XG40 ) + { + if ( !XGI_EnableChISLCD(pVBInfo) ) + { + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) + { + if ( XGI_BacklightByDrv(pVBInfo) ) + return ; + } + else + return ; + } + + if ( pVBInfo->LCDInfo & SetPWDEnable ) + { + XGI_FirePWDEnable(pVBInfo) ; + return ; + } + + XGI_SetPanelDelay( 2,pVBInfo ) ; + + if ( pVBInfo->VBType & ( VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + tempah = 0x01 ; + tempbl = 0xFE ; /* turn on backlght */ + } + else + { + tempbl = 0xF7 ; + tempah = 0x00 ; + } + XGI_SetPanelPower( tempah , tempbl , pVBInfo) ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_DisableBridge */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_DisableBridge(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +{ + USHORT tempax , + tempbx , + tempah = 0 , + tempbl = 0 ; + + if ( pVBInfo->SetFlag == Win9xDOSMode ) + return ; + + + if ( HwDeviceExtension->jChipType < XG40 ) + { + if ( ( !( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) ) || ( XGI_DisableChISLCD(pVBInfo) ) ) + { + if ( !XGI_IsLCDON(pVBInfo) ) + { + if ( pVBInfo->LCDInfo & SetPWDEnable ) + XGI_EnablePWD( pVBInfo) ; + else + { + pVBInfo->LCDInfo &= ~SetPWDEnable ; + XGI_DisablePWD(pVBInfo) ; + if ( pVBInfo->VBType & ( VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + tempbx = 0xFE ; /* not 01h */ + tempax = 0 ; + } + else + { + tempbx = 0xF7 ; /* not 08h */ + tempax = 0x08 ; + } + XGI_SetPanelPower( tempax , tempbx , pVBInfo) ; + XGI_SetPanelDelay( 3,pVBInfo ) ; + } + } /* end if(!XGI_IsLCDON(pVBInfo)) */ + } + } + +/* if ( CH7017 ) + { + if ( !( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2toLCDA ) ) || ( XGI_DisableChISLCD(pVBInfo) ) ) + { + if ( !XGI_IsLCDON(pVBInfo) ) + { + if ( DISCHARGE ) + { + tempbx = XGINew_GetCH7005( 0x61 ) ; + if ( tempbx < 0x01 ) //first time we power up + XGINew_SetCH7005( 0x0066 ) ; //and disable power sequence + else + XGINew_SetCH7005( 0x5f66 ) ; //leave VDD on - disable power + } + } + } + } */ + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B| VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + tempah = 0x3F ; + if ( !( pVBInfo->VBInfo & ( DisableCRT2Display | SetSimuScanMode ) ) ) + { + if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) + { + if ( pVBInfo->VBInfo & SetCRT2ToDualEdge ) + { + tempah = 0x7F; /* Disable Channel A */ + if ( !( pVBInfo->VBInfo & SetCRT2ToLCDA ) ) + tempah = 0xBF ; /* Disable Channel B */ + + if ( pVBInfo->SetFlag & DisableChB ) + tempah &= 0xBF ; /* force to disable Cahnnel */ + + if ( pVBInfo->SetFlag & DisableChA ) + tempah &= 0x7F ; /* Force to disable Channel B */ + } + } + } + + XGINew_SetRegAND( pVBInfo->Part4Port , 0x1F , tempah ) ; /* disable part4_1f */ + + if ( pVBInfo->VBType & ( VB_XGI302LV | VB_XGI301C ) ) + { + if ( ( ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) ) || ( XGI_DisableChISLCD(pVBInfo) ) || ( XGI_IsLCDON(pVBInfo) ) ) + XGINew_SetRegOR( pVBInfo->Part4Port , 0x30 , 0x80 ) ; /* LVDS Driver power down */ + } + + if ( ( pVBInfo->SetFlag & DisableChA ) || ( pVBInfo->VBInfo & ( DisableCRT2Display | SetCRT2ToLCDA | SetSimuScanMode ) ) ) + { + if ( pVBInfo->SetFlag & GatingCRT ) + XGI_EnableGatingCRT( HwDeviceExtension, pVBInfo ) ; + XGI_DisplayOff( pVBInfo) ; + } + + if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) + { + if ( ( pVBInfo->SetFlag & DisableChA ) || ( pVBInfo->VBInfo & SetCRT2ToLCDA ) ) + XGINew_SetRegAND( pVBInfo->Part1Port , 0x1e , 0xdf ) ; /* Power down */ + } + + XGINew_SetRegAND( pVBInfo->P3c4 , 0x32 , 0xdf ) ; /* disable TV as primary VGA swap */ + + if ( ( pVBInfo->VBInfo & ( SetSimuScanMode | SetCRT2ToDualEdge ) ) ) + XGINew_SetRegAND(pVBInfo->Part2Port,0x00,0xdf); + + if ( ( pVBInfo->SetFlag & DisableChB ) || ( pVBInfo->VBInfo & ( DisableCRT2Display | SetSimuScanMode ) ) + || ( ( !( pVBInfo->VBInfo & SetCRT2ToLCDA ) ) && ( pVBInfo->VBInfo & ( SetCRT2ToRAMDAC | SetCRT2ToLCD | SetCRT2ToTV ) ) ) ) + XGINew_SetRegOR( pVBInfo->Part1Port , 0x00 , 0x80 ) ; /* BScreenOff=1 */ + + if ( ( pVBInfo->SetFlag & DisableChB ) || ( pVBInfo->VBInfo & ( DisableCRT2Display | SetSimuScanMode ) ) + || ( !( pVBInfo->VBInfo & SetCRT2ToLCDA ) ) || ( pVBInfo->VBInfo & ( SetCRT2ToRAMDAC | SetCRT2ToLCD | SetCRT2ToTV ) ) ) + { + tempah= XGINew_GetReg1( pVBInfo->Part1Port , 0x00 ) ; /* save Part1 index 0 */ + XGINew_SetRegOR( pVBInfo->Part1Port , 0x00 , 0x10 ) ; /* BTDAC = 1, avoid VB reset */ + XGINew_SetRegAND( pVBInfo->Part1Port , 0x1E , 0xDF ) ; /* disable CRT2 */ + XGINew_SetReg1( pVBInfo->Part1Port , 0x00 , tempah ) ; /* restore Part1 index 0 */ + } + } + else /* {301} */ + { + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToTV ) ) + { + XGINew_SetRegOR( pVBInfo->Part1Port , 0x00 , 0x80 ) ; /* BScreenOff=1 */ + XGINew_SetRegAND( pVBInfo->Part1Port , 0x1E , 0xDF ) ; /* Disable CRT2 */ + XGINew_SetRegAND( pVBInfo->P3c4 , 0x32 , 0xDF ) ; /* Disable TV asPrimary VGA swap */ + } + + if ( pVBInfo->VBInfo & ( DisableCRT2Display | SetCRT2ToLCDA | SetSimuScanMode ) ) + XGI_DisplayOff( pVBInfo) ; + } + + + + + if ( HwDeviceExtension->jChipType < XG40 ) + { + if ( !( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) || ( XGI_DisableChISLCD(pVBInfo) ) || ( XGI_IsLCDON(pVBInfo) ) ) + { + if ( pVBInfo->LCDInfo & SetPWDEnable ) + { + if ( pVBInfo->LCDInfo & SetPWDEnable ) + XGI_BacklightByDrv(pVBInfo) ; + else + { + XGI_SetPanelDelay( 4 ,pVBInfo) ; + if ( pVBInfo->VBType & VB_XGI301LV ) + { + tempbl = 0xFD ; + tempah = 0x00 ; + } + else + { + tempbl = 0xFB ; + tempah = 0x04 ; + } + } + } + XGI_SetPanelPower( tempah , tempbl , pVBInfo) ; + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetTVPtrIndex */ +/* Input : */ +/* Output : */ +/* Description : bx 0 : ExtNTSC */ +/* 1 : StNTSC */ +/* 2 : ExtPAL */ +/* 3 : StPAL */ +/* 4 : ExtHiTV */ +/* 5 : StHiTV */ +/* 6 : Ext525i */ +/* 7 : St525i */ +/* 8 : Ext525p */ +/* 9 : St525p */ +/* A : Ext750p */ +/* B : St750p */ +/* --------------------------------------------------------------------- */ +USHORT XGI_GetTVPtrIndex( PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempbx = 0 ; + + if ( pVBInfo->TVInfo & SetPALTV ) + tempbx = 2 ; + if ( pVBInfo->TVInfo & SetYPbPrMode1080i ) + tempbx = 4 ; + if ( pVBInfo->TVInfo & SetYPbPrMode525i ) + tempbx = 6 ; + if ( pVBInfo->TVInfo & SetYPbPrMode525p ) + tempbx = 8 ; + if ( pVBInfo->TVInfo & SetYPbPrMode750p ) + tempbx = 10 ; + if ( pVBInfo->TVInfo & TVSimuMode ) + tempbx++ ; + + return tempbx ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_OEM310Setting */ +/* Input : */ +/* Output : */ +/* Description : Customized Param. for 301 */ +/* --------------------------------------------------------------------- */ +void XGI_OEM310Setting( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) +{ + if ( pVBInfo->SetFlag & Win9xDOSMode ) + return ; + + /* GetPart1IO(); */ + XGI_SetDelayComp(pVBInfo) ; + + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) + XGI_SetLCDCap(pVBInfo) ; + + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + /* GetPart2IO() */ + XGI_SetPhaseIncr(pVBInfo) ; + XGI_SetYFilter( ModeNo , ModeIdIndex,pVBInfo ) ; + XGI_SetAntiFlicker( ModeNo , ModeIdIndex,pVBInfo ) ; + + if ( pVBInfo->VBType&VB_XGI301) + XGI_SetEdgeEnhance( ModeNo , ModeIdIndex ,pVBInfo) ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetDelayComp */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetDelayComp( PVB_DEVICE_INFO pVBInfo ) +{ + USHORT index ; + + UCHAR tempah , + tempbl , + tempbh ; + + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA | SetCRT2ToTV | SetCRT2ToRAMDAC ) ) + { + tempbl = 0; + tempbh = 0; + + index = XGI_GetTVPtrIndex(pVBInfo ) ; /* Get TV Delay */ + tempbl = pVBInfo->XGI_TVDelayList[ index ] ; + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + tempbl = pVBInfo->XGI_TVDelayList2[ index ] ; + + if ( pVBInfo->VBInfo & SetCRT2ToDualEdge ) + tempbl = tempbl >> 4 ; +/* + if ( pVBInfo->VBInfo & SetCRT2ToRAMDAC ) + tempbl = CRT2Delay1 ; // Get CRT2 Delay + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + tempbl = CRT2Delay2 ; +*/ + if ( pVBInfo->VBInfo & ( SetCRT2ToLCD | SetCRT2ToLCDA ) ) + { + index = XGI_GetLCDCapPtr(pVBInfo) ; /* Get LCD Delay */ + tempbh=pVBInfo->LCDCapList[ index ].LCD_DelayCompensation ; + + if ( !( pVBInfo->VBInfo & SetCRT2ToLCDA ) ) + tempbl = tempbh ; + } + + tempbl &= 0x0F ; + tempbh &= 0xF0 ; + tempah = XGINew_GetReg1( pVBInfo->Part1Port , 0x2D ) ; + + if ( pVBInfo->VBInfo & ( SetCRT2ToRAMDAC | SetCRT2ToLCD | SetCRT2ToTV ) ) /* Channel B */ + { + tempah &= 0xF0 ; + tempah |= tempbl ; + } + + if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) /* Channel A */ + { + tempah &= 0x0F ; + tempah |= tempbh ; + } + XGINew_SetReg1(pVBInfo->Part1Port,0x2D,tempah); + } + } + else if ( pVBInfo->IF_DEF_LVDS == 1 ) + { + tempbl = 0; + tempbh = 0; + if ( pVBInfo->VBInfo & SetCRT2ToLCD ) + { + tempah = pVBInfo->LCDCapList[ XGI_GetLCDCapPtr(pVBInfo) ].LCD_DelayCompensation ; /* / Get LCD Delay */ + tempah &= 0x0f ; + tempah = tempah << 4 ; + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x2D , 0x0f , tempah ) ; + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetLCDCap */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetLCDCap( PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempcx ; + + tempcx = pVBInfo->LCDCapList[ XGI_GetLCDCapPtr(pVBInfo) ].LCD_Capability ; + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + if ( pVBInfo->VBType & ( VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { /* 301LV/302LV only */ + /* Set 301LV Capability */ + XGINew_SetReg1( pVBInfo->Part4Port , 0x24 , ( UCHAR )( tempcx & 0x1F ) ) ; + } + /* VB Driving */ + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x0D , ~( ( EnableVBCLKDRVLOW | EnablePLLSPLOW ) >> 8 ) , ( USHORT )( ( tempcx & ( EnableVBCLKDRVLOW | EnablePLLSPLOW ) ) >> 8 ) ) ; + } + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + if ( pVBInfo->VBInfo & SetCRT2ToLCD ) + XGI_SetLCDCap_B( tempcx,pVBInfo ) ; + else if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) + XGI_SetLCDCap_A( tempcx,pVBInfo ) ; + + if ( pVBInfo->VBType & ( VB_XGI302LV | VB_XGI301C ) ) + { + if ( tempcx & EnableSpectrum ) + SetSpectrum( pVBInfo) ; + } + } + else /* LVDS,CH7017 */ + XGI_SetLCDCap_A( tempcx, pVBInfo ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetLCDCap_A */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetLCDCap_A(USHORT tempcx,PVB_DEVICE_INFO pVBInfo) +{ + USHORT temp ; + + temp = XGINew_GetReg1( pVBInfo->P3d4 , 0x37 ) ; + + if ( temp & LCDRGB18Bit ) + { + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x19 , 0x0F , ( USHORT )( 0x20 | ( tempcx & 0x00C0 ) ) ) ; /* Enable Dither */ + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x1A , 0x7F , 0x80 ) ; + } + else + { + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x19 , 0x0F , ( USHORT )( 0x30 | ( tempcx & 0x00C0 ) ) ) ; + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x1A , 0x7F , 0x00 ) ; + } + +/* + if ( tempcx & EnableLCD24bpp ) // 24bits + { + XGINew_SetRegANDOR(pVBInfo->Part1Port,0x19, 0x0F,(USHORT)(0x30|(tempcx&0x00C0)) ); + XGINew_SetRegANDOR(pVBInfo->Part1Port,0x1A,0x7F,0x00); + } + else + { + XGINew_SetRegANDOR(pVBInfo->Part1Port,0x19, 0x0F,(USHORT)(0x20|(tempcx&0x00C0)) );//Enable Dither + XGINew_SetRegANDOR(pVBInfo->Part1Port,0x1A,0x7F,0x80); + } +*/ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetLCDCap_B */ +/* Input : cx -> LCD Capability */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetLCDCap_B(USHORT tempcx,PVB_DEVICE_INFO pVBInfo) +{ + if ( tempcx & EnableLCD24bpp ) /* 24bits */ + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x1A , 0xE0 , ( USHORT )( ( ( tempcx & 0x00ff ) >> 6 ) | 0x0c ) ) ; + else + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x1A , 0xE0 , ( USHORT )( ( ( tempcx & 0x00ff ) >> 6 ) | 0x18 ) ) ; /* Enable Dither */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : SetSpectrum */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +static void SetSpectrum( PVB_DEVICE_INFO pVBInfo ) +{ + USHORT index ; + + index = XGI_GetLCDCapPtr(pVBInfo) ; + + XGINew_SetRegAND( pVBInfo->Part4Port , 0x30 , 0x8F ) ; /* disable down spectrum D[4] */ + XGI_LongWait(pVBInfo) ; + XGINew_SetRegOR( pVBInfo->Part4Port , 0x30 , 0x20 ) ; /* reset spectrum */ + XGI_LongWait(pVBInfo) ; + + XGINew_SetReg1( pVBInfo->Part4Port , 0x31 , pVBInfo->LCDCapList[ index ].Spectrum_31 ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x32 , pVBInfo->LCDCapList[ index ].Spectrum_32 ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x33 , pVBInfo->LCDCapList[ index ].Spectrum_33 ) ; + XGINew_SetReg1( pVBInfo->Part4Port , 0x34 , pVBInfo->LCDCapList[ index ].Spectrum_34 ) ; + XGI_LongWait(pVBInfo) ; + XGINew_SetRegOR( pVBInfo->Part4Port , 0x30 , 0x40 ) ; /* enable spectrum */ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetAntiFlicker */ +/* Input : */ +/* Output : */ +/* Description : Set TV Customized Param. */ +/* --------------------------------------------------------------------- */ +void XGI_SetAntiFlicker( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempbx , + index ; + + UCHAR tempah ; + + if (pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p ) ) + return ; + + tempbx = XGI_GetTVPtrIndex(pVBInfo ) ; + tempbx &= 0xFE ; + + if ( ModeNo <= 0x13 ) + { + index = pVBInfo->SModeIDTable[ ModeIdIndex ].VB_StTVFlickerIndex ; + } + else + { + index = pVBInfo->EModeIDTable[ ModeIdIndex ].VB_ExtTVFlickerIndex ; + } + + tempbx += index ; + tempah = TVAntiFlickList[ tempbx ] ; + tempah = tempah << 4 ; + + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x0A , 0x8F , tempah ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetEdgeEnhance */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetEdgeEnhance( USHORT ModeNo , USHORT ModeIdIndex , PVB_DEVICE_INFO pVBInfo) +{ + USHORT tempbx , + index ; + + UCHAR tempah ; + + + tempbx = XGI_GetTVPtrIndex(pVBInfo ) ; + tempbx &= 0xFE ; + + if ( ModeNo <= 0x13 ) + { + index = pVBInfo->SModeIDTable[ ModeIdIndex ].VB_StTVEdgeIndex ; + } + else + { + index = pVBInfo->EModeIDTable[ ModeIdIndex ].VB_ExtTVEdgeIndex ; + } + + tempbx += index ; + tempah = TVEdgeList[ tempbx ] ; + tempah = tempah << 5 ; + + XGINew_SetRegANDOR( pVBInfo->Part2Port , 0x3A , 0x1F , tempah ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetPhaseIncr */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetPhaseIncr( PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempbx ; + + UCHAR tempcl , + tempch ; + + ULONG tempData ; + + XGI_GetTVPtrIndex2( &tempbx , &tempcl , &tempch, pVBInfo ) ; /* bx, cl, ch */ + tempData = TVPhaseList[ tempbx ] ; + + XGINew_SetReg1( pVBInfo->Part2Port , 0x31 , ( USHORT )( tempData & 0x000000FF ) ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x32 , ( USHORT )( ( tempData & 0x0000FF00 ) >> 8 ) ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x33 , ( USHORT )( ( tempData & 0x00FF0000 ) >> 16 ) ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x34 , ( USHORT )( ( tempData & 0xFF000000 ) >> 24 ) ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetYFilter */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_SetYFilter( USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) +{ + USHORT tempbx , + index ; + + UCHAR tempcl , + tempch , + tempal , + *filterPtr ; + + XGI_GetTVPtrIndex2( &tempbx , &tempcl , &tempch, pVBInfo ) ; /* bx, cl, ch */ + + switch( tempbx ) + { + case 0x00: + case 0x04: + filterPtr = NTSCYFilter1 ; + break ; + + case 0x01: + filterPtr = PALYFilter1 ; + break ; + + case 0x02: + case 0x05: + case 0x0D: + filterPtr = PALMYFilter1 ; + break ; + + case 0x03: + filterPtr = PALNYFilter1 ; + break ; + + case 0x08: + case 0x0C: + filterPtr = NTSCYFilter2 ; + break ; + + case 0x0A: + filterPtr = PALMYFilter2 ; + break ; + + case 0x0B: + filterPtr = PALNYFilter2 ; + break ; + + case 0x09: + filterPtr = PALYFilter2 ; + break ; + + default: + return ; + } + + if ( ModeNo <= 0x13 ) + tempal = pVBInfo->SModeIDTable[ ModeIdIndex ].VB_StTVYFilterIndex ; + else + tempal = pVBInfo->EModeIDTable[ ModeIdIndex ].VB_ExtTVYFilterIndex ; + + if ( tempcl == 0 ) + index = tempal * 4; + else + index = tempal * 7; + + if ( ( tempcl == 0 ) && ( tempch == 1 ) ) + { + XGINew_SetReg1( pVBInfo->Part2Port , 0x35 , 0 ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x36 , 0 ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x37 , 0 ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x38 , filterPtr[ index++ ] ) ; + } + else + { + XGINew_SetReg1( pVBInfo->Part2Port , 0x35 , filterPtr[ index++ ] ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x36 , filterPtr[ index++ ] ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x37 , filterPtr[ index++ ] ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x38 , filterPtr[ index++ ] ) ; + } + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + XGINew_SetReg1( pVBInfo->Part2Port , 0x48 , filterPtr[ index++ ] ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x49 , filterPtr[ index++ ] ) ; + XGINew_SetReg1( pVBInfo->Part2Port , 0x4A , filterPtr[ index++ ] ) ; + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetTVPtrIndex2 */ +/* Input : */ +/* Output : bx 0 : NTSC */ +/* 1 : PAL */ +/* 2 : PALM */ +/* 3 : PALN */ +/* 4 : NTSC1024x768 */ +/* 5 : PAL-M 1024x768 */ +/* 6-7: reserved */ +/* cl 0 : YFilter1 */ +/* 1 : YFilter2 */ +/* ch 0 : 301A */ +/* 1 : 301B/302B/301LV/302LV */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_GetTVPtrIndex2(USHORT* tempbx,UCHAR* tempcl,UCHAR* tempch, PVB_DEVICE_INFO pVBInfo) +{ + *tempbx = 0 ; + *tempcl = 0 ; + *tempch = 0 ; + + if ( pVBInfo->TVInfo & SetPALTV ) + *tempbx = 1 ; + + if ( pVBInfo->TVInfo & SetPALMTV ) + *tempbx = 2 ; + + if ( pVBInfo->TVInfo & SetPALNTV ) + *tempbx = 3 ; + + if ( pVBInfo->TVInfo & NTSC1024x768 ) + { + *tempbx = 4 ; + if ( pVBInfo->TVInfo & SetPALMTV ) + *tempbx = 5 ; + } + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + if ( ( !( pVBInfo->VBInfo & SetInSlaveMode ) ) || ( pVBInfo->TVInfo & TVSimuMode ) ) + { + *tempbx += 8 ; + *tempcl += 1 ; + } + } + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + (*tempch)++ ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_SetCRT2ModeRegs */ +/* Input : */ +/* Output : */ +/* Description : Origin code for crt2group */ +/* --------------------------------------------------------------------- */ +void XGI_SetCRT2ModeRegs(USHORT ModeNo,PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) +{ + USHORT tempbl ; + + + int tempcl ; + + UCHAR tempah ; + + /* XGINew_SetReg1( pVBInfo->Part1Port , 0x03 , 0x00 ) ; // fix write part1 index 0 BTDRAM bit Bug */ + tempah=0; + if ( !( pVBInfo->VBInfo & DisableCRT2Display ) ) + { + tempah=XGINew_GetReg1( pVBInfo->Part1Port , 0x00 ) ; + tempah &= ~0x10 ; /* BTRAMDAC */ + tempah |= 0x40 ; /* BTRAM */ + + if ( pVBInfo->VBInfo & ( SetCRT2ToRAMDAC | SetCRT2ToTV | SetCRT2ToLCD ) ) + { + tempah=0x40; /* BTDRAM */ + if ( ModeNo > 0x13 ) + { + tempcl = pVBInfo->ModeType ; + tempcl -= ModeVGA ; + if ( tempcl >= 0 ) + { + tempah = ( 0x008 >> tempcl ) ; /* BT Color */ + if ( tempah == 0 ) + tempah = 1 ; + tempah |= 0x040 ; + } + } + if ( pVBInfo->VBInfo & SetInSlaveMode ) + tempah ^= 0x50 ; /* BTDAC */ + } + } + +/* 0210 shampoo + if ( pVBInfo->VBInfo & DisableCRT2Display ) + { + tempah = 0 ; + } + + XGINew_SetReg1( pVBInfo->Part1Port , 0x00 , tempah ) ; + if ( pVBInfo->VBInfo & ( SetCRT2ToRAMDAC | SetCRT2ToTV | SetCRT2ToLCD ) ) + { + tempcl = pVBInfo->ModeType ; + if ( ModeNo > 0x13 ) + { + tempcl -= ModeVGA ; + if ( ( tempcl > 0 ) || ( tempcl == 0 ) ) + { + tempah=(0x008>>tempcl) ; + if ( tempah == 0 ) + tempah = 1 ; + tempah |= 0x040; + } + } + else + { + tempah = 0x040 ; + } + + if ( pVBInfo->VBInfo & SetInSlaveMode ) + { + tempah = ( tempah ^ 0x050 ) ; + } + } +*/ + + XGINew_SetReg1( pVBInfo->Part1Port , 0x00 , tempah ) ; + tempah = 0x08 ; + tempbl = 0xf0 ; + + if ( pVBInfo->VBInfo & DisableCRT2Display ) + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x2e , tempbl , tempah ) ; + else + { + tempah = 0x00 ; + tempbl = 0xff ; + + if ( pVBInfo->VBInfo & ( SetCRT2ToRAMDAC | SetCRT2ToTV | SetCRT2ToLCD | SetCRT2ToLCDA ) ) + { + if ( ( pVBInfo->VBInfo & SetCRT2ToLCDA ) && ( !( pVBInfo->VBInfo & SetSimuScanMode ) ) ) + { + tempbl &= 0xf7 ; + tempah |= 0x01 ; + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x2e , tempbl , tempah ) ; + } + else + { + if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) + { + tempbl &= 0xf7 ; + tempah |= 0x01 ; + } + + if ( pVBInfo->VBInfo & ( SetCRT2ToRAMDAC | SetCRT2ToTV | SetCRT2ToLCD ) ) + { + tempbl &= 0xf8 ; + tempah = 0x01 ; + + if ( !( pVBInfo->VBInfo & SetInSlaveMode ) ) + tempah |= 0x02 ; + + if ( !( pVBInfo->VBInfo & SetCRT2ToRAMDAC ) ) + { + tempah = tempah ^ 0x05 ; + if ( !( pVBInfo->VBInfo & SetCRT2ToLCD ) ) + tempah = tempah ^ 0x01 ; + } + + if ( !( pVBInfo->VBInfo & SetCRT2ToDualEdge ) ) + tempah |= 0x08 ; + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x2e , tempbl , tempah ) ; + } + else + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x2e , tempbl , tempah ) ; + } + } + else + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x2e , tempbl , tempah ) ; + } + + if ( pVBInfo->VBInfo & ( SetCRT2ToRAMDAC | SetCRT2ToTV | SetCRT2ToLCD | SetCRT2ToLCDA ) ) + { + tempah &= ( ~0x08 ) ; + if ( ( pVBInfo->ModeType == ModeVGA ) && ( !( pVBInfo->VBInfo & SetInSlaveMode ) ) ) + { + tempah |= 0x010 ; + } + tempah |= 0x080 ; + + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + /* if ( !( pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p ) ) ) */ + /* { */ + tempah |= 0x020 ; + if ( ModeNo > 0x13 ) + { + if ( pVBInfo->VBInfo & DriverMode ) + tempah = tempah ^ 0x20 ; + } + /* } */ + } + + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x0D , ~0x0BF , tempah ) ; + tempah = 0 ; + + if ( pVBInfo->LCDInfo & SetLCDDualLink ) + tempah |= 0x40 ; + + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + /* if ( ( !( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) ) && ( !( pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p ) ) ) ) */ + /* { */ + if ( pVBInfo->TVInfo & RPLLDIV2XO ) + tempah |= 0x40 ; + /* } */ + } + + if ( ( pVBInfo->LCDResInfo == Panel1280x1024 ) || ( pVBInfo->LCDResInfo == Panel1280x1024x75 ) ) + tempah |= 0x80 ; + + if ( pVBInfo->LCDResInfo == Panel1280x960 ) + tempah |= 0x80 ; + + XGINew_SetReg1( pVBInfo->Part4Port , 0x0C , tempah ) ; + } + + if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) ) + { + tempah = 0 ; + tempbl = 0xfb ; + + if ( pVBInfo->VBInfo & SetCRT2ToDualEdge ) + { + tempbl=0xff; + if ( pVBInfo->VBInfo & SetCRT2ToLCDA ) + tempah |= 0x04 ; /* shampoo 0129 */ + } + + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x13 , tempbl , tempah ) ; + tempah = 0x00 ; + tempbl = 0xcf ; + if ( !( pVBInfo->VBInfo & DisableCRT2Display ) ) + { + if ( pVBInfo->VBInfo & SetCRT2ToDualEdge ) + tempah |= 0x30 ; + } + + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x2c , tempbl , tempah ) ; + tempah = 0 ; + tempbl = 0x3f ; + + if ( !( pVBInfo->VBInfo & DisableCRT2Display ) ) + { + if ( pVBInfo->VBInfo & SetCRT2ToDualEdge ) + tempah |= 0xc0 ; + } + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x21 , tempbl , tempah ) ; + } + + tempah = 0 ; + tempbl = 0x7f ; + if ( !( pVBInfo->VBInfo & SetCRT2ToLCDA ) ) + { + tempbl = 0xff ; + if ( !( pVBInfo->VBInfo & SetCRT2ToDualEdge ) ) + tempah |= 0x80 ; + } + + XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x23 , tempbl , tempah ) ; + + if ( pVBInfo->VBType & ( VB_XGI302LV | VB_XGI301C ) ) + { + if ( pVBInfo->LCDInfo & SetLCDDualLink ) + { + XGINew_SetRegOR( pVBInfo->Part4Port , 0x27 , 0x20 ) ; + XGINew_SetRegOR( pVBInfo->Part4Port , 0x34 , 0x10 ) ; + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_CloseCRTC */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_CloseCRTC( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +{ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_OpenCRTC */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_OpenCRTC( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +{ +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetRAMDAC2DATA */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_GetRAMDAC2DATA(USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempax , + tempbx , + temp1 , + temp2 , + modeflag = 0 , + tempcx , + StandTableIndex , + CRT1Index ; + + + + + pVBInfo->RVBHCMAX = 1 ; + pVBInfo->RVBHCFACT = 1 ; + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + StandTableIndex = XGI_GetModePtr( ModeNo , ModeIdIndex, pVBInfo ) ; + tempax = pVBInfo->StandTable[ StandTableIndex ].CRTC[ 0 ] ; + tempbx = pVBInfo->StandTable[StandTableIndex ].CRTC[ 6 ] ; + temp1 = pVBInfo->StandTable[ StandTableIndex ].CRTC[ 7 ] ; + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + CRT1Index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT1CRTC ; + CRT1Index &= IndexMask ; + temp1 = ( USHORT )pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 0 ] ; + temp2 = ( USHORT )pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 5 ] ; + tempax = ( temp1 & 0xFF ) | ( ( temp2 & 0x03 ) << 8 ) ; + tempbx = ( USHORT )pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 8 ] ; + tempcx = ( USHORT )pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 14 ] << 8 ; + tempcx &= 0x0100 ; + tempcx = tempcx << 2 ; + tempbx |= tempcx; + temp1 = ( USHORT )pVBInfo->XGINEWUB_CRT1Table[ CRT1Index ].CR[ 9 ] ; + } + + if ( temp1 & 0x01 ) + tempbx |= 0x0100 ; + + if ( temp1 & 0x20 ) + tempbx |= 0x0200 ; + tempax += 5 ; + + if ( modeflag & Charx8Dot ) + tempax *= 8 ; + else + tempax *= 9 ; + + pVBInfo->VGAHT = tempax ; + pVBInfo->HT = tempax ; + tempbx++ ; + pVBInfo->VGAVT = tempbx ; + pVBInfo->VT = tempbx ; +} + + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetColorDepth */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +USHORT XGI_GetColorDepth(USHORT ModeNo , USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) +{ + USHORT ColorDepth[ 6 ] = { 1 , 2 , 4 , 4 , 6 , 8 } ; + SHORT index ; + USHORT modeflag ; + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; + } + + index=(modeflag&ModeInfoFlag)-ModeEGA; + + if ( index < 0 ) + index = 0 ; + + return( ColorDepth[ index ] ) ; +} + + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_UnLockCRT2 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_UnLockCRT2( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +{ + + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x2f , 0xFF , 0x01 ) ; + +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_LockCRT2 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_LockCRT2( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo ) +{ + + XGINew_SetRegANDOR( pVBInfo->Part1Port , 0x2F , 0xFE , 0x00 ) ; + + +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGINew_EnableCRT2 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_EnableCRT2( PVB_DEVICE_INFO pVBInfo) +{ + XGINew_SetRegANDOR( pVBInfo->P3c4 , 0x1E , 0xFF , 0x20 ) ; +} + + + +/* --------------------------------------------------------------------- */ +/* Function : */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGINew_LCD_Wait_Time(UCHAR DelayTime, PVB_DEVICE_INFO pVBInfo) +{ + USHORT i , + j ; + + ULONG temp , + flag ; + + flag = 0 ; + + for( i = 0 ; i < DelayTime ; i++ ) + { + for( j = 0 ; j < 66 ; j++ ) + { + temp = XGINew_GetReg3( 0x61 ) ; + temp &= 0x10; + + if ( temp == flag ) + continue ; + + flag = temp ; + } + } +} + + + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_BridgeIsOn */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +BOOLEAN XGI_BridgeIsOn( PVB_DEVICE_INFO pVBInfo ) +{ + USHORT flag ; + + if ( pVBInfo->IF_DEF_LVDS == 1 ) + { + return( 1 ) ; + } + else + { + flag = XGINew_GetReg1( pVBInfo->Part4Port , 0x00 ) ; + if ( ( flag == 1 ) || ( flag == 2 ) ) + return( 1 ) ; /* 301b */ + else + return( 0 ) ; + } +} + + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_LongWait */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_LongWait(PVB_DEVICE_INFO pVBInfo) +{ + USHORT i ; + + i = XGINew_GetReg1( pVBInfo->P3c4 , 0x1F ) ; + + if ( !( i & 0xC0 ) ) + { + for( i = 0 ; i < 0xFFFF ; i++ ) + { + if ( !( XGINew_GetReg2( pVBInfo->P3da ) & 0x08 ) ) + break ; + } + + for( i = 0 ; i < 0xFFFF ; i++ ) + { + if ( ( XGINew_GetReg2( pVBInfo->P3da ) & 0x08 ) ) + break ; + } + } +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_VBLongWait */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +void XGI_VBLongWait( PVB_DEVICE_INFO pVBInfo ) +{ + USHORT tempal , + temp , + i , + j ; + + if ( !( pVBInfo->VBInfo & SetCRT2ToTV ) ) + { + temp = 0 ; + for( i = 0 ; i < 3 ; i++ ) + { + for( j = 0 ; j < 100 ; j++ ) + { + tempal = XGINew_GetReg2( pVBInfo->P3da ) ; + if ( temp & 0x01 ) + { /* VBWaitMode2 */ + if ( ( tempal & 0x08 ) ) + { + continue ; + } + + if ( !( tempal & 0x08 ) ) + { + break ; + } + } + else + { /* VBWaitMode1 */ + if ( !( tempal & 0x08 ) ) + { + continue ; + } + + if ( ( tempal & 0x08 ) ) + { + break ; + } + } + } + temp = temp ^ 0x01 ; + } + } + else + { + XGI_LongWait(pVBInfo) ; + } + return ; +} + + + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetVGAHT2 */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +USHORT XGI_GetVGAHT2( PVB_DEVICE_INFO pVBInfo ) +{ + ULONG tempax , + tempbx ; + + tempbx = ( ( pVBInfo->VGAVT - pVBInfo->VGAVDE ) * pVBInfo->RVBHCMAX ) & 0xFFFF ; + tempax = ( pVBInfo->VT - pVBInfo->VDE ) * pVBInfo->RVBHCFACT ; + tempax = ( tempax * pVBInfo->HT ) /tempbx ; + + return( ( USHORT )tempax ) ; +} + + +/* --------------------------------------------------------------------- */ +/* Function : XGI_GetVCLK2Ptr */ +/* Input : */ +/* Output : */ +/* Description : */ +/* --------------------------------------------------------------------- */ +USHORT XGI_GetVCLK2Ptr( USHORT ModeNo , USHORT ModeIdIndex , USHORT RefreshRateTableIndex , PXGI_HW_DEVICE_INFO HwDeviceExtension ,PVB_DEVICE_INFO pVBInfo) +{ + USHORT tempbx ; + + USHORT LCDXlat1VCLK[ 4 ] = { VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 } ; + USHORT LCDXlat2VCLK[ 4 ] = { VCLK108_2 + 5 , VCLK108_2 + 5 , VCLK108_2 + 5 , VCLK108_2 + 5 } ; + USHORT LVDSXlat1VCLK[ 4 ] = { VCLK40 , VCLK40 , VCLK40 , VCLK40 } ; + USHORT LVDSXlat2VCLK[ 4 ] = { VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 } ; + USHORT LVDSXlat3VCLK[ 4 ] = { VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 , VCLK65 + 2 } ; + + USHORT CRT2Index , VCLKIndex=0 ; + USHORT modeflag ; + UCHAR *CHTVVCLKPtr = NULL ; + + if ( ModeNo <= 0x13 ) + { + modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ; /* si+St_ResInfo */ + CRT2Index = pVBInfo->SModeIDTable[ ModeIdIndex ].St_CRT2CRTC ; + } + else + { + modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ; /* si+Ext_ResInfo */ + CRT2Index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT2CRTC ; + } + + if ( pVBInfo->IF_DEF_LVDS == 0 ) + { + CRT2Index = CRT2Index >> 6 ; /* for LCD */ + if ( ( ( pVBInfo->VBInfo & SetCRT2ToLCD ) | SetCRT2ToLCDA ) ) /*301b*/ + { + if ( pVBInfo->LCDResInfo != Panel1024x768 ) + { + VCLKIndex = LCDXlat2VCLK[ CRT2Index ] ; + } + else + { + VCLKIndex = LCDXlat1VCLK[ CRT2Index ] ; + } + } + else /* for TV */ + { + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) + { + if ( pVBInfo->SetFlag & RPLLDIV2XO ) + { + VCLKIndex = HiTVVCLKDIV2 ; + + + VCLKIndex += 25 ; + + } + else + { + VCLKIndex = HiTVVCLK ; + + + VCLKIndex += 25 ; + + } + + if ( pVBInfo->SetFlag & TVSimuMode ) + { + if( modeflag & Charx8Dot ) + { + VCLKIndex = HiTVSimuVCLK ; + + + VCLKIndex += 25 ; + + } + else + { + VCLKIndex = HiTVTextVCLK ; + + + VCLKIndex += 25 ; + + } + } + + if ( pVBInfo->VBType & VB_XGI301LV ) /* 301lv */ + { + if ( !( pVBInfo->VBExtInfo == VB_YPbPr1080i ) ) + { + VCLKIndex = YPbPr750pVCLK ; + if ( !( pVBInfo->VBExtInfo == VB_YPbPr750p ) ) + { + VCLKIndex = YPbPr525pVCLK ; + if ( !( pVBInfo->VBExtInfo == VB_YPbPr525p ) ) + { + VCLKIndex = YPbPr525iVCLK_2 ; + if ( !( pVBInfo->SetFlag & RPLLDIV2XO ) ) + VCLKIndex = YPbPr525iVCLK ; + } + } + } + } + } + else + { + if ( pVBInfo->VBInfo & SetCRT2ToTV ) + { + if ( pVBInfo->SetFlag & RPLLDIV2XO ) + { + VCLKIndex = TVVCLKDIV2 ; + + + VCLKIndex += 25 ; + + } + else + { + VCLKIndex = TVVCLK ; + + + VCLKIndex += 25 ; + + } + } + } + } + else + { /* for CRT2 */ + VCLKIndex = ( UCHAR )XGINew_GetReg2( ( USHORT )( pVBInfo->P3ca + 0x02 ) ) ; /* Port 3cch */ + VCLKIndex = ( ( VCLKIndex >> 2 ) & 0x03 ) ; + if ( ModeNo > 0x13 ) + { + VCLKIndex = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRTVCLK ; /* di+Ext_CRTVCLK */ + VCLKIndex &= IndexMask ; + } + } + } + } + else + { /* LVDS */ + if ( ModeNo <= 0x13 ) + VCLKIndex = CRT2Index ; + else + VCLKIndex = CRT2Index ; + + if ( pVBInfo->IF_DEF_CH7005 == 1 ) + { + if ( !( pVBInfo->VBInfo & SetCRT2ToLCD ) ) + { + VCLKIndex &= 0x1f ; + tempbx = 0 ; + + if ( pVBInfo->VBInfo & SetPALTV ) + tempbx += 2 ; + + if ( pVBInfo->VBInfo & SetCHTVOverScan ) + tempbx += 1 ; + + switch( tempbx ) + { + case 0: + CHTVVCLKPtr = pVBInfo->CHTVVCLKUNTSC ; + break ; + case 1: + CHTVVCLKPtr = pVBInfo->CHTVVCLKONTSC ; + break; + case 2: + CHTVVCLKPtr = pVBInfo->CHTVVCLKUPAL ; + break ; + case 3: + CHTVVCLKPtr = pVBInfo->CHTVVCLKOPAL ; + break ; + default: + break ; + } + + VCLKIndex = CHTVVCLKPtr[ VCLKIndex ] ; + } + } + else + { + VCLKIndex = VCLKIndex >> 6 ; + if ( ( pVBInfo->LCDResInfo == Panel800x600 ) || ( pVBInfo->LCDResInfo == Panel320x480 ) ) + VCLKIndex = LVDSXlat1VCLK[ VCLKIndex ] ; + else if ( ( pVBInfo->LCDResInfo == Panel1024x768 ) || ( pVBInfo->LCDResInfo == Panel1024x768x75 ) ) + VCLKIndex = LVDSXlat2VCLK[ VCLKIndex ] ; + else + VCLKIndex = LVDSXlat3VCLK[ VCLKIndex ] ; + } + } + /* VCLKIndex = VCLKIndex&IndexMask ; */ + + + + return( VCLKIndex ) ; +} +