[IGT PATCH 2/2] intel_opregion_decode: decipher bclm table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux