From cfa778af9c70faea8c13e5cb7f80029eee0d074e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 21 Feb 2003 23:23:09 +0000 Subject: Merge from bsd-4-0-0-branch. --- bsd-core/drm_scatter.c | 57 -------------------------------------------------- 1 file changed, 57 deletions(-) (limited to 'bsd-core/drm_scatter.c') diff --git a/bsd-core/drm_scatter.c b/bsd-core/drm_scatter.c index c16b7c05..f639b697 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 ); -- cgit v1.2.3