[Intel-gfx] [IGT PATCH 2/2] intel_opregion_decode: decipher bclm table

Jani Nikula jani.nikula at intel.com
Tue Oct 8 20:18:14 CEST 2013


Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 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);
-- 
1.7.10.4




More information about the Intel-gfx mailing list