public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-gfx@lists.freedesktop.org, Ben Widawsky <ben@bwidawsk.net>,
	Ben Widawsky <benjamin.widawsky@intel.com>
Subject: Re: [PATCH 4/7] drm/i915/bdw: cs-stall before state cache invld w/a
Date: Tue, 5 Aug 2014 15:39:40 +0300	[thread overview]
Message-ID: <20140805123940.GI4193@intel.com> (raw)
In-Reply-To: <1407176119-5294-4-git-send-email-rodrigo.vivi@intel.com>

On Mon, Aug 04, 2014 at 11:15:16AM -0700, Rodrigo Vivi wrote:
> From: Ben Widawsky <benjamin.widawsky@intel.com>
> 
> We do this already for previous GENs. I guess we must do it for BDW too
> according to DOCS.
> 
> "Pipe_control with CS-stall bit set must be issued before a
> pipe-control command that has the State Cache Invalidate bit set."
> 
> This does not solve the problem I have unfortunately.
> 
> I didn't check if this was in Ville's CHV series. If it was, I
> apologize.

Ken's version from long ago was included there. It's just waiting
to be merged.

> 
> NOTE: I tried to use smaller lengths for the command, but nothing made
> it happy except 6.
> 
> Cc: Kenneth Graunke <kenneth@whitecape.org>
> Cc: Jordan Justen <jljusten@gmail.com>
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ringbuffer.c | 19 ++++++++++++++++---
>  1 file changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 9a562b5..2e566e0 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -279,17 +279,25 @@ gen6_render_ring_flush(struct intel_engine_cs *ring,
>  static int
>  gen7_render_ring_cs_stall_wa(struct intel_engine_cs *ring)
>  {
> -	int ret;
> +	int ret, size = 4;
>  
> -	ret = intel_ring_begin(ring, 4);
> +	if (IS_BROADWELL(ring->dev))
> +		size += 2;
> +
> +	ret = intel_ring_begin(ring, size);
>  	if (ret)
>  		return ret;
>  
> -	intel_ring_emit(ring, GFX_OP_PIPE_CONTROL(4));
> +	intel_ring_emit(ring, GFX_OP_PIPE_CONTROL(size));
>  	intel_ring_emit(ring, PIPE_CONTROL_CS_STALL |
>  			      PIPE_CONTROL_STALL_AT_SCOREBOARD);
>  	intel_ring_emit(ring, 0);
>  	intel_ring_emit(ring, 0);
> +	if (IS_BROADWELL(ring->dev)) {
> +		intel_ring_emit(ring, 0);
> +		intel_ring_emit(ring, 0);
> +	}
> +
>  	intel_ring_advance(ring);
>  
>  	return 0;
> @@ -422,6 +430,11 @@ gen8_render_ring_flush(struct intel_engine_cs *ring,
>  		flags |= PIPE_CONTROL_STATE_CACHE_INVALIDATE;
>  		flags |= PIPE_CONTROL_QW_WRITE;
>  		flags |= PIPE_CONTROL_GLOBAL_GTT_IVB;
> +
> +		/* Workaround: we must issue a pipe_control with CS-stall bit
> +		 * set before a pipe_control command that has the state cache
> +		 * invalidate bit set. */
> +		gen7_render_ring_cs_stall_wa(ring);
>  	}
>  
>  	return gen8_emit_pipe_control(ring, flags, scratch_addr);
> -- 
> 1.9.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2014-08-05 12:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 18:15 [PATCH 1/7] drm/i915/bdw: Always issue a force restore Rodrigo Vivi
2014-08-04 18:15 ` [PATCH 2/7] drm/i915: Add thread stall DOP clock gating workaround on Broadwell Rodrigo Vivi
2014-08-05 17:10   ` Ville Syrjälä
2014-08-04 18:15 ` [PATCH 3/7] drm/i915/bdw: MI_FLUSH_DW a qword instead of dword Rodrigo Vivi
2014-08-05  1:21   ` Ben Widawsky
2014-08-04 18:15 ` [PATCH 4/7] drm/i915/bdw: cs-stall before state cache invld w/a Rodrigo Vivi
2014-08-05 12:39   ` Ville Syrjälä [this message]
2014-08-04 18:15 ` [PATCH 5/7] drm/i915: avoid emiting semaphore wait on GEN8 when seqno wrap happened Rodrigo Vivi
2014-08-05  8:36   ` Daniel Vetter
2014-08-04 18:15 ` [PATCH 6/7] drm/i915: BDW Semaphore signal with Post Sync Rodrigo Vivi
2014-08-04 18:15 ` [PATCH 7/7] Revert "drm/i915: Enable semaphores on BDW" Rodrigo Vivi
2014-08-07 20:05   ` Rodrigo Vivi
2014-08-08  7:10     ` Daniel Vetter
2014-08-08  7:13   ` Daniel Vetter
2014-08-08  7:31     ` Chris Wilson
2014-08-05  1:20 ` [PATCH 1/7] drm/i915/bdw: Always issue a force restore Ben Widawsky
2014-08-05  8:41   ` 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=20140805123940.GI4193@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=ben@bwidawsk.net \
    --cc=benjamin.widawsky@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    /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