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
217 if (dma_map_sg(drm->dev, sgt->sgl, sgt->nents, DMA_TO_DEVICE) == 0) in tegra_bo_get_pages()
233 static int tegra_bo_alloc(struct drm_device *drm, struct tegra_bo *bo) in tegra_bo_alloc() argument
235 struct tegra_drm *tegra = drm->dev_private; in tegra_bo_alloc()
239 err = tegra_bo_get_pages(drm, bo); in tegra_bo_alloc()
245 tegra_bo_free(drm, bo); in tegra_bo_alloc()
251 bo->vaddr = dma_alloc_writecombine(drm->dev, size, &bo->paddr, in tegra_bo_alloc()
254 dev_err(drm->dev, in tegra_bo_alloc()
264 struct tegra_bo *tegra_bo_create(struct drm_device *drm, size_t size, in tegra_bo_create() argument
270 bo = tegra_bo_alloc_object(drm, size); in tegra_bo_create()
274 err = tegra_bo_alloc(drm, bo); in tegra_bo_create()
293 struct drm_device *drm, in tegra_bo_create_with_handle() argument
301 bo = tegra_bo_create(drm, size, flags); in tegra_bo_create_with_handle()
316 static struct tegra_bo *tegra_bo_import(struct drm_device *drm, in tegra_bo_import() argument
319 struct tegra_drm *tegra = drm->dev_private; in tegra_bo_import()
324 bo = tegra_bo_alloc_object(drm, buf->size); in tegra_bo_import()
328 attach = dma_buf_attach(buf, drm->dev); in tegra_bo_import()
396 int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm, in tegra_bo_dumb_create() argument
400 struct tegra_drm *tegra = drm->dev_private; in tegra_bo_dumb_create()
406 bo = tegra_bo_create_with_handle(file, drm, args->size, 0, in tegra_bo_dumb_create()
414 int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm, in tegra_bo_dumb_map_offset() argument
420 mutex_lock(&drm->struct_mutex); in tegra_bo_dumb_map_offset()
422 gem = drm_gem_object_lookup(drm, file, handle); in tegra_bo_dumb_map_offset()
424 dev_err(drm->dev, "failed to lookup GEM object\n"); in tegra_bo_dumb_map_offset()
425 mutex_unlock(&drm->struct_mutex); in tegra_bo_dumb_map_offset()
435 mutex_unlock(&drm->struct_mutex); in tegra_bo_dumb_map_offset()
626 struct dma_buf *tegra_gem_prime_export(struct drm_device *drm, in tegra_gem_prime_export() argument
640 struct drm_gem_object *tegra_gem_prime_import(struct drm_device *drm, in tegra_gem_prime_import() argument
648 if (gem->dev == drm) { in tegra_gem_prime_import()
654 bo = tegra_bo_import(drm, buf); in tegra_gem_prime_import()