All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/4] drm/i915: Record the position of the start	of the request
Date: Wed, 10 Aug 2016 15:19:34 +0300	[thread overview]
Message-ID: <87eg5wolyh.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <1470502191-29547-2-git-send-email-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Not only does it make for good documentation and debugging aide, but it is
> also vital for when we want to unwind requests - such as when throwing away
> an incomplete request.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Link: http://patchwork.freedesktop.org/patch/msgid/1470414607-32453-2-git-send-email-arun.siluvery@linux.intel.com
> ---
>  drivers/gpu/drm/i915/i915_drv.h         |  1 +
>  drivers/gpu/drm/i915/i915_gem_request.c | 13 +++++++++----
>  drivers/gpu/drm/i915/i915_gpu_error.c   |  6 ++++--
>  3 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index feec00f769e1..040c3b6300ac 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -557,6 +557,7 @@ struct drm_i915_error_state {
>  		struct drm_i915_error_request {
>  			long jiffies;
>  			u32 seqno;
> +			u32 head;
>  			u32 tail;
>  		} *requests;
>  
> diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
> index 6a1661643d3d..6c2553715263 100644
> --- a/drivers/gpu/drm/i915/i915_gem_request.c
> +++ b/drivers/gpu/drm/i915/i915_gem_request.c
> @@ -391,6 +391,13 @@ i915_gem_request_alloc(struct intel_engine_cs *engine,
>  	if (ret)
>  		goto err_ctx;
>  
> +	/* Record the position of the start of the request so that
> +	 * should we detect the updated seqno part-way through the
> +	 * GPU processing the request, we never over-estimate the
> +	 * position of the head.
> +	 */
> +	req->head = req->ring->tail;
> +
>  	return req;
>  
>  err_ctx:
> @@ -467,8 +474,6 @@ void __i915_add_request(struct drm_i915_gem_request *request,
>  
>  	trace_i915_gem_request_add(request);
>  
> -	request->head = request_start;

Nuke the local request_start also?

-Mika

> -
>  	/* Whilst this request exists, batch_obj will be on the
>  	 * active_list, and so will hold the active reference. Only when this
>  	 * request is retired will the the batch_obj be moved onto the
> @@ -489,10 +494,10 @@ void __i915_add_request(struct drm_i915_gem_request *request,
>  	list_add_tail(&request->link, &engine->request_list);
>  	list_add_tail(&request->ring_link, &ring->request_list);
>  
> -	/* Record the position of the start of the request so that
> +	/* Record the position of the start of the breadcrumb so that
>  	 * should we detect the updated seqno part-way through the
>  	 * GPU processing the request, we never over-estimate the
> -	 * position of the head.
> +	 * position of the ring's HEAD.
>  	 */
>  	request->postfix = ring->tail;
>  
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index eecb87063c88..c9e1246ecd36 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -455,9 +455,10 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
>  				   dev_priv->engine[i].name,
>  				   ee->num_requests);
>  			for (j = 0; j < ee->num_requests; j++) {
> -				err_printf(m, "  seqno 0x%08x, emitted %ld, tail 0x%08x\n",
> +				err_printf(m, "  seqno 0x%08x, emitted %ld, head 0x%08x tail 0x%08x\n",
>  					   ee->requests[j].seqno,
>  					   ee->requests[j].jiffies,
> +					   ee->requests[j].head,
>  					   ee->requests[j].tail);
>  			}
>  		}
> @@ -1205,7 +1206,8 @@ static void i915_gem_record_rings(struct drm_i915_private *dev_priv,
>  			erq = &ee->requests[count++];
>  			erq->seqno = request->fence.seqno;
>  			erq->jiffies = request->emitted_jiffies;
> -			erq->tail = request->postfix;
> +			erq->head = request->head;
> +			erq->tail = request->tail;
>  		}
>  	}
>  }
> -- 
> 2.8.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-08-10 12:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-06 16:49 Per-engine reset, preliminary recovery patches Chris Wilson
2016-08-06 16:49 ` [PATCH 1/4] drm/i915: Record the position of the start of the request Chris Wilson
2016-08-10 12:19   ` Mika Kuoppala [this message]
2016-08-10 13:03     ` Chris Wilson
2016-08-06 16:49 ` [PATCH 2/4] drm/i915: Simplify ELSP queue request tracking Chris Wilson
2016-08-23 14:28   ` Mika Kuoppala
2016-08-23 14:51     ` Chris Wilson
2016-08-06 16:49 ` [PATCH 3/4] drm/i915: Update reset path to fix incomplete requests Chris Wilson
2016-08-06 16:49 ` [PATCH 4/4] drm/i915: Separate out reset flags from the reset counter Chris Wilson
2016-08-06 17:16 ` ✗ Ro.CI.BAT: failure for series starting with [1/4] drm/i915: Record the position of the start of the request Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eg5wolyh.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.