diff options
| author | Philipp Zabel <p.zabel@pengutronix.de> | 2013-05-21 03:16:28 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-06-03 14:51:11 -0400 |
| commit | 8b94ca61d7065fa7fa7bdb08ce31a9385be5205b (patch) | |
| tree | fd433d2926ecb4ebd4b82a1454d2241e452ed166 | |
| parent | 57183467c09555d985ae62b79c754e64279381df (diff) | |
[media] v4l2-mem2mem: add v4l2_m2m_create_bufs helper
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
| -rw-r--r-- | drivers/media/v4l2-core/v4l2-mem2mem.c | 14 | ||||
| -rw-r--r-- | include/media/v4l2-mem2mem.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c index 9ac39b5d5830..a756170dbe7b 100644 --- a/drivers/media/v4l2-core/v4l2-mem2mem.c +++ b/drivers/media/v4l2-core/v4l2-mem2mem.c | |||
| @@ -372,6 +372,20 @@ int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | |||
| 372 | EXPORT_SYMBOL_GPL(v4l2_m2m_dqbuf); | 372 | EXPORT_SYMBOL_GPL(v4l2_m2m_dqbuf); |
| 373 | 373 | ||
| 374 | /** | 374 | /** |
| 375 | * v4l2_m2m_create_bufs() - create a source or destination buffer, depending | ||
| 376 | * on the type | ||
| 377 | */ | ||
| 378 | int v4l2_m2m_create_bufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | ||
| 379 | struct v4l2_create_buffers *create) | ||
| 380 | { | ||
| 381 | struct vb2_queue *vq; | ||
| 382 | |||
| 383 | vq = v4l2_m2m_get_vq(m2m_ctx, create->format.type); | ||
| 384 | return vb2_create_bufs(vq, create); | ||
| 385 | } | ||
| 386 | EXPORT_SYMBOL_GPL(v4l2_m2m_create_bufs); | ||
| 387 | |||
| 388 | /** | ||
| 375 | * v4l2_m2m_expbuf() - export a source or destination buffer, depending on | 389 | * v4l2_m2m_expbuf() - export a source or destination buffer, depending on |
| 376 | * the type | 390 | * the type |
| 377 | */ | 391 | */ |
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h index d3eef01da648..0f4555b2a31b 100644 --- a/include/media/v4l2-mem2mem.h +++ b/include/media/v4l2-mem2mem.h | |||
| @@ -110,6 +110,8 @@ int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | |||
| 110 | struct v4l2_buffer *buf); | 110 | struct v4l2_buffer *buf); |
| 111 | int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | 111 | int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, |
| 112 | struct v4l2_buffer *buf); | 112 | struct v4l2_buffer *buf); |
| 113 | int v4l2_m2m_create_bufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | ||
| 114 | struct v4l2_create_buffers *create); | ||
| 113 | 115 | ||
| 114 | int v4l2_m2m_expbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | 116 | int v4l2_m2m_expbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, |
| 115 | struct v4l2_exportbuffer *eb); | 117 | struct v4l2_exportbuffer *eb); |
