Lines Matching refs:prime
31 * While no substantial code is shared, the prime code is inspired by
482 * ttm_prime_refcount_release - refcount release method for a prime object.
487 * underlying object. At the same time it cleans up the prime object.
494 struct ttm_prime_object *prime;
497 prime = container_of(base, struct ttm_prime_object, base);
498 BUG_ON(prime->dma_buf != NULL);
499 mutex_destroy(&prime->mutex);
500 if (prime->refcount_release)
501 prime->refcount_release(&base);
516 struct ttm_prime_object *prime =
518 struct ttm_base_object *base = &prime->base;
523 mutex_lock(&prime->mutex);
524 if (prime->dma_buf == dma_buf)
525 prime->dma_buf = NULL;
526 mutex_unlock(&prime->mutex);
531 * ttm_prime_fd_to_handle - Get a base object handle from a prime fd
534 * @fd: The prime / dmabuf fd.
546 struct ttm_prime_object *prime;
557 prime = (struct ttm_prime_object *) dma_buf->priv;
558 base = &prime->base;
568 * ttm_prime_handle_to_fd - Return a dma_buf fd from a ttm prime object
583 struct ttm_prime_object *prime;
593 prime = container_of(base, struct ttm_prime_object, base);
599 ret = mutex_lock_interruptible(&prime->mutex);
605 dma_buf = prime->dma_buf;
609 exp_info.size = prime->size;
611 exp_info.priv = prime;
620 mutex_unlock(&prime->mutex);
628 prime->dma_buf = dma_buf;
630 mutex_unlock(&prime->mutex);
650 * @prime: The object to be initialized.
659 struct ttm_prime_object *prime, bool shareable,
663 mutex_init(&prime->mutex);
664 prime->size = PAGE_ALIGN(size);
665 prime->real_type = type;
666 prime->dma_buf = NULL;
667 prime->refcount_release = refcount_release;
668 return ttm_base_object_init(tfile, &prime->base, shareable,