From 2e96a71e6f9b306869a4c6fca6ae40506fc9727e Mon Sep 17 00:00:00 2001 From: Sean Rhodes Date: Mon, 10 Nov 2025 21:34:50 +0000 Subject: [PATCH] drivers/intel/gma: Cache brightness level Cache the brightness level requested via _BCM and return it from XBQC while the IGD OpRegion registers are still zeroed during S3 resume. Once BCLM is valid we refresh the cache with the hardware reading. This keeps _BQC from reporting zero after resume. Change-Id: I3f06c9cf6529da6d634d7b0368f0c88b468f0c45 Signed-off-by: Sean Rhodes Reviewed-on: https://review.coreboot.org/c/coreboot/+/89986 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- .../gma/acpi/configure_brightness_levels.asl | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/drivers/intel/gma/acpi/configure_brightness_levels.asl b/src/drivers/intel/gma/acpi/configure_brightness_levels.asl index b6c27fbe92..92ffbcbe55 100644 --- a/src/drivers/intel/gma/acpi/configure_brightness_levels.asl +++ b/src/drivers/intel/gma/acpi/configure_brightness_levels.asl @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ + Name (BRLV, 100) /* * Pseudo device that contains methods to modify Opregion * "Mailbox 3 BIOS to Driver Notification" @@ -147,6 +148,7 @@ Method (XBCM, 1, NotSerialized) { + BRLV = Arg0 If (^BOX3.XBCM (Arg0) == Ones) { /* @@ -163,9 +165,16 @@ Method (XBQC, 0, NotSerialized) { /* - * Always query the hardware directly. Not all OS drivers - * keep CBLV up to date (one is Linux' i915). Some years - * after that is fixed we can probably use CBLV? + * During early boot / resume the IGD driver has not yet populated + * the OpRegion brightness fields (BCLM stays zero), so fall back to + * the cached value we last exposed to the OS. */ - Return (^LEGA.XBQC ()) + If (BCLM == 0) + { + Return (BRLV) + } + + Local0 = ^LEGA.XBQC () + BRLV = Local0 + Return (Local0) }