Lines Matching refs:prime
600 struct ttm_prime_object *prime; in ttm_prime_refcount_release() local
603 prime = container_of(base, struct ttm_prime_object, base); in ttm_prime_refcount_release()
604 BUG_ON(prime->dma_buf != NULL); in ttm_prime_refcount_release()
605 mutex_destroy(&prime->mutex); in ttm_prime_refcount_release()
606 if (prime->refcount_release) in ttm_prime_refcount_release()
607 prime->refcount_release(&base); in ttm_prime_refcount_release()
622 struct ttm_prime_object *prime = in ttm_prime_dmabuf_release() local
624 struct ttm_base_object *base = &prime->base; in ttm_prime_dmabuf_release()
629 mutex_lock(&prime->mutex); in ttm_prime_dmabuf_release()
630 if (prime->dma_buf == dma_buf) in ttm_prime_dmabuf_release()
631 prime->dma_buf = NULL; in ttm_prime_dmabuf_release()
632 mutex_unlock(&prime->mutex); in ttm_prime_dmabuf_release()
653 struct ttm_prime_object *prime; in ttm_prime_fd_to_handle() local
664 prime = (struct ttm_prime_object *) dma_buf->priv; in ttm_prime_fd_to_handle()
665 base = &prime->base; in ttm_prime_fd_to_handle()
690 struct ttm_prime_object *prime; in ttm_prime_handle_to_fd() local
700 prime = container_of(base, struct ttm_prime_object, base); in ttm_prime_handle_to_fd()
706 ret = mutex_lock_interruptible(&prime->mutex); in ttm_prime_handle_to_fd()
712 dma_buf = prime->dma_buf; in ttm_prime_handle_to_fd()
720 exp_info.size = prime->size; in ttm_prime_handle_to_fd()
722 exp_info.priv = prime; in ttm_prime_handle_to_fd()
730 mutex_unlock(&prime->mutex); in ttm_prime_handle_to_fd()
739 mutex_unlock(&prime->mutex); in ttm_prime_handle_to_fd()
747 prime->dma_buf = dma_buf; in ttm_prime_handle_to_fd()
749 mutex_unlock(&prime->mutex); in ttm_prime_handle_to_fd()
779 struct ttm_prime_object *prime, bool shareable, in ttm_prime_object_init() argument
785 mutex_init(&prime->mutex); in ttm_prime_object_init()
786 prime->size = PAGE_ALIGN(size); in ttm_prime_object_init()
787 prime->real_type = type; in ttm_prime_object_init()
788 prime->dma_buf = NULL; in ttm_prime_object_init()
789 prime->refcount_release = refcount_release; in ttm_prime_object_init()
790 return ttm_base_object_init(tfile, &prime->base, shareable, in ttm_prime_object_init()