FreeBSD/sys/dev/drm2/radeon/radeon_gart.c
/**
 * radeon_gart_table_vram_pin - pin gart page table in vram
 *
 * @rdev: radeon_device pointer
 *
 * Pin the GART page table in vram so it will not be moved
 * by the memory manager (pcie r4xx, r5xx+).  These asics require the
 * gart table to be in video memory.
 * Returns 0 for success, error for failure.
 */
pin gart page table in vram
@rdev: radeon_device pointer

Pin the GART page table in vram so it will not be moved
by the memory manager (pcie r4xx, r5xx+).  These asics require the
gart table to be in video memory.
Returns 0 for success, error for failure.
pin gart page table in vram @rdev : radeon_device pointer Pin the GART page table in vram so it will not be moved by the memory manager ( pcie r4xx r5xx + ) . These asics require the gart table to be in video memory . Returns 0 for success error for failure .
int radeon_gart_table_vram_pin(struct radeon_device *rdev)
{
	uint64_t gpu_addr;
	int r;
	r = radeon_bo_reserve(rdev->gart.robj, false);
	if (unlikely(r != 0))
		return r;
	r = radeon_bo_pin(rdev->gart.robj,
				RADEON_GEM_DOMAIN_VRAM, &gpu_addr);
	if (r) {
		radeon_bo_unreserve(rdev->gart.robj);
		return r;
	}
	r = radeon_bo_kmap(rdev->gart.robj, &rdev->gart.ptr);
	if (r)
		radeon_bo_unpin(rdev->gart.robj);
	radeon_bo_unreserve(rdev->gart.robj);
	rdev->gart.table_addr = gpu_addr;
	return r;
}
int radeon_gart_table_vram_pin ( struct radeon_device * rdev ) { uint64_t gpu_addr ; int r ; r = radeon_bo_reserve ( rdev -> gart . robj , false ) ; if ( unlikely ( r != 0 ) ) return r ; r = radeon_bo_pin ( rdev -> gart . robj , RADEON_GEM_DOMAIN_VRAM , & gpu_addr ) ; if ( r ) { radeon_bo_unreserve ( rdev -> gart . robj ) ; return r ; } r = radeon_bo_kmap ( rdev -> gart . robj , & rdev -> gart . ptr ) ; if ( r ) radeon_bo_unpin ( rdev -> gart . robj ) ; radeon_bo_unreserve ( rdev -> gart . robj ) ; rdev -> gart . table_addr = gpu_addr ; return r ; }
radeon_gart_table_vram_pin - pin gart page table in vram
 @rdev: radeon_device pointer
radeon_gart_table_vram_pin - pin gart page table in vram @rdev : radeon_device pointer