diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/common/xmlconfig.c | 19 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/xmlconfig.h | 23 | ||||
-rw-r--r-- | src/mesa/drivers/dri/mga/mga_xmesa.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_context.c | 25 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_screen.c | 27 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_context.c | 25 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_screen.c | 27 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_context.c | 24 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.c | 26 | ||||
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_context.c | 15 | ||||
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_screen.c | 18 |
11 files changed, 121 insertions, 113 deletions
diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c index a6d4c8ab941..887f720f0d9 100644 --- a/src/mesa/drivers/dri/common/xmlconfig.c +++ b/src/mesa/drivers/dri/common/xmlconfig.c @@ -504,16 +504,17 @@ static void optInfoEndElem (void *userData, const XML_Char *name) { } } -void driParseOptionInfo (driOptionCache *info) { +void driParseOptionInfo (driOptionCache *info, + const char *configOptions, GLuint nConfigOptions) { XML_Parser p; int status; struct OptInfoData userData; struct OptInfoData *data = &userData; - GLuint nOptions; + GLuint realNoptions; /* determine hash table size and allocate memory */ GLuint size, log2size; - for (size = 1, log2size = 0; size < __driNConfigOptions*3/2; + for (size = 1, log2size = 0; size < nConfigOptions*3/2; size <<= 1, ++log2size); info->tableSize = log2size; info->info = CALLOC (size * sizeof (driOptionInfo)); @@ -537,21 +538,21 @@ void driParseOptionInfo (driOptionCache *info) { userData.inEnum = GL_FALSE; userData.curOption = -1; - status = XML_Parse (p, __driConfigOptions, strlen (__driConfigOptions), 1); + status = XML_Parse (p, configOptions, strlen (configOptions), 1); if (!status) XML_FATAL ("%s.", XML_ErrorString(XML_GetErrorCode(p))); XML_ParserFree (p); - /* Check if the actual number of options matches __driNConfigOptions. + /* Check if the actual number of options matches nConfigOptions. * A mismatch is not fatal (a hash table overflow would be) but we * want the driver developer's attention anyway. */ - nOptions = countOptions (info); - if (nOptions != __driNConfigOptions) { + realNoptions = countOptions (info); + if (realNoptions != nConfigOptions) { fprintf (stderr, - "Error: __driNConfigOptions (%u) does not match the actual number of options in\n" + "Error: nConfigOptions (%u) does not match the actual number of options in\n" " __driConfigOptions (%u).\n", - __driNConfigOptions, nOptions); + nConfigOptions, realNoptions); } } diff --git a/src/mesa/drivers/dri/common/xmlconfig.h b/src/mesa/drivers/dri/common/xmlconfig.h index 710e328e015..b636349b1f4 100644 --- a/src/mesa/drivers/dri/common/xmlconfig.h +++ b/src/mesa/drivers/dri/common/xmlconfig.h @@ -81,21 +81,20 @@ typedef struct driOptionCache { * The value is the same in the screen and all contexts. */ } driOptionCache; -/** \brief XML document describing available options +/** \brief Parse XML option info from configOptions * - * This must be defined in a driver-specific soure file. xmlpool.h - * defines helper macros and common options. */ -extern const char __driConfigOptions[]; -/** \brief The number of options supported by a driver + * To be called in <driver>CreateScreen * - * This is used to choose an appropriate hash table size. So any value - * larger than the actual number of options will work. */ -extern const GLuint __driNConfigOptions; - -/** \brief Parse XML option info from __driConfigOptions + * \param info pointer to a driOptionCache that will store the option info + * \param configOptions XML document describing available configuration opts + * \param nConfigOptions number of options, used to choose a hash table size * - * To be called in <driver>CreateScreen */ -void driParseOptionInfo (driOptionCache *info); + * For the option information to be available to external configuration tools + * it must be a public symbol __driConfigOptions. It is also passed as a + * parameter to driParseOptionInfo in order to avoid driver-independent code + * depending on symbols in driver-specific code. */ +void driParseOptionInfo (driOptionCache *info, + const char *configOptions, GLuint nConfigOptions); /** \brief Initialize option cache from info and parse configuration files * * To be called in <driver>CreateContext. screenNum and driverName select diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 75a6c32b574..7f199ea5c41 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -73,7 +73,7 @@ DRI_CONF_BEGIN DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER) DRI_CONF_SECTION_END DRI_CONF_END; -const GLuint __driNConfigOptions = 3; +static const GLuint __driNConfigOptions = 3; #ifndef MGA_DEBUG int MGA_DEBUG = 0; @@ -241,7 +241,8 @@ mgaInitDriver(__DRIscreenPrivate *sPriv) mgaScreen->sarea_priv_offset = serverInfo->sarea_priv_offset; /* parse information in __driConfigOptions */ - driParseOptionInfo (&mgaScreen->optionCache); + driParseOptionInfo (&mgaScreen->optionCache, + __driConfigOptions, __driNConfigOptions); return GL_TRUE; } diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index a26c9dd3401..73547aa67f7 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -59,30 +59,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vblank.h" #include "utils.h" #include "texmem.h" - -/* R128 configuration - */ -#include "xmlpool.h" - -const char __driConfigOptions[] = -DRI_CONF_BEGIN - DRI_CONF_SECTION_PERFORMANCE - DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0) - DRI_CONF_SECTION_END - DRI_CONF_SECTION_QUALITY - DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB) - DRI_CONF_SECTION_END -#if ENABLE_PERF_BOXES - DRI_CONF_SECTION_DEBUG - DRI_CONF_PERFORMANCE_BOXES(false) - DRI_CONF_SECTION_END -#endif -DRI_CONF_END; -#if ENABLE_PERF_BOXES -const GLuint __driNConfigOptions = 3; -#else -const GLuint __driNConfigOptions = 2; -#endif +#include "xmlpool.h" /* for symbolic values of enum-type options */ #ifndef R128_DEBUG int R128_DEBUG = 0; diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index 8eee8bbe068..ac8f185a457 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -50,6 +50,30 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "glxextensions.h" #endif +/* R128 configuration + */ +#include "xmlpool.h" + +const char __driConfigOptions[] = +DRI_CONF_BEGIN + DRI_CONF_SECTION_PERFORMANCE + DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0) + DRI_CONF_SECTION_END + DRI_CONF_SECTION_QUALITY + DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB) + DRI_CONF_SECTION_END +#if ENABLE_PERF_BOXES + DRI_CONF_SECTION_DEBUG + DRI_CONF_PERFORMANCE_BOXES(false) + DRI_CONF_SECTION_END +#endif +DRI_CONF_END; +#if ENABLE_PERF_BOXES +static const GLuint __driNConfigOptions = 3; +#else +static const GLuint __driNConfigOptions = 2; +#endif + #if 1 /* Including xf86PciInfo.h introduces a bunch of errors... */ @@ -80,7 +104,8 @@ r128CreateScreen( __DRIscreenPrivate *sPriv ) if ( !r128Screen ) return NULL; /* parse information in __driConfigOptions */ - driParseOptionInfo (&r128Screen->optionCache); + driParseOptionInfo (&r128Screen->optionCache, + __driConfigOptions, __driNConfigOptions); /* This is first since which regions we map depends on whether or * not we are using a PCI card. diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 5ab6b781cb0..08bea796ccc 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -64,35 +64,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vblank.h" #include "utils.h" +#include "xmlpool.h" /* for symbolic values of enum-type options */ #ifndef R200_DEBUG int R200_DEBUG = (0); #endif -/* R200 configuration - */ -#include "xmlpool.h" - -const char __driConfigOptions[] = -DRI_CONF_BEGIN - DRI_CONF_SECTION_PERFORMANCE - DRI_CONF_TCL_MODE(DRI_CONF_TCL_CODEGEN) - DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS) - DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0) - DRI_CONF_SECTION_END - DRI_CONF_SECTION_QUALITY - DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB) - DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER) - DRI_CONF_ROUND_MODE(DRI_CONF_ROUND_TRUNC) - DRI_CONF_DITHER_MODE(DRI_CONF_DITHER_XERRORDIFF) - DRI_CONF_SECTION_END - DRI_CONF_SECTION_DEBUG - DRI_CONF_NO_RAST(false) - DRI_CONF_SECTION_END -DRI_CONF_END; -const GLuint __driNConfigOptions = 8; - - /* Return the width and height of the given buffer. */ static void r200GetBufferSize( GLframebuffer *buffer, diff --git a/src/mesa/drivers/dri/r200/r200_screen.c b/src/mesa/drivers/dri/r200/r200_screen.c index fe246686a01..a79ac71d42b 100644 --- a/src/mesa/drivers/dri/r200/r200_screen.c +++ b/src/mesa/drivers/dri/r200/r200_screen.c @@ -50,6 +50,30 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef _SOLO #include "glxextensions.h" #endif + +/* R200 configuration + */ +#include "xmlpool.h" + +const char __driConfigOptions[] = +DRI_CONF_BEGIN + DRI_CONF_SECTION_PERFORMANCE + DRI_CONF_TCL_MODE(DRI_CONF_TCL_CODEGEN) + DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS) + DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0) + DRI_CONF_SECTION_END + DRI_CONF_SECTION_QUALITY + DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB) + DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER) + DRI_CONF_ROUND_MODE(DRI_CONF_ROUND_TRUNC) + DRI_CONF_DITHER_MODE(DRI_CONF_DITHER_XERRORDIFF) + DRI_CONF_SECTION_END + DRI_CONF_SECTION_DEBUG + DRI_CONF_NO_RAST(false) + DRI_CONF_SECTION_END +DRI_CONF_END; +static const GLuint __driNConfigOptions = 8; + #if 1 /* Including xf86PciInfo.h introduces a bunch of errors... */ @@ -109,7 +133,8 @@ r200CreateScreen( __DRIscreenPrivate *sPriv ) } /* parse information in __driConfigOptions */ - driParseOptionInfo (&screen->optionCache); + driParseOptionInfo (&screen->optionCache, + __driConfigOptions, __driNConfigOptions); /* This is first since which regions we map depends on whether or * not we are using a PCI card. diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index f2af26c6b6e..3a9721540be 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -64,34 +64,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vblank.h" #include "utils.h" +#include "xmlpool.h" /* for symbolic values of enum-type options */ #ifndef RADEON_DEBUG int RADEON_DEBUG = (0); #endif -/* Radeon configuration - */ -#include "xmlpool.h" - -const char __driConfigOptions[] = -DRI_CONF_BEGIN - DRI_CONF_SECTION_PERFORMANCE - DRI_CONF_TCL_MODE(DRI_CONF_TCL_CODEGEN) - DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS) - DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0) - DRI_CONF_SECTION_END - DRI_CONF_SECTION_QUALITY - DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB) - DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER) - DRI_CONF_ROUND_MODE(DRI_CONF_ROUND_TRUNC) - DRI_CONF_DITHER_MODE(DRI_CONF_DITHER_XERRORDIFF) - DRI_CONF_SECTION_END - DRI_CONF_SECTION_DEBUG - DRI_CONF_NO_RAST(false) - DRI_CONF_SECTION_END -DRI_CONF_END; -const GLuint __driNConfigOptions = 8; - /* Return the width and height of the given buffer. */ static void radeonGetBufferSize( GLframebuffer *buffer, diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 3bb709019f0..edd7c0f34e4 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -50,6 +50,29 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "glxextensions.h" #endif +/* Radeon configuration + */ +#include "xmlpool.h" + +const char __driConfigOptions[] = +DRI_CONF_BEGIN + DRI_CONF_SECTION_PERFORMANCE + DRI_CONF_TCL_MODE(DRI_CONF_TCL_CODEGEN) + DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS) + DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0) + DRI_CONF_SECTION_END + DRI_CONF_SECTION_QUALITY + DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB) + DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER) + DRI_CONF_ROUND_MODE(DRI_CONF_ROUND_TRUNC) + DRI_CONF_DITHER_MODE(DRI_CONF_DITHER_XERRORDIFF) + DRI_CONF_SECTION_END + DRI_CONF_SECTION_DEBUG + DRI_CONF_NO_RAST(false) + DRI_CONF_SECTION_END +DRI_CONF_END; +static const GLuint __driNConfigOptions = 8; + #if 1 /* Including xf86PciInfo.h introduces a bunch of errors... */ @@ -91,7 +114,8 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ) } /* parse information in __driConfigOptions */ - driParseOptionInfo (&screen->optionCache); + driParseOptionInfo (&screen->optionCache, + __driConfigOptions, __driNConfigOptions); /* This is first since which regions we map depends on whether or * not we are using a PCI card. diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c index 6aa61944086..7daa947a464 100644 --- a/src/mesa/drivers/dri/sis/sis_context.c +++ b/src/mesa/drivers/dri/sis/sis_context.c @@ -59,21 +59,6 @@ int GlobalCurrentHwcx = -1; int GlobalHwcxCountBase = 1; int GlobalCmdQueueLen = 0; -#include "xmlpool.h" - -const char __driConfigOptions[] = -DRI_CONF_BEGIN - DRI_CONF_SECTION_DEBUG - DRI_CONF_OPT_BEGIN(agp_disable,bool,false) - DRI_CONF_DESC(en,"Disable AGP vertex dispatch") - DRI_CONF_OPT_END - DRI_CONF_OPT_BEGIN(fallback_force,bool,false) - DRI_CONF_DESC(en,"Force software fallback") - DRI_CONF_OPT_END - DRI_CONF_SECTION_END -DRI_CONF_END; -const GLuint __driNConfigOptions = 2; - static const char * const card_extensions[] = { "GL_ARB_multitexture", diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index f1a51039d29..1d78801442d 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -39,6 +39,21 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_dri.h" #include "sis_lock.h" +#include "xmlpool.h" + +const char __driConfigOptions[] = +DRI_CONF_BEGIN + DRI_CONF_SECTION_DEBUG + DRI_CONF_OPT_BEGIN(agp_disable,bool,false) + DRI_CONF_DESC(en,"Disable AGP vertex dispatch") + DRI_CONF_OPT_END + DRI_CONF_OPT_BEGIN(fallback_force,bool,false) + DRI_CONF_DESC(en,"Force software fallback") + DRI_CONF_OPT_END + DRI_CONF_SECTION_END +DRI_CONF_END; +static const GLuint __driNConfigOptions = 2; + /* Create the device specific screen private data struct. */ static sisScreenPtr @@ -86,7 +101,8 @@ sisCreateScreen( __DRIscreenPrivate *sPriv ) sisScreen->driScreen = sPriv; /* parse information in __driConfigOptions */ - driParseOptionInfo(&sisScreen->optionCache); + driParseOptionInfo(&sisScreen->optionCache, + __driConfigOptions, __driNConfigOptions); return sisScreen; } |