mesa/src
Kenneth Graunke 0efb7fb803 i965: Fix brw_render_cache_set_check_flush's PIPE_CONTROLs.
Our driver uses the brw_render_cache mechanism to track buffers we've
rendered to and are about to sample from.

Previously, we did a single PIPE_CONTROL with the following bits set:
- Render Target Flush
- Depth Cache Flush
- Texture Cache Invalidate
- VF Cache Invalidate
- Instruction Cache Invalidate
- CS Stall

This combined both "top of pipe" invalidations and "bottom of pipe"
flushes, which isn't how the hardware is intended to be programmed.

The "top of pipe" invalidations may happen right away, without any
guarantees that rendering using those caches has completed.  That
rendering may continue altering the caches.  The "bottom of pipe"
flushes do wait for the rendering to complete.  The CS stall also
prevents further work from happening until data is flushed out.

What we wanted to do was wait for rendering complete, flush the new
data out of the render and depth caches, wait, then invalidate any
stale data in read-only caches.  We can accomplish this by doing the
"bottom of pipe" flushes with a CS stall, then the "top of pipe"
flushes as a second PIPE_CONTROL.  The flushes will wait until the
rendering is complete, and the CS stall will prevent the second
PIPE_CONTROL with the invalidations from executing until the first
is done.

Fixes dEQP-GLES3.functional.texture.specification.teximage2d_pbo
subtests on Braswell and Skylake.  These tests hit the meta PBO
texture upload path, which binds the PBO as a texture and samples
from it, while rendering to the destination texture.  The tests
then sample from the texture.

For now, we leave Gen4-5 alone.  It probably needs work too, but
apparently it hasn't even been setting the (G45+) TC invalidation
bit at all...

v2: Add Sandybridge post-sync non-zero workaround, for safety.

Cc: mesa-stable@lists.freedesktop.org
Suggested-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit 72473658c5)
2016-03-29 12:15:01 +01:00
..
compiler glsl: avoid stack smashing when there are too many attributes 2016-03-12 01:17:20 +00:00
egl egl: support EGL_LARGEST_PBUFFER in eglCreatePbufferSurface(...) 2016-03-29 11:35:50 +01:00
gallium nvc0: disable primitive restart and index bias during blits 2016-03-29 12:15:01 +01:00
gbm gbm.h: Add a missing stddef.h include for size_t. 2015-10-30 19:12:14 +00:00
getopt
glx glx: update to updated version of EXT_create_context_es2_profile 2016-02-03 15:44:51 -05:00
gtest mesa: Enable subdir-objects globally. 2015-06-26 12:55:25 +01:00
hgl
loader virtio_gpu: Add PCI ID to driver map 2016-01-23 12:35:24 +10:00
mapi mesa: move GL_ARB_debug_output code into new debug_output.c file 2016-02-08 09:29:38 -07:00
mesa i965: Fix brw_render_cache_set_check_flush's PIPE_CONTROLs. 2016-03-29 12:15:01 +01:00
util util: fix new gcc6 warnings 2016-02-18 17:10:55 -05:00
Makefile.am glsl: move to compiler/ 2016-01-26 16:08:33 +00:00
SConscript glsl: move to compiler/ 2016-01-26 16:08:33 +00:00