OSDN Git Service

intel: flush fake front buffer more robustly.
authorPaul Berry <stereotype441@gmail.com>
Wed, 29 May 2013 16:48:26 +0000 (09:48 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 7 Jun 2013 20:26:43 +0000 (13:26 -0700)
commit447df5eabac62d11740b23987cf91fb269bffcc6
tree6546a1077406f533d7d1bd63df9e7ad947f1bb81
parent03cc31031315059a80d12485a402ea2a8731dc8a
intel: flush fake front buffer more robustly.

When a fake front buffer is in use, if we request the front buffer
(using screen->dri2.loader->getBuffersWithFormat()), the X server
copies the real front buffer to the fake front buffer and returns the
fake front buffer.  We sometimes make redundant requests for the front
buffer (due to using a single counter to track invalidates for both
the front and back buffers), so there's a danger of pending front
buffer rendering getting overwritten when the redundant front buffer
request occurs.

Previous to this patch, intel_update_renderbuffers() worked around
that problem by sometimes doing intel_flush() and intel_flush_front()
before calling intel_query_dri2_buffers().  But it only did the
workaround when the front buffer was bound for drawing; it didn't do
it when the front buffer was bound for reading.

This patch moves the workaround code to intel_query_dri2_buffers(), so
that it happens in exactly the circumstances where it is needed.

This should fix some of the sporadic failures in Piglit tests
fbo-sys-blit and fbo-sys-sub-blit.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/intel/intel_context.c