summaryrefslogtreecommitdiff
path: root/include/linux/dma-buf.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-05-20 11:03:56 +0400
committerSumit Semwal <sumit.semwal@ti.com>2012-05-25 11:05:24 +0400
commit98f86c9e4ae3205e4c85c535691a5d36426360ee (patch)
tree07a533aaf702c8b0a0f6ffb0b0ee2ae6e4fe62e3 /include/linux/dma-buf.h
parent4c78513e457f72d5554a0f6e2eabfad7b98e4f19 (diff)
downloadlinux-98f86c9e4ae3205e4c85c535691a5d36426360ee.tar.xz
dma-buf: add vmap interface
The main requirement I have for this interface is for scanning out using the USB gpu devices. Since these devices have to read the framebuffer on updates and linearly compress it, using kmaps is a major overhead for every update. v2: fix warn issues pointed out by Sylwester Nawrocki. v3: fix compile !CONFIG_DMA_SHARED_BUFFER and add _GPL for now Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Rob Clark <rob.clark@linaro.org> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Diffstat (limited to 'include/linux/dma-buf.h')
-rw-r--r--include/linux/dma-buf.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
index 1f78d1594cc7..a02b1ff6488e 100644
--- a/include/linux/dma-buf.h
+++ b/include/linux/dma-buf.h
@@ -98,6 +98,9 @@ struct dma_buf_ops {
void (*kunmap)(struct dma_buf *, unsigned long, void *);
int (*mmap)(struct dma_buf *, struct vm_area_struct *vma);
+
+ void *(*vmap)(struct dma_buf *);
+ void (*vunmap)(struct dma_buf *, void *vaddr);
};
/**
@@ -176,6 +179,8 @@ void dma_buf_kunmap(struct dma_buf *, unsigned long, void *);
int dma_buf_mmap(struct dma_buf *, struct vm_area_struct *,
unsigned long);
+void *dma_buf_vmap(struct dma_buf *);
+void dma_buf_vunmap(struct dma_buf *, void *vaddr);
#else
static inline struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
@@ -264,6 +269,15 @@ static inline int dma_buf_mmap(struct dma_buf *dmabuf,
{
return -ENODEV;
}
+
+static inline void *dma_buf_vmap(struct dma_buf *dmabuf)
+{
+ return NULL;
+}
+
+static inline void dma_buf_vunmap(struct dma_buf *dmabuf, void *vaddr)
+{
+}
#endif /* CONFIG_DMA_SHARED_BUFFER */
#endif /* __DMA_BUF_H__ */