summaryrefslogtreecommitdiff
path: root/linux/drm_memory.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2004-09-04 23:21:40 +0000
committerDave Airlie <airlied@linux.ie>2004-09-04 23:21:40 +0000
commit4499ea42eae887c45403cd9ea364fccf311fee8e (patch)
treefc12944d1a50a92a3141996a193081ea98d621ad /linux/drm_memory.h
parent3d9e16aa6e074fdaa7a74f2fb6b0c46f1dd04172 (diff)
Fixup OS_HAS_AGP/OS_HAS_MTRR along lines of patches going to kernel, as
suggested by Arjan.. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'linux/drm_memory.h')
-rw-r--r--linux/drm_memory.h31
1 files changed, 24 insertions, 7 deletions
diff --git a/linux/drm_memory.h b/linux/drm_memory.h
index 38084ccc..2cdccb13 100644
--- a/linux/drm_memory.h
+++ b/linux/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;