drm/i915: Fix for ringbuf space wait in LRC mode
authorJohn Harrison <John.C.Harrison@Intel.com>
Thu, 19 Mar 2015 12:30:09 +0000 (12:30 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 1 Apr 2015 05:54:43 +0000 (07:54 +0200)
commitdbe4646d6e3467adbe2ec8dbe6b7ceea57dee2ec
tree9188b03897eea756a20ce2cd2b4d8fd0cf69f07a
parent6689cb2b62065b5417aeda13d57d61b437b2126e
drm/i915: Fix for ringbuf space wait in LRC mode

The legacy and LRC code paths have an almost identical procedure for waiting for
space in the ring buffer. They both search for a request in the free list that
will advance the tail to a point where sufficient space is available. They then
wait for that request, retire it and recalculate the free space value.

Unfortunately, a bug in the LRC side meant that the resulting free space might
not be as large as expected and indeed, might not be sufficient. This is because
it was testing against the value of request->tail not request->postfix. Whereas,
when a request is retired, ringbuf->tail is updated to req->postfix not
req->tail.

Another significant difference between the two is that the LRC one did not trust
the wait for request to work! It redid the is there enough space available test
and would fail the call if insufficient. Whereas, the legacy version just said
'return 0' - it assumed the preceeding code works. This difference meant that
the LRC version still worked even with the bug - it just fell back to the
polling wait path.

For: VIZ-5115
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: Thomas Daniel <thomas.daniel@intel.com>
Reviewed-by: Tomas Elf <tomas.elf@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.c
This page took 0.026873 seconds and 5 git commands to generate.