* [REVIEW PATCH v2 0/5] Add V4L2_SEL_TGT_NATIVE_SIZE target
@ 2014-11-18 5:40 Sakari Ailus
2014-11-18 5:40 ` [REVIEW PATCH v2 1/5] v4l: Clean up sub-device format documentation Sakari Ailus
` (5 more replies)
0 siblings, 6 replies; 13+ messages in thread
From: Sakari Ailus @ 2014-11-18 5:40 UTC (permalink / raw)
To: linux-media; +Cc: hans.verkuil
Hi all,
This small set cleans up sub-device format documentation --- the
documentation noted the source format is used to configure scaling, which
was contradicting what was said right after on the selections on
sub-devices. This part was written before the selections interface.
The two latter patches create a V4L2_SEL_TGT_NATIVE_SIZE target which is
used in the smiapp driver. The CROP_BOUNDS target is still supported as
compatibility means.
since v2:
- Document that left and top are zero for the native size target.
- Add a patch to zero left and top in the smiapp driver.
- Add a patch to document native size setting input and output capability
flags.
--
Kind regards,
Sakari
^ permalink raw reply [flat|nested] 13+ messages in thread
* [REVIEW PATCH v2 1/5] v4l: Clean up sub-device format documentation
2014-11-18 5:40 [REVIEW PATCH v2 0/5] Add V4L2_SEL_TGT_NATIVE_SIZE target Sakari Ailus
@ 2014-11-18 5:40 ` Sakari Ailus
2014-11-28 23:42 ` [PATCH v2.1 " Sakari Ailus
2014-11-18 5:40 ` [REVIEW PATCH v2 2/5] v4l: Add V4L2_SEL_TGT_NATIVE_SIZE selection target Sakari Ailus
` (4 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Sakari Ailus @ 2014-11-18 5:40 UTC (permalink / raw)
To: linux-media; +Cc: hans.verkuil
The sub-device format documentation documented scaling configuration through
formats. Instead the compose selection rectangle is elsewhere documented to
be used for the purpose. Remove scaling related part of the documentation.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
---
Documentation/DocBook/media/v4l/dev-subdev.xml | 108 ++++++++++++++----------
1 file changed, 62 insertions(+), 46 deletions(-)
diff --git a/Documentation/DocBook/media/v4l/dev-subdev.xml b/Documentation/DocBook/media/v4l/dev-subdev.xml
index d15aaf8..c129196 100644
--- a/Documentation/DocBook/media/v4l/dev-subdev.xml
+++ b/Documentation/DocBook/media/v4l/dev-subdev.xml
@@ -195,53 +195,59 @@
<title>Sample Pipeline Configuration</title>
<tgroup cols="3">
<colspec colname="what"/>
- <colspec colname="sensor-0" />
- <colspec colname="frontend-0" />
- <colspec colname="frontend-1" />
- <colspec colname="scaler-0" />
- <colspec colname="scaler-1" />
+ <colspec colname="sensor-0 format" />
+ <colspec colname="frontend-0 format" />
+ <colspec colname="frontend-1 format" />
+ <colspec colname="scaler-0 format" />
+ <colspec colname="scaler-0 compose" />
+ <colspec colname="scaler-1 format" />
<thead>
<row>
<entry></entry>
- <entry>Sensor/0</entry>
- <entry>Frontend/0</entry>
- <entry>Frontend/1</entry>
- <entry>Scaler/0</entry>
- <entry>Scaler/1</entry>
+ <entry>Sensor/0 format</entry>
+ <entry>Frontend/0 format</entry>
+ <entry>Frontend/1 format</entry>
+ <entry>Scaler/0 format</entry>
+ <entry>Scaler/0 compose selection rectangle</entry>
+ <entry>Scaler/1 format</entry>
</row>
</thead>
<tbody valign="top">
<row>
<entry>Initial state</entry>
- <entry>2048x1536</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ <entry>2048x1536/SGRBG8_1X8</entry>
+ <entry>(default)</entry>
+ <entry>(default)</entry>
+ <entry>(default)</entry>
+ <entry>(default)</entry>
+ <entry>(default)</entry>
</row>
<row>
- <entry>Configure frontend input</entry>
- <entry>2048x1536</entry>
- <entry><emphasis>2048x1536</emphasis></entry>
- <entry><emphasis>2046x1534</emphasis></entry>
- <entry>-</entry>
- <entry>-</entry>
+ <entry>Configure frontend sink format</entry>
+ <entry>2048x1536/SGRBG8_1X8</entry>
+ <entry><emphasis>2048x1536/SGRBG8_1X8</emphasis></entry>
+ <entry><emphasis>2046x1534/SGRBG8_1X8</emphasis></entry>
+ <entry>(default)</entry>
+ <entry>(default)</entry>
+ <entry>(default)</entry>
</row>
<row>
- <entry>Configure scaler input</entry>
- <entry>2048x1536</entry>
- <entry>2048x1536</entry>
- <entry>2046x1534</entry>
- <entry><emphasis>2046x1534</emphasis></entry>
- <entry><emphasis>2046x1534</emphasis></entry>
+ <entry>Configure scaler sink format</entry>
+ <entry>2048x1536/SGRBG8_1X8</entry>
+ <entry>2048x1536/SGRBG8_1X8</entry>
+ <entry>2046x1534/SGRBG8_1X8</entry>
+ <entry><emphasis>2046x1534/SGRBG8_1X8</emphasis></entry>
+ <entry><emphasis>0,0/2046x1534</emphasis></entry>
+ <entry><emphasis>2046x1534/SGRBG8_1X8</emphasis></entry>
</row>
<row>
- <entry>Configure scaler output</entry>
- <entry>2048x1536</entry>
- <entry>2048x1536</entry>
- <entry>2046x1534</entry>
- <entry>2046x1534</entry>
- <entry><emphasis>1280x960</emphasis></entry>
+ <entry>Configure scaler sink compose selection</entry>
+ <entry>2048x1536/SGRBG8_1X8</entry>
+ <entry>2048x1536/SGRBG8_1X8</entry>
+ <entry>2046x1534/SGRBG8_1X8</entry>
+ <entry>2046x1534/SGRBG8_1X8</entry>
+ <entry><emphasis>0,0/1280x960</emphasis></entry>
+ <entry><emphasis>1280x960/SGRBG8_1X8</emphasis></entry>
</row>
</tbody>
</tgroup>
@@ -249,19 +255,29 @@
<para>
<orderedlist>
- <listitem><para>Initial state. The sensor output is set to its native 3MP
- resolution. Resolutions on the host frontend and scaler input and output
- pads are undefined.</para></listitem>
- <listitem><para>The application configures the frontend input pad resolution to
- 2048x1536. The driver propagates the format to the frontend output pad.
- Note that the propagated output format can be different, as in this case,
- than the input format, as the hardware might need to crop pixels (for
- instance when converting a Bayer filter pattern to RGB or YUV).</para></listitem>
- <listitem><para>The application configures the scaler input pad resolution to
- 2046x1534 to match the frontend output resolution. The driver propagates
- the format to the scaler output pad.</para></listitem>
- <listitem><para>The application configures the scaler output pad resolution to
- 1280x960.</para></listitem>
+ <listitem><para>Initial state. The sensor source pad format is
+ set to its native 3MP size and V4L2_MBUS_FMT_SGRBG8_1X8
+ media bus code. Formats on the host frontend and scaler sink
+ and source pads have the default values, as well as the
+ compose rectangle on the scaler's sink pad.</para></listitem>
+
+ <listitem><para>The application configures the frontend sink
+ pad format's size to 2048x1536 and its media bus code to
+ V4L2_MBUS_FMT_SGRBG_1X8. The driver propagates the format to
+ the frontend source pad.</para></listitem>
+
+ <listitem><para>The application configures the scaler sink pad
+ format's size to 2046x1534 and the media bus code to
+ V4L2_MBUS_FMT_SGRBG_1X8 to match the frontend source size and
+ media bus code. The media bus code on the sink pad is set to
+ V4L2_MBUS_FMT_SGRBG_1X8. The driver propagates the size to the
+ compose selection rectangle on the scaler's sink pad, and the
+ format to the scaler source pad.</para></listitem>
+
+ <listitem><para>The application configures the compose
+ selection rectangle of the scaler's sink pad and scaler source
+ pad format's size to 1280x960.</para></listitem>
+
</orderedlist>
</para>
--
1.7.10.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [REVIEW PATCH v2 2/5] v4l: Add V4L2_SEL_TGT_NATIVE_SIZE selection target
2014-11-18 5:40 [REVIEW PATCH v2 0/5] Add V4L2_SEL_TGT_NATIVE_SIZE target Sakari Ailus
2014-11-18 5:40 ` [REVIEW PATCH v2 1/5] v4l: Clean up sub-device format documentation Sakari Ailus
@ 2014-11-18 5:40 ` Sakari Ailus
2014-11-18 21:08 ` [REVIEW PATCH v2.1 " Sakari Ailus
2014-11-18 5:40 ` [REVIEW PATCH v2 3/5] v4l: Add intput and output capability flags for native size setting Sakari Ailus
` (3 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Sakari Ailus @ 2014-11-18 5:40 UTC (permalink / raw)
To: linux-media; +Cc: hans.verkuil
The V4L2_SEL_TGT_NATIVE_SIZE target is used to denote e.g. the size of a
sensor's pixel array.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
---
Documentation/DocBook/media/v4l/selections-common.xml | 10 ++++++++++
include/uapi/linux/v4l2-common.h | 2 ++
2 files changed, 12 insertions(+)
diff --git a/Documentation/DocBook/media/v4l/selections-common.xml b/Documentation/DocBook/media/v4l/selections-common.xml
index 7502f78..99c984c 100644
--- a/Documentation/DocBook/media/v4l/selections-common.xml
+++ b/Documentation/DocBook/media/v4l/selections-common.xml
@@ -63,6 +63,16 @@
<entry>Yes</entry>
</row>
<row>
+ <entry><constant>V4L2_SEL_TGT_NATIVE_SIZE</constant></entry>
+ <entry>0x0003</entry>
+ <entry>The native size of the device, e.g. a sensor's
+ pixel array. <structfield>top</structfield> and
+ <structfield>left</structfield> fields are zero for this target.
+ </entry>
+ <entry>Yes</entry>
+ <entry>Yes</entry>
+ </row>
+ <row>
<entry><constant>V4L2_SEL_TGT_COMPOSE</constant></entry>
<entry>0x0100</entry>
<entry>Compose rectangle. Used to configure scaling
diff --git a/include/uapi/linux/v4l2-common.h b/include/uapi/linux/v4l2-common.h
index 2f6f8ca..1527398 100644
--- a/include/uapi/linux/v4l2-common.h
+++ b/include/uapi/linux/v4l2-common.h
@@ -43,6 +43,8 @@
#define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
/* Cropping bounds */
#define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
+/* Native frame size */
+#define V4L2_SEL_TGT_NATIVE_SIZE 0x0003
/* Current composing area */
#define V4L2_SEL_TGT_COMPOSE 0x0100
/* Default composing area */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [REVIEW PATCH v2 3/5] v4l: Add intput and output capability flags for native size setting
2014-11-18 5:40 [REVIEW PATCH v2 0/5] Add V4L2_SEL_TGT_NATIVE_SIZE target Sakari Ailus
2014-11-18 5:40 ` [REVIEW PATCH v2 1/5] v4l: Clean up sub-device format documentation Sakari Ailus
2014-11-18 5:40 ` [REVIEW PATCH v2 2/5] v4l: Add V4L2_SEL_TGT_NATIVE_SIZE selection target Sakari Ailus
@ 2014-11-18 5:40 ` Sakari Ailus
2014-11-18 8:56 ` Hans Verkuil
2014-11-18 5:40 ` [REVIEW PATCH v2 4/5] smiapp: Set left and top to zero for crop bounds selection Sakari Ailus
` (2 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Sakari Ailus @ 2014-11-18 5:40 UTC (permalink / raw)
To: linux-media; +Cc: hans.verkuil
Add input and output capability flags for setting native size of the device,
and document them.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
---
Documentation/DocBook/media/v4l/vidioc-enuminput.xml | 8 ++++++++
Documentation/DocBook/media/v4l/vidioc-enumoutput.xml | 8 ++++++++
include/uapi/linux/videodev2.h | 2 ++
3 files changed, 18 insertions(+)
diff --git a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml
index 493a39a..603fece 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml
@@ -287,6 +287,14 @@ input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
<entry>0x00000004</entry>
<entry>This input supports setting the TV standard by using VIDIOC_S_STD.</entry>
</row>
+ <row>
+ <entry><constant>V4L2_IN_CAP_NATIVE_SIZE</constant></entry>
+ <entry>0x00000008</entry>
+ <entry>This input supports setting the native size using
+ the <constant>V4L2_SEL_TGT_NATIVE_SIZE</constant>
+ selection target, see <xref
+ linkend="v4l2-selections-common"/>.</entry>
+ </row>
</tbody>
</tgroup>
</table>
diff --git a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml
index 2654e09..773fb12 100644
--- a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml
@@ -172,6 +172,14 @@ input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
<entry>0x00000004</entry>
<entry>This output supports setting the TV standard by using VIDIOC_S_STD.</entry>
</row>
+ <row>
+ <entry><constant>V4L2_OUT_CAP_NATIVE_SIZE</constant></entry>
+ <entry>0x00000008</entry>
+ <entry>This output supports setting the native size using
+ the <constant>V4L2_SEL_TGT_NATIVE_SIZE</constant>
+ selection target, see <xref
+ linkend="v4l2-selections-common"/>.</entry>
+ </row>
</tbody>
</tgroup>
</table>
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 1c2f84f..e445b48 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -1249,6 +1249,7 @@ struct v4l2_input {
#define V4L2_IN_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
#define V4L2_IN_CAP_CUSTOM_TIMINGS V4L2_IN_CAP_DV_TIMINGS /* For compatibility */
#define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */
+#define V4L2_IN_CAP_NATIVE_SIZE 0x00000008 /* Supports setting native size */
/*
* V I D E O O U T P U T S
@@ -1272,6 +1273,7 @@ struct v4l2_output {
#define V4L2_OUT_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
#define V4L2_OUT_CAP_CUSTOM_TIMINGS V4L2_OUT_CAP_DV_TIMINGS /* For compatibility */
#define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */
+#define V4L2_OUT_CAP_NATIVE_SIZE 0x00000008 /* Supports setting native size */
/*
* C O N T R O L S
--
1.7.10.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [REVIEW PATCH v2 4/5] smiapp: Set left and top to zero for crop bounds selection
2014-11-18 5:40 [REVIEW PATCH v2 0/5] Add V4L2_SEL_TGT_NATIVE_SIZE target Sakari Ailus
` (2 preceding siblings ...)
2014-11-18 5:40 ` [REVIEW PATCH v2 3/5] v4l: Add intput and output capability flags for native size setting Sakari Ailus
@ 2014-11-18 5:40 ` Sakari Ailus
2014-11-18 5:40 ` [REVIEW PATCH v2 5/5] smiapp: Support V4L2_SEL_TGT_NATIVE_SIZE Sakari Ailus
2014-11-18 5:45 ` [REVIEW PATCH v2 0/5] Add V4L2_SEL_TGT_NATIVE_SIZE target Sakari Ailus
5 siblings, 0 replies; 13+ messages in thread
From: Sakari Ailus @ 2014-11-18 5:40 UTC (permalink / raw)
To: linux-media; +Cc: hans.verkuil
The fields were previously uninitialised, leaving the returned values to
where the user had set them. This was never the intention.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
---
drivers/media/i2c/smiapp/smiapp-core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 193af1c..022ad44 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2191,6 +2191,7 @@ static int __smiapp_get_selection(struct v4l2_subdev *subdev,
switch (sel->target) {
case V4L2_SEL_TGT_CROP_BOUNDS:
if (ssd == sensor->pixel_array) {
+ sel->r.left = sel->r.top = 0;
sel->r.width =
sensor->limits[SMIAPP_LIMIT_X_ADDR_MAX] + 1;
sel->r.height =
--
1.7.10.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [REVIEW PATCH v2 5/5] smiapp: Support V4L2_SEL_TGT_NATIVE_SIZE
2014-11-18 5:40 [REVIEW PATCH v2 0/5] Add V4L2_SEL_TGT_NATIVE_SIZE target Sakari Ailus
` (3 preceding siblings ...)
2014-11-18 5:40 ` [REVIEW PATCH v2 4/5] smiapp: Set left and top to zero for crop bounds selection Sakari Ailus
@ 2014-11-18 5:40 ` Sakari Ailus
2014-11-18 5:45 ` [REVIEW PATCH v2 0/5] Add V4L2_SEL_TGT_NATIVE_SIZE target Sakari Ailus
5 siblings, 0 replies; 13+ messages in thread
From: Sakari Ailus @ 2014-11-18 5:40 UTC (permalink / raw)
To: linux-media; +Cc: hans.verkuil
Add support for selection target V4L2_SEL_TGT_NATIVE_SIZE. It is equivalent
of what V4L2_SEL_TGT_CROP_BOUNDS used to be. Support for
V4L2_SEL_TGT_CROP_BOUNDS is still supported by the driver as a compatibility
interface.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
---
drivers/media/i2c/smiapp/smiapp-core.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 022ad44..65e4e05 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2092,6 +2092,11 @@ static int __smiapp_sel_supported(struct v4l2_subdev *subdev,
== SMIAPP_DIGITAL_CROP_CAPABILITY_INPUT_CROP)
return 0;
return -EINVAL;
+ case V4L2_SEL_TGT_NATIVE_SIZE:
+ if (ssd == sensor->pixel_array
+ && sel->pad == SMIAPP_PA_PAD_SRC)
+ return 0;
+ return -EINVAL;
case V4L2_SEL_TGT_COMPOSE:
case V4L2_SEL_TGT_COMPOSE_BOUNDS:
if (sel->pad == ssd->source_pad)
@@ -2190,6 +2195,7 @@ static int __smiapp_get_selection(struct v4l2_subdev *subdev,
switch (sel->target) {
case V4L2_SEL_TGT_CROP_BOUNDS:
+ case V4L2_SEL_TGT_NATIVE_SIZE:
if (ssd == sensor->pixel_array) {
sel->r.left = sel->r.top = 0;
sel->r.width =
--
1.7.10.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [REVIEW PATCH v2 0/5] Add V4L2_SEL_TGT_NATIVE_SIZE target
2014-11-18 5:40 [REVIEW PATCH v2 0/5] Add V4L2_SEL_TGT_NATIVE_SIZE target Sakari Ailus
` (4 preceding siblings ...)
2014-11-18 5:40 ` [REVIEW PATCH v2 5/5] smiapp: Support V4L2_SEL_TGT_NATIVE_SIZE Sakari Ailus
@ 2014-11-18 5:45 ` Sakari Ailus
5 siblings, 0 replies; 13+ messages in thread
From: Sakari Ailus @ 2014-11-18 5:45 UTC (permalink / raw)
To: linux-media; +Cc: hans.verkuil
On Tue, Nov 18, 2014 at 07:40:15AM +0200, Sakari Ailus wrote:
> since v2:
This obviously should have been v1.
Also a spelling fix in documentation has been included, as Hans suggested.
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [REVIEW PATCH v2 3/5] v4l: Add intput and output capability flags for native size setting
2014-11-18 5:40 ` [REVIEW PATCH v2 3/5] v4l: Add intput and output capability flags for native size setting Sakari Ailus
@ 2014-11-18 8:56 ` Hans Verkuil
2014-11-18 20:59 ` Sakari Ailus
0 siblings, 1 reply; 13+ messages in thread
From: Hans Verkuil @ 2014-11-18 8:56 UTC (permalink / raw)
To: Sakari Ailus, linux-media; +Cc: hans.verkuil
Hi Sakari,
A few notes:
Typo in subject: intput -> input
On 11/18/14 06:40, Sakari Ailus wrote:
> Add input and output capability flags for setting native size of the device,
> and document them.
>
> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
> ---
> Documentation/DocBook/media/v4l/vidioc-enuminput.xml | 8 ++++++++
> Documentation/DocBook/media/v4l/vidioc-enumoutput.xml | 8 ++++++++
> include/uapi/linux/videodev2.h | 2 ++
> 3 files changed, 18 insertions(+)
>
> diff --git a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml
> index 493a39a..603fece 100644
> --- a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml
> +++ b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml
> @@ -287,6 +287,14 @@ input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
> <entry>0x00000004</entry>
> <entry>This input supports setting the TV standard by using VIDIOC_S_STD.</entry>
> </row>
> + <row>
> + <entry><constant>V4L2_IN_CAP_NATIVE_SIZE</constant></entry>
> + <entry>0x00000008</entry>
> + <entry>This input supports setting the native size using
> + the <constant>V4L2_SEL_TGT_NATIVE_SIZE</constant>
> + selection target, see <xref
> + linkend="v4l2-selections-common"/>.</entry>
> + </row>
I would expand on this a little bit (or alternatively add that to the
V4L2_SEL_TGT_NATIVE_SIZE documentation itself, at your discretion):
"Setting the native size will generally only make sense for memory
to memory devices where the software can create a canvas of a given
size in which for example a video frame can be composed. In that case
V4L2_SEL_TGT_NATIVE_SIZE can be used to configure the size of that
canvas."
Or words to that effect.
Regards,
Hans
> </tbody>
> </tgroup>
> </table>
> diff --git a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml
> index 2654e09..773fb12 100644
> --- a/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml
> +++ b/Documentation/DocBook/media/v4l/vidioc-enumoutput.xml
> @@ -172,6 +172,14 @@ input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
> <entry>0x00000004</entry>
> <entry>This output supports setting the TV standard by using VIDIOC_S_STD.</entry>
> </row>
> + <row>
> + <entry><constant>V4L2_OUT_CAP_NATIVE_SIZE</constant></entry>
> + <entry>0x00000008</entry>
> + <entry>This output supports setting the native size using
> + the <constant>V4L2_SEL_TGT_NATIVE_SIZE</constant>
> + selection target, see <xref
> + linkend="v4l2-selections-common"/>.</entry>
> + </row>
> </tbody>
> </tgroup>
> </table>
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 1c2f84f..e445b48 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -1249,6 +1249,7 @@ struct v4l2_input {
> #define V4L2_IN_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
> #define V4L2_IN_CAP_CUSTOM_TIMINGS V4L2_IN_CAP_DV_TIMINGS /* For compatibility */
> #define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */
> +#define V4L2_IN_CAP_NATIVE_SIZE 0x00000008 /* Supports setting native size */
>
> /*
> * V I D E O O U T P U T S
> @@ -1272,6 +1273,7 @@ struct v4l2_output {
> #define V4L2_OUT_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
> #define V4L2_OUT_CAP_CUSTOM_TIMINGS V4L2_OUT_CAP_DV_TIMINGS /* For compatibility */
> #define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */
> +#define V4L2_OUT_CAP_NATIVE_SIZE 0x00000008 /* Supports setting native size */
>
> /*
> * C O N T R O L S
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [REVIEW PATCH v2 3/5] v4l: Add intput and output capability flags for native size setting
2014-11-18 8:56 ` Hans Verkuil
@ 2014-11-18 20:59 ` Sakari Ailus
0 siblings, 0 replies; 13+ messages in thread
From: Sakari Ailus @ 2014-11-18 20:59 UTC (permalink / raw)
To: Hans Verkuil; +Cc: linux-media, hans.verkuil
Hi Hans,
On Tue, Nov 18, 2014 at 09:56:00AM +0100, Hans Verkuil wrote:
> Hi Sakari,
>
> A few notes:
>
> Typo in subject: intput -> input
Will fix.
> On 11/18/14 06:40, Sakari Ailus wrote:
> > Add input and output capability flags for setting native size of the device,
> > and document them.
> >
> > Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
> > ---
> > Documentation/DocBook/media/v4l/vidioc-enuminput.xml | 8 ++++++++
> > Documentation/DocBook/media/v4l/vidioc-enumoutput.xml | 8 ++++++++
> > include/uapi/linux/videodev2.h | 2 ++
> > 3 files changed, 18 insertions(+)
> >
> > diff --git a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml
> > index 493a39a..603fece 100644
> > --- a/Documentation/DocBook/media/v4l/vidioc-enuminput.xml
> > +++ b/Documentation/DocBook/media/v4l/vidioc-enuminput.xml
> > @@ -287,6 +287,14 @@ input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
> > <entry>0x00000004</entry>
> > <entry>This input supports setting the TV standard by using VIDIOC_S_STD.</entry>
> > </row>
> > + <row>
> > + <entry><constant>V4L2_IN_CAP_NATIVE_SIZE</constant></entry>
> > + <entry>0x00000008</entry>
> > + <entry>This input supports setting the native size using
> > + the <constant>V4L2_SEL_TGT_NATIVE_SIZE</constant>
> > + selection target, see <xref
> > + linkend="v4l2-selections-common"/>.</entry>
> > + </row>
>
> I would expand on this a little bit (or alternatively add that to the
> V4L2_SEL_TGT_NATIVE_SIZE documentation itself, at your discretion):
I think I'd prefer having this in the selection target documentation, as
that's something which involves this flag, not so much the capability flags.
>
> "Setting the native size will generally only make sense for memory
> to memory devices where the software can create a canvas of a given
> size in which for example a video frame can be composed. In that case
> V4L2_SEL_TGT_NATIVE_SIZE can be used to configure the size of that
> canvas."
I'll use the text as-is.
--
Kind regards,
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 13+ messages in thread
* [REVIEW PATCH v2.1 2/5] v4l: Add V4L2_SEL_TGT_NATIVE_SIZE selection target
2014-11-18 5:40 ` [REVIEW PATCH v2 2/5] v4l: Add V4L2_SEL_TGT_NATIVE_SIZE selection target Sakari Ailus
@ 2014-11-18 21:08 ` Sakari Ailus
2014-11-24 10:49 ` Hans Verkuil
0 siblings, 1 reply; 13+ messages in thread
From: Sakari Ailus @ 2014-11-18 21:08 UTC (permalink / raw)
To: linux-media; +Cc: hans.verkuil
The V4L2_SEL_TGT_NATIVE_SIZE target is used to denote e.g. the size of a
sensor's pixel array.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
---
since v2:
- Add a note on s_selection support for native selection target on mem2mem
devices only.
- Reverse the order or left and top fields, i.e. make it the same as in
struct v4l2_rect.
Documentation/DocBook/media/v4l/selections-common.xml | 16 ++++++++++++++++
include/uapi/linux/v4l2-common.h | 2 ++
2 files changed, 18 insertions(+)
diff --git a/Documentation/DocBook/media/v4l/selections-common.xml b/Documentation/DocBook/media/v4l/selections-common.xml
index 7502f78..d6d56fb 100644
--- a/Documentation/DocBook/media/v4l/selections-common.xml
+++ b/Documentation/DocBook/media/v4l/selections-common.xml
@@ -63,6 +63,22 @@
<entry>Yes</entry>
</row>
<row>
+ <entry><constant>V4L2_SEL_TGT_NATIVE_SIZE</constant></entry>
+ <entry>0x0003</entry>
+ <entry>The native size of the device, e.g. a sensor's
+ pixel array. <structfield>left</structfield> and
+ <structfield>top</structfield> fields are zero for this
+ target. Setting the native size will generally only make
+ sense for memory to memory devices where the software can
+ create a canvas of a given size in which for example a
+ video frame can be composed. In that case
+ V4L2_SEL_TGT_NATIVE_SIZE can be used to configure the size
+ of that canvas.
+ </entry>
+ <entry>Yes</entry>
+ <entry>Yes</entry>
+ </row>
+ <row>
<entry><constant>V4L2_SEL_TGT_COMPOSE</constant></entry>
<entry>0x0100</entry>
<entry>Compose rectangle. Used to configure scaling
diff --git a/include/uapi/linux/v4l2-common.h b/include/uapi/linux/v4l2-common.h
index 2f6f8ca..1527398 100644
--- a/include/uapi/linux/v4l2-common.h
+++ b/include/uapi/linux/v4l2-common.h
@@ -43,6 +43,8 @@
#define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
/* Cropping bounds */
#define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
+/* Native frame size */
+#define V4L2_SEL_TGT_NATIVE_SIZE 0x0003
/* Current composing area */
#define V4L2_SEL_TGT_COMPOSE 0x0100
/* Default composing area */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [REVIEW PATCH v2.1 2/5] v4l: Add V4L2_SEL_TGT_NATIVE_SIZE selection target
2014-11-18 21:08 ` [REVIEW PATCH v2.1 " Sakari Ailus
@ 2014-11-24 10:49 ` Hans Verkuil
2014-11-24 21:36 ` Sakari Ailus
0 siblings, 1 reply; 13+ messages in thread
From: Hans Verkuil @ 2014-11-24 10:49 UTC (permalink / raw)
To: Sakari Ailus, linux-media; +Cc: hans.verkuil
On 11/18/14 22:08, Sakari Ailus wrote:
> The V4L2_SEL_TGT_NATIVE_SIZE target is used to denote e.g. the size of a
> sensor's pixel array.
>
> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
For the whole patch series:
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Thanks!
Once this is mainlined, can you update v4l2-ctl so it supports this
new target?
Regards,
Hans
> ---
> since v2:
> - Add a note on s_selection support for native selection target on mem2mem
> devices only.
> - Reverse the order or left and top fields, i.e. make it the same as in
> struct v4l2_rect.
>
> Documentation/DocBook/media/v4l/selections-common.xml | 16 ++++++++++++++++
> include/uapi/linux/v4l2-common.h | 2 ++
> 2 files changed, 18 insertions(+)
>
> diff --git a/Documentation/DocBook/media/v4l/selections-common.xml b/Documentation/DocBook/media/v4l/selections-common.xml
> index 7502f78..d6d56fb 100644
> --- a/Documentation/DocBook/media/v4l/selections-common.xml
> +++ b/Documentation/DocBook/media/v4l/selections-common.xml
> @@ -63,6 +63,22 @@
> <entry>Yes</entry>
> </row>
> <row>
> + <entry><constant>V4L2_SEL_TGT_NATIVE_SIZE</constant></entry>
> + <entry>0x0003</entry>
> + <entry>The native size of the device, e.g. a sensor's
> + pixel array. <structfield>left</structfield> and
> + <structfield>top</structfield> fields are zero for this
> + target. Setting the native size will generally only make
> + sense for memory to memory devices where the software can
> + create a canvas of a given size in which for example a
> + video frame can be composed. In that case
> + V4L2_SEL_TGT_NATIVE_SIZE can be used to configure the size
> + of that canvas.
> + </entry>
> + <entry>Yes</entry>
> + <entry>Yes</entry>
> + </row>
> + <row>
> <entry><constant>V4L2_SEL_TGT_COMPOSE</constant></entry>
> <entry>0x0100</entry>
> <entry>Compose rectangle. Used to configure scaling
> diff --git a/include/uapi/linux/v4l2-common.h b/include/uapi/linux/v4l2-common.h
> index 2f6f8ca..1527398 100644
> --- a/include/uapi/linux/v4l2-common.h
> +++ b/include/uapi/linux/v4l2-common.h
> @@ -43,6 +43,8 @@
> #define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
> /* Cropping bounds */
> #define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
> +/* Native frame size */
> +#define V4L2_SEL_TGT_NATIVE_SIZE 0x0003
> /* Current composing area */
> #define V4L2_SEL_TGT_COMPOSE 0x0100
> /* Default composing area */
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [REVIEW PATCH v2.1 2/5] v4l: Add V4L2_SEL_TGT_NATIVE_SIZE selection target
2014-11-24 10:49 ` Hans Verkuil
@ 2014-11-24 21:36 ` Sakari Ailus
0 siblings, 0 replies; 13+ messages in thread
From: Sakari Ailus @ 2014-11-24 21:36 UTC (permalink / raw)
To: Hans Verkuil; +Cc: linux-media, hans.verkuil
Hi Hans,
On Mon, Nov 24, 2014 at 11:49:01AM +0100, Hans Verkuil wrote:
> On 11/18/14 22:08, Sakari Ailus wrote:
> > The V4L2_SEL_TGT_NATIVE_SIZE target is used to denote e.g. the size of a
> > sensor's pixel array.
> >
> > Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
>
> For the whole patch series:
>
> Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
>
> Thanks!
>
> Once this is mainlined, can you update v4l2-ctl so it supports this
> new target?
Sure! I'll do the same to media-ctl.
--
Cheers,
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2.1 1/5] v4l: Clean up sub-device format documentation
2014-11-18 5:40 ` [REVIEW PATCH v2 1/5] v4l: Clean up sub-device format documentation Sakari Ailus
@ 2014-11-28 23:42 ` Sakari Ailus
0 siblings, 0 replies; 13+ messages in thread
From: Sakari Ailus @ 2014-11-28 23:42 UTC (permalink / raw)
To: linux-media; +Cc: hverkuil, laurent.pinchart, Sakari Ailus
The sub-device format documentation documented scaling configuration through
formats. Instead the compose selection rectangle is elsewhere documented to
be used for the purpose. Remove scaling related part of the documentation.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
---
since v2:
- Fix the last documentation paragraph to tell the driver propagates the
size to source pad format, instead of the application having to set it.
Documentation/DocBook/media/v4l/dev-subdev.xml | 109 ++++++++++++++----------
1 file changed, 63 insertions(+), 46 deletions(-)
diff --git a/Documentation/DocBook/media/v4l/dev-subdev.xml b/Documentation/DocBook/media/v4l/dev-subdev.xml
index d15aaf8..4f0ba58 100644
--- a/Documentation/DocBook/media/v4l/dev-subdev.xml
+++ b/Documentation/DocBook/media/v4l/dev-subdev.xml
@@ -195,53 +195,59 @@
<title>Sample Pipeline Configuration</title>
<tgroup cols="3">
<colspec colname="what"/>
- <colspec colname="sensor-0" />
- <colspec colname="frontend-0" />
- <colspec colname="frontend-1" />
- <colspec colname="scaler-0" />
- <colspec colname="scaler-1" />
+ <colspec colname="sensor-0 format" />
+ <colspec colname="frontend-0 format" />
+ <colspec colname="frontend-1 format" />
+ <colspec colname="scaler-0 format" />
+ <colspec colname="scaler-0 compose" />
+ <colspec colname="scaler-1 format" />
<thead>
<row>
<entry></entry>
- <entry>Sensor/0</entry>
- <entry>Frontend/0</entry>
- <entry>Frontend/1</entry>
- <entry>Scaler/0</entry>
- <entry>Scaler/1</entry>
+ <entry>Sensor/0 format</entry>
+ <entry>Frontend/0 format</entry>
+ <entry>Frontend/1 format</entry>
+ <entry>Scaler/0 format</entry>
+ <entry>Scaler/0 compose selection rectangle</entry>
+ <entry>Scaler/1 format</entry>
</row>
</thead>
<tbody valign="top">
<row>
<entry>Initial state</entry>
- <entry>2048x1536</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
- <entry>-</entry>
+ <entry>2048x1536/SGRBG8_1X8</entry>
+ <entry>(default)</entry>
+ <entry>(default)</entry>
+ <entry>(default)</entry>
+ <entry>(default)</entry>
+ <entry>(default)</entry>
</row>
<row>
- <entry>Configure frontend input</entry>
- <entry>2048x1536</entry>
- <entry><emphasis>2048x1536</emphasis></entry>
- <entry><emphasis>2046x1534</emphasis></entry>
- <entry>-</entry>
- <entry>-</entry>
+ <entry>Configure frontend sink format</entry>
+ <entry>2048x1536/SGRBG8_1X8</entry>
+ <entry><emphasis>2048x1536/SGRBG8_1X8</emphasis></entry>
+ <entry><emphasis>2046x1534/SGRBG8_1X8</emphasis></entry>
+ <entry>(default)</entry>
+ <entry>(default)</entry>
+ <entry>(default)</entry>
</row>
<row>
- <entry>Configure scaler input</entry>
- <entry>2048x1536</entry>
- <entry>2048x1536</entry>
- <entry>2046x1534</entry>
- <entry><emphasis>2046x1534</emphasis></entry>
- <entry><emphasis>2046x1534</emphasis></entry>
+ <entry>Configure scaler sink format</entry>
+ <entry>2048x1536/SGRBG8_1X8</entry>
+ <entry>2048x1536/SGRBG8_1X8</entry>
+ <entry>2046x1534/SGRBG8_1X8</entry>
+ <entry><emphasis>2046x1534/SGRBG8_1X8</emphasis></entry>
+ <entry><emphasis>0,0/2046x1534</emphasis></entry>
+ <entry><emphasis>2046x1534/SGRBG8_1X8</emphasis></entry>
</row>
<row>
- <entry>Configure scaler output</entry>
- <entry>2048x1536</entry>
- <entry>2048x1536</entry>
- <entry>2046x1534</entry>
- <entry>2046x1534</entry>
- <entry><emphasis>1280x960</emphasis></entry>
+ <entry>Configure scaler sink compose selection</entry>
+ <entry>2048x1536/SGRBG8_1X8</entry>
+ <entry>2048x1536/SGRBG8_1X8</entry>
+ <entry>2046x1534/SGRBG8_1X8</entry>
+ <entry>2046x1534/SGRBG8_1X8</entry>
+ <entry><emphasis>0,0/1280x960</emphasis></entry>
+ <entry><emphasis>1280x960/SGRBG8_1X8</emphasis></entry>
</row>
</tbody>
</tgroup>
@@ -249,19 +255,30 @@
<para>
<orderedlist>
- <listitem><para>Initial state. The sensor output is set to its native 3MP
- resolution. Resolutions on the host frontend and scaler input and output
- pads are undefined.</para></listitem>
- <listitem><para>The application configures the frontend input pad resolution to
- 2048x1536. The driver propagates the format to the frontend output pad.
- Note that the propagated output format can be different, as in this case,
- than the input format, as the hardware might need to crop pixels (for
- instance when converting a Bayer filter pattern to RGB or YUV).</para></listitem>
- <listitem><para>The application configures the scaler input pad resolution to
- 2046x1534 to match the frontend output resolution. The driver propagates
- the format to the scaler output pad.</para></listitem>
- <listitem><para>The application configures the scaler output pad resolution to
- 1280x960.</para></listitem>
+ <listitem><para>Initial state. The sensor source pad format is
+ set to its native 3MP size and V4L2_MBUS_FMT_SGRBG8_1X8
+ media bus code. Formats on the host frontend and scaler sink
+ and source pads have the default values, as well as the
+ compose rectangle on the scaler's sink pad.</para></listitem>
+
+ <listitem><para>The application configures the frontend sink
+ pad format's size to 2048x1536 and its media bus code to
+ V4L2_MBUS_FMT_SGRBG_1X8. The driver propagates the format to
+ the frontend source pad.</para></listitem>
+
+ <listitem><para>The application configures the scaler sink pad
+ format's size to 2046x1534 and the media bus code to
+ V4L2_MBUS_FMT_SGRBG_1X8 to match the frontend source size and
+ media bus code. The media bus code on the sink pad is set to
+ V4L2_MBUS_FMT_SGRBG_1X8. The driver propagates the size to the
+ compose selection rectangle on the scaler's sink pad, and the
+ format to the scaler source pad.</para></listitem>
+
+ <listitem><para>The application configures the size of the compose
+ selection rectangle of the scaler's sink pad 1280x960. The driver
+ propagates the size to the scaler's source pad
+ format.</para></listitem>
+
</orderedlist>
</para>
--
1.7.10.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
end of thread, other threads:[~2014-11-28 23:42 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-18 5:40 [REVIEW PATCH v2 0/5] Add V4L2_SEL_TGT_NATIVE_SIZE target Sakari Ailus
2014-11-18 5:40 ` [REVIEW PATCH v2 1/5] v4l: Clean up sub-device format documentation Sakari Ailus
2014-11-28 23:42 ` [PATCH v2.1 " Sakari Ailus
2014-11-18 5:40 ` [REVIEW PATCH v2 2/5] v4l: Add V4L2_SEL_TGT_NATIVE_SIZE selection target Sakari Ailus
2014-11-18 21:08 ` [REVIEW PATCH v2.1 " Sakari Ailus
2014-11-24 10:49 ` Hans Verkuil
2014-11-24 21:36 ` Sakari Ailus
2014-11-18 5:40 ` [REVIEW PATCH v2 3/5] v4l: Add intput and output capability flags for native size setting Sakari Ailus
2014-11-18 8:56 ` Hans Verkuil
2014-11-18 20:59 ` Sakari Ailus
2014-11-18 5:40 ` [REVIEW PATCH v2 4/5] smiapp: Set left and top to zero for crop bounds selection Sakari Ailus
2014-11-18 5:40 ` [REVIEW PATCH v2 5/5] smiapp: Support V4L2_SEL_TGT_NATIVE_SIZE Sakari Ailus
2014-11-18 5:45 ` [REVIEW PATCH v2 0/5] Add V4L2_SEL_TGT_NATIVE_SIZE target Sakari Ailus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).