Skip to contentSkip to conversation

dma-buf: add initial vmap documentation

PATCH In review Dave Airlie 2 participants 2 messages May 22, 2012 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma-buf: add initial vmap documentation

From: Dave Airlie <[email protected]>

---
 Documentation/dma-buf-sharing.txt |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
Documentation/dma-buf-sharing.txt +11 -0
index 3bbd5c5..98e9fa0 100644
@@ -300,6 +300,17 @@ Access to a dma_buf from the kernel context involves three steps:
    Note that these calls need to always succeed. The exporter needs to complete
    any preparations that might fail in begin_cpu_access.
 
+   For some circumstances the overhead of kmap can be too high, a vmap interface
+   is introduced. This interface shouldn't be used very carefully, as vmalloc
+   space is a limited resources on many architectures.
+
+   Interfaces:
+      void *dma_buf_vmap(struct dma_buf *dmabuf)
+      void dma_buf_vunmap(struct dma_buf *dmabuf, void *vaddr)
+
+   This call can fail if there is no vmap support in the exporter, or if it
+   runs out of vmalloc space. Fallback to kmap should be implemented.
+
 3. Finish access
 
    When the importer is done accessing the range specified in begin_cpu_access,
Signature · 1 line
1.7.6
#1 lore raw
Quoted 1 line · Dave Airlie

From: Dave Airlie <[email protected]>

Inline comment for one sentence that made no sense.

Quoted 10 lines
---
 Documentation/dma-buf-sharing.txt |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
Documentation/dma-buf-sharing.txt +0 -0
index 3bbd5c5..98e9fa0 100644

Documentation/dma-buf-sharing.txt Access to a dma_buf from the kernel context involves three steps: · line 304

Quoted 5 lines
Documentation/dma-buf-sharing.txt +2 -0
@@ -300,6 +300,17 @@ Access to a dma_buf from the kernel context involves three steps:
    Note that these calls need to always succeed. The exporter needs to complete
    any preparations that might fail in begin_cpu_access.
 
+   For some circumstances the overhead of kmap can be too high, a vmap interface
+   is introduced. This interface shouldn't be used very carefully, as vmalloc

This interface should be used carefully.

Sparingly would also be appropriate, though in less regular usage than carefully.

Quoted 10 lines
Documentation/dma-buf-sharing.txt +9 -0
+   space is a limited resources on many architectures.
+
+   Interfaces:
+      void *dma_buf_vmap(struct dma_buf *dmabuf)
+      void dma_buf_vunmap(struct dma_buf *dmabuf, void *vaddr)
+
+   This call can fail if there is no vmap support in the exporter, or if it
+   runs out of vmalloc space. Fallback to kmap should be implemented.
+
 3. Finish access
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre