drm/i915: Wait for pending flips on the GPU
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 7 Oct 2010 16:28:15 +0000 (17:28 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 7 Oct 2010 18:10:09 +0000 (19:10 +0100)
commite59f2bac15042eb744851bcf866f18dadc3091c6
treea0534aea9beab6f65489d171e6dff2b3c992c13d
parentc2873e9633fe908dccd36dbb1d370e9c59a1ca62
drm/i915: Wait for pending flips on the GPU

Currently, if a batch buffer refers to an object with a pending flip,
then we sleep until that pending flip is completed (unpinned and
signalled). This is so that a flip can be queued and the user can
continue rendering to the backbuffer oblivious to whether the buffer is
still pinned as the scan out. (The kernel arbitrating at the last moment
to stall the batch and wait until the buffer is unpinned and replaced as
the front buffer.)

As we only have a queue depth of 1, we can simply wait for the current
pending flip to complete and continue rendering. We can achieve this
with a single WAIT_FOR_EVENT command inserted into the ring buffer prior
to executing the batch, *without* stalling the client.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_display.c