summaryrefslogtreecommitdiff
path: root/src/northbridge
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@gmail.com>2020-03-30 19:20:54 -0500
committerMatt DeVillier <matt.devillier@gmail.com>2020-04-02 20:32:06 +0000
commit41c4eb5fa686431f9831f337de5e9f3895633d56 (patch)
treef0cd595df08f956b2647b44709a8602b8553b96f /src/northbridge
parentae51bb4ba962b6e3a0ae9fea71df530ce4d7999b (diff)
nb/intel/haswell: Simplify GMA SSDT generator
Simplify generation of GMA SSDT, using updated naming convention. If acpi_fill_ssdt is being invoked, then we know the IGD device is present and enabled, so we can skip those checks. And the SSDT generator now checks that the gfx struct is populated, so we can skip that too. Change-Id: Icd9caf622dd4c46b13589ebb772138b25888752f Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/39948 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/northbridge')
-rw-r--r--src/northbridge/intel/haswell/gma.c37
1 files changed, 12 insertions, 25 deletions
diff --git a/src/northbridge/intel/haswell/gma.c b/src/northbridge/intel/haswell/gma.c
index c0eaf6dfdb..4c11bd1c64 100644
--- a/src/northbridge/intel/haswell/gma.c
+++ b/src/northbridge/intel/haswell/gma.c
@@ -524,24 +524,11 @@ static void gma_func0_init(struct device *dev)
intel_gma_restore_opregion();
}
-const struct i915_gpu_controller_info *intel_gma_get_controller_info(void)
+static void gma_generate_ssdt(struct device *dev)
{
- struct device *dev = pcidev_on_root(2, 0);
- if (!dev) {
- return NULL;
- }
- struct northbridge_intel_haswell_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) {
- return;
- }
+ const struct northbridge_intel_haswell_config *chip = dev->chip_info;
- drivers_intel_gma_displays_ssdt_generate(gfx);
+ drivers_intel_gma_displays_ssdt_generate(&chip->gfx);
}
static unsigned long gma_write_acpi_tables(struct device *const dev, unsigned long current,
@@ -573,15 +560,15 @@ static struct pci_operations gma_pci_ops = {
};
static struct device_operations gma_func0_ops = {
- .read_resources = pci_dev_read_resources,
- .set_resources = pci_dev_set_resources,
- .enable_resources = pci_dev_enable_resources,
- .init = gma_func0_init,
- .acpi_fill_ssdt = gma_ssdt,
- .scan_bus = NULL,
- .enable = NULL,
- .ops_pci = &gma_pci_ops,
- .write_acpi_tables = gma_write_acpi_tables,
+ .read_resources = pci_dev_read_resources,
+ .set_resources = pci_dev_set_resources,
+ .enable_resources = pci_dev_enable_resources,
+ .init = gma_func0_init,
+ .acpi_fill_ssdt = gma_generate_ssdt,
+ .scan_bus = NULL,
+ .enable = NULL,
+ .ops_pci = &gma_pci_ops,
+ .write_acpi_tables = gma_write_acpi_tables,
};
static const unsigned short pci_device_ids[] = {