summaryrefslogtreecommitdiff
path: root/src/northbridge
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@gmail.com>2020-03-30 22:18:45 -0500
committerMatt DeVillier <matt.devillier@gmail.com>2020-04-02 20:32:34 +0000
commitfd054bc7d46b870a225abffd9f0eb0351dd3c56a (patch)
treea21cc121fec79d5440476aa2fbefbaee7af80a25 /src/northbridge
parent33f89eea9ff9ebfcdf95b1eaf66daa92edee4969 (diff)
nb/intel/i945: 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: I68848516fab2058d4aa96ac0342c883fd1df2d6d Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/39958 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/i945/gma.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/northbridge/intel/i945/gma.c b/src/northbridge/intel/i945/gma.c
index c26ffb4bf5..f5a964ab82 100644
--- a/src/northbridge/intel/i945/gma.c
+++ b/src/northbridge/intel/i945/gma.c
@@ -755,25 +755,11 @@ static void gma_func1_init(struct device *dev)
pci_write_config8(dev, 0xf4, 0xff);
}
-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(0x2, 0);
- if (!dev)
- return NULL;
- struct northbridge_intel_i945_config *chip = dev->chip_info;
- if (!chip)
- return NULL;
- 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_i945_config *chip = device->chip_info;
- drivers_intel_gma_displays_ssdt_generate(gfx);
+ drivers_intel_gma_displays_ssdt_generate(&chip->gfx);
}
static void gma_func0_read_resources(struct device *dev)
@@ -829,7 +815,7 @@ static struct device_operations gma_func0_ops = {
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = gma_func0_init,
- .acpi_fill_ssdt = gma_ssdt,
+ .acpi_fill_ssdt = gma_generate_ssdt,
.scan_bus = 0,
.enable = 0,
.disable = gma_func0_disable,