drivers/intel/gma: Reapply cached brightness once BCLM is valid

The OS replays _BCM requests while the graphics driver is
still reinitializing, so hardware brightness can diverge
from what we cached in BRLV. Reapply the cached level once
the OpRegion is ready to keep firmware and OS state aligned.

Change-Id: I2e6ed0936b2e74f55a2c760e7f4fcf56a2e02c53
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90029
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Sean Rhodes 2025-11-13 20:06:08 +00:00 committed by Matt DeVillier
commit 2d78478345

View file

@ -175,6 +175,23 @@
}
Local0 = ^LEGA.XBQC ()
If (Local0 != BRLV)
{
/*
* The OS replays _BCM requests while the graphics driver is
* still reinitializing, so hardware brightness can diverge
* from what we cached in BRLV. Reapply the cached level once
* the OpRegion is ready to keep firmware and OS state aligned.
* Use BRCT flag to prevent recursion.
*/
If (BRCT == 0)
{
BRCT = 1
XBCM (BRLV)
Local0 = ^LEGA.XBQC ()
BRCT = 0
}
}
BRLV = Local0
Return (Local0)
}