From patchwork Wed Feb 10 15:50:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: arun.siluvery@linux.intel.com X-Patchwork-Id: 8272921 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EC4B3BEEE5 for ; Wed, 10 Feb 2016 15:50:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC279203EB for ; Wed, 10 Feb 2016 15:50:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id F03A52039E for ; Wed, 10 Feb 2016 15:50:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6A0A16E71E; Wed, 10 Feb 2016 07:50:21 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTP id D48EF6E1C2 for ; Wed, 10 Feb 2016 07:50:19 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP; 10 Feb 2016 07:50:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,426,1449561600"; d="scan'208";a="45646708" Received: from asiluver-linux.isw.intel.com ([10.102.226.117]) by fmsmga004.fm.intel.com with ESMTP; 10 Feb 2016 07:50:18 -0800 From: Arun Siluvery To: intel-gfx@lists.freedesktop.org Date: Wed, 10 Feb 2016 15:50:04 +0000 Message-Id: <1455119410-17283-4-git-send-email-arun.siluvery@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455119410-17283-1-git-send-email-arun.siluvery@linux.intel.com> References: <1455119410-17283-1-git-send-email-arun.siluvery@linux.intel.com> Cc: Mika Kuoppala Subject: [Intel-gfx] [PATCH v2 3/9] drm/i915/error: report ctx id & desc for each request in the queue 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.4 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: Dave Gordon Also decode and output CSB entries, in time order For: VIZ-2021 Signed-off-by: Dave Gordon Signed-off-by: Arun Siluvery --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_gpu_error.c | 37 +++++++++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 84bbd98..cb8de49 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -568,6 +568,7 @@ struct drm_i915_error_state { } *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page; struct drm_i915_error_request { + uint64_t ctx_desc; long jiffies; u32 seqno; u32 tail; diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index d4d46ac..ac83f91 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -312,9 +312,25 @@ static void i915_ring_error_state(struct drm_i915_error_state_buf *m, err_printf(m, " EXECLIST_CSB_WR: 0x%08x\n", ring->execlist_csb_write_pointer); err_printf(m, " EXECLIST_CSB_RD: 0x%08x\n", ring->execlist_csb_read_pointer); - for (i = 0; i < 6; i++) { - err_printf(m, " EXECLIST_CSB[%d]: 0x%08x\n", i, ring->execlist_csb[i]); - err_printf(m, " EXECLIST_CTX[%d]: 0x%08x\n", i, ring->execlist_ctx[i]); +#define GEN8_CTX_STATUS_IDLE_ACTIVE (1 << 0) +#define GEN8_CTX_STATUS_PREEMPTED (1 << 1) +#define GEN8_CTX_STATUS_ELEMENT_SWITCH (1 << 2) +#define GEN8_CTX_STATUS_ACTIVE_IDLE (1 << 3) +#define GEN8_CTX_STATUS_COMPLETE (1 << 4) +#define GEN8_CTX_STATUS_LITE_RESTORE (1 << 15) + + for (i = 1; i <= GEN8_CSB_ENTRIES; ++i) { + int n = (ring->execlist_csb_write_pointer + i) % GEN8_CSB_ENTRIES; + u32 csb = ring->execlist_csb[n]; + err_printf(m, " EXECLIST_CTX/CSB[%d]: 0x%08x 0x%08x ", + n, ring->execlist_ctx[n], csb); + err_printf(m, "%s %s %s %s %s %s\n", + csb & GEN8_CTX_STATUS_IDLE_ACTIVE ? "I->A" : " ", + csb & GEN8_CTX_STATUS_PREEMPTED ? "PRMT" : " ", + csb & GEN8_CTX_STATUS_ELEMENT_SWITCH ? "ELSW" : " ", + csb & GEN8_CTX_STATUS_ACTIVE_IDLE ? "A->I" : " ", + csb & GEN8_CTX_STATUS_COMPLETE ? "DONE" : " ", + csb & GEN8_CTX_STATUS_LITE_RESTORE ? "LITE" : " "); } } } @@ -470,10 +486,13 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m, dev_priv->ring[i].name, error->ring[i].num_requests); for (j = 0; j < error->ring[i].num_requests; j++) { - err_printf(m, " seqno 0x%08x, emitted %ld, tail 0x%08x\n", - error->ring[i].requests[j].seqno, - error->ring[i].requests[j].jiffies, - error->ring[i].requests[j].tail); + struct drm_i915_error_request *erq; + erq = &error->ring[i].requests[j]; + err_printf(m, " seqno 0x%08x, tail 0x%08x, " + "emitted %ld, ctx_desc 0x%08x_%08x\n", + erq->seqno, erq->tail, erq->jiffies, + upper_32_bits(erq->ctx_desc), + lower_32_bits(erq->ctx_desc)); } } @@ -1132,6 +1151,7 @@ static void i915_gem_record_rings(struct drm_device *dev, count = 0; list_for_each_entry(request, &ring->request_list, list) { + struct intel_context *ctx = request->ctx; struct drm_i915_error_request *erq; if (count >= error->ring[i].num_requests) { @@ -1154,8 +1174,9 @@ static void i915_gem_record_rings(struct drm_device *dev, } erq = &error->ring[i].requests[count++]; - erq->seqno = request->seqno; + erq->ctx_desc = intel_lr_context_descriptor(ctx, ring); erq->jiffies = request->emitted_jiffies; + erq->seqno = request->seqno; erq->tail = request->postfix; } }