diff options
Diffstat (limited to 'include/linux/dma-buf.h')
| -rw-r--r-- | include/linux/dma-buf.h | 21 |
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 @@ | |||
| 30 | #include <linux/list.h> | 30 | #include <linux/list.h> |
| 31 | #include <linux/dma-mapping.h> | 31 | #include <linux/dma-mapping.h> |
| 32 | #include <linux/fs.h> | 32 | #include <linux/fs.h> |
| 33 | #include <linux/fence.h> | ||
| 34 | #include <linux/wait.h> | ||
| 33 | 35 | ||
| 34 | struct device; | 36 | struct device; |
| 35 | struct dma_buf; | 37 | struct dma_buf; |
| @@ -115,6 +117,7 @@ struct dma_buf_ops { | |||
| 115 | * @exp_name: name of the exporter; useful for debugging. | 117 | * @exp_name: name of the exporter; useful for debugging. |
| 116 | * @list_node: node for dma_buf accounting and debugging. | 118 | * @list_node: node for dma_buf accounting and debugging. |
| 117 | * @priv: exporter specific private data for this buffer object. | 119 | * @priv: exporter specific private data for this buffer object. |
| 120 | * @resv: reservation object linked to this dma-buf | ||
| 118 | */ | 121 | */ |
| 119 | struct dma_buf { | 122 | struct dma_buf { |
| 120 | size_t size; | 123 | size_t size; |
| @@ -128,6 +131,17 @@ struct dma_buf { | |||
| 128 | const char *exp_name; | 131 | const char *exp_name; |
| 129 | struct list_head list_node; | 132 | struct list_head list_node; |
| 130 | void *priv; | 133 | void *priv; |
| 134 | struct reservation_object *resv; | ||
| 135 | |||
| 136 | /* poll support */ | ||
| 137 | wait_queue_head_t poll; | ||
| 138 | |||
| 139 | struct dma_buf_poll_cb_t { | ||
| 140 | struct fence_cb cb; | ||
| 141 | wait_queue_head_t *poll; | ||
| 142 | |||
| 143 | unsigned long active; | ||
| 144 | } cb_excl, cb_shared; | ||
| 131 | }; | 145 | }; |
| 132 | 146 | ||
| 133 | /** | 147 | /** |
| @@ -168,10 +182,11 @@ void dma_buf_detach(struct dma_buf *dmabuf, | |||
| 168 | struct dma_buf_attachment *dmabuf_attach); | 182 | struct dma_buf_attachment *dmabuf_attach); |
| 169 | 183 | ||
| 170 | struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops, | 184 | struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops, |
| 171 | size_t size, int flags, const char *); | 185 | size_t size, int flags, const char *, |
| 186 | struct reservation_object *); | ||
| 172 | 187 | ||
| 173 | #define dma_buf_export(priv, ops, size, flags) \ | 188 | #define dma_buf_export(priv, ops, size, flags, resv) \ |
| 174 | dma_buf_export_named(priv, ops, size, flags, KBUILD_MODNAME) | 189 | dma_buf_export_named(priv, ops, size, flags, KBUILD_MODNAME, resv) |
| 175 | 190 | ||
| 176 | int dma_buf_fd(struct dma_buf *dmabuf, int flags); | 191 | int dma_buf_fd(struct dma_buf *dmabuf, int flags); |
| 177 | struct dma_buf *dma_buf_get(int fd); | 192 | struct dma_buf *dma_buf_get(int fd); |
