[Mesa-dev] radeon/r200 clear() inconsistency

Brian Paul brianp at vmware.com
Fri Mar 9 06:33:11 PST 2012


I happened to be looking at radeonClear() and r200Clear() in the 
legacy DRI drivers.  I think there's a bug in one function or the 
other in the hyperz/fastclear test:

 From radeon_ioctl.c:

    if (rmesa->using_hyperz) {
       flags |= RADEON_USE_COMP_ZBUF;
/*      if (rmesa->radeon.radeonScreen->chipset & RADEON_CHIPSET_TCL)
          flags |= RADEON_USE_HIERZ; */
       if (((flags & RADEON_DEPTH) && (flags & RADEON_STENCIL) &&
	    ((rmesa->radeon.state.stencil.clear & RADEON_STENCIL_WRITE_MASK) 
== RADEON_STENCIL_WRITE_MASK))) {
	  flags |= RADEON_CLEAR_FASTZ;
       }
    }

 From r200_ioctl.c:

    if (rmesa->using_hyperz) {
       flags |= RADEON_USE_COMP_ZBUF;
/*      if (rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_R200)
	 flags |= RADEON_USE_HIERZ; */
       if (!((flags & RADEON_DEPTH) && (flags & RADEON_STENCIL) &&
	    ((rmesa->radeon.state.stencil.clear & R200_STENCIL_WRITE_MASK) == 
R200_STENCIL_WRITE_MASK))) {
	  flags |= RADEON_CLEAR_FASTZ;
       }
    }


Note that the later version has a '!' operator in the second 
if-statement that's not present in the former.  I suspect the ! should 
be removed.

Can someone familiar with this code take a look?

-Brian



More information about the mesa-dev mailing list