aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShow Liu <show.liu@linaro.org>2013-12-26 11:00:38 +0800
committerShow Liu <show.liu@linaro.org>2014-02-20 16:00:55 +0800
commit203294d7b7193e8e44e617d9254e9b654ac34d73 (patch)
treef46fd2e3d682ffbbe6884e33bdcbd47c9cf12574
parentb82db44ee85b14fd588373f24d48ce1e9ef94c4c (diff)
Applied kds patches into dma_buf
-rw-r--r--include/linux/dma-buf.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
index dfac5ed3112..0c781c9308f 100644
--- a/include/linux/dma-buf.h
+++ b/include/linux/dma-buf.h
@@ -30,6 +30,7 @@
#include <linux/list.h>
#include <linux/dma-mapping.h>
#include <linux/fs.h>
+#include <linux/kds.h>
struct device;
struct dma_buf;
@@ -127,6 +128,7 @@ struct dma_buf {
void *vmap_ptr;
const char *exp_name;
struct list_head list_node;
+ struct kds_resource kds;
void *priv;
};
@@ -162,6 +164,21 @@ static inline void get_dma_buf(struct dma_buf *dmabuf)
get_file(dmabuf->file);
}
+/**
+ * get_dma_buf_kds_resource - get a KDS resource for this dma-buf
+ * @dmabuf: [in] pointer to dma_buf
+ *
+ * Returns a KDS resource that represents the dma-buf. This should be used by
+ * drivers to synchronize access to the buffer. Note that the caller should
+ * ensure that a reference to the dma-buf exists from the call to
+ * kds_async_wait until kds_resource_set_release is called.
+ */
+static inline struct kds_resource *
+ get_dma_buf_kds_resource(struct dma_buf *dmabuf)
+{
+ return &dmabuf->kds;
+}
+
struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
struct device *dev);
void dma_buf_detach(struct dma_buf *dmabuf,