Index: linux-core/mga_drv.c =================================================================== RCS file: /cvs/dri/drm/linux-core/mga_drv.c,v retrieving revision 1.49 diff -u -d -r1.49 mga_drv.c --- linux-core/mga_drv.c 9 Nov 2004 16:58:02 -0000 1.49 +++ linux-core/mga_drv.c 9 May 2005 21:52:50 -0000 @@ -37,6 +37,8 @@ #include "drm_pciids.h" +static int mga_driver_open_helper(drm_device_t * dev, drm_file_t * filp_priv); + static int postinit(struct drm_device *dev, unsigned long flags) { dev->counters += 3; @@ -82,6 +84,7 @@ DRIVER_IRQ_VBL, .pretakedown = mga_driver_pretakedown, .dma_quiescent = mga_driver_dma_quiescent, + .open_helper = mga_driver_open_helper, .vblank_wait = mga_driver_vblank_wait, .irq_preinstall = mga_driver_irq_preinstall, .irq_postinstall = mga_driver_irq_postinstall, @@ -134,3 +137,31 @@ MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL and additional rights"); + +int mga_driver_open_helper(drm_device_t * dev, drm_file_t * filp_priv) +{ + const struct pci_dev * const pdev = dev->pdev; + + + /* 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 ( (pdev->device == 0x0525) + && (pdev->bus->self->vendor == 0x3388) + && (pdev->bus->self->device == 0x0021) ) { +#if defined( __powerpc__ ) + DRM_ERROR("GXT135p is not yet supported\n"); +#else + DRM_ERROR("PCI G450 is not yet supported\n"); +#endif + return -ENODEV; + } + + return 0; +}