radeon: simplify ZS buffer checking on r600
authorMarek Olšák <maraeo@gmail.com>
Sun, 29 Jul 2012 12:10:07 +0000 (14:10 +0200)
committerMarek Olšák <maraeo@gmail.com>
Thu, 9 Aug 2012 14:37:20 +0000 (16:37 +0200)
Setting those flags has no effect anywhere else.

Reviewed-by: Christian König <christian.koenig@amd.com>
radeon/radeon_surface.c

index c80f7f493268af28190ddc55d64d913f7920d0d5..5800c3345ca61c76f9cd3660bc03c046174987cf 100644 (file)
@@ -385,14 +385,7 @@ static int r6_surface_init(struct radeon_surface_manager *surf_man,
     /* tiling mode */
     mode = (surf->flags >> RADEON_SURF_MODE_SHIFT) & RADEON_SURF_MODE_MASK;
 
-    /* always enable z & stencil together */
-    if (surf->flags & RADEON_SURF_ZBUFFER) {
-        surf->flags |= RADEON_SURF_SBUFFER;
-    }
-    if (surf->flags & RADEON_SURF_SBUFFER) {
-        surf->flags |= RADEON_SURF_ZBUFFER;
-    }
-    if (surf->flags & RADEON_SURF_ZBUFFER) {
+    if (surf->flags & (RADEON_SURF_ZBUFFER | RADEON_SURF_SBUFFER)) {
         /* zbuffer only support 1D or 2D tiled surface */
         switch (mode) {
         case RADEON_SURF_MODE_1D: