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/2] drm/i915: Wait upon the last request seqno, rather than a future seqno
Date: Tue, 27 Nov 2012 10:40:51 +0200	[thread overview]
Message-ID: <87mwy3zbe4.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <1353589641-29466-1-git-send-email-chris@chris-wilson.co.uk>

On Thu, 22 Nov 2012 13:07:20 +0000, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> In commit 69c2fc891343cb5217c866d10709343cff190bdc
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date:   Fri Jul 20 12:41:03 2012 +0100
> 
>     drm/i915: Remove the per-ring write list
> 
> the explicit flush was removed from i915_ring_idle(). However, we
> continued to wait upon the next seqno which now did not correspond to
> any request (except for the unusual condition of a failure to queue a
> request after execbuffer) and so would wait indefinitely.
> 
> This has an important side-effect that i915_gpu_idle() does not cause
> the seqno to be incremented. This is vital if we are to be able to idle
> the GPU to handle seqno wraparound, as in subsequent patches.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/i915_gem.c |   23 +++++++++++++++++++++--
>  1 file changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index b0016bb..9be450e 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2462,10 +2462,29 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj)
>  
>  static int i915_ring_idle(struct intel_ring_buffer *ring)
>  {
> -	if (list_empty(&ring->active_list))
> +	u32 seqno;
> +	int ret;
> +
> +	/* We need to add any requests required to flush the objects */
> +	if (!list_empty(&ring->active_list)) {
> +		seqno = list_entry(ring->active_list.prev,
> +				   struct drm_i915_gem_object,
> +				   ring_list)->last_read_seqno;
> +
> +		ret = i915_gem_check_olr(ring, seqno);
> +		if (ret)
> +			return ret;
> +	}
> +
> +	/* Wait upon the last request to be completed */
> +	if (list_empty(&ring->request_list))
>  		return 0;
>  
> -	return i915_wait_seqno(ring, i915_gem_next_request_seqno(ring));
> +	seqno = list_entry(ring->request_list.prev,
> +			   struct drm_i915_gem_request,
> +			   list)->seqno;
> +
> +	return i915_wait_seqno(ring, seqno);
>  }
>  
>  int i915_gpu_idle(struct drm_device *dev)
> -- 
> 1.7.10.4

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

  parent reply	other threads:[~2012-11-27  8:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-22 13:07 [PATCH 1/2] drm/i915: Wait upon the last request seqno, rather than a future seqno Chris Wilson
2012-11-22 13:07 ` [PATCH 2/2] drm/i915: Preallocate next seqno before touching the ring Chris Wilson
2012-11-27  9:03   ` Mika Kuoppala
2012-11-27  9:25     ` Chris Wilson
2012-11-27  9:48       ` [PATCH] " Chris Wilson
2012-11-27 14:30         ` Mika Kuoppala
2012-11-27  8:40 ` Mika Kuoppala [this message]
2012-11-27  9:25   ` [PATCH 1/2] drm/i915: Wait upon the last request seqno, rather than a future seqno Daniel Vetter

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=87mwy3zbe4.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.