aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2012-05-17 16:50:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-07-06 19:14:39 -0400
commit1ec0ed083988ae433305d7f4158fda8c3a1a23b9 (patch)
treeaad35d1ee8bed6a1851fdffa7a4ffd9570f17787
parentc133482300113b3b71fa4a1fd2118531e765b36a (diff)
[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: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--Documentation/DocBook/media/v4l/dev-subdev.xml28
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml12
-rw-r--r--drivers/media/video/omap3isp/ispccdc.c4
-rw-r--r--drivers/media/video/omap3isp/isppreview.c4
-rw-r--r--drivers/media/video/omap3isp/ispresizer.c4
-rw-r--r--drivers/media/video/smiapp/smiapp-core.c22
-rw-r--r--drivers/media/video/v4l2-subdev.c4
-rw-r--r--include/linux/v4l2-subdev.h9
8 files changed, 46 insertions, 41 deletions
diff --git a/Documentation/DocBook/media/v4l/dev-subdev.xml b/Documentation/DocBook/media/v4l/dev-subdev.xml
index 4afcbbec5eda..e88d5ea8f826 100644
--- a/Documentation/DocBook/media/v4l/dev-subdev.xml
+++ b/Documentation/DocBook/media/v4l/dev-subdev.xml
@@ -289,9 +289,9 @@
289 &v4l2-rect; by the coordinates of the top left corner and the rectangle 289 &v4l2-rect; by the coordinates of the top left corner and the rectangle
290 size. Both the coordinates and sizes are expressed in pixels.</para> 290 size. Both the coordinates and sizes are expressed in pixels.</para>
291 291
292 <para>As for pad formats, drivers store try and active 292 <para>As for pad formats, drivers store try and active rectangles for
293 rectangles for the selection targets of ACTUAL type <xref 293 the selection targets <xref
294 linkend="v4l2-subdev-selection-targets">.</xref></para> 294 linkend="v4l2-subdev-selection-targets" />.</para>
295 295
296 <para>On sink pads, cropping is applied relative to the 296 <para>On sink pads, cropping is applied relative to the
297 current pad format. The pad format represents the image size as 297 current pad format. The pad format represents the image size as
@@ -308,7 +308,7 @@
308 <para>Scaling support is optional. When supported by a subdev, 308 <para>Scaling support is optional. When supported by a subdev,
309 the crop rectangle on the subdev's sink pad is scaled to the 309 the crop rectangle on the subdev's sink pad is scaled to the
310 size configured using the &VIDIOC-SUBDEV-S-SELECTION; IOCTL 310 size configured using the &VIDIOC-SUBDEV-S-SELECTION; IOCTL
311 using <constant>V4L2_SUBDEV_SEL_COMPOSE_ACTUAL</constant> 311 using <constant>V4L2_SUBDEV_SEL_TGT_COMPOSE</constant>
312 selection target on the same pad. If the subdev supports scaling 312 selection target on the same pad. If the subdev supports scaling
313 but not composing, the top and left values are not used and must 313 but not composing, the top and left values are not used and must
314 always be set to zero.</para> 314 always be set to zero.</para>
@@ -333,22 +333,22 @@
333 <title>Types of selection targets</title> 333 <title>Types of selection targets</title>
334 334
335 <section> 335 <section>
336 <title>ACTUAL targets</title> 336 <title>Actual targets</title>
337 337
338 <para>ACTUAL targets reflect the actual hardware configuration 338 <para>Actual targets (without a postfix) reflect the actual
339 at any point of time. There is a BOUNDS target 339 hardware configuration at any point of time. There is a BOUNDS
340 corresponding to every ACTUAL.</para> 340 target corresponding to every actual target.</para>
341 </section> 341 </section>
342 342
343 <section> 343 <section>
344 <title>BOUNDS targets</title> 344 <title>BOUNDS targets</title>
345 345
346 <para>BOUNDS targets is the smallest rectangle that contains 346 <para>BOUNDS targets is the smallest rectangle that contains all
347 all valid ACTUAL rectangles. It may not be possible to set the 347 valid actual rectangles. It may not be possible to set the actual
348 ACTUAL rectangle as large as the BOUNDS rectangle, however. 348 rectangle as large as the BOUNDS rectangle, however. This may be
349 This may be because e.g. a sensor's pixel array is not 349 because e.g. a sensor's pixel array is not rectangular but
350 rectangular but cross-shaped or round. The maximum size may 350 cross-shaped or round. The maximum size may also be smaller than the
351 also be smaller than the BOUNDS rectangle.</para> 351 BOUNDS rectangle.</para>
352 </section> 352 </section>
353 353
354 </section> 354 </section>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
index 208e9f0da3f3..4c44808ab25c 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 @@
72 <section> 72 <section>
73 <title>Types of selection targets</title> 73 <title>Types of selection targets</title>
74 74
75 <para>There are two types of selection targets: actual and bounds. 75 <para>There are two types of selection targets: actual and bounds. The
76 The ACTUAL targets are the targets which configure the hardware. 76 actual targets are the targets which configure the hardware. The BOUNDS
77 The BOUNDS target will return a rectangle that contain all 77 target will return a rectangle that contain all possible actual
78 possible ACTUAL rectangles.</para> 78 rectangles.</para>
79 </section> 79 </section>
80 80
81 <section> 81 <section>
@@ -93,7 +93,7 @@
93 &cs-def; 93 &cs-def;
94 <tbody valign="top"> 94 <tbody valign="top">
95 <row> 95 <row>
96 <entry><constant>V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL</constant></entry> 96 <entry><constant>V4L2_SUBDEV_SEL_TGT_CROP</constant></entry>
97 <entry>0x0000</entry> 97 <entry>0x0000</entry>
98 <entry>Actual crop. Defines the cropping 98 <entry>Actual crop. Defines the cropping
99 performed by the processing step.</entry> 99 performed by the processing step.</entry>
@@ -104,7 +104,7 @@
104 <entry>Bounds of the crop rectangle.</entry> 104 <entry>Bounds of the crop rectangle.</entry>
105 </row> 105 </row>
106 <row> 106 <row>
107 <entry><constant>V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL</constant></entry> 107 <entry><constant>V4L2_SUBDEV_SEL_TGT_COMPOSE</constant></entry>
108 <entry>0x0100</entry> 108 <entry>0x0100</entry>
109 <entry>Actual compose rectangle. Used to configure scaling 109 <entry>Actual compose rectangle. Used to configure scaling
110 on sink pads and composition on source pads.</entry> 110 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 7e32331b60fb..f19774f8396a 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,
2024 ccdc_try_crop(ccdc, format, &sel->r); 2024 ccdc_try_crop(ccdc, format, &sel->r);
2025 break; 2025 break;
2026 2026
2027 case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: 2027 case V4L2_SUBDEV_SEL_TGT_CROP:
2028 sel->r = *__ccdc_get_crop(ccdc, fh, sel->which); 2028 sel->r = *__ccdc_get_crop(ccdc, fh, sel->which);
2029 break; 2029 break;
2030 2030
@@ -2052,7 +2052,7 @@ static int ccdc_set_selection(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
2052 struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd); 2052 struct isp_ccdc_device *ccdc = v4l2_get_subdevdata(sd);
2053 struct v4l2_mbus_framefmt *format; 2053 struct v4l2_mbus_framefmt *format;
2054 2054
2055 if (sel->target != V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL || 2055 if (sel->target != V4L2_SUBDEV_SEL_TGT_CROP ||
2056 sel->pad != CCDC_PAD_SOURCE_OF) 2056 sel->pad != CCDC_PAD_SOURCE_OF)
2057 return -EINVAL; 2057 return -EINVAL;
2058 2058
diff --git a/drivers/media/video/omap3isp/isppreview.c b/drivers/media/video/omap3isp/isppreview.c
index 8a4935ecc655..1086f6a9ff76 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,
1960 preview_try_crop(prev, format, &sel->r); 1960 preview_try_crop(prev, format, &sel->r);
1961 break; 1961 break;
1962 1962
1963 case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: 1963 case V4L2_SUBDEV_SEL_TGT_CROP:
1964 sel->r = *__preview_get_crop(prev, fh, sel->which); 1964 sel->r = *__preview_get_crop(prev, fh, sel->which);
1965 break; 1965 break;
1966 1966
@@ -1988,7 +1988,7 @@ static int preview_set_selection(struct v4l2_subdev *sd,
1988 struct isp_prev_device *prev = v4l2_get_subdevdata(sd); 1988 struct isp_prev_device *prev = v4l2_get_subdevdata(sd);
1989 struct v4l2_mbus_framefmt *format; 1989 struct v4l2_mbus_framefmt *format;
1990 1990
1991 if (sel->target != V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL || 1991 if (sel->target != V4L2_SUBDEV_SEL_TGT_CROP ||
1992 sel->pad != PREV_PAD_SINK) 1992 sel->pad != PREV_PAD_SINK)
1993 return -EINVAL; 1993 return -EINVAL;
1994 1994
diff --git a/drivers/media/video/omap3isp/ispresizer.c b/drivers/media/video/omap3isp/ispresizer.c
index 14041c9c8643..945665295571 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,
1259 resizer_calc_ratios(res, &sel->r, format_source, &ratio); 1259 resizer_calc_ratios(res, &sel->r, format_source, &ratio);
1260 break; 1260 break;
1261 1261
1262 case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: 1262 case V4L2_SUBDEV_SEL_TGT_CROP:
1263 sel->r = *__resizer_get_crop(res, fh, sel->which); 1263 sel->r = *__resizer_get_crop(res, fh, sel->which);
1264 resizer_calc_ratios(res, &sel->r, format_source, &ratio); 1264 resizer_calc_ratios(res, &sel->r, format_source, &ratio);
1265 break; 1265 break;
@@ -1293,7 +1293,7 @@ static int resizer_set_selection(struct v4l2_subdev *sd,
1293 struct v4l2_mbus_framefmt *format_sink, *format_source; 1293 struct v4l2_mbus_framefmt *format_sink, *format_source;
1294 struct resizer_ratio ratio; 1294 struct resizer_ratio ratio;
1295 1295
1296 if (sel->target != V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL || 1296 if (sel->target != V4L2_SUBDEV_SEL_TGT_CROP ||
1297 sel->pad != RESZ_PAD_SINK) 1297 sel->pad != RESZ_PAD_SINK)
1298 return -EINVAL; 1298 return -EINVAL;
1299 1299
diff --git a/drivers/media/video/smiapp/smiapp-core.c b/drivers/media/video/smiapp/smiapp-core.c
index e8c93c89265a..37622bb6c667 100644
--- a/drivers/media/video/smiapp/smiapp-core.c
+++ b/drivers/media/video/smiapp/smiapp-core.c
@@ -1630,7 +1630,7 @@ static void smiapp_propagate(struct v4l2_subdev *subdev,
1630 smiapp_get_crop_compose(subdev, fh, crops, &comp, which); 1630 smiapp_get_crop_compose(subdev, fh, crops, &comp, which);
1631 1631
1632 switch (target) { 1632 switch (target) {
1633 case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: 1633 case V4L2_SUBDEV_SEL_TGT_CROP:
1634 comp->width = crops[SMIAPP_PAD_SINK]->width; 1634 comp->width = crops[SMIAPP_PAD_SINK]->width;
1635 comp->height = crops[SMIAPP_PAD_SINK]->height; 1635 comp->height = crops[SMIAPP_PAD_SINK]->height;
1636 if (which == V4L2_SUBDEV_FORMAT_ACTIVE) { 1636 if (which == V4L2_SUBDEV_FORMAT_ACTIVE) {
@@ -1646,7 +1646,7 @@ static void smiapp_propagate(struct v4l2_subdev *subdev,
1646 } 1646 }
1647 } 1647 }
1648 /* Fall through */ 1648 /* Fall through */
1649 case V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL: 1649 case V4L2_SUBDEV_SEL_TGT_COMPOSE:
1650 *crops[SMIAPP_PAD_SRC] = *comp; 1650 *crops[SMIAPP_PAD_SRC] = *comp;
1651 break; 1651 break;
1652 default: 1652 default:
@@ -1722,7 +1722,7 @@ static int smiapp_set_format(struct v4l2_subdev *subdev,
1722 if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) 1722 if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE)
1723 ssd->sink_fmt = *crops[ssd->sink_pad]; 1723 ssd->sink_fmt = *crops[ssd->sink_pad];
1724 smiapp_propagate(subdev, fh, fmt->which, 1724 smiapp_propagate(subdev, fh, fmt->which,
1725 V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL); 1725 V4L2_SUBDEV_SEL_TGT_CROP);
1726 1726
1727 mutex_unlock(&sensor->mutex); 1727 mutex_unlock(&sensor->mutex);
1728 1728
@@ -1957,7 +1957,7 @@ static int smiapp_set_compose(struct v4l2_subdev *subdev,
1957 1957
1958 *comp = sel->r; 1958 *comp = sel->r;
1959 smiapp_propagate(subdev, fh, sel->which, 1959 smiapp_propagate(subdev, fh, sel->which,
1960 V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL); 1960 V4L2_SUBDEV_SEL_TGT_COMPOSE);
1961 1961
1962 if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE) 1962 if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE)
1963 return smiapp_update_mode(sensor); 1963 return smiapp_update_mode(sensor);
@@ -1973,7 +1973,7 @@ static int __smiapp_sel_supported(struct v4l2_subdev *subdev,
1973 1973
1974 /* We only implement crop in three places. */ 1974 /* We only implement crop in three places. */
1975 switch (sel->target) { 1975 switch (sel->target) {
1976 case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: 1976 case V4L2_SUBDEV_SEL_TGT_CROP:
1977 case V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS: 1977 case V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS:
1978 if (ssd == sensor->pixel_array 1978 if (ssd == sensor->pixel_array
1979 && sel->pad == SMIAPP_PA_PAD_SRC) 1979 && sel->pad == SMIAPP_PA_PAD_SRC)
@@ -1987,7 +1987,7 @@ static int __smiapp_sel_supported(struct v4l2_subdev *subdev,
1987 == SMIAPP_DIGITAL_CROP_CAPABILITY_INPUT_CROP) 1987 == SMIAPP_DIGITAL_CROP_CAPABILITY_INPUT_CROP)
1988 return 0; 1988 return 0;
1989 return -EINVAL; 1989 return -EINVAL;
1990 case V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL: 1990 case V4L2_SUBDEV_SEL_TGT_COMPOSE:
1991 case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS: 1991 case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS:
1992 if (sel->pad == ssd->source_pad) 1992 if (sel->pad == ssd->source_pad)
1993 return -EINVAL; 1993 return -EINVAL;
@@ -2050,7 +2050,7 @@ static int smiapp_set_crop(struct v4l2_subdev *subdev,
2050 2050
2051 if (ssd != sensor->pixel_array && sel->pad == SMIAPP_PAD_SINK) 2051 if (ssd != sensor->pixel_array && sel->pad == SMIAPP_PAD_SINK)
2052 smiapp_propagate(subdev, fh, sel->which, 2052 smiapp_propagate(subdev, fh, sel->which,
2053 V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL); 2053 V4L2_SUBDEV_SEL_TGT_CROP);
2054 2054
2055 return 0; 2055 return 0;
2056} 2056}
@@ -2096,11 +2096,11 @@ static int __smiapp_get_selection(struct v4l2_subdev *subdev,
2096 sel->r = *comp; 2096 sel->r = *comp;
2097 } 2097 }
2098 break; 2098 break;
2099 case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: 2099 case V4L2_SUBDEV_SEL_TGT_CROP:
2100 case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS: 2100 case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS:
2101 sel->r = *crops[sel->pad]; 2101 sel->r = *crops[sel->pad];
2102 break; 2102 break;
2103 case V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL: 2103 case V4L2_SUBDEV_SEL_TGT_COMPOSE:
2104 sel->r = *comp; 2104 sel->r = *comp;
2105 break; 2105 break;
2106 } 2106 }
@@ -2147,10 +2147,10 @@ static int smiapp_set_selection(struct v4l2_subdev *subdev,
2147 sel->r.height); 2147 sel->r.height);
2148 2148
2149 switch (sel->target) { 2149 switch (sel->target) {
2150 case V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL: 2150 case V4L2_SUBDEV_SEL_TGT_CROP:
2151 ret = smiapp_set_crop(subdev, fh, sel); 2151 ret = smiapp_set_crop(subdev, fh, sel);
2152 break; 2152 break;
2153 case V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL: 2153 case V4L2_SUBDEV_SEL_TGT_COMPOSE:
2154 ret = smiapp_set_compose(subdev, fh, sel); 2154 ret = smiapp_set_compose(subdev, fh, sel);
2155 break; 2155 break;
2156 default: 2156 default:
diff --git a/drivers/media/video/v4l2-subdev.c b/drivers/media/video/v4l2-subdev.c
index db6e859b93d4..cd86f0c3ec74 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)
245 memset(&sel, 0, sizeof(sel)); 245 memset(&sel, 0, sizeof(sel));
246 sel.which = crop->which; 246 sel.which = crop->which;
247 sel.pad = crop->pad; 247 sel.pad = crop->pad;
248 sel.target = V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL; 248 sel.target = V4L2_SUBDEV_SEL_TGT_CROP;
249 249
250 rval = v4l2_subdev_call( 250 rval = v4l2_subdev_call(
251 sd, pad, get_selection, subdev_fh, &sel); 251 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 memset(&sel, 0, sizeof(sel)); 274 memset(&sel, 0, sizeof(sel));
275 sel.which = crop->which; 275 sel.which = crop->which;
276 sel.pad = crop->pad; 276 sel.pad = crop->pad;
277 sel.target = V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL; 277 sel.target = V4L2_SUBDEV_SEL_TGT_CROP;
278 sel.r = crop->rect; 278 sel.r = crop->rect;
279 279
280 rval = v4l2_subdev_call( 280 rval = v4l2_subdev_call(
diff --git a/include/linux/v4l2-subdev.h b/include/linux/v4l2-subdev.h
index 812019ee1e06..3cbe6889fcb5 100644
--- a/include/linux/v4l2-subdev.h
+++ b/include/linux/v4l2-subdev.h
@@ -128,14 +128,19 @@ struct v4l2_subdev_frame_interval_enum {
128#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG (1 << 2) 128#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG (1 << 2)
129 129
130/* active cropping area */ 130/* active cropping area */
131#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL 0x0000 131#define V4L2_SUBDEV_SEL_TGT_CROP 0x0000
132/* cropping bounds */ 132/* cropping bounds */
133#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS 0x0002 133#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS 0x0002
134/* current composing area */ 134/* current composing area */
135#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL 0x0100 135#define V4L2_SUBDEV_SEL_TGT_COMPOSE 0x0100
136/* composing bounds */ 136/* composing bounds */
137#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS 0x0102 137#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS 0x0102
138 138
139/* backward compatibility definitions */
140#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL \
141 V4L2_SUBDEV_SEL_TGT_CROP
142#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL \
143 V4L2_SUBDEV_SEL_TGT_COMPOSE
139 144
140/** 145/**
141 * struct v4l2_subdev_selection - selection info 146 * struct v4l2_subdev_selection - selection info