OSDN Git Service

drm/i915: Check for awaits on still currently executing requests
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 29 May 2020 14:39:26 +0000 (15:39 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 29 May 2020 16:47:39 +0000 (17:47 +0100)
commitb55230e5e800868961fc271b26d9ce53ae1f691e
treec79d49f94b9050986c1a41605d20b5b0ea9c1e0e
parent98b7067a17ba745fb6dac9669e26bae1960d283c
drm/i915: Check for awaits on still currently executing requests

With the advent of preempt-to-busy, a request may still be on the GPU as
we unwind. And in the case of a unpreemptible [due to HW] request, that
request will remain indefinitely on the GPU even though we have
returned it back to our submission queue, and cleared the active bit.

We only run the execution callbacks on transferring the request from our
submission queue to the execution queue, but if this is a bonded request
that the HW is waiting for, we will not submit it (as we wait for a
fresh execution) even though it is still being executed.

As we know that there are always preemption points between requests, we
know that only the currently executing request may be still active even
though we have cleared the flag. However, we do not precisely know which
request is in ELSP[0] due to a delay in processing events, and
furthermore we only store the last request in a context in our state
tracker.

Fixes: 22b7a426bbe1 ("drm/i915/execlists: Preempt-to-busy")
Testcase: igt/gem_exec_balancer/bonded-dual
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200529143926.3245-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_request.c