summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2011-05-06 13:14:25 -0700
committerOwain G. Ainsworth <oga@openbsd.org>2011-05-30 00:17:05 +0100
commit1707b4bac0a1d3350113ec35b9efb52e1fd08dca (patch)
tree523dfbff83d1eb05efd1473b5df10659ca9929ee
parente808087b286acb1f8a674170c2e5d544ab93b710 (diff)
Remove the static list of PciChipset and construct it from SymTabRec instead.
This is one less place the new hardware enabler has to spam the chipset in. The PciChipset is just a match structure from PciId to the SymTabRec entry token, and our SymTabRec entry tokens are just the PciId, so it's trivial to construct. Acked-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 792738adfc5164d30358f045875dfc9b199a46da) Conflicts: src/intel_module.c
-rw-r--r--src/intel_module.c53
1 files changed, 11 insertions, 42 deletions
diff --git a/src/intel_module.c b/src/intel_module.c
index 500e6867..df8ae146 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -180,44 +180,6 @@ static const struct pci_id_match intel_device_match[] = {
{ 0, 0, 0 },
};
-static PciChipsets intel_pci_chipsets[] = {
- {PCI_CHIP_I810, PCI_CHIP_I810, NULL},
- {PCI_CHIP_I810_DC100, PCI_CHIP_I810_DC100, NULL},
- {PCI_CHIP_I810_E, PCI_CHIP_I810_E, NULL},
- {PCI_CHIP_I815, PCI_CHIP_I815, NULL},
- {PCI_CHIP_I830_M, PCI_CHIP_I830_M, NULL},
- {PCI_CHIP_845_G, PCI_CHIP_845_G, NULL},
- {PCI_CHIP_I854, PCI_CHIP_I854, NULL},
- {PCI_CHIP_I855_GM, PCI_CHIP_I855_GM, NULL},
- {PCI_CHIP_I865_G, PCI_CHIP_I865_G, NULL},
- {PCI_CHIP_I915_G, PCI_CHIP_I915_G, NULL},
- {PCI_CHIP_E7221_G, PCI_CHIP_E7221_G, NULL},
- {PCI_CHIP_I915_GM, PCI_CHIP_I915_GM, NULL},
- {PCI_CHIP_I945_G, PCI_CHIP_I945_G, NULL},
- {PCI_CHIP_I945_GM, PCI_CHIP_I945_GM, NULL},
- {PCI_CHIP_I945_GME, PCI_CHIP_I945_GME, NULL},
- {PCI_CHIP_PINEVIEW_M, PCI_CHIP_PINEVIEW_M, NULL},
- {PCI_CHIP_PINEVIEW_G, PCI_CHIP_PINEVIEW_G, NULL},
- {PCI_CHIP_I965_G, PCI_CHIP_I965_G, NULL},
- {PCI_CHIP_G35_G, PCI_CHIP_G35_G, NULL},
- {PCI_CHIP_I965_Q, PCI_CHIP_I965_Q, NULL},
- {PCI_CHIP_I946_GZ, PCI_CHIP_I946_GZ, NULL},
- {PCI_CHIP_I965_GM, PCI_CHIP_I965_GM, NULL},
- {PCI_CHIP_I965_GME, PCI_CHIP_I965_GME, NULL},
- {PCI_CHIP_G33_G, PCI_CHIP_G33_G, NULL},
- {PCI_CHIP_Q35_G, PCI_CHIP_Q35_G, NULL},
- {PCI_CHIP_Q33_G, PCI_CHIP_Q33_G, NULL},
- {PCI_CHIP_GM45_GM, PCI_CHIP_GM45_GM, NULL},
- {PCI_CHIP_G45_E_G, PCI_CHIP_G45_E_G, NULL},
- {PCI_CHIP_G45_G, PCI_CHIP_G45_G, NULL},
- {PCI_CHIP_Q45_G, PCI_CHIP_Q45_G, NULL},
- {PCI_CHIP_G41_G, PCI_CHIP_G41_G, NULL},
- {PCI_CHIP_B43_G, PCI_CHIP_B43_G, NULL},
- {PCI_CHIP_IRONLAKE_D_G, PCI_CHIP_IRONLAKE_D_G, NULL},
- {PCI_CHIP_IRONLAKE_M_G, PCI_CHIP_IRONLAKE_M_G, NULL},
- {-1, -1, NULL }
-};
-
void intel_detect_chipset(ScrnInfoPtr scrn,
struct pci_device *pci,
struct intel_chipset *chipset)
@@ -286,13 +248,20 @@ static Bool intel_pci_probe (DriverPtr driver,
struct pci_device *device,
intptr_t match_data)
{
- ScrnInfoPtr scrn = NULL;
+ ScrnInfoPtr scrn;
+ PciChipsets intel_pci_chipsets[ARRAY_SIZE(intel_chipsets)];
+ int i;
chipset_info = (void *)match_data;
- scrn = xf86ConfigPciEntity(scrn, 0, entity_num, intel_pci_chipsets,
- NULL,
- NULL, NULL, NULL, NULL);
+ for (i = 0; i < ARRAY_SIZE(intel_chipsets); i++) {
+ intel_pci_chipsets[i].numChipset = intel_chipsets[i].token;
+ intel_pci_chipsets[i].PCIid = intel_chipsets[i].token;
+ intel_pci_chipsets[i].dummy = NULL;
+ }
+
+ scrn = xf86ConfigPciEntity(NULL, 0, entity_num, intel_pci_chipsets,
+ NULL, NULL, NULL, NULL, NULL);
if (scrn != NULL) {
scrn->driverVersion = INTEL_VERSION;
scrn->driverName = INTEL_DRIVER_NAME;