summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.c3
-rw-r--r--src/mesa/drivers/dri/r200/r200_state.c25
2 files changed, 17 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index e402b923ee..e8e7a42099 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -327,7 +327,8 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
rmesa->radeon.initialMaxAnisotropy = driQueryOptionf(&rmesa->radeon.optionCache,
"def_max_anisotropy");
- if ( driQueryOptionb( &rmesa->radeon.optionCache, "hyperz" ) ) {
+ if ( sPriv->drm_version.major == 1
+ && driQueryOptionb( &rmesa->radeon.optionCache, "hyperz" ) ) {
if ( sPriv->drm_version.minor < 13 )
fprintf( stderr, "DRM version 1.%d too old to support HyperZ, "
"disabling.\n", sPriv->drm_version.minor );
diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c
index f56da9082a..4d052e246e 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -767,26 +767,31 @@ static void r200PolygonOffset( GLcontext *ctx,
static void r200PolygonStipple( GLcontext *ctx, const GLubyte *mask )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint i;
+ GLint i;
+ BATCH_LOCALS(&rmesa->radeon);
drm_radeon_stipple_t stipple;
+ radeon_firevertices(&rmesa->radeon);
+
+ BEGIN_BATCH_NO_AUTOSTATE(35);
+
+ OUT_BATCH(CP_PACKET0(R200_RE_STIPPLE_ADDR, 0));
+ OUT_BATCH(0x00000000);
+
+ OUT_BATCH(CP_PACKET0_ONE(R200_RE_STIPPLE_DATA, 31));
+
/* Must flip pattern upside down.
*/
- for ( i = 0 ; i < 32 ; i++ ) {
- rmesa->state.stipple.mask[31 - i] = ((GLuint *) mask)[i];
+ for ( i = 31 ; i >= 0; i--) {
+ OUT_BATCH(((GLuint *) mask)[i]);
}
- /* TODO: push this into cmd mechanism
- */
- radeon_firevertices(&rmesa->radeon);
- LOCK_HARDWARE( &rmesa->radeon );
+ END_BATCH();
+
/* FIXME: Use window x,y offsets into stipple RAM.
*/
stipple.mask = rmesa->state.stipple.mask;
- drmCommandWrite( rmesa->radeon.dri.fd, DRM_RADEON_STIPPLE,
- &stipple, sizeof(stipple) );
- UNLOCK_HARDWARE( &rmesa->radeon );
}
static void r200PolygonMode( GLcontext *ctx, GLenum face, GLenum mode )