summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)