aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2005-10-19 03:23:29 +0000
committerEric Anholt <[email protected]>2005-10-19 03:23:29 +0000
commit2420318cd9d42e1dda43e9e6ffb0accae1ff6b02 (patch)
tree56100db0cab3f1325ee272236b5408a655163b86
parente0cb784e03530d2c806e74b3ac9b66021b5791ce (diff)
Make SiS a little more like other drivers: Add SIS_DEBUG (only option being
"fall" so far) and make the fallback_force option be no_rast like other drivers. Incidentally, makes no_rast not crash (though it still fails to render).
-rw-r--r--src/mesa/drivers/dri/sis/sis_context.c19
-rw-r--r--src/mesa/drivers/dri/sis/sis_context.h15
-rw-r--r--src/mesa/drivers/dri/sis/sis_screen.c4
-rw-r--r--src/mesa/drivers/dri/sis/sis_tris.c34
4 files changed, 63 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c
index 101b97b7b80..948f15a9414 100644
--- a/src/mesa/drivers/dri/sis/sis_context.c
+++ b/src/mesa/drivers/dri/sis/sis_context.c
@@ -61,6 +61,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define need_GL_ARB_multisample
#include "extension_helper.h"
+#ifndef SIS_DEBUG
+int SIS_DEBUG = 0;
+#endif
+
int GlobalCurrentHwcx = -1;
int GlobalHwcxCountBase = 1;
int GlobalCmdQueueLen = 0;
@@ -74,6 +78,12 @@ struct dri_extension card_extensions[] =
{ NULL, NULL }
};
+static const struct dri_debug_control debug_control[] =
+{
+ { "fall", DEBUG_FALLBACKS },
+ { NULL, 0 }
+};
+
void
WaitEngIdle (sisContextPtr smesa)
{
@@ -200,6 +210,10 @@ sisCreateContext( const __GLcontextModes *glVisual,
driParseConfigFiles (&smesa->optionCache, &sisScreen->optionCache,
sisScreen->driScreen->myNum, "sis");
+#if DO_DEBUG
+ SIS_DEBUG = driParseDebugString(getenv("SIS_DEBUG"), debug_control);
+#endif
+
/* TODO: index mode */
smesa->CurrentQueueLenPtr = &(smesa->sarea->QueueLength);
@@ -269,6 +283,11 @@ sisCreateContext( const __GLcontextModes *glVisual,
smesa->PrevTexFormat[i] = 0;
}
+ if (driQueryOptionb(&smesa->optionCache, "no_rast")) {
+ fprintf(stderr, "disabling 3D acceleration\n");
+ FALLBACK(smesa, SIS_FALLBACK_DISABLE, 1);
+ }
+
return GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/sis/sis_context.h b/src/mesa/drivers/dri/sis/sis_context.h
index 5ef1895362d..17d283995fc 100644
--- a/src/mesa/drivers/dri/sis/sis_context.h
+++ b/src/mesa/drivers/dri/sis/sis_context.h
@@ -65,7 +65,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SIS_FALLBACK_TEXENV1 0x0010
#define SIS_FALLBACK_DRAW_BUFFER 0x0020
#define SIS_FALLBACK_STENCIL 0x0040
-#define SIS_FALLBACK_FORCE 0x8000
+#define SIS_FALLBACK_DISABLE 0x0080
/* Flags for hardware state that needs to be updated */
#define GFLAG_ENABLESETTING 0x00000001
@@ -445,4 +445,17 @@ void WaitingFor3dIdle(sisContextPtr smesa, int wLen);
extern void sis_update_texture_state( sisContextPtr smesa );
extern void sis_update_render_state( sisContextPtr smesa );
+/* ================================================================
+ * Debugging:
+ */
+#define DO_DEBUG 1
+
+#if DO_DEBUG
+extern int SIS_DEBUG;
+#else
+#define SIS_DEBUG 0
#endif
+
+#define DEBUG_FALLBACKS 0x01
+
+#endif /* _sis_ctx_h_ */
diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c
index 362c8696e3a..d213cc406ce 100644
--- a/src/mesa/drivers/dri/sis/sis_screen.c
+++ b/src/mesa/drivers/dri/sis/sis_screen.c
@@ -52,9 +52,7 @@ DRI_CONF_BEGIN
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_NO_RAST(false)
DRI_CONF_SECTION_END
DRI_CONF_END;
static const GLuint __driNConfigOptions = 2;
diff --git a/src/mesa/drivers/dri/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c
index fb0fd1ac099..0c70f26b637 100644
--- a/src/mesa/drivers/dri/sis/sis_tris.c
+++ b/src/mesa/drivers/dri/sis/sis_tris.c
@@ -959,6 +959,27 @@ void sisFlushPrims(sisContextPtr smesa)
/* Transition to/from hardware rasterization. */
/**********************************************************************/
+static const char * const fallbackStrings[] = {
+ "Texture mode",
+ "Texture 0 mode",
+ "Texture 1 moder",
+ "Texture 0 env",
+ "Texture 1 env",
+ "glDrawBuffer(GL_FRONT_AND_BACK)",
+ "glEnable(GL_STENCIL) without hw stencil buffer",
+ "no_rast",
+};
+
+static const char *getFallbackString(GLuint bit)
+{
+ int i = 0;
+ while (bit > 1) {
+ i++;
+ bit >>= 1;
+ }
+ return fallbackStrings[i];
+}
+
void sisFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
@@ -971,6 +992,10 @@ void sisFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
SIS_FIREVERTICES(smesa);
_swsetup_Wakeup( ctx );
smesa->RenderIndex = ~0;
+ if (SIS_DEBUG & DEBUG_FALLBACKS) {
+ fprintf(stderr, "SiS begin rasterization fallback: 0x%x %s\n",
+ bit, getFallbackString(bit));
+ }
}
}
else {
@@ -993,6 +1018,10 @@ void sisFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
smesa->hw_viewport, 0 );
smesa->NewGLState |= _SIS_NEW_RENDER_STATE;
+ if (SIS_DEBUG & DEBUG_FALLBACKS) {
+ fprintf(stderr, "SiS end rasterization fallback: 0x%x %s\n",
+ bit, getFallbackString(bit));
+ }
}
}
}
@@ -1046,11 +1075,6 @@ void sisInitTriFuncs( GLcontext *ctx )
sis_vert_init_gwst0t1();
}
- if (driQueryOptionb(&smesa->optionCache, "fallback_force"))
- sisFallback(ctx, SIS_FALLBACK_FORCE, 1);
- else
- sisFallback(ctx, SIS_FALLBACK_FORCE, 0);
-
smesa->RenderIndex = ~0;
smesa->NewGLState |= _SIS_NEW_RENDER_STATE;