diff options
author | Show Liu <show.liu@linaro.org> | 2013-12-26 11:00:38 +0800 |
---|---|---|
committer | Show Liu <show.liu@linaro.org> | 2014-04-28 11:37:15 +0800 |
commit | bb3c6d27fa8dd2294a7e43f87ccce76480f1732c (patch) | |
tree | 74ca64c97e8e7058c406e53258739bd70d920e21 | |
parent | b748a063ae4a5fca54a12022d93952ce214abd6f (diff) |
Applied kds patches into dma_buf
-rw-r--r-- | include/linux/dma-buf.h | 17 |
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, |