From patchwork Wed Feb 10 15:50:03 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: 8272931 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 D20F69FC36 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 3311D203DA 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 5597820270 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 E1B286E1C2; Wed, 10 Feb 2016 07:50:20 -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 54F836E1C2 for ; Wed, 10 Feb 2016 07:50:18 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP; 10 Feb 2016 07:50:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,426,1449561600"; d="scan'208";a="45646700" Received: from asiluver-linux.isw.intel.com ([10.102.226.117]) by fmsmga004.fm.intel.com with ESMTP; 10 Feb 2016 07:50:17 -0800 From: Arun Siluvery To: intel-gfx@lists.freedesktop.org Date: Wed, 10 Feb 2016 15:50:03 +0000 Message-Id: <1455119410-17283-3-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 2/9] drm/i915/error: capture ringbuffer pointed to by START 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 For: VIZ-2021 Signed-off-by: Dave Gordon --- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/i915_gpu_error.c | 36 +++++++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 6cca108..84bbd98 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -565,7 +565,7 @@ struct drm_i915_error_state { int page_count; u64 gtt_offset; u32 *pages[0]; - } *ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page; + } *req_ringbuffer, *hw_ringbuffer, *batchbuffer, *wa_batchbuffer, *ctx, *hws_page; struct drm_i915_error_request { long jiffies; diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 8efc8f9a..d4d46ac 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -477,13 +477,20 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m, } } - if ((obj = error->ring[i].ringbuffer)) { + if ((obj = error->ring[i].req_ringbuffer)) { err_printf(m, "%s --- ringbuffer = 0x%08x\n", dev_priv->ring[i].name, lower_32_bits(obj->gtt_offset)); print_error_obj(m, obj); } + if ((obj = error->ring[i].hw_ringbuffer)) { + err_printf(m, "%s --- HW ringbuffer = 0x%08x\n", + dev_priv->ring[i].name, + lower_32_bits(obj->gtt_offset)); + print_error_obj(m, obj); + } + if ((obj = error->ring[i].hws_page)) { u64 hws_offset = obj->gtt_offset; u32 *hws_page = &obj->pages[0][0]; @@ -594,7 +601,8 @@ static void i915_error_state_free(struct kref *error_ref) for (i = 0; i < ARRAY_SIZE(error->ring); i++) { i915_error_object_free(error->ring[i].batchbuffer); i915_error_object_free(error->ring[i].wa_batchbuffer); - i915_error_object_free(error->ring[i].ringbuffer); + i915_error_object_free(error->ring[i].req_ringbuffer); + i915_error_object_free(error->ring[i].hw_ringbuffer); i915_error_object_free(error->ring[i].hws_page); i915_error_object_free(error->ring[i].ctx); kfree(error->ring[i].requests); @@ -1006,19 +1014,27 @@ static void i915_gem_record_active_context(struct intel_engine_cs *ring, { struct drm_i915_private *dev_priv = ring->dev->dev_private; struct drm_i915_gem_object *obj; - - /* Currently render ring is the only HW context user */ - if (ring->id != RCS || !error->ccid) - return; + u64 base; list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) { if (!i915_gem_obj_ggtt_bound(obj)) continue; - if ((error->ccid & PAGE_MASK) == i915_gem_obj_ggtt_offset(obj)) { - ering->ctx = i915_error_ggtt_object_create(dev_priv, obj); - break; + base = i915_gem_obj_ggtt_offset(obj); + + if (base == ering->start) { + ering->hw_ringbuffer = i915_error_ggtt_object_create(dev_priv, obj); + continue; } + + if (!error->ccid) + continue; + + if (i915.enable_execlists) + base += LRC_PPHWSP_PN * PAGE_SIZE; + + if (base == (error->ccid & PAGE_MASK)) + ering->ctx = i915_error_ggtt_object_create(dev_priv, obj); } } @@ -1093,7 +1109,7 @@ static void i915_gem_record_rings(struct drm_device *dev, error->ring[i].cpu_ring_head = rbuf->head; error->ring[i].cpu_ring_tail = rbuf->tail; - error->ring[i].ringbuffer = + error->ring[i].req_ringbuffer = i915_error_ggtt_object_create(dev_priv, rbuf->obj); error->ring[i].hws_page =