aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drmP.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2005-07-10 03:31:26 -0400
committerDave Airlie <airlied@linux.ie>2005-07-10 03:31:26 -0400
commitcda173806644d2af22ffd9896eed8ef99b97d356 (patch)
tree374ad48818df951a03c59d54ec75d5b19d4a24c3 /drivers/char/drm/drmP.h
parentceb9c27aa7d61c70f4c75f017d9fbc9de50034f1 (diff)
drm: add test for AGP devices and driver override for it.
Added device_is_agp callback to drm_driver. This function is called by the platform-specific drm_device_is_agp function. Added implementation of this function the the Linux-specific portion of the MGA driver to detect PCI G450 cards. Added code to the Linux-specific portion of the generic DRM layer to not initialize AGP infrastructure if the card is not AGP (this matches what already existed in BSD). Fix up i810/i830 and i915 drivers to always return AGP as they don't always report the capability. Fix the MGA to not report AGP for a card that has an AGP chip behind a PCI bridge. From: Ian Romanick, Dave Airlie, Alan Hourihane Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drmP.h')
-rw-r--r--drivers/char/drm/drmP.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index 8e060a2cc3db..a9b61864feba 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -586,7 +586,22 @@ struct drm_driver {
586 int (*kernel_context_switch)(struct drm_device *dev, int old, int new); 586 int (*kernel_context_switch)(struct drm_device *dev, int old, int new);
587 void (*kernel_context_switch_unlock)(struct drm_device *dev, drm_lock_t *lock); 587 void (*kernel_context_switch_unlock)(struct drm_device *dev, drm_lock_t *lock);
588 int (*vblank_wait)(struct drm_device *dev, unsigned int *sequence); 588 int (*vblank_wait)(struct drm_device *dev, unsigned int *sequence);
589
590 /**
591 * Called by \c drm_device_is_agp. Typically used to determine if a
592 * card is really attached to AGP or not.
593 *
594 * \param dev DRM device handle
595 *
596 * \returns
597 * One of three values is returned depending on whether or not the
598 * card is absolutely \b not AGP (return of 0), absolutely \b is AGP
599 * (return of 1), or may or may not be AGP (return of 2).
600 */
601 int (*device_is_agp) (struct drm_device * dev);
602
589 /* these have to be filled in */ 603 /* these have to be filled in */
604
590 int (*postinit)(struct drm_device *, unsigned long flags); 605 int (*postinit)(struct drm_device *, unsigned long flags);
591 irqreturn_t (*irq_handler)( DRM_IRQ_ARGS ); 606 irqreturn_t (*irq_handler)( DRM_IRQ_ARGS );
592 void (*irq_preinstall)(struct drm_device *dev); 607 void (*irq_preinstall)(struct drm_device *dev);
@@ -1041,6 +1056,19 @@ static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev, unsig
1041 return NULL; 1056 return NULL;
1042} 1057}
1043 1058
1059static __inline__ int drm_device_is_agp(drm_device_t *dev)
1060{
1061 if ( dev->driver->device_is_agp != NULL ) {
1062 int err = (*dev->driver->device_is_agp)( dev );
1063
1064 if (err != 2) {
1065 return err;
1066 }
1067 }
1068
1069 return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP);
1070}
1071
1044static __inline__ void drm_core_dropmap(struct drm_map *map) 1072static __inline__ void drm_core_dropmap(struct drm_map *map)
1045{ 1073{
1046} 1074}