summaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@gmail.com>2024-01-16 18:44:27 -0600
committerFelix Held <felix-coreboot@felixheld.de>2024-02-14 22:05:57 +0000
commit2981e7999e0bf2203c31701c4df5cd3164fa6d65 (patch)
tree9428b5eb70e4346b1f8e81b120ddd7613792580b /src/drivers
parent8f47aa8c937693e9b3fe3d4a6b34cfc80734af16 (diff)
downloadcoreboot-2981e7999e0bf2203c31701c4df5cd3164fa6d65.tar.gz
coreboot-2981e7999e0bf2203c31701c4df5cd3164fa6d65.tar.bz2
coreboot-2981e7999e0bf2203c31701c4df5cd3164fa6d65.zip
drv/gfx/generic: Add Intel ACPI Backlight funcs for LCD devices
Normally this would be done by the Intel GMA driver, but we can't have two copies of the _DOD method, so generate the LCD backlight controls here to allow use of this driver instead of the default GMA panel definition. TEST=build/boot Win11 on google/byra (redrix), ensure ACPI brightness controls functional. Change-Id: Ic8fbaf7550405f8c6f36012c8efadb8c36b968c2 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80061 Reviewed-by: Martin L Roth <gaumless@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/gfx/generic/generic.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/drivers/gfx/generic/generic.c b/src/drivers/gfx/generic/generic.c
index cd323142dac4..0714565b2d6a 100644
--- a/src/drivers/gfx/generic/generic.c
+++ b/src/drivers/gfx/generic/generic.c
@@ -140,6 +140,42 @@ static void gfx_fill_ssdt_generator(const struct device *dev)
if (config->device[i].use_pld)
acpigen_write_pld(&config->device[i].pld);
+ /* Generate ACPI brightness controls for LCD on Intel iGPU */
+ if (CONFIG(INTEL_GMA_ACPI) && strcmp(config->device[i].name, "LCD0") == 0) {
+ /*
+ Method (_BCL, 0, NotSerialized)
+ {
+ Return (^^XBCL())
+ }
+ */
+ acpigen_write_method("_BCL", 0);
+ acpigen_emit_byte(RETURN_OP);
+ acpigen_emit_namestring("^^XBCL");
+ acpigen_pop_len();
+
+ /*
+ Method (_BCM, 1, NotSerialized)
+ {
+ ^^XBCM(Arg0)
+ }
+ */
+ acpigen_write_method("_BCM", 1);
+ acpigen_emit_namestring("^^XBCM");
+ acpigen_emit_byte(ARG0_OP);
+ acpigen_pop_len();
+
+ /*
+ Method (_BQC, 0, NotSerialized)
+ {
+ Return (^^XBQC())
+ }
+ */
+ acpigen_write_method("_BQC", 0);
+ acpigen_emit_byte(RETURN_OP);
+ acpigen_emit_namestring("^^XBQC");
+ acpigen_pop_len();
+ }
+
acpigen_pop_len(); /* Device */
}
acpigen_pop_len(); /* Scope */