Lines Matching refs:dma_buf
95 void (*dmabuf_release)(struct dma_buf *dma_buf);
131 static void ttm_prime_dmabuf_release(struct dma_buf *dma_buf);
547 tdev->dma_buf_size = ttm_round_pot(sizeof(struct dma_buf)) + in ttm_object_device_init()
582 static bool __must_check get_dma_buf_unless_doomed(struct dma_buf *dmabuf) in get_dma_buf_unless_doomed()
604 BUG_ON(prime->dma_buf != NULL); in ttm_prime_refcount_release()
620 static void ttm_prime_dmabuf_release(struct dma_buf *dma_buf) in ttm_prime_dmabuf_release() argument
623 (struct ttm_prime_object *) dma_buf->priv; in ttm_prime_dmabuf_release()
628 tdev->dmabuf_release(dma_buf); 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()
652 struct dma_buf *dma_buf; in ttm_prime_fd_to_handle() local
657 dma_buf = dma_buf_get(fd); in ttm_prime_fd_to_handle()
658 if (IS_ERR(dma_buf)) in ttm_prime_fd_to_handle()
659 return PTR_ERR(dma_buf); in ttm_prime_fd_to_handle()
661 if (dma_buf->ops != &tdev->ops) in ttm_prime_fd_to_handle()
664 prime = (struct ttm_prime_object *) dma_buf->priv; in ttm_prime_fd_to_handle()
669 dma_buf_put(dma_buf); in ttm_prime_fd_to_handle()
689 struct dma_buf *dma_buf; in ttm_prime_handle_to_fd() local
712 dma_buf = prime->dma_buf; in ttm_prime_handle_to_fd()
713 if (!dma_buf || !get_dma_buf_unless_doomed(dma_buf)) { in ttm_prime_handle_to_fd()
734 dma_buf = dma_buf_export(&exp_info); in ttm_prime_handle_to_fd()
735 if (IS_ERR(dma_buf)) { in ttm_prime_handle_to_fd()
736 ret = PTR_ERR(dma_buf); in ttm_prime_handle_to_fd()
747 prime->dma_buf = dma_buf; in ttm_prime_handle_to_fd()
751 ret = dma_buf_fd(dma_buf, flags); in ttm_prime_handle_to_fd()
756 dma_buf_put(dma_buf); in ttm_prime_handle_to_fd()
788 prime->dma_buf = NULL; in ttm_prime_object_init()