]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/dma-buf.h
dma-buf: replace dma_buf_export() with dma_buf_export_named()
[karo-tx-linux.git] / include / linux / dma-buf.h
index 9978b614a1aac8627a24e6b42b3a0ff0761e941a..6f55c0424f120610ac700ad3663743f98eabec42 100644 (file)
@@ -112,6 +112,7 @@ struct dma_buf_ops {
  * @file: file pointer used for sharing buffers across, and for refcounting.
  * @attachments: list of dma_buf_attachment that denotes all devices attached.
  * @ops: dma_buf_ops associated with this buffer object.
+ * @exp_name: name of the exporter; useful for debugging.
  * @priv: exporter specific private data for this buffer object.
  */
 struct dma_buf {
@@ -123,6 +124,7 @@ struct dma_buf {
        struct mutex lock;
        unsigned vmapping_counter;
        void *vmap_ptr;
+       const char *exp_name;
        void *priv;
 };
 
@@ -162,8 +164,13 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
                                                        struct device *dev);
 void dma_buf_detach(struct dma_buf *dmabuf,
                                struct dma_buf_attachment *dmabuf_attach);
-struct dma_buf *dma_buf_export(void *priv, const struct dma_buf_ops *ops,
-                              size_t size, int flags);
+
+struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops,
+                              size_t size, int flags, const char *);
+
+#define dma_buf_export(priv, ops, size, flags) \
+       dma_buf_export_named(priv, ops, size, flags, __FILE__)
+
 int dma_buf_fd(struct dma_buf *dmabuf, int flags);
 struct dma_buf *dma_buf_get(int fd);
 void dma_buf_put(struct dma_buf *dmabuf);