Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39949 )
Change subject: nb/intel/sandybridge: Simplify GMA SSDT generator ......................................................................
nb/intel/sandybridge: Simplify GMA SSDT generator
Simplify generation of GMA SSDT, using updated naming convention. If acpi_fill_ssdt_generator is being invoked, then we know the IGD device is present and enabled, so we can skip those checks. Only check we need is if a given board has supplied the i915 controller info to populate the SSDT.
Change-Id: If34ebe0edc46674244c9d5afc7ed165c2ad685ba Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/northbridge/intel/sandybridge/gma.c 1 file changed, 6 insertions(+), 17 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/39949/1
diff --git a/src/northbridge/intel/sandybridge/gma.c b/src/northbridge/intel/sandybridge/gma.c index 1680b1e..4dd34a9 100644 --- a/src/northbridge/intel/sandybridge/gma.c +++ b/src/northbridge/intel/sandybridge/gma.c @@ -640,24 +640,13 @@ intel_gma_restore_opregion(); }
-const struct i915_gpu_controller_info *intel_gma_get_controller_info(void) +static void gma_generate_ssdt(struct device *device) { - struct device *dev = pcidev_on_root(2, 0); - if (!dev) { - return NULL; - } - struct northbridge_intel_sandybridge_config *chip = dev->chip_info; - return &chip->gfx; -} + const struct northbridge_intel_sandybridge_config *chip = device->chip_info; + const struct i915_gpu_controller_info *gfx = &chip->gfx;
-static void gma_ssdt(struct device *device) -{ - const struct i915_gpu_controller_info *gfx = intel_gma_get_controller_info(); - if (!gfx) { - return; - } - - drivers_intel_gma_displays_ssdt_generate(gfx); + if (gfx) + drivers_intel_gma_displays_ssdt_generate(gfx); }
static unsigned long gma_write_acpi_tables(struct device *const dev, unsigned long current, @@ -710,7 +699,7 @@ .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, - .acpi_fill_ssdt_generator = gma_ssdt, + .acpi_fill_ssdt_generator = gma_generate_ssdt, .init = gma_func0_init, .scan_bus = NULL, .enable = NULL,