Lines Matching refs:prime

31  * While no substantial code is shared, the prime code is inspired by
588 * ttm_prime_refcount_release - refcount release method for a prime object.
593 * underlying object. At the same time it cleans up the prime object.
600 struct ttm_prime_object *prime;
603 prime = container_of(base, struct ttm_prime_object, base);
604 BUG_ON(prime->dma_buf != NULL);
605 mutex_destroy(&prime->mutex);
606 if (prime->refcount_release)
607 prime->refcount_release(&base);
622 struct ttm_prime_object *prime =
624 struct ttm_base_object *base = &prime->base;
629 mutex_lock(&prime->mutex);
630 if (prime->dma_buf == dma_buf)
631 prime->dma_buf = NULL;
632 mutex_unlock(&prime->mutex);
638 * ttm_prime_fd_to_handle - Get a base object handle from a prime fd
641 * @fd: The prime / dmabuf fd.
653 struct ttm_prime_object *prime;
664 prime = (struct ttm_prime_object *) dma_buf->priv;
665 base = &prime->base;
675 * ttm_prime_handle_to_fd - Return a dma_buf fd from a ttm prime object
690 struct ttm_prime_object *prime;
700 prime = container_of(base, struct ttm_prime_object, base);
706 ret = mutex_lock_interruptible(&prime->mutex);
712 dma_buf = prime->dma_buf;
720 exp_info.size = prime->size;
722 exp_info.priv = prime;
730 mutex_unlock(&prime->mutex);
739 mutex_unlock(&prime->mutex);
747 prime->dma_buf = dma_buf;
749 mutex_unlock(&prime->mutex);
769 * @prime: The object to be initialized.
779 struct ttm_prime_object *prime, bool shareable,
785 mutex_init(&prime->mutex);
786 prime->size = PAGE_ALIGN(size);
787 prime->real_type = type;
788 prime->dma_buf = NULL;
789 prime->refcount_release = refcount_release;
790 return ttm_base_object_init(tfile, &prime->base, shareable,