All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Konno <joe.konno@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [RFC 3/3] drm/i915: add underrun counts to i915_display_info
Date: Tue, 26 Jan 2016 11:36:57 -0800	[thread overview]
Message-ID: <1453837017-23209-4-git-send-email-joe.konno@linux.intel.com> (raw)
In-Reply-To: <1453837017-23209-1-git-send-email-joe.konno@linux.intel.com>

From: Joe Konno <joe.konno@intel.com>

Add atomic cpu and pch underrun counters to struct intel_crtc, and
increment them each time their respective interrupt handler executes.

Whether dmesg underrun reporting is disabled or not, keep a count of cpu
and pch underrun interrupts. Display these counts in i915_display_info
on a per-pipe. per-transcoder basis to assist debugging and testing.

In debugfs, the i915_display_info output for each pipe changes from
this:
    underrun reporting: cpu=%s pch=%s

to this, where the number of underruns are reported in parentheses:
    underrun reporting: cpu=%s (%d) pch=%s (%d)

Signed-off-by: Joe Konno <joe.konno@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c        | 6 ++++--
 drivers/gpu/drm/i915/intel_drv.h           | 4 ++++
 drivers/gpu/drm/i915/intel_fifo_underrun.c | 6 ++++++
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 863012a2602e..aa47987bb13b 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -3101,9 +3101,11 @@ static int i915_display_info(struct seq_file *m, void *unused)
 			intel_plane_info(m, crtc);
 		}
 
-		seq_printf(m, "\tunderrun reporting: cpu=%s pch=%s \n",
+		seq_printf(m, "\tunderrun reporting: cpu=%s (%d) pch=%s (%d) \n",
 			   yesno(!crtc->cpu_fifo_underrun_disabled),
-			   yesno(!crtc->pch_fifo_underrun_disabled));
+			   atomic_read(&crtc->cpu_fifo_underrun_count),
+			   yesno(!crtc->pch_fifo_underrun_disabled),
+			   atomic_read(&crtc->pch_fifo_underrun_count));
 	}
 
 	seq_printf(m, "\n");
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index bc970125ec76..efc6eb0a517f 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -589,6 +589,10 @@ struct intel_crtc {
 	/* reset counter value when the last flip was submitted */
 	unsigned int reset_counter;
 
+	/* fifo_underrun counters, used in debugfs only */
+	atomic_t cpu_fifo_underrun_count;
+	atomic_t pch_fifo_underrun_count;
+
 	/* Access to these should be protected by dev_priv->irq_lock. */
 	bool cpu_fifo_underrun_disabled;
 	bool pch_fifo_underrun_disabled;
diff --git a/drivers/gpu/drm/i915/intel_fifo_underrun.c b/drivers/gpu/drm/i915/intel_fifo_underrun.c
index 4a1a2781fc5e..d7b355b831e1 100644
--- a/drivers/gpu/drm/i915/intel_fifo_underrun.c
+++ b/drivers/gpu/drm/i915/intel_fifo_underrun.c
@@ -407,6 +407,9 @@ void intel_cpu_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv,
 
 	report = intel_get_cpu_fifo_underrun_reporting(dev_priv, pipe);
 
+	/* Increment the debugfs underrun counter */
+	atomic_inc(&to_intel_crtc(crtc)->cpu_fifo_underrun_count);
+
 	if (report)
 		DRM_ERROR_RATELIMITED("CPU pipe %c FIFO underrun\n",
 				      pipe_name(pipe));
@@ -427,6 +430,9 @@ void intel_pch_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv,
 	bool report = intel_get_pch_fifo_underrun_reporting(dev_priv,
 							    pch_transcoder);
 
+	/* Increment the debugfs underrun counter */
+	atomic_inc(&to_intel_crtc(crtc)->pch_fifo_underrun_count);
+
 	if (report)
 		DRM_ERROR_RATELIMITED("PCH transcoder %c FIFO underrun\n",
 				      transcoder_name(pch_transcoder));
-- 
2.6.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-01-26 19:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 19:36 [RFC 0/3] drm/i915: expose fifo pipe underrun counts Joe Konno
2016-01-26 19:36 ` [RFC 1/3] drm/i915: get cpu, pch underrun reporting state Joe Konno
2016-01-26 19:36 ` [RFC 2/3] drm/i915: do not disable handler after underrun Joe Konno
2016-01-26 20:49   ` Daniel Vetter
2016-01-26 19:36 ` Joe Konno [this message]
2016-01-26 20:51 ` [RFC 0/3] drm/i915: expose fifo pipe underrun counts Daniel Vetter
2016-01-26 21:05   ` Joe Konno
2016-01-27  8:29     ` Daniel Vetter
2016-01-28  7:13 ` ✗ Fi.CI.BAT: failure for " Patchwork
2016-01-28 15:09 ` ✓ Fi.CI.BAT: success " 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=1453837017-23209-4-git-send-email-joe.konno@linux.intel.com \
    --to=joe.konno@linux.intel.com \
    --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.