From 74cf2305a0690a350235e5698f66a885a7913ccb Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 24 May 2024 16:17:15 +0200 Subject: [PATCH] drop ifdef's on XGIMERGED It's always enabled, so no need for the #ifdef's anymore. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- src/xgi.h | 12 ------------ src/xgi_dga.c | 6 +----- src/xgi_driver.c | 44 +------------------------------------------- src/xgi_opt.c | 13 +------------ src/xgi_vb.c | 2 -- 5 files changed, 3 insertions(+), 74 deletions(-) diff --git a/src/xgi.h b/src/xgi.h index 5bde9b9..410eb87 100644 --- a/src/xgi.h +++ b/src/xgi.h @@ -186,17 +186,9 @@ extern Bool g_bRunTimeDebug; #define CHIP_REVISION(p) (p)->chipRev #endif -#if 1 -#define XGIMERGED /* Include Merged-FB mode */ -#endif - -#ifdef XGIMERGED -#if 1 #define XGIXINERAMA /* Include Pseudo-Xinerama for MergedFB mode */ #define XGI_XINERAMA_MAJOR_VERSION 1 #define XGI_XINERAMA_MINOR_VERSION 1 -#endif -#endif #if 1 #define XGIGAMMA /* Include code for gamma correction */ @@ -211,13 +203,11 @@ extern Bool g_bRunTimeDebug; #define ENABLE_YPBPR #endif -#ifdef XGIMERGED #ifdef XGIXINERAMA #define EXTENSION_PROC_ARGS void * #include "extnsionst.h" /* required */ #include /* required */ #endif -#endif #if 1 #define XGIVRAMQ /* Use VRAM queue mode on 315 series */ @@ -792,7 +782,6 @@ typedef struct { int CurXPreset ; int CurYPreset ; unsigned long mmioSize; -#ifdef XGIMERGED Bool MergedFB, MergedFBAuto; XGIScrn2Rel CRT2Position; char * CRT2HSync; @@ -813,7 +802,6 @@ typedef struct { ExtensionEntry *XineramaExtEntry; int xgiXineramaVX, xgiXineramaVY; Bool AtLeastOneNonClone; -#endif #endif /* Added for 3D */ diff --git a/src/xgi_dga.c b/src/xgi_dga.c index 98cec29..b1a97d0 100644 --- a/src/xgi_dga.c +++ b/src/xgi_dga.c @@ -198,11 +198,7 @@ XGIDGAInit(ScreenPtr pScreen) /* We don't support 8bpp modes in dual head or MergedFB mode, * so don't offer them to DGA either. */ - if (!IS_DUAL_HEAD(pXGI) -#ifdef XGIMERGED - && !(pXGI->MergedFB) -#endif - ) { + if (!IS_DUAL_HEAD(pXGI) && !(pXGI->MergedFB)) { modes = XGISetupDGAMode(pScrn, modes, &num, 8, 8, (pScrn->bitsPerPixel == 8), ((pScrn->bitsPerPixel != 8) diff --git a/src/xgi_driver.c b/src/xgi_driver.c index 88c4d51..c848ac1 100644 --- a/src/xgi_driver.c +++ b/src/xgi_driver.c @@ -235,7 +235,6 @@ static XF86ModuleVersionInfo xgiVersRec = { _X_EXPORT XF86ModuleData xgiModuleData = { &xgiVersRec, xgiSetup, NULL }; /*** static string ***/ -#ifdef XGIMERGED static const char *mergednocrt1 = "CRT1 not detected or forced off. %s.\n"; static const char *mergednocrt2 = "No CRT2 output selected or no bridge detected. %s.\n"; @@ -244,7 +243,6 @@ static const char *modesforstr = "Modes for CRT%d: *********************************************\n"; static const char *crtsetupstr = "------------------------ CRT%d setup -------------------------\n"; -#endif typedef struct { @@ -425,7 +423,6 @@ XGIFreeRec(ScrnInfoPtr pScrn) pXGI->RenderAccelArray = NULL; } -#ifdef XGIMERGED if (pXGI->MetaModes) free(pXGI->MetaModes); pXGI->MetaModes = NULL; @@ -448,7 +445,6 @@ XGIFreeRec(ScrnInfoPtr pScrn) pXGI->CRT1Modes = NULL; } } -#endif if (pXGI->pVbe) vbeFree(pXGI->pVbe); pXGI->pVbe = NULL; @@ -859,8 +855,6 @@ XGIProbe(DriverPtr drv, int flags) /* Some helper functions for MergedFB mode */ -#ifdef XGIMERGED - /* Copy and link two modes form mergedfb mode * (Code base taken from mga driver) * Copies mode i, links the result to dest, and returns it. @@ -1402,8 +1396,6 @@ XGIFreeCRT2Structs(XGIPtr pXGI) } } -#endif /* End of MergedFB helpers */ - static xf86MonPtr XGIInternalDDC(ScrnInfoPtr pScrn, int crtno) { @@ -2265,7 +2257,6 @@ XGIDDCPreInit(ScrnInfoPtr pScrn) return; -#ifdef XGIMERGED if (pXGI->MergedFB) { pXGI->CRT2pScrn->monitor = malloc(sizeof(MonRec)); if (pXGI->CRT2pScrn->monitor) { @@ -2323,15 +2314,10 @@ XGIDDCPreInit(ScrnInfoPtr pScrn) pXGI->MergedFB = FALSE; } } -#endif -#ifdef XGIMERGED if (pXGI->MergedFB) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, crtsetupstr, 1); } -#endif - - /* end of DDC */ } #ifdef DEBUG5 @@ -3041,14 +3027,12 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags) /* Evaluate options */ xgiOptions(pScrn); -#ifdef XGIMERGED /* Due to palette & timing problems we don't support 8bpp in MFBM */ if ((pXGI->MergedFB) && (pScrn->bitsPerPixel == 8)) { XGIErrorLog(pScrn, "MergedFB: Color depth 8 not supported, %s\n", mergeddisstr); pXGI->MergedFB = pXGI->MergedFBAuto = FALSE; } -#endif /* Do basic configuration */ @@ -3339,7 +3323,6 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags) } /* Do some MergedFB mode initialisation */ -#ifdef XGIMERGED if (pXGI->MergedFB) { pXGI->CRT2pScrn = malloc(sizeof(ScrnInfoRec)); if (!pXGI->CRT2pScrn) { @@ -3352,7 +3335,6 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags) memcpy(pXGI->CRT2pScrn, pScrn, sizeof(ScrnInfoRec)); } } -#endif PDEBUG(ErrorF("3674 pXGI->VBFlags =%x\n", pXGI->VBFlags)); /* Determine CRT1<>CRT2 mode @@ -3377,7 +3359,6 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags) XGIFreeRec(pScrn); return FALSE; } -#ifdef XGIMERGED if (pXGI->MergedFB) { if (pXGI->MergedFBAuto) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, mergednocrt1, @@ -3391,7 +3372,6 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags) pXGI->CRT2pScrn = NULL; pXGI->MergedFB = FALSE; } -#endif pXGI->VBFlags |= VB_DISPMODE_SINGLE; } /* CRT1 and CRT2 - mirror or dual head ----- */ @@ -3418,7 +3398,6 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags) return FALSE; } -#ifdef XGIMERGED if (pXGI->MergedFB) { if (pXGI->MergedFBAuto) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, mergednocrt2, @@ -3432,7 +3411,6 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags) pXGI->CRT2pScrn = NULL; pXGI->MergedFB = FALSE; } -#endif PDEBUG(ErrorF("3782 pXGI->VBFlags =%x\n", pXGI->VBFlags)); pXGI->VBFlags |= (VB_DISPMODE_SINGLE | DISPTYPE_CRT1); } @@ -3600,9 +3578,7 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags) */ /* Select valid modes from those available */ -#ifdef XGIMERGED pXGI->CheckForCRT2 = FALSE; -#endif XGIDumpMonPtr(pScrn->monitor); @@ -3724,17 +3700,14 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags) pXGI->CurrentLayout.mode = pScrn->currentMode; pXGI->CurrentLayout.displayWidth = pScrn->displayWidth; -#ifdef XGIMERGED if (pXGI->MergedFB) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, modesforstr, 1); } -#endif /* Print the list of modes being used ; call xf86Mode.c-xf86PrintModeline() to print */ ErrorF("Call xf86PrintModes(pScrn) to list all valid modes...\n"); xf86PrintModes(pScrn); -#ifdef XGIMERGED if (pXGI->MergedFB) { BOOLEAN acceptcustommodes = TRUE; BOOLEAN includelcdmodes = TRUE; @@ -3862,16 +3835,12 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags) pXGI->CurrentLayout.displayWidth = pScrn->displayWidth; } -#endif /* Set display resolution */ -#ifdef XGIMERGED if (pXGI->MergedFB) { XGIMergedFBSetDpi(pScrn, pXGI->CRT2pScrn, pXGI->CRT2Position); } else -#endif - /* Jong 07/30/2009; might cause small font size */ xf86SetDpi(pScrn, 0, 0); @@ -3990,10 +3959,8 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags) #endif } -#ifdef XGIMERGED if (pXGI->MergedFB) pXGI->XGI_SD_Flags |= XGI_SD_ISMERGEDFB; -#endif if (pXGI->enablexgictrl) pXGI->XGI_SD_Flags |= XGI_SD_ENABLED; @@ -5035,7 +5002,6 @@ XGISetStartAddressCRT1(XGIPtr pXGI, unsigned long base) setXGIIDXREG(XGICR, 0x11, 0x7F,(cr11backup & 0x80)); } */ -#ifdef XGIMERGED /* static Bool InRegion(int x, int y, region r) { @@ -5280,7 +5246,6 @@ XGIAdjustFrameMerged(int scrnIndex, int x, int y, int flags) XGIAdjustFrameHW_CRT1(pScrn1, pXGI->CRT1frameX0, pXGI->CRT1frameY0); } */ -#endif /* * This function is used to initialize the Start Address - the first @@ -5817,17 +5782,13 @@ XGIPreSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int viewmode) int temp = 0; int crt1rateindex = 0; DisplayModePtr mymode; -#ifdef XGIMERGED DisplayModePtr mymode2 = NULL; -#endif -#ifdef XGIMERGED if (pXGI->MergedFB) { mymode = ((XGIMergedDisplayModePtr) mode->Private)->CRT1; mymode2 = ((XGIMergedDisplayModePtr) mode->Private)->CRT2; } else -#endif mymode = mode; vbflag = pXGI->VBFlags; @@ -6000,9 +5961,7 @@ XGIPreSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int viewmode) } } } - else -#ifdef XGIMERGED - if (pXGI->MergedFB) { + else if (pXGI->MergedFB) { CR33 = 0; if (!(vbflag & CRT1_LCDA)) { CR33 |= (crt1rateindex & 0x0f); @@ -6012,7 +5971,6 @@ XGIPreSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int viewmode) } } else -#endif { CR33 = 0; if (!(vbflag & CRT1_LCDA)) { diff --git a/src/xgi_opt.c b/src/xgi_opt.c index d3185f1..ab9b0c9 100644 --- a/src/xgi_opt.c +++ b/src/xgi_opt.c @@ -143,7 +143,6 @@ static const OptionInfoRec XGIOptions[] = { { OPTION_XVMEMCPY, "XvUseMemcpy", OPTV_BOOLEAN, {0}, -1 }, { OPTION_ENABLEHOTKEY, "EnableHotkey", OPTV_BOOLEAN, {0}, -1 }, { OPTION_ENABLEXGICTRL, "EnableXGICtrl", OPTV_BOOLEAN, {0}, -1 }, -#ifdef XGIMERGED { OPTION_MERGEDFB, "MergedFB", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_MERGEDFB2, "TwinView", OPTV_BOOLEAN, {0}, FALSE }, /* alias */ { OPTION_MERGEDFBAUTO, "MergedFBAuto", OPTV_BOOLEAN, {0}, FALSE }, @@ -164,7 +163,6 @@ static const OptionInfoRec XGIOptions[] = { { OPTION_NOXGIXINERAMA, "NoMergedXinerama", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOXGIXINERAMA2, "NoTwinviewXineramaInfo", OPTV_BOOLEAN, {0}, FALSE }, /* alias */ { OPTION_CRT2ISSCRN0, "MergedXineramaCRT2IsScreen0",OPTV_BOOLEAN,{0},FALSE }, -#endif #endif { -1, NULL, OPTV_NONE, {0}, FALSE } }; @@ -247,7 +245,6 @@ xgiOptions(ScrnInfoPtr pScrn) pXGI->XvDefDisableGfxLR = FALSE; pXGI->XvUseMemcpy = TRUE; pXGI->XvGammaRed = pXGI->XvGammaGreen = pXGI->XvGammaBlue = 1000; -#ifdef XGIMERGED pXGI->MergedFB = pXGI->MergedFBAuto = FALSE; pXGI->CRT2Position = xgiRightOf; pXGI->CRT2HSync = NULL; @@ -257,7 +254,6 @@ xgiOptions(ScrnInfoPtr pScrn) #ifdef XGIXINERAMA pXGI->UsexgiXinerama = TRUE; pXGI->CRT2IsScrn0 = FALSE; -#endif #endif /* Collect the options */ @@ -420,7 +416,6 @@ xgiOptions(ScrnInfoPtr pScrn) * Enable/disable and configure merged framebuffer mode * */ -#ifdef XGIMERGED if (IS_DUAL_HEAD(pXGI)) { Bool val; if(xf86GetOptValBool(pXGI->Options, OPTION_MERGEDFB, &val)) { @@ -428,7 +423,6 @@ xgiOptions(ScrnInfoPtr pScrn) "Option \"MergedFB\" cannot be used in Dual Head mode\n"); } } else -#endif /* Some options can only be specified in the Master Head's Device * section. Here we give the user a hint in the log. @@ -502,13 +496,11 @@ xgiOptions(ScrnInfoPtr pScrn) /* ShadowFB */ from = X_DEFAULT; if(xf86GetOptValBool(pXGI->Options, OPTION_SHADOW_FB, &pXGI->ShadowFB)) { -#ifdef XGIMERGED if(pXGI->MergedFB) { pXGI->ShadowFB = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Shadow Frame Buffer not supported in MergedFB mode\n"); } else -#endif from = X_CONFIG; } if(pXGI->ShadowFB) { @@ -519,13 +511,10 @@ xgiOptions(ScrnInfoPtr pScrn) /* Rotate */ if((strptr = (char *)xf86GetOptValString(pXGI->Options, OPTION_ROTATE))) { -#ifdef XGIMERGED if(pXGI->MergedFB) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Screen rotation not supported in MergedFB mode\n"); - } else -#endif - if(!xf86NameCmp(strptr, "CW")) { + } else if(!xf86NameCmp(strptr, "CW")) { pXGI->Rotate = 1; } else if(!xf86NameCmp(strptr, "CCW")) { pXGI->Rotate = -1; diff --git a/src/xgi_vb.c b/src/xgi_vb.c index dd3b50e..13f1f58 100644 --- a/src/xgi_vb.c +++ b/src/xgi_vb.c @@ -110,9 +110,7 @@ void XGICRT1PreInit(ScrnInfoPtr pScrn) unsigned char CRT1Detected; if (!(pXGI->XGI_Pr->VBType & VB_XGIVB) || IS_DUAL_HEAD(pXGI) -#ifdef XGIMERGED || ((pXGI->MergedFB) && (!(pXGI->MergedFBAuto))) -#endif ) { pXGI->CRT1off = 0; return;