Lines Matching refs:tdev
73 struct ttm_object_device *tdev; member
169 struct ttm_object_device *tdev = tfile->tdev; in ttm_base_object_init() local
179 spin_lock(&tdev->object_lock); in ttm_base_object_init()
180 ret = idr_alloc(&tdev->idr, base, 1, 0, GFP_NOWAIT); in ttm_base_object_init()
181 spin_unlock(&tdev->object_lock); in ttm_base_object_init()
195 spin_lock(&tdev->object_lock); in ttm_base_object_init()
196 idr_remove(&tdev->idr, base->handle); in ttm_base_object_init()
197 spin_unlock(&tdev->object_lock); in ttm_base_object_init()
205 struct ttm_object_device *tdev = base->tfile->tdev; in ttm_release_base() local
207 spin_lock(&tdev->object_lock); in ttm_release_base()
208 idr_remove(&tdev->idr, base->handle); in ttm_release_base()
209 spin_unlock(&tdev->object_lock); in ttm_release_base()
288 ttm_base_object_lookup_for_ref(struct ttm_object_device *tdev, uint32_t key) in ttm_base_object_lookup_for_ref() argument
293 base = idr_find(&tdev->idr, key); in ttm_base_object_lookup_for_ref()
355 struct ttm_mem_global *mem_glob = tfile->tdev->mem_glob; in ttm_ref_object_add()
430 struct ttm_mem_global *mem_glob = tfile->tdev->mem_glob; in ttm_ref_object_release()
494 struct ttm_object_file *ttm_object_file_init(struct ttm_object_device *tdev, in ttm_object_file_init() argument
506 tfile->tdev = tdev; in ttm_object_file_init()
533 struct ttm_object_device *tdev = kmalloc(sizeof(*tdev), GFP_KERNEL); in ttm_object_device_init() local
536 if (unlikely(tdev == NULL)) in ttm_object_device_init()
539 tdev->mem_glob = mem_glob; in ttm_object_device_init()
540 spin_lock_init(&tdev->object_lock); in ttm_object_device_init()
541 atomic_set(&tdev->object_count, 0); in ttm_object_device_init()
542 ret = drm_ht_create(&tdev->object_hash, hash_order); in ttm_object_device_init()
546 idr_init_base(&tdev->idr, 1); in ttm_object_device_init()
547 tdev->ops = *ops; in ttm_object_device_init()
548 tdev->dmabuf_release = tdev->ops.release; in ttm_object_device_init()
549 tdev->ops.release = ttm_prime_dmabuf_release; in ttm_object_device_init()
550 tdev->dma_buf_size = ttm_round_pot(sizeof(struct dma_buf)) + in ttm_object_device_init()
552 return tdev; in ttm_object_device_init()
555 kfree(tdev); in ttm_object_device_init()
561 struct ttm_object_device *tdev = *p_tdev; in ttm_object_device_release() local
565 WARN_ON_ONCE(!idr_is_empty(&tdev->idr)); in ttm_object_device_release()
566 idr_destroy(&tdev->idr); in ttm_object_device_release()
567 drm_ht_remove(&tdev->object_hash); in ttm_object_device_release()
569 kfree(tdev); in ttm_object_device_release()
628 struct ttm_object_device *tdev = base->tfile->tdev; in ttm_prime_dmabuf_release() local
630 if (tdev->dmabuf_release) in ttm_prime_dmabuf_release()
631 tdev->dmabuf_release(dma_buf); in ttm_prime_dmabuf_release()
636 ttm_mem_global_free(tdev->mem_glob, tdev->dma_buf_size); in ttm_prime_dmabuf_release()
654 struct ttm_object_device *tdev = tfile->tdev; in ttm_prime_fd_to_handle() local
664 if (dma_buf->ops != &tdev->ops) in ttm_prime_fd_to_handle()
690 struct ttm_object_device *tdev = tfile->tdev; in ttm_prime_handle_to_fd() local
722 exp_info.ops = &tdev->ops; in ttm_prime_handle_to_fd()
730 ret = ttm_mem_global_alloc(tdev->mem_glob, tdev->dma_buf_size, in ttm_prime_handle_to_fd()
740 ttm_mem_global_free(tdev->mem_glob, in ttm_prime_handle_to_fd()
741 tdev->dma_buf_size); in ttm_prime_handle_to_fd()