diff --git a/src/mesa/drivers/dri/i915/intel_batchbuffer.c b/src/mesa/drivers/dri/i915/intel_batchbuffer.c index c546d84e7b6..7cf4868fa10 100644 --- a/src/mesa/drivers/dri/i915/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i915/intel_batchbuffer.c @@ -134,7 +134,8 @@ void intel_batchbuffer_free( struct intel_batchbuffer *batch ) */ static void do_flush_locked( struct intel_batchbuffer *batch, GLuint used, - GLboolean ignore_cliprects) + GLboolean ignore_cliprects, + GLboolean allow_unlock) { GLuint *ptr; GLuint i; @@ -169,7 +170,8 @@ static void do_flush_locked( struct intel_batchbuffer *batch, intel_batch_ioctl(batch->intel, batch->offset[0], used, - ignore_cliprects); + ignore_cliprects, + allow_unlock); #endif batch->last_fence = bmFenceBufferList(batch->bm, batch->list); } @@ -211,11 +213,11 @@ GLuint intel_batchbuffer_flush( struct intel_batchbuffer *batch ) assert(!(batch->flags & INTEL_BATCH_NO_CLIPRECTS)); LOCK_HARDWARE(intel); - do_flush_locked(batch, used, GL_FALSE); + do_flush_locked(batch, used, GL_FALSE, GL_TRUE); UNLOCK_HARDWARE(intel); } else { - do_flush_locked(batch, used, !(batch->flags & INTEL_BATCH_CLIPRECTS)); + do_flush_locked(batch, used, !(batch->flags & INTEL_BATCH_CLIPRECTS), GL_FALSE); } /* Reset the buffer: diff --git a/src/mesa/drivers/dri/i915/intel_ioctl.c b/src/mesa/drivers/dri/i915/intel_ioctl.c index f9d9f466d82..dd8b0ecd638 100644 --- a/src/mesa/drivers/dri/i915/intel_ioctl.c +++ b/src/mesa/drivers/dri/i915/intel_ioctl.c @@ -91,7 +91,8 @@ void intelWaitIrq( struct intel_context *intel, int seq ) void intel_batch_ioctl( struct intel_context *intel, GLuint start_offset, GLuint used, - GLboolean ignore_cliprects) + GLboolean ignore_cliprects, + GLboolean allow_unlock) { drmI830BatchBuffer batch; @@ -111,6 +112,11 @@ void intel_batch_ioctl( struct intel_context *intel, * single buffer. */ if (intel->numClipRects == 0 && !ignore_cliprects) { + if (allow_unlock) { + UNLOCK_HARDWARE(intel); + sched_yield(); + LOCK_HARDWARE(intel); + } intel->vtbl.lost_hardware( intel ); return; } diff --git a/src/mesa/drivers/dri/i915/intel_ioctl.h b/src/mesa/drivers/dri/i915/intel_ioctl.h index 955681774b5..cfc4fa56fe9 100644 --- a/src/mesa/drivers/dri/i915/intel_ioctl.h +++ b/src/mesa/drivers/dri/i915/intel_ioctl.h @@ -36,7 +36,8 @@ int intelEmitIrqLocked( struct intel_context *intel ); void intel_batch_ioctl( struct intel_context *intel, GLuint start_offset, GLuint used, - GLboolean ignore_cliprects); + GLboolean ignore_cliprects, + GLboolean allow_unlock); #endif