diff options
author | Jeff Hartmann <jhartmann@valinux.com> | 2001-08-10 16:29:21 +0000 |
---|---|---|
committer | Jeff Hartmann <jhartmann@valinux.com> | 2001-08-10 16:29:21 +0000 |
commit | 97b8aa52bba602d5babe225983f7e4c7cb4d7492 (patch) | |
tree | 922882797ea335549c01849c4dd2cdc350938be0 /linux/drm_scatter.h | |
parent | b6923b39539c34c2a589197def5eee72a9d719bf (diff) |
Commit Keith Owens kernel Makefile changes, merge and commit alpha patch
set from Jay Estabrook (sans some mga modifications which broke other
arch's.)
Diffstat (limited to 'linux/drm_scatter.h')
-rw-r--r-- | linux/drm_scatter.h | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/linux/drm_scatter.h b/linux/drm_scatter.h index c1c9f7e8..5654c8cb 100644 --- a/linux/drm_scatter.h +++ b/linux/drm_scatter.h @@ -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; } |