[Intel-gfx] [PATCH 06/11] drm/i915/tdr: Restart submission after engine reset
Chris Wilson
chris at chris-wilson.co.uk
Tue Jul 26 21:32:48 UTC 2016
On Tue, Jul 26, 2016 at 05:40:52PM +0100, Arun Siluvery wrote:
> We stop the engine during reset and recovery so after a successful reset
> the request that caused the hang would've been removed from the queue so we
> can now restart submissions to elsp.
>
> Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> Signed-off-by: Tomas Elf <tomas.elf at intel.com>
> Signed-off-by: Arun Siluvery <arun.siluvery at linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_lrc.c | 45 +++++++++++++++++++++++++++++++++++++---
> 1 file changed, 42 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 8fc5a3b..7834edc 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -418,7 +418,8 @@ static inline void execlists_context_status_change(
> atomic_notifier_call_chain(&rq->ctx->status_notifier, status, rq);
> }
>
> -static void execlists_context_unqueue(struct intel_engine_cs *engine)
> +static void execlists_context_unqueue(struct intel_engine_cs *engine,
> + bool submission_after_reset)
> {
> struct drm_i915_gem_request *req0 = NULL, *req1 = NULL;
> struct drm_i915_gem_request *cursor, *tmp;
> @@ -436,6 +437,27 @@ static void execlists_context_unqueue(struct intel_engine_cs *engine)
> execlist_link) {
> if (!req0) {
> req0 = cursor;
> +
> + /*
> + * we submit two requests at a time, req0 and req1.
> + * Assume that req0 is the one that causes hang and
> + * req1 is a normal batch.
> +
> + * After engine reset, once engine is
> + * reinitialized, we skip req0 and submit req1
> + * along with next request in the queue so we endup
> + * incrementing req1->elsp_submitted again. But
> + * after reset HW would've switched to req1 and
> + * executed it so just this once, submit only req1
> + * (which is req0 now) and don't increment
> + * submission count. Once this is removed we submit
> + * two requests as usual.
> + */
> + if (submission_after_reset) {
> + if (req0->elsp_submitted)
> + req0->elsp_submitted--;
> + break;
And no. Put the special case handling in the reset to cancel the
submitted hw tracking and re-establish the request queue.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list