aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drmP.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r--include/drm/drmP.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index e2a4da7d7fab..7809d230adee 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -305,14 +305,16 @@ struct drm_ioctl_desc {
305 unsigned int cmd; 305 unsigned int cmd;
306 int flags; 306 int flags;
307 drm_ioctl_t *func; 307 drm_ioctl_t *func;
308 unsigned int cmd_drv;
308}; 309};
309 310
310/** 311/**
311 * Creates a driver or general drm_ioctl_desc array entry for the given 312 * Creates a driver or general drm_ioctl_desc array entry for the given
312 * ioctl, for use by drm_ioctl(). 313 * ioctl, for use by drm_ioctl().
313 */ 314 */
314#define DRM_IOCTL_DEF(ioctl, _func, _flags) \ 315
315 [DRM_IOCTL_NR(ioctl)] = {.cmd = ioctl, .func = _func, .flags = _flags} 316#define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags) \
317 [DRM_IOCTL_NR(DRM_##ioctl)] = {.cmd = DRM_##ioctl, .func = _func, .flags = _flags, .cmd_drv = DRM_IOCTL_##ioctl}
316 318
317struct drm_magic_entry { 319struct drm_magic_entry {
318 struct list_head head; 320 struct list_head head;
@@ -1075,7 +1077,6 @@ static __inline__ int drm_core_check_feature(struct drm_device *dev,
1075 return ((dev->driver->driver_features & feature) ? 1 : 0); 1077 return ((dev->driver->driver_features & feature) ? 1 : 0);
1076} 1078}
1077 1079
1078
1079static inline int drm_dev_to_irq(struct drm_device *dev) 1080static inline int drm_dev_to_irq(struct drm_device *dev)
1080{ 1081{
1081 if (drm_core_check_feature(dev, DRIVER_USE_PLATFORM_DEVICE)) 1082 if (drm_core_check_feature(dev, DRIVER_USE_PLATFORM_DEVICE))
@@ -1084,11 +1085,22 @@ static inline int drm_dev_to_irq(struct drm_device *dev)
1084 return dev->pdev->irq; 1085 return dev->pdev->irq;
1085} 1086}
1086 1087
1087#ifdef __alpha__ 1088static inline int drm_get_pci_domain(struct drm_device *dev)
1088#define drm_get_pci_domain(dev) dev->hose->index 1089{
1089#else 1090 if (drm_core_check_feature(dev, DRIVER_USE_PLATFORM_DEVICE))
1090#define drm_get_pci_domain(dev) 0 1091 return 0;
1091#endif 1092
1093#ifndef __alpha__
1094 /* For historical reasons, drm_get_pci_domain() is busticated
1095 * on most archs and has to remain so for userspace interface
1096 * < 1.4, except on alpha which was right from the beginning
1097 */
1098 if (dev->if_version < 0x10004)
1099 return 0;
1100#endif /* __alpha__ */
1101
1102 return pci_domain_nr(dev->pdev->bus);
1103}
1092 1104
1093#if __OS_HAS_AGP 1105#if __OS_HAS_AGP
1094static inline int drm_core_has_AGP(struct drm_device *dev) 1106static inline int drm_core_has_AGP(struct drm_device *dev)