Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39943 )
Change subject: soc/intel/braswell: add ACPI backlight support ......................................................................
soc/intel/braswell: add ACPI backlight support
Add framework to generate ACPI methods in SSDT for screen backlight control.
To make use of this, individual boards will need to include default_brightness_levels.asl in their dsdt, as well as add 'register "gfx" = "GMA_STATIC_DISPLAYS(0)"' to their devicetree.
Change-Id: I0adccc6c8bee71d3c1b7840518308c8dc8ea2d81 Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/soc/intel/braswell/chip.h M src/soc/intel/braswell/gfx.c 2 files changed, 23 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/39943/1
diff --git a/src/soc/intel/braswell/chip.h b/src/soc/intel/braswell/chip.h index 026e491..5f1aaee 100644 --- a/src/soc/intel/braswell/chip.h +++ b/src/soc/intel/braswell/chip.h @@ -21,6 +21,7 @@ #define _SOC_CHIP_H_
#include <stdint.h> +#include <drivers/intel/gma/i915.h> #include <fsp/util.h> #include <intelblocks/lpc_lib.h> #include <soc/pci_devs.h> @@ -169,6 +170,8 @@ uint8_t I2C4Frequency; uint8_t I2C5Frequency; uint8_t I2C6Frequency; + + struct i915_gpu_controller_info gfx; };
#endif /* _SOC_CHIP_H_ */ diff --git a/src/soc/intel/braswell/gfx.c b/src/soc/intel/braswell/gfx.c index ff73955..faef4c7 100644 --- a/src/soc/intel/braswell/gfx.c +++ b/src/soc/intel/braswell/gfx.c @@ -18,6 +18,7 @@ #include <device/pci.h> #include <device/pci_ids.h> #include <drivers/intel/gma/opregion.h> +#include <drivers/intel/gma/i915.h> #include <reg_script.h> #include <soc/gfx.h> #include <soc/nvs.h> @@ -87,10 +88,29 @@ gnvs_ptr->aslb = aslb; }
+const struct i915_gpu_controller_info * +intel_gma_get_controller_info(void) +{ + struct device *dev = pcidev_on_root(GFX_DEV, GFX_FUNC); + if (!dev || !dev->enabled) + return NULL; + + struct soc_intel_braswell_config *chip = dev->chip_info; + return &chip->gfx; +} + +static void gma_ssdt(struct device *dev) +{ + const struct i915_gpu_controller_info *gfx = intel_gma_get_controller_info(); + if (gfx) + drivers_intel_gma_displays_ssdt_generate(gfx); +} + static struct device_operations gfx_device_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, + .acpi_fill_ssdt_generator = gma_ssdt, .init = gfx_init, .ops_pci = &soc_pci_ops, };
Hello build bot (Jenkins), Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39943
to look at the new patch set (#2).
Change subject: soc/intel/braswell: add ACPI backlight support ......................................................................
soc/intel/braswell: add ACPI backlight support
Add framework to generate ACPI methods in SSDT for screen backlight control.
To make use of this, individual boards will need to include default_brightness_levels.asl in their dsdt, as well as add 'register "gfx" = "GMA_STATIC_DISPLAYS(0)"' to their devicetree.
Change-Id: I0adccc6c8bee71d3c1b7840518308c8dc8ea2d81 Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/soc/intel/braswell/chip.h M src/soc/intel/braswell/gfx.c 2 files changed, 14 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/39943/2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39943 )
Change subject: soc/intel/braswell: add ACPI backlight support ......................................................................
Patch Set 2: Code-Review+1
Hello build bot (Jenkins), Angel Pons, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39943
to look at the new patch set (#3).
Change subject: soc/intel/braswell: add ACPI backlight support ......................................................................
soc/intel/braswell: add ACPI backlight support
Add framework to generate ACPI methods in SSDT for screen backlight control.
To make use of this, individual boards will need to include default_brightness_levels.asl in their dsdt, as well as add 'register "gfx" = "GMA_STATIC_DISPLAYS(0)"' to their devicetree.
Change-Id: I0adccc6c8bee71d3c1b7840518308c8dc8ea2d81 Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/soc/intel/braswell/chip.h M src/soc/intel/braswell/gfx.c 2 files changed, 18 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/39943/3
Hello build bot (Jenkins), Angel Pons, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39943
to look at the new patch set (#4).
Change subject: soc/intel/braswell: add ACPI backlight support ......................................................................
soc/intel/braswell: add ACPI backlight support
Add hook to generate ACPI methods in SSDT for screen backlight control.
To make use of this, individual boards will need to include default_brightness_levels.asl in their dsdt, as well as add 'register "gfx" = "GMA_STATIC_DISPLAYS(0)"' to their devicetree.
Change-Id: I0adccc6c8bee71d3c1b7840518308c8dc8ea2d81 Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/soc/intel/braswell/chip.h M src/soc/intel/braswell/gfx.c 2 files changed, 12 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/39943/4
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39943 )
Change subject: soc/intel/braswell: add ACPI backlight support ......................................................................
Patch Set 4: Code-Review+2
Matt DeVillier has submitted this change. ( https://review.coreboot.org/c/coreboot/+/39943 )
Change subject: soc/intel/braswell: add ACPI backlight support ......................................................................
soc/intel/braswell: add ACPI backlight support
Add hook to generate ACPI methods in SSDT for screen backlight control.
To make use of this, individual boards will need to include default_brightness_levels.asl in their dsdt, as well as add 'register "gfx" = "GMA_STATIC_DISPLAYS(0)"' to their devicetree.
Change-Id: I0adccc6c8bee71d3c1b7840518308c8dc8ea2d81 Signed-off-by: Matt DeVillier matt.devillier@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/39943 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/soc/intel/braswell/chip.h M src/soc/intel/braswell/gfx.c 2 files changed, 12 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/src/soc/intel/braswell/chip.h b/src/soc/intel/braswell/chip.h index 026e491..5f1aaee 100644 --- a/src/soc/intel/braswell/chip.h +++ b/src/soc/intel/braswell/chip.h @@ -21,6 +21,7 @@ #define _SOC_CHIP_H_
#include <stdint.h> +#include <drivers/intel/gma/i915.h> #include <fsp/util.h> #include <intelblocks/lpc_lib.h> #include <soc/pci_devs.h> @@ -169,6 +170,8 @@ uint8_t I2C4Frequency; uint8_t I2C5Frequency; uint8_t I2C6Frequency; + + struct i915_gpu_controller_info gfx; };
#endif /* _SOC_CHIP_H_ */ diff --git a/src/soc/intel/braswell/gfx.c b/src/soc/intel/braswell/gfx.c index ff73955..12fe642 100644 --- a/src/soc/intel/braswell/gfx.c +++ b/src/soc/intel/braswell/gfx.c @@ -18,6 +18,7 @@ #include <device/pci.h> #include <device/pci_ids.h> #include <drivers/intel/gma/opregion.h> +#include <drivers/intel/gma/i915.h> #include <reg_script.h> #include <soc/gfx.h> #include <soc/nvs.h> @@ -87,12 +88,20 @@ gnvs_ptr->aslb = aslb; }
+static void gma_generate_ssdt(struct device *dev) +{ + const struct soc_intel_braswell_config *chip = dev->chip_info; + + drivers_intel_gma_displays_ssdt_generate(&chip->gfx); +} + static struct device_operations gfx_device_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = gfx_init, .ops_pci = &soc_pci_ops, + .acpi_fill_ssdt = gma_generate_ssdt, };
static const struct pci_driver gfx_driver __pci_driver = {
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39943 )
Change subject: soc/intel/braswell: add ACPI backlight support ......................................................................
Patch Set 5:
Automatic boot test returned (PASS/FAIL/TOTAL): 3/0/3 Emulation targets: EMULATION_QEMU_X86_Q35 using payload TianoCore : SUCCESS : https://lava.9esec.io/r/2011 EMULATION_QEMU_X86_Q35 using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/2010 EMULATION_QEMU_X86_I440FX using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/2009
Please note: This test is under development and might not be accurate at all!