diff options
author | Eric Anholt <anholt@freebsd.org> | 2003-02-21 23:23:09 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2003-02-21 23:23:09 +0000 |
commit | cfa778af9c70faea8c13e5cb7f80029eee0d074e (patch) | |
tree | 15483e64b6c2b56d3bb0f247df9df2c2602e0404 /bsd-core/drm_scatter.c | |
parent | a64472d18493de575a7636704b45babe7b4b4572 (diff) |
Merge from bsd-4-0-0-branch.bsd-4-0-0-20030221-merge
Diffstat (limited to 'bsd-core/drm_scatter.c')
-rw-r--r-- | bsd-core/drm_scatter.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/bsd-core/drm_scatter.c b/bsd-core/drm_scatter.c index c16b7c05c..f639b6970 100644 --- a/bsd-core/drm_scatter.c +++ b/bsd-core/drm_scatter.c @@ -40,9 +40,6 @@ void DRM(sg_cleanup)( drm_sg_mem_t *entry ) DRM(free)( entry->busaddr, entry->pages * sizeof(*entry->busaddr), DRM_MEM_PAGES ); - DRM(free)( entry->pagelist, - entry->pages * sizeof(*entry->pagelist), - DRM_MEM_PAGES ); DRM(free)( entry, sizeof(*entry), DRM_MEM_SGLISTS ); @@ -73,21 +70,10 @@ int DRM(sg_alloc)( DRM_IOCTL_ARGS ) DRM_DEBUG( "sg size=%ld pages=%ld\n", request.size, pages ); entry->pages = pages; - entry->pagelist = DRM(alloc)( pages * sizeof(*entry->pagelist), - DRM_MEM_PAGES ); - if ( !entry->pagelist ) { - DRM(free)( entry, sizeof(*entry), DRM_MEM_SGLISTS ); - return ENOMEM; - } - - bzero(entry->pagelist, pages * sizeof(*entry->pagelist)); 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 ); @@ -100,9 +86,6 @@ int DRM(sg_alloc)( DRM_IOCTL_ARGS ) DRM(free)( entry->busaddr, entry->pages * sizeof(*entry->busaddr), DRM_MEM_PAGES ); - DRM(free)( entry->pagelist, - entry->pages * sizeof(*entry->pagelist), - DRM_MEM_PAGES ); DRM(free)( entry, sizeof(*entry), DRM_MEM_SGLISTS ); @@ -124,46 +107,6 @@ int DRM(sg_alloc)( DRM_IOCTL_ARGS ) dev->sg = entry; -#if DEBUG_SCATTER - /* Verify that each page points to its virtual address, and vice - * versa. - */ - { - int error = 0; - - for ( i = 0 ; i < pages ; i++ ) { - unsigned long *tmp; - - tmp = page_address( entry->pagelist[i] ); - for ( j = 0 ; - j < PAGE_SIZE / sizeof(unsigned long) ; - j++, tmp++ ) { - *tmp = 0xcafebabe; - } - tmp = (unsigned long *)((u8 *)entry->virtual + - (PAGE_SIZE * i)); - for( j = 0 ; - j < PAGE_SIZE / sizeof(unsigned long) ; - j++, tmp++ ) { - if ( *tmp != 0xcafebabe && error == 0 ) { - error = 1; - DRM_ERROR( "Scatter allocation error, " - "pagelist does not match " - "virtual mapping\n" ); - } - } - tmp = page_address( entry->pagelist[i] ); - for(j = 0 ; - j < PAGE_SIZE / sizeof(unsigned long) ; - j++, tmp++) { - *tmp = 0; - } - } - if (error == 0) - DRM_ERROR( "Scatter allocation matches pagelist\n" ); - } -#endif - return 0; DRM(sg_cleanup)( entry ); |