From patchwork Sun Apr 21 23:01:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2469691 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id F2CAADF230 for ; Sun, 21 Apr 2013 22:59:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CAC4AE6003 for ; Sun, 21 Apr 2013 15:59:04 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from shiva.localdomain (unknown [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id C46A5E5C1E for ; Sun, 21 Apr 2013 15:58:55 -0700 (PDT) Received: by shiva.localdomain (Postfix, from userid 1005) id EAC9A88659; Sun, 21 Apr 2013 22:58:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on shiva.chad-versace.us X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham version=3.3.2 Received: from lundgren.kumite (c-24-21-100-90.hsd1.or.comcast.net [24.21.100.90]) by shiva.localdomain (Postfix) with ESMTPSA id 26646884B0; Sun, 21 Apr 2013 22:58:54 +0000 (UTC) From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Sun, 21 Apr 2013 16:01:19 -0700 Message-Id: <1366585279-18263-1-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.8.2.1 Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH] drm/i915: Decode RING_BUFFER_HEAD in error state X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org I consistently forget how to decode the HEAD pointer. If we put it in the error state, one doesn't need to look in docs to find the relevant info. Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_debugfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index e913d32..dd5a64e 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -643,7 +643,10 @@ static void i915_ring_error_state(struct seq_file *m, { BUG_ON(ring >= I915_NUM_RINGS); /* shut up confused gcc */ seq_printf(m, "%s command stream:\n", ring_str(ring)); - seq_printf(m, " HEAD: 0x%08x\n", error->head[ring]); + seq_printf(m, " HEAD: 0x%08x (wraps: %d; offset: 0x%08x)\n", + error->head[ring], + error->head[ring] >> 21, + error->head[ring] & (0x7ffff << 2)); seq_printf(m, " TAIL: 0x%08x\n", error->tail[ring]); seq_printf(m, " CTL: 0x%08x\n", error->ctl[ring]); seq_printf(m, " ACTHD: 0x%08x\n", error->acthd[ring]);