From: Pauli Nieminen Date: Fri, 28 Aug 2009 01:12:17 +0000 (+0300) Subject: r200: Fix piglit paths test. X-Git-Tag: android-x86-1.6~16^2~632 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e541845959761e9f47d14ade6b58a32db04ef7e4;p=android-x86%2Fexternal-mesa.git r200: Fix piglit paths test. Polygon stipple has to go to command buffer because special ioctl is disabled. Piglit doesn't like HyperZ warning so disable it for kms. --- diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index e402b923ee6..e8e7a42099b 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 f56da9082a5..4d052e246e9 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 )