r200: Fix piglit paths test.
authorPauli Nieminen <suokkos@gmail.com>
Fri, 28 Aug 2009 01:12:17 +0000 (04:12 +0300)
committerPauli Nieminen <suokkos@gmail.com>
Fri, 28 Aug 2009 01:13:01 +0000 (04:13 +0300)
Polygon stipple has to go to command buffer because special ioctl is disabled.
Piglit doesn't like HyperZ warning so disable it for kms.

src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/r200/r200_state.c

index e402b923ee6990070bbaa1244735e1f03a244057..e8e7a42099b0f6163726caa4a7f7591a18aa149b 100644 (file)
@@ -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 );
index f56da9082a501dd9d92bc57553adb5125d321ecf..4d052e246e991c843a094ed29bb1a8047c742f66 100644 (file)
@@ -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 )