Index: linux-core/drmP.h =================================================================== RCS file: /cvs/dri/drm/linux-core/drmP.h,v retrieving revision 1.142 diff -u -d -r1.142 drmP.h --- linux-core/drmP.h 26 Apr 2005 05:19:11 -0000 1.142 +++ linux-core/drmP.h 10 May 2005 14:42:24 -0000 @@ -541,6 +541,18 @@ int new); int (*kernel_context_switch_unlock) (struct drm_device * dev); int (*vblank_wait) (struct drm_device * dev, unsigned int *sequence); + + /** + * Called by \c drm_agp_init. Typically used to determine if a card + * is really attached to AGP or not. + * + * \param dev DRM device handle + * + * \returns false if the card should not be initialized for AGP, true + * otherwise. + */ + int (*agp_preinit) (struct drm_device * dev); + /* these have to be filled in */ int (*postinit) (struct drm_device *, unsigned long flags); irqreturn_t(*irq_handler) (DRM_IRQ_ARGS); Index: linux-core/drm_agpsupport.c =================================================================== RCS file: /cvs/dri/drm/linux-core/drm_agpsupport.c,v retrieving revision 1.30 diff -u -d -r1.30 drm_agpsupport.c --- linux-core/drm_agpsupport.c 25 Mar 2005 09:48:34 -0000 1.30 +++ linux-core/drm_agpsupport.c 10 May 2005 14:42:24 -0000 @@ -421,6 +421,11 @@ { drm_agp_head_t *head = NULL; + if ( (dev->driver->agp_preinit != NULL) + && ! (*dev->driver->agp_preinit)( dev ) ) { + return NULL; + } + if (!(head = drm_alloc(sizeof(*head), DRM_MEM_AGPLISTS))) return NULL; memset((void *)head, 0, sizeof(*head)); 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 10 May 2005 14:42:24 -0000 @@ -37,6 +37,8 @@ #include "drm_pciids.h" +static int mga_driver_agp_preinit(drm_device_t * dev); + 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, + .agp_preinit = mga_driver_agp_preinit, .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_agp_preinit(drm_device_t * dev) +{ + 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 0; + } + + return 1; +}