Lines Matching refs:tegra
223 static int tegra_bo_iommu_map(struct tegra_drm *tegra, struct tegra_bo *bo) in tegra_bo_iommu_map() argument
235 mutex_lock(&tegra->mm_lock); in tegra_bo_iommu_map()
237 err = drm_mm_insert_node_generic(&tegra->mm, in tegra_bo_iommu_map()
240 dev_err(tegra->drm->dev, "out of I/O virtual memory: %d\n", in tegra_bo_iommu_map()
247 bo->size = iommu_map_sgtable(tegra->domain, bo->iova, bo->sgt, prot); in tegra_bo_iommu_map()
249 dev_err(tegra->drm->dev, "failed to map buffer\n"); in tegra_bo_iommu_map()
254 mutex_unlock(&tegra->mm_lock); in tegra_bo_iommu_map()
261 mutex_unlock(&tegra->mm_lock); in tegra_bo_iommu_map()
266 static int tegra_bo_iommu_unmap(struct tegra_drm *tegra, struct tegra_bo *bo) in tegra_bo_iommu_unmap() argument
271 mutex_lock(&tegra->mm_lock); in tegra_bo_iommu_unmap()
272 iommu_unmap(tegra->domain, bo->iova, bo->size); in tegra_bo_iommu_unmap()
274 mutex_unlock(&tegra->mm_lock); in tegra_bo_iommu_unmap()
363 struct tegra_drm *tegra = drm->dev_private; in tegra_bo_alloc() local
366 if (tegra->domain) { in tegra_bo_alloc()
371 err = tegra_bo_iommu_map(tegra, bo); in tegra_bo_alloc()
447 struct tegra_drm *tegra = drm->dev_private; in tegra_bo_import() local
470 if (tegra->domain) { in tegra_bo_import()
471 err = tegra_bo_iommu_map(tegra, bo); in tegra_bo_import()
494 struct tegra_drm *tegra = gem->dev->dev_private; in tegra_bo_free_object() local
507 if (tegra->domain) in tegra_bo_free_object()
508 tegra_bo_iommu_unmap(tegra, bo); in tegra_bo_free_object()
526 struct tegra_drm *tegra = drm->dev_private; in tegra_bo_dumb_create() local
529 args->pitch = round_up(min_pitch, tegra->pitch_align); in tegra_bo_dumb_create()