Lines Matching refs:dma_buf
98 void (*dmabuf_release)(struct dma_buf *dma_buf);
134 static void ttm_prime_dmabuf_release(struct dma_buf *dma_buf);
550 tdev->dma_buf_size = ttm_round_pot(sizeof(struct dma_buf)) + in ttm_object_device_init()
585 static bool __must_check get_dma_buf_unless_doomed(struct dma_buf *dmabuf) in get_dma_buf_unless_doomed()
607 BUG_ON(prime->dma_buf != NULL); in ttm_prime_refcount_release()
623 static void ttm_prime_dmabuf_release(struct dma_buf *dma_buf) in ttm_prime_dmabuf_release() argument
626 (struct ttm_prime_object *) dma_buf->priv; in ttm_prime_dmabuf_release()
631 tdev->dmabuf_release(dma_buf); in ttm_prime_dmabuf_release()
633 if (prime->dma_buf == dma_buf) in ttm_prime_dmabuf_release()
634 prime->dma_buf = NULL; in ttm_prime_dmabuf_release()
655 struct dma_buf *dma_buf; in ttm_prime_fd_to_handle() local
660 dma_buf = dma_buf_get(fd); in ttm_prime_fd_to_handle()
661 if (IS_ERR(dma_buf)) in ttm_prime_fd_to_handle()
662 return PTR_ERR(dma_buf); in ttm_prime_fd_to_handle()
664 if (dma_buf->ops != &tdev->ops) in ttm_prime_fd_to_handle()
667 prime = (struct ttm_prime_object *) dma_buf->priv; in ttm_prime_fd_to_handle()
672 dma_buf_put(dma_buf); in ttm_prime_fd_to_handle()
692 struct dma_buf *dma_buf; in ttm_prime_handle_to_fd() local
715 dma_buf = prime->dma_buf; in ttm_prime_handle_to_fd()
716 if (!dma_buf || !get_dma_buf_unless_doomed(dma_buf)) { in ttm_prime_handle_to_fd()
737 dma_buf = dma_buf_export(&exp_info); in ttm_prime_handle_to_fd()
738 if (IS_ERR(dma_buf)) { in ttm_prime_handle_to_fd()
739 ret = PTR_ERR(dma_buf); in ttm_prime_handle_to_fd()
750 prime->dma_buf = dma_buf; in ttm_prime_handle_to_fd()
754 ret = dma_buf_fd(dma_buf, flags); in ttm_prime_handle_to_fd()
759 dma_buf_put(dma_buf); in ttm_prime_handle_to_fd()
791 prime->dma_buf = NULL; in ttm_prime_object_init()