diff options
author | Dave Airlie <airlied@redhat.com> | 2011-12-05 15:41:24 +0000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-12-05 15:41:24 +0000 |
commit | 5c666bdfdb7681c2250b801ff286c4837ea36893 (patch) | |
tree | 7d0b8a346dfebd04b90b2ec39dfbe5c995e2c02a | |
parent | b2596c36c8f73e8bb7a0b1679b491662aeb2f9d9 (diff) |
radeon: add some tiling support for r100.
This sets up the tiling flags on the blitter.
Fixes some piglit tests with tiling enabled.
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_blit.c | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_state_init.c | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.c b/src/mesa/drivers/dri/radeon/radeon_blit.c index b84f2fa9f2b..4233221165f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_blit.c +++ b/src/mesa/drivers/dri/radeon/radeon_blit.c | |||
@@ -139,6 +139,11 @@ static void inline emit_tx_setup(struct r100_context *r100, | |||
139 | default: | 139 | default: |
140 | break; | 140 | break; |
141 | } | 141 | } |
142 | |||
143 | if (bo->flags & RADEON_BO_FLAGS_MACRO_TILE) | ||
144 | offset |= RADEON_TXO_MACRO_TILE; | ||
145 | if (bo->flags & RADEON_BO_FLAGS_MICRO_TILE) | ||
146 | offset |= RADEON_TXO_MICRO_TILE_X2; | ||
142 | 147 | ||
143 | BEGIN_BATCH(18); | 148 | BEGIN_BATCH(18); |
144 | OUT_BATCH_REGVAL(RADEON_PP_CNTL, RADEON_TEX_0_ENABLE | RADEON_TEX_BLEND_0_ENABLE); | 149 | 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, | |||
203 | break; | 208 | break; |
204 | } | 209 | } |
205 | 210 | ||
211 | if (bo->flags & RADEON_BO_FLAGS_MACRO_TILE) | ||
212 | dst_pitch |= RADEON_COLOR_TILE_ENABLE; | ||
213 | |||
214 | if (bo->flags & RADEON_BO_FLAGS_MICRO_TILE) | ||
215 | dst_pitch |= RADEON_COLOR_MICROTILE_ENABLE; | ||
216 | |||
206 | BEGIN_BATCH_NO_AUTOSTATE(18); | 217 | BEGIN_BATCH_NO_AUTOSTATE(18); |
207 | OUT_BATCH_REGVAL(RADEON_RE_TOP_LEFT, 0); | 218 | OUT_BATCH_REGVAL(RADEON_RE_TOP_LEFT, 0); |
208 | OUT_BATCH_REGVAL(RADEON_RE_WIDTH_HEIGHT, ((width << RADEON_RE_WIDTH_SHIFT) | | 219 | OUT_BATCH_REGVAL(RADEON_RE_WIDTH_HEIGHT, ((width << RADEON_RE_WIDTH_SHIFT) | |
diff --git a/src/mesa/drivers/dri/radeon/radeon_state_init.c b/src/mesa/drivers/dri/radeon/radeon_state_init.c index eb31fe895cf..8edba6ec9de 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state_init.c +++ b/src/mesa/drivers/dri/radeon/radeon_state_init.c | |||
@@ -351,6 +351,8 @@ static void ctx_emit_cs(struct gl_context *ctx, struct radeon_state_atom *atom) | |||
351 | cbpitch = (rrb->pitch / rrb->cpp); | 351 | cbpitch = (rrb->pitch / rrb->cpp); |
352 | if (rrb->bo->flags & RADEON_BO_FLAGS_MACRO_TILE) | 352 | if (rrb->bo->flags & RADEON_BO_FLAGS_MACRO_TILE) |
353 | cbpitch |= R200_COLOR_TILE_ENABLE; | 353 | cbpitch |= R200_COLOR_TILE_ENABLE; |
354 | if (rrb->bo->flags & RADEON_BO_FLAGS_MICRO_TILE) | ||
355 | cbpitch |= RADEON_COLOR_MICROTILE_ENABLE; | ||
354 | 356 | ||
355 | drb = radeon_get_depthbuffer(&r100->radeon); | 357 | drb = radeon_get_depthbuffer(&r100->radeon); |
356 | if (drb) { | 358 | if (drb) { |