i965: Disable access to CPU mmap for async access on non-LLC machines
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 20 Jun 2017 10:39:22 +0000 (11:39 +0100)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 10 Jul 2017 22:55:31 +0000 (15:55 -0700)
commitde4c2eaa627204ffa54160ab9ea0bd3aaf3732b2
tree6bce986e1052c2e08aa4debc3c55efe7b3912920
parentb532e3b4a2ce503224f2bf0e511812860a6c609f
i965: Disable access to CPU mmap for async access on non-LLC machines

If the user triggers an implicit batch flush while holding access to a
CPU mapped buffer, that mmapping will be invalidated by the kernel for
non-LLC devices. (The kernel when executing a batch will change the
cache domain of the buffers in that batch, which for non-LLC CPU access
will cause that buffer to be clflushed and any further CPU access to be
discarded.) To prevent this, simply disallow any CPU async mmap access.
The cases where async CPU access to a non-LLC buffer should continue to
be allowed via their preferred snooping path.

v2 (Ken): Reword the comment slightly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_bufmgr.c