]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
[media] v4l2-mem2mem: add v4l2_m2m_create_bufs helper
authorPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 21 May 2013 07:16:28 +0000 (04:16 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 3 Jun 2013 18:51:11 +0000 (15:51 -0300)
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>
drivers/media/v4l2-core/v4l2-mem2mem.c
include/media/v4l2-mem2mem.h

index 9ac39b5d5830ba684a6d0cd55f37151d90710969..a756170dbe7bffd2f919bf196251499d8037c862 100644 (file)
@@ -371,6 +371,20 @@ int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
 }
 EXPORT_SYMBOL_GPL(v4l2_m2m_dqbuf);
 
+/**
+ * v4l2_m2m_create_bufs() - create a source or destination buffer, depending
+ * on the type
+ */
+int v4l2_m2m_create_bufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
+                        struct v4l2_create_buffers *create)
+{
+       struct vb2_queue *vq;
+
+       vq = v4l2_m2m_get_vq(m2m_ctx, create->format.type);
+       return vb2_create_bufs(vq, create);
+}
+EXPORT_SYMBOL_GPL(v4l2_m2m_create_bufs);
+
 /**
  * v4l2_m2m_expbuf() - export a source or destination buffer, depending on
  * the type
index d3eef01da648d49387d6efe41bb2cae66bd6dac6..0f4555b2a31bdfc4a499df23f3b77de6a95769a2 100644 (file)
@@ -110,6 +110,8 @@ int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
                  struct v4l2_buffer *buf);
 int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
                   struct v4l2_buffer *buf);
+int v4l2_m2m_create_bufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
+                        struct v4l2_create_buffers *create);
 
 int v4l2_m2m_expbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
                   struct v4l2_exportbuffer *eb);