Commit f0476a83 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[media] V4L: Add capability flags for memory-to-memory devices

This patch adds new V4L2_CAP_VIDEO_M2M and V4L2_CAP_VIDEO_M2M_MPLANE
capability flags that are intended to be used for memory-to-memory (M2M)
devices, instead of ORed V4L2_CAP_VIDEO_CAPTURE and V4L2_CAP_VIDEO_OUTPUT.

V4L2_CAP_VIDEO_M2M flag is added at the drivers, CAPTURE and OUTPUT
capability flags are left untouched and will be removed in future,
after a transition period required for existing applications to be
adapted to check only for V4L2_CAP_VIDEO_M2M.
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Acked-by: default avatarKamil Debski <k.debski@samsung.com>
Acked-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6126b912
...@@ -2471,6 +2471,15 @@ that used it. It was originally scheduled for removal in 2.6.35. ...@@ -2471,6 +2471,15 @@ that used it. It was originally scheduled for removal in 2.6.35.
</orderedlist> </orderedlist>
</section> </section>
<section>
<title>V4L2 in Linux 3.6</title>
<orderedlist>
<listitem>
<para>Added V4L2_CAP_VIDEO_M2M and V4L2_CAP_VIDEO_M2M_MPLANE capabilities.</para>
</listitem>
</orderedlist>
</section>
<section id="other"> <section id="other">
<title>Relation of V4L2 to other Linux multimedia APIs</title> <title>Relation of V4L2 to other Linux multimedia APIs</title>
......
...@@ -191,6 +191,19 @@ linkend="output">Video Output</link> interface.</entry> ...@@ -191,6 +191,19 @@ linkend="output">Video Output</link> interface.</entry>
<link linkend="planar-apis">multi-planar API</link> through the <link linkend="planar-apis">multi-planar API</link> through the
<link linkend="output">Video Output</link> interface.</entry> <link linkend="output">Video Output</link> interface.</entry>
</row> </row>
<row>
<entry><constant>V4L2_CAP_VIDEO_M2M</constant></entry>
<entry>0x00004000</entry>
<entry>The device supports the single-planar API through the
Video Memory-To-Memory interface.</entry>
</row>
<row>
<entry><constant>V4L2_CAP_VIDEO_M2M_MPLANE</constant></entry>
<entry>0x00008000</entry>
<entry>The device supports the
<link linkend="planar-apis">multi-planar API</link> through the
Video Memory-To-Memory interface.</entry>
</row>
<row> <row>
<entry><constant>V4L2_CAP_VIDEO_OVERLAY</constant></entry> <entry><constant>V4L2_CAP_VIDEO_OVERLAY</constant></entry>
<entry>0x00000004</entry> <entry>0x00000004</entry>
......
...@@ -431,8 +431,7 @@ static int vidioc_querycap(struct file *file, void *priv, ...@@ -431,8 +431,7 @@ static int vidioc_querycap(struct file *file, void *priv,
strncpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver) - 1); strncpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver) - 1);
strncpy(cap->card, MEM2MEM_NAME, sizeof(cap->card) - 1); strncpy(cap->card, MEM2MEM_NAME, sizeof(cap->card) - 1);
strlcpy(cap->bus_info, MEM2MEM_NAME, sizeof(cap->bus_info)); strlcpy(cap->bus_info, MEM2MEM_NAME, sizeof(cap->bus_info));
cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT cap->capabilities = V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
| V4L2_CAP_STREAMING;
cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
return 0; return 0;
} }
......
...@@ -396,9 +396,13 @@ static int vidioc_querycap(struct file *file, void *priv, ...@@ -396,9 +396,13 @@ static int vidioc_querycap(struct file *file, void *priv,
{ {
strncpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver) - 1); strncpy(cap->driver, MEM2MEM_NAME, sizeof(cap->driver) - 1);
strncpy(cap->card, MEM2MEM_NAME, sizeof(cap->card) - 1); strncpy(cap->card, MEM2MEM_NAME, sizeof(cap->card) - 1);
cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT /*
| V4L2_CAP_STREAMING; * This is only a mem-to-mem video device. The capture and output
* device capability flags are left only for backward compatibility
* and are scheduled for removal.
*/
cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT |
V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
return 0; return 0;
} }
......
...@@ -259,7 +259,12 @@ static int fimc_m2m_querycap(struct file *file, void *fh, ...@@ -259,7 +259,12 @@ static int fimc_m2m_querycap(struct file *file, void *fh,
strncpy(cap->driver, fimc->pdev->name, sizeof(cap->driver) - 1); strncpy(cap->driver, fimc->pdev->name, sizeof(cap->driver) - 1);
strncpy(cap->card, fimc->pdev->name, sizeof(cap->card) - 1); strncpy(cap->card, fimc->pdev->name, sizeof(cap->card) - 1);
cap->bus_info[0] = 0; cap->bus_info[0] = 0;
cap->capabilities = V4L2_CAP_STREAMING | /*
* This is only a mem-to-mem video device. The capture and output
* device capability flags are left only for backward compatibility
* and are scheduled for removal.
*/
cap->capabilities = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M_MPLANE |
V4L2_CAP_VIDEO_CAPTURE_MPLANE | V4L2_CAP_VIDEO_OUTPUT_MPLANE; V4L2_CAP_VIDEO_CAPTURE_MPLANE | V4L2_CAP_VIDEO_OUTPUT_MPLANE;
return 0; return 0;
......
...@@ -290,8 +290,13 @@ static int vidioc_querycap(struct file *file, void *priv, ...@@ -290,8 +290,13 @@ static int vidioc_querycap(struct file *file, void *priv,
strncpy(cap->card, G2D_NAME, sizeof(cap->card) - 1); strncpy(cap->card, G2D_NAME, sizeof(cap->card) - 1);
cap->bus_info[0] = 0; cap->bus_info[0] = 0;
cap->version = KERNEL_VERSION(1, 0, 0); cap->version = KERNEL_VERSION(1, 0, 0);
cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT /*
| V4L2_CAP_STREAMING; * This is only a mem-to-mem video device. The capture and output
* device capability flags are left only for backward compatibility
* and are scheduled for removal.
*/
cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT |
V4L2_CAP_VIDEO_M2M | V4L2_CAP_STREAMING;
return 0; return 0;
} }
......
...@@ -489,9 +489,13 @@ static int s5p_jpeg_querycap(struct file *file, void *priv, ...@@ -489,9 +489,13 @@ static int s5p_jpeg_querycap(struct file *file, void *priv,
sizeof(cap->card)); sizeof(cap->card));
} }
cap->bus_info[0] = 0; cap->bus_info[0] = 0;
cap->capabilities = V4L2_CAP_STREAMING | /*
V4L2_CAP_VIDEO_CAPTURE | * This is only a mem-to-mem video device. The capture and output
V4L2_CAP_VIDEO_OUTPUT; * device capability flags are left only for backward compatibility
* and are scheduled for removal.
*/
cap->capabilities = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M |
V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT;
return 0; return 0;
} }
......
...@@ -220,8 +220,14 @@ static int vidioc_querycap(struct file *file, void *priv, ...@@ -220,8 +220,14 @@ static int vidioc_querycap(struct file *file, void *priv,
strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1); strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
cap->bus_info[0] = 0; cap->bus_info[0] = 0;
cap->version = KERNEL_VERSION(1, 0, 0); cap->version = KERNEL_VERSION(1, 0, 0);
cap->capabilities = V4L2_CAP_VIDEO_CAPTURE_MPLANE | /*
V4L2_CAP_VIDEO_OUTPUT_MPLANE | V4L2_CAP_STREAMING; * This is only a mem-to-mem video device. The capture and output
* device capability flags are left only for backward compatibility
* and are scheduled for removal.
*/
cap->capabilities = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING |
V4L2_CAP_VIDEO_CAPTURE_MPLANE |
V4L2_CAP_VIDEO_OUTPUT_MPLANE;
return 0; return 0;
} }
......
...@@ -779,9 +779,14 @@ static int vidioc_querycap(struct file *file, void *priv, ...@@ -779,9 +779,14 @@ static int vidioc_querycap(struct file *file, void *priv,
strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1); strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
cap->bus_info[0] = 0; cap->bus_info[0] = 0;
cap->version = KERNEL_VERSION(1, 0, 0); cap->version = KERNEL_VERSION(1, 0, 0);
cap->capabilities = V4L2_CAP_VIDEO_CAPTURE_MPLANE /*
| V4L2_CAP_VIDEO_OUTPUT_MPLANE * This is only a mem-to-mem video device. The capture and output
| V4L2_CAP_STREAMING; * device capability flags are left only for backward compatibility
* and are scheduled for removal.
*/
cap->capabilities = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING |
V4L2_CAP_VIDEO_CAPTURE_MPLANE |
V4L2_CAP_VIDEO_OUTPUT_MPLANE;
return 0; return 0;
} }
......
...@@ -274,6 +274,10 @@ struct v4l2_capability { ...@@ -274,6 +274,10 @@ struct v4l2_capability {
#define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000 #define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000
/* Is a video output device that supports multiplanar formats */ /* Is a video output device that supports multiplanar formats */
#define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000 #define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000
/* Is a video mem-to-mem device that supports multiplanar formats */
#define V4L2_CAP_VIDEO_M2M_MPLANE 0x00004000
/* Is a video mem-to-mem device */
#define V4L2_CAP_VIDEO_M2M 0x00008000
#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment