From patchwork Tue Jan 26 19:36:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Konno X-Patchwork-Id: 8126971 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 361A89F1C0 for ; Tue, 26 Jan 2016 19:37:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E00D4202F2 for ; Tue, 26 Jan 2016 19:37:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A4CB3202D1 for ; Tue, 26 Jan 2016 19:37:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E2FC6E23E; Tue, 26 Jan 2016 11:36:59 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 6213B6E296 for ; Tue, 26 Jan 2016 11:36:58 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 26 Jan 2016 11:36:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,351,1449561600"; d="scan'208";a="898791254" Received: from jbkonno-beef.jf.intel.com ([10.7.197.231]) by orsmga002.jf.intel.com with ESMTP; 26 Jan 2016 11:36:57 -0800 From: Joe Konno To: intel-gfx@lists.freedesktop.org Date: Tue, 26 Jan 2016 11:36:57 -0800 Message-Id: <1453837017-23209-4-git-send-email-joe.konno@linux.intel.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1453837017-23209-1-git-send-email-joe.konno@linux.intel.com> References: <1453837017-23209-1-git-send-email-joe.konno@linux.intel.com> Subject: [Intel-gfx] [RFC 3/3] drm/i915: add underrun counts to i915_display_info X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Joe Konno 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 --- 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));