From 2981e7999e0bf2203c31701c4df5cd3164fa6d65 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Tue, 16 Jan 2024 18:44:27 -0600 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/80061 Reviewed-by: Martin L Roth Tested-by: build bot (Jenkins) --- src/drivers/gfx/generic/generic.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/drivers/gfx/generic/generic.c b/src/drivers/gfx/generic/generic.c index cd323142da..0714565b2d 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 */ -- cgit v1.2.3