]> Pileus Git - ~andy/linux/commit
drm/i915: Update rules for reading cache lines through the LLC
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 8 Aug 2013 13:41:03 +0000 (14:41 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sat, 10 Aug 2013 09:19:50 +0000 (11:19 +0200)
commitc76ce038e31a2b30bc3dd816f0aefaf685097a0a
tree1fe9c541f3b6f08e2f39677c5a4d5bb39ae8056d
parent5c536613d8ebda3da0448550d0a997651a6048e2
drm/i915: Update rules for reading cache lines through the LLC

The LLC is a fun device. The cache is a distinct functional block within
the SA that arbitrates access from both the CPU and GPU cores. As such
all writes to memory land first in the LLC before further action is
taken. For example, an uncached write from either the CPU or GPU will
then proceed to memory and evict the cacheline from the LLC. This means that
a read from the LLC always returns the correct information even if the PTE
bit in the GPU differs from the PAT bit in the CPU. For the older
snooping architecture on non-LLC, the fundamental principle still holds
except that some coordination is required between the CPU and GPU to
explicitly perform the snooping (which is handled by our request
tracking).

The upshot of this is that we know that we can issue a read from either
LLC devices or snoopable memory and trust the contents of the cache -
i.e. we can forgo a clflush before a read in these circumstances.
Writing to memory from the CPU is a little more tricky as we have to
consider that the scanout does not read from the CPU cache at all, but
from main memory. So we have to currently treat all requests to write to
uncached memory as having to be flushed to main memory for coherency
with all consumers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c