Index: config/cf/xorg.cf =================================================================== RCS file: /cvs/xorg/xc/config/cf/xorg.cf,v retrieving revision 1.23 diff -u -r1.23 xorg.cf --- config/cf/xorg.cf 19 Aug 2004 16:28:42 -0000 1.23 +++ config/cf/xorg.cf 27 Aug 2004 05:28:07 -0000 @@ -330,10 +330,6 @@ # ifndef XF8_16Bpp # define XF8_16Bpp YES # endif -/* 24/32bpp conversion module */ -# ifndef XF24_32Bpp -# define XF24_32Bpp YES -# endif /* shadow fb module */ # ifndef XFShadowFB # define XFShadowFB YES @@ -692,10 +688,6 @@ # ifndef XF8_16Bpp # define XF8_16Bpp YES # endif -/* 24/32bpp conversion module */ -# ifndef XF24_32Bpp -# define XF24_32Bpp YES -# endif /* shadow fb module */ # ifndef XFShadowFB # define XFShadowFB YES Index: programs/Xserver/hw/xfree86/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/Imakefile,v retrieving revision 1.3 diff -u -r1.3 Imakefile --- programs/Xserver/hw/xfree86/Imakefile 18 Aug 2004 18:41:40 -0000 1.3 +++ programs/Xserver/hw/xfree86/Imakefile 27 Aug 2004 05:28:12 -0000 @@ -40,10 +40,6 @@ XF8_16BPPDIR = xf8_16bpp #endif -#if XF24_32Bpp -XF24_32BPPDIR = xf24_32bpp -#endif - #if XFShadowFB SHADOWFBDIR = shadowfb #endif @@ -89,11 +85,11 @@ #endif SUBDIRS = os-support common $(I2CDIR) $(XAADIR) $(XF1BPPDIR) $(XF4BPPDIR) \ - $(XF8_32BPPDIR) $(XF8_16BPPDIR) $(XF24_32BPPDIR) $(SHADOWFBDIR) \ - drivers $(LOADERDIR) $(VGAHWDIR) $(FBDEVHWDIR) $(RAMDACDIR) \ - $(RACDIR) $(DDCDIR) $(INPUTDIR) $(INT10DIR) $(VBEDIR) parser \ - scanpci doc dummylib $(XF86CFGDIRS) etc $(DRIVERSDK) \ - $(XF8_32WIDDIR) getconfig + $(XF8_32BPPDIR) $(XF8_16BPPDIR) $(SHADOWFBDIR) drivers \ + $(LOADERDIR) $(VGAHWDIR) $(FBDEVHWDIR) $(RAMDACDIR) $(RACDIR) \ + $(DDCDIR) $(INPUTDIR) $(INT10DIR) $(VBEDIR) parser scanpci doc \ + dummylib $(XF86CFGDIRS) etc $(DRIVERSDK) $(XF8_32WIDDIR) \ + getconfig #if !defined(OS2Architecture) && !defined(cygwinArchitecture) XORGCONFIG = XConfigFile Index: programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c,v retrieving revision 1.2 diff -u -r1.2 i740_driver.c --- programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c 23 Apr 2004 19:35:03 -0000 1.2 +++ programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c 27 Aug 2004 05:28:12 -0000 @@ -75,23 +75,7 @@ #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: */ @@ -222,17 +206,8 @@ #ifdef XFree86LOADER static const char *fbSymbols[] = { -#ifdef USE_FB "fbScreenInit", "fbPictureInit", -#else - "cfbScreenInit", - "cfb16ScreenInit", - "cfb24ScreenInit", - "cfb32ScreenInit", -#endif - "cfb8_32ScreenInit", - "cfb24_32ScreenInit", NULL }; #endif @@ -498,9 +473,6 @@ int i; MessageType from; int temp; -#ifndef USE_FB - char *mod=0, *reqSym=0; -#endif int flags24; rgb defaultWeight = {0, 0, 0}; @@ -793,37 +765,11 @@ xf86SetDpi(pScrn, 0, 0); -#ifdef USE_FB if (!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 if (!xf86ReturnOptValBool(pI740->Options, OPTION_NOACCEL, FALSE)) { if (!xf86LoadSubModule(pScrn, "xaa")) { @@ -1594,12 +1540,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: @@ -1610,45 +1553,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: programs/Xserver/hw/xfree86/drivers/nsc/nsc_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_driver.c,v retrieving revision 1.2 diff -u -r1.2 nsc_driver.c --- programs/Xserver/hw/xfree86/drivers/nsc/nsc_driver.c 23 Apr 2004 19:40:15 -0000 1.2 +++ programs/Xserver/hw/xfree86/drivers/nsc/nsc_driver.c 27 Aug 2004 05:28:12 -0000 @@ -145,7 +145,6 @@ #define DEBUG(x) #define NSC_TRACE 0 -#define CFB 0 #define HWVGA 1 /* Includes that are used by all drivers */ @@ -167,20 +166,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" @@ -352,21 +338,11 @@ NULL }; -#if CFB -const char *nscCfbSymbols[] = { - "cfbScreenInit", - "cfb16ScreenInit", - "cfb24ScreenInit", - "cfb32ScreenInit", - NULL -}; -#else const char *nscFbSymbols[] = { "fbScreenInit", "fbPictureInit", NULL }; -#endif const char *nscXaaSymbols[] = { "XAADestroyInfoRec", @@ -442,11 +418,7 @@ * module might refer to. */ LoaderRefSymLists(nscVgahwSymbols, nscVbeSymbols, -#if CFB - nscCfbSymbols, -#else nscFbSymbols, -#endif nscXaaSymbols, nscInt10Symbols, nscRamdacSymbols, nscShadowSymbols, NULL); Index: programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_driver.c,v retrieving revision 1.2 diff -u -r1.2 nsc_gx1_driver.c --- programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_driver.c 23 Apr 2004 19:40:15 -0000 1.2 +++ programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx1_driver.c 27 Aug 2004 05:28:13 -0000 @@ -150,7 +150,6 @@ #define DEBUG(x) #define GEODE_TRACE 0 -#define CFB 0 #define HWVGA 0 /* Includes that are used by all drivers */ @@ -170,23 +169,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 */ @@ -308,11 +292,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[]; @@ -474,11 +454,6 @@ MessageType from; int i = 0; GeodePtr pGeode; -#if CFB - char *mod = NULL; - - char *reqSymbol = NULL; -#endif #if defined(STB_X) GAL_ADAPTERINFO sAdapterInfo; @@ -1020,37 +995,12 @@ 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) { GX1FreeRec(pScreenInfo); return FALSE; } xf86LoaderReqSymLists(nscFbSymbols, NULL); -#endif GeodeDebug(("GX1PreInit(15)!\n")); if (pGeode->NoAccel == FALSE) { if (!xf86LoadSubModule(pScreenInfo, "xaa")) { @@ -2019,26 +1969,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 +2007,8 @@ } } } -#if CFB -#else /* must be after RGB ordering fixed */ fbPictureInit(pScreen, 0, 0); -#endif GeodeDebug(("GX1ScreenInit(6)!\n")); if (!pGeode->NoAccel) { Index: programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_driver.c,v retrieving revision 1.2 diff -u -r1.2 nsc_gx2_driver.c --- programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_driver.c 23 Apr 2004 19:40:15 -0000 1.2 +++ programs/Xserver/hw/xfree86/drivers/nsc/nsc_gx2_driver.c 27 Aug 2004 05:28:15 -0000 @@ -145,7 +145,6 @@ #define DEBUG(x) #define GEODE_TRACE 0 -#define CFB 0 /* Includes that are used by all drivers */ #include "xf86.h" @@ -168,20 +167,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" @@ -269,11 +255,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[]; @@ -474,10 +456,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 */ @@ -978,45 +956,12 @@ 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) { - GX2FreeRec(pScreenInfo); - return FALSE; - } - - xf86LoaderReqSymbols(reqSymbol, NULL); -#else if (xf86LoadSubModule(pScreenInfo, "fb") == NULL) { GX2FreeRec(pScreenInfo); return FALSE; } xf86LoaderReqSymLists(nscFbSymbols, NULL); -#endif GeodeDebug(("GX2PreInit(15)!\n")); if (pGeode->NoAccel == FALSE) { if (!xf86LoadSubModule(pScreenInfo, "xaa")) { @@ -1933,24 +1878,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 +1886,6 @@ 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,8 @@ } } } -#if CFB -#else /* must be after RGB ordering fixed */ fbPictureInit(pScreen, 0, 0); -#endif GeodeDebug(("GX2ScreenInit(6)!\n")); if (!pGeode->NoAccel) { Index: programs/Xserver/hw/xfree86/drivers/s3/s3.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/s3/s3.h,v retrieving revision 1.2 diff -u -r1.2 s3.h --- programs/Xserver/hw/xfree86/drivers/s3/s3.h 23 Apr 2004 19:43:14 -0000 1.2 +++ programs/Xserver/hw/xfree86/drivers/s3/s3.h 27 Aug 2004 05:28:15 -0000 @@ -45,15 +45,6 @@ #include "fourcc.h" -#ifndef S3_USEFB -#define PSZ 8 -#include "cfb.h" -#undef PSZ -#include "cfb16.h" -#include "cfb24.h" -#include "cfb32.h" -#endif - typedef struct _S3RegRec { unsigned char cr31, cr32, cr33, cr34, cr3a, cr3b, cr3c; unsigned char cr3b2, cr3c2; Index: programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c,v retrieving revision 1.6 diff -u -r1.6 s3_driver.c --- programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c 16 Aug 2004 09:13:14 -0000 1.6 +++ programs/Xserver/hw/xfree86/drivers/s3/s3_driver.c 27 Aug 2004 05:28:15 -0000 @@ -176,23 +176,11 @@ { -1 } }; -#define S3_USEFB - -#ifdef S3_USEFB static const char *fbSymbols[] = { "fbPictureInit", "fbScreenInit", NULL }; -#else -static const char *cfbSymbols[] = { - "cfbScreenInit", - "cfb16ScreenInit", - "cfb24ScreenInit", - "cfb32ScreenInit", - NULL -}; -#endif static const char *vgaHWSymbols[] = { "vgaHWGetHWRec", @@ -278,11 +266,7 @@ xf86AddDriver(&S3, module, 0); LoaderRefSymLists(vgaHWSymbols, vbeSymbols, int10Symbols, ramdacSymbols, -#ifdef S3_USEFB fbSymbols, -#else - cfbSymbols, -#endif xaaSymbols, NULL); return (pointer) 1; @@ -746,31 +730,8 @@ xf86PrintModes(pScrn); xf86SetDpi(pScrn, 0, 0); -#ifdef S3_USEFB xf86LoadSubModule(pScrn, "fb"); xf86LoaderReqSymLists(fbSymbols, NULL); -#else - { - switch (pScrn->bitsPerPixel) { - case 8: - xf86LoadSubModule(pScrn, "cfb"); - xf86LoaderReqSymbols("cfbScreenInit", NULL); - break; - case 16: - xf86LoadSubModule(pScrn, "cfb16"); - xf86LoaderReqSymbols("cfb16ScreenInit", NULL); - break; - case 24: - xf86LoadSubModule(pScrn, "cfb24"); - xf86LoaderReqSymbols("cfb24ScreenInit", NULL); - break; - case 32: - xf86LoadSubModule(pScrn, "cfb32"); - xf86LoaderReqSymbols("cfb32ScreenInit", NULL); - break; - } - } -#endif if (!xf86LoadSubModule(pScrn, "xaa")) return FALSE; @@ -819,45 +780,10 @@ miSetPixmapDepths (); -#ifdef S3_USEFB if (!fbScreenInit(pScreen, pS3->FBBase, pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth, pScrn->bitsPerPixel)) return FALSE; -#else - { - int ret; - - switch(pScrn->bitsPerPixel) { - case 8: - ret = cfbScreenInit(pScreen, pS3->FBBase, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth); - break; - case 16: - ret = cfb16ScreenInit(pScreen, pS3->FBBase, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth); - break; - case 24: - ret = cfb24ScreenInit(pScreen, pS3->FBBase, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth); - break; - case 32: - ret = cfb32ScreenInit(pScreen, pS3->FBBase, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth); - break; - } - if (!ret) - return FALSE; - } -#endif xf86SetBlackWhitePixels(pScreen); @@ -876,9 +802,7 @@ } } } -#ifdef S3_USEFB fbPictureInit (pScreen, 0, 0); -#endif S3DGAInit(pScreen); miInitializeBackingStore(pScreen); Index: programs/Xserver/hw/xfree86/drivers/s3virge/s3v_accel.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_accel.c,v retrieving revision 1.2 diff -u -r1.2 s3v_accel.c --- programs/Xserver/hw/xfree86/drivers/s3virge/s3v_accel.c 30 Jul 2004 20:30:54 -0000 1.2 +++ programs/Xserver/hw/xfree86/drivers/s3virge/s3v_accel.c 27 Aug 2004 05:28:15 -0000 @@ -965,12 +965,6 @@ #if 0 /* Line funcs are disabled at the moment */ -static void (*LineFuncs[3])() = { - cfbBresS, - cfb16BresS, - cfb24BresS -}; - static void S3VSubsequentSolidBresenhamLine( ScrnInfoPtr pScrn, @@ -1021,27 +1015,6 @@ #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 Index: programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c,v retrieving revision 1.5 diff -u -r1.5 s3v_driver.c --- programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c 16 Aug 2004 09:13:14 -0000 1.5 +++ programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c 27 Aug 2004 05:28:16 -0000 @@ -872,17 +872,11 @@ ps3v->hwcursor = FALSE; } + ps3v->UseFB = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, "Using fb.\n"); 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"); - } + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "UseFB option is deprecated.\n"); if (xf86IsOptionSet(ps3v->Options, OPTION_MX_CR3A_FIX)) { @@ -1512,38 +1506,6 @@ } xf86LoaderReqSymLists(fbSymbols, NULL); } - else - { - 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); - } /* Load XAA if needed */ if (!ps3v->NoAccel || ps3v->hwcursor ) { @@ -2742,49 +2704,6 @@ 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; } Index: programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h,v retrieving revision 1.3 diff -u -r1.3 smi.h --- programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h 26 May 2004 16:24:09 -0000 1.3 +++ programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h 27 Aug 2004 05:28:16 -0000 @@ -31,8 +31,6 @@ #ifndef _SMI_H #define _SMI_H -#define USE_FB - #include "xf86.h" #include "xf86_OSproc.h" #include "xf86_ansic.h" @@ -46,16 +44,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" Index: programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c,v retrieving revision 1.6 diff -u -r1.6 smi_driver.c --- programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c 16 Aug 2004 09:13:15 -0000 1.6 +++ programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c 27 Aug 2004 05:28:24 -0000 @@ -280,17 +280,8 @@ static const char *fbSymbols[] = { -#ifdef USE_FB "fbPictureInit", "fbScreenInit", -#else - "cfbScreenInit", - "cfb16ScreenInit", - "cfb24ScreenInit", - "cfb32ScreenInit", - "cfb16BresS", - "cfb24BresS", -#endif NULL }; @@ -504,10 +495,6 @@ 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; int mclk; @@ -1194,7 +1181,6 @@ /* Set display resolution */ xf86SetDpi(pScrn, 0, 0); -#ifdef USE_FB if ((xf86LoadSubModule(pScrn, "fb") == NULL)) { SMI_FreeRec(pScrn); @@ -1203,35 +1189,6 @@ } 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 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) { @@ -2132,9 +2089,6 @@ * as calling the framebuffer's ScreenInit() 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 are not - * appropriate. In this driver, we fixup the visuals after. */ /* @@ -2144,35 +2098,14 @@ /* Setup the visuals we support. */ - /* - * For bpp > 8, the default visuals are not acceptable because we only - * 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); - } - } - else -#endif - { - 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)) { @@ -2201,10 +2134,8 @@ } } -#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 */ @@ -2411,29 +2342,12 @@ pSmi->FBBase, width, height, displayWidth)); switch (pScrn->bitsPerPixel) { -#ifdef USE_FB case 8: case 16: case 24: 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); Index: programs/Xserver/hw/xfree86/drivers/via/via_driver.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.c,v retrieving revision 1.5 diff -u -r1.5 via_driver.c --- programs/Xserver/hw/xfree86/drivers/via/via_driver.c 16 Aug 2004 09:13:15 -0000 1.5 +++ programs/Xserver/hw/xfree86/drivers/via/via_driver.c 27 Aug 2004 05:28:24 -0000 @@ -265,24 +265,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 @@ -355,11 +342,7 @@ setupDone = TRUE; xf86AddDriver(&VIA, module, 0); LoaderRefSymLists(vgaHWSymbols, -#ifdef USE_FB fbSymbols, -#else - cfbSymbols, -#endif ramdacSymbols, xaaSymbols, shadowSymbols, @@ -704,10 +687,6 @@ 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; @@ -1545,7 +1524,6 @@ xf86PrintModes(pScrn); xf86SetDpi(pScrn, 0, 0); -#ifdef USE_FB if (xf86LoadSubModule(pScrn, "fb") == NULL) { VIAFreeRec(pScrn); return FALSE; @@ -1553,31 +1531,6 @@ 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; - } - - xf86LoaderReqSymbols(reqSym, NULL); -#endif - if (!pVia->NoAccel) { if(!xf86LoadSubModule(pScrn, "xaa")) { VIAFreeRec(pScrn); @@ -2364,10 +2317,8 @@ } } -#ifdef USE_FB /* must be after RGB ordering fixed */ fbPictureInit(pScreen, 0, 0); -#endif if (!pVia->NoAccel) { VIAInitAccel(pScreen); @@ -2529,35 +2480,9 @@ 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 return ret; } Index: programs/Xserver/hw/xfree86/drivers/via/via_driver.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h,v retrieving revision 1.2 diff -u -r1.2 via_driver.h --- programs/Xserver/hw/xfree86/drivers/via/via_driver.h 23 Apr 2004 19:53:54 -0000 1.2 +++ programs/Xserver/hw/xfree86/drivers/via/via_driver.h 27 Aug 2004 05:28:24 -0000 @@ -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" Index: programs/Xserver/hw/xfree86/xf24_32bpp/Imakefile =================================================================== RCS file: programs/Xserver/hw/xfree86/xf24_32bpp/Imakefile diff -N programs/Xserver/hw/xfree86/xf24_32bpp/Imakefile --- programs/Xserver/hw/xfree86/xf24_32bpp/Imakefile 23 Apr 2004 19:54:17 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,41 +0,0 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/xf24_32bpp/Imakefile,v 1.3 1999/04/17 09:08:45 dawes Exp $ -#define IHaveModules -#include - - -#if DoLoadableServer -XFMODSRC = cfb24_32module.c -XFMODOBJ = cfb24_32module.o -#endif - -SRCS = cfbcpyarea.c cfbgcmisc.c cfbpixmap.c \ - cfbimage.c cfbscrinit.c cfbwindow.c \ - $(XFMODSRC) cfbgc24.c cfbgc32.c - - -OBJS = cfbcpyarea.o cfbgcmisc.o cfbpixmap.o \ - cfbimage.o cfbscrinit.o cfbwindow.o \ - $(XFMODOBJ) cfbgc24.o cfbgc32.o - -INCLUDES = -I. -I$(XF86SRC)/xf1bpp -I$(SERVERSRC)/mfb \ - -I$(SERVERSRC)/cfb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \ - -I$(XF86OSSRC) -I$(XF86COMSRC) \ - -I$(FONTINCSRC) -I$(XINCLUDESRC) - - -ModuleObjectRule() -LibraryModuleTarget(xf24_32bpp,$(OBJS)) -LintLibraryTarget(xf24_32bpp,$(SRCS)) -NormalLintTarget($(LINTDEFS) $(SRCS)) - -ObjectFromSpecialSource(cfbgc24,cfbgc,-DPSZ=24) -ObjectFromSpecialSource(cfbgc32,cfbgc,-DPSZ=32) - - -InstallLibraryModule(xf24_32bpp,$(MODULEDIR),.) - -DependTarget() - -InstallDriverSDKLibraryModule(xf24_32bpp,$(DRIVERSDKMODULEDIR),.) - -InstallDriverSDKNonExecFile(cfb24_32.h,$(DRIVERSDKINCLUDEDIR)) Index: programs/Xserver/hw/xfree86/xf24_32bpp/cfb24_32.h =================================================================== RCS file: programs/Xserver/hw/xfree86/xf24_32bpp/cfb24_32.h diff -N programs/Xserver/hw/xfree86/xf24_32bpp/cfb24_32.h --- programs/Xserver/hw/xfree86/xf24_32bpp/cfb24_32.h 23 Apr 2004 19:54:17 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,162 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf24_32bpp/cfb24_32.h,v 1.5 2000/04/01 00:17:19 mvojkovi Exp $ */ - -#ifndef _CFB24_32_H -#define _CFB24_32_H - -#include "gcstruct.h" -#include "window.h" - -typedef struct { - GCOps *Ops24bpp; - GCOps *Ops32bpp; - unsigned long changes; - Bool OpsAre24bpp; -} cfb24_32GCRec, *cfb24_32GCPtr; - - -extern int cfb24_32GCIndex; -extern int cfb24_32PixmapIndex; - -typedef struct { - PixmapPtr pix; - Bool freePrivate; - Bool isRefPix; -} cfb24_32PixmapRec, *cfb24_32PixmapPtr; - -RegionPtr -cfb24_32CopyArea( - DrawablePtr pSrcDraw, - DrawablePtr pDstDraw, - GC *pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty -); - -void -cfbDoBitblt24To32( - DrawablePtr pSrc, - DrawablePtr pDst, - int rop, - RegionPtr prgnDst, - DDXPointPtr pptSrc, - unsigned long planemask -); - -void -cfbDoBitblt32To24( - DrawablePtr pSrc, - DrawablePtr pDst, - int rop, - RegionPtr prgnDst, - DDXPointPtr pptSrc, - unsigned long planemask -); - -void -cfb24_32DoBitblt24To24GXcopy( - DrawablePtr pSrc, - DrawablePtr pDst, - int rop, - RegionPtr prgnDst, - DDXPointPtr pptSrc, - unsigned long pm -); - -void -cfb24_32ValidateGC24( - GCPtr pGC, - unsigned long changes, - DrawablePtr pDrawable -); - -void -cfb24_32ValidateGC32( - GCPtr pGC, - unsigned long changes, - DrawablePtr pDrawable -); - -Bool cfb24_32CreateGC(GCPtr pGC); - -void -cfb24_32GetSpans( - DrawablePtr pDraw, - int wMax, - DDXPointPtr ppt, - int *pwidth, - int nspans, - char *pchardstStart -); - -void -cfb24_32PutImage ( - DrawablePtr pDraw, - GCPtr pGC, - int depth, - int x, int y, int w, int h, - int leftPad, - int format, - char *pImage -); - -void -cfb24_32GetImage ( - DrawablePtr pDraw, - int sx, int sy, int w, int h, - unsigned int format, - unsigned long planeMask, - char *pdstLine -); - -Bool -cfb24_32ScreenInit ( - ScreenPtr pScreen, - pointer pbits, - int xsize, int ysize, - int dpix, int dpiy, - int width -); - - -Bool cfb24_32CreateWindow(WindowPtr pWin); -Bool cfb24_32DestroyWindow(WindowPtr pWin); - -Bool -cfb24_32PositionWindow( - WindowPtr pWin, - int x, int y -); - -void -cfb24_32CopyWindow( - WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc -); - -Bool -cfb24_32ChangeWindowAttributes( - WindowPtr pWin, - unsigned long mask -); - -PixmapPtr -cfb24_32CreatePixmap ( - ScreenPtr pScreen, - int width, - int height, - int depth -); - -Bool cfb24_32DestroyPixmap(PixmapPtr pPixmap); - -PixmapPtr cfb24_32RefreshPixmap(PixmapPtr pix); - -#define CFB24_32_GET_GC_PRIVATE(pGC)\ - (cfb24_32GCPtr)((pGC)->devPrivates[cfb24_32GCIndex].ptr) - -#define CFB24_32_GET_PIXMAP_PRIVATE(pPix) \ - (cfb24_32PixmapPtr)((pPix)->devPrivates[cfb24_32PixmapIndex].ptr) - -#endif /* _CFB24_32_H */ Index: programs/Xserver/hw/xfree86/xf24_32bpp/cfb24_32module.c =================================================================== RCS file: programs/Xserver/hw/xfree86/xf24_32bpp/cfb24_32module.c diff -N programs/Xserver/hw/xfree86/xf24_32bpp/cfb24_32module.c --- programs/Xserver/hw/xfree86/xf24_32bpp/cfb24_32module.c 23 Apr 2004 19:54:17 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,37 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf24_32bpp/cfb24_32module.c,v 1.2 1999/01/24 13:32:41 dawes Exp $ */ - -#ifdef XFree86LOADER - -#include "xf86Module.h" - -static MODULESETUPPROTO(xf24_32bppSetup); - -static XF86ModuleVersionInfo VersRec = -{ - "xf24_32bpp", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_ANSIC, /* Only need the ansic layer */ - ABI_ANSIC_VERSION, - MOD_CLASS_NONE, - {0,0,0,0} /* signature, to be patched into the file by a tool */ -}; - -XF86ModuleData xf24_32bppModuleData = { &VersRec, xf24_32bppSetup, NULL }; - -static pointer -xf24_32bppSetup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - if (!LoadSubModule(module, "cfb24", NULL, NULL, NULL, NULL, - errmaj, errmin)) - return NULL; - if (!LoadSubModule(module, "cfb32", NULL, NULL, NULL, NULL, - errmaj, errmin)) - return NULL; - return (pointer)1; /* non-NULL required to indicate success */ -} - -#endif Index: programs/Xserver/hw/xfree86/xf24_32bpp/cfbbstore.c =================================================================== RCS file: programs/Xserver/hw/xfree86/xf24_32bpp/cfbbstore.c diff -N programs/Xserver/hw/xfree86/xf24_32bpp/cfbbstore.c --- programs/Xserver/hw/xfree86/xf24_32bpp/cfbbstore.c 23 Apr 2004 19:54:17 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,89 +0,0 @@ -/* $XFree86$ */ - -#define PSZ 8 -#include "cfb.h" -#undef PSZ -#include "cfb24.h" -#include "cfb32.h" -#include "cfb24_32.h" -#include "X.h" -#include "mibstore.h" -#include "regionstr.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "windowstr.h" - -void -cfb24_32SaveAreas( - PixmapPtr pPixmap, - RegionPtr prgnSave, - int xorg, - int yorg, - WindowPtr pWin -){ - DDXPointPtr pPt; - DDXPointPtr pPtsInit; - BoxPtr pBox; - ScreenPtr pScreen = pPixmap->drawable.pScreen; - PixmapPtr pScrPix; - int i = REGION_NUM_RECTS(prgnSave); - - - pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(i * sizeof(DDXPointRec)); - if (!pPtsInit) - return; - - pBox = REGION_RECTS(prgnSave); - pPt = pPtsInit; - while (--i >= 0) { - pPt->x = pBox->x1 + xorg; - pPt->y = pBox->y1 + yorg; - pPt++; - pBox++; - } - - pScrPix = (PixmapPtr) pScreen->devPrivate; - - cfbDoBitblt24To32((DrawablePtr) pScrPix, (DrawablePtr)pPixmap, - GXcopy, prgnSave, pPtsInit, ~0L, 0); - - DEALLOCATE_LOCAL (pPtsInit); -} - - -void -cfb24_32RestoreAreas( - PixmapPtr pPixmap, - RegionPtr prgnRestore, - int xorg, - int yorg, - WindowPtr pWin -){ - DDXPointPtr pPt; - DDXPointPtr pPtsInit; - BoxPtr pBox; - int i; - ScreenPtr pScreen = pPixmap->drawable.pScreen; - PixmapPtr pScrPix; - - i = REGION_NUM_RECTS(prgnRestore); - pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(i*sizeof(DDXPointRec)); - if (!pPtsInit) - return; - - pBox = REGION_RECTS(prgnRestore); - pPt = pPtsInit; - while (--i >= 0) { - pPt->x = pBox->x1 - xorg; - pPt->y = pBox->y1 - yorg; - pPt++; - pBox++; - } - - pScrPix = (PixmapPtr) pScreen->devPrivate; - - cfbDoBitblt32To24((DrawablePtr)pPixmap, (DrawablePtr) pScrPix, - GXcopy, prgnRestore, pPtsInit, ~0L, 0); - - DEALLOCATE_LOCAL (pPtsInit); -} Index: programs/Xserver/hw/xfree86/xf24_32bpp/cfbcpyarea.c =================================================================== RCS file: programs/Xserver/hw/xfree86/xf24_32bpp/cfbcpyarea.c diff -N programs/Xserver/hw/xfree86/xf24_32bpp/cfbcpyarea.c --- programs/Xserver/hw/xfree86/xf24_32bpp/cfbcpyarea.c 23 Apr 2004 19:54:17 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,717 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf24_32bpp/cfbcpyarea.c,v 1.5 1999/05/16 10:13:05 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" -#define PSZ 8 -#include "cfb.h" -#undef PSZ -#include "cfb24.h" -#include "cfb32.h" -#include "cfb24_32.h" -#include "mi.h" -#include "mistruct.h" -#include "dix.h" -#include "mibstore.h" - - - -RegionPtr -cfb24_32CopyArea( - DrawablePtr pSrcDraw, - DrawablePtr pDstDraw, - GC *pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty -){ - - if(pSrcDraw->bitsPerPixel == 32) { - if(pDstDraw->bitsPerPixel == 32) { - return(cfb32CopyArea(pSrcDraw, pDstDraw, pGC, srcx, srcy, - width, height, dstx, dsty)); - } else { - /* have to translate 32 -> 24 copies */ - return cfb32BitBlt (pSrcDraw, pDstDraw, - pGC, srcx, srcy, width, height, dstx, dsty, - cfbDoBitblt32To24, 0L); - } - } else { - if(pDstDraw->bitsPerPixel == 32) { - /* have to translate 24 -> 32 copies */ - return cfb32BitBlt (pSrcDraw, pDstDraw, - pGC, srcx, srcy, width, height, dstx, dsty, - cfbDoBitblt24To32, 0L); - } else if((pDstDraw->type == DRAWABLE_WINDOW) && - (pSrcDraw->type == DRAWABLE_WINDOW) && (pGC->alu == GXcopy) && - ((pGC->planemask & 0x00ffffff) == 0x00ffffff)) { - - return cfb24BitBlt (pSrcDraw, pDstDraw, - pGC, srcx, srcy, width, height, dstx, dsty, - cfb24_32DoBitblt24To24GXcopy, 0L); - } else { - return(cfb24CopyArea(pSrcDraw, pDstDraw, pGC, srcx, srcy, - width, height, dstx, dsty)); - } - } -} - - - -void -cfbDoBitblt24To32( - DrawablePtr pSrc, - DrawablePtr pDst, - int rop, - RegionPtr prgnDst, - DDXPointPtr pptSrc, - unsigned long planemask -){ - BoxPtr pbox = REGION_RECTS(prgnDst); - int nbox = REGION_NUM_RECTS(prgnDst); - unsigned char *data24, *data32; - unsigned char *ptr24, *ptr32; - int pitch24, pitch32; - int height, width, i, j; - unsigned char *pm; - - cfbGetByteWidthAndPointer(pSrc, pitch24, ptr24); - cfbGetByteWidthAndPointer(pDst, pitch32, ptr32); - - planemask &= 0x00ffffff; - pm = (unsigned char*)(&planemask); - - if((planemask == 0x00ffffff) && (rop == GXcopy)) { - CARD32 *dst, *src; - CARD32 tmp, phase; - - for(;nbox; pbox++, pptSrc++, nbox--) { - data24 = ptr24 + (pptSrc->y * pitch24) + (pptSrc->x * 3); - data32 = ptr32 + (pbox->y1 * pitch32) + (pbox->x1 << 2); - width = pbox->x2 - pbox->x1; - height = pbox->y2 - pbox->y1; - - phase = (long)data24 & 3L; - data24 = (unsigned char*)((long)data24 & ~3L); - - while(height--) { - src = (CARD32*)data24; - dst = (CARD32*)data32; - i = width; - - switch(phase) { - case 0: break; - case 1: - dst[0] = src[0] >> 8; - dst++; - src++; - i--; - break; - case 2: - dst[0] = src[0] >> 16; - tmp = src[1]; - dst[0] |= tmp << 16; - if(!(--i)) break; - dst[1] = tmp >> 8; - dst += 2; - src += 2; - i--; - break; - default: - dst[0] = src[0] >> 24; - tmp = src[1]; - dst[0] |= tmp << 8; - if(!(--i)) break; - dst[1] = tmp >> 16; - tmp = src[2]; - dst[1] |= tmp << 16; - if(!(--i)) break; - dst[2] = tmp >> 8; - dst += 3; - src += 3; - i--; - break; - } - - while(i >= 4) { - dst[0] = src[0]; - tmp = src[1]; - dst[3] = src[2]; - dst[1] = (dst[0] >> 24) | (tmp << 8); - dst[2] = (tmp >> 16) | (dst[3] << 16); - dst[3] >>= 8; - - src += 3; - dst += 4; - i -= 4; - } - - switch(i) { - case 0: break; - case 1: - dst[0] = src[0]; - break; - case 2: - dst[0] = src[0]; - dst[1] = (dst[0] >> 24) | (src[1] << 8); - break; - default: - dst[0] = src[0]; - tmp = src[1]; - dst[2] = src[2] << 16; - dst[1] = (dst[0] >> 24) | (tmp << 8); - dst[2] |= tmp >> 16; - break; - } - - data24 += pitch24; - data32 += pitch32; - } - } - } else { /* it ain't pretty, but hey */ - for(;nbox; pbox++, pptSrc++, nbox--) { - data24 = ptr24 + (pptSrc->y * pitch24) + (pptSrc->x * 3); - data32 = ptr32 + (pbox->y1 * pitch32) + (pbox->x1 << 2); - width = (pbox->x2 - pbox->x1) << 2; - height = pbox->y2 - pbox->y1; - - while(height--) { - switch(rop) { - case GXcopy: - for(i = j = 0; i < width; i += 4, j += 3) { - data32[i] = (data24[j] & pm[0]) | (data32[i] & ~pm[0]); - data32[i+1] = (data24[j+1] & pm[1]) | - (data32[i+1] & ~pm[1]); - data32[i+2] = (data24[j+2] & pm[2]) | - (data32[i+2] & ~pm[2]); - } - break; - case GXor: - for(i = j = 0; i < width; i += 4, j += 3) { - data32[i] |= data24[j] & pm[0]; - data32[i+1] |= data24[j+1] & pm[1]; - data32[i+2] |= data24[j+2] & pm[2]; - } - break; - case GXclear: - for(i = 0; i < width; i += 4) { - data32[i] &= ~pm[0]; - data32[i+1] &= ~pm[1]; - data32[i+2] &= ~pm[2]; - } - break; - case GXand: - for(i = j = 0; i < width; i += 4, j += 3) { - data32[i] &= data24[j] | ~pm[0]; - data32[i+1] &= data24[j+1] | ~pm[1]; - data32[i+2] &= data24[j+2] | ~pm[2]; - } - break; - case GXandReverse: - for(i = j = 0; i < width; i += 4, j += 3) { - data32[i] = ~data32[i] & (data24[j] | ~pm[0]); - data32[i+1] = ~data32[i+1] & (data24[j+1] | ~pm[1]); - data32[i+2] = ~data32[i+2] & (data24[j+2] | ~pm[2]); - } - break; - case GXandInverted: - for(i = j = 0; i < width; i += 4, j += 3) { - data32[i] &= ~(data24[j] & pm[0]); - data32[i+1] &= ~(data24[j+1] & pm[1]); - data32[i+2] &= ~(data24[j+2] & pm[2]); - } - break; - case GXnoop: - return; - case GXxor: - for(i = j = 0; i < width; i += 4, j += 3) { - data32[i] ^= data24[j] & pm[0]; - data32[i+1] ^= data24[j+1] & pm[1]; - data32[i+2] ^= data24[j+2] & pm[2]; - } - break; - case GXnor: - for(i = j = 0; i < width; i += 4, j += 3) { - data32[i] = ~(data32[i] | (data24[j] & pm[0])); - data32[i+1] = ~(data32[i+1] | (data24[j+1] & pm[1])); - data32[i+2] = ~(data32[i+2] | (data24[j+2] & pm[2])); - } - break; - case GXequiv: - for(i = j = 0; i < width; i += 4, j += 3) { - data32[i] = ~(data32[i] ^ (data24[j] & pm[0])); - data32[i+1] = ~(data32[i+1] ^ (data24[j+1] & pm[1])); - data32[i+2] = ~(data32[i+2] ^ (data24[j+2] & pm[2])); - } - break; - case GXinvert: - for(i = 0; i < width; i += 4) { - data32[i] ^= pm[0]; - data32[i+1] ^= pm[1]; - data32[i+2] ^= pm[2]; - } - break; - case GXorReverse: - for(i = j = 0; i < width; i += 4, j += 3) { - data32[i] = ~data32[i] | (data24[j] & pm[0]); - data32[i+1] = ~data32[i+1] | (data24[j+1] & pm[1]); - data32[i+2] = ~data32[i+2] | (data24[j+2] & pm[2]); - } - break; - case GXcopyInverted: - for(i = j = 0; i < width; i += 4, j += 3) { - data32[i] = (~data24[j] & pm[0]) | (data32[i] & ~pm[0]); - data32[i+1] = (~data24[j+1] & pm[1]) | - (data32[i+1] & ~pm[1]); - data32[i+2] = (~data24[j+2] & pm[2]) | - (data32[i+2] & ~pm[2]); - } - break; - case GXorInverted: - for(i = j = 0; i < width; i += 4, j += 3) { - data32[i] |= ~data24[j] & pm[0]; - data32[i+1] |= ~data24[j+1] & pm[1]; - data32[i+2] |= ~data24[j+2] & pm[2]; - } - break; - case GXnand: - for(i = j = 0; i < width; i += 4, j += 3) { - data32[i] = ~(data32[i] & (data24[j] | ~pm[0])); - data32[i+1] = ~(data32[i+1] & (data24[j+1] | ~pm[1])); - data32[i+2] = ~(data32[i+2] & (data24[j+2] | ~pm[2])); - } - break; - case GXset: - for(i = 0; i < width; i+=4) { - data32[i] |= pm[0]; - data32[i+1] |= pm[1]; - data32[i+2] |= pm[2]; - } - break; - } - data24 += pitch24; - data32 += pitch32; - } - } - } -} - - -void -cfbDoBitblt32To24( - DrawablePtr pSrc, - DrawablePtr pDst, - int rop, - RegionPtr prgnDst, - DDXPointPtr pptSrc, - unsigned long planemask -){ - BoxPtr pbox = REGION_RECTS(prgnDst); - int nbox = REGION_NUM_RECTS(prgnDst); - unsigned char *ptr24, *ptr32; - unsigned char *data24, *data32; - int pitch24, pitch32; - int height, width, i, j; - unsigned char *pm; - - cfbGetByteWidthAndPointer(pDst, pitch24, ptr24); - cfbGetByteWidthAndPointer(pSrc, pitch32, ptr32); - - planemask &= 0x00ffffff; - pm = (unsigned char*)(&planemask); - - if((planemask == 0x00ffffff) && (rop == GXcopy)) { - CARD32 *src; - CARD8 *dst; - long phase; - for(;nbox; pbox++, pptSrc++, nbox--) { - data24 = ptr24 + (pbox->y1 * pitch24) + (pbox->x1 * 3); - data32 = ptr32 + (pptSrc->y * pitch32) + (pptSrc->x << 2); - width = pbox->x2 - pbox->x1; - height = pbox->y2 - pbox->y1; - - phase = (long)data24 & 3L; - - while(height--) { - src = (CARD32*)data32; - dst = data24; - j = width; - - switch(phase) { - case 0: break; - case 1: - dst[0] = src[0]; - *((CARD16*)(dst + 1)) = src[0] >> 8; - dst += 3; - src++; - j--; - break; - case 2: - if(j == 1) break; - *((CARD16*)dst) = src[0]; - *((CARD32*)(dst + 2)) = ((src[0] >> 16) & 0x000000ff) | - (src[1] << 8); - dst += 6; - src += 2; - j -= 2; - break; - default: - if(j < 3) break; - dst[0] = src[0]; - *((CARD32*)(dst + 1)) = ((src[0] >> 8) & 0x0000ffff) | - (src[1] << 16); - *((CARD32*)(dst + 5)) = ((src[1] >> 16) & 0x000000ff) | - (src[2] << 8); - dst += 9; - src += 3; - j -= 3; - } - - while(j >= 4) { - *((CARD32*)dst) = (src[0] & 0x00ffffff) | (src[1] << 24); - *((CARD32*)(dst + 4)) = ((src[1] >> 8) & 0x0000ffff)| - (src[2] << 16); - *((CARD32*)(dst + 8)) = ((src[2] >> 16) & 0x000000ff) | - (src[3] << 8); - dst += 12; - src += 4; - j -= 4; - } - switch(j) { - case 0: - break; - case 1: - *((CARD16*)dst) = src[0]; - dst[2] = src[0] >> 16; - break; - case 2: - *((CARD32*)dst) = (src[0] & 0x00ffffff) | (src[1] << 24); - *((CARD16*)(dst + 4)) = src[1] >> 8; - break; - default: - *((CARD32*)dst) = (src[0] & 0x00ffffff) | (src[1] << 24); - *((CARD32*)(dst + 4)) = ((src[1] >> 8) & 0x0000ffff) | - (src[2] << 16); - dst[8] = src[2] >> 16; - break; - } - - data24 += pitch24; - data32 += pitch32; - } - } - } else { - for(;nbox; pbox++, pptSrc++, nbox--) { - data24 = ptr24 + (pbox->y1 * pitch24) + (pbox->x1 * 3); - data32 = ptr32 + (pptSrc->y * pitch32) + (pptSrc->x << 2); - width = pbox->x2 - pbox->x1; - height = pbox->y2 - pbox->y1; - - while(height--) { - switch(rop) { - case GXcopy: - for(i = j = 0; j < width; i += 4, j += 3) { - data24[j] = (data32[i] & pm[0]) | (data24[j] & ~pm[0]); - data24[j+1] = (data32[i+1] & pm[1]) | - (data24[j+1] & ~pm[1]); - data24[j+2] = (data32[i+2] & pm[2]) | - (data24[j+2] & ~pm[2]); - } - break; - case GXor: - for(i = j = 0; j < width; i += 4, j += 3) { - data24[j] |= data32[i] & pm[0]; - data24[j+1] |= data32[i+1] & pm[1]; - data24[j+2] |= data32[i+2] & pm[2]; - } - break; - case GXclear: - for(j = 0; j < width; j += 3) { - data24[j] &= ~pm[0]; - data24[j+1] &= ~pm[1]; - data24[j+2] &= ~pm[2]; - } - break; - case GXand: - for(i = j = 0; j < width; i += 4, j += 3) { - data24[j] &= data32[i] | ~pm[0]; - data24[j+1] &= data32[i+1] | ~pm[1]; - data24[j+2] &= data32[i+2] | ~pm[2]; - } - break; - case GXandReverse: - for(i = j = 0; j < width; i += 4, j += 3) { - data24[j] = ~data24[j] & (data32[i] | ~pm[0]); - data24[j+1] = ~data24[j+1] & (data32[i+1] | ~pm[1]); - data24[j+2] = ~data24[j+2] & (data32[i+2] | ~pm[2]); - } - break; - case GXandInverted: - for(i = j = 0; j < width; i += 4, j += 3) { - data24[j] &= ~(data32[i] & pm[0]); - data24[j+1] &= ~(data32[i+1] & pm[1]); - data24[j+2] &= ~(data32[i+2] & pm[2]); - } - break; - case GXnoop: - return; - case GXxor: - for(i = j = 0; j < width; i += 4, j += 3) { - data24[j] ^= data32[i] & pm[0]; - data24[j+1] ^= data32[i+1] & pm[1]; - data24[j+2] ^= data32[i+2] & pm[2]; - } - break; - case GXnor: - for(i = j = 0; j < width; i += 4, j += 3) { - data24[j] = ~(data24[j] | (data32[i] & pm[0])); - data24[j+1] = ~(data24[j+1] | (data32[i+1] & pm[1])); - data24[j+2] = ~(data24[j+2] | (data32[i+2] & pm[2])); - } - break; - case GXequiv: - for(i = j = 0; j < width; i += 4, j += 3) { - data24[j] = ~(data24[j] ^ (data32[i] & pm[0])); - data24[j+1] = ~(data24[j+1] ^ (data32[i+1] & pm[1])); - data24[j+2] = ~(data24[j+2] ^ (data32[i+2] & pm[2])); - } - break; - case GXinvert: - for(j = 0; j < width; j+=3) { - data24[j] ^= pm[0]; - data24[j+1] ^= pm[1]; - data24[j+2] ^= pm[2]; - } - break; - case GXorReverse: - for(i = j = 0; j < width; i += 4, j += 3) { - data24[j] = ~data24[j] | (data32[i] & pm[0]); - data24[j+1] = ~data24[j+1] | (data32[i+1] & pm[1]); - data24[j+2] = ~data24[j+2] | (data32[i+2] & pm[2]); - } - break; - case GXcopyInverted: - for(i = j = 0; j < width; i += 4, j += 3) { - data24[j] = (~data32[i] & pm[0]) | (data24[j] & ~pm[0]); - data24[j+1] = (~data32[i+1] & pm[1]) | - (data24[j+1] & ~pm[1]); - data24[j+2] = (~data32[i+2] & pm[2]) | - (data24[j+2] & ~pm[2]); - } - break; - case GXorInverted: - for(i = j = 0; j < width; i += 4, j += 3) { - data24[j] |= ~data32[i] & pm[0]; - data24[j+1] |= ~data32[i+1] & pm[1]; - data24[j+2] |= ~data32[i+2] & pm[2]; - } - break; - case GXnand: - for(i = j = 0; j < width; i += 4, j += 3) { - data24[j] = ~(data24[j] & (data32[i] | ~pm[0])); - data24[j+1] = ~(data24[j+1] & (data32[i+1] | ~pm[1])); - data24[j+2] = ~(data24[j+2] & (data32[i+2] | ~pm[2])); - } - break; - case GXset: - for(j = 0; j < width; j+=3) { - data24[j] |= pm[0]; - data24[j+1] |= pm[1]; - data24[j+2] |= pm[2]; - } - break; - } - data24 += pitch24; - data32 += pitch32; - } - } - } -} - - - - -static void -Do24To24Blt( - unsigned char *ptr, - int pitch, - int nbox, - DDXPointPtr pptSrc, - BoxPtr pbox, - int xdir, int ydir -){ - int width, height, diff, phase; - CARD8 *swap, *lineAddr; - - ydir *= pitch; - - swap = (CARD8*)ALLOCATE_LOCAL((2048 * 3) + 3); - - for(;nbox; pbox++, pptSrc++, nbox--) { - lineAddr = ptr + (pptSrc->y * pitch) + (pptSrc->x * 3); - diff = ((pbox->y1 - pptSrc->y) * pitch) + ((pbox->x1 - pptSrc->x) * 3); - width = (pbox->x2 - pbox->x1) * 3; - height = pbox->y2 - pbox->y1; - - if(ydir < 0) - lineAddr += (height - 1) * pitch; - - phase = (long)lineAddr & 3L; - - while(height--) { - /* copy src onto the stack */ - memcpy(swap, (CARD32*)((long)lineAddr & ~3L), - (width + phase + 3) & ~3L); - - /* copy the stack to the dst */ - memcpy(lineAddr + diff, swap + phase, width); - lineAddr += ydir; - } - } - - DEALLOCATE_LOCAL(swap); -} - - -static void -cfb24_32DoBitBlt( - DrawablePtr pSrc, - DrawablePtr pDst, - RegionPtr prgnDst, - DDXPointPtr pptSrc, - void (*DoBlt)( - unsigned char *ptr, - int pitch, - int nbox, - DDXPointPtr pptSrc, - BoxPtr pbox, - int xdir, int ydir) -){ - int nbox, careful, pitch; - BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2; - DDXPointPtr pptTmp, pptNew1, pptNew2; - int xdir, ydir; - unsigned char *ptr; - - /* XXX we have to err on the side of safety when both are windows, - * because we don't know if IncludeInferiors is being used. - */ - careful = ((pSrc == pDst) || - ((pSrc->type == DRAWABLE_WINDOW) && - (pDst->type == DRAWABLE_WINDOW))); - - pbox = REGION_RECTS(prgnDst); - nbox = REGION_NUM_RECTS(prgnDst); - - pboxNew1 = NULL; - pptNew1 = NULL; - pboxNew2 = NULL; - pptNew2 = NULL; - if (careful && (pptSrc->y < pbox->y1)) { - /* walk source botttom to top */ - ydir = -1; - - if (nbox > 1) { - /* keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); - if(!pboxNew1) - return; - pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); - if(!pptNew1) { - DEALLOCATE_LOCAL(pboxNew1); - return; - } - pboxBase = pboxNext = pbox+nbox-1; - while (pboxBase >= pbox) { - while ((pboxNext >= pbox) && - (pboxBase->y1 == pboxNext->y1)) - pboxNext--; - pboxTmp = pboxNext+1; - pptTmp = pptSrc + (pboxTmp - pbox); - while (pboxTmp <= pboxBase) { - *pboxNew1++ = *pboxTmp++; - *pptNew1++ = *pptTmp++; - } - pboxBase = pboxNext; - } - pboxNew1 -= nbox; - pbox = pboxNew1; - pptNew1 -= nbox; - pptSrc = pptNew1; - } - } else { - /* walk source top to bottom */ - ydir = 1; - } - - if (careful && (pptSrc->x < pbox->x1)) { - /* walk source right to left */ - xdir = -1; - - if (nbox > 1) { - /* reverse order of rects in each band */ - pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); - pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); - if(!pboxNew2 || !pptNew2) { - if (pptNew2) DEALLOCATE_LOCAL(pptNew2); - if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2); - if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); - } - return; - } - pboxBase = pboxNext = pbox; - while (pboxBase < pbox+nbox) { - while ((pboxNext < pbox+nbox) && - (pboxNext->y1 == pboxBase->y1)) - pboxNext++; - pboxTmp = pboxNext; - pptTmp = pptSrc + (pboxTmp - pbox); - while (pboxTmp != pboxBase) { - *pboxNew2++ = *--pboxTmp; - *pptNew2++ = *--pptTmp; - } - pboxBase = pboxNext; - } - pboxNew2 -= nbox; - pbox = pboxNew2; - pptNew2 -= nbox; - pptSrc = pptNew2; - } - } else { - /* walk source left to right */ - xdir = 1; - } - - cfbGetByteWidthAndPointer(pDst, pitch, ptr); - - (*DoBlt)(ptr, pitch, nbox, pptSrc, pbox, xdir, ydir); - - if (pboxNew2) { - DEALLOCATE_LOCAL(pptNew2); - DEALLOCATE_LOCAL(pboxNew2); - } - if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); - DEALLOCATE_LOCAL(pboxNew1); - } - -} - -void -cfb24_32DoBitblt24To24GXcopy( - DrawablePtr pSrc, - DrawablePtr pDst, - int rop, - RegionPtr prgnDst, - DDXPointPtr pptSrc, - unsigned long pm -){ - cfb24_32DoBitBlt(pSrc, pDst, prgnDst, pptSrc, Do24To24Blt); -} Index: programs/Xserver/hw/xfree86/xf24_32bpp/cfbgc.c =================================================================== RCS file: programs/Xserver/hw/xfree86/xf24_32bpp/cfbgc.c diff -N programs/Xserver/hw/xfree86/xf24_32bpp/cfbgc.c --- programs/Xserver/hw/xfree86/xf24_32bpp/cfbgc.c 23 Apr 2004 19:54:17 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,671 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf24_32bpp/cfbgc.c,v 1.2 1999/08/21 13:48:43 dawes Exp $ */ - -/*********************************************************** - -Copyright 1987, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the name of Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR -ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -******************************************************************/ - - -/* - -PSZ 8 16 24 32 -PIXEL_ADDR True True True True -NO_ONE_RECT False False False False -WriteBitGroup True True True True -FOUR_BIT_CODE True False False False -LOWMEMFTPT False False False False - -*/ - - -/* This gets built twice. Once for 24bpp and another for 32bpp */ - -#include "X.h" -#include "Xmd.h" -#include "Xproto.h" -#include "cfb.h" -#include "fontstruct.h" -#include "dixfontstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "region.h" - -#include "mistruct.h" -#include "mibstore.h" -#include "migc.h" - -#include "cfb24_32.h" -#include "cfbmskbits.h" -#include "cfb8bit.h" - - -#if PSZ == 8 -# define useTEGlyphBlt cfbTEGlyphBlt8 -#else -# ifdef WriteBitGroup -# define useTEGlyphBlt cfbImageGlyphBlt8 -# else -# define useTEGlyphBlt cfbTEGlyphBlt -# endif -#endif - -#ifdef WriteBitGroup -# define useImageGlyphBlt cfbImageGlyphBlt8 -# define usePolyGlyphBlt cfbPolyGlyphBlt8 -#else -# define useImageGlyphBlt miImageGlyphBlt -# define usePolyGlyphBlt miPolyGlyphBlt -#endif - -#ifdef FOUR_BIT_CODE -# define usePushPixels cfbPushPixels8 -#else -#ifndef LOWMEMFTPT -# define usePushPixels mfbPushPixels -#else -# define usePushPixels miPushPixels -#endif /* ifndef LOWMEMFTPT */ -#endif - -#ifdef PIXEL_ADDR -# define ZeroPolyArc cfbZeroPolyArcSS8Copy -#else -# define ZeroPolyArc miZeroPolyArc -#endif - - -static GCOps cfb24_32TEOps1Rect = { - cfbSolidSpansCopy, - cfbSetSpans, - cfbPutImage, - cfb24_32CopyArea, - cfbCopyPlane, - cfbPolyPoint, -#ifdef PIXEL_ADDR - cfb8LineSS1Rect, - cfb8SegmentSS1Rect, -#else - cfbLineSS, - cfbSegmentSS, -#endif - miPolyRectangle, - ZeroPolyArc, - cfbFillPoly1RectCopy, - cfbPolyFillRect, - cfbPolyFillArcSolidCopy, - miPolyText8, - miPolyText16, - miImageText8, - miImageText16, - useTEGlyphBlt, - usePolyGlyphBlt, - usePushPixels -#ifdef NEED_LINEHELPER - ,NULL -#endif -}; - -static GCOps cfb24_32NonTEOps1Rect = { - cfbSolidSpansCopy, - cfbSetSpans, - cfbPutImage, - cfb24_32CopyArea, - cfbCopyPlane, - cfbPolyPoint, -#ifdef PIXEL_ADDR - cfb8LineSS1Rect, - cfb8SegmentSS1Rect, -#else - cfbLineSS, - cfbSegmentSS, -#endif - miPolyRectangle, - ZeroPolyArc, - cfbFillPoly1RectCopy, - cfbPolyFillRect, - cfbPolyFillArcSolidCopy, - miPolyText8, - miPolyText16, - miImageText8, - miImageText16, - useImageGlyphBlt, - usePolyGlyphBlt, - usePushPixels -#ifdef NEED_LINEHELPER - ,NULL -#endif -}; - -static GCOps cfb24_32TEOps = { - cfbSolidSpansCopy, - cfbSetSpans, - cfbPutImage, - cfb24_32CopyArea, - cfbCopyPlane, - cfbPolyPoint, - cfbLineSS, - cfbSegmentSS, - miPolyRectangle, - ZeroPolyArc, - miFillPolygon, - cfbPolyFillRect, - cfbPolyFillArcSolidCopy, - miPolyText8, - miPolyText16, - miImageText8, - miImageText16, - useTEGlyphBlt, - usePolyGlyphBlt, - usePushPixels -#ifdef NEED_LINEHELPER - ,NULL -#endif -}; - -static GCOps cfb24_32NonTEOps = { - cfbSolidSpansCopy, - cfbSetSpans, - cfbPutImage, - cfb24_32CopyArea, - cfbCopyPlane, - cfbPolyPoint, - cfbLineSS, - cfbSegmentSS, - miPolyRectangle, -#ifdef PIXEL_ADDR - cfbZeroPolyArcSS8Copy, -#else - miZeroPolyArc, -#endif - miFillPolygon, - cfbPolyFillRect, - cfbPolyFillArcSolidCopy, - miPolyText8, - miPolyText16, - miImageText8, - miImageText16, - useImageGlyphBlt, - usePolyGlyphBlt, - usePushPixels -#ifdef NEED_LINEHELPER - ,NULL -#endif -}; - -static GCOps * -cfb24_32MatchCommon (GCPtr pGC, cfbPrivGCPtr devPriv) -{ - if (pGC->lineWidth != 0) - return 0; - if (pGC->lineStyle != LineSolid) - return 0; - if (pGC->fillStyle != FillSolid) - return 0; - if (devPriv->rop != GXcopy) - return 0; - if (pGC->font && - FONTMAXBOUNDS(pGC->font,rightSideBearing) - - FONTMINBOUNDS(pGC->font,leftSideBearing) <= 32 && - FONTMINBOUNDS(pGC->font,characterWidth) >= 0) - { - if (TERMINALFONT(pGC->font) -#ifdef FOUR_BIT_CODE - && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB -#endif - ) -#ifdef NO_ONE_RECT - return &cfb24_32TEOps1Rect; -#else - if (devPriv->oneRect) - return &cfb24_32TEOps1Rect; - else - return &cfb24_32TEOps; -#endif - else -#ifdef NO_ONE_RECT - return &cfb24_32NonTEOps1Rect; -#else - if (devPriv->oneRect) - return &cfb24_32NonTEOps1Rect; - else - return &cfb24_32NonTEOps; -#endif - } - return 0; -} - - -/* Clipping conventions - if the drawable is a window - CT_REGION ==> pCompositeClip really is the composite - CT_other ==> pCompositeClip is the window clip region - if the drawable is a pixmap - CT_REGION ==> pCompositeClip is the translated client region - clipped to the pixmap boundary - CT_other ==> pCompositeClip is the pixmap bounding box -*/ - -void -#if PSZ == 24 -cfb24_32ValidateGC24( -#else -cfb24_32ValidateGC32( -#endif - GCPtr pGC, - unsigned long changes, - DrawablePtr pDrawable -){ - int mask; /* stateChanges */ - int index; /* used for stepping through bitfields */ - int new_rrop; - int new_line, new_text, new_fillspans, new_fillarea; - /* flags for changing the proc vector */ - cfbPrivGCPtr devPriv; - int oneRect; - - pGC->lastWinOrg.x = pDrawable->x; - pGC->lastWinOrg.y = pDrawable->y; - devPriv = cfbGetGCPrivate(pGC); - - new_rrop = FALSE; - new_line = FALSE; - new_text = FALSE; - new_fillspans = FALSE; - new_fillarea = FALSE; - - /* - * if the client clip is different or moved OR the subwindowMode has - * changed OR the window's clip has changed since the last validation - * we need to recompute the composite clip - */ - - if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) || - (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))) - { - miComputeCompositeClip (pGC, pDrawable); -#ifdef NO_ONE_RECT - devPriv->oneRect = FALSE; -#else - oneRect = REGION_NUM_RECTS(pGC->pCompositeClip) == 1; - if (oneRect != devPriv->oneRect) - new_line = TRUE; - devPriv->oneRect = oneRect; -#endif - } - - mask = changes; - while (mask) { - index = lowbit (mask); - mask &= ~index; - - /* - * this switch acculmulates a list of which procedures might have - * to change due to changes in the GC. in some cases (e.g. - * changing one 16 bit tile for another) we might not really need - * a change, but the code is being paranoid. this sort of batching - * wins if, for example, the alu and the font have been changed, - * or any other pair of items that both change the same thing. - */ - switch (index) { - case GCFunction: - case GCForeground: - new_rrop = TRUE; - break; - case GCPlaneMask: - new_rrop = TRUE; - new_text = TRUE; - break; - case GCBackground: - break; - case GCLineStyle: - case GCLineWidth: - new_line = TRUE; - break; - case GCJoinStyle: - case GCCapStyle: - break; - case GCFillStyle: - new_text = TRUE; - new_fillspans = TRUE; - new_line = TRUE; - new_fillarea = TRUE; - break; - case GCFillRule: - break; - case GCTile: - new_fillspans = TRUE; - new_fillarea = TRUE; - break; - case GCStipple: - new_fillspans = TRUE; - new_fillarea = TRUE; - break; - case GCTileStipXOrigin: - case GCTileStipYOrigin: - break; - case GCFont: - new_text = TRUE; - break; - case GCSubwindowMode: - case GCGraphicsExposures: - case GCClipXOrigin: - case GCClipYOrigin: - case GCClipMask: - case GCDashOffset: - case GCDashList: - case GCArcMode: - default: - break; - } - } - - /* - * If the drawable has changed, ensure suitable - * entries are in the proc vector. - */ - if (pDrawable->serialNumber != (pGC->serialNumber & (DRAWABLE_SERIAL_BITS))) - new_fillspans = TRUE; /* deal with FillSpans later */ - - if (new_rrop) - { - int old_rrop; - - old_rrop = devPriv->rop; - devPriv->rop = cfbReduceRasterOp (pGC->alu, pGC->fgPixel, - pGC->planemask, - &devPriv->and, &devPriv->xor); - if (old_rrop == devPriv->rop) - new_rrop = FALSE; - else - { -#ifdef PIXEL_ADDR - new_line = TRUE; -#endif -#ifdef WriteBitGroup - new_text = TRUE; -#endif - new_fillspans = TRUE; - new_fillarea = TRUE; - } - } - - if(!pGC->ops) - pGC->ops = & cfb24_32NonTEOps; - - if (new_rrop || new_fillspans || new_text || new_fillarea || new_line) - { - GCOps *newops; - - if ((newops = cfb24_32MatchCommon (pGC, devPriv))) - { - if (pGC->ops->devPrivate.val) - miDestroyGCOps (pGC->ops); - pGC->ops = newops; - new_rrop = new_line = new_fillspans = new_text = new_fillarea = 0; - } - else - { - if (!pGC->ops->devPrivate.val) - { - pGC->ops = miCreateGCOps (pGC->ops); - pGC->ops->devPrivate.val = 1; - } - } - } - - /* deal with the changes we've collected */ - if (new_line) - { - pGC->ops->FillPolygon = miFillPolygon; -#ifdef NO_ONE_RECT - if (pGC->fillStyle == FillSolid) - { - switch (devPriv->rop) { - case GXcopy: - pGC->ops->FillPolygon = cfbFillPoly1RectCopy; - break; - default: - pGC->ops->FillPolygon = cfbFillPoly1RectGeneral; - break; - } - } -#else - if (devPriv->oneRect && pGC->fillStyle == FillSolid) - { - switch (devPriv->rop) { - case GXcopy: - pGC->ops->FillPolygon = cfbFillPoly1RectCopy; - break; - default: - pGC->ops->FillPolygon = cfbFillPoly1RectGeneral; - break; - } - } -#endif - if (pGC->lineWidth == 0) - { -#ifdef PIXEL_ADDR - if ((pGC->lineStyle == LineSolid) && (pGC->fillStyle == FillSolid)) - { - switch (devPriv->rop) - { - case GXxor: - pGC->ops->PolyArc = cfbZeroPolyArcSS8Xor; - break; - case GXcopy: - pGC->ops->PolyArc = cfbZeroPolyArcSS8Copy; - break; - default: - pGC->ops->PolyArc = cfbZeroPolyArcSS8General; - break; - } - } - else -#endif - pGC->ops->PolyArc = miZeroPolyArc; - } - else - pGC->ops->PolyArc = miPolyArc; - pGC->ops->PolySegment = miPolySegment; - switch (pGC->lineStyle) - { - case LineSolid: - if(pGC->lineWidth == 0) - { - if (pGC->fillStyle == FillSolid) - { -#if defined(PIXEL_ADDR) && !defined(NO_ONE_RECT) - if (devPriv->oneRect && - ((pDrawable->x >= pGC->pScreen->width - 32768) && - (pDrawable->y >= pGC->pScreen->height - 32768))) - { - pGC->ops->Polylines = cfb8LineSS1Rect; - pGC->ops->PolySegment = cfb8SegmentSS1Rect; - } else -#endif -#ifdef NO_ONE_RECT - { - pGC->ops->Polylines = cfb8LineSS1Rect; - pGC->ops->PolySegment = cfb8SegmentSS1Rect; - } -#else - { - pGC->ops->Polylines = cfbLineSS; - pGC->ops->PolySegment = cfbSegmentSS; - } -#endif - } - else - pGC->ops->Polylines = miZeroLine; - } - else - pGC->ops->Polylines = miWideLine; - break; - case LineOnOffDash: - case LineDoubleDash: - if (pGC->lineWidth == 0 && pGC->fillStyle == FillSolid) - { - pGC->ops->Polylines = cfbLineSD; - pGC->ops->PolySegment = cfbSegmentSD; - } else - pGC->ops->Polylines = miWideDash; - break; - } - } - - if (new_text && (pGC->font)) - { - if (FONTMAXBOUNDS(pGC->font,rightSideBearing) - - FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 || - FONTMINBOUNDS(pGC->font,characterWidth) < 0) - { - pGC->ops->PolyGlyphBlt = miPolyGlyphBlt; - pGC->ops->ImageGlyphBlt = miImageGlyphBlt; - } - else - { -#ifdef WriteBitGroup - if (pGC->fillStyle == FillSolid) - { - if (devPriv->rop == GXcopy) - pGC->ops->PolyGlyphBlt = cfbPolyGlyphBlt8; - else -#ifdef FOUR_BIT_CODE - pGC->ops->PolyGlyphBlt = cfbPolyGlyphRop8; -#else - pGC->ops->PolyGlyphBlt = miPolyGlyphBlt; -#endif - } - else -#endif - pGC->ops->PolyGlyphBlt = miPolyGlyphBlt; - /* special case ImageGlyphBlt for terminal emulator fonts */ -#if !defined(WriteBitGroup) || PSZ == 8 - if (TERMINALFONT(pGC->font) && - (pGC->planemask & PMSK) == PMSK -#ifdef FOUR_BIT_CODE - && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB -#endif - ) - { - pGC->ops->ImageGlyphBlt = useTEGlyphBlt; - } - else -#endif - { -#ifdef WriteBitGroup - if (devPriv->rop == GXcopy && - pGC->fillStyle == FillSolid && - (pGC->planemask & PMSK) == PMSK) - pGC->ops->ImageGlyphBlt = cfbImageGlyphBlt8; - else -#endif - pGC->ops->ImageGlyphBlt = miImageGlyphBlt; - } - } - } - - - if (new_fillspans) { - switch (pGC->fillStyle) { - case FillSolid: - switch (devPriv->rop) { - case GXcopy: - pGC->ops->FillSpans = cfbSolidSpansCopy; - break; - case GXxor: - pGC->ops->FillSpans = cfbSolidSpansXor; - break; - default: - pGC->ops->FillSpans = cfbSolidSpansGeneral; - break; - } - break; - case FillTiled: - pGC->ops->FillSpans = cfbUnnaturalTileFS; - break; - case FillStippled: - case FillOpaqueStippled: - pGC->ops->FillSpans = cfbUnnaturalStippleFS; - break; - default: - FatalError("cfbValidateGC: illegal fillStyle\n"); - } - } /* end of new_fillspans */ - - if (new_fillarea) { -#ifndef FOUR_BIT_CODE - pGC->ops->PolyFillRect = miPolyFillRect; - if (pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled) - { - pGC->ops->PolyFillRect = cfbPolyFillRect; - } -#endif -#ifdef FOUR_BIT_CODE -#ifndef LOWMEMFTPT - pGC->ops->PushPixels = mfbPushPixels; -#else - pGC->ops->PushPixels = miPushPixels; -#endif /* ifndef LOWMEMFTPT */ - if (pGC->fillStyle == FillSolid && devPriv->rop == GXcopy) - pGC->ops->PushPixels = cfbPushPixels8; -#endif - pGC->ops->PolyFillArc = miPolyFillArc; - if (pGC->fillStyle == FillSolid) - { - switch (devPriv->rop) - { - case GXcopy: - pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy; - break; - default: - pGC->ops->PolyFillArc = cfbPolyFillArcSolidGeneral; - break; - } - } - } -} Index: programs/Xserver/hw/xfree86/xf24_32bpp/cfbgcmisc.c =================================================================== RCS file: programs/Xserver/hw/xfree86/xf24_32bpp/cfbgcmisc.c diff -N programs/Xserver/hw/xfree86/xf24_32bpp/cfbgcmisc.c --- programs/Xserver/hw/xfree86/xf24_32bpp/cfbgcmisc.c 23 Apr 2004 19:54:17 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,170 +0,0 @@ -/* $XFree86$ */ - -#include "X.h" -#include "Xmd.h" -#include "Xproto.h" -#define PSZ 8 -#include "cfb.h" -#undef PSZ -#include "cfb24.h" -#include "cfb32.h" -#include "cfb24_32.h" -#include "fontstruct.h" -#include "dixfontstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "region.h" - -#include "mistruct.h" -#include "mibstore.h" -#include "migc.h" - - -static void cfb24_32ValidateGC(GCPtr, unsigned long, DrawablePtr); -static void cfb24_32DestroyGC(GCPtr pGC); -static void cfb24_32ChangeGC(GCPtr pGC, unsigned long mask); -static void cfb24_32CopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst); - -static -GCFuncs cfb24_32GCFuncs = { - cfb24_32ValidateGC, - cfb24_32ChangeGC, - cfb24_32CopyGC, - cfb24_32DestroyGC, - miChangeClip, - miDestroyClip, - miCopyClip, -}; - -static void -cfb24_32DestroyGC(GCPtr pGC) -{ - cfb24_32GCPtr pGCPriv = CFB24_32_GET_GC_PRIVATE(pGC); - - if (pGC->freeCompClip) - REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip); - if(pGCPriv->Ops24bpp) - miDestroyGCOps(pGCPriv->Ops24bpp); - if(pGCPriv->Ops32bpp) - miDestroyGCOps(pGCPriv->Ops32bpp); -} - -static void -cfb24_32ChangeGC( - GCPtr pGC, - unsigned long mask -){ - - if((mask & GCTile) && pGC->tile.pixmap && !pGC->tileIsPixel) { - PixmapPtr pPix = pGC->tile.pixmap; - cfb24_32PixmapPtr pixPriv = CFB24_32_GET_PIXMAP_PRIVATE(pPix); - - if(pixPriv->pix && (pPix->refcnt != pixPriv->pix->refcnt)) - pixPriv->pix->refcnt = pPix->refcnt; - } - - return; -} - -static void -cfb24_32CopyGC( - GCPtr pGCSrc, - unsigned long changes, - GCPtr pGCDst -){ - if((changes & GCTile) && pGCDst->tile.pixmap && !pGCDst->tileIsPixel) { - PixmapPtr pPix = pGCDst->tile.pixmap; - cfb24_32PixmapPtr pixPriv = CFB24_32_GET_PIXMAP_PRIVATE(pPix); - - if(pixPriv->pix && (pPix->refcnt != pixPriv->pix->refcnt)) - pixPriv->pix->refcnt = pPix->refcnt; - } - - return; -} - - - -Bool -cfb24_32CreateGC(GCPtr pGC) -{ - cfb24_32GCPtr pGCPriv; - cfbPrivGC *pPriv; - - if (PixmapWidthPaddingInfo[pGC->depth].padPixelsLog2 == LOG2_BITMAP_PAD) - return (mfbCreateGC(pGC)); - - pGC->clientClip = NULL; - pGC->clientClipType = CT_NONE; - pGC->miTranslate = 1; - pGC->fExpose = TRUE; - pGC->freeCompClip = FALSE; - pGC->pRotatedPixmap = (PixmapPtr) NULL; - - pPriv = cfbGetGCPrivate(pGC); - pPriv->rop = pGC->alu; - pPriv->oneRect = FALSE; - - pGC->ops = NULL; - pGC->funcs = &cfb24_32GCFuncs; - - pGCPriv = CFB24_32_GET_GC_PRIVATE(pGC); - pGCPriv->Ops24bpp = NULL; - pGCPriv->Ops32bpp = NULL; - pGCPriv->OpsAre24bpp = FALSE; - pGCPriv->changes = 0; - - return TRUE; -} - - -static void -cfb24_32ValidateGC( - GCPtr pGC, - unsigned long changes, - DrawablePtr pDraw -){ - cfb24_32GCPtr pGCPriv = CFB24_32_GET_GC_PRIVATE(pGC); - - if(pDraw->bitsPerPixel == 32) { - if(pGCPriv->OpsAre24bpp) { - int origChanges = changes; - pGC->ops = pGCPriv->Ops32bpp; - changes |= pGCPriv->changes; - pGCPriv->changes = origChanges; - pGCPriv->OpsAre24bpp = FALSE; - } else - pGCPriv->changes |= changes; - - if((pGC->fillStyle == FillTiled) && - (pGC->tile.pixmap->drawable.bitsPerPixel == 24)){ - pGC->tile.pixmap = cfb24_32RefreshPixmap(pGC->tile.pixmap); - changes |= GCTile; - } - - cfb24_32ValidateGC32(pGC, changes, pDraw); - pGCPriv->Ops32bpp = pGC->ops; - } else { /* bitsPerPixel == 24 */ - if(!pGCPriv->OpsAre24bpp) { - int origChanges = changes; - pGC->ops = pGCPriv->Ops24bpp; - changes |= pGCPriv->changes; - pGCPriv->changes = origChanges; - pGCPriv->OpsAre24bpp = TRUE; - } else - pGCPriv->changes |= changes; - - if((pGC->fillStyle == FillTiled) && - (pGC->tile.pixmap->drawable.bitsPerPixel == 32)){ - pGC->tile.pixmap = cfb24_32RefreshPixmap(pGC->tile.pixmap); - changes |= GCTile; - } - - cfb24_32ValidateGC24(pGC, changes, pDraw); - pGCPriv->Ops24bpp = pGC->ops; - } - -} - Index: programs/Xserver/hw/xfree86/xf24_32bpp/cfbimage.c =================================================================== RCS file: programs/Xserver/hw/xfree86/xf24_32bpp/cfbimage.c diff -N programs/Xserver/hw/xfree86/xf24_32bpp/cfbimage.c --- programs/Xserver/hw/xfree86/xf24_32bpp/cfbimage.c 23 Apr 2004 19:54:17 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,101 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf24_32bpp/cfbimage.c,v 1.3 2000/02/25 00:21:00 mvojkovi Exp $ */ - -#include "X.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#include "gcstruct.h" -#define PSZ 8 -#include "cfb.h" -#undef PSZ -#include "cfb24.h" -#include "cfb32.h" -#include "cfb24_32.h" -#include "servermd.h" -#include "mi.h" - - -void -cfb24_32GetImage ( - DrawablePtr pDraw, - int sx, int sy, int w, int h, - unsigned int format, - unsigned long planemask, - char *pdstLine -){ - if(!w || !h) return; - - if (!cfbDrawableEnabled (pDraw)) - return; - - if(pDraw->bitsPerPixel != 24) { - cfb32GetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine); - return; - } else if (format == ZPixmap) { - BoxRec box; - DDXPointRec ptSrc; - RegionRec rgnDst; - ScreenPtr pScreen; - PixmapPtr pPixmap; - - pScreen = pDraw->pScreen; - pPixmap = GetScratchPixmapHeader(pScreen, w, h, 24, 32, - PixmapBytePad(w,24), (pointer)pdstLine); - if (!pPixmap) - return; - if ((planemask & 0x00ffffff) != 0x00ffffff) - bzero((char *)pdstLine, pPixmap->devKind * h); - ptSrc.x = sx + pDraw->x; - ptSrc.y = sy + pDraw->y; - box.x1 = 0; - box.y1 = 0; - box.x2 = w; - box.y2 = h; - REGION_INIT(pScreen, &rgnDst, &box, 1); - cfbDoBitblt24To32(pDraw, (DrawablePtr)pPixmap, GXcopy, &rgnDst, - &ptSrc, planemask); - REGION_UNINIT(pScreen, &rgnDst); - FreeScratchPixmapHeader(pPixmap); - } else - miGetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine); -} - - -void -cfb24_32GetSpans( - DrawablePtr pDraw, - int wMax, - DDXPointPtr ppt, - int *pwidth, - int nspans, - char *pDst -){ - int pitch, i; - CARD8 *ptr, *ptrBase; - - if (!cfbDrawableEnabled (pDraw)) - return; - - if(pDraw->bitsPerPixel != 24){ - cfb32GetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst); - return; - } - - /* gotta get spans from a 24 bpp window */ - cfbGetByteWidthAndPointer(pDraw, pitch, ptrBase); - - while(nspans--) { - ptr = ptrBase + (ppt->y * pitch) + (ppt->x * 3); - - for(i = *pwidth; i--; ptr += 3, pDst += 4) { - /* this is used so infrequently that it's not worth optimizing */ - pDst[0] = ptr[0]; - pDst[1] = ptr[1]; - pDst[2] = ptr[2]; - } - - ppt++; pwidth++; - } -} - - Index: programs/Xserver/hw/xfree86/xf24_32bpp/cfbpixmap.c =================================================================== RCS file: programs/Xserver/hw/xfree86/xf24_32bpp/cfbpixmap.c diff -N programs/Xserver/hw/xfree86/xf24_32bpp/cfbpixmap.c --- programs/Xserver/hw/xfree86/xf24_32bpp/cfbpixmap.c 23 Apr 2004 19:54:17 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,151 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf24_32bpp/cfbpixmap.c,v 1.1 1999/01/23 09:56:14 dawes Exp $ */ - -#include "Xmd.h" -#include "servermd.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "mi.h" -#define PSZ 8 -#include "cfb.h" -#undef PSZ -#include "cfb24_32.h" - - -PixmapPtr -cfb24_32CreatePixmap ( - ScreenPtr pScreen, - int width, - int height, - int depth -){ - cfb24_32PixmapPtr pPixPriv; - PixmapPtr pPix; - int size, bpp, pitch; - - /* All depth 24 pixmaps are 24bpp unless the caller is allocating - its own data (width == 0) */ - - if(depth == 1) { - pitch = ((width + 31) >> 5) << 2; - bpp = 1; - } else { /* depth == 24 */ - pitch = ((width * 3) + 3) & ~3L; - bpp = (width && height) ? 24 : 32; - } - - size = height * pitch; - pPix = AllocatePixmap(pScreen, size); - if (!pPix) - return NullPixmap; - pPix->drawable.type = DRAWABLE_PIXMAP; - pPix->drawable.class = 0; - pPix->drawable.pScreen = pScreen; - pPix->drawable.depth = depth; - pPix->drawable.bitsPerPixel = bpp; - pPix->drawable.id = 0; - pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pPix->drawable.x = 0; - pPix->drawable.y = 0; - pPix->drawable.width = width; - pPix->drawable.height = height; - pPix->devKind = pitch; - pPix->refcnt = 1; - pPix->devPrivate.ptr = size ? - (pointer)((char*)pPix + pScreen->totalPixmapSize) : NULL; - - pPixPriv = CFB24_32_GET_PIXMAP_PRIVATE(pPix); - pPixPriv->pix = NULL; /* no clone yet */ - pPixPriv->freePrivate = FALSE; - pPixPriv->isRefPix = FALSE; - - return pPix; -} - -Bool -cfb24_32DestroyPixmap(PixmapPtr pPix) -{ - cfb24_32PixmapPtr pPriv = CFB24_32_GET_PIXMAP_PRIVATE(pPix); - PixmapPtr pClone = pPriv->pix; - - if(pClone) { - cfb24_32PixmapPtr cPriv = CFB24_32_GET_PIXMAP_PRIVATE(pClone); - int refcnt = pPix->refcnt; - cPriv->pix = NULL; /* avoid looping back */ - - if(refcnt != pClone->refcnt) - ErrorF("Pixmap refcnt mismatch in DestroyPixmap()\n"); - - (*pPix->drawable.pScreen->DestroyPixmap)(pClone); - - if(refcnt > 1) - cPriv->pix = pPix; - } - - if(--pPix->refcnt) - return TRUE; - - if(pPriv->freePrivate) - xfree(pPix->devPrivate.ptr); - xfree(pPix); - - return TRUE; -} - -PixmapPtr -cfb24_32RefreshPixmap(PixmapPtr pPix) -{ - cfb24_32PixmapPtr newPixPriv, pixPriv = CFB24_32_GET_PIXMAP_PRIVATE(pPix); - ScreenPtr pScreen = pPix->drawable.pScreen; - int width = pPix->drawable.width; - int height = pPix->drawable.height; - GCPtr pGC; - - if(pPix->drawable.bitsPerPixel == 24) { - if(!pixPriv->pix) { /* need to make a 32bpp clone */ - int pitch = width << 2; - unsigned char* data; - PixmapPtr newPix; - - if(!(data = (unsigned char*)xalloc(pitch * height))) - FatalError("Out of memory\n"); - - /* cfb24_32CreatePixmap will make a 32bpp header for us */ - newPix = (*pScreen->CreatePixmap)(pScreen, 0, 0, 24); - newPix->devKind = pitch; - newPix->devPrivate.ptr = (pointer)data; - newPix->drawable.width = width; - newPix->drawable.height = height; - newPix->refcnt = pPix->refcnt; - pixPriv->pix = newPix; - newPixPriv = CFB24_32_GET_PIXMAP_PRIVATE(newPix); - newPixPriv->pix = pPix; - newPixPriv->freePrivate = TRUE; - pixPriv->isRefPix = TRUE; - } - } else { /* bitsPerPixel == 32 */ - if(!pixPriv->pix) { /* need to make a 32bpp clone */ - - /* cfb24_32CreatePixmap will make a 24bpp pixmap for us */ - pixPriv->pix = (*pScreen->CreatePixmap)(pScreen, width, height, 24); - pixPriv->pix->refcnt = pPix->refcnt; - newPixPriv = CFB24_32_GET_PIXMAP_PRIVATE(pixPriv->pix); - newPixPriv->pix = pPix; - pixPriv->isRefPix = TRUE; - } - } - - if(pPix->refcnt != pixPriv->pix->refcnt) - ErrorF("Pixmap refcnt mismatch in RefreshPixmap()\n"); - - /* make sure copies only go from the real to the clone */ - if(pixPriv->isRefPix) { - pGC = GetScratchGC(24, pScreen); - ValidateGC((DrawablePtr)pixPriv->pix, pGC); - (*pGC->ops->CopyArea)((DrawablePtr)pPix, (DrawablePtr)pixPriv->pix, - pGC, 0, 0, width, height, 0, 0); - FreeScratchGC(pGC); - } - - return pixPriv->pix; -} - Index: programs/Xserver/hw/xfree86/xf24_32bpp/cfbscrinit.c =================================================================== RCS file: programs/Xserver/hw/xfree86/xf24_32bpp/cfbscrinit.c diff -N programs/Xserver/hw/xfree86/xf24_32bpp/cfbscrinit.c --- programs/Xserver/hw/xfree86/xf24_32bpp/cfbscrinit.c 23 Apr 2004 19:54:17 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,205 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf24_32bpp/cfbscrinit.c,v 1.5 2003/07/16 01:38:49 dawes Exp $ */ - - -#include "X.h" -#include "Xmd.h" -#include "misc.h" -#include "servermd.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "resource.h" -#include "colormap.h" -#include "colormapst.h" -#define PSZ 8 -#include "cfb.h" -#undef PSZ -#include "cfb24.h" -#include "cfb32.h" -#include "cfb24_32.h" -#include "mi.h" -#include "micmap.h" -#include "mistruct.h" -#include "dix.h" -#include "mibstore.h" - -/* CAUTION: We require that cfb24 and cfb32 were NOT - compiled with CFB_NEED_SCREEN_PRIVATE */ - -static BSFuncRec cfb24_32BSFuncRec = { - cfb24SaveAreas, - cfb24RestoreAreas, - (BackingStoreSetClipmaskRgnProcPtr) 0, - (BackingStoreGetImagePixmapProcPtr) 0, - (BackingStoreGetSpansPixmapProcPtr) 0, -}; - - -int cfb24_32GCIndex = 1; -int cfb24_32PixmapIndex = 1; - -static unsigned long cfb24_32Generation = 0; - -static Bool -cfb24_32AllocatePrivates(ScreenPtr pScreen) -{ - if(cfb24_32Generation != serverGeneration) { - if( ((cfb24_32GCIndex = AllocateGCPrivateIndex()) < 0) | - ((cfb24_32PixmapIndex = AllocatePixmapPrivateIndex()) < 0)) - return FALSE; - cfb24_32Generation = serverGeneration; - } - - - /* All cfb will have the same GC and Window private indicies */ - if(!mfbAllocatePrivates(pScreen,&cfbWindowPrivateIndex, &cfbGCPrivateIndex)) - return FALSE; - - /* The cfb indicies are the mfb indicies. Reallocating them resizes them */ - if(!AllocateWindowPrivate(pScreen,cfbWindowPrivateIndex,sizeof(cfbPrivWin))) - return FALSE; - - if(!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC))) - return FALSE; - - if(!AllocateGCPrivate(pScreen, cfb24_32GCIndex, sizeof(cfb24_32GCRec))) - return FALSE; - - if(!AllocatePixmapPrivate( - pScreen, cfb24_32PixmapIndex, sizeof(cfb24_32PixmapRec))) - return FALSE; - - - return TRUE; -} - -static void DestroyColormapNoop( - ColormapPtr pColormap) -{ - /* NOOP */ -} - -static void StoreColorsNoop( - ColormapPtr pColormap, - int ndef, - xColorItem * pdef) -{ - /* NOOP */ -} - -static Bool -cfb24_32SetupScreen( - ScreenPtr pScreen, - pointer pbits, /* pointer to screen bitmap */ - int xsize, int ysize, /* in pixels */ - int dpix, int dpiy, /* dots per inch */ - int width /* pixel width of frame buffer */ -){ - if (!cfb24_32AllocatePrivates(pScreen)) - return FALSE; - pScreen->defColormap = FakeClientID(0); - /* let CreateDefColormap do whatever it wants for pixels */ - pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0; - pScreen->QueryBestSize = mfbQueryBestSize; - /* SaveScreen */ - pScreen->GetImage = cfb24_32GetImage; - pScreen->GetSpans = cfb24_32GetSpans; - pScreen->CreateWindow = cfb24_32CreateWindow; - pScreen->DestroyWindow = cfb24_32DestroyWindow; - pScreen->PositionWindow = cfb24_32PositionWindow; - pScreen->ChangeWindowAttributes = cfb24_32ChangeWindowAttributes; - pScreen->RealizeWindow = cfb24MapWindow; /* OK */ - pScreen->UnrealizeWindow = cfb24UnmapWindow; /* OK */ - pScreen->PaintWindowBackground = cfb24PaintWindow; /* OK */ - pScreen->PaintWindowBorder = cfb24PaintWindow; /* OK */ - pScreen->CopyWindow = cfb24_32CopyWindow; - pScreen->CreatePixmap = cfb24_32CreatePixmap; - pScreen->DestroyPixmap = cfb24_32DestroyPixmap; - pScreen->RealizeFont = mfbRealizeFont; - pScreen->UnrealizeFont = mfbUnrealizeFont; - pScreen->CreateGC = cfb24_32CreateGC; - pScreen->CreateColormap = miInitializeColormap; - pScreen->DestroyColormap = DestroyColormapNoop; - pScreen->InstallColormap = miInstallColormap; - pScreen->UninstallColormap = miUninstallColormap; - pScreen->ListInstalledColormaps = miListInstalledColormaps; - pScreen->StoreColors = StoreColorsNoop; - pScreen->ResolveColor = miResolveColor; - pScreen->BitmapToRegion = mfbPixmapToRegion; - - mfbRegisterCopyPlaneProc (pScreen, miCopyPlane); - return TRUE; -} - -typedef struct { - pointer pbits; - int width; -} miScreenInitParmsRec, *miScreenInitParmsPtr; - -static Bool -cfb24_32CreateScreenResources(ScreenPtr pScreen) -{ - miScreenInitParmsPtr pScrInitParms; - int pitch; - Bool retval; - - /* get the pitch before mi destroys it */ - pScrInitParms = (miScreenInitParmsPtr)pScreen->devPrivate; - pitch = BitmapBytePad(pScrInitParms->width * 24); - - if((retval = miCreateScreenResources(pScreen))) { - /* fix the screen pixmap */ - PixmapPtr pPix = (PixmapPtr)pScreen->devPrivate; - pPix->drawable.bitsPerPixel = 24; - pPix->devKind = pitch; - } - - return retval; -} - - -static Bool -cfb24_32FinishScreenInit( - ScreenPtr pScreen, - pointer pbits, /* pointer to screen bitmap */ - int xsize, int ysize, /* in pixels */ - int dpix, int dpiy, /* dots per inch */ - int width /* pixel width of frame buffer */ -){ - VisualPtr visuals; - DepthPtr depths; - int nvisuals; - int ndepths; - int rootdepth; - VisualID defaultVisual; - - rootdepth = 0; - if (!miInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth, - &defaultVisual,((unsigned long)1<<(24-1)), 8, -1)) - return FALSE; - if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, - rootdepth, ndepths, depths, - defaultVisual, nvisuals, visuals)) - return FALSE; - - pScreen->BackingStoreFuncs = cfb24_32BSFuncRec; - pScreen->CreateScreenResources = cfb24_32CreateScreenResources; - pScreen->CloseScreen = cfb32CloseScreen; /* OK */ - pScreen->GetScreenPixmap = cfb32GetScreenPixmap; /* OK */ - pScreen->SetScreenPixmap = cfb32SetScreenPixmap; /* OK */ - return TRUE; -} - -Bool -cfb24_32ScreenInit( - ScreenPtr pScreen, - pointer pbits, /* pointer to screen bitmap */ - int xsize, int ysize, /* in pixels */ - int dpix, int dpiy, /* dots per inch */ - int width /* pixel width of frame buffer */ -){ - if (!cfb24_32SetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width)) - return FALSE; - return cfb24_32FinishScreenInit( - pScreen, pbits, xsize, ysize, dpix, dpiy, width); -} - Index: programs/Xserver/hw/xfree86/xf24_32bpp/cfbwindow.c =================================================================== RCS file: programs/Xserver/hw/xfree86/xf24_32bpp/cfbwindow.c diff -N programs/Xserver/hw/xfree86/xf24_32bpp/cfbwindow.c --- programs/Xserver/hw/xfree86/xf24_32bpp/cfbwindow.c 23 Apr 2004 19:54:17 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,122 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf24_32bpp/cfbwindow.c,v 1.4tsi Exp $ */ - -#include "X.h" -#include "windowstr.h" -#include "regionstr.h" -#include "pixmapstr.h" -#include "scrnintstr.h" -#define PSZ 8 -#include "cfb.h" -#undef PSZ -#include "cfb24.h" -#include "cfb32.h" -#include "cfb24_32.h" -#include "mi.h" - - -Bool -cfb24_32CreateWindow(WindowPtr pWin) -{ - cfbPrivWin *pPrivWin = cfbGetWindowPrivate(pWin); - - pPrivWin->fastBackground = FALSE; - pPrivWin->fastBorder = FALSE; - - pWin->drawable.bitsPerPixel = 24; - return TRUE; -} - - -Bool -cfb24_32DestroyWindow(WindowPtr pWin) -{ - return TRUE; -} - -Bool -cfb24_32PositionWindow( - WindowPtr pWin, - int x, int y -){ - return TRUE; -} - - -Bool -cfb24_32ChangeWindowAttributes( - WindowPtr pWin, - unsigned long mask -){ - cfb24_32PixmapPtr pixPriv; - PixmapPtr pPix; - - /* The dix layer may have incremented a refcnt. We sync them here */ - - if((mask & CWBackPixmap) && (pWin->backgroundState == BackgroundPixmap)) { - pPix = pWin->background.pixmap; - pixPriv = CFB24_32_GET_PIXMAP_PRIVATE(pPix); - - if(pixPriv->pix && (pPix->refcnt != pixPriv->pix->refcnt)) - pixPriv->pix->refcnt = pPix->refcnt; - - if(pPix->drawable.bitsPerPixel != 24) - pWin->background.pixmap = cfb24_32RefreshPixmap(pPix); - } - - if((mask & CWBorderPixmap) && !pWin->borderIsPixel) { - pPix = pWin->border.pixmap; - pixPriv = CFB24_32_GET_PIXMAP_PRIVATE(pPix); - - if(pixPriv->pix && (pPix->refcnt != pixPriv->pix->refcnt)) - pixPriv->pix->refcnt = pPix->refcnt; - - if(pPix->drawable.bitsPerPixel != 24) - pWin->border.pixmap = cfb24_32RefreshPixmap(pPix); - } - - return TRUE; -} - -void -cfb24_32CopyWindow( - WindowPtr pWin, - DDXPointRec ptOldOrg, - RegionPtr prgnSrc -){ - DDXPointPtr pptSrc, ppt; - RegionRec rgnDst; - BoxPtr pbox; - int i, nbox, dx, dy; - WindowPtr pwinRoot; - - pwinRoot = WindowTable[pWin->drawable.pScreen->myNum]; - - REGION_NULL(pWin->drawable.pScreen, &rgnDst); - - dx = ptOldOrg.x - pWin->drawable.x; - dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); - REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, - &pWin->borderClip, prgnSrc); - - pbox = REGION_RECTS(&rgnDst); - nbox = REGION_NUM_RECTS(&rgnDst); - if(!nbox || - !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) - { - REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); - return; - } - ppt = pptSrc; - - for (i = nbox; --i >= 0; ppt++, pbox++) - { - ppt->x = pbox->x1 + dx; - ppt->y = pbox->y1 + dy; - } - - cfb24_32DoBitblt24To24GXcopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot, - GXcopy, &rgnDst, pptSrc, ~0L); - DEALLOCATE_LOCAL(pptSrc); - REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); -}