summaryrefslogtreecommitdiff
path: root/bsd-core
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-11-28 21:15:46 +0000
committerEric Anholt <anholt@freebsd.org>2005-11-28 21:15:46 +0000
commit1835dff04a69509c0ea5fdb94abe0eaa61e7ab5a (patch)
tree6429c7218395c5df204ed027faf863f292473337 /bsd-core
parent0472ac5d117908a4ef612722960411c58e824999 (diff)
Fix AGP support guessing: Implement the same bridge checking in the MGA
driver as Linux uses, and actually use the driver's device_is_agp if available (hopefully fixing i915).
Diffstat (limited to 'bsd-core')
-rw-r--r--bsd-core/drm_agpsupport.c11
-rw-r--r--bsd-core/mga_drv.c15
2 files changed, 25 insertions, 1 deletions
diff --git a/bsd-core/drm_agpsupport.c b/bsd-core/drm_agpsupport.c
index 58293566..0a565105 100644
--- a/bsd-core/drm_agpsupport.c
+++ b/bsd-core/drm_agpsupport.c
@@ -89,6 +89,17 @@ drm_device_find_capability(drm_device_t *dev, int cap)
int drm_device_is_agp(drm_device_t *dev)
{
+ if (dev->driver.device_is_agp != NULL) {
+ int ret;
+
+ /* device_is_agp returns a tristate, 0 = not AGP, 1 = definitely
+ * AGP, 2 = fall back to PCI capability
+ */
+ ret = (*dev->driver.device_is_agp)(dev);
+ if (ret != 2)
+ return ret;
+ }
+
return (drm_device_find_capability(dev, PCIY_AGP));
}
diff --git a/bsd-core/mga_drv.c b/bsd-core/mga_drv.c
index b3c8345b..1dc146f6 100644
--- a/bsd-core/mga_drv.c
+++ b/bsd-core/mga_drv.c
@@ -61,7 +61,20 @@ static drm_pci_id_list_t mga_pciidlist[] = {
*/
static int mga_driver_device_is_agp(drm_device_t * dev)
{
- return 1;
+ /* There are PCI versions of the G450. These cards have the
+ * same PCI ID as the AGP G450, but have an additional PCI-to-PCI
+ * bridge chip. We detect these cards, which are not currently
+ * supported by this driver, by looking at the device ID of the
+ * bus the "card" is on. If vendor is 0x3388 (Hint Corp) and the
+ * device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the
+ * device.
+ */
+ if (pci_get_device(dev->device) == 0x0525 &&
+ pci_get_vendor(device_get_parent(dev->device)) == 0x3388 &&
+ pci_get_device(device_get_parent(dev->device)) == 0x0021)
+ return 0;
+ else
+ return 2;
}
static void mga_configure(drm_device_t *dev)