Lines Matching refs:drm
31 struct drm_device *drm = obj->gem.dev; in tegra_bo_put() local
33 mutex_lock(&drm->struct_mutex); in tegra_bo_put()
35 mutex_unlock(&drm->struct_mutex); in tegra_bo_put()
75 struct drm_device *drm = obj->gem.dev; in tegra_bo_get() local
77 mutex_lock(&drm->struct_mutex); in tegra_bo_get()
79 mutex_unlock(&drm->struct_mutex); in tegra_bo_get()
110 dev_err(tegra->drm->dev, "out of I/O virtual memory: %zd\n", in tegra_bo_iommu_map()
120 dev_err(tegra->drm->dev, "failed to map buffer: %zd\n", err); in tegra_bo_iommu_map()
147 static struct tegra_bo *tegra_bo_alloc_object(struct drm_device *drm, in tegra_bo_alloc_object() argument
160 err = drm_gem_object_init(drm, &bo->gem, size); in tegra_bo_alloc_object()
177 static void tegra_bo_free(struct drm_device *drm, struct tegra_bo *bo) in tegra_bo_free() argument
184 dma_free_writecombine(drm->dev, bo->gem.size, bo->vaddr, in tegra_bo_free()
189 static int tegra_bo_get_pages(struct drm_device *drm, struct tegra_bo *bo) in tegra_bo_get_pages() argument
214 dma_sync_sg_for_device(drm->dev, bo->sgt->sgl, bo->sgt->nents, in tegra_bo_get_pages()
224 static int tegra_bo_alloc(struct drm_device *drm, struct tegra_bo *bo) in tegra_bo_alloc() argument
226 struct tegra_drm *tegra = drm->dev_private; in tegra_bo_alloc()
230 err = tegra_bo_get_pages(drm, bo); in tegra_bo_alloc()
236 tegra_bo_free(drm, bo); in tegra_bo_alloc()
242 bo->vaddr = dma_alloc_writecombine(drm->dev, size, &bo->paddr, in tegra_bo_alloc()
245 dev_err(drm->dev, in tegra_bo_alloc()
255 struct tegra_bo *tegra_bo_create(struct drm_device *drm, size_t size, in tegra_bo_create() argument
261 bo = tegra_bo_alloc_object(drm, size); in tegra_bo_create()
265 err = tegra_bo_alloc(drm, bo); in tegra_bo_create()
284 struct drm_device *drm, in tegra_bo_create_with_handle() argument
292 bo = tegra_bo_create(drm, size, flags); in tegra_bo_create_with_handle()
307 static struct tegra_bo *tegra_bo_import(struct drm_device *drm, in tegra_bo_import() argument
310 struct tegra_drm *tegra = drm->dev_private; in tegra_bo_import()
315 bo = tegra_bo_alloc_object(drm, buf->size); in tegra_bo_import()
319 attach = dma_buf_attach(buf, drm->dev); in tegra_bo_import()
387 int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm, in tegra_bo_dumb_create() argument
391 struct tegra_drm *tegra = drm->dev_private; in tegra_bo_dumb_create()
397 bo = tegra_bo_create_with_handle(file, drm, args->size, 0, in tegra_bo_dumb_create()
405 int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm, in tegra_bo_dumb_map_offset() argument
411 mutex_lock(&drm->struct_mutex); in tegra_bo_dumb_map_offset()
413 gem = drm_gem_object_lookup(drm, file, handle); in tegra_bo_dumb_map_offset()
415 dev_err(drm->dev, "failed to lookup GEM object\n"); in tegra_bo_dumb_map_offset()
416 mutex_unlock(&drm->struct_mutex); in tegra_bo_dumb_map_offset()
426 mutex_unlock(&drm->struct_mutex); in tegra_bo_dumb_map_offset()
617 struct dma_buf *tegra_gem_prime_export(struct drm_device *drm, in tegra_gem_prime_export() argument
631 struct drm_gem_object *tegra_gem_prime_import(struct drm_device *drm, in tegra_gem_prime_import() argument
639 if (gem->dev == drm) { in tegra_gem_prime_import()
645 bo = tegra_bo_import(drm, buf); in tegra_gem_prime_import()