All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kenneth Graunke <kenneth@whitecape.org>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Fixed VS thread distribution between slices
Date: Tue, 10 Apr 2012 11:38:32 -0700	[thread overview]
Message-ID: <4F847E28.4010602@whitecape.org> (raw)
In-Reply-To: <1334031024-7685-1-git-send-email-ben@bwidawsk.net>

On 04/09/2012 09:10 PM, Ben Widawsky wrote:
> From: "bernard.r.kilarski"<your-user-name@intel.com>
>
> Full disclosure: my IVB hangs on nexuiz both before, and after this patch, and
> I haven't done any debug
>
> This patch was given to me by Bernard, by way of Daniel. The patch came
> with very little description, and I haven't really spent too much time
> in the spec to make much sense out of it.
>
> The improvement (IVB only) with my nexuiz configuration is almost
> unbelievable. It has a more humble improvement on OpenArena. I'll throw
> other tests at it, and try to debug the hangs a bit, but given the
> nexuiz results, I was compelled to post this sooner, rather than later.
>
> I see about a 2% improvement on OA
> and about a 40$% improvement on nexuiz
>
> CC: Daniel Vetter<daniel.vetter@ffwll.ch>
> Signed-off-by: Ben Widawsky<benjamin.widawsky@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_reg.h      |    3 +++
>   drivers/gpu/drm/i915/intel_display.c |    3 +++
>   2 files changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index cb55444..755bdff 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -682,6 +682,9 @@
>
>   #define GEN6_BSD_RNCID			0x12198
>
> +#define GEN7_FF_THREAD_MODE		0x20a0
> +#define GEN7_FF_THREAD_SIMPLE_SCHED	0x28a00010
> +
>   /*
>    * Framebuffer compression (915+ only)
>    */
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 6ec81b4..bbd5f46 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -8893,6 +8893,9 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)
>   			   DISPPLANE_TRICKLE_FEED_DISABLE);
>   		intel_flush_display_plane(dev_priv, pipe);
>   	}
> +
> +	/* Fix vertex load balancing */
> +	I915_WRITE(GEN7_FF_THREAD_MODE,GEN7_FF_THREAD_SIMPLE_SCHED);
>   }
>
>   static void valleyview_init_clock_gating(struct drm_device *dev)

I definitely approve of this patch.  It appears to make the hardware use 
a simple scheduler, as opposed to a complex one which is default.

The default scheduler has this lovely comment: "Note: this will cause 
possible corruption if input handles are reused due to instancing or 
topologies that reuse vertices (i.e. strips and fans)".

That is frightening.  We use instancing, tristrips, and trifans all the 
time.  While I haven't observed a problem, I don't want this to come 
back and bite us later.  The other scheduling options in VS Thread 
Dispatch Mode are useless.  Simple scheduling appears to be the only 
option that's safe.  And apparently it performs well too :)

So, as is, I think this qualifies for a:

Cc: stable@kernel.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

However!  I would like to be more paranoid and program it to 0x28a00000.
In other words, the IVB default minus bit 4 and bit 12:

     0x28a01010 & ~(1 << 4 | 1 << 12)

Bit 12 is the VS Thread Dispatch Override, which Bernard's patch 
cleared.  Bit 4 is the equivalent bit for DS (Domain Shaders).  It also 
has the scary comment about instancing and strips/fans not working.

Likewise, bit 16 also should be off (but is already off by default).

Since domain shaders are an OpenGL 4.0 feature, this shouldn't matter in 
the short term...but I doubt any of us will remember to come back here 
and change these bits when we eventually need them.

  reply	other threads:[~2012-04-10 18:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10  4:10 [PATCH] drm/i915: Fixed VS thread distribution between slices Ben Widawsky
2012-04-10 18:38 ` Kenneth Graunke [this message]
2012-04-10 21:08   ` Ben Widawsky
2012-04-10 18:39 ` Eugeni Dodonov

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=4F847E28.4010602@whitecape.org \
    --to=kenneth@whitecape.org \
    --cc=ben@bwidawsk.net \
    --cc=daniel.vetter@ffwll.ch \
    --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.