diff options
author | Eric Anholt <anholt@freebsd.org> | 2004-07-23 05:36:14 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2004-07-23 05:36:14 +0000 |
commit | 6f1e01ecdb11913fd768b9918f516b8379b7858f (patch) | |
tree | d4f17a99e6570a5c335400c5a0d0c40817342504 | |
parent | b68322f467b7e524092af15e33ab872abb99b6a2 (diff) |
- Add a new option, BuildDevelDRIDrivers, which controls whether
DevelDRIDrivers is non-empty. DevelDRIDrivers contains those drivers
aren't built by default either due to being unusable on that
architecture (but buildable for testing) or due to security concerns,
as in the mach64 and savage cases.
- Merge the Mach64 DDX's DRI support, under the XF86DRI_DEVEL define, which
is set only when BuildDevelDRIDrivers is set.
- Fix up of the sets of DRI drivers built for various architectures.
- Fix build of unichrome DRI driver, which is now enabled on x86.
-rw-r--r-- | src/atiaccel.c | 4 | ||||
-rw-r--r-- | src/aticonfig.c | 38 | ||||
-rw-r--r-- | src/aticonsole.c | 31 | ||||
-rw-r--r-- | src/atiload.c | 6 | ||||
-rw-r--r-- | src/atiload.h | 6 | ||||
-rw-r--r-- | src/atilock.c | 12 | ||||
-rw-r--r-- | src/atimach64.c | 16 | ||||
-rw-r--r-- | src/atimach64accel.c | 8 | ||||
-rw-r--r-- | src/atimach64cursor.c | 10 | ||||
-rw-r--r-- | src/atimach64io.h | 8 | ||||
-rw-r--r-- | src/atimisc.c | 44 | ||||
-rw-r--r-- | src/atioption.c | 6 | ||||
-rw-r--r-- | src/atioption.h | 10 | ||||
-rw-r--r-- | src/atiregs.h | 2 | ||||
-rw-r--r-- | src/atiscreen.c | 28 | ||||
-rw-r--r-- | src/atistruct.h | 47 |
16 files changed, 165 insertions, 111 deletions
diff --git a/src/atiaccel.c b/src/atiaccel.c index 04edd30..8b60fbd 100644 --- a/src/atiaccel.c +++ b/src/atiaccel.c @@ -1,6 +1,6 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c,v 1.13 2003/04/24 21:19:22 tsi Exp $ */ /* - * Copyright 2001 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2001 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -67,7 +67,7 @@ ATIInitializeAcceleration #endif /* AVOID_CPIO */ -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL /* If DRI is enabled, we've already set up the FB manager in ATIScreenInit */ if (!pATI->directRenderingEnabled) diff --git a/src/aticonfig.c b/src/aticonfig.c index eb1f428..40ee24f 100644 --- a/src/aticonfig.c +++ b/src/aticonfig.c @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.c,v 1.14 2003/04/30 21:43:31 tsi Exp $*/ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonfig.c,v 1.15tsi Exp $*/ /* - * Copyright 2000 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -39,6 +39,7 @@ */ typedef enum { + ATI_OPTION_BIOS_DISPLAY, /* Allow BIOS interference */ ATI_OPTION_CRT_SCREEN, /* Legacy negation of "PanelDisplay" */ ATI_OPTION_DEVEL, /* Intentionally undocumented */ ATI_OPTION_BLEND, /* Force horizontal blending of small modes */ @@ -61,6 +62,13 @@ ATIProcessOptions OptionInfoPtr PublicOption = xnfalloc(ATIPublicOptionSize); OptionInfoRec PrivateOption[] = { + { /* ON: Let BIOS change display(s) */ + ATI_OPTION_BIOS_DISPLAY, /* OFF: Don't */ + "biosdisplay", + OPTV_BOOLEAN, + {0, }, + FALSE + }, { /* Negation of "PanelDisplay" public option */ ATI_OPTION_CRT_SCREEN, "crtscreen", @@ -68,6 +76,13 @@ ATIProcessOptions {0, }, FALSE }, + { /* ON: Ease exploration of loose ends */ + ATI_OPTION_DEVEL, /* OFF: Fit for public consumption */ + "tsi", + OPTV_BOOLEAN, + {0, }, + FALSE + }, { /* ON: Horizontally blend most modes */ ATI_OPTION_BLEND, /* OFF: Use pixel replication more often */ "lcdblend", @@ -82,13 +97,6 @@ ATIProcessOptions {0, }, FALSE }, - { /* ON: Ease exploration of loose ends */ - ATI_OPTION_DEVEL, /* OFF: Fit for public consumption */ - "tsi", - OPTV_BOOLEAN, - {0, }, - FALSE - }, { -1, NULL, @@ -101,6 +109,7 @@ ATIProcessOptions (void)memcpy(PublicOption, ATIPublicOptions, ATIPublicOptionSize); # define Accel PublicOption[ATI_OPTION_ACCEL].value.bool +# define BIOSDisplay PrivateOption[ATI_OPTION_BIOS_DISPLAY].value.bool # define Blend PrivateOption[ATI_OPTION_BLEND].value.bool # define CRTDisplay PublicOption[ATI_OPTION_CRT_DISPLAY].value.bool # define CRTScreen PrivateOption[ATI_OPTION_CRT_SCREEN].value.bool @@ -114,7 +123,7 @@ ATIProcessOptions #endif /* AVOID_CPIO */ -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL # define IsPCI PublicOption[ATI_OPTION_IS_PCI].value.bool # define DMAMode PublicOption[ATI_OPTION_DMA_MODE].value.str @@ -123,7 +132,7 @@ ATIProcessOptions # define LocalTex PublicOption[ATI_OPTION_LOCAL_TEXTURES].value.bool # define BufferSize PublicOption[ATI_OPTION_BUFFER_SIZE].value.num -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ # define CacheMMIO PublicOption[ATI_OPTION_MMIO_CACHE].value.bool # define TestCacheMMIO PublicOption[ATI_OPTION_TEST_MMIO_CACHE].value.bool @@ -171,7 +180,9 @@ ATIProcessOptions } Blend = PanelDisplay = TRUE; +#ifdef XF86DRI_DEVEL DMAMode = "mmio"; +#endif xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options, PublicOption); @@ -193,6 +204,7 @@ ATIProcessOptions /* Move option values into driver private structure */ pATI->OptionAccel = Accel; + pATI->OptionBIOSDisplay = BIOSDisplay; pATI->OptionBlend = Blend; pATI->OptionCRTDisplay = CRTDisplay; pATI->OptionCSync = CSync; @@ -217,7 +229,7 @@ ATIProcessOptions else pATI->OptionPanelDisplay = !CRTScreen; -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL pATI->OptionIsPCI = IsPCI; pATI->OptionAGPMode = AGPMode; @@ -241,7 +253,7 @@ ATIProcessOptions pATI->OptionDMAMode = MACH64_MODE_DMA_ASYNC; } -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ /* Validate and set cursor options */ pATI->Cursor = ATI_CURSOR_SOFTWARE; diff --git a/src/aticonsole.c b/src/aticonsole.c index 1d65df7..1b87a95 100644 --- a/src/aticonsole.c +++ b/src/aticonsole.c @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c,v 1.21 2003/07/24 22:08:27 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/aticonsole.c,v 1.22 2003/11/13 18:42:47 tsi Exp $ */ /* - * Copyright 1997 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -38,6 +38,10 @@ #include "ativga.h" #include "atividmem.h" +#ifdef XF86DRI_DEVEL +#include "mach64_common.h" +#endif + #include "mach64_common.h" @@ -253,7 +257,7 @@ ATISwitchMode { pScreenInfo->currentMode = pMode; -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL if (pATI->directRenderingEnabled) { @@ -261,18 +265,18 @@ ATISwitchMode ATIDRIWaitForIdle(pATI); } -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ ATIModeSet(pScreenInfo, pATI, &pATI->NewHW); -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL if (pATI->directRenderingEnabled) { DRIUnlock(pScreenInfo->pScreen); } -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ } @@ -307,14 +311,14 @@ ATIEnterVT if (pATI->OptionShadowFB) { -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL if (pATI->directRenderingEnabled) { DRIUnlock(pScreen); } -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ return TRUE; } @@ -342,14 +346,14 @@ ATIEnterVT pScreenPixmap->devPrivate.ptr = NULL; } -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL if (pATI->directRenderingEnabled) { DRIUnlock(pScreen); } -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ return Entered; } @@ -371,7 +375,7 @@ ATILeaveVT ScreenPtr pScreen = pScreenInfo->pScreen; ATIPtr pATI = ATIPTR(pScreenInfo); -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL if (pATI->directRenderingEnabled) { @@ -379,7 +383,7 @@ ATILeaveVT ATIDRIWaitForIdle(pATI); } -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ ATILeaveGraphics(pScreenInfo, ATIPTR(pScreenInfo)); } @@ -400,7 +404,8 @@ ATIFreeScreen ScrnInfoPtr pScreenInfo = xf86Screens[iScreen]; ATIPtr pATI = ATIPTR(pScreenInfo); - ATII2CFreeScreen(iScreen); + if (pATI->Closeable || (serverGeneration > 1)) + ATII2CFreeScreen(iScreen); if (pATI->Closeable) (void)(*pScreen->CloseScreen)(iScreen, pScreen); diff --git a/src/atiload.c b/src/atiload.c index 9449205..8ed14f1 100644 --- a/src/atiload.c +++ b/src/atiload.c @@ -1,6 +1,6 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.c,v 1.15 2003/08/29 21:07:57 tsi Exp $ */ /* - * Copyright 2000 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -75,7 +75,7 @@ const char *ATIxf4bppSymbols[] = #endif /* AVOID_CPIO */ -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL const char *ATIdrmSymbols[] = { "drmAddBufs", @@ -125,7 +125,7 @@ const char *ATIdriSymbols[] = { NULL }; -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ const char *ATIfbSymbols[] = { diff --git a/src/atiload.h b/src/atiload.h index 3447825..3827223 100644 --- a/src/atiload.h +++ b/src/atiload.h @@ -1,6 +1,6 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiload.h,v 1.6 2003/07/24 22:08:28 tsi Exp $ */ /* - * Copyright 2000 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -42,11 +42,11 @@ extern const char *ATIint10Symbols[], *ATIddcSymbols[], *ATIvbeSymbols[], #endif /* AVOID_CPIO */ -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL *ATIdrmSymbols[], *ATIdriSymbols[], -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ *ATIfbSymbols[], *ATIshadowfbSymbols[], *ATIxaaSymbols[], *ATIramdacSymbols[], *ATIi2cSymbols[]; diff --git a/src/atilock.c b/src/atilock.c index 4ba06e5..8dafcf7 100644 --- a/src/atilock.c +++ b/src/atilock.c @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c,v 1.19 2003/04/23 21:51:28 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atilock.c,v 1.20tsi Exp $ */ /* - * Copyright 1999 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -120,13 +120,13 @@ ATIUnlock outr(CRTC_INT_CNTL, (pATI->LockData.crtc_int_cntl & ~CRTC_INT_ENS) | CRTC_INT_ACKS); -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL if (pATI->irq > 0) outr(CRTC_INT_CNTL, (inr(CRTC_INT_CNTL) & ~CRTC_INT_ACKS) | CRTC_VBLANK_INT_EN); /* Enable VBLANK interrupt - handled by DRM */ -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ pATI->LockData.gen_test_cntl = inr(GEN_TEST_CNTL) & (GEN_OVR_OUTPUT_EN | GEN_OVR_POLARITY | GEN_CUR_EN | @@ -152,7 +152,7 @@ ATIUnlock /* * Prevent BIOS initiated display switches on dual-CRT controllers. */ - if (pATI->Chip != ATI_CHIP_264XL) + if (!pATI->OptionBIOSDisplay && (pATI->Chip != ATI_CHIP_264XL)) { pATI->LockData.scratch_reg3 = inr(SCRATCH_REG3); outr(SCRATCH_REG3, @@ -575,7 +575,7 @@ ATILock if ((pATI->LCDPanelID >= 0) && (pATI->Chip != ATI_CHIP_264LT)) { outr(LCD_INDEX, pATI->LockData.lcd_index); - if (pATI->Chip != ATI_CHIP_264XL) + if (!pATI->OptionBIOSDisplay && (pATI->Chip != ATI_CHIP_264XL)) outr(SCRATCH_REG3, pATI->LockData.scratch_reg3); } if (pATI->Chip >= ATI_CHIP_264VTB) diff --git a/src/atimach64.c b/src/atimach64.c index 72f4a10..dfbe8d7 100644 --- a/src/atimach64.c +++ b/src/atimach64.c @@ -1,6 +1,6 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c,v 1.52 2003/04/23 21:51:28 tsi Exp $ */ /* - * Copyright 1997 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -226,18 +226,18 @@ ATIMach64PreInit */ if (pATI->Chip >= ATI_CHIP_264VT4) -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL /* Changing the FIFO depth seems to interfere with DMA, so use * default of 128 entries (0x01) */ pATIHW->gui_cntl = (inm(GUI_CNTL) & ~CMDFIFO_SIZE_MODE) | 0x01; -#else /* XF86DRI */ +#else /* XF86DRI_DEVEL */ pATIHW->gui_cntl = inm(GUI_CNTL) & ~CMDFIFO_SIZE_MODE; -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ /* Initialise destination registers */ pATIHW->dst_off_pitch = @@ -1123,12 +1123,12 @@ ATIMach64SetDPMSMode return; } -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL /* XAA Sync requires the DRM lock if DRI enabled */ ATIDRILock(pScreenInfo); -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ ATIMach64Sync(pScreenInfo); @@ -1226,10 +1226,10 @@ ATIMach64SetDPMSMode } } -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL ATIDRIUnlock(pScreenInfo); -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ } diff --git a/src/atimach64accel.c b/src/atimach64accel.c index b7b8e07..9a38cf0 100644 --- a/src/atimach64accel.c +++ b/src/atimach64accel.c @@ -1,6 +1,6 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64accel.c,v 1.1 2003/04/23 21:51:28 tsi Exp $ */ /* - * Copyright 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -56,7 +56,9 @@ #include "atipriv.h" #include "atiregs.h" +#ifdef XF86DRI_DEVEL #include "mach64_common.h" +#endif #include "miline.h" @@ -137,7 +139,7 @@ ATIMach64Sync { ATIPtr pATI = ATIPTR(pScreenInfo); -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL if ( pATI->directRenderingEnabled && pATI->NeedDRISync ) { @@ -271,7 +273,7 @@ ATIMach64Sync } else -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ { ATIMach64WaitForIdle(pATI); diff --git a/src/atimach64cursor.c b/src/atimach64cursor.c index 6b55d42..07d85cb 100644 --- a/src/atimach64cursor.c +++ b/src/atimach64cursor.c @@ -1,6 +1,6 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64cursor.c,v 1.1 2003/04/23 21:51:29 tsi Exp $ */ /* - * Copyright 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2003 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -132,12 +132,12 @@ ATIMach64LoadCursorImage CARD32 *pSrc = (pointer)pImage; volatile CARD32 *pDst = pATI->pCursorImage; -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL /* XAA Sync requires the DRM lock if DRI enabled */ ATIDRILock(pScreenInfo); -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ /* Synchronise video memory accesses */ ATIMach64Sync(pScreenInfo); @@ -284,11 +284,11 @@ ATIMach64LoadCursorImage #endif -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL ATIDRIUnlock(pScreenInfo); -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ } diff --git a/src/atimach64io.h b/src/atimach64io.h index d9da1d2..01cb32d 100644 --- a/src/atimach64io.h +++ b/src/atimach64io.h @@ -1,6 +1,6 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64io.h,v 1.15 2003/04/23 21:51:29 tsi Exp $ */ /* - * Copyright 2000 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -204,7 +204,7 @@ extern void ATIMach64PollEngineStatus FunctionPrototype((ATIPtr)); while ((_pATI)->EngineIsBusy) \ ATIMach64PollEngineStatus(_pATI) -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL #define ATIDRIWaitForIdle(_pATI) \ do { \ @@ -257,7 +257,7 @@ do } \ } while (0) -#else /* XF86DRI */ +#else /* XF86DRI_DEVEL */ #define ATIDRIWaitForIdle(_pATI) @@ -265,7 +265,7 @@ do #define ATIDRIUnlock(_pScrInfo) #define ATIDRISync(_pScrInfo) -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ /* diff --git a/src/atimisc.c b/src/atimisc.c index 61801eb..cfbf40f 100644 --- a/src/atimisc.c +++ b/src/atimisc.c @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimisc.c,v 1.7 2003/07/24 22:08:28 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimisc.c,v 1.8tsi Exp $ */ /* - * Copyright 2000 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 2000 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -38,7 +38,7 @@ static XF86ModuleVersionInfo ATIVersionRec = MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, - XF86_VERSION_CURRENT, + XORG_VERSION_CURRENT, ATI_VERSION_MAJOR, ATI_VERSION_MINOR, ATI_VERSION_PATCH, ABI_CLASS_VIDEODRV, ABI_VIDEODRV_VERSION, @@ -65,8 +65,38 @@ ATISetup if (!Inited) { /* Ensure main driver module is loaded, but not as a submodule */ - if (!xf86ServerIsOnlyDetecting() && !LoaderSymbol(ATI_NAME)) - xf86LoadOneModule(ATI_DRIVER_NAME, Options); + if (!xf86ServerIsOnlyDetecting()) + { + if (!LoaderSymbol(ATI_NAME)) + xf86LoadOneModule(ATI_DRIVER_NAME, Options); + + /* ati & atimisc module versions must match */ + do + { + XF86ModuleData *pModuleData = LoaderSymbol("atiModuleData"); + + if (pModuleData) + { + XF86ModuleVersionInfo *pModuleInfo = pModuleData->vers; + + if ((pModuleInfo->majorversion == ATI_VERSION_MAJOR) && + (pModuleInfo->minorversion == ATI_VERSION_MINOR) && + (pModuleInfo->patchlevel == ATI_VERSION_PATCH)) + break; + } + + xf86Msg(X_ERROR, + "\"ati\" and \"atimisc\" module versions must" + " match.\n"); + + if (ErrorMajor) + *ErrorMajor = (int)LDR_MISMATCH; + if (ErrorMinor) + *ErrorMinor = (int)LDR_MISMATCH; + + return NULL; + } while (0); + } /* * Tell loader about symbols from other modules that this module might @@ -84,12 +114,12 @@ ATISetup #endif /* AVOID_CPIO */ -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL ATIdrmSymbols, ATIdriSymbols, -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ ATIfbSymbols, ATIshadowfbSymbols, diff --git a/src/atioption.c b/src/atioption.c index 1bd90ec..24536fc 100644 --- a/src/atioption.c +++ b/src/atioption.c @@ -1,6 +1,6 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c,v 1.22 2003/04/23 21:51:29 tsi Exp $ */ /* - * Copyright 1999 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -76,7 +76,7 @@ const OptionInfoRec ATIPublicOptions[] = #endif /* AVOID_CPIO */ -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL { ATI_OPTION_IS_PCI, @@ -121,7 +121,7 @@ const OptionInfoRec ATIPublicOptions[] = FALSE, }, -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ { ATI_OPTION_MMIO_CACHE, diff --git a/src/atioption.h b/src/atioption.h index 6a907db..de406f9 100644 --- a/src/atioption.h +++ b/src/atioption.h @@ -1,6 +1,6 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h,v 1.12 2003/04/23 21:51:29 tsi Exp $ */ /* - * Copyright 1999 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -47,16 +47,16 @@ typedef enum #endif /* AVOID_CPIO */ -#ifdef XF86DRI - +#ifdef XF86DRI_DEVEL + ATI_OPTION_IS_PCI, ATI_OPTION_DMA_MODE, ATI_OPTION_AGP_MODE, ATI_OPTION_AGP_SIZE, ATI_OPTION_LOCAL_TEXTURES, ATI_OPTION_BUFFER_SIZE, - -#endif /* XF86DRI */ + +#endif /* XF86DRI_DEVEL */ ATI_OPTION_MMIO_CACHE, ATI_OPTION_TEST_MMIO_CACHE, diff --git a/src/atiregs.h b/src/atiregs.h index b0c3d84..4c35c2b 100644 --- a/src/atiregs.h +++ b/src/atiregs.h @@ -1,6 +1,6 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiregs.h,v 1.24 2003/04/23 21:51:30 tsi Exp $ */ /* - * Copyright 1994 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1994 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that diff --git a/src/atiscreen.c b/src/atiscreen.c index ec784cb..33e8a32 100644 --- a/src/atiscreen.c +++ b/src/atiscreen.c @@ -1,6 +1,6 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c,v 1.30 2003/04/23 21:51:30 tsi Exp $ */ /* - * Copyright 1999 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -42,8 +42,10 @@ #include "atixv.h" #include "atimach64accel.h" +#ifdef XF86DRI_DEVEL #include "mach64_dri.h" #include "mach64_sarea.h" +#endif #include "shadowfb.h" #include "xf86cmap.h" @@ -130,7 +132,9 @@ ATIScreenInit ATIPtr pATI = ATIPTR(pScreenInfo); pointer pFB; int VisualMask; +#ifdef XF86DRI_DEVEL BoxRec ScreenArea; +#endif /* Set video hardware state */ if (!ATIEnterGraphics(pScreen, pScreenInfo, pATI)) @@ -169,7 +173,7 @@ ATIScreenInit } } -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL /* Setup DRI after visuals have been established, but before * cfbScreenInit is called. cfbScreenInit will eventually call the @@ -211,7 +215,7 @@ ATIScreenInit } } -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ /* Initialise framebuffer layer */ switch (pATI->bitsPerPixel) @@ -315,7 +319,7 @@ ATIScreenInit /* Memory manager setup */ -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL if (pATI->directRenderingEnabled) { @@ -344,7 +348,7 @@ ATIScreenInit } else { int l, maxPixcache; -# ifdef XvExtension +#ifdef XvExtension int xvBytes; @@ -353,12 +357,12 @@ ATIScreenInit xvBytes = 720*480*cpp; /* enough for single-buffered DVD */ maxPixcache = xvBytes > bufferSize ? xvBytes : bufferSize; -# else /* XvExtension */ +#else /* XvExtension */ /* Try for one viewport */ maxPixcache = bufferSize; -# endif /* XvExtension */ +#endif /* XvExtension */ pATIDRIServer->textureSize = offscreenBytes - maxPixcache; @@ -485,7 +489,7 @@ ATIScreenInit } } -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ /* Setup acceleration */ /* If direct rendering is not enabled, the framebuffer memory @@ -549,7 +553,7 @@ ATIScreenInit if (serverGeneration == 1) xf86ShowUnusedOptions(pScreenInfo->scrnIndex, pScreenInfo->options); -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL /* DRI finalization */ if (pATI->directRenderingEnabled) { @@ -567,7 +571,7 @@ ATIScreenInit "Direct rendering disabled\n"); } -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ return TRUE; } @@ -588,7 +592,7 @@ ATICloseScreen ATIPtr pATI = ATIPTR(pScreenInfo); Bool Closed = TRUE; -#ifdef XF86DRI +#ifdef XF86DRI_DEVEL /* Disable direct rendering */ if (pATI->directRenderingEnabled) @@ -597,7 +601,7 @@ ATICloseScreen pATI->directRenderingEnabled = FALSE; } -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ ATICloseXVideo(pScreen, pScreenInfo, pATI); diff --git a/src/atistruct.h b/src/atistruct.h index cbaf1b8..87ff0a1 100644 --- a/src/atistruct.h +++ b/src/atistruct.h @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h,v 1.39 2003/07/24 22:08:28 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atistruct.h,v 1.41tsi Exp $ */ /* - * Copyright 1999 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * Copyright 1999 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -32,8 +32,8 @@ #include "aticlock.h" #include "atiregs.h" -#ifdef XF86DRI - +#ifdef XF86DRI_DEVEL + /* * DRI support */ @@ -44,7 +44,7 @@ #include "xf86dri.h" #include "dri.h" -#endif /* XF86DRI */ +#endif /* XF86DRI_DEVEL */ #include "xaa.h" #include "xf86Cursor.h" @@ -336,8 +336,8 @@ typedef struct _ATIRec * LCD panel data. */ int LCDPanelID, LCDClock, LCDHorizontal, LCDVertical; - int LCDHSyncStart, LCDHSyncWidth, LCDHBlankWidth; - int LCDVSyncStart, LCDVSyncWidth, LCDVBlankWidth; + unsigned LCDHSyncStart, LCDHSyncWidth, LCDHBlankWidth; + unsigned LCDVSyncStart, LCDVSyncWidth, LCDVBlankWidth; int LCDVBlendFIFOSize; /* @@ -424,24 +424,25 @@ typedef struct _ATIRec /* * Driver options. */ - CARD8 OptionAccel; /* Use hardware draw engine */ - CARD8 OptionBlend; /* Force horizontal blending */ - CARD8 OptionCRTDisplay; /* Display on both CRT and digital panel */ - CARD8 OptionCSync; /* Use composite sync */ - CARD8 OptionDevel; /* Intentionally undocumented */ + CARD8 OptionAccel:1; /* Use hardware draw engine */ + CARD8 OptionBIOSDisplay:1; /* Allow BIOS interference */ + CARD8 OptionBlend:1; /* Force horizontal blending */ + CARD8 OptionCRTDisplay:1; /* Display on both CRT and digital panel */ + CARD8 OptionCSync:1; /* Use composite sync */ + CARD8 OptionDevel:1; /* Intentionally undocumented */ #ifndef AVOID_CPIO - CARD8 OptionLinear; /* Use linear fb aperture when available */ + CARD8 OptionLinear:1; /* Use linear fb aperture when available */ #endif /* AVOID_CPIO */ - CARD8 OptionMMIOCache; /* Cache MMIO writes */ - CARD8 OptionTestMMIOCache; /* Test MMIO cache integrity */ - CARD8 OptionPanelDisplay; /* Prefer CRT over digital panel */ - CARD8 OptionProbeClocks; /* Force probe for fixed clocks */ - CARD8 OptionShadowFB; /* Use shadow frame buffer */ - CARD8 OptionLCDSync; /* Temporary */ + CARD8 OptionMMIOCache:1; /* Cache MMIO writes */ + CARD8 OptionTestMMIOCache:1;/* Test MMIO cache integrity */ + CARD8 OptionPanelDisplay:1; /* Prefer digital panel over CRT */ + CARD8 OptionProbeClocks:1; /* Force probe for fixed clocks */ + CARD8 OptionShadowFB:1; /* Use shadow frame buffer */ + CARD8 OptionLCDSync:1; /* Temporary */ /* * State flags. @@ -454,8 +455,8 @@ typedef struct _ATIRec */ CloseScreenProcPtr CloseScreen; -#ifdef XF86DRI - +#ifdef XF86DRI_DEVEL + /* * DRI data. */ @@ -481,8 +482,8 @@ typedef struct _ATIRec CARD8 OptionAGPSize; /* AGP size in MB */ CARD8 OptionLocalTextures; /* Use local textures + AGP textures (only valid for AGP) */ CARD8 OptionBufferSize; /* Command/dma buffer size in MB */ - -#endif /* XF86DRI */ + +#endif /* XF86DRI_DEVEL */ } ATIRec; |