drm/i915: Only insert the mb() before updating the fence parameter
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 9 Oct 2012 18:24:37 +0000 (19:24 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 20 Jan 2013 12:11:16 +0000 (13:11 +0100)
commitd0a57789d5ec807fc218151b2fb2de4da30fbef5
tree7725177c02c17a8df63ac146322b5d80411e60c7
parent1f83fee08d625f8d0130f9fe5ef7b17c2e022f3c
drm/i915: Only insert the mb() before updating the fence parameter

With a fence, we only need to insert a memory barrier around the actual
fence alteration for CPU accesses through the GTT. Performing the
barrier in flush-fence was inserting unnecessary and expensive barriers
for never fenced objects.

Note removing the barriers from flush-fence, which was effectively a
barrier before every direct access through the GTT, revealed that we
where missing a barrier before the first access through the GTT. Lack of
that barrier was sufficient to cause GPU hangs.

v2: Add a couple more comments to explain the new barriers

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c