From patchwork Fri Oct 27 18:01:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: oscar.mateo@intel.com X-Patchwork-Id: 10030401 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 DDF4A6022E for ; Fri, 27 Oct 2017 18:01:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB79C28FAA for ; Fri, 27 Oct 2017 18:01:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D02A828FBB; Fri, 27 Oct 2017 18:01:20 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 67CA628FAA for ; Fri, 27 Oct 2017 18:01:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E75846E9B1; Fri, 27 Oct 2017 18:01:19 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 357ED6E9B3 for ; Fri, 27 Oct 2017 18:01:17 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Oct 2017 11:01:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.44,304,1505804400"; d="scan'208"; a="1236250406" Received: from omateolo-linux.fm.intel.com ([10.1.27.13]) by fmsmga002.fm.intel.com with ESMTP; 27 Oct 2017 11:01:15 -0700 From: Oscar Mateo To: intel-gfx@lists.freedesktop.org Date: Fri, 27 Oct 2017 11:01:13 -0700 Message-Id: <1509127275-22121-11-git-send-email-oscar.mateo@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509127275-22121-1-git-send-email-oscar.mateo@intel.com> References: <1509127275-22121-1-git-send-email-oscar.mateo@intel.com> Cc: Chris Wilson Subject: [Intel-gfx] [RFC PATCH 10/12] drm/i915: Always add BOs to capture list if AubCrash is enabled 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 If we want the AUB file to be complete (and, therefore, more useful) we need to capture all BOs in use, we cannot leave that to the UMD as before. Signed-off-by: Oscar Mateo Cc: Chris Wilson --- drivers/gpu/drm/i915/i915_aubcrash.h | 12 ++++++++++++ drivers/gpu/drm/i915/i915_gem_execbuffer.c | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_aubcrash.h b/drivers/gpu/drm/i915/i915_aubcrash.h index 2eed388..b42307e 100644 --- a/drivers/gpu/drm/i915/i915_aubcrash.h +++ b/drivers/gpu/drm/i915/i915_aubcrash.h @@ -37,6 +37,12 @@ void i915_error_page_walk(struct i915_address_space *vm, int i915_error_state_to_aub(struct drm_i915_error_state_buf *m, const struct i915_gpu_state *error); +static inline bool i915_error_state_should_capture(struct i915_vma *vma, + struct i915_vma *batch) +{ + return ((INTEL_GEN(vma->vm->i915) >= 8) && (vma != batch)); +} + #else static inline void i915_error_record_ppgtt(struct i915_gpu_state *error, @@ -62,6 +68,12 @@ static inline int i915_error_state_to_aub(struct drm_i915_error_state_buf *m, return 0; } +static inline bool i915_error_state_should_capture(struct i915_vma *vma, + struct i915_vma *batch) +{ + return false; +} + #endif #endif diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 3d71907..47559a4 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -38,6 +38,7 @@ #include "i915_drv.h" #include "i915_gem_clflush.h" #include "i915_trace.h" +#include "i915_aubcrash.h" #include "intel_drv.h" #include "intel_frontbuffer.h" @@ -1758,7 +1759,8 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb) struct i915_vma *vma = eb->vma[i]; struct drm_i915_gem_object *obj = vma->obj; - if (flags & EXEC_OBJECT_CAPTURE) { + if ((flags & EXEC_OBJECT_CAPTURE) || + i915_error_state_should_capture(vma, eb->batch)) { struct i915_gem_capture_list *capture; capture = kmalloc(sizeof(*capture), GFP_KERNEL);