From patchwork Sat May 7 00:08:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Anholt X-Patchwork-Id: 763632 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4709hJ0030108 for ; Sat, 7 May 2011 00:10:03 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3BB8C9EDD5 for ; Fri, 6 May 2011 17:09:43 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from annarchy.freedesktop.org (annarchy.freedesktop.org [131.252.210.176]) by gabe.freedesktop.org (Postfix) with ESMTP id BB7A29E733; Fri, 6 May 2011 17:08:57 -0700 (PDT) Received: from pollan.anholt.net (annarchy.freedesktop.org [127.0.0.1]) by annarchy.freedesktop.org (Postfix) with ESMTP id 55D5013004F; Fri, 6 May 2011 17:08:57 -0700 (PDT) Received: by pollan.anholt.net (Postfix, from userid 1000) id 3A1AE32C06C; Fri, 6 May 2011 17:08:56 -0700 (PDT) From: Eric Anholt To: intel-gfx@lists.freedesktop.org Date: Fri, 6 May 2011 17:08:54 -0700 Message-Id: <1304726935-8428-3-git-send-email-eric@anholt.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1304726935-8428-1-git-send-email-eric@anholt.net> References: <1304726935-8428-1-git-send-email-eric@anholt.net> Subject: [Intel-gfx] [PATCH 3/4] Remove the static list of PciChipset and construct it from SymTabRec instead. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 07 May 2011 00:10:03 +0000 (UTC) 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 --- src/intel_module.c | 53 +++++++-------------------------------------------- 1 files changed, 8 insertions(+), 45 deletions(-) diff --git a/src/intel_module.c b/src/intel_module.c index be34e7f..6cf5951 100644 --- a/src/intel_module.c +++ b/src/intel_module.c @@ -176,51 +176,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}, - {PCI_CHIP_SANDYBRIDGE_GT1, PCI_CHIP_SANDYBRIDGE_GT1, NULL}, - {PCI_CHIP_SANDYBRIDGE_GT2, PCI_CHIP_SANDYBRIDGE_GT2, NULL}, - {PCI_CHIP_SANDYBRIDGE_GT2_PLUS, PCI_CHIP_SANDYBRIDGE_GT2_PLUS, NULL}, - {PCI_CHIP_SANDYBRIDGE_M_GT1, PCI_CHIP_SANDYBRIDGE_M_GT1, NULL}, - {PCI_CHIP_SANDYBRIDGE_M_GT2, PCI_CHIP_SANDYBRIDGE_M_GT2, NULL}, - {PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS, PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS, NULL}, - {PCI_CHIP_SANDYBRIDGE_S_GT, PCI_CHIP_SANDYBRIDGE_S_GT, NULL}, - {-1, -1, NULL } -}; - void intel_detect_chipset(ScrnInfoPtr scrn, struct pci_device *pci, struct intel_chipset *chipset) @@ -311,6 +266,8 @@ static Bool intel_pci_probe (DriverPtr driver, intptr_t match_data) { ScrnInfoPtr scrn; + PciChipsets intel_pci_chipsets[ARRAY_SIZE(intel_chipsets)]; + int i; chipset_info = (void *)match_data; @@ -330,6 +287,12 @@ static Bool intel_pci_probe (DriverPtr driver, #endif } + 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) {