Matthew Garrett has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32549
Change subject: SKL: Add ACPI brightness control ......................................................................
SKL: Add ACPI brightness control
Hook up the generic src/drivers/intel/gma ACPI backlight control for Skylake. Based on a patch by Matt DeVillier matt.devillier@gmail.com.
Signed-off-by: Matthew Garrett mjg59@google.com Change-Id: I993770fdcd0a28cee756df2bd6a795498f175952 --- M src/soc/intel/common/block/graphics/graphics.c M src/soc/intel/common/block/include/intelblocks/graphics.h M src/soc/intel/skylake/acpi/globalnvs.asl M src/soc/intel/skylake/acpi/pch.asl M src/soc/intel/skylake/chip.h M src/soc/intel/skylake/graphics.c M src/soc/intel/skylake/include/soc/nvs.h 7 files changed, 40 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/32549/1
diff --git a/src/soc/intel/common/block/graphics/graphics.c b/src/soc/intel/common/block/graphics/graphics.c index 5d3b4a1..6489e8e 100644 --- a/src/soc/intel/common/block/graphics/graphics.c +++ b/src/soc/intel/common/block/graphics/graphics.c @@ -33,6 +33,10 @@ pci_dev_init(dev); }
+__weak void gma_ssdt(struct device *dev) +{ +} + static uintptr_t graphics_get_bar(unsigned long index) { struct device *dev = SA_DEV_IGD; @@ -104,6 +108,7 @@ .init = graphics_soc_init, .ops_pci = &pci_dev_ops_pci, .write_acpi_tables = graphics_soc_write_acpi_opregion, + .acpi_fill_ssdt_generator = gma_ssdt, };
static const unsigned short pci_device_ids[] = { diff --git a/src/soc/intel/common/block/include/intelblocks/graphics.h b/src/soc/intel/common/block/include/intelblocks/graphics.h index 6be7661..077f0db 100644 --- a/src/soc/intel/common/block/include/intelblocks/graphics.h +++ b/src/soc/intel/common/block/include/intelblocks/graphics.h @@ -51,4 +51,7 @@ void graphics_gtt_rmw(unsigned long reg, uint32_t andmask, uint32_t ormask); uintptr_t graphics_get_memory_base(void);
+void gma_ssdt(struct device *dev); +struct i915_gpu_controller_info *intel_igd_get_controller_info(void); + #endif /* SOC_INTEL_COMMON_BLOCK_GRAPHICS_H */ diff --git a/src/soc/intel/skylake/acpi/globalnvs.asl b/src/soc/intel/skylake/acpi/globalnvs.asl index c4544e8..6963f70 100644 --- a/src/soc/intel/skylake/acpi/globalnvs.asl +++ b/src/soc/intel/skylake/acpi/globalnvs.asl @@ -70,6 +70,9 @@ EPCS, 8, // 0x43 - SGX Enabled status EMNA, 64, // 0x44 - 0x4B EPC base address ELNG, 64, // 0x4C - 0x53 EPC Length + BRTL, 32, // 0x54 - 0x57 Brightness Level + CSTE, 16, // 0x58 - 0x59 Current display state + NSTE, 16, // 0x5a - 0x5b Next display state
/* IGD OpRegion */ Offset (0xb4), diff --git a/src/soc/intel/skylake/acpi/pch.asl b/src/soc/intel/skylake/acpi/pch.asl index 0aba2e7..f0095bc 100644 --- a/src/soc/intel/skylake/acpi/pch.asl +++ b/src/soc/intel/skylake/acpi/pch.asl @@ -56,6 +56,9 @@ /* USB XHCI 0:14.0 */ #include "xhci.asl"
+/* Graphics */ +#include <drivers/intel/gma/acpi/pch.asl> + Method (_OSC, 4) { /* Check for proper GUID */ diff --git a/src/soc/intel/skylake/chip.h b/src/soc/intel/skylake/chip.h index 57d51e7..51bb740 100644 --- a/src/soc/intel/skylake/chip.h +++ b/src/soc/intel/skylake/chip.h @@ -22,6 +22,7 @@ #include <arch/acpi_device.h> #include <device/i2c_simple.h> #include <drivers/i2c/designware/dw_i2c.h> +#include <drivers/intel/gma/i915.h> #include <intelblocks/chip.h> #include <intelblocks/gspi.h> #include <intelblocks/lpc_lib.h> @@ -580,6 +581,8 @@
/* Enable/Disable Sata power optimization */ u8 SataPwrOptEnable; + + struct i915_gpu_controller_info gfx; };
typedef struct soc_intel_skylake_config config_t; diff --git a/src/soc/intel/skylake/graphics.c b/src/soc/intel/skylake/graphics.c index 07ee67a..1be5f9d 100644 --- a/src/soc/intel/skylake/graphics.c +++ b/src/soc/intel/skylake/graphics.c @@ -122,3 +122,22 @@ printk(BIOS_DEBUG, "current = %lx\n", current); return current; } + +struct i915_gpu_controller_info *intel_igd_get_controller_info(void) +{ + struct device *dev = dev_find_slot(0, PCI_DEVFN(0x2, 0)); + if (!dev) + return NULL; + struct soc_intel_skylake_config *chip = dev->chip_info; + return &chip->gfx; +} + +void gma_ssdt(struct device *dev) +{ + struct i915_gpu_controller_info *gfx = intel_igd_get_controller_info(); + + if (!gfx) + return; + + drivers_intel_gma_displays_ssdt_generate(gfx); +} diff --git a/src/soc/intel/skylake/include/soc/nvs.h b/src/soc/intel/skylake/include/soc/nvs.h index 72b1ac9..5a2ca38 100644 --- a/src/soc/intel/skylake/include/soc/nvs.h +++ b/src/soc/intel/skylake/include/soc/nvs.h @@ -60,7 +60,10 @@ u8 ecps; /* 0x43 - SGX Enabled status */ u64 emna; /* 0x44 - 0x4B EPC base address */ u64 elng; /* 0x4C - 0x53 EPC Length */ - u8 rsvd[96]; + u32 brtl; /* 0x54 - 0x57 Brightness Level */ + u16 cste; /* 0x58 - 0x59 Current display state */ + u16 nste; /* 0x5a - 0x5b Next display state */ + u8 rsvd[88];
/* IGD OpRegion */ u32 aslb; /* 0xb4 - IGD OpRegion Base Address */
Hello Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32549
to look at the new patch set (#2).
Change subject: SKL: Add ACPI brightness control ......................................................................
SKL: Add ACPI brightness control
Hook up the generic src/drivers/intel/gma ACPI backlight control for Skylake. Based on a patch by Matt DeVillier matt.devillier@gmail.com.
Signed-off-by: Matthew Garrett mjg59@google.com Change-Id: I993770fdcd0a28cee756df2bd6a795498f175952 --- M src/soc/intel/common/block/graphics/graphics.c M src/soc/intel/common/block/include/intelblocks/graphics.h M src/soc/intel/skylake/acpi/globalnvs.asl M src/soc/intel/skylake/acpi/pch.asl M src/soc/intel/skylake/chip.h M src/soc/intel/skylake/graphics.c M src/soc/intel/skylake/include/soc/nvs.h 7 files changed, 40 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/32549/2
Hello Patrick Rudolph, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32549
to look at the new patch set (#3).
Change subject: SKL: Add ACPI brightness control ......................................................................
SKL: Add ACPI brightness control
Hook up the generic src/drivers/intel/gma ACPI backlight control for Skylake. Based on a patch by Matt DeVillier matt.devillier@gmail.com.
Signed-off-by: Matthew Garrett mjg59@google.com Change-Id: I993770fdcd0a28cee756df2bd6a795498f175952 --- M src/soc/intel/common/block/graphics/graphics.c M src/soc/intel/common/block/include/intelblocks/graphics.h M src/soc/intel/skylake/acpi/globalnvs.asl M src/soc/intel/skylake/chip.h M src/soc/intel/skylake/graphics.c M src/soc/intel/skylake/include/soc/nvs.h 6 files changed, 37 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/32549/3
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: SKL: Add ACPI brightness control ......................................................................
Patch Set 3: Code-Review+1
Maxim Polyakov has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: SKL: Add ACPI brightness control ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/#/c/32549/3/src/soc/intel/skylake/graphics.c File src/soc/intel/skylake/graphics.c:
https://review.coreboot.org/#/c/32549/3/src/soc/intel/skylake/graphics.c@129 PS3, Line 129: if (!dev) It would be better if you use !dev || !dev->enabled here
Hello Patrick Rudolph, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32549
to look at the new patch set (#4).
Change subject: SKL: Add ACPI brightness control ......................................................................
SKL: Add ACPI brightness control
Hook up the generic src/drivers/intel/gma ACPI backlight control for Skylake. Based on a patch by Matt DeVillier matt.devillier@gmail.com.
Signed-off-by: Matthew Garrett mjg59@google.com Change-Id: I993770fdcd0a28cee756df2bd6a795498f175952 --- M src/soc/intel/common/block/graphics/graphics.c M src/soc/intel/common/block/include/intelblocks/graphics.h M src/soc/intel/skylake/acpi/globalnvs.asl M src/soc/intel/skylake/chip.h M src/soc/intel/skylake/graphics.c M src/soc/intel/skylake/include/soc/nvs.h 6 files changed, 37 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/32549/4
Matthew Garrett has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: SKL: Add ACPI brightness control ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/#/c/32549/3/src/soc/intel/skylake/graphics.c File src/soc/intel/skylake/graphics.c:
https://review.coreboot.org/#/c/32549/3/src/soc/intel/skylake/graphics.c@129 PS3, Line 129: if (!dev)
It would be better if you use !dev || !dev->enabled here
Done
Maxim Polyakov has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: SKL: Add ACPI brightness control ......................................................................
Patch Set 4: Code-Review+1
Hello Patrick Rudolph, Maxim Polyakov, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32549
to look at the new patch set (#5).
Change subject: SKL: Add ACPI brightness control ......................................................................
SKL: Add ACPI brightness control
Hook up the generic src/drivers/intel/gma ACPI backlight control for Skylake. Based on a patch by Matt DeVillier matt.devillier@gmail.com.
Signed-off-by: Matthew Garrett mjg59@google.com Change-Id: I993770fdcd0a28cee756df2bd6a795498f175952 --- M src/soc/intel/common/block/graphics/graphics.c M src/soc/intel/common/block/include/intelblocks/graphics.h M src/soc/intel/skylake/acpi/globalnvs.asl M src/soc/intel/skylake/chip.h M src/soc/intel/skylake/graphics.c M src/soc/intel/skylake/include/soc/nvs.h 6 files changed, 37 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/32549/5
Maxim Polyakov has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: SKL: Add ACPI brightness control ......................................................................
Patch Set 5: Code-Review+1
Sumeet R Pawnikar has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: SKL: Add ACPI brightness control ......................................................................
Patch Set 5:
(3 comments)
https://review.coreboot.org/#/c/32549/5/src/soc/intel/skylake/acpi/globalnvs... File src/soc/intel/skylake/acpi/globalnvs.asl:
https://review.coreboot.org/#/c/32549/5/src/soc/intel/skylake/acpi/globalnvs... PS5, Line 74: Put a tab here instead of spaces.
https://review.coreboot.org/#/c/32549/5/src/soc/intel/skylake/acpi/globalnvs... PS5, Line 75: same as above.
https://review.coreboot.org/#/c/32549/5/src/soc/intel/skylake/graphics.c File src/soc/intel/skylake/graphics.c:
https://review.coreboot.org/#/c/32549/5/src/soc/intel/skylake/graphics.c@128 PS5, Line 128: 0x2 Add info on this value as comment. If possible make this as #define.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: SKL: Add ACPI brightness control ......................................................................
Patch Set 5:
(5 comments)
https://review.coreboot.org/#/c/32549/5/src/soc/intel/common/block/graphics/... File src/soc/intel/common/block/graphics/graphics.c:
https://review.coreboot.org/#/c/32549/5/src/soc/intel/common/block/graphics/... PS5, Line 38: } The only platform specific part seems to be the pointer in the chip config. So we could also move the implementation here and add a weak intel_igd_get_controller_info(dev) that returns NULL.
https://review.coreboot.org/#/c/32549/5/src/soc/intel/skylake/acpi/globalnvs... File src/soc/intel/skylake/acpi/globalnvs.asl:
https://review.coreboot.org/#/c/32549/5/src/soc/intel/skylake/acpi/globalnvs... PS5, Line 73: BRTL, 32, // 0x54 - 0x57 Brightness Level I don't see this used anywhere.
https://review.coreboot.org/#/c/32549/5/src/soc/intel/skylake/acpi/globalnvs... PS5, Line 74: CSTE, 16, // 0x58 - 0x59 Current display state : NSTE, 16, // 0x5a - 0x5b Next display state Why add this to GNVS? It seems they are only used in ASL code. So wouldn't it be the same to just add them as named variables? (e.g. `Name (CSTE, 0)`)
https://review.coreboot.org/#/c/32549/5/src/soc/intel/skylake/graphics.c File src/soc/intel/skylake/graphics.c:
https://review.coreboot.org/#/c/32549/5/src/soc/intel/skylake/graphics.c@128 PS5, Line 128: 0x2
Add info on this value as comment. If possible make this as #define.
The `dev` here should be the same as the `dev` passed to gma_ssdt() below...
https://review.coreboot.org/#/c/32549/5/src/soc/intel/skylake/graphics.c@130 PS5, Line 130: return NULL; ...and it should only be called when the device is enabled.
Benjamin Doron has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: SKL: Add ACPI brightness control ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/32549/5/src/soc/intel/skylake/graph... File src/soc/intel/skylake/graphics.c:
https://review.coreboot.org/c/coreboot/+/32549/5/src/soc/intel/skylake/graph... PS5, Line 128: 0x2
The `dev` here should be the same as the `dev` passed to […]
Device 2 on the System Agent is iGFX. Perhaps "SA_DEV_IGD" from pci_devs.h could be used, but device number doesn't seem to vary, as Tigerlake (the latest architecture at this time in the tree?) uses the same number.
Matt DeVillier has uploaded a new patch set (#6) to the change originally created by Matthew Garrett. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: soc/intel/common: Hook up GMA ACPI brightness controls ......................................................................
soc/intel/common: Hook up GMA ACPI brightness controls
Add framework to hook up the generic src/drivers/intel/gma ACPI backlight control for platforms using SOC_INTEL_COMMON_BLOCK_GRAPHICS. Add a weak function to get the struct i915_gpu_controller_info needed to generate the SSDT, defaulting to NULL, which SoC's will override.
Each SoC will need to override intel_igd_get_controller_info, and individual boards will need to populate the struct in order for the backlight control methods to be added to the SSDT.
Change-Id: I993770fdcd0a28cee756df2bd6a795498f175952 Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/soc/intel/common/block/graphics/graphics.c M src/soc/intel/common/block/include/intelblocks/graphics.h 2 files changed, 25 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/32549/6
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: soc/intel/common: Hook up GMA ACPI brightness controls ......................................................................
Patch Set 6:
(3 comments)
https://review.coreboot.org/c/coreboot/+/32549/6/src/soc/intel/common/block/... File src/soc/intel/common/block/graphics/graphics.c:
https://review.coreboot.org/c/coreboot/+/32549/6/src/soc/intel/common/block/... PS6, Line 36: struct Nit, could be const.
https://review.coreboot.org/c/coreboot/+/32549/6/src/soc/intel/common/block/... PS6, Line 41: unused Why not pass it along? it looks really odd, especially because we need to look it up inside intel_igd_get_controller_info() otherwise, and check for presence, enabled... If this function (or any of the `device_operations`) gets called, the passed `struct device *` is non-NULL and the device is enabled.
https://review.coreboot.org/c/coreboot/+/32549/6/src/soc/intel/common/block/... PS6, Line 43: struct Here too, in case.
Matt DeVillier has uploaded a new patch set (#7) to the change originally created by Matthew Garrett. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: soc/intel/common: Hook up GMA ACPI brightness controls ......................................................................
soc/intel/common: Hook up GMA ACPI brightness controls
Add framework to hook up the generic src/drivers/intel/gma ACPI backlight control for platforms using SOC_INTEL_COMMON_BLOCK_GRAPHICS. Add a weak function to get the struct i915_gpu_controller_info needed to generate the SSDT, defaulting to NULL, which SoC's will override.
Each SoC will need to override intel_igd_get_controller_info, and individual boards will need to populate the struct in order for the backlight control methods to be added to the SSDT.
Change-Id: I993770fdcd0a28cee756df2bd6a795498f175952 Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/soc/intel/common/block/graphics/graphics.c M src/soc/intel/common/block/include/intelblocks/graphics.h 2 files changed, 27 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/32549/7
Matt DeVillier has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: soc/intel/common: Hook up GMA ACPI brightness controls ......................................................................
Patch Set 7:
(3 comments)
https://review.coreboot.org/c/coreboot/+/32549/6/src/soc/intel/common/block/... File src/soc/intel/common/block/graphics/graphics.c:
https://review.coreboot.org/c/coreboot/+/32549/6/src/soc/intel/common/block/... PS6, Line 36: struct
Nit, could be const.
Done
https://review.coreboot.org/c/coreboot/+/32549/6/src/soc/intel/common/block/... PS6, Line 41: unused
Why not pass it along? it looks really odd, especially because we need to […]
Done
https://review.coreboot.org/c/coreboot/+/32549/6/src/soc/intel/common/block/... PS6, Line 43: struct
Here too, in case.
Done
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: soc/intel/common: Hook up GMA ACPI brightness controls ......................................................................
Patch Set 7: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/32549/7/src/soc/intel/common/block/... File src/soc/intel/common/block/graphics/graphics.c:
https://review.coreboot.org/c/coreboot/+/32549/7/src/soc/intel/common/block/... PS7, Line 37: * I think it's common to keep the asterisk on the first line in such a case, but I'm not sure.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: soc/intel/common: Hook up GMA ACPI brightness controls ......................................................................
Patch Set 7:
(7 comments)
https://review.coreboot.org/c/coreboot/+/32549/5/src/soc/intel/common/block/... File src/soc/intel/common/block/graphics/graphics.c:
https://review.coreboot.org/c/coreboot/+/32549/5/src/soc/intel/common/block/... PS5, Line 38: }
The only platform specific part seems to be the pointer in […]
Done
https://review.coreboot.org/c/coreboot/+/32549/5/src/soc/intel/skylake/acpi/... File src/soc/intel/skylake/acpi/globalnvs.asl:
https://review.coreboot.org/c/coreboot/+/32549/5/src/soc/intel/skylake/acpi/... PS5, Line 73: BRTL, 32, // 0x54 - 0x57 Brightness Level
I don't see this used anywhere.
Ack
https://review.coreboot.org/c/coreboot/+/32549/5/src/soc/intel/skylake/acpi/... PS5, Line 74:
Put a tab here instead of spaces.
Ack
https://review.coreboot.org/c/coreboot/+/32549/5/src/soc/intel/skylake/acpi/... PS5, Line 75:
same as above.
Ack
https://review.coreboot.org/c/coreboot/+/32549/5/src/soc/intel/skylake/acpi/... PS5, Line 74: CSTE, 16, // 0x58 - 0x59 Current display state : NSTE, 16, // 0x5a - 0x5b Next display state
Why add this to GNVS? It seems they are only used in […]
Done
https://review.coreboot.org/c/coreboot/+/32549/5/src/soc/intel/skylake/graph... File src/soc/intel/skylake/graphics.c:
https://review.coreboot.org/c/coreboot/+/32549/5/src/soc/intel/skylake/graph... PS5, Line 128: 0x2
Device 2 on the System Agent is iGFX. Perhaps "SA_DEV_IGD" from pci_devs. […]
Ack
https://review.coreboot.org/c/coreboot/+/32549/5/src/soc/intel/skylake/graph... PS5, Line 130: return NULL;
...and it should only be called when the device is enabled.
Ack
Matt DeVillier has uploaded a new patch set (#8) to the change originally created by Matthew Garrett. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: soc/intel/common: Hook up GMA ACPI brightness controls ......................................................................
soc/intel/common: Hook up GMA ACPI brightness controls
Add framework to hook up the generic src/drivers/intel/gma ACPI backlight control for platforms using SOC_INTEL_COMMON_BLOCK_GRAPHICS. Add a weak function to get the struct i915_gpu_controller_info needed to generate the SSDT, defaulting to NULL, which SoC's will override.
Each SoC will need to override intel_igd_get_controller_info, and individual boards will need to populate the struct in order for the backlight control methods to be added to the SSDT.
Change-Id: I993770fdcd0a28cee756df2bd6a795498f175952 Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/soc/intel/common/block/graphics/graphics.c M src/soc/intel/common/block/include/intelblocks/graphics.h 2 files changed, 27 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/32549/8
Matt DeVillier has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: soc/intel/common: Hook up GMA ACPI brightness controls ......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/c/coreboot/+/32549/7/src/soc/intel/common/block/... File src/soc/intel/common/block/graphics/graphics.c:
https://review.coreboot.org/c/coreboot/+/32549/7/src/soc/intel/common/block/... PS7, Line 37: *
I think it's common to keep the asterisk on the first line in such a case, […]
Done
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: soc/intel/common: Hook up GMA ACPI brightness controls ......................................................................
Patch Set 8: Code-Review+2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: soc/intel/common: Hook up GMA ACPI brightness controls ......................................................................
Patch Set 8: Code-Review+2
Nico Huber has submitted this change. ( https://review.coreboot.org/c/coreboot/+/32549 )
Change subject: soc/intel/common: Hook up GMA ACPI brightness controls ......................................................................
soc/intel/common: Hook up GMA ACPI brightness controls
Add framework to hook up the generic src/drivers/intel/gma ACPI backlight control for platforms using SOC_INTEL_COMMON_BLOCK_GRAPHICS. Add a weak function to get the struct i915_gpu_controller_info needed to generate the SSDT, defaulting to NULL, which SoC's will override.
Each SoC will need to override intel_igd_get_controller_info, and individual boards will need to populate the struct in order for the backlight control methods to be added to the SSDT.
Change-Id: I993770fdcd0a28cee756df2bd6a795498f175952 Signed-off-by: Matt DeVillier matt.devillier@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/32549 Reviewed-by: Nico Huber nico.h@gmx.de Reviewed-by: Angel Pons th3fanbus@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/intel/common/block/graphics/graphics.c M src/soc/intel/common/block/include/intelblocks/graphics.h 2 files changed, 27 insertions(+), 7 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/src/soc/intel/common/block/graphics/graphics.c b/src/soc/intel/common/block/graphics/graphics.c index efbc3e7..e1eb6fe 100644 --- a/src/soc/intel/common/block/graphics/graphics.c +++ b/src/soc/intel/common/block/graphics/graphics.c @@ -18,6 +18,7 @@ #include <device/mmio.h> #include <device/pci.h> #include <device/pci_ids.h> +#include <drivers/intel/gma/i915.h> #include <intelblocks/graphics.h> #include <soc/pci_devs.h>
@@ -32,6 +33,20 @@ pci_dev_init(dev); }
+__weak const struct i915_gpu_controller_info * +intel_igd_get_controller_info(struct device *device) +{ + return NULL; +} + +static void gma_generate_ssdt(struct device *device) +{ + const struct i915_gpu_controller_info *gfx = intel_igd_get_controller_info(device); + + if (gfx) + drivers_intel_gma_displays_ssdt_generate(gfx); +} + static int is_graphics_disabled(struct device *dev) { /* Check if Graphics PCI device is disabled */ @@ -111,15 +126,16 @@ }
static const struct device_operations graphics_ops = { - .read_resources = pci_dev_read_resources, - .set_resources = pci_dev_set_resources, - .enable_resources = pci_dev_enable_resources, - .init = graphics_soc_init, - .ops_pci = &pci_dev_ops_pci, + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, + .init = graphics_soc_init, + .ops_pci = &pci_dev_ops_pci, #if CONFIG(HAVE_ACPI_TABLES) - .write_acpi_tables = graphics_soc_write_acpi_opregion, + .write_acpi_tables = graphics_soc_write_acpi_opregion, + .acpi_fill_ssdt_generator = gma_generate_ssdt, #endif - .scan_bus = scan_generic_bus, + .scan_bus = scan_generic_bus, };
static const unsigned short pci_device_ids[] = { diff --git a/src/soc/intel/common/block/include/intelblocks/graphics.h b/src/soc/intel/common/block/include/intelblocks/graphics.h index 8e98228..153f9d8 100644 --- a/src/soc/intel/common/block/include/intelblocks/graphics.h +++ b/src/soc/intel/common/block/include/intelblocks/graphics.h @@ -44,6 +44,10 @@ uintptr_t graphics_soc_write_acpi_opregion(struct device *device, uintptr_t current, struct acpi_rsdp *rsdp);
+/* i915 controller info for ACPI backlight controls */ +const struct i915_gpu_controller_info * +intel_igd_get_controller_info(struct device *device); + /* Graphics MMIO register read/write APIs */ uint32_t graphics_gtt_read(unsigned long reg); void graphics_gtt_write(unsigned long reg, uint32_t data);