summaryrefslogtreecommitdiff
path: root/include/linux/dma-buf.h
diff options
context:
space:
mode:
authorArto Merilainen <amerilainen@nvidia.com>2014-02-16 15:22:50 +0200
committerTerje Bergstrom <tbergstrom@nvidia.com>2014-02-26 22:35:21 -0800
commita5757cc67b0e151475101bf451df9fc092816a46 (patch)
treed7033827c82471e34df67d1ef447a1e0c47d846d /include/linux/dma-buf.h
parentb9de88f6b2362532edbab617fd2d824b83fcf059 (diff)
dmabuf: Support driver data
Occassionally we need to store driver/device specific data of a device that survives over attach/detach sequence. This patch adds support for defining drvdata inside dmabuf. Bug 1450489 Change-Id: I840d415657a07ef86476e32bcac4e13a8706ece4 Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-on: http://git-master/r/368139 Reviewed-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'include/linux/dma-buf.h')
-rw-r--r--include/linux/dma-buf.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
index dfac5ed31120..cf1f03f69a47 100644
--- a/include/linux/dma-buf.h
+++ b/include/linux/dma-buf.h
@@ -104,6 +104,10 @@ struct dma_buf_ops {
void *(*vmap)(struct dma_buf *);
void (*vunmap)(struct dma_buf *, void *vaddr);
+
+ void *(*get_drvdata)(struct dma_buf *, struct device *);
+ int (*set_drvdata)(struct dma_buf *, struct device *, void *priv,
+ void (*)(void *));
};
/**
@@ -177,6 +181,10 @@ 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);
+int dma_buf_set_drvdata(struct dma_buf *, struct device *,
+ void *, void (*destroy)(void *));
+void *dma_buf_get_drvdata(struct dma_buf *, struct device *);
+
struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *,
enum dma_data_direction);
void dma_buf_unmap_attachment(struct dma_buf_attachment *, struct sg_table *,