radeon: add some tiling support for r100.
authorDave Airlie <airlied@redhat.com>
Mon, 5 Dec 2011 15:41:24 +0000 (15:41 +0000)
committerDave Airlie <airlied@redhat.com>
Mon, 5 Dec 2011 15:41:24 +0000 (15:41 +0000)
This sets up the tiling flags on the blitter.

Fixes some piglit tests with tiling enabled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/drivers/dri/radeon/radeon_blit.c
src/mesa/drivers/dri/radeon/radeon_state_init.c

index b84f2fa9f2b9bb7851310896471b6bc77b129b28..4233221165fc182a84d461c010903c381abbeff1 100644 (file)
@@ -139,6 +139,11 @@ static void inline emit_tx_setup(struct r100_context *r100,
     default:
            break;
     }
+    
+    if (bo->flags & RADEON_BO_FLAGS_MACRO_TILE)
+       offset |= RADEON_TXO_MACRO_TILE;
+    if (bo->flags & RADEON_BO_FLAGS_MICRO_TILE)
+       offset |= RADEON_TXO_MICRO_TILE_X2;
 
     BEGIN_BATCH(18);
     OUT_BATCH_REGVAL(RADEON_PP_CNTL, RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE);
@@ -203,6 +208,12 @@ static inline void emit_cb_setup(struct r100_context *r100,
            break;
     }
 
+    if (bo->flags & RADEON_BO_FLAGS_MACRO_TILE)
+        dst_pitch |= RADEON_COLOR_TILE_ENABLE;
+
+    if (bo->flags & RADEON_BO_FLAGS_MICRO_TILE)
+        dst_pitch |= RADEON_COLOR_MICROTILE_ENABLE;
+
     BEGIN_BATCH_NO_AUTOSTATE(18);
     OUT_BATCH_REGVAL(RADEON_RE_TOP_LEFT, 0);
     OUT_BATCH_REGVAL(RADEON_RE_WIDTH_HEIGHT, ((width << RADEON_RE_WIDTH_SHIFT) |
index eb31fe895cfaa86a5aecb5e8ff08cb6c4a026439..8edba6ec9decc90f940b0ca92355c14fe229b523 100644 (file)
@@ -351,6 +351,8 @@ static void ctx_emit_cs(struct gl_context *ctx, struct radeon_state_atom *atom)
    cbpitch = (rrb->pitch / rrb->cpp);
    if (rrb->bo->flags & RADEON_BO_FLAGS_MACRO_TILE)
        cbpitch |= R200_COLOR_TILE_ENABLE;
+   if (rrb->bo->flags & RADEON_BO_FLAGS_MICRO_TILE)
+       cbpitch |= RADEON_COLOR_MICROTILE_ENABLE;
 
    drb = radeon_get_depthbuffer(&r100->radeon);
    if (drb) {