Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39942 )
Change subject: soc/intel/baytrail: add ACPI backlight support ......................................................................
soc/intel/baytrail: 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: I0b7fc45bda3aaf89306bedb579fb1e9f8ce07926 Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/soc/intel/baytrail/chip.h M src/soc/intel/baytrail/gfx.c 2 files changed, 23 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/39942/1
diff --git a/src/soc/intel/baytrail/chip.h b/src/soc/intel/baytrail/chip.h index 0fa7eaf..52b1e33 100644 --- a/src/soc/intel/baytrail/chip.h +++ b/src/soc/intel/baytrail/chip.h @@ -18,6 +18,7 @@ #ifndef _BAYTRAIL_CHIP_H_ #define _BAYTRAIL_CHIP_H_
+#include <drivers/intel/gma/i915.h> #include <stdint.h>
struct soc_intel_baytrail_config { @@ -84,6 +85,8 @@ uint16_t gpu_pipeb_power_cycle_delay; int gpu_pipeb_pwm_freq_hz; int disable_ddr_2x_refresh_rate; + + struct i915_gpu_controller_info gfx; };
#endif /* _BAYTRAIL_CHIP_H_ */ diff --git a/src/soc/intel/baytrail/gfx.c b/src/soc/intel/baytrail/gfx.c index 417f36e..197c085 100644 --- a/src/soc/intel/baytrail/gfx.c +++ b/src/soc/intel/baytrail/gfx.c @@ -397,6 +397,25 @@ intel_gma_restore_opregion(); }
+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_baytrail_config *chip = dev->chip_info; + return &chip->gfx; +} + +static void gma_ssdt(struct device *device) +{ + const struct i915_gpu_controller_info *gfx = + intel_gma_get_controller_info(); + if (gfx) + drivers_intel_gma_displays_ssdt_generate(gfx); +} + static unsigned long gma_write_acpi_tables(struct device *const dev, unsigned long current, @@ -428,6 +447,7 @@ .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = gfx_init, + .acpi_fill_ssdt_generator = gma_ssdt, .ops_pci = &soc_pci_ops, .write_acpi_tables = gma_write_acpi_tables, };
Hello build bot (Jenkins), Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39942
to look at the new patch set (#2).
Change subject: soc/intel/baytrail: add ACPI backlight support ......................................................................
soc/intel/baytrail: 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: I0b7fc45bda3aaf89306bedb579fb1e9f8ce07926 Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/soc/intel/baytrail/chip.h M src/soc/intel/baytrail/gfx.c 2 files changed, 13 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/39942/2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39942 )
Change subject: soc/intel/baytrail: add ACPI backlight support ......................................................................
Patch Set 2: Code-Review+1
(2 comments)
https://review.coreboot.org/c/coreboot/+/39942/2/src/soc/intel/baytrail/gfx.... File src/soc/intel/baytrail/gfx.c:
https://review.coreboot.org/c/coreboot/+/39942/2/src/soc/intel/baytrail/gfx.... PS2, Line 400: device Everyone else seems to use "dev"
https://review.coreboot.org/c/coreboot/+/39942/2/src/soc/intel/baytrail/gfx.... PS2, Line 402: const struct soc_intel_baytrail_config *chip = device->chip_info; Will this ever dereference a null pointer?
Hello build bot (Jenkins), Angel Pons, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39942
to look at the new patch set (#3).
Change subject: soc/intel/baytrail: add ACPI backlight support ......................................................................
soc/intel/baytrail: 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: I0b7fc45bda3aaf89306bedb579fb1e9f8ce07926 Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/soc/intel/baytrail/chip.h M src/soc/intel/baytrail/gfx.c 2 files changed, 18 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/39942/3
Matt DeVillier has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39942 )
Change subject: soc/intel/baytrail: add ACPI backlight support ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/c/coreboot/+/39942/2/src/soc/intel/baytrail/gfx.... File src/soc/intel/baytrail/gfx.c:
https://review.coreboot.org/c/coreboot/+/39942/2/src/soc/intel/baytrail/gfx.... PS2, Line 400: device
Everyone else seems to use "dev"
Done
https://review.coreboot.org/c/coreboot/+/39942/2/src/soc/intel/baytrail/gfx.... PS2, Line 402: const struct soc_intel_baytrail_config *chip = device->chip_info;
Will this ever dereference a null pointer?
Done
Hello build bot (Jenkins), Angel Pons, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39942
to look at the new patch set (#4).
Change subject: soc/intel/baytrail: add ACPI backlight support ......................................................................
soc/intel/baytrail: 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: I0b7fc45bda3aaf89306bedb579fb1e9f8ce07926 Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/soc/intel/baytrail/chip.h M src/soc/intel/baytrail/gfx.c 2 files changed, 11 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/39942/4
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39942 )
Change subject: soc/intel/baytrail: add ACPI backlight support ......................................................................
Patch Set 4: Code-Review+2
Matt DeVillier has submitted this change. ( https://review.coreboot.org/c/coreboot/+/39942 )
Change subject: soc/intel/baytrail: add ACPI backlight support ......................................................................
soc/intel/baytrail: 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: I0b7fc45bda3aaf89306bedb579fb1e9f8ce07926 Signed-off-by: Matt DeVillier matt.devillier@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/39942 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/soc/intel/baytrail/chip.h M src/soc/intel/baytrail/gfx.c 2 files changed, 11 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/src/soc/intel/baytrail/chip.h b/src/soc/intel/baytrail/chip.h index 0fa7eaf..52b1e33 100644 --- a/src/soc/intel/baytrail/chip.h +++ b/src/soc/intel/baytrail/chip.h @@ -18,6 +18,7 @@ #ifndef _BAYTRAIL_CHIP_H_ #define _BAYTRAIL_CHIP_H_
+#include <drivers/intel/gma/i915.h> #include <stdint.h>
struct soc_intel_baytrail_config { @@ -84,6 +85,8 @@ uint16_t gpu_pipeb_power_cycle_delay; int gpu_pipeb_pwm_freq_hz; int disable_ddr_2x_refresh_rate; + + struct i915_gpu_controller_info gfx; };
#endif /* _BAYTRAIL_CHIP_H_ */ diff --git a/src/soc/intel/baytrail/gfx.c b/src/soc/intel/baytrail/gfx.c index 417f36e..e4ed6f3 100644 --- a/src/soc/intel/baytrail/gfx.c +++ b/src/soc/intel/baytrail/gfx.c @@ -397,6 +397,13 @@ intel_gma_restore_opregion(); }
+static void gma_generate_ssdt(struct device *dev) +{ + const struct soc_intel_baytrail_config *chip = dev->chip_info; + + drivers_intel_gma_displays_ssdt_generate(&chip->gfx); +} + static unsigned long gma_write_acpi_tables(struct device *const dev, unsigned long current, @@ -430,6 +437,7 @@ .init = gfx_init, .ops_pci = &soc_pci_ops, .write_acpi_tables = gma_write_acpi_tables, + .acpi_fill_ssdt = gma_generate_ssdt, };
static const struct pci_driver gfx_driver __pci_driver = {