From: Kristian Høgsberg Date: Tue, 15 Jan 2008 15:23:15 +0000 (-0500) Subject: [i915] Prevent recursive batchbuffer flushing. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bb73cf9ec093d734cbed956d843ef6c2982141ef;p=mesa.git [i915] Prevent recursive batchbuffer flushing. Workaround for recursive batchbuffer flushing: If the window is moved, we can get into a case where we try to flush during a flush. What happens is that when we try to grab the lock for the first flush, we detect that the window moved which then causes another flush (from the intel_draw_buffer() call in intelUpdatePageFlipping()). To work around this we reset the batchbuffer tail pointer before trying to get the lock. This prevent the nested buffer flush, but a better fix would be to avoid that in the first place. --- diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index cff15d253de..d6cd4ca6c72 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -216,6 +216,17 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, used += 8; } + /* Workaround for recursive batchbuffer flushing: If the window is + * moved, we can get into a case where we try to flush during a + * flush. What happens is that when we try to grab the lock for + * the first flush, we detect that the window moved which then + * causes another flush (from the intel_draw_buffer() call in + * intelUpdatePageFlipping()). To work around this we reset the + * batchbuffer tail pointer before trying to get the lock. This + * prevent the nested buffer flush, but a better fix would be to + * avoid that in the first place. */ + batch->ptr = batch->map; + /* TODO: Just pass the relocation list and dma buffer up to the * kernel. */