aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWang Zhenyu <zhenyu.z.wang@intel.com>2007-06-13 22:01:04 -0400
committerDave Jones <davej@redhat.com>2007-06-14 18:08:51 -0400
commit8888985144db8f4cb7e56154b31bdf233d3550bf (patch)
treeda3ecf1eb2236e15e63ac5453369b10408a7598b /drivers
parent874808c6dd429f7431b906a32c7f78a68e7636af (diff)
[AGPGART] intel_agp: fix device probe
This patch trys to fix device probe in two cases. First we should correctly detect device if integrated graphics device is not enabled or exists, like an add-in card is plugged. Second on some type of intel GMCH, it might have multiple graphic chip models, like 945GME case, so we should be sure the detect works through the whole table. Signed-off-by: Wang Zhenyu <zhenyu.z.wang@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/agp/intel-agp.c97
1 files changed, 51 insertions, 46 deletions
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index d383168b75fa..0439ee951a11 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -1810,68 +1810,69 @@ static int find_gmch(u16 device)
1810static const struct intel_driver_description { 1810static const struct intel_driver_description {
1811 unsigned int chip_id; 1811 unsigned int chip_id;
1812 unsigned int gmch_chip_id; 1812 unsigned int gmch_chip_id;
1813 unsigned int multi_gmch_chip; /* if we have more gfx chip type on this HB. */
1813 char *name; 1814 char *name;
1814 const struct agp_bridge_driver *driver; 1815 const struct agp_bridge_driver *driver;
1815 const struct agp_bridge_driver *gmch_driver; 1816 const struct agp_bridge_driver *gmch_driver;
1816} intel_agp_chipsets[] = { 1817} intel_agp_chipsets[] = {
1817 { PCI_DEVICE_ID_INTEL_82443LX_0, 0, "440LX", &intel_generic_driver, NULL }, 1818 { PCI_DEVICE_ID_INTEL_82443LX_0, 0, 0, "440LX", &intel_generic_driver, NULL },
1818 { PCI_DEVICE_ID_INTEL_82443BX_0, 0, "440BX", &intel_generic_driver, NULL }, 1819 { PCI_DEVICE_ID_INTEL_82443BX_0, 0, 0, "440BX", &intel_generic_driver, NULL },
1819 { PCI_DEVICE_ID_INTEL_82443GX_0, 0, "440GX", &intel_generic_driver, NULL }, 1820 { PCI_DEVICE_ID_INTEL_82443GX_0, 0, 0, "440GX", &intel_generic_driver, NULL },
1820 { PCI_DEVICE_ID_INTEL_82810_MC1, PCI_DEVICE_ID_INTEL_82810_IG1, "i810", 1821 { PCI_DEVICE_ID_INTEL_82810_MC1, PCI_DEVICE_ID_INTEL_82810_IG1, 0, "i810",
1821 NULL, &intel_810_driver }, 1822 NULL, &intel_810_driver },
1822 { PCI_DEVICE_ID_INTEL_82810_MC3, PCI_DEVICE_ID_INTEL_82810_IG3, "i810", 1823 { PCI_DEVICE_ID_INTEL_82810_MC3, PCI_DEVICE_ID_INTEL_82810_IG3, 0, "i810",
1823 NULL, &intel_810_driver }, 1824 NULL, &intel_810_driver },
1824 { PCI_DEVICE_ID_INTEL_82810E_MC, PCI_DEVICE_ID_INTEL_82810E_IG, "i810", 1825 { PCI_DEVICE_ID_INTEL_82810E_MC, PCI_DEVICE_ID_INTEL_82810E_IG, 0, "i810",
1825 NULL, &intel_810_driver }, 1826 NULL, &intel_810_driver },
1826 { PCI_DEVICE_ID_INTEL_82815_MC, PCI_DEVICE_ID_INTEL_82815_CGC, "i815", 1827 { PCI_DEVICE_ID_INTEL_82815_MC, PCI_DEVICE_ID_INTEL_82815_CGC, 0, "i815",
1827 &intel_810_driver, &intel_815_driver }, 1828 &intel_815_driver, &intel_810_driver },
1828 { PCI_DEVICE_ID_INTEL_82820_HB, 0, "i820", &intel_820_driver, NULL }, 1829 { PCI_DEVICE_ID_INTEL_82820_HB, 0, 0, "i820", &intel_820_driver, NULL },
1829 { PCI_DEVICE_ID_INTEL_82820_UP_HB, 0, "i820", &intel_820_driver, NULL }, 1830 { PCI_DEVICE_ID_INTEL_82820_UP_HB, 0, 0, "i820", &intel_820_driver, NULL },
1830 { PCI_DEVICE_ID_INTEL_82830_HB, PCI_DEVICE_ID_INTEL_82830_CGC, "830M", 1831 { PCI_DEVICE_ID_INTEL_82830_HB, PCI_DEVICE_ID_INTEL_82830_CGC, 0, "830M",
1831 &intel_830mp_driver, &intel_830_driver }, 1832 &intel_830mp_driver, &intel_830_driver },
1832 { PCI_DEVICE_ID_INTEL_82840_HB, 0, "i840", &intel_840_driver, NULL }, 1833 { PCI_DEVICE_ID_INTEL_82840_HB, 0, 0, "i840", &intel_840_driver, NULL },
1833 { PCI_DEVICE_ID_INTEL_82845_HB, 0, "845G", &intel_845_driver, NULL }, 1834 { PCI_DEVICE_ID_INTEL_82845_HB, 0, 0, "845G", &intel_845_driver, NULL },
1834 { PCI_DEVICE_ID_INTEL_82845G_HB, PCI_DEVICE_ID_INTEL_82845G_IG, "830M", 1835 { PCI_DEVICE_ID_INTEL_82845G_HB, PCI_DEVICE_ID_INTEL_82845G_IG, 0, "830M",
1835 &intel_845_driver, &intel_830_driver }, 1836 &intel_845_driver, &intel_830_driver },
1836 { PCI_DEVICE_ID_INTEL_82850_HB, 0, "i850", &intel_850_driver, NULL }, 1837 { PCI_DEVICE_ID_INTEL_82850_HB, 0, 0, "i850", &intel_850_driver, NULL },
1837 { PCI_DEVICE_ID_INTEL_82855PM_HB, 0, "855PM", &intel_845_driver, NULL }, 1838 { PCI_DEVICE_ID_INTEL_82855PM_HB, 0, 0, "855PM", &intel_845_driver, NULL },
1838 { PCI_DEVICE_ID_INTEL_82855GM_HB, PCI_DEVICE_ID_INTEL_82855GM_IG, "855GM", 1839 { PCI_DEVICE_ID_INTEL_82855GM_HB, PCI_DEVICE_ID_INTEL_82855GM_IG, 0, "855GM",
1839 &intel_845_driver, &intel_830_driver }, 1840 &intel_845_driver, &intel_830_driver },
1840 { PCI_DEVICE_ID_INTEL_82860_HB, 0, "i860", &intel_860_driver, NULL }, 1841 { PCI_DEVICE_ID_INTEL_82860_HB, 0, 0, "i860", &intel_860_driver, NULL },
1841 { PCI_DEVICE_ID_INTEL_82865_HB, PCI_DEVICE_ID_INTEL_82865_IG, "865", 1842 { PCI_DEVICE_ID_INTEL_82865_HB, PCI_DEVICE_ID_INTEL_82865_IG, 0, "865",
1842 &intel_845_driver, &intel_830_driver }, 1843 &intel_845_driver, &intel_830_driver },
1843 { PCI_DEVICE_ID_INTEL_82875_HB, 0, "i875", &intel_845_driver, NULL }, 1844 { PCI_DEVICE_ID_INTEL_82875_HB, 0, 0, "i875", &intel_845_driver, NULL },
1844 { PCI_DEVICE_ID_INTEL_82915G_HB, PCI_DEVICE_ID_INTEL_82915G_IG, "915G", 1845 { PCI_DEVICE_ID_INTEL_82915G_HB, PCI_DEVICE_ID_INTEL_82915G_IG, 0, "915G",
1845 &intel_845_driver, &intel_915_driver }, 1846 &intel_845_driver, &intel_915_driver },
1846 { PCI_DEVICE_ID_INTEL_82915GM_HB, PCI_DEVICE_ID_INTEL_82915GM_IG, "915GM", 1847 { PCI_DEVICE_ID_INTEL_82915GM_HB, PCI_DEVICE_ID_INTEL_82915GM_IG, 0, "915GM",
1847 &intel_845_driver, &intel_915_driver }, 1848 &intel_845_driver, &intel_915_driver },
1848 { PCI_DEVICE_ID_INTEL_82945G_HB, PCI_DEVICE_ID_INTEL_82945G_IG, "945G", 1849 { PCI_DEVICE_ID_INTEL_82945G_HB, PCI_DEVICE_ID_INTEL_82945G_IG, 0, "945G",
1849 &intel_845_driver, &intel_915_driver }, 1850 &intel_845_driver, &intel_915_driver },
1850 { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GM_IG, "945GM", 1851 { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GM_IG, 1, "945GM",
1851 &intel_845_driver, &intel_915_driver }, 1852 &intel_845_driver, &intel_915_driver },
1852 { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GME_IG, "945GME", 1853 { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GME_IG, 0, "945GME",
1853 &intel_845_driver, &intel_915_driver }, 1854 &intel_845_driver, &intel_915_driver },
1854 { PCI_DEVICE_ID_INTEL_82946GZ_HB, PCI_DEVICE_ID_INTEL_82946GZ_IG, "946GZ", 1855 { PCI_DEVICE_ID_INTEL_82946GZ_HB, PCI_DEVICE_ID_INTEL_82946GZ_IG, 0, "946GZ",
1855 &intel_845_driver, &intel_i965_driver }, 1856 &intel_845_driver, &intel_i965_driver },
1856 { PCI_DEVICE_ID_INTEL_82965G_1_HB, PCI_DEVICE_ID_INTEL_82965G_1_IG, "965G", 1857 { PCI_DEVICE_ID_INTEL_82965G_1_HB, PCI_DEVICE_ID_INTEL_82965G_1_IG, 0, "965G",
1857 &intel_845_driver, &intel_i965_driver }, 1858 &intel_845_driver, &intel_i965_driver },
1858 { PCI_DEVICE_ID_INTEL_82965Q_HB, PCI_DEVICE_ID_INTEL_82965Q_IG, "965Q", 1859 { PCI_DEVICE_ID_INTEL_82965Q_HB, PCI_DEVICE_ID_INTEL_82965Q_IG, 0, "965Q",
1859 &intel_845_driver, &intel_i965_driver }, 1860 &intel_845_driver, &intel_i965_driver },
1860 { PCI_DEVICE_ID_INTEL_82965G_HB, PCI_DEVICE_ID_INTEL_82965G_IG, "965G", 1861 { PCI_DEVICE_ID_INTEL_82965G_HB, PCI_DEVICE_ID_INTEL_82965G_IG, 0, "965G",
1861 &intel_845_driver, &intel_i965_driver }, 1862 &intel_845_driver, &intel_i965_driver },
1862 { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GM_IG, "965GM", 1863 { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GM_IG, 1, "965GM",
1863 &intel_845_driver, &intel_i965_driver }, 1864 &intel_845_driver, &intel_i965_driver },
1864 { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GME_IG, "965GME/GLE", 1865 { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GME_IG, 0, "965GME/GLE",
1865 &intel_845_driver, &intel_i965_driver }, 1866 &intel_845_driver, &intel_i965_driver },
1866 { PCI_DEVICE_ID_INTEL_7505_0, 0, "E7505", &intel_7505_driver, NULL }, 1867 { PCI_DEVICE_ID_INTEL_7505_0, 0, 0, "E7505", &intel_7505_driver, NULL },
1867 { PCI_DEVICE_ID_INTEL_7205_0, 0, "E7205", &intel_7505_driver, NULL }, 1868 { PCI_DEVICE_ID_INTEL_7205_0, 0, 0, "E7205", &intel_7505_driver, NULL },
1868 { PCI_DEVICE_ID_INTEL_G33_HB, PCI_DEVICE_ID_INTEL_G33_IG, "G33", 1869 { PCI_DEVICE_ID_INTEL_G33_HB, PCI_DEVICE_ID_INTEL_G33_IG, 0, "G33",
1869 &intel_845_driver, &intel_g33_driver }, 1870 &intel_845_driver, &intel_g33_driver },
1870 { PCI_DEVICE_ID_INTEL_Q35_HB, PCI_DEVICE_ID_INTEL_Q35_IG, "Q35", 1871 { PCI_DEVICE_ID_INTEL_Q35_HB, PCI_DEVICE_ID_INTEL_Q35_IG, 0, "Q35",
1871 &intel_845_driver, &intel_g33_driver }, 1872 &intel_845_driver, &intel_g33_driver },
1872 { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, "Q33", 1873 { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, 0, "Q33",
1873 &intel_845_driver, &intel_g33_driver }, 1874 &intel_845_driver, &intel_g33_driver },
1874 { 0, 0, NULL, NULL, NULL } 1875 { 0, 0, 0, NULL, NULL, NULL }
1875}; 1876};
1876 1877
1877static int __devinit agp_intel_probe(struct pci_dev *pdev, 1878static int __devinit agp_intel_probe(struct pci_dev *pdev,
@@ -1892,10 +1893,19 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1892 /* In case that multiple models of gfx chip may 1893 /* In case that multiple models of gfx chip may
1893 stand on same host bridge type, this can be 1894 stand on same host bridge type, this can be
1894 sure we detect the right IGD. */ 1895 sure we detect the right IGD. */
1895 if ((pdev->device == intel_agp_chipsets[i].chip_id) && 1896 if (pdev->device == intel_agp_chipsets[i].chip_id) {
1896 ((intel_agp_chipsets[i].gmch_chip_id == 0) || 1897 if ((intel_agp_chipsets[i].gmch_chip_id != 0) &&
1897 find_gmch(intel_agp_chipsets[i].gmch_chip_id))) 1898 find_gmch(intel_agp_chipsets[i].gmch_chip_id)) {
1898 break; 1899 bridge->driver =
1900 intel_agp_chipsets[i].gmch_driver;
1901 break;
1902 } else if (intel_agp_chipsets[i].multi_gmch_chip) {
1903 continue;
1904 } else {
1905 bridge->driver = intel_agp_chipsets[i].driver;
1906 break;
1907 }
1908 }
1899 } 1909 }
1900 1910
1901 if (intel_agp_chipsets[i].name == NULL) { 1911 if (intel_agp_chipsets[i].name == NULL) {
@@ -1906,11 +1916,6 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1906 return -ENODEV; 1916 return -ENODEV;
1907 } 1917 }
1908 1918
1909 if (intel_agp_chipsets[i].gmch_chip_id != 0)
1910 bridge->driver = intel_agp_chipsets[i].gmch_driver;
1911 else
1912 bridge->driver = intel_agp_chipsets[i].driver;
1913
1914 if (bridge->driver == NULL) { 1919 if (bridge->driver == NULL) {
1915 printk(KERN_WARNING PFX "Failed to find bridge device " 1920 printk(KERN_WARNING PFX "Failed to find bridge device "
1916 "(chip_id: %04x)\n", intel_agp_chipsets[i].gmch_chip_id); 1921 "(chip_id: %04x)\n", intel_agp_chipsets[i].gmch_chip_id);