drivers/intel/gma: Fix OpRegion Mailbox3 backlight change

We should always update BCLP, no matter if the driver is ready yet to
process the request. This way it will hold the current value when the
driver initializes.

Change-Id: I4b091d744f95da39abe542966f0a8589a187573b
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/28300
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Nico Huber 2018-08-23 21:52:05 +02:00 committed by Martin Roth
parent 661907cdb4
commit 58344fc2e7
1 changed files with 9 additions and 6 deletions

View File

@ -2,6 +2,7 @@
* This file is part of the coreboot project. * This file is part of the coreboot project.
* *
* Copyright (C) 2015 Nico Huber <nico.huber@secunet.com> * Copyright (C) 2015 Nico Huber <nico.huber@secunet.com>
* Copyright (C) 2018 Nico Huber <nico.h@gmx.de>
* Copyright (C) 2018 Patrick Rudolph * Copyright (C) 2018 Patrick Rudolph
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -64,19 +65,21 @@
{ {
Return (Ones) Return (Ones)
} }
If (LEqual(ARDY, Zero))
{
Return (Ones)
}
/* BCLP requires brightness unsigned 8bit. 255 = 100 % */ /* Always keep BCLP up to date, even if driver is not ready.
It requires a full 8-bit brightness value. 255 = 100% */
Store (Divide (Multiply (Arg0, 255), 100), Local1) Store (Divide (Multiply (Arg0, 255), 100), Local1)
If (LGreater(Local1, 255)) { If (LGreater(Local1, 255)) {
Store (255, Local1) Store (255, Local1)
} }
/* set valid bit */ /* also set valid bit */
Store (Or (Local1, 0x80000000), BCLP) Store (Or (Local1, 0x80000000), BCLP)
If (LEqual(ARDY, Zero))
{
Return (Ones)
}
/* Request back-light change */ /* Request back-light change */
Store (0x2, ASLC) Store (0x2, ASLC)
/* Trigger IRQ */ /* Trigger IRQ */