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 );
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 )