linux/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
/**
 * amdgpu_gem_prime_vmap - &dma_buf_ops.vmap implementation
 * @obj: GEM buffer object
 *
 * Sets up an in-kernel virtual mapping of the buffer object's memory.
 *
 * Returns:
 * The virtual address of the mapping or an error pointer.
 */
&dma_buf_ops.vmap implementation
@obj: GEM buffer object

Sets up an in-kernel virtual mapping of the buffer object's memory.

The virtual address of the mapping or an error pointer.
&dma_buf_ops . vmap implementation @obj : GEM buffer object Sets up an in - kernel virtual mapping of the buffer object ' s memory . The virtual address of the mapping or an error pointer .
void *amdgpu_gem_prime_vmap(struct drm_gem_object *obj)
{
	struct amdgpu_bo *bo = gem_to_amdgpu_bo(obj);
	int ret;
	ret = ttm_bo_kmap(&bo->tbo, 0, bo->tbo.num_pages,
			  &bo->dma_buf_vmap);
	if (ret)
		return ERR_PTR(ret);
	return bo->dma_buf_vmap.virtual;
}
void * amdgpu_gem_prime_vmap ( struct drm_gem_object * obj ) { struct amdgpu_bo * bo = gem_to_amdgpu_bo ( obj ) ; int ret ; ret = ttm_bo_kmap ( & bo -> tbo , 0 , bo -> tbo . num_pages , & bo -> dma_buf_vmap ) ; if ( ret ) return ERR_PTR ( ret ) ; return bo -> dma_buf_vmap . virtual ; }
amdgpu_gem_prime_vmap - &dma_buf_ops.vmap implementation
 @obj: GEM buffer object
amdgpu_gem_prime_vmap - &dma_buf_ops . vmap implementation @obj : GEM buffer object