summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorSumit Semwal <sumit.semwal@linaro.org>2015-01-23 02:23:43 -0500
committerSumit Semwal <sumit.semwal@linaro.org>2015-04-21 05:17:16 -0400
commitd8fbe341beb617ebb22b98fb893e4aa32ae2d864 (patch)
tree2e19c951d2b6ffef2319d87ec8a6c39e4e1ab8ee /Documentation
parent646da63172f660ba84f195c1165360a9b73583ee (diff)
dma-buf: cleanup dma_buf_export() to make it easily extensible
At present, dma_buf_export() takes a series of parameters, which makes it difficult to add any new parameters for exporters, if required. Make it simpler by moving all these parameters into a struct, and pass the struct * as parameter to dma_buf_export(). While at it, unite dma_buf_export_named() with dma_buf_export(), and change all callers accordingly. Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/dma-buf-sharing.txt23
1 files changed, 12 insertions, 11 deletions
diff --git a/Documentation/dma-buf-sharing.txt b/Documentation/dma-buf-sharing.txt
index bb9753b635a3..480c8de3c2c4 100644
--- a/Documentation/dma-buf-sharing.txt
+++ b/Documentation/dma-buf-sharing.txt
@@ -49,25 +49,26 @@ The dma_buf buffer sharing API usage contains the following steps:
49 The buffer exporter announces its wish to export a buffer. In this, it 49 The buffer exporter announces its wish to export a buffer. In this, it
50 connects its own private buffer data, provides implementation for operations 50 connects its own private buffer data, provides implementation for operations
51 that can be performed on the exported dma_buf, and flags for the file 51 that can be performed on the exported dma_buf, and flags for the file
52 associated with this buffer. 52 associated with this buffer. All these fields are filled in struct
53 dma_buf_export_info, defined via the DEFINE_DMA_BUF_EXPORT_INFO macro.
53 54
54 Interface: 55 Interface:
55 struct dma_buf *dma_buf_export_named(void *priv, struct dma_buf_ops *ops, 56 DEFINE_DMA_BUF_EXPORT_INFO(exp_info)
56 size_t size, int flags, 57 struct dma_buf *dma_buf_export(struct dma_buf_export_info *exp_info)
57 const char *exp_name)
58 58
59 If this succeeds, dma_buf_export_named allocates a dma_buf structure, and 59 If this succeeds, dma_buf_export allocates a dma_buf structure, and
60 returns a pointer to the same. It also associates an anonymous file with this 60 returns a pointer to the same. It also associates an anonymous file with this
61 buffer, so it can be exported. On failure to allocate the dma_buf object, 61 buffer, so it can be exported. On failure to allocate the dma_buf object,
62 it returns NULL. 62 it returns NULL.
63 63
64 'exp_name' is the name of exporter - to facilitate information while 64 'exp_name' in struct dma_buf_export_info is the name of exporter - to
65 debugging. 65 facilitate information while debugging. It is set to KBUILD_MODNAME by
66 default, so exporters don't have to provide a specific name, if they don't
67 wish to.
68
69 DEFINE_DMA_BUF_EXPORT_INFO macro defines the struct dma_buf_export_info,
70 zeroes it out and pre-populates exp_name in it.
66 71
67 Exporting modules which do not wish to provide any specific name may use the
68 helper define 'dma_buf_export()', with the same arguments as above, but
69 without the last argument; a KBUILD_MODNAME pre-processor directive will be
70 inserted in place of 'exp_name' instead.
71 72
722. Userspace gets a handle to pass around to potential buffer-users 732. Userspace gets a handle to pass around to potential buffer-users
73 74