[coreboot-gerrit] Change in coreboot[master]: drivers/intel/gma: store uint8_t brightness values in mailbox3

Alexander Couzens (Code Review) gerrit at coreboot.org
Sat Aug 25 12:29:06 CEST 2018


Alexander Couzens has uploaded this change for review. ( https://review.coreboot.org/28345


Change subject: drivers/intel/gma: store uint8_t brightness values in mailbox3
......................................................................

drivers/intel/gma: store uint8_t brightness values in mailbox3

The _BCM function requires a percentage value. While the
brightness in mailbox3 requires a value in uint8_t. Meaning 255 = 100%.
Previous implementation stored the percentage brightness value resulting
in limiting the brightness to ~40% of it's maximum power.

Only affects brightness control using mailbox3.

Fixes: 6838aaebf9ec ("drvs/intel/gma/acpi: Add methods to use MBOX3")
Change-Id: I290b5f5b2a8ee406e39e86d3e0de9997798d890d
Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
M src/drivers/intel/gma/acpi/configure_brightness_levels.asl
1 file changed, 8 insertions(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/28345/1

diff --git a/src/drivers/intel/gma/acpi/configure_brightness_levels.asl b/src/drivers/intel/gma/acpi/configure_brightness_levels.asl
index 8625f04..0867c5a 100644
--- a/src/drivers/intel/gma/acpi/configure_brightness_levels.asl
+++ b/src/drivers/intel/gma/acpi/configure_brightness_levels.asl
@@ -69,7 +69,14 @@
 				Return (Ones)
 			}
 
-			Store (Or (Arg0, 0x80000000), BCLP)
+			/* BCLP requires brightness unsigned 8bit. 255 = 100 % */
+			Store (Divide (Multiply (Arg0, 255), 100), Local1)
+			If (LGreater(Local1, 255)) {
+				Store (255, Local1)
+			}
+			/* set valid bit */
+			Store (Or (Local1, 0x80000000), BCLP)
+
 			/* Request back-light change */
 			Store (0x2, ASLC)
 			/* Trigger IRQ */

-- 
To view, visit https://review.coreboot.org/28345
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I290b5f5b2a8ee406e39e86d3e0de9997798d890d
Gerrit-Change-Number: 28345
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Couzens <lynxis at fe80.eu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180825/8935dfb8/attachment-0001.html>


More information about the coreboot-gerrit mailing list