summaryrefslogtreecommitdiff
path: root/linux-core/drm_scatter.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-core/drm_scatter.c')
-rw-r--r--linux-core/drm_scatter.c42
1 files changed, 33 insertions, 9 deletions
diff --git a/linux-core/drm_scatter.c b/linux-core/drm_scatter.c
index c1c9f7e8..5654c8cb 100644
--- a/linux-core/drm_scatter.c
+++ b/linux-core/drm_scatter.c
@@ -47,12 +47,17 @@ void DRM(sg_cleanup)( drm_sg_mem_t *entry )
vfree( entry->virtual );
+#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400)
+ DRM(free)( entry->busaddr,
+ entry->pages * sizeof(*entry->busaddr),
+ DRM_MEM_PAGES );
+#endif
DRM(free)( entry->pagelist,
- entry->pages * sizeof(*entry->pagelist),
- DRM_MEM_PAGES );
+ entry->pages * sizeof(*entry->pagelist),
+ DRM_MEM_PAGES );
DRM(free)( entry,
- sizeof(*entry),
- DRM_MEM_SGLISTS );
+ sizeof(*entry),
+ DRM_MEM_SGLISTS );
}
int DRM(sg_alloc)( struct inode *inode, struct file *filp,
@@ -93,16 +98,35 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp,
DRM(free)( entry, sizeof(*entry), DRM_MEM_SGLISTS );
return -ENOMEM;
}
- memset(entry->pagelist, 0, pages * sizeof(*entry->pagelist));
+
+#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400)
+ entry->busaddr = DRM(alloc)( pages * sizeof(*entry->busaddr),
+ DRM_MEM_PAGES );
+ if ( !entry->busaddr ) {
+ DRM(free)( entry->pagelist,
+ entry->pages * sizeof(*entry->pagelist),
+ DRM_MEM_PAGES );
+ DRM(free)( entry,
+ sizeof(*entry),
+ DRM_MEM_SGLISTS );
+ return -ENOMEM;
+ }
+ memset( (void *)entry->busaddr, 0, pages * sizeof(*entry->busaddr) );
+#endif
entry->virtual = vmalloc_32( pages << PAGE_SHIFT );
if ( !entry->virtual ) {
+#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400)
+ DRM(free)( entry->busaddr,
+ entry->pages * sizeof(*entry->busaddr),
+ DRM_MEM_PAGES );
+#endif
DRM(free)( entry->pagelist,
- entry->pages * sizeof(*entry->pagelist),
- DRM_MEM_PAGES );
+ entry->pages * sizeof(*entry->pagelist),
+ DRM_MEM_PAGES );
DRM(free)( entry,
- sizeof(*entry),
- DRM_MEM_SGLISTS );
+ sizeof(*entry),
+ DRM_MEM_SGLISTS );
return -ENOMEM;
}