aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dma-buf.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/dma-buf.h')
-rw-r--r--include/linux/dma-buf.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
index f886985a28b2..694e1fe1c4b4 100644
--- a/include/linux/dma-buf.h
+++ b/include/linux/dma-buf.h
@@ -30,6 +30,8 @@
#include <linux/list.h>
#include <linux/dma-mapping.h>
#include <linux/fs.h>
+#include <linux/fence.h>
+#include <linux/wait.h>
struct device;
struct dma_buf;
@@ -115,6 +117,7 @@ struct dma_buf_ops {
* @exp_name: name of the exporter; useful for debugging.
* @list_node: node for dma_buf accounting and debugging.
* @priv: exporter specific private data for this buffer object.
+ * @resv: reservation object linked to this dma-buf
*/
struct dma_buf {
size_t size;
@@ -128,6 +131,17 @@ struct dma_buf {
const char *exp_name;
struct list_head list_node;
void *priv;
+ struct reservation_object *resv;
+
+ /* poll support */
+ wait_queue_head_t poll;
+
+ struct dma_buf_poll_cb_t {
+ struct fence_cb cb;
+ wait_queue_head_t *poll;
+
+ unsigned long active;
+ } cb_excl, cb_shared;
};
/**
@@ -168,10 +182,11 @@ void dma_buf_detach(struct dma_buf *dmabuf,
struct dma_buf_attachment *dmabuf_attach);
struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops,
- size_t size, int flags, const char *);
+ size_t size, int flags, const char *,
+ struct reservation_object *);
-#define dma_buf_export(priv, ops, size, flags) \
- dma_buf_export_named(priv, ops, size, flags, KBUILD_MODNAME)
+#define dma_buf_export(priv, ops, size, flags, resv) \
+ dma_buf_export_named(priv, ops, size, flags, KBUILD_MODNAME, resv)
int dma_buf_fd(struct dma_buf *dmabuf, int flags);
struct dma_buf *dma_buf_get(int fd);