aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorSylwester Nawrocki <sylvester.nawrocki@gmail.com>2012-05-20 10:17:12 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-07-06 19:13:30 -0400
commitc133482300113b3b71fa4a1fd2118531e765b36a (patch)
tree795edef9f10d5016c64edf1e7959669b26d7bf51 /drivers/media
parent936148a71e5e55a301b274e98b0ad8b246a6f11b (diff)
[media] V4L: Remove "_ACTIVE" from the selection target name definitions
This patch drops the _ACTIVE part from the selection target names as a prerequisite to unify the selection target names across the subdev and regular video node API. 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. For some system configurations different names may lead to interoperability issues. For backwards compatibility V4L2_SEL_TGT_CROP_ACTIVE and V4L2_SEL_TGT_COMPOSE_ACTIVE are defined as aliases to V4L2_SEL_TGT_CROP and V4L2_SEL_TGT_COMPOSE. These aliases will be removed after deprecation period, according to Documentation/feature-removal-schedule.txt. 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> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/s5p-fimc/fimc-capture.c14
-rw-r--r--drivers/media/video/s5p-fimc/fimc-lite.c4
-rw-r--r--drivers/media/video/s5p-jpeg/jpeg-core.c4
-rw-r--r--drivers/media/video/s5p-tv/mixer_video.c8
4 files changed, 15 insertions, 15 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c
index 62ce5399c4cf..a3cd78d33913 100644
--- a/drivers/media/video/s5p-fimc/fimc-capture.c
+++ b/drivers/media/video/s5p-fimc/fimc-capture.c
@@ -655,7 +655,7 @@ static void fimc_capture_try_selection(struct fimc_ctx *ctx,
655 r->left = r->top = 0; 655 r->left = r->top = 0;
656 return; 656 return;
657 } 657 }
658 if (target == V4L2_SEL_TGT_COMPOSE_ACTIVE) { 658 if (target == V4L2_SEL_TGT_COMPOSE) {
659 if (ctx->rotation != 90 && ctx->rotation != 270) 659 if (ctx->rotation != 90 && ctx->rotation != 270)
660 align_h = 1; 660 align_h = 1;
661 max_sc_h = min(SCALER_MAX_HRATIO, 1 << (ffs(sink->width) - 3)); 661 max_sc_h = min(SCALER_MAX_HRATIO, 1 << (ffs(sink->width) - 3));
@@ -682,7 +682,7 @@ static void fimc_capture_try_selection(struct fimc_ctx *ctx,
682 rotate ? sink->f_height : sink->f_width); 682 rotate ? sink->f_height : sink->f_width);
683 max_h = min_t(u32, FIMC_CAMIF_MAX_HEIGHT, sink->f_height); 683 max_h = min_t(u32, FIMC_CAMIF_MAX_HEIGHT, sink->f_height);
684 684
685 if (target == V4L2_SEL_TGT_COMPOSE_ACTIVE) { 685 if (target == V4L2_SEL_TGT_COMPOSE) {
686 min_w = min_t(u32, max_w, sink->f_width / max_sc_h); 686 min_w = min_t(u32, max_w, sink->f_width / max_sc_h);
687 min_h = min_t(u32, max_h, sink->f_height / max_sc_v); 687 min_h = min_t(u32, max_h, sink->f_height / max_sc_v);
688 if (rotate) { 688 if (rotate) {
@@ -1147,9 +1147,9 @@ static int fimc_cap_g_selection(struct file *file, void *fh,
1147 s->r.height = f->o_height; 1147 s->r.height = f->o_height;
1148 return 0; 1148 return 0;
1149 1149
1150 case V4L2_SEL_TGT_COMPOSE_ACTIVE: 1150 case V4L2_SEL_TGT_COMPOSE:
1151 f = &ctx->d_frame; 1151 f = &ctx->d_frame;
1152 case V4L2_SEL_TGT_CROP_ACTIVE: 1152 case V4L2_SEL_TGT_CROP:
1153 s->r.left = f->offs_h; 1153 s->r.left = f->offs_h;
1154 s->r.top = f->offs_v; 1154 s->r.top = f->offs_v;
1155 s->r.width = f->width; 1155 s->r.width = f->width;
@@ -1185,9 +1185,9 @@ static int fimc_cap_s_selection(struct file *file, void *fh,
1185 if (s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) 1185 if (s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
1186 return -EINVAL; 1186 return -EINVAL;
1187 1187
1188 if (s->target == V4L2_SEL_TGT_COMPOSE_ACTIVE) 1188 if (s->target == V4L2_SEL_TGT_COMPOSE)
1189 f = &ctx->d_frame; 1189 f = &ctx->d_frame;
1190 else if (s->target == V4L2_SEL_TGT_CROP_ACTIVE) 1190 else if (s->target == V4L2_SEL_TGT_CROP)
1191 f = &ctx->s_frame; 1191 f = &ctx->s_frame;
1192 else 1192 else
1193 return -EINVAL; 1193 return -EINVAL;
@@ -1483,7 +1483,7 @@ static int fimc_subdev_set_selection(struct v4l2_subdev *sd,
1483 return -EINVAL; 1483 return -EINVAL;
1484 1484
1485 mutex_lock(&fimc->lock); 1485 mutex_lock(&fimc->lock);
1486 fimc_capture_try_selection(ctx, r, V4L2_SEL_TGT_CROP_ACTIVE); 1486 fimc_capture_try_selection(ctx, r, V4L2_SEL_TGT_CROP);
1487 1487
1488 switch (sel->target) { 1488 switch (sel->target) {
1489 case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS: 1489 case V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS:
diff --git a/drivers/media/video/s5p-fimc/fimc-lite.c b/drivers/media/video/s5p-fimc/fimc-lite.c
index 400d701aef04..52ede56e0758 100644
--- a/drivers/media/video/s5p-fimc/fimc-lite.c
+++ b/drivers/media/video/s5p-fimc/fimc-lite.c
@@ -871,7 +871,7 @@ static int fimc_lite_g_selection(struct file *file, void *fh,
871 sel->r.height = f->f_height; 871 sel->r.height = f->f_height;
872 return 0; 872 return 0;
873 873
874 case V4L2_SEL_TGT_COMPOSE_ACTIVE: 874 case V4L2_SEL_TGT_COMPOSE:
875 sel->r = f->rect; 875 sel->r = f->rect;
876 return 0; 876 return 0;
877 } 877 }
@@ -888,7 +888,7 @@ static int fimc_lite_s_selection(struct file *file, void *fh,
888 unsigned long flags; 888 unsigned long flags;
889 889
890 if (sel->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE || 890 if (sel->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ||
891 sel->target != V4L2_SEL_TGT_COMPOSE_ACTIVE) 891 sel->target != V4L2_SEL_TGT_COMPOSE)
892 return -EINVAL; 892 return -EINVAL;
893 893
894 fimc_lite_try_compose(fimc, &rect); 894 fimc_lite_try_compose(fimc, &rect);
diff --git a/drivers/media/video/s5p-jpeg/jpeg-core.c b/drivers/media/video/s5p-jpeg/jpeg-core.c
index e40e79b33df6..95f23024b17d 100644
--- a/drivers/media/video/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/video/s5p-jpeg/jpeg-core.c
@@ -824,10 +824,10 @@ static int s5p_jpeg_g_selection(struct file *file, void *priv,
824 824
825 /* For JPEG blob active == default == bounds */ 825 /* For JPEG blob active == default == bounds */
826 switch (s->target) { 826 switch (s->target) {
827 case V4L2_SEL_TGT_CROP_ACTIVE: 827 case V4L2_SEL_TGT_CROP:
828 case V4L2_SEL_TGT_CROP_BOUNDS: 828 case V4L2_SEL_TGT_CROP_BOUNDS:
829 case V4L2_SEL_TGT_CROP_DEFAULT: 829 case V4L2_SEL_TGT_CROP_DEFAULT:
830 case V4L2_SEL_TGT_COMPOSE_ACTIVE: 830 case V4L2_SEL_TGT_COMPOSE:
831 case V4L2_SEL_TGT_COMPOSE_DEFAULT: 831 case V4L2_SEL_TGT_COMPOSE_DEFAULT:
832 s->r.width = ctx->out_q.w; 832 s->r.width = ctx->out_q.w;
833 s->r.height = ctx->out_q.h; 833 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 33fde2a763ec..6c74b05d1f95 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,
367 return -EINVAL; 367 return -EINVAL;
368 368
369 switch (s->target) { 369 switch (s->target) {
370 case V4L2_SEL_TGT_CROP_ACTIVE: 370 case V4L2_SEL_TGT_CROP:
371 s->r.left = geo->src.x_offset; 371 s->r.left = geo->src.x_offset;
372 s->r.top = geo->src.y_offset; 372 s->r.top = geo->src.y_offset;
373 s->r.width = geo->src.width; 373 s->r.width = geo->src.width;
@@ -380,7 +380,7 @@ static int mxr_g_selection(struct file *file, void *fh,
380 s->r.width = geo->src.full_width; 380 s->r.width = geo->src.full_width;
381 s->r.height = geo->src.full_height; 381 s->r.height = geo->src.full_height;
382 break; 382 break;
383 case V4L2_SEL_TGT_COMPOSE_ACTIVE: 383 case V4L2_SEL_TGT_COMPOSE:
384 case V4L2_SEL_TGT_COMPOSE_PADDED: 384 case V4L2_SEL_TGT_COMPOSE_PADDED:
385 s->r.left = geo->dst.x_offset; 385 s->r.left = geo->dst.x_offset;
386 s->r.top = geo->dst.y_offset; 386 s->r.top = geo->dst.y_offset;
@@ -449,11 +449,11 @@ static int mxr_s_selection(struct file *file, void *fh,
449 res.height = geo->dst.full_height; 449 res.height = geo->dst.full_height;
450 break; 450 break;
451 451
452 case V4L2_SEL_TGT_CROP_ACTIVE: 452 case V4L2_SEL_TGT_CROP:
453 target = &geo->src; 453 target = &geo->src;
454 stage = MXR_GEOMETRY_CROP; 454 stage = MXR_GEOMETRY_CROP;
455 break; 455 break;
456 case V4L2_SEL_TGT_COMPOSE_ACTIVE: 456 case V4L2_SEL_TGT_COMPOSE:
457 case V4L2_SEL_TGT_COMPOSE_PADDED: 457 case V4L2_SEL_TGT_COMPOSE_PADDED:
458 target = &geo->dst; 458 target = &geo->dst;
459 stage = MXR_GEOMETRY_COMPOSE; 459 stage = MXR_GEOMETRY_COMPOSE;