Lines Matching refs:tegra
235 static int tegra_bo_iommu_map(struct tegra_drm *tegra, struct tegra_bo *bo) in tegra_bo_iommu_map() argument
247 mutex_lock(&tegra->mm_lock); in tegra_bo_iommu_map()
249 err = drm_mm_insert_node_generic(&tegra->mm, in tegra_bo_iommu_map()
252 dev_err(tegra->drm->dev, "out of I/O virtual memory: %d\n", in tegra_bo_iommu_map()
259 bo->size = iommu_map_sgtable(tegra->domain, bo->iova, bo->sgt, prot); in tegra_bo_iommu_map()
261 dev_err(tegra->drm->dev, "failed to map buffer\n"); in tegra_bo_iommu_map()
266 mutex_unlock(&tegra->mm_lock); in tegra_bo_iommu_map()
273 mutex_unlock(&tegra->mm_lock); in tegra_bo_iommu_map()
278 static int tegra_bo_iommu_unmap(struct tegra_drm *tegra, struct tegra_bo *bo) in tegra_bo_iommu_unmap() argument
283 mutex_lock(&tegra->mm_lock); in tegra_bo_iommu_unmap()
284 iommu_unmap(tegra->domain, bo->iova, bo->size); in tegra_bo_iommu_unmap()
286 mutex_unlock(&tegra->mm_lock); in tegra_bo_iommu_unmap()
375 struct tegra_drm *tegra = drm->dev_private; in tegra_bo_alloc() local
378 if (tegra->domain) { in tegra_bo_alloc()
383 err = tegra_bo_iommu_map(tegra, bo); in tegra_bo_alloc()
459 struct tegra_drm *tegra = drm->dev_private; in tegra_bo_import() local
472 if (tegra->domain) { in tegra_bo_import()
485 err = tegra_bo_iommu_map(tegra, bo); in tegra_bo_import()
511 struct tegra_drm *tegra = gem->dev->dev_private; in tegra_bo_free_object() local
524 if (tegra->domain) { in tegra_bo_free_object()
525 tegra_bo_iommu_unmap(tegra, bo); in tegra_bo_free_object()
547 struct tegra_drm *tegra = drm->dev_private; in tegra_bo_dumb_create() local
550 args->pitch = round_up(min_pitch, tegra->pitch_align); in tegra_bo_dumb_create()