Lines Matching refs:dma_buf

99 	void (*dmabuf_release)(struct dma_buf *dma_buf);
133 static void ttm_prime_dmabuf_release(struct dma_buf *dma_buf);
476 static bool __must_check get_dma_buf_unless_doomed(struct dma_buf *dmabuf) in get_dma_buf_unless_doomed()
498 BUG_ON(prime->dma_buf != NULL); in ttm_prime_refcount_release()
514 static void ttm_prime_dmabuf_release(struct dma_buf *dma_buf) in ttm_prime_dmabuf_release() argument
517 (struct ttm_prime_object *) dma_buf->priv; in ttm_prime_dmabuf_release()
522 tdev->dmabuf_release(dma_buf); in ttm_prime_dmabuf_release()
524 if (prime->dma_buf == dma_buf) in ttm_prime_dmabuf_release()
525 prime->dma_buf = NULL; in ttm_prime_dmabuf_release()
545 struct dma_buf *dma_buf; in ttm_prime_fd_to_handle() local
550 dma_buf = dma_buf_get(fd); in ttm_prime_fd_to_handle()
551 if (IS_ERR(dma_buf)) in ttm_prime_fd_to_handle()
552 return PTR_ERR(dma_buf); in ttm_prime_fd_to_handle()
554 if (dma_buf->ops != &tdev->ops) in ttm_prime_fd_to_handle()
557 prime = (struct ttm_prime_object *) dma_buf->priv; in ttm_prime_fd_to_handle()
562 dma_buf_put(dma_buf); in ttm_prime_fd_to_handle()
582 struct dma_buf *dma_buf; in ttm_prime_handle_to_fd() local
605 dma_buf = prime->dma_buf; in ttm_prime_handle_to_fd()
606 if (!dma_buf || !get_dma_buf_unless_doomed(dma_buf)) { in ttm_prime_handle_to_fd()
617 dma_buf = dma_buf_export(&exp_info); in ttm_prime_handle_to_fd()
618 if (IS_ERR(dma_buf)) { in ttm_prime_handle_to_fd()
619 ret = PTR_ERR(dma_buf); in ttm_prime_handle_to_fd()
628 prime->dma_buf = dma_buf; in ttm_prime_handle_to_fd()
632 ret = dma_buf_fd(dma_buf, flags); in ttm_prime_handle_to_fd()
637 dma_buf_put(dma_buf); in ttm_prime_handle_to_fd()
666 prime->dma_buf = NULL; in ttm_prime_object_init()