* [PATCH] V4L: Rename V4L2_SEL_TGT_[CROP/COMPOSE]_ACTIVE to V4L2_SEL_TGT_[CROP/COMPOSE]
@ 2012-05-14 17:17 Sylwester Nawrocki
2012-05-14 23:21 ` Laurent Pinchart
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Sylwester Nawrocki @ 2012-05-14 17:17 UTC (permalink / raw)
To: linux-media
Cc: sakari.ailus, t.stanislaws, laurent.pinchart, Sylwester Nawrocki,
Kyungmin Park
This patch drops the _ACTIVE part from the selection target names as
a prerequisite to unify the selection target names on subdevs and regular
video nodes.
Although not exactly the same, the meaning of V4L2_SEL_TGT_*_ACTIVE and
V4L2_SUBDEV_SEL_TGT_*_ACTUAL selection targets is logically the same.
Different names add to confusion where both APIs are used in a single
driver or an application.
The selections API is experimental, so no compatibility layer is added.
The ABI remains unchanged.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Documentation/DocBook/media/v4l/selection-api.xml | 24 ++++++++++----------
.../DocBook/media/v4l/vidioc-g-selection.xml | 15 ++++++------
drivers/media/video/s5p-fimc/fimc-capture.c | 8 +++----
drivers/media/video/s5p-jpeg/jpeg-core.c | 4 ++--
drivers/media/video/s5p-tv/mixer_video.c | 8 +++----
drivers/media/video/v4l2-ioctl.c | 8 +++----
include/linux/videodev2.h | 4 ++--
7 files changed, 36 insertions(+), 35 deletions(-)
diff --git a/Documentation/DocBook/media/v4l/selection-api.xml b/Documentation/DocBook/media/v4l/selection-api.xml
index b299e47..ac013e5 100644
--- a/Documentation/DocBook/media/v4l/selection-api.xml
+++ b/Documentation/DocBook/media/v4l/selection-api.xml
@@ -91,7 +91,7 @@ top/left corner at position <constant> (0,0) </constant>. The rectangle's
coordinates are expressed in pixels.</para>
<para>The top left corner, width and height of the source rectangle, that is
-the area actually sampled, is given by the <constant> V4L2_SEL_TGT_CROP_ACTIVE
+the area actually sampled, is given by the <constant> V4L2_SEL_TGT_CROP
</constant> target. It uses the same coordinate system as <constant>
V4L2_SEL_TGT_CROP_BOUNDS </constant>. The active cropping area must lie
completely inside the capture boundaries. The driver may further adjust the
@@ -111,7 +111,7 @@ height are equal to the image size set by <constant> VIDIOC_S_FMT </constant>.
</para>
<para>The part of a buffer into which the image is inserted by the hardware is
-controlled by the <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target.
+controlled by the <constant> V4L2_SEL_TGT_COMPOSE </constant> target.
The rectangle's coordinates are also expressed in the same coordinate system as
the bounds rectangle. The composing rectangle must lie completely inside bounds
rectangle. The driver must adjust the composing rectangle to fit to the
@@ -125,7 +125,7 @@ bounding rectangle.</para>
<para>The part of a buffer that is modified by the hardware is given by
<constant> V4L2_SEL_TGT_COMPOSE_PADDED </constant>. It contains all pixels
-defined using <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> plus all
+defined using <constant> V4L2_SEL_TGT_COMPOSE </constant> plus all
padding data modified by hardware during insertion process. All pixels outside
this rectangle <emphasis>must not</emphasis> be changed by the hardware. The
content of pixels that lie inside the padded area but outside active area is
@@ -153,7 +153,7 @@ specified using <constant> VIDIOC_S_FMT </constant> ioctl.</para>
<para>The top left corner, width and height of the source rectangle, that is
the area from which image date are processed by the hardware, is given by the
-<constant> V4L2_SEL_TGT_CROP_ACTIVE </constant>. Its coordinates are expressed
+<constant> V4L2_SEL_TGT_CROP </constant>. Its coordinates are expressed
in in the same coordinate system as the bounds rectangle. The active cropping
area must lie completely inside the crop boundaries and the driver may further
adjust the requested size and/or position according to hardware
@@ -165,7 +165,7 @@ bounding rectangle.</para>
<para>The part of a video signal or graphics display where the image is
inserted by the hardware is controlled by <constant>
-V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target. The rectangle's coordinates
+V4L2_SEL_TGT_COMPOSE </constant> target. The rectangle's coordinates
are expressed in pixels. The composing rectangle must lie completely inside the
bounds rectangle. The driver must adjust the area to fit to the bounding
limits. Moreover, the driver can perform other adjustments according to
@@ -184,7 +184,7 @@ such a padded area is driver-dependent feature not covered by this document.
Driver developers are encouraged to keep padded rectangle equal to active one.
The padded target is accessed by the <constant> V4L2_SEL_TGT_COMPOSE_PADDED
</constant> identifier. It must contain all pixels from the <constant>
-V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target.</para>
+V4L2_SEL_TGT_COMPOSE </constant> target.</para>
</section>
@@ -193,8 +193,8 @@ V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target.</para>
<title>Scaling control</title>
<para>An application can detect if scaling is performed by comparing the width
-and the height of rectangles obtained using <constant> V4L2_SEL_TGT_CROP_ACTIVE
-</constant> and <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> targets. If
+and the height of rectangles obtained using <constant> V4L2_SEL_TGT_CROP
+</constant> and <constant> V4L2_SEL_TGT_COMPOSE </constant> targets. If
these are not equal then the scaling is applied. The application can compute
the scaling ratios using these values.</para>
@@ -252,7 +252,7 @@ area)</para>
ret = ioctl(fd, &VIDIOC-G-SELECTION;, &sel);
if (ret)
exit(-1);
- sel.target = V4L2_SEL_TGT_CROP_ACTIVE;
+ sel.target = V4L2_SEL_TGT_CROP;
ret = ioctl(fd, &VIDIOC-S-SELECTION;, &sel);
if (ret)
exit(-1);
@@ -281,7 +281,7 @@ area)</para>
r.left = sel.r.width / 4;
r.top = sel.r.height / 4;
sel.r = r;
- sel.target = V4L2_SEL_TGT_COMPOSE_ACTIVE;
+ sel.target = V4L2_SEL_TGT_COMPOSE;
sel.flags = V4L2_SEL_FLAG_LE;
ret = ioctl(fd, &VIDIOC-S-SELECTION;, &sel);
if (ret)
@@ -298,11 +298,11 @@ V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> for other devices</para>
&v4l2-selection; compose = {
.type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
- .target = V4L2_SEL_TGT_COMPOSE_ACTIVE,
+ .target = V4L2_SEL_TGT_COMPOSE,
};
&v4l2-selection; crop = {
.type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
- .target = V4L2_SEL_TGT_CROP_ACTIVE,
+ .target = V4L2_SEL_TGT_CROP,
};
double hscale, vscale;
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
index bb04eff..6376e57 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
@@ -65,8 +65,8 @@ Do not use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE
</constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of
<constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is
setting the value of &v4l2-selection; <structfield>target</structfield> field
-to <constant> V4L2_SEL_TGT_CROP_ACTIVE </constant> (<constant>
-V4L2_SEL_TGT_COMPOSE_ACTIVE </constant>). Please refer to table <xref
+to <constant> V4L2_SEL_TGT_CROP </constant> (<constant>
+V4L2_SEL_TGT_COMPOSE </constant>). Please refer to table <xref
linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional
targets. The <structfield>flags</structfield> and <structfield>reserved
</structfield> fields of &v4l2-selection; are ignored and they must be filled
@@ -86,8 +86,8 @@ use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE
</constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of
<constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is
setting the value of &v4l2-selection; <structfield>target</structfield> to
-<constant>V4L2_SEL_TGT_CROP_ACTIVE</constant> (<constant>
-V4L2_SEL_TGT_COMPOSE_ACTIVE </constant>). Please refer to table <xref
+<constant>V4L2_SEL_TGT_CROP</constant> (<constant>
+V4L2_SEL_TGT_COMPOSE </constant>). Please refer to table <xref
linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional
targets. The &v4l2-rect; <structfield>r</structfield> rectangle need to be
set to the desired active area. Field &v4l2-selection; <structfield> reserved
@@ -161,7 +161,7 @@ exist no rectangle </emphasis> that satisfies the constraints.</para>
&cs-def;
<tbody valign="top">
<row>
- <entry><constant>V4L2_SEL_TGT_CROP_ACTIVE</constant></entry>
+ <entry><constant>V4L2_SEL_TGT_CROP</constant></entry>
<entry>0x0000</entry>
<entry>The area that is currently cropped by hardware.</entry>
</row>
@@ -176,7 +176,7 @@ exist no rectangle </emphasis> that satisfies the constraints.</para>
<entry>Limits for the cropping rectangle.</entry>
</row>
<row>
- <entry><constant>V4L2_SEL_TGT_COMPOSE_ACTIVE</constant></entry>
+ <entry><constant>V4L2_SEL_TGT_COMPOSE</constant></entry>
<entry>0x0100</entry>
<entry>The area to which data is composed by hardware.</entry>
</row>
@@ -193,7 +193,8 @@ exist no rectangle </emphasis> that satisfies the constraints.</para>
<row>
<entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry>
<entry>0x0103</entry>
- <entry>The active area and all padding pixels that are inserted or modified by hardware.</entry>
+ <entry>The active area and all padding pixels that are inserted or
+ modified by hardware.</entry>
</row>
</tbody>
</tgroup>
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c
index 5202177..a154cc1 100644
--- a/drivers/media/video/s5p-fimc/fimc-capture.c
+++ b/drivers/media/video/s5p-fimc/fimc-capture.c
@@ -1059,9 +1059,9 @@ static int fimc_cap_g_selection(struct file *file, void *fh,
s->r.height = f->o_height;
return 0;
- case V4L2_SEL_TGT_COMPOSE_ACTIVE:
+ case V4L2_SEL_TGT_COMPOSE:
f = &ctx->d_frame;
- case V4L2_SEL_TGT_CROP_ACTIVE:
+ case V4L2_SEL_TGT_CROP:
s->r.left = f->offs_h;
s->r.top = f->offs_v;
s->r.width = f->width;
@@ -1101,13 +1101,13 @@ static int fimc_cap_s_selection(struct file *file, void *fh,
switch (s->target) {
case V4L2_SEL_TGT_COMPOSE_DEFAULT:
case V4L2_SEL_TGT_COMPOSE_BOUNDS:
- case V4L2_SEL_TGT_COMPOSE_ACTIVE:
+ case V4L2_SEL_TGT_COMPOSE:
f = &ctx->d_frame;
pad = FIMC_SD_PAD_SOURCE;
break;
case V4L2_SEL_TGT_CROP_BOUNDS:
case V4L2_SEL_TGT_CROP_DEFAULT:
- case V4L2_SEL_TGT_CROP_ACTIVE:
+ case V4L2_SEL_TGT_CROP:
f = &ctx->s_frame;
pad = FIMC_SD_PAD_SINK;
break;
diff --git a/drivers/media/video/s5p-jpeg/jpeg-core.c b/drivers/media/video/s5p-jpeg/jpeg-core.c
index ecf7b0b..e49f13b 100644
--- a/drivers/media/video/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/video/s5p-jpeg/jpeg-core.c
@@ -824,10 +824,10 @@ int s5p_jpeg_g_selection(struct file *file, void *priv,
/* For JPEG blob active == default == bounds */
switch (s->target) {
- case V4L2_SEL_TGT_CROP_ACTIVE:
+ case V4L2_SEL_TGT_CROP:
case V4L2_SEL_TGT_CROP_BOUNDS:
case V4L2_SEL_TGT_CROP_DEFAULT:
- case V4L2_SEL_TGT_COMPOSE_ACTIVE:
+ case V4L2_SEL_TGT_COMPOSE:
case V4L2_SEL_TGT_COMPOSE_DEFAULT:
s->r.width = ctx->out_q.w;
s->r.height = ctx->out_q.h;
diff --git a/drivers/media/video/s5p-tv/mixer_video.c b/drivers/media/video/s5p-tv/mixer_video.c
index c0eadd7..2cce455 100644
--- a/drivers/media/video/s5p-tv/mixer_video.c
+++ b/drivers/media/video/s5p-tv/mixer_video.c
@@ -367,7 +367,7 @@ static int mxr_g_selection(struct file *file, void *fh,
return -EINVAL;
switch (s->target) {
- case V4L2_SEL_TGT_CROP_ACTIVE:
+ case V4L2_SEL_TGT_CROP:
s->r.left = geo->src.x_offset;
s->r.top = geo->src.y_offset;
s->r.width = geo->src.width;
@@ -380,7 +380,7 @@ static int mxr_g_selection(struct file *file, void *fh,
s->r.width = geo->src.full_width;
s->r.height = geo->src.full_height;
break;
- case V4L2_SEL_TGT_COMPOSE_ACTIVE:
+ case V4L2_SEL_TGT_COMPOSE:
case V4L2_SEL_TGT_COMPOSE_PADDED:
s->r.left = geo->dst.x_offset;
s->r.top = geo->dst.y_offset;
@@ -449,11 +449,11 @@ static int mxr_s_selection(struct file *file, void *fh,
res.height = geo->dst.full_height;
break;
- case V4L2_SEL_TGT_CROP_ACTIVE:
+ case V4L2_SEL_TGT_CROP:
target = &geo->src;
stage = MXR_GEOMETRY_CROP;
break;
- case V4L2_SEL_TGT_COMPOSE_ACTIVE:
+ case V4L2_SEL_TGT_COMPOSE:
case V4L2_SEL_TGT_COMPOSE_PADDED:
target = &geo->dst;
stage = MXR_GEOMETRY_COMPOSE;
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index 623d280..003c7d8 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -1455,9 +1455,9 @@ static long __video_do_ioctl(struct file *file,
/* crop means compose for output devices */
if (V4L2_TYPE_IS_OUTPUT(p->type))
- s.target = V4L2_SEL_TGT_COMPOSE_ACTIVE;
+ s.target = V4L2_SEL_TGT_COMPOSE;
else
- s.target = V4L2_SEL_TGT_CROP_ACTIVE;
+ s.target = V4L2_SEL_TGT_CROP;
ret = ops->vidioc_g_selection(file, fh, &s);
@@ -1488,9 +1488,9 @@ static long __video_do_ioctl(struct file *file,
/* crop means compose for output devices */
if (V4L2_TYPE_IS_OUTPUT(p->type))
- s.target = V4L2_SEL_TGT_COMPOSE_ACTIVE;
+ s.target = V4L2_SEL_TGT_COMPOSE;
else
- s.target = V4L2_SEL_TGT_CROP_ACTIVE;
+ s.target = V4L2_SEL_TGT_CROP;
ret = ops->vidioc_s_selection(file, fh, &s);
}
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 7f75846..6199840 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -768,13 +768,13 @@ struct v4l2_crop {
/* Selection targets */
/* Current cropping area */
-#define V4L2_SEL_TGT_CROP_ACTIVE 0x0000
+#define V4L2_SEL_TGT_CROP 0x0000
/* Default cropping area */
#define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
/* Cropping bounds */
#define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
/* Current composing area */
-#define V4L2_SEL_TGT_COMPOSE_ACTIVE 0x0100
+#define V4L2_SEL_TGT_COMPOSE 0x0100
/* Default composing area */
#define V4L2_SEL_TGT_COMPOSE_DEFAULT 0x0101
/* Composing bounds */
--
1.7.10
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] V4L: Rename V4L2_SEL_TGT_[CROP/COMPOSE]_ACTIVE to V4L2_SEL_TGT_[CROP/COMPOSE]
2012-05-14 17:17 [PATCH] V4L: Rename V4L2_SEL_TGT_[CROP/COMPOSE]_ACTIVE to V4L2_SEL_TGT_[CROP/COMPOSE] Sylwester Nawrocki
@ 2012-05-14 23:21 ` Laurent Pinchart
2012-05-17 21:04 ` Sakari Ailus
2012-05-17 21:15 ` [PATCH 1/1] v4l: Remove "_ACTUAL" from subdev selection API target definition names Sakari Ailus
2 siblings, 0 replies; 7+ messages in thread
From: Laurent Pinchart @ 2012-05-14 23:21 UTC (permalink / raw)
To: Sylwester Nawrocki; +Cc: linux-media, sakari.ailus, t.stanislaws, Kyungmin Park
Hi Sylwester,
Thanks for the patch.
On Monday 14 May 2012 19:17:03 Sylwester Nawrocki wrote:
> This patch drops the _ACTIVE part from the selection target names as
> a prerequisite to unify the selection target names on subdevs and regular
> video nodes.
>
> Although not exactly the same, the meaning of V4L2_SEL_TGT_*_ACTIVE and
> V4L2_SUBDEV_SEL_TGT_*_ACTUAL selection targets is logically the same.
> Different names add to confusion where both APIs are used in a single
> driver or an application.
> The selections API is experimental, so no compatibility layer is added.
> The ABI remains unchanged.
>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] V4L: Rename V4L2_SEL_TGT_[CROP/COMPOSE]_ACTIVE to V4L2_SEL_TGT_[CROP/COMPOSE]
2012-05-14 17:17 [PATCH] V4L: Rename V4L2_SEL_TGT_[CROP/COMPOSE]_ACTIVE to V4L2_SEL_TGT_[CROP/COMPOSE] Sylwester Nawrocki
2012-05-14 23:21 ` Laurent Pinchart
@ 2012-05-17 21:04 ` Sakari Ailus
2012-05-17 21:15 ` [PATCH 1/1] v4l: Remove "_ACTUAL" from subdev selection API target definition names Sakari Ailus
2 siblings, 0 replies; 7+ messages in thread
From: Sakari Ailus @ 2012-05-17 21:04 UTC (permalink / raw)
To: Sylwester Nawrocki
Cc: linux-media, t.stanislaws, laurent.pinchart, Kyungmin Park
On Mon, May 14, 2012 at 07:17:03PM +0200, Sylwester Nawrocki wrote:
> This patch drops the _ACTIVE part from the selection target names as
> a prerequisite to unify the selection target names on subdevs and regular
> video nodes.
>
> Although not exactly the same, the meaning of V4L2_SEL_TGT_*_ACTIVE and
> V4L2_SUBDEV_SEL_TGT_*_ACTUAL selection targets is logically the same.
> Different names add to confusion where both APIs are used in a single
> driver or an application.
> The selections API is experimental, so no compatibility layer is added.
> The ABI remains unchanged.
>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Thanks!
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi jabber/XMPP/Gmail: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/1] v4l: Remove "_ACTUAL" from subdev selection API target definition names
2012-05-14 17:17 [PATCH] V4L: Rename V4L2_SEL_TGT_[CROP/COMPOSE]_ACTIVE to V4L2_SEL_TGT_[CROP/COMPOSE] Sylwester Nawrocki
2012-05-14 23:21 ` Laurent Pinchart
2012-05-17 21:04 ` Sakari Ailus
@ 2012-05-17 21:15 ` Sakari Ailus
2012-05-17 21:37 ` Sylwester Nawrocki
2 siblings, 1 reply; 7+ messages in thread
From: Sakari Ailus @ 2012-05-17 21:15 UTC (permalink / raw)
To: linux-media; +Cc: laurent.pinchart, s.nawrocki
The string "_ACTUAL" does not say anything more about the target names. Drop
it. V4L2 selection API was changed by "V4L: Rename V4L2_SEL_TGT_[CROP/COMPOSE]_ACTIVE to
V4L2_SEL_TGT_[CROP/COMPOSE]" by Sylwester Nawrocki. This patch does the same
for the V4L2 subdev API.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
---
Documentation/DocBook/media/v4l/dev-subdev.xml | 25 +++++++++----------
.../media/v4l/vidioc-subdev-g-selection.xml | 12 ++++----
drivers/media/video/omap3isp/ispccdc.c | 4 +-
drivers/media/video/omap3isp/isppreview.c | 4 +-
drivers/media/video/omap3isp/ispresizer.c | 4 +-
drivers/media/video/smiapp/smiapp-core.c | 22 ++++++++--------
drivers/media/video/v4l2-subdev.c | 4 +-
include/linux/v4l2-subdev.h | 4 +-
8 files changed, 39 insertions(+), 40 deletions(-)
diff --git a/Documentation/DocBook/media/v4l/dev-subdev.xml b/Documentation/DocBook/media/v4l/dev-subdev.xml
index 4afcbbe..ac715dd 100644
--- a/Documentation/DocBook/media/v4l/dev-subdev.xml
+++ b/Documentation/DocBook/media/v4l/dev-subdev.xml
@@ -289,8 +289,8 @@
&v4l2-rect; by the coordinates of the top left corner and the rectangle
size. Both the coordinates and sizes are expressed in pixels.</para>
- <para>As for pad formats, drivers store try and active
- rectangles for the selection targets of ACTUAL type <xref
+ <para>As for pad formats, drivers store try and active rectangles for
+ the selection targets <xref
linkend="v4l2-subdev-selection-targets">.</xref></para>
<para>On sink pads, cropping is applied relative to the
@@ -308,7 +308,7 @@
<para>Scaling support is optional. When supported by a subdev,
the crop rectangle on the subdev's sink pad is scaled to the
size configured using the &VIDIOC-SUBDEV-S-SELECTION; IOCTL
- using <constant>V4L2_SUBDEV_SEL_COMPOSE_ACTUAL</constant>
+ using <constant>V4L2_SUBDEV_SEL_TGT_COMPOSE</constant>
selection target on the same pad. If the subdev supports scaling
but not composing, the top and left values are not used and must
always be set to zero.</para>
@@ -333,22 +333,21 @@
<title>Types of selection targets</title>
<section>
- <title>ACTUAL targets</title>
+ <title>Actual targets</title>
- <para>ACTUAL targets reflect the actual hardware configuration
- at any point of time. There is a BOUNDS target
- corresponding to every ACTUAL.</para>
+ <para>Actual targets (without a postfix) reflect the actual hardware
+ configuration at any point of time.</para>
</section>
<section>
<title>BOUNDS targets</title>
- <para>BOUNDS targets is the smallest rectangle that contains
- all valid ACTUAL rectangles. It may not be possible to set the
- ACTUAL rectangle as large as the BOUNDS rectangle, however.
- This may be because e.g. a sensor's pixel array is not
- rectangular but cross-shaped or round. The maximum size may
- also be smaller than the BOUNDS rectangle.</para>
+ <para>BOUNDS targets is the smallest rectangle that contains all
+ valid actual rectangles. It may not be possible to set the actual
+ rectangle as large as the BOUNDS rectangle, however. This may be
+ because e.g. a sensor's pixel array is not rectangular but
+ cross-shaped or round. The maximum size may also be smaller than the
+ BOUNDS rectangle.</para>
</section>
</section>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
index 208e9f0..96ab51e 100644
--- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
@@ -72,10 +72,10 @@
<section>
<title>Types of selection targets</title>
- <para>There are two types of selection targets: actual and bounds.
- The ACTUAL targets are the targets which configure the hardware.
- The BOUNDS target will return a rectangle that contain all
- possible ACTUAL rectangles.</para>
+ <para>There are two types of selection targets: plain and bounds. The
+ actual targets are the targets which configure the hardware. The BOUNDS
+ target will return a rectangle that contain all possible actual
+ rectangles.</para>
</section>
<section>
@@ -93,7 +93,7 @@
&cs-def;
<tbody valign="top">
<row>
- <entry><constant>V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL</constant></entry>
+ <entry><constant>V4L2_SUBDEV_SEL_TGT_CROP</constant></entry>
<entry>0x0000</entry>
<entry>Actual crop. Defines the cropping
performed by the processing step.</entry>
@@ -104,7 +104,7 @@
<entry>Bounds of the crop rectangle.</entry>
</row>
<row>
- <entry><constant>V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL</constant></entry>
+ <entry><constant>V4L2_SUBDEV_SEL_TGT_COMPOSE</constant></entry>
<entry>0x0100</entry>
<entry>Actual compose rectangle. Used to configure scaling
on sink pads and composition on source pads.</entry>
diff --git a/drivers/media/video/omap3isp/ispccdc.c b/drivers/media/video/omap3isp/ispccdc.c
index 7e32331..f19774f 100644
--- a/drivers/media/video/omap3isp/ispccdc.c
+++ b/drivers/media/video/omap3isp/ispccdc.c
@@ -2024,7 +2024,7 @@ static int ccdc_get_selection(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
ccdc_try_crop(ccdc, format, &sel->r);
break;
- case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL:
+ case V4L2_SUBDEV_SEL_TGT_CROP:
sel->r = *__ccdc_get_crop(ccdc, fh, sel->which);
break;
@@ -2052,7 +2052,7 @@ static int ccdc_set_selection(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd);
struct v4l2_mbus_framefmt *format;
- if (sel->target != V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL ||
+ if (sel->target != V4L2_SUBDEV_SEL_TGT_CROP ||
sel->pad != CCDC_PAD_SOURCE_OF)
return -EINVAL;
diff --git a/drivers/media/video/omap3isp/isppreview.c b/drivers/media/video/omap3isp/isppreview.c
index 8a4935e..1086f6a 100644
--- a/drivers/media/video/omap3isp/isppreview.c
+++ b/drivers/media/video/omap3isp/isppreview.c
@@ -1960,7 +1960,7 @@ static int preview_get_selection(struct v4l2_subdev *sd,
preview_try_crop(prev, format, &sel->r);
break;
- case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL:
+ case V4L2_SUBDEV_SEL_TGT_CROP:
sel->r = *__preview_get_crop(prev, fh, sel->which);
break;
@@ -1988,7 +1988,7 @@ static int preview_set_selection(struct v4l2_subdev *sd,
struct isp_prev_device *prev = v4l2_get_subdevdata(sd);
struct v4l2_mbus_framefmt *format;
- if (sel->target != V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL ||
+ if (sel->target != V4L2_SUBDEV_SEL_TGT_CROP ||
sel->pad != PREV_PAD_SINK)
return -EINVAL;
diff --git a/drivers/media/video/omap3isp/ispresizer.c b/drivers/media/video/omap3isp/ispresizer.c
index 14041c9..9456652 100644
--- a/drivers/media/video/omap3isp/ispresizer.c
+++ b/drivers/media/video/omap3isp/ispresizer.c
@@ -1259,7 +1259,7 @@ static int resizer_get_selection(struct v4l2_subdev *sd,
resizer_calc_ratios(res, &sel->r, format_source, &ratio);
break;
- case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL:
+ case V4L2_SUBDEV_SEL_TGT_CROP:
sel->r = *__resizer_get_crop(res, fh, sel->which);
resizer_calc_ratios(res, &sel->r, format_source, &ratio);
break;
@@ -1293,7 +1293,7 @@ static int resizer_set_selection(struct v4l2_subdev *sd,
struct v4l2_mbus_framefmt *format_sink, *format_source;
struct resizer_ratio ratio;
- if (sel->target != V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL ||
+ if (sel->target != V4L2_SUBDEV_SEL_TGT_CROP ||
sel->pad != RESZ_PAD_SINK)
return -EINVAL;
diff --git a/drivers/media/video/smiapp/smiapp-core.c b/drivers/media/video/smiapp/smiapp-core.c
index a8a1db9..53e0ee7 100644
--- a/drivers/media/video/smiapp/smiapp-core.c
+++ b/drivers/media/video/smiapp/smiapp-core.c
@@ -1601,7 +1601,7 @@ static void smiapp_propagate(struct v4l2_subdev *subdev,
smiapp_get_crop_compose(subdev, fh, crops, &comp, which);
switch (target) {
- case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL:
+ case V4L2_SUBDEV_SEL_TGT_CROP:
comp->width = crops[SMIAPP_PAD_SINK]->width;
comp->height = crops[SMIAPP_PAD_SINK]->height;
if (which == V4L2_SUBDEV_FORMAT_ACTIVE) {
@@ -1617,7 +1617,7 @@ static void smiapp_propagate(struct v4l2_subdev *subdev,
}
}
/* Fall through */
- case V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL:
+ case V4L2_SUBDEV_SEL_TGT_COMPOSE:
*crops[SMIAPP_PAD_SRC] = *comp;
break;
default:
@@ -1693,7 +1693,7 @@ static int smiapp_set_format(struct v4l2_subdev *subdev,
if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE)
ssd->sink_fmt = *crops[ssd->sink_pad];
smiapp_propagate(subdev, fh, fmt->which,
- V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL);
+ V4L2_SUBDEV_SEL_TGT_CROP);
mutex_unlock(&sensor->mutex);
@@ -1928,7 +1928,7 @@ static int smiapp_set_compose(struct v4l2_subdev *subdev,
*comp = sel->r;
smiapp_propagate(subdev, fh, sel->which,
- V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL);
+ V4L2_SUBDEV_SEL_TGT_COMPOSE);
if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE)
return smiapp_update_mode(sensor);
@@ -1944,7 +1944,7 @@ static int __smiapp_sel_supported(struct v4l2_subdev *subdev,
/* We only implement crop in three places. */
switch (sel->target) {
- case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL:
+ case V4L2_SUBDEV_SEL_TGT_CROP:
case V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS:
if (ssd == sensor->pixel_array
&& sel->pad == SMIAPP_PA_PAD_SRC)
@@ -1958,7 +1958,7 @@ static int __smiapp_sel_supported(struct v4l2_subdev *subdev,
== SMIAPP_DIGITAL_CROP_CAPABILITY_INPUT_CROP)
return 0;
return -EINVAL;
- case V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL:
+ case V4L2_SUBDEV_SEL_TGT_COMPOSE:
case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS:
if (sel->pad == ssd->source_pad)
return -EINVAL;
@@ -2021,7 +2021,7 @@ static int smiapp_set_crop(struct v4l2_subdev *subdev,
if (ssd != sensor->pixel_array && sel->pad == SMIAPP_PAD_SINK)
smiapp_propagate(subdev, fh, sel->which,
- V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL);
+ V4L2_SUBDEV_SEL_TGT_CROP);
return 0;
}
@@ -2067,11 +2067,11 @@ static int __smiapp_get_selection(struct v4l2_subdev *subdev,
sel->r = *comp;
}
break;
- case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL:
+ case V4L2_SUBDEV_SEL_TGT_CROP:
case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS:
sel->r = *crops[sel->pad];
break;
- case V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL:
+ case V4L2_SUBDEV_SEL_TGT_COMPOSE:
sel->r = *comp;
break;
}
@@ -2118,10 +2118,10 @@ static int smiapp_set_selection(struct v4l2_subdev *subdev,
sel->r.height);
switch (sel->target) {
- case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL:
+ case V4L2_SUBDEV_SEL_TGT_CROP:
ret = smiapp_set_crop(subdev, fh, sel);
break;
- case V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL:
+ case V4L2_SUBDEV_SEL_TGT_COMPOSE:
ret = smiapp_set_compose(subdev, fh, sel);
break;
default:
diff --git a/drivers/media/video/v4l2-subdev.c b/drivers/media/video/v4l2-subdev.c
index db6e859..cd86f0c 100644
--- a/drivers/media/video/v4l2-subdev.c
+++ b/drivers/media/video/v4l2-subdev.c
@@ -245,7 +245,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
memset(&sel, 0, sizeof(sel));
sel.which = crop->which;
sel.pad = crop->pad;
- sel.target = V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL;
+ sel.target = V4L2_SUBDEV_SEL_TGT_CROP;
rval = v4l2_subdev_call(
sd, pad, get_selection, subdev_fh, &sel);
@@ -274,7 +274,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
memset(&sel, 0, sizeof(sel));
sel.which = crop->which;
sel.pad = crop->pad;
- sel.target = V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL;
+ sel.target = V4L2_SUBDEV_SEL_TGT_CROP;
sel.r = crop->rect;
rval = v4l2_subdev_call(
diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h
index 812019e..01eee06 100644
--- a/include/linux/v4l2-subdev.h
+++ b/include/linux/v4l2-subdev.h
@@ -128,11 +128,11 @@ struct v4l2_subdev_frame_interval_enum {
#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG (1 << 2)
/* active cropping area */
-#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL 0x0000
+#define V4L2_SUBDEV_SEL_TGT_CROP 0x0000
/* cropping bounds */
#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS 0x0002
/* current composing area */
-#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL 0x0100
+#define V4L2_SUBDEV_SEL_TGT_COMPOSE 0x0100
/* composing bounds */
#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS 0x0102
--
1.7.2.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] v4l: Remove "_ACTUAL" from subdev selection API target definition names
2012-05-17 21:15 ` [PATCH 1/1] v4l: Remove "_ACTUAL" from subdev selection API target definition names Sakari Ailus
@ 2012-05-17 21:37 ` Sylwester Nawrocki
2012-05-17 22:35 ` Sakari Ailus
0 siblings, 1 reply; 7+ messages in thread
From: Sylwester Nawrocki @ 2012-05-17 21:37 UTC (permalink / raw)
To: Sakari Ailus
Cc: linux-media, laurent.pinchart, s.nawrocki, Mauro Carvalho Chehab
Hi Sakari,
thanks for the patch.
On 05/17/2012 11:15 PM, Sakari Ailus wrote:
> The string "_ACTUAL" does not say anything more about the target names. Drop
> it. V4L2 selection API was changed by "V4L: Rename V4L2_SEL_TGT_[CROP/COMPOSE]_ACTIVE to
> V4L2_SEL_TGT_[CROP/COMPOSE]" by Sylwester Nawrocki. This patch does the same
> for the V4L2 subdev API.
>
> Signed-off-by: Sakari Ailus<sakari.ailus@iki.fi>
Are these all changes, or do you think we could try to drop the _SUBDEV
part as well from the below selection target names, so they are same
across V4L2 and subdev API ? :-)
I realize it might me quite a bit of documentation work and it's pretty
late for getting these patches in for v3.5.
I still have a dependency on my previous pull request which is pending
for the patch you mentioned. Do you think we should leave "_SUBDEV"
in subdev selection target names for now (/ever) ?
Regards,
Sylwester
> ---
...
> diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h
> index 812019e..01eee06 100644
> --- a/include/linux/v4l2-subdev.h
> +++ b/include/linux/v4l2-subdev.h
> @@ -128,11 +128,11 @@ struct v4l2_subdev_frame_interval_enum {
> #define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG (1<< 2)
>
> /* active cropping area */
> -#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL 0x0000
> +#define V4L2_SUBDEV_SEL_TGT_CROP 0x0000
> /* cropping bounds */
> #define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS 0x0002
> /* current composing area */
> -#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL 0x0100
> +#define V4L2_SUBDEV_SEL_TGT_COMPOSE 0x0100
> /* composing bounds */
> #define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS 0x0102
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] v4l: Remove "_ACTUAL" from subdev selection API target definition names
2012-05-17 21:37 ` Sylwester Nawrocki
@ 2012-05-17 22:35 ` Sakari Ailus
2012-05-17 23:07 ` Sylwester Nawrocki
0 siblings, 1 reply; 7+ messages in thread
From: Sakari Ailus @ 2012-05-17 22:35 UTC (permalink / raw)
To: Sylwester Nawrocki
Cc: linux-media, laurent.pinchart, s.nawrocki, Mauro Carvalho Chehab
Hi Sylwester,
On Thu, May 17, 2012 at 11:37:47PM +0200, Sylwester Nawrocki wrote:
> Hi Sakari,
>
> thanks for the patch.
>
> On 05/17/2012 11:15 PM, Sakari Ailus wrote:
> > The string "_ACTUAL" does not say anything more about the target names. Drop
> > it. V4L2 selection API was changed by "V4L: Rename V4L2_SEL_TGT_[CROP/COMPOSE]_ACTIVE to
> > V4L2_SEL_TGT_[CROP/COMPOSE]" by Sylwester Nawrocki. This patch does the same
> > for the V4L2 subdev API.
> >
> > Signed-off-by: Sakari Ailus<sakari.ailus@iki.fi>
>
> Are these all changes, or do you think we could try to drop the _SUBDEV
> part as well from the below selection target names, so they are same
> across V4L2 and subdev API ? :-)
>
> I realize it might me quite a bit of documentation work and it's pretty
> late for getting these patches in for v3.5.
>
> I still have a dependency on my previous pull request which is pending
> for the patch you mentioned. Do you think we should leave "_SUBDEV"
> in subdev selection target names for now (/ever) ?
I started working on removing the SUBDEV_ in between but I agree with you,
there seems to be more than just a tiny bit of documentation work. It may be
we'll go past 3.5 in doing that.
I think the most important change was to get rid or ACTUAL/ACTIVE anyway.
What we could do is that we postpone this change after 3.5 (to 3.6) and
perhaps keep the old subdev targets around awhile.
In my opinion the user space may (or perhaps even should) begin using the
V4L2 targets already, but in kernel we'll use the existing subdev targets
before the removal patch is eventually ready.
This is primarily a documentation change after all.
Could you rebase your exposure metering target definition patch on top of
the _ACTUAL/_ACTIVE removal patches?
Kind regars,
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi jabber/XMPP/Gmail: sailus@retiisi.org.uk
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] v4l: Remove "_ACTUAL" from subdev selection API target definition names
2012-05-17 22:35 ` Sakari Ailus
@ 2012-05-17 23:07 ` Sylwester Nawrocki
0 siblings, 0 replies; 7+ messages in thread
From: Sylwester Nawrocki @ 2012-05-17 23:07 UTC (permalink / raw)
To: Sakari Ailus
Cc: linux-media, laurent.pinchart, s.nawrocki, Mauro Carvalho Chehab
Hi Sakari,
On 05/18/2012 12:35 AM, Sakari Ailus wrote:
...
>> On 05/17/2012 11:15 PM, Sakari Ailus wrote:
>>> The string "_ACTUAL" does not say anything more about the target names. Drop
>>> it. V4L2 selection API was changed by "V4L: Rename V4L2_SEL_TGT_[CROP/COMPOSE]_ACTIVE to
>>> V4L2_SEL_TGT_[CROP/COMPOSE]" by Sylwester Nawrocki. This patch does the same
>>> for the V4L2 subdev API.
>>>
>>> Signed-off-by: Sakari Ailus<sakari.ailus@iki.fi>
>>
>> Are these all changes, or do you think we could try to drop the _SUBDEV
>> part as well from the below selection target names, so they are same
>> across V4L2 and subdev API ? :-)
>>
>> I realize it might me quite a bit of documentation work and it's pretty
>> late for getting these patches in for v3.5.
>>
>> I still have a dependency on my previous pull request which is pending
>> for the patch you mentioned. Do you think we should leave "_SUBDEV"
>> in subdev selection target names for now (/ever) ?
>
> I started working on removing the SUBDEV_ in between but I agree with you,
> there seems to be more than just a tiny bit of documentation work. It may be
> we'll go past 3.5 in doing that.
>
> I think the most important change was to get rid or ACTUAL/ACTIVE anyway.
> What we could do is that we postpone this change after 3.5 (to 3.6) and
> perhaps keep the old subdev targets around awhile.
>
> In my opinion the user space may (or perhaps even should) begin using the
> V4L2 targets already, but in kernel we'll use the existing subdev targets
> before the removal patch is eventually ready.
That sounds good to me.
> This is primarily a documentation change after all.
>
> Could you rebase your exposure metering target definition patch on top of
> the _ACTUAL/_ACTIVE removal patches?
It's not the focus targets patches that would cause conflicts, I have
postponed them to 3.6. It's just the last patch from this series:
http://git.infradead.org/users/kmpark/linux-samsung/shortlog/refs/heads/v4l-fimc-exynos4x12
What I could do is just to apply the selection rename patch before it
and to resend whole pull request again. I'll try to do it tomorrow.
--
Best regards,
Sylwester
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-05-17 23:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-14 17:17 [PATCH] V4L: Rename V4L2_SEL_TGT_[CROP/COMPOSE]_ACTIVE to V4L2_SEL_TGT_[CROP/COMPOSE] Sylwester Nawrocki
2012-05-14 23:21 ` Laurent Pinchart
2012-05-17 21:04 ` Sakari Ailus
2012-05-17 21:15 ` [PATCH 1/1] v4l: Remove "_ACTUAL" from subdev selection API target definition names Sakari Ailus
2012-05-17 21:37 ` Sylwester Nawrocki
2012-05-17 22:35 ` Sakari Ailus
2012-05-17 23:07 ` Sylwester Nawrocki
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).