From patchwork Mon Aug 15 09:48:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9280691 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9030060839 for ; Mon, 15 Aug 2016 09:49:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80D1E28D25 for ; Mon, 15 Aug 2016 09:49:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75D8928D35; Mon, 15 Aug 2016 09:49:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3114C28D25 for ; Mon, 15 Aug 2016 09:49:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5284E6E3CD; Mon, 15 Aug 2016 09:49:22 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id D18336E3CA for ; Mon, 15 Aug 2016 09:49:20 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id o80so10242917wme.0 for ; Mon, 15 Aug 2016 02:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=7Z2dUoos/5ehMaLNCUOIIIb5+LdHDkaaVas7pxZpGv4=; b=Ueiy3kymRNScqPiMXYdCv4JMkb+EQiKXGvcOyadGeOIEiUnJNuZ02XWfsnGh2wl3Mt CODZv6mwPFdbJN5uBulRVRjXPHZHOY6GW4gUqyu79nk5Pr+HcH8RtRwBf9LWIQTwUeGc MpUSD5nxRQ8pScTuSL9vgT8YuVkB1dCRcfRzhqwcKjzaKfTfpbQXRrk6nvEhd7ZTBvFe kq/fML2MiVHnazgTOSiFCcWgc2wDYODsl9q05j5pWu4aIDBmhvUk/2IbftKX+3BdvU7g kQ1l0bz/Hfc1o4soF95yPOu/4WBBEnboF5VAiI3nh3do1iYLIbBqRMvuiVbGWsHHGv86 y1Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=7Z2dUoos/5ehMaLNCUOIIIb5+LdHDkaaVas7pxZpGv4=; b=EJvUHV0YZIXI+1zg2ATEoI6BQVqFU64Idc02e22CvdsaVhfdjEeXErQlLy4LfrkvO/ NGQLSNPzQ0vB2TYwyTcAJQWX+M4SOgPzZX2V2yu5Hr5uinNG3PIDxYs2ma/PJN+u5bfP Ta2/1ntQKhy+LYPQW7OHdfLWVkg4UOeSaZY6JaJ2d4KwYEB0TrnJzXLqUJla0rIXkNPd m37HsVX8Br4LbZmHAKWsbsjv9qVrcvxVnuqfN6UNeeLsxbp+w1B26O49qHNB9JUsKcZ6 3Qfs8hafA3NfMhvz41YaAgy4BhgDx425WZTjZe3VaWhWF0NiERam/9u56JkQg2MOG0vf 7CWQ== X-Gm-Message-State: AEkooutRCbBx4JuSQpgHRLyyjV7rLN0AtXFPNS4fJ0+HwxD88Hd2Q/P4fTCUIL0afR4UJw== X-Received: by 10.28.221.8 with SMTP id u8mr13228811wmg.61.1471254559287; Mon, 15 Aug 2016 02:49:19 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id v203sm15675247wmv.2.2016.08.15.02.49.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Aug 2016 02:49:18 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Mon, 15 Aug 2016 10:48:42 +0100 Message-Id: <1471254551-25805-3-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1471254551-25805-1-git-send-email-chris@chris-wilson.co.uk> References: <1471254551-25805-1-git-send-email-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [CI 03/32] drm/i915: Store the active context object on all engines upon error 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-Virus-Scanned: ClamAV using ClamSMTP With execlists, we have context objects everywhere, not just RCS. So store them for post-mortem debugging. This also has a secondary effect of removing one more unsafe list iteration with using preserved state from the hanging request. And now we can cross-reference the request's context state with that loaded by the GPU. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_gpu_error.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 1c098fa65fbe..d11630bac188 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -1043,28 +1043,6 @@ static void error_record_engine_registers(struct drm_i915_error_state *error, } } -static void i915_gem_record_active_context(struct intel_engine_cs *engine, - struct drm_i915_error_state *error, - struct drm_i915_error_engine *ee) -{ - struct drm_i915_private *dev_priv = engine->i915; - struct drm_i915_gem_object *obj; - - /* Currently render ring is the only HW context user */ - if (engine->id != RCS || !error->ccid) - return; - - 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)) { - ee->ctx = i915_error_ggtt_object_create(dev_priv, obj); - break; - } - } -} - static void i915_gem_record_rings(struct drm_i915_private *dev_priv, struct drm_i915_error_state *error) { @@ -1114,6 +1092,10 @@ static void i915_gem_record_rings(struct drm_i915_private *dev_priv, i915_error_ggtt_object_create(dev_priv, engine->scratch.obj); + ee->ctx = + i915_error_ggtt_object_create(dev_priv, + request->ctx->engine[i].state); + if (request->pid) { struct task_struct *task; @@ -1144,8 +1126,6 @@ static void i915_gem_record_rings(struct drm_i915_private *dev_priv, ee->wa_ctx = i915_error_ggtt_object_create(dev_priv, engine->wa_ctx.obj); - i915_gem_record_active_context(engine, error, ee); - count = 0; list_for_each_entry(request, &engine->request_list, link) count++;