supported so far.
#include "dri_util.h"
#include "mtypes.h"
+#include "xmlconfig.h"
+
typedef struct {
drm_handle_t handle;
drmSize size;
drmBufMapPtr bufs;
int use_copy_buf;
unsigned int sarea_priv_offset;
+
+ /* Configuration cache with default values for all contexts */
+ driOptionCache optionCache;
} savageScreenPrivate;
#include "savagedma.h"
+#include "xmlpool.h"
+
+/* Configuration
+ */
+const char __driConfigOptions[] =
+DRI_CONF_BEGIN
+ DRI_CONF_SECTION_QUALITY
+ DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB)
+ DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER)
+ DRI_CONF_SECTION_END
+ DRI_CONF_SECTION_PERFORMANCE
+ DRI_CONF_MAX_TEXTURE_UNITS(2,1,2)
+ DRI_CONF_SECTION_END
+DRI_CONF_END;
+static const GLuint __driNConfigOptions = 3;
+
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /* USE_NEW_INTERFACE */
return GL_FALSE;
}
+ /* parse information in __driConfigOptions */
+ driParseOptionInfo (&savageScreen->optionCache,
+ __driConfigOptions, __driNConfigOptions);
+
#if 0
savageDDFastPathInit();
savageDDTrifuncInit();
{
savageScreenPrivate *savageScreen = (savageScreenPrivate *)sPriv->private;
-
+ /* free all option information */
+ driDestroyOptionInfo (&savageScreen->optionCache);
+
Xfree(savageScreen);
sPriv->private = NULL;
}
}
driContextPriv->driverPrivate = imesa;
+ /* Parse configuration files */
+ driParseConfigFiles (&imesa->optionCache, &savageScreen->optionCache,
+ sPriv->myNum, "savage");
+
+ imesa->texture_depth = driQueryOptioni (&imesa->optionCache,
+ "texture_depth");
+ if (imesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
+ imesa->texture_depth = ( savageScreen->cpp == 4 ) ?
+ DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16;
+
if (savageScreen->chipset >= S3_SAVAGE4)
ctx->Const.MaxTextureUnits = 2;
else
ctx->Const.MaxTextureUnits = 1;
+ if (driQueryOptioni(&imesa->optionCache, "texture_units") <
+ ctx->Const.MaxTextureUnits)
+ ctx->Const.MaxTextureUnits =
+ driQueryOptioni(&imesa->optionCache, "texture_units");
ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
#include "savagetex.h"
#include "savagedma.h"
+#include "xmlconfig.h"
+
/* Reasons to fallback on all primitives.
*/
#define SAVAGE_FALLBACK_TEXTURE 0x1
volatile GLuint *eventTag1;
GLuint shadowCounter;
GLboolean shadowStatus;
+
+ /* Configuration cache
+ */
+ driOptionCache optionCache;
+ int texture_depth;
};
#define SAVAGE_CONTEXT(ctx) ((savageContextPtr)(ctx->DriverCtx))
#include "tnl/tnl.h"
#include "swrast_setup/swrast_setup.h"
+#include "xmlpool.h"
+
static void savageBlendFunc_s4(GLcontext *);
static void savageBlendFunc_s3d(GLcontext *);
imesa->regs.s4.drawLocalCtrl.ni.flushPdDestWrites= GL_TRUE;
imesa->regs.s4.drawLocalCtrl.ni.zUpdateEn= GL_TRUE;
- imesa->regs.s4.drawCtrl1.ni.ditherEn=GL_TRUE;
+ imesa->regs.s4.drawCtrl1.ni.ditherEn = (
+ driQueryOptioni(&imesa->optionCache, "color_reduction") ==
+ DRI_CONF_COLOR_REDUCTION_DITHER) ? GL_TRUE : GL_FALSE;
imesa->regs.s4.drawCtrl1.ni.cullMode = BCM_None;
imesa->regs.s4.zBufCtrl.ni.stencilRefVal = 0x00;
imesa->regs.s3d.drawCtrl.ni.flushPdZbufWrites = GL_TRUE;
imesa->regs.s3d.drawCtrl.ni.flushPdDestWrites = GL_TRUE;
- imesa->regs.s3d.drawCtrl.ni.ditherEn = GL_TRUE;
+ imesa->regs.s3d.drawCtrl.ni.ditherEn = (
+ driQueryOptioni(&imesa->optionCache, "color_reduction") ==
+ DRI_CONF_COLOR_REDUCTION_DITHER) ? GL_TRUE : GL_FALSE;
imesa->regs.s3d.drawCtrl.ni.cullMode = BCM_None;
imesa->LcsCullMode = BCM_None;
#include "swrast/swrast.h"
+#include "xmlpool.h"
+
/* Size 1, 2 and 4 images are packed into the last subtile. Each image
* is repeated to fill a 4x4 pixel area. The figure below shows the
* layout of those 4x4 pixel areas in the 8x8 subtile.
GLenum format, GLenum type )
{
savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
- const GLboolean do32bpt = GL_FALSE;
- const GLboolean force16bpt = GL_FALSE;
+ const GLboolean do32bpt =
+ ( imesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_32 );
+ const GLboolean force16bpt =
+ ( imesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FORCE_16 );
const GLboolean isSavage4 = (imesa->savageScreen->chipset >= S3_SAVAGE4);
(void) format;
(void) type;