From patchwork Tue May 3 14:19:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 9004251 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5C64CBF29F for ; Tue, 3 May 2016 14:19:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8045E2010C for ; Tue, 3 May 2016 14:19:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 914BE20270 for ; Tue, 3 May 2016 14:19:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 234A76E890; Tue, 3 May 2016 14:19:45 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F3B46E88F for ; Tue, 3 May 2016 14:19:44 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 03 May 2016 07:19:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,572,1455004800"; d="scan'208";a="971596430" Received: from jnikula-mobl.fi.intel.com (HELO localhost) ([10.237.72.67]) by fmsmga002.fm.intel.com with ESMTP; 03 May 2016 07:19:43 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Date: Tue, 3 May 2016 17:19:05 +0300 Message-Id: <1398889b49d8d456e27333efb83f45373417ae76.1462285023.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Cc: jani.nikula@intel.com Subject: [Intel-gfx] [PATCH i-g-t 15/17] tools/intel_bios_reader: add --all-panels option to dump all panels 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=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Only dump the one matching panel_type by default. Cleans up the output, and allows the users to get more verbose output if he so chooses. Signed-off-by: Jani Nikula --- tools/intel_bios_reader.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/intel_bios_reader.c b/tools/intel_bios_reader.c index 029cb48fb4cf..3e5df3007520 100644 --- a/tools/intel_bios_reader.c +++ b/tools/intel_bios_reader.c @@ -67,6 +67,7 @@ struct context { uint32_t devid; int panel_type; + bool dump_all_panel_types; bool hexdump; }; @@ -513,6 +514,9 @@ static void dump_lvds_data(struct context *context, (const struct bdb_lvds_lfp_data_entry *)lfp_data_ptr; char marker; + if (i != context->panel_type && !context->dump_all_panel_types) + continue; + if (i == context->panel_type) marker = '*'; else @@ -628,6 +632,9 @@ static void dump_edp(struct context *context, int i; for (i = 0; i < 16; i++) { + if (i != context->panel_type && !context->dump_all_panel_types) + continue; + printf("\tPanel %d%s\n", i, context->panel_type == i ? " *" : ""); printf("\t\tPower Sequence: T3 %d T7 %d T9 %d T10 %d T12 %d\n", @@ -1402,6 +1409,7 @@ enum opt { OPT_FILE, OPT_DEVID, OPT_PANEL_TYPE, + OPT_ALL_PANELS, OPT_HEXDUMP, OPT_BLOCK, }; @@ -1430,6 +1438,7 @@ int main(int argc, char **argv) { "file", required_argument, NULL, OPT_FILE }, { "devid", required_argument, NULL, OPT_DEVID }, { "panel-type", required_argument, NULL, OPT_PANEL_TYPE }, + { "all-panels", no_argument, NULL, OPT_ALL_PANELS }, { "hexdump", no_argument, NULL, OPT_HEXDUMP }, { "block", required_argument, NULL, OPT_BLOCK }, { 0 } @@ -1457,6 +1466,9 @@ int main(int argc, char **argv) return EXIT_FAILURE; } break; + case OPT_ALL_PANELS: + context.dump_all_panel_types = true; + break; case OPT_HEXDUMP: context.hexdump = true; break;