From patchwork Fri Feb 24 20:01:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Thierry X-Patchwork-Id: 9591123 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 225756042B for ; Fri, 24 Feb 2017 20:01:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 166DC28949 for ; Fri, 24 Feb 2017 20:01:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B80E2894C; Fri, 24 Feb 2017 20:01:28 +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 C4B8B28949 for ; Fri, 24 Feb 2017 20:01:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6958F6ED16; Fri, 24 Feb 2017 20:01:25 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9E7C66ED11 for ; Fri, 24 Feb 2017 20:01:23 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2017 12:01:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.35,201,1484035200"; d="scan'208"; a="1134547403" Received: from relo-linux-11.sc.intel.com ([10.3.160.214]) by fmsmga002.fm.intel.com with ESMTP; 24 Feb 2017 12:01:22 -0800 From: Michel Thierry To: intel-gfx@lists.freedesktop.org Date: Fri, 24 Feb 2017 12:01:21 -0800 Message-Id: <20170224200122.2571-2-michel.thierry@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170224200122.2571-1-michel.thierry@intel.com> References: <20170224200122.2571-1-michel.thierry@intel.com> Subject: [Intel-gfx] [PATCH v2 2/3] drm/i915: Include GuC fw version in error state 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 There was no way to check if the platform is running the latest firmware. v2: use HAS_GUC and intel_guc* (Michal) capture before reset (Chris) v3: if version is 0, the fw was not loaded. Cc: Chris Wilson Cc: Michal Wajdeczko Cc: Tvrtko Ursulin Cc: Arkadiusz Hiler Reviewed-by: Michal Wajdeczko Reviewed-by: Chris Wilson Signed-off-by: Michel Thierry --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_gpu_error.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 47f8d5e47c8f..37cda64f07ad 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -955,6 +955,7 @@ struct i915_gpu_state { /* Firmware load state */ u32 dmc_version; + u32 guc_version; u32 nfence; u64 fence[I915_MAX_NUM_FENCES]; diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 4e6cf705c779..bb1b9e916638 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -629,6 +629,13 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m, CSR_VERSION_MINOR(error->dmc_version)); } + if (HAS_GUC(dev_priv)) { + err_printf(m, "GuC loaded: %s\n", yesno(error->guc_version)); + err_printf(m, "GuC fw version: %d.%d\n", + error->guc_version >> 16, + error->guc_version & 0xffff); + } + err_printf(m, "EIR: 0x%08x\n", error->eir); err_printf(m, "IER: 0x%08x\n", error->ier); for (i = 0; i < error->ngtier; i++) @@ -1591,6 +1598,14 @@ static void i915_capture_fw_state(struct drm_i915_private *dev_priv, error->dmc_version = csr->version; } + + if (HAS_GUC(dev_priv)) { + struct intel_guc *guc = &dev_priv->guc; + + error->guc_version = + (guc->fw.major_ver_found << 16 | + guc->fw.minor_ver_found); + } } static void i915_error_capture_msg(struct drm_i915_private *dev_priv,