diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2013-05-21 04:11:35 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-12-09 11:50:50 -0500 |
commit | c1b96a236e94d49d9396d0bbceb5524519c5c66e (patch) | |
tree | a65634750514493440bdea83364001f3a48c9b7f /drivers/media/v4l2-core/videobuf2-dma-contig.c | |
parent | c7223f8f66b685f325879a88a6c955ebf46a8a36 (diff) |
[media] videobuf2: Add support for file access mode flags for DMABUF exporting
Currently it is not possible for userspace to map a DMABUF exported buffer
with write permissions. This patch allows to also pass O_RDONLY/O_RDWR when
exporting the buffer, so that userspace may map it with write permissions.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/v4l2-core/videobuf2-dma-contig.c')
-rw-r--r-- | drivers/media/v4l2-core/videobuf2-dma-contig.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c index 646f08f4f504..33d3871d1e13 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c | |||
@@ -393,7 +393,7 @@ static struct sg_table *vb2_dc_get_base_sgt(struct vb2_dc_buf *buf) | |||
393 | return sgt; | 393 | return sgt; |
394 | } | 394 | } |
395 | 395 | ||
396 | static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv) | 396 | static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags) |
397 | { | 397 | { |
398 | struct vb2_dc_buf *buf = buf_priv; | 398 | struct vb2_dc_buf *buf = buf_priv; |
399 | struct dma_buf *dbuf; | 399 | struct dma_buf *dbuf; |
@@ -404,7 +404,7 @@ static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv) | |||
404 | if (WARN_ON(!buf->sgt_base)) | 404 | if (WARN_ON(!buf->sgt_base)) |
405 | return NULL; | 405 | return NULL; |
406 | 406 | ||
407 | dbuf = dma_buf_export(buf, &vb2_dc_dmabuf_ops, buf->size, 0); | 407 | dbuf = dma_buf_export(buf, &vb2_dc_dmabuf_ops, buf->size, flags); |
408 | if (IS_ERR(dbuf)) | 408 | if (IS_ERR(dbuf)) |
409 | return NULL; | 409 | return NULL; |
410 | 410 | ||