public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: Eliminate unrequired dwords for MI_SET_CONTEXT
Date: Fri, 9 Aug 2013 11:41:26 +0200	[thread overview]
Message-ID: <20130809094126.GB7441@phenom.ffwll.local> (raw)
In-Reply-To: <1375988426-4713-1-git-send-email-chris@chris-wilson.co.uk>

On Thu, Aug 08, 2013 at 08:00:25PM +0100, Chris Wilson wrote:
> A later patch adds yet another workaround for MI_SET_CONTEXT, at which
> point we start to end up with more NOOPs than actual command dwords
> along the non-workaround paths. It is time that we made the MI_SET_CONTEXT
> a variable length block and only emit the dwords we truly need.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>

Since this seems to be based on top of gen5 context support: Care to slap
an r-b and tested-by onto it so that I can merge the entire shebang?

Cheers, Daniel
> ---
>  drivers/gpu/drm/i915/i915_gem_context.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index 879bfa2..8a7b61e 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -348,7 +348,7 @@ mi_set_context(struct intel_ring_buffer *ring,
>  	       struct i915_hw_context *new_context,
>  	       u32 hw_flags)
>  {
> -	int ret;
> +	int ret, len;
>  
>  	/* w/a: If Flush TLB Invalidation Mode is enabled, driver must do a TLB
>  	 * invalidation prior to MI_SET_CONTEXT. On GEN6 we don't set the value
> @@ -361,7 +361,14 @@ mi_set_context(struct intel_ring_buffer *ring,
>  			return ret;
>  	}
>  
> -	ret = intel_ring_begin(ring, 6);
> +	len = 4;
> +	switch (INTEL_INFO(ring->dev)->gen) {
> +	case 7:
> +	case 5: len += 2;
> +		break;
> +	}
> +
> +	ret = intel_ring_begin(ring, len);
>  	if (ret)
>  		return ret;
>  
> @@ -373,9 +380,6 @@ mi_set_context(struct intel_ring_buffer *ring,
>  	case 5:
>  		intel_ring_emit(ring, MI_SUSPEND_FLUSH | MI_SUSPEND_FLUSH_EN);
>  		break;
> -	default:
> -		intel_ring_emit(ring, MI_NOOP);
> -		break;
>  	}
>  
>  	intel_ring_emit(ring, MI_NOOP);
> @@ -395,9 +399,6 @@ mi_set_context(struct intel_ring_buffer *ring,
>  	case 5:
>  		intel_ring_emit(ring, MI_SUSPEND_FLUSH);
>  		break;
> -	default:
> -		intel_ring_emit(ring, MI_NOOP);
> -		break;
>  	}
>  
>  	intel_ring_advance(ring);
> -- 
> 1.8.4.rc1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  parent reply	other threads:[~2013-08-09  9:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08 13:37 [PATCH] drm/i915: Prevent loading of uninitialized context garbage Chris Wilson
2013-08-08 17:12 ` Ben Widawsky
2013-08-08 19:00   ` [PATCH 1/2] drm/i915: Eliminate unrequired dwords for MI_SET_CONTEXT Chris Wilson
2013-08-08 19:00     ` [PATCH 2/2] drm/i915: Prevent loading of uninitialized context garbage Chris Wilson
2013-08-21 13:43       ` Ville Syrjälä
2013-08-21 15:31         ` Ville Syrjälä
2013-08-21 21:12           ` Daniel Vetter
2013-08-22  9:18             ` Abdiel Janulgue
2013-08-22  9:32               ` Ville Syrjälä
2013-08-09  9:41     ` Daniel Vetter [this message]
2013-08-09 10:05       ` [PATCH 1/2] drm/i915: Eliminate unrequired dwords for MI_SET_CONTEXT Chris Wilson

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=20130809094126.GB7441@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox