public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] tools/intel_watermark: Parse WM_DBG to help diagnose watermark issues
Date: Wed, 27 Mar 2019 18:03:29 +0200	[thread overview]
Message-ID: <20190327160329.870-1-ville.syrjala@linux.intel.com> (raw)

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

WM_DBG has some useful sticky bits which tell us whether the
hardware has entered specific LP1+ and/or maxfifo modes since
those bits were last cleared. Let's dump those out.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tools/intel_watermark.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/tools/intel_watermark.c b/tools/intel_watermark.c
index 2dc4307c33a3..8296795f5b66 100644
--- a/tools/intel_watermark.c
+++ b/tools/intel_watermark.c
@@ -43,6 +43,11 @@ static uint32_t read_reg(uint32_t addr)
 	return INREG(display_base + addr);
 }
 
+static void write_reg(uint32_t addr, uint32_t val)
+{
+	OUTREG(display_base + addr, val);
+}
+
 struct gmch_wm {
 	int wm, wm1, dl, fifo, fbc, burst;
 	bool dl_prec, valid;
@@ -250,6 +255,7 @@ static void skl_wm_dump(void)
 	uint32_t nv12_buf_cfg[num_pipes][max_planes];
 	uint32_t plane_ctl[num_pipes][max_planes];
 	uint32_t wm_linetime[num_pipes];
+	uint32_t wm_dbg;
 
 	intel_register_access_init(igt_device_get_pci_device(fd), 0, -1);
 
@@ -456,6 +462,17 @@ static void skl_wm_dump(void)
 
 	printf("* plane watermark enabled\n");
 	printf("(x) line watermark if enabled\n");
+
+	wm_dbg = read_reg(0x45280);
+	printf("WM_DBG: 0x%08x\n", wm_dbg);
+	printf(" LP used:");
+	for (level = 1; level < num_levels; level++) {
+		if (wm_dbg & (1 << (23 + level)))
+			printf(" LP%d", level);
+	}
+	printf("\n");
+	/* clear the sticky bits */
+	write_reg(0x45280, wm_dbg);
 }
 
 static void ilk_wm_dump(void)
@@ -608,6 +625,22 @@ static void ilk_wm_dump(void)
 	}
 	printf("FBC watermark = %s\n",
 	       endis(!REG_DECODE1(arb_ctl, 15, 1)));
+
+	if (IS_BROADWELL(devid) || IS_HASWELL(devid)) {
+		uint32_t wm_dbg = read_reg(0x45280);
+		printf("WM_DBG: 0x%08x\n", wm_dbg);
+		if (wm_dbg & (1 << 31))
+			printf(" Full maxfifo used\n");
+		if (wm_dbg & (1 << 30))
+			printf(" Sprite maxfifo used\n");
+		printf(" LP used:");
+		for (i = 1; i < 4; i++) {
+			if (wm_dbg & (1 << (23+i)))
+				printf(" LP%d", i);
+		}
+		/* clear the sticky bits */
+		write_reg(0x45280, wm_dbg);
+	}
 }
 
 static void vlv_wm_dump(void)
-- 
2.19.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-03-27 16:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27 16:03 Ville Syrjala [this message]
2019-03-27 17:04 ` [igt-dev] ✗ Fi.CI.BAT: failure for tools/intel_watermark: Parse WM_DBG to help diagnose watermark issues Patchwork

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=20190327160329.870-1-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@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