From patchwork Tue Oct 10 23:02:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Justen X-Patchwork-Id: 9998127 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 08556601AE for ; Tue, 10 Oct 2017 23:04:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE40328706 for ; Tue, 10 Oct 2017 23:04:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E30F028744; Tue, 10 Oct 2017 23:04:42 +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 F15CF28706 for ; Tue, 10 Oct 2017 23:04:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DEC3B6E546; Tue, 10 Oct 2017 23:04:39 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1CBE66E546 for ; Tue, 10 Oct 2017 23:04:38 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 10 Oct 2017 16:04:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,359,1503385200"; d="scan'208";a="908692661" Received: from dpturley-mobl1.amr.corp.intel.com (HELO jljusten-skl.amr.corp.intel.com) ([10.255.229.103]) by FMSMGA003.fm.intel.com with ESMTP; 10 Oct 2017 16:04:37 -0700 From: Jordan Justen To: Intel GFX discussion Date: Tue, 10 Oct 2017 16:02:18 -0700 Message-Id: <20171010230218.19948-1-jordan.l.justen@intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170915003424.2322-1-jordan.l.justen@intel.com> References: <20170915003424.2322-1-jordan.l.justen@intel.com> Subject: [Intel-gfx] [PATCH i-g-t] intel_aubdump: Add device override names (from Mesa INTEL_DEVID_OVERRIDE) 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 This just lets you specify an override like --device=bdw for broadwell. Signed-off-by: Jordan Justen --- Resend with 'i-g-t' in subject line. tools/aubdump.c | 36 ++++++++++++++++++++++++++++++++---- tools/intel_aubdump.in | 4 +++- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/tools/aubdump.c b/tools/aubdump.c index ee4d99b0..f3efb451 100644 --- a/tools/aubdump.c +++ b/tools/aubdump.c @@ -60,6 +60,24 @@ static int verbose = 0; static bool device_override; static uint32_t device; +static const struct { + const char *name; + int pci_id; +} name_map[] = { + { "brw", 0x2a02 }, + { "g4x", 0x2a42 }, + { "ilk", 0x0042 }, + { "snb", 0x0126 }, + { "ivb", 0x016a }, + { "hsw", 0x0d2e }, + { "byt", 0x0f33 }, + { "bdw", 0x162e }, + { "skl", 0x1912 }, + { "kbl", 0x5912 }, + { "cnl", 0x5a52 }, + /* Note: also update list in intel_aubdump.in */ +}; + #define MAX_BO_COUNT 64 * 1024 struct bo { @@ -570,10 +588,20 @@ maybe_init(void) if (!strcmp(key, "verbose")) { verbose = 1; } else if (!strcmp(key, "device")) { - fail_if(sscanf(value, "%i", &device) != 1, - "intel_aubdump: failed to parse device id '%s'", - value); - device_override = true; + unsigned i; + for (i = 0; i < ARRAY_SIZE(name_map); i++) { + if (!strcmp(name_map[i].name, value)) { + device = name_map[i].pci_id; + device_override = true; + break; + } + } + if (i >= ARRAY_SIZE(name_map)) { + fail_if(sscanf(value, "%i", &device) != 1, + "intel_aubdump: failed to parse device id '%s'", + value); + device_override = true; + } } else if (!strcmp(key, "file")) { filename = strdup(value); files[0] = fopen(filename, "w+"); diff --git a/tools/intel_aubdump.in b/tools/intel_aubdump.in index 977fe951..f9a92d86 100755 --- a/tools/intel_aubdump.in +++ b/tools/intel_aubdump.in @@ -13,7 +13,9 @@ contents and execution of the GEM application. -c, --command=CMD Execute CMD and write the AUB file's content to its standard input - --device=ID Override PCI ID of the reported device + --device=ID Override PCI ID of the reported device. ID may be an + integer, or one of: brw, g4x, ilk, snb, ivb, hsw, byt, + bdw, skl, kbl or cnl -v Enable verbose output