]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Flush the context object from the CPU caches upon switching
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 15 Jul 2012 11:34:22 +0000 (12:34 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 25 Jul 2012 08:39:57 +0000 (10:39 +0200)
commit71c062a7f05196bfd919c1935b183fb484f6dfc0
tree8e35bc0fb55b1ef69f53ed3f110fbaab4786b72e
parent1251deede30793280984e91984dc14e8e6d1e8e6
drm/i915: Flush the context object from the CPU caches upon switching

The issue is that we stale data in the CPU caches, when we come to
swap-out the object, the CPU may short-circuit the reads from those
cacheline and so corrupt the context object.

Secondary, leaving the context object as being marked in the CPU write
domain whilst on the GPU active list is a bad idea and will throw
warnings later.

Note: Thanks to calling set_to_gtt_domain with write = false and not
setting any gpu write domain when putting a context object onto the
active list (when we switch away from it) the set_to_gtt_domain call
won't block.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
[danvet: Added a note to the commit message and a comment in the code
to explain the clever non-blocking trick.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem_context.c