|
@@ -30,6 +30,7 @@
|
|
#include <linux/scatterlist.h>
|
|
#include <linux/scatterlist.h>
|
|
#include <linux/list.h>
|
|
#include <linux/list.h>
|
|
#include <linux/dma-mapping.h>
|
|
#include <linux/dma-mapping.h>
|
|
|
|
+#include <linux/fs.h>
|
|
|
|
|
|
struct dma_buf;
|
|
struct dma_buf;
|
|
struct dma_buf_attachment;
|
|
struct dma_buf_attachment;
|
|
@@ -110,6 +111,20 @@ struct dma_buf_attachment {
|
|
void *priv;
|
|
void *priv;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * get_dma_buf - convenience wrapper for get_file.
|
|
|
|
+ * @dmabuf: [in] pointer to dma_buf
|
|
|
|
+ *
|
|
|
|
+ * Increments the reference count on the dma-buf, needed in case of drivers
|
|
|
|
+ * that either need to create additional references to the dmabuf on the
|
|
|
|
+ * kernel side. For example, an exporter that needs to keep a dmabuf ptr
|
|
|
|
+ * so that subsequent exports don't create a new dmabuf.
|
|
|
|
+ */
|
|
|
|
+static inline void get_dma_buf(struct dma_buf *dmabuf)
|
|
|
|
+{
|
|
|
|
+ get_file(dmabuf->file);
|
|
|
|
+}
|
|
|
|
+
|
|
#ifdef CONFIG_DMA_SHARED_BUFFER
|
|
#ifdef CONFIG_DMA_SHARED_BUFFER
|
|
struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
|
|
struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
|
|
struct device *dev);
|
|
struct device *dev);
|