From patchwork Tue Oct 8 18:18:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 3004741 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BEB259F1E1 for ; Tue, 8 Oct 2013 18:23:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 04D9620172 for ; Tue, 8 Oct 2013 18:23:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E661B2016D for ; Tue, 8 Oct 2013 18:23:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DA185E6FF2 for ; Tue, 8 Oct 2013 11:23:51 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id B07E3E6FAE for ; Tue, 8 Oct 2013 11:21:17 -0700 (PDT) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 08 Oct 2013 11:21:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="4.90,1057,1371106800"; d="scan'208"; a="305079823" Received: from junemccl-mobl.ger.corp.intel.com (HELO localhost) ([10.252.120.196]) by AZSMGA002.ch.intel.com with ESMTP; 08 Oct 2013 11:21:15 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Date: Tue, 8 Oct 2013 21:18:14 +0300 Message-Id: <21992fc9e380c1519a878a912c7d7c6788bc0dca.1381256177.git.jani.nikula@intel.com> X-Mailer: git-send-email 1.7.10.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] [IGT PATCH 2/2] intel_opregion_decode: decipher bclm table X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.5 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 Signed-off-by: Jani Nikula --- tools/intel_opregion_decode.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/intel_opregion_decode.c b/tools/intel_opregion_decode.c index e5f79df..8a9ef20 100644 --- a/tools/intel_opregion_decode.c +++ b/tools/intel_opregion_decode.c @@ -258,8 +258,18 @@ static void decode_asle(const void *buffer) printf("\tcblv:\t0x%08x\n", asle->cblv); printf("\tbclm:\n"); - for (i = 0; i < ARRAY_SIZE(asle->bclm); i++) - printf("\t\tbclm[%d]:\t0x%04x\n", i, asle->bclm[i]); + for (i = 0; i < ARRAY_SIZE(asle->bclm); i++) { + int valid = asle->bclm[i] & (1 << 15); + int percentage = (asle->bclm[i] & 0x7f00) >> 8; + int duty_cycle = asle->bclm[i] & 0xff; + + printf("\t\tbclm[%d]:\t0x%04x", i, asle->bclm[i]); + if (valid) + printf(" (%3d%% -> 0x%02x)\n", percentage, duty_cycle); + else + printf("\n"); + + } printf("\tcpfm:\t0x%08x\n", asle->cpfm); printf("\tepfm:\t0x%08x\n", asle->epfm);