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.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
index 9978b614a1aa..dfac5ed31120 100644
--- a/include/linux/dma-buf.h
+++ b/include/linux/dma-buf.h
@@ -112,6 +112,8 @@ struct dma_buf_ops {
112 * @file: file pointer used for sharing buffers across, and for refcounting. 112 * @file: file pointer used for sharing buffers across, and for refcounting.
113 * @attachments: list of dma_buf_attachment that denotes all devices attached. 113 * @attachments: list of dma_buf_attachment that denotes all devices attached.
114 * @ops: dma_buf_ops associated with this buffer object. 114 * @ops: dma_buf_ops associated with this buffer object.
115 * @exp_name: name of the exporter; useful for debugging.
116 * @list_node: node for dma_buf accounting and debugging.
115 * @priv: exporter specific private data for this buffer object. 117 * @priv: exporter specific private data for this buffer object.
116 */ 118 */
117struct dma_buf { 119struct dma_buf {
@@ -123,6 +125,8 @@ struct dma_buf {
123 struct mutex lock; 125 struct mutex lock;
124 unsigned vmapping_counter; 126 unsigned vmapping_counter;
125 void *vmap_ptr; 127 void *vmap_ptr;
128 const char *exp_name;
129 struct list_head list_node;
126 void *priv; 130 void *priv;
127}; 131};
128 132
@@ -162,8 +166,13 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
162 struct device *dev); 166 struct device *dev);
163void dma_buf_detach(struct dma_buf *dmabuf, 167void dma_buf_detach(struct dma_buf *dmabuf,
164 struct dma_buf_attachment *dmabuf_attach); 168 struct dma_buf_attachment *dmabuf_attach);
165struct dma_buf *dma_buf_export(void *priv, const struct dma_buf_ops *ops, 169
166 size_t size, int flags); 170struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops,
171 size_t size, int flags, const char *);
172
173#define dma_buf_export(priv, ops, size, flags) \
174 dma_buf_export_named(priv, ops, size, flags, __FILE__)
175
167int dma_buf_fd(struct dma_buf *dmabuf, int flags); 176int dma_buf_fd(struct dma_buf *dmabuf, int flags);
168struct dma_buf *dma_buf_get(int fd); 177struct dma_buf *dma_buf_get(int fd);
169void dma_buf_put(struct dma_buf *dmabuf); 178void dma_buf_put(struct dma_buf *dmabuf);
@@ -185,5 +194,6 @@ int dma_buf_mmap(struct dma_buf *, struct vm_area_struct *,
185 unsigned long); 194 unsigned long);
186void *dma_buf_vmap(struct dma_buf *); 195void *dma_buf_vmap(struct dma_buf *);
187void dma_buf_vunmap(struct dma_buf *, void *vaddr); 196void dma_buf_vunmap(struct dma_buf *, void *vaddr);
188 197int dma_buf_debugfs_create_file(const char *name,
198 int (*write)(struct seq_file *));
189#endif /* __DMA_BUF_H__ */ 199#endif /* __DMA_BUF_H__ */