From patchwork Wed Mar 25 13:42:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 6090951 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 555D99F318 for ; Wed, 25 Mar 2015 13:42:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 77BBF2034C for ; Wed, 25 Mar 2015 13:42:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 90FD9202C8 for ; Wed, 25 Mar 2015 13:42:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2FE826E045; Wed, 25 Mar 2015 06:42:15 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 135B36E045 for ; Wed, 25 Mar 2015 06:42:13 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 25 Mar 2015 06:42:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,465,1422950400"; d="scan'208";a="703969409" Received: from rosetta.fi.intel.com (HELO rosetta) ([10.237.72.58]) by orsmga002.jf.intel.com with ESMTP; 25 Mar 2015 06:42:12 -0700 Received: by rosetta (Postfix, from userid 1000) id 02C1580056; Wed, 25 Mar 2015 15:42:14 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Wed, 25 Mar 2015 15:42:11 +0200 Message-Id: <1427290932-5156-2-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427290932-5156-1-git-send-email-mika.kuoppala@intel.com> References: <1427290932-5156-1-git-send-email-mika.kuoppala@intel.com> Subject: [Intel-gfx] [PATCH 2/3] tools/intel_error_decode: Add decodings for FAULT_REG 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Add decodings for FAULT_REG Signed-off-by: Mika Kuoppala --- tools/intel_error_decode.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c index fb4a2a4..553307f 100644 --- a/tools/intel_error_decode.c +++ b/tools/intel_error_decode.c @@ -380,6 +380,27 @@ print_fence(unsigned int devid, uint64_t fence) } } +static void +print_fault_reg(unsigned devid, uint32_t reg) +{ + const char *type[] = { "Page", "Invalid PD", + "Unloaded PD", "Invalid and Unloaded PD" }; + const char *engine[] = { "GFX", "MFX0", "MFX1", "VEBX", "BLT" }; + + if (reg & (1 << 0)) + printf(" Valid\n"); + else + return; + + printf(" %s (%s)\n", type[reg >> 1 & 0x3], + reg & (1 << 11) ? "GGTT" : "PPGTT"); + printf(" Engine %s (Source ID %d)\n", engine[reg >> 12 & 0x3], + reg >> 3 & 0xff); + + if (intel_gen(devid) < 8) + printf(" Address 0x%08x\n", reg & ~((1 << 12)-1)); +} + #define MAX_RINGS 10 /* I really hope this never... */ uint32_t head[MAX_RINGS]; int head_ndx = 0; @@ -520,6 +541,10 @@ read_data_file(FILE *file) if (matched == 2) print_fence(devid, fence); + matched = sscanf(line, " FAULT_REG: 0x%08x\n", ®); + if (matched == 1 && reg) + print_fault_reg(devid, reg); + continue; }