summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-05-13 12:20:32 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-05-13 12:20:32 +0200
commit84d5d5155c16d6673542ca0f4358c0247c001eb0 (patch)
treef0096be70a7883aed859431e24b9b312b27d7267
parent6ffcb173980674e5a63e95807f3d51c5a0e7fe5a (diff)
i915tex: SWZ cliprect handling improvements.
Before firing the SWZ batchbuffer, check that the cliprects still match the binning parameters and drop the batchbuffer if not. Also only allow ZONE_INIT to be emitted when there's at least one cliprect.
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_state_rasterizer.c3
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_buffers.c2
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_swz.c30
3 files changed, 28 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i915tex/i915_state_rasterizer.c b/src/mesa/drivers/dri/i915tex/i915_state_rasterizer.c
index e27d93e296..5ba8b2e7d7 100644
--- a/src/mesa/drivers/dri/i915tex/i915_state_rasterizer.c
+++ b/src/mesa/drivers/dri/i915tex/i915_state_rasterizer.c
@@ -64,7 +64,8 @@ static GLboolean check_swz( struct intel_context *intel )
* be fixed)
*/
if (intel->state.DrawBuffer == NULL ||
- intel->state.DrawBuffer->Name != 0)
+ intel->state.DrawBuffer->Name != 0 ||
+ intel->numClipRects > 1)
return GL_FALSE;
return GL_TRUE;
diff --git a/src/mesa/drivers/dri/i915tex/intel_buffers.c b/src/mesa/drivers/dri/i915tex/intel_buffers.c
index b2af3d0e6d..c9981440f0 100644
--- a/src/mesa/drivers/dri/i915tex/intel_buffers.c
+++ b/src/mesa/drivers/dri/i915tex/intel_buffers.c
@@ -335,7 +335,7 @@ intelWindowMoved(struct intel_context *intel)
}
/* Can ZONE_INIT primitives be used for clears with zone rendering? */
- intel_fb->may_use_zone_init = GL_TRUE;
+ intel_fb->may_use_zone_init = intel->numClipRects > 0;
for (i = 0; i < intel->numClipRects; i++) {
drm_clip_rect_t *pRect = &intel->pClipRects[i];
diff --git a/src/mesa/drivers/dri/i915tex/intel_swz.c b/src/mesa/drivers/dri/i915tex/intel_swz.c
index 1f394d3520..79c907e0e3 100644
--- a/src/mesa/drivers/dri/i915tex/intel_swz.c
+++ b/src/mesa/drivers/dri/i915tex/intel_swz.c
@@ -376,12 +376,32 @@ static void swz_flush( struct clip_render *render,
CM0_RC_OP_FLUSH_ENABLE |
CM0_DEPTH_WRITE_ENABLE) );
- WAIT_VBLANK(intel);
+ WAIT_VBLANK( intel );
+
+ LOCK_HARDWARE( intel );
+
+ if (intel->contended_lock)
+ UPDATE_CLIPRECTS( intel );
+
+ if (intel->contended_lock &&
+ (intel->numClipRects > 1 ||
+ swz->xoff != (intel->drawX % 64) ||
+ swz->yoff != (intel->drawY % 32) ||
+ swz->zone_width != (align(intel->driDrawable->w + swz->xoff,
+ ZONE_WIDTH) / ZONE_WIDTH) ||
+ swz->zone_height != (align(intel->driDrawable->h + swz->yoff,
+ ZONE_HEIGHT) / ZONE_HEIGHT))) {
+ intel_batchbuffer_unmap(intel->batch);
+ intel_batchbuffer_reset(intel->batch);
+ } else {
+ /* Tell the batchbuffer code about what we've emitted:
+ */
+ intel->batch->segment_finish_offset[0] = swz->pre_post.ptr -
+ intel->batch->map;
+ intel_batchbuffer_flush( intel->batch, !finished );
+ }
- /* Tell the batchbuffer code about what we've emitted:
- */
- intel->batch->segment_finish_offset[0] = swz->pre_post.ptr - intel->batch->map;
- intel_batchbuffer_flush( intel->batch, !finished );
+ UNLOCK_HARDWARE( intel );
}
memset(swz->zone, 0, sizeof(swz->zone));