OSDN Git Service

i965: Fix remaining flush vs invalidate race conditions in brw_emit_pipe_control_flush.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 1 Jul 2016 00:49:18 +0000 (17:49 -0700)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 21 Jul 2016 10:54:41 +0000 (11:54 +0100)
commit04584d58357f6a89581367ea57c8ac65e4e63245
tree1567959c53b1258775f1072dfb1bd8141efbbb41
parent2035ac24ce3a60741993156462f156cad64daf67
i965: Fix remaining flush vs invalidate race conditions in brw_emit_pipe_control_flush.

This hardware race condition has caused problems several times already
(see "i965: Fix cache pollution race during L3 partitioning set-up.",
"i965: Fix brw_render_cache_set_check_flush's PIPE_CONTROLs." and
"i965: intel_texture_barrier reimplemented").  The problem is that
whenever we attempt to both flush and invalidate multiple caches with
a single pipe control command the flush and invalidation happen in
reverse order, so the contents flushed from the R/W caches aren't
guaranteed to become visible from the invalidated caches after the
PIPE_CONTROL command completes execution if some concurrent rendering
workload happened to pollute any of the invalidated R/O caches in the
short window of time between the invalidation and flush.

This makes sure that brw_emit_pipe_control_flush() has the effect
expected by most callers of making the contents flushed from any R/W
caches visible from the invalidated R/O caches.

Cc: "12.0 11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 37b901003b7bb0c0b003550b1255b42b4fc68695)
src/mesa/drivers/dri/i965/brw_pipe_control.c
src/mesa/drivers/dri/i965/intel_reg.h