Commit 1ec0ed08 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

[media] v4l: Remove "_ACTUAL" from subdev selection API target definition names

The string "_ACTUAL" does not say anything more about the target names. Drop
it. V4L2 selection API was changed by "V4L: Remove "_ACTIVE" from the
selection target name definitions" by Sylwester Nawrocki. This patch does
the same for the V4L2 subdev API.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@iki.fi>
Acked-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c1334823
...@@ -289,9 +289,9 @@ ...@@ -289,9 +289,9 @@
&v4l2-rect; by the coordinates of the top left corner and the rectangle &v4l2-rect; by the coordinates of the top left corner and the rectangle
size. Both the coordinates and sizes are expressed in pixels.</para> size. Both the coordinates and sizes are expressed in pixels.</para>
<para>As for pad formats, drivers store try and active <para>As for pad formats, drivers store try and active rectangles for
rectangles for the selection targets of ACTUAL type <xref the selection targets <xref
linkend="v4l2-subdev-selection-targets">.</xref></para> linkend="v4l2-subdev-selection-targets" />.</para>
<para>On sink pads, cropping is applied relative to the <para>On sink pads, cropping is applied relative to the
current pad format. The pad format represents the image size as current pad format. The pad format represents the image size as
...@@ -308,7 +308,7 @@ ...@@ -308,7 +308,7 @@
<para>Scaling support is optional. When supported by a subdev, <para>Scaling support is optional. When supported by a subdev,
the crop rectangle on the subdev's sink pad is scaled to the the crop rectangle on the subdev's sink pad is scaled to the
size configured using the &VIDIOC-SUBDEV-S-SELECTION; IOCTL 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 selection target on the same pad. If the subdev supports scaling
but not composing, the top and left values are not used and must but not composing, the top and left values are not used and must
always be set to zero.</para> always be set to zero.</para>
...@@ -333,22 +333,22 @@ ...@@ -333,22 +333,22 @@
<title>Types of selection targets</title> <title>Types of selection targets</title>
<section> <section>
<title>ACTUAL targets</title> <title>Actual targets</title>
<para>ACTUAL targets reflect the actual hardware configuration <para>Actual targets (without a postfix) reflect the actual
at any point of time. There is a BOUNDS target hardware configuration at any point of time. There is a BOUNDS
corresponding to every ACTUAL.</para> target corresponding to every actual target.</para>
</section> </section>
<section> <section>
<title>BOUNDS targets</title> <title>BOUNDS targets</title>
<para>BOUNDS targets is the smallest rectangle that contains <para>BOUNDS targets is the smallest rectangle that contains all
all valid ACTUAL rectangles. It may not be possible to set the valid actual rectangles. It may not be possible to set the actual
ACTUAL rectangle as large as the BOUNDS rectangle, however. rectangle as large as the BOUNDS rectangle, however. This may be
This may be because e.g. a sensor's pixel array is not because e.g. a sensor's pixel array is not rectangular but
rectangular but cross-shaped or round. The maximum size may cross-shaped or round. The maximum size may also be smaller than the
also be smaller than the BOUNDS rectangle.</para> BOUNDS rectangle.</para>
</section> </section>
</section> </section>
......
...@@ -72,10 +72,10 @@ ...@@ -72,10 +72,10 @@
<section> <section>
<title>Types of selection targets</title> <title>Types of selection targets</title>
<para>There are two types of selection targets: actual and bounds. <para>There are two types of selection targets: actual and bounds. The
The ACTUAL targets are the targets which configure the hardware. actual targets are the targets which configure the hardware. The BOUNDS
The BOUNDS target will return a rectangle that contain all target will return a rectangle that contain all possible actual
possible ACTUAL rectangles.</para> rectangles.</para>
</section> </section>
<section> <section>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
&cs-def; &cs-def;
<tbody valign="top"> <tbody valign="top">
<row> <row>
<entry><constant>V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL</constant></entry> <entry><constant>V4L2_SUBDEV_SEL_TGT_CROP</constant></entry>
<entry>0x0000</entry> <entry>0x0000</entry>
<entry>Actual crop. Defines the cropping <entry>Actual crop. Defines the cropping
performed by the processing step.</entry> performed by the processing step.</entry>
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<entry>Bounds of the crop rectangle.</entry> <entry>Bounds of the crop rectangle.</entry>
</row> </row>
<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>0x0100</entry>
<entry>Actual compose rectangle. Used to configure scaling <entry>Actual compose rectangle. Used to configure scaling
on sink pads and composition on source pads.</entry> on sink pads and composition on source pads.</entry>
......
...@@ -2024,7 +2024,7 @@ static int ccdc_get_selection(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, ...@@ -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); ccdc_try_crop(ccdc, format, &sel->r);
break; break;
case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: case V4L2_SUBDEV_SEL_TGT_CROP:
sel->r = *__ccdc_get_crop(ccdc, fh, sel->which); sel->r = *__ccdc_get_crop(ccdc, fh, sel->which);
break; break;
...@@ -2052,7 +2052,7 @@ static int ccdc_set_selection(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, ...@@ -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 isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd);
struct v4l2_mbus_framefmt *format; 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) sel->pad != CCDC_PAD_SOURCE_OF)
return -EINVAL; return -EINVAL;
......
...@@ -1960,7 +1960,7 @@ static int preview_get_selection(struct v4l2_subdev *sd, ...@@ -1960,7 +1960,7 @@ static int preview_get_selection(struct v4l2_subdev *sd,
preview_try_crop(prev, format, &sel->r); preview_try_crop(prev, format, &sel->r);
break; break;
case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: case V4L2_SUBDEV_SEL_TGT_CROP:
sel->r = *__preview_get_crop(prev, fh, sel->which); sel->r = *__preview_get_crop(prev, fh, sel->which);
break; break;
...@@ -1988,7 +1988,7 @@ static int preview_set_selection(struct v4l2_subdev *sd, ...@@ -1988,7 +1988,7 @@ static int preview_set_selection(struct v4l2_subdev *sd,
struct isp_prev_device *prev = v4l2_get_subdevdata(sd); struct isp_prev_device *prev = v4l2_get_subdevdata(sd);
struct v4l2_mbus_framefmt *format; 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) sel->pad != PREV_PAD_SINK)
return -EINVAL; return -EINVAL;
......
...@@ -1259,7 +1259,7 @@ static int resizer_get_selection(struct v4l2_subdev *sd, ...@@ -1259,7 +1259,7 @@ static int resizer_get_selection(struct v4l2_subdev *sd,
resizer_calc_ratios(res, &sel->r, format_source, &ratio); resizer_calc_ratios(res, &sel->r, format_source, &ratio);
break; break;
case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: case V4L2_SUBDEV_SEL_TGT_CROP:
sel->r = *__resizer_get_crop(res, fh, sel->which); sel->r = *__resizer_get_crop(res, fh, sel->which);
resizer_calc_ratios(res, &sel->r, format_source, &ratio); resizer_calc_ratios(res, &sel->r, format_source, &ratio);
break; break;
...@@ -1293,7 +1293,7 @@ static int resizer_set_selection(struct v4l2_subdev *sd, ...@@ -1293,7 +1293,7 @@ static int resizer_set_selection(struct v4l2_subdev *sd,
struct v4l2_mbus_framefmt *format_sink, *format_source; struct v4l2_mbus_framefmt *format_sink, *format_source;
struct resizer_ratio ratio; 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) sel->pad != RESZ_PAD_SINK)
return -EINVAL; return -EINVAL;
......
...@@ -1630,7 +1630,7 @@ static void smiapp_propagate(struct v4l2_subdev *subdev, ...@@ -1630,7 +1630,7 @@ static void smiapp_propagate(struct v4l2_subdev *subdev,
smiapp_get_crop_compose(subdev, fh, crops, &comp, which); smiapp_get_crop_compose(subdev, fh, crops, &comp, which);
switch (target) { switch (target) {
case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: case V4L2_SUBDEV_SEL_TGT_CROP:
comp->width = crops[SMIAPP_PAD_SINK]->width; comp->width = crops[SMIAPP_PAD_SINK]->width;
comp->height = crops[SMIAPP_PAD_SINK]->height; comp->height = crops[SMIAPP_PAD_SINK]->height;
if (which == V4L2_SUBDEV_FORMAT_ACTIVE) { if (which == V4L2_SUBDEV_FORMAT_ACTIVE) {
...@@ -1646,7 +1646,7 @@ static void smiapp_propagate(struct v4l2_subdev *subdev, ...@@ -1646,7 +1646,7 @@ static void smiapp_propagate(struct v4l2_subdev *subdev,
} }
} }
/* Fall through */ /* Fall through */
case V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL: case V4L2_SUBDEV_SEL_TGT_COMPOSE:
*crops[SMIAPP_PAD_SRC] = *comp; *crops[SMIAPP_PAD_SRC] = *comp;
break; break;
default: default:
...@@ -1722,7 +1722,7 @@ static int smiapp_set_format(struct v4l2_subdev *subdev, ...@@ -1722,7 +1722,7 @@ static int smiapp_set_format(struct v4l2_subdev *subdev,
if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE)
ssd->sink_fmt = *crops[ssd->sink_pad]; ssd->sink_fmt = *crops[ssd->sink_pad];
smiapp_propagate(subdev, fh, fmt->which, smiapp_propagate(subdev, fh, fmt->which,
V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL); V4L2_SUBDEV_SEL_TGT_CROP);
mutex_unlock(&sensor->mutex); mutex_unlock(&sensor->mutex);
...@@ -1957,7 +1957,7 @@ static int smiapp_set_compose(struct v4l2_subdev *subdev, ...@@ -1957,7 +1957,7 @@ static int smiapp_set_compose(struct v4l2_subdev *subdev,
*comp = sel->r; *comp = sel->r;
smiapp_propagate(subdev, fh, sel->which, smiapp_propagate(subdev, fh, sel->which,
V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL); V4L2_SUBDEV_SEL_TGT_COMPOSE);
if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE) if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE)
return smiapp_update_mode(sensor); return smiapp_update_mode(sensor);
...@@ -1973,7 +1973,7 @@ static int __smiapp_sel_supported(struct v4l2_subdev *subdev, ...@@ -1973,7 +1973,7 @@ static int __smiapp_sel_supported(struct v4l2_subdev *subdev,
/* We only implement crop in three places. */ /* We only implement crop in three places. */
switch (sel->target) { switch (sel->target) {
case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: case V4L2_SUBDEV_SEL_TGT_CROP:
case V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS: case V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS:
if (ssd == sensor->pixel_array if (ssd == sensor->pixel_array
&& sel->pad == SMIAPP_PA_PAD_SRC) && sel->pad == SMIAPP_PA_PAD_SRC)
...@@ -1987,7 +1987,7 @@ static int __smiapp_sel_supported(struct v4l2_subdev *subdev, ...@@ -1987,7 +1987,7 @@ static int __smiapp_sel_supported(struct v4l2_subdev *subdev,
== SMIAPP_DIGITAL_CROP_CAPABILITY_INPUT_CROP) == SMIAPP_DIGITAL_CROP_CAPABILITY_INPUT_CROP)
return 0; return 0;
return -EINVAL; return -EINVAL;
case V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL: case V4L2_SUBDEV_SEL_TGT_COMPOSE:
case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS: case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS:
if (sel->pad == ssd->source_pad) if (sel->pad == ssd->source_pad)
return -EINVAL; return -EINVAL;
...@@ -2050,7 +2050,7 @@ static int smiapp_set_crop(struct v4l2_subdev *subdev, ...@@ -2050,7 +2050,7 @@ static int smiapp_set_crop(struct v4l2_subdev *subdev,
if (ssd != sensor->pixel_array && sel->pad == SMIAPP_PAD_SINK) if (ssd != sensor->pixel_array && sel->pad == SMIAPP_PAD_SINK)
smiapp_propagate(subdev, fh, sel->which, smiapp_propagate(subdev, fh, sel->which,
V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL); V4L2_SUBDEV_SEL_TGT_CROP);
return 0; return 0;
} }
...@@ -2096,11 +2096,11 @@ static int __smiapp_get_selection(struct v4l2_subdev *subdev, ...@@ -2096,11 +2096,11 @@ static int __smiapp_get_selection(struct v4l2_subdev *subdev,
sel->r = *comp; sel->r = *comp;
} }
break; break;
case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: case V4L2_SUBDEV_SEL_TGT_CROP:
case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS: case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS:
sel->r = *crops[sel->pad]; sel->r = *crops[sel->pad];
break; break;
case V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL: case V4L2_SUBDEV_SEL_TGT_COMPOSE:
sel->r = *comp; sel->r = *comp;
break; break;
} }
...@@ -2147,10 +2147,10 @@ static int smiapp_set_selection(struct v4l2_subdev *subdev, ...@@ -2147,10 +2147,10 @@ static int smiapp_set_selection(struct v4l2_subdev *subdev,
sel->r.height); sel->r.height);
switch (sel->target) { switch (sel->target) {
case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: case V4L2_SUBDEV_SEL_TGT_CROP:
ret = smiapp_set_crop(subdev, fh, sel); ret = smiapp_set_crop(subdev, fh, sel);
break; break;
case V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL: case V4L2_SUBDEV_SEL_TGT_COMPOSE:
ret = smiapp_set_compose(subdev, fh, sel); ret = smiapp_set_compose(subdev, fh, sel);
break; break;
default: default:
......
...@@ -245,7 +245,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg) ...@@ -245,7 +245,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
memset(&sel, 0, sizeof(sel)); memset(&sel, 0, sizeof(sel));
sel.which = crop->which; sel.which = crop->which;
sel.pad = crop->pad; sel.pad = crop->pad;
sel.target = V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL; sel.target = V4L2_SUBDEV_SEL_TGT_CROP;
rval = v4l2_subdev_call( rval = v4l2_subdev_call(
sd, pad, get_selection, subdev_fh, &sel); sd, pad, get_selection, subdev_fh, &sel);
...@@ -274,7 +274,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg) ...@@ -274,7 +274,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
memset(&sel, 0, sizeof(sel)); memset(&sel, 0, sizeof(sel));
sel.which = crop->which; sel.which = crop->which;
sel.pad = crop->pad; sel.pad = crop->pad;
sel.target = V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL; sel.target = V4L2_SUBDEV_SEL_TGT_CROP;
sel.r = crop->rect; sel.r = crop->rect;
rval = v4l2_subdev_call( rval = v4l2_subdev_call(
......
...@@ -128,14 +128,19 @@ struct v4l2_subdev_frame_interval_enum { ...@@ -128,14 +128,19 @@ struct v4l2_subdev_frame_interval_enum {
#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG (1 << 2) #define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG (1 << 2)
/* active cropping area */ /* active cropping area */
#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL 0x0000 #define V4L2_SUBDEV_SEL_TGT_CROP 0x0000
/* cropping bounds */ /* cropping bounds */
#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS 0x0002 #define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS 0x0002
/* current composing area */ /* current composing area */
#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL 0x0100 #define V4L2_SUBDEV_SEL_TGT_COMPOSE 0x0100
/* composing bounds */ /* composing bounds */
#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS 0x0102 #define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS 0x0102
/* backward compatibility definitions */
#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL \
V4L2_SUBDEV_SEL_TGT_CROP
#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL \
V4L2_SUBDEV_SEL_TGT_COMPOSE
/** /**
* struct v4l2_subdev_selection - selection info * struct v4l2_subdev_selection - selection info
......
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