FreeBSD/sys/dev/drm2/radeon/radeon_gart.c
/**
 * radeon_gart_table_ram_alloc - allocate system ram for gart page table
 *
 * @rdev: radeon_device pointer
 *
 * Allocate system memory for GART page table
 * (r1xx-r3xx, non-pcie r4xx, rs400).  These asics require the
 * gart table to be in system memory.
 * Returns 0 for success, -ENOMEM for failure.
 */
allocate system ram for gart page table
@rdev: radeon_device pointer

Allocate system memory for GART page table
(r1xx-r3xx, non-pcie r4xx, rs400).  These asics require the
gart table to be in system memory.
Returns 0 for success, -ENOMEM for failure.
allocate system ram for gart page table @rdev : radeon_device pointer Allocate system memory for GART page table ( r1xx - r3xx non - pcie r4xx rs400 ) . These asics require the gart table to be in system memory . Returns 0 for success - ENOMEM for failure .
int radeon_gart_table_ram_alloc(struct radeon_device *rdev)
{
	drm_dma_handle_t *dmah;
	dmah = drm_pci_alloc(rdev->ddev, rdev->gart.table_size,
	    PAGE_SIZE, BUS_SPACE_MAXADDR);
	if (dmah == NULL) {
		return -ENOMEM;
	}
	rdev->gart.dmah = dmah;
	rdev->gart.ptr = dmah->vaddr;
#ifdef CONFIG_X86
	if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480 ||
	    rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) {
		pmap_change_attr((vm_offset_t)rdev->gart.ptr,
		    rdev->gart.table_size >> PAGE_SHIFT, PAT_UNCACHED);
	}
#endif
	rdev->gart.table_addr = dmah->busaddr;
	memset((void *)rdev->gart.ptr, 0, rdev->gart.table_size);
	return 0;
}
int radeon_gart_table_ram_alloc ( struct radeon_device * rdev ) { drm_dma_handle_t * dmah ; dmah = drm_pci_alloc ( rdev -> ddev , rdev -> gart . table_size , PAGE_SIZE , BUS_SPACE_MAXADDR ) ; if ( dmah == NULL ) { return - ENOMEM ; } rdev -> gart . dmah = dmah ; rdev -> gart . ptr = dmah -> vaddr ; #ifdef CONFIG_X86 if ( rdev -> family == CHIP_RS400 || rdev -> family == CHIP_RS480 || rdev -> family == CHIP_RS690 || rdev -> family == CHIP_RS740 ) { pmap_change_attr ( ( vm_offset_t ) rdev -> gart . ptr , rdev -> gart . table_size >> PAGE_SHIFT , PAT_UNCACHED ) ; } #endif rdev -> gart . table_addr = dmah -> busaddr ; memset ( ( void * ) rdev -> gart . ptr , 0 , rdev -> gart . table_size ) ; return 0 ; }
radeon_gart_table_ram_alloc - allocate system ram for gart page table
 @rdev: radeon_device pointer
radeon_gart_table_ram_alloc - allocate system ram for gart page table @rdev : radeon_device pointer