Lines Matching refs:dma_buf
96 void (*dmabuf_release)(struct dma_buf *dma_buf);
131 static void ttm_prime_dmabuf_release(struct dma_buf *dma_buf);
525 tdev->dma_buf_size = ttm_round_pot(sizeof(struct dma_buf)) + in ttm_object_device_init()
560 static bool __must_check get_dma_buf_unless_doomed(struct dma_buf *dmabuf) in get_dma_buf_unless_doomed()
582 BUG_ON(prime->dma_buf != NULL); in ttm_prime_refcount_release()
598 static void ttm_prime_dmabuf_release(struct dma_buf *dma_buf) in ttm_prime_dmabuf_release() argument
601 (struct ttm_prime_object *) dma_buf->priv; in ttm_prime_dmabuf_release()
606 tdev->dmabuf_release(dma_buf); in ttm_prime_dmabuf_release()
608 if (prime->dma_buf == dma_buf) in ttm_prime_dmabuf_release()
609 prime->dma_buf = NULL; in ttm_prime_dmabuf_release()
630 struct dma_buf *dma_buf; in ttm_prime_fd_to_handle() local
635 dma_buf = dma_buf_get(fd); in ttm_prime_fd_to_handle()
636 if (IS_ERR(dma_buf)) in ttm_prime_fd_to_handle()
637 return PTR_ERR(dma_buf); in ttm_prime_fd_to_handle()
639 if (dma_buf->ops != &tdev->ops) in ttm_prime_fd_to_handle()
642 prime = (struct ttm_prime_object *) dma_buf->priv; in ttm_prime_fd_to_handle()
647 dma_buf_put(dma_buf); in ttm_prime_fd_to_handle()
668 struct dma_buf *dma_buf; in ttm_prime_handle_to_fd() local
691 dma_buf = prime->dma_buf; in ttm_prime_handle_to_fd()
692 if (!dma_buf || !get_dma_buf_unless_doomed(dma_buf)) { in ttm_prime_handle_to_fd()
713 dma_buf = dma_buf_export(&exp_info); in ttm_prime_handle_to_fd()
714 if (IS_ERR(dma_buf)) { in ttm_prime_handle_to_fd()
715 ret = PTR_ERR(dma_buf); in ttm_prime_handle_to_fd()
726 prime->dma_buf = dma_buf; in ttm_prime_handle_to_fd()
730 ret = dma_buf_fd(dma_buf, flags); in ttm_prime_handle_to_fd()
735 dma_buf_put(dma_buf); in ttm_prime_handle_to_fd()
768 prime->dma_buf = NULL; in ttm_prime_object_init()