summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2003-08-19- Remove $FreeBSD$ tags as they weren't too useful and merges are now beingEric Anholt
2003-08-18Clean up Radeon DRI resume codeMichel Daenzer
2003-08-18Make r128_do_wait_for_idle static, as it's only used in this file.Eric Anholt
2003-08-18Remove an unnecessary #define __NO_VERSION__Eric Anholt
2003-08-15Merge from 2.6 kernel (Linus Torvalds)Michel Daenzer
2003-08-15DA: loads of whitespace .. some from Linus, some from meDave Airlie
2003-08-13DA: patch from Matthew upgraded to latest DRI head to solve issue with i810Dave Airlie
2003-08-12Whitespace cleanup from the pageflipping commit.Eric Anholt
2003-08-12Document change in interface version 1.9.Eric Anholt
2003-08-12Document the changes in interface version 2.5.Eric Anholt
2003-08-12Merge from FreeBSD r1.11: We have memset in the kernel, no need to defineEric Anholt
2003-08-11DA: code cleanups for i810_dma.c from 2.4 kernelDave Airlie
2003-08-08Added some information as to when (which DRM version) various queries wereIan Romanick
2003-08-07build fix for kernels >= 2.6Michel Daenzer
2003-08-06Fix maplist entries being used after they were freed; thanks to BenjaminMichel Daenzer
2003-07-29IRQ code cleanup suggested by Linus TorvaldsMichel Daenzer
2003-07-26Degrade uninformative error message to debug message, as in other driversMichel Daenzer
2003-07-26Add Rage 128 pageflipping support, defaults to off. DRM version bump toEric Anholt
2003-07-26Fix FreeBSD build after IRQ changes.Eric Anholt
2003-07-25Compile fixes for recent 2.5/2.6 Linux kernels. I hope this doesn't breakMichel Daenzer
2003-07-25Fail in DRM(agp_acquire) if the AGP aperture can't be used, such that the XMichel Daenzer
2003-07-11Restore __HAVE_KERNEL_CTX_SWITCH, required for the sparc drm module in theKeith Whitwell
2003-07-09DA: fix for bug 484 in Bugzilla, originally from me, reworked by DavidDave Airlie
2003-07-09file drm_mem.h was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-07-09file drm_dma.c was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-07-09file drm_fops.c was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-07-09file drm_lock.c was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-07-09file drm_stub.c was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-07-09file drm_vm.c was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-07-08Removed unused __HAVE_KERNEL_CTX_SWITCH, whatever that was.Keith Whitwell
2003-07-04Don't need to include linux/wrapper.h - we only use Set/ClearPageReservedLeif Delgass
2003-07-01file drm_agp.c was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-07-01file drm_bufs.c was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-07-01file drm_mem.c was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-07-01file drm_pci.c was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-07-01file drm_sg.c was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-06-23file savage_dma.c was initially added on branch savage-1_0_0-branch.Alan Hourihane
2003-06-23file savage_state.c was initially added on branch savage-1_0_0-branch.Alan Hourihane
2003-06-21file drm_pci_tmp.h was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-06-21file drm_stub_tmp.h was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-06-21file drm_memory_tmp.h was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-06-21file drm_vm_tmp.h was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-06-21file drm_dma_tmp.h was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-06-21file drm_lock_tmp.h was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-06-19file drm_bufs_tmp.h was initially added on branch newdrm-0-0-1-branch.Jose Fonseca
2003-06-19Revert the janitorial - that works is now on the new branchJose Fonseca
2003-06-18file i830_compat.c was initially added on branch i865-agp-0-1-branch.Keith Whitwell
2003-06-18file i830.h was initially added on branch i865-agp-0-1-branch.Keith Whitwell
2003-06-18file i830_dma.c was initially added on branch i865-agp-0-1-branch.Keith Whitwell
2003-06-18file i830_drm.h was initially added on branch i865-agp-0-1-branch.Keith Whitwell
>(sg_alloc)( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ) { drm_file_t *priv = filp->private_data; drm_device_t *dev = priv->dev; drm_scatter_gather_t request; drm_sg_mem_t *entry; unsigned long pages, i, j; DRM_DEBUG( "%s\n", __FUNCTION__ ); if ( dev->sg ) return -EINVAL; if ( copy_from_user( &request, (drm_scatter_gather_t *)arg, sizeof(request) ) ) return -EFAULT; entry = DRM(alloc)( sizeof(*entry), DRM_MEM_SGLISTS ); if ( !entry ) return -ENOMEM; memset( entry, 0, sizeof(*entry) ); pages = (request.size + PAGE_SIZE - 1) / PAGE_SIZE; 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; } memset(entry->pagelist, 0, 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 ); return -ENOMEM; } memset( (void *)entry->busaddr, 0, pages * sizeof(*entry->busaddr) ); entry->virtual = vmalloc_32( pages << PAGE_SHIFT ); if ( !entry->virtual ) { 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 ); return -ENOMEM; } /* This also forces the mapping of COW pages, so our page list * will be valid. Please don't remove it... */ memset( entry->virtual, 0, pages << PAGE_SHIFT ); entry->handle = (unsigned long)entry->virtual; DRM_DEBUG( "sg alloc handle = %08lx\n", entry->handle ); DRM_DEBUG( "sg alloc virtual = %p\n", entry->virtual ); for ( i = entry->handle, j = 0 ; j < pages ; i += PAGE_SIZE, j++ ) { entry->pagelist[j] = vmalloc_to_page((void *)i); if (!entry->pagelist[j]) goto failed; SetPageReserved(entry->pagelist[j]); } request.handle = entry->handle; if ( copy_to_user( (drm_scatter_gather_t *)arg, &request, sizeof(request) ) ) { DRM(sg_cleanup)( entry ); return -EFAULT; } 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; failed: DRM(sg_cleanup)( entry ); return -ENOMEM; } int DRM(sg_free)( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ) { drm_file_t *priv = filp->private_data; drm_device_t *dev = priv->dev; drm_scatter_gather_t request; drm_sg_mem_t *entry; if ( copy_from_user( &request, (drm_scatter_gather_t *)arg, sizeof(request) ) ) return -EFAULT; entry = dev->sg; dev->sg = NULL; if ( !entry || entry->handle != request.handle ) return -EINVAL; DRM_DEBUG( "sg free virtual = %p\n", entry->virtual ); DRM(sg_cleanup)( entry ); return 0; }