From 4499ea42eae887c45403cd9ea364fccf311fee8e Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 4 Sep 2004 23:21:40 +0000 Subject: Fixup OS_HAS_AGP/OS_HAS_MTRR along lines of patches going to kernel, as suggested by Arjan.. Signed-off-by: Dave Airlie --- linux-core/drm_memory.h | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'linux-core/drm_memory.h') diff --git a/linux-core/drm_memory.h b/linux-core/drm_memory.h index 38084ccc..2cdccb13 100644 --- a/linux-core/drm_memory.h +++ b/linux-core/drm_memory.h @@ -139,12 +139,29 @@ drm_follow_page (void *vaddr) return pte_pfn(*ptep) << PAGE_SHIFT; } -#endif /* __OS_HAS_AGP && defined(VMAP_4_ARGS) */ +#else /* __OS_HAS_AGP */ + +static inline drm_map_t *drm_lookup_map(unsigned long offset, unsigned long size, drm_device_t *dev) +{ + return NULL; +} + +static inline void *agp_remap(unsigned long offset, unsigned long size, drm_device_t *dev) +{ + return NULL; +} + +static inline unsigned long drm_follow_page (void *vaddr) +{ + return 0; +} + +#endif static inline void *drm_ioremap(unsigned long offset, unsigned long size, drm_device_t *dev) { -#if __OS_HAS_AGP && defined(VMAP_4_ARGS) - if ( drm_core_check_feature(dev, DRIVER_USE_AGP) && dev->agp && dev->agp->cant_use_aperture) { +#if defined(VMAP_4_ARGS) + if ( drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture) { drm_map_t *map = drm_lookup_map(offset, size, dev); if (map && map->type == _DRM_AGP) @@ -158,8 +175,8 @@ static inline void *drm_ioremap(unsigned long offset, unsigned long size, drm_de static inline void *drm_ioremap_nocache(unsigned long offset, unsigned long size, drm_device_t *dev) { -#if __OS_HAS_AGP&& defined(VMAP_4_ARGS) - if ( drm_core_check_feature(dev, DRIVER_USE_AGP) && dev->agp && dev->agp->cant_use_aperture) { +#if defined(VMAP_4_ARGS) + if ( drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture) { drm_map_t *map = drm_lookup_map(offset, size, dev); if (map && map->type == _DRM_AGP) @@ -172,13 +189,13 @@ static inline void *drm_ioremap_nocache(unsigned long offset, unsigned long size static inline void drm_ioremapfree(void *pt, unsigned long size, drm_device_t *dev) { -#if __OS_HAS_AGP && defined(VMAP_4_ARGS) +#if defined(VMAP_4_ARGS) /* * This is a bit ugly. It would be much cleaner if the DRM API would use separate * routines for handling mappings in the AGP space. Hopefully this can be done in * a future revision of the interface... */ - if (drm_core_check_feature(dev, DRIVER_USE_AGP) && dev->agp && dev->agp->cant_use_aperture + if (drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture && ((unsigned long) pt >= VMALLOC_START && (unsigned long) pt < VMALLOC_END)) { unsigned long offset; -- cgit v1.2.3