Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Eric Anholt <eric@anholt.net>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/4] intel: Add decode for gen7 3DSTATE_WM.
Date: Wed, 22 Feb 2012 10:38:11 +0100	[thread overview]
Message-ID: <20120222093811.GA4872@phenom.ffwll.local> (raw)
In-Reply-To: <1329760537-5342-2-git-send-email-eric@anholt.net>

On Mon, Feb 20, 2012 at 09:55:35AM -0800, Eric Anholt wrote:
> This requires pulling the gen6 3DSTATE_WM out to a function so it
> doesn't override gen7's handler.
> ---
>  intel/intel_decode.c              |  178 ++++++++++++++++++++++++++++---------
>  intel/tests/gen7-3d.batch-ref.txt |   70 +++------------
>  2 files changed, 150 insertions(+), 98 deletions(-)
> 
> diff --git a/intel/intel_decode.c b/intel/intel_decode.c
> index 00908d0..02e81f9 100644
> --- a/intel/intel_decode.c
> +++ b/intel/intel_decode.c
> @@ -2859,6 +2859,140 @@ gen7_3DSTATE_CONSTANT_HS(struct drm_intel_decode *ctx)
>  	return gen7_3DSTATE_CONSTANT(ctx, "HS");
>  }
>  
> +
> +static int
> +gen6_3DSTATE_WM(struct drm_intel_decode *ctx)
> +{
> +	instr_out(ctx, 0, "3DSTATE_WM\n");
> +	instr_out(ctx, 1, "kernel start pointer 0\n");
> +	instr_out(ctx, 2,
> +		  "SPF=%d, VME=%d, Sampler Count %d, "
> +		  "Binding table count %d\n",
> +		  (ctx->data[2] >> 31) & 1,
> +		  (ctx->data[2] >> 30) & 1,
> +		  (ctx->data[2] >> 27) & 7,
> +		  (ctx->data[2] >> 18) & 0xff);
> +	instr_out(ctx, 3, "scratch offset\n");
> +	instr_out(ctx, 4,
> +		  "Depth Clear %d, Depth Resolve %d, HiZ Resolve %d, "
> +		  "Dispatch GRF start[0] %d, start[1] %d, start[2] %d\n",
> +		  (ctx->data[4] & (1 << 30)) != 0,
> +		  (ctx->data[4] & (1 << 28)) != 0,
> +		  (ctx->data[4] & (1 << 27)) != 0,
> +		  (ctx->data[4] >> 16) & 0x7f,
> +		  (ctx->data[4] >> 8) & 0x7f,
> +		  (ctx->data[4] & 0x7f));
> +	instr_out(ctx, 5,
> +		  "MaxThreads %d, PS KillPixel %d, PS computed Z %d, "
> +		  "PS use sourceZ %d, Thread Dispatch %d, PS use sourceW %d, "
> +		  "Dispatch32 %d, Dispatch16 %d, Dispatch8 %d\n",
> +		  ((ctx->data[5] >> 25) & 0x7f) + 1,
> +		  (ctx->data[5] & (1 << 22)) != 0,
> +		  (ctx->data[5] & (1 << 21)) != 0,
> +		  (ctx->data[5] & (1 << 20)) != 0,
> +		  (ctx->data[5] & (1 << 19)) != 0,
> +		  (ctx->data[5] & (1 << 8)) != 0,
> +		  (ctx->data[5] & (1 << 2)) != 0,
> +		  (ctx->data[5] & (1 << 1)) != 0,
> +		  (ctx->data[5] & (1 << 0)) != 0);
> +	instr_out(ctx, 6,
> +		  "Num SF output %d, Pos XY offset %d, ZW interp mode %d , "
> +		  "Barycentric interp mode 0x%x, Point raster rule %d, "
> +		  "Multisample mode %d, "
> +		  "Multisample Dispatch mode %d\n",
> +		  (ctx->data[6] >> 20) & 0x3f,
> +		  (ctx->data[6] >> 18) & 3,
> +		  (ctx->data[6] >> 16) & 3,
> +		  (ctx->data[6] >> 10) & 0x3f,
> +		  (ctx->data[6] & (1 << 9)) != 0,
> +		  (ctx->data[6] >> 1) & 3,
> +		  (ctx->data[6] & 1));
> +	instr_out(ctx, 7, "kernel start pointer 1\n");
> +	instr_out(ctx, 8, "kernel start pointer 2\n");
> +
> +	return 9;
> +}
> +
> +static int
> +gen7_3DSTATE_WM(struct drm_intel_decode *ctx)
> +{
> +	const char *computed_depth = "";
> +	const char *early_depth = "";
> +	const char *zw_interp = "";
> +
> +	switch ((ctx->data[1] >> 23) & 0x3) {
> +	case 0:
> +		computed_depth = "";
> +		break;
> +	case 1:
> +		computed_depth = "computed depth";
> +		break;
> +	case 2:
> +		computed_depth = "computed depth >=";
> +		break;
> +	case 3:
> +		computed_depth = "computed depth <=";
> +		break;
> +	}
> +
> +	switch ((ctx->data[1] >> 21) & 0x3) {
> +	case 0:
> +		early_depth = "";
> +		break;
> +	case 1:
> +		early_depth = ", EDSC_PSEXEC";
> +		break;
> +	case 2:
> +		early_depth = ", EDSC_PREPS";
> +		break;
> +	case 3:
> +		early_depth = ", BAD EDSC";
> +		break;
> +	}
> +
> +	switch ((ctx->data[1] >> 21) & 0x3) {

Afacs this should be >> 17 instead of >> 21. With that fixed patches 1-3
are Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> and patch 4 is
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

  reply	other threads:[~2012-02-22  9:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-20 17:55 [PATCH 1/4] intel: Fix a typo in decode error message Eric Anholt
2012-02-20 17:55 ` [PATCH 2/4] intel: Add decode for gen7 3DSTATE_WM Eric Anholt
2012-02-22  9:38   ` Daniel Vetter [this message]
2012-02-20 17:55 ` [PATCH 3/4] intel: Add decode for gen7 HIER_DEPTH_BUFFER Eric Anholt
2012-02-20 17:55 ` [PATCH 4/4] intel: Import a new batchbuffer for the gen7 test Eric Anholt

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=20120222093811.GA4872@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=eric@anholt.net \
    --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