Lines Matching refs:dma_buf
96 void (*dmabuf_release)(struct dma_buf *dma_buf);
130 static void ttm_prime_dmabuf_release(struct dma_buf *dma_buf);
472 static bool __must_check get_dma_buf_unless_doomed(struct dma_buf *dmabuf) in get_dma_buf_unless_doomed()
494 BUG_ON(prime->dma_buf != NULL); in ttm_prime_refcount_release()
510 static void ttm_prime_dmabuf_release(struct dma_buf *dma_buf) in ttm_prime_dmabuf_release() argument
513 (struct ttm_prime_object *) dma_buf->priv; in ttm_prime_dmabuf_release()
518 tdev->dmabuf_release(dma_buf); in ttm_prime_dmabuf_release()
520 if (prime->dma_buf == dma_buf) in ttm_prime_dmabuf_release()
521 prime->dma_buf = NULL; in ttm_prime_dmabuf_release()
541 struct dma_buf *dma_buf; in ttm_prime_fd_to_handle() local
546 dma_buf = dma_buf_get(fd); in ttm_prime_fd_to_handle()
547 if (IS_ERR(dma_buf)) in ttm_prime_fd_to_handle()
548 return PTR_ERR(dma_buf); in ttm_prime_fd_to_handle()
550 if (dma_buf->ops != &tdev->ops) in ttm_prime_fd_to_handle()
553 prime = (struct ttm_prime_object *) dma_buf->priv; in ttm_prime_fd_to_handle()
558 dma_buf_put(dma_buf); in ttm_prime_fd_to_handle()
578 struct dma_buf *dma_buf; in ttm_prime_handle_to_fd() local
601 dma_buf = prime->dma_buf; in ttm_prime_handle_to_fd()
602 if (!dma_buf || !get_dma_buf_unless_doomed(dma_buf)) { in ttm_prime_handle_to_fd()
613 dma_buf = dma_buf_export(&exp_info); in ttm_prime_handle_to_fd()
614 if (IS_ERR(dma_buf)) { in ttm_prime_handle_to_fd()
615 ret = PTR_ERR(dma_buf); in ttm_prime_handle_to_fd()
624 prime->dma_buf = dma_buf; in ttm_prime_handle_to_fd()
628 ret = dma_buf_fd(dma_buf, flags); in ttm_prime_handle_to_fd()
633 dma_buf_put(dma_buf); in ttm_prime_handle_to_fd()
662 prime->dma_buf = NULL; in ttm_prime_object_init()