drm/i915: infrastructure to track pipelined fence setup
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 12 Feb 2010 08:55:54 +0000 (09:55 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 2 Mar 2010 22:53:00 +0000 (23:53 +0100)
commit89c3a5642569cb1800411d964a7352c440efa1f8
tree5b304958e96ca4d8f724c51c4f20ecd364a93f2d
parentf235b90fc75b543d3f0c2fe34f069ac01caaa734
drm/i915: infrastructure to track pipelined fence setup

Fenced gtt access by the cpu needs to wait for the gpu to have updated
the fence reg if it was pipelined. This patch adds the necessary
infrastructure.

I'm not too fond of the code in i915_gem_retire_requests, but I
think that a new list to track fences a la objects for retiring
is overkill.

v2: Retire fences before request and explain in a big comment why this
leads to setup_seqno inconsistencies. Also a few new BUG_ONs if used
to check consistency (and catch the above-mentioned problem).

v3: Like for pipelined fence use, ensure that a fence doesn't outlive
it's object under certain perculiar error-conditions in
i915_gem_object_put_fence_reg.

v4: Add some more phat comments to explain what the changes in v3 actually
fixed. Also fix up a cache-coherency problem in case userspace ever mixes
fenced with non-fenced access in different batchbuffers.

v5: Adapt to Sandybridge support.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c