[media] s5p-jpeg: fix g_selection op
authorJacek Anaszewski <j.anaszewski@samsung.com>
Fri, 11 Jul 2014 15:19:45 +0000 (12:19 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Wed, 30 Jul 2014 22:17:43 +0000 (19:17 -0300)
V4L2_SEL_TGT_COMPOSE_DEFAULT switch case should select whole
available area of the image and V4L2_SEL_TGT_COMPOSE
should apply user settings.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/platform/s5p-jpeg/jpeg-core.c

index 5ef7f5b1e8297bd1417b54fbf5e8f1e0af01a938..d11357f5fc45da87648309aaf95407664bf5610d 100644 (file)
@@ -1505,21 +1505,23 @@ static int s5p_jpeg_g_selection(struct file *file, void *priv,
        case V4L2_SEL_TGT_CROP:
        case V4L2_SEL_TGT_CROP_BOUNDS:
        case V4L2_SEL_TGT_CROP_DEFAULT:
-       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;
+               s->r.left = 0;
+               s->r.top = 0;
                break;
+       case V4L2_SEL_TGT_COMPOSE:
        case V4L2_SEL_TGT_COMPOSE_BOUNDS:
        case V4L2_SEL_TGT_COMPOSE_PADDED:
-               s->r.width = ctx->cap_q.w;
-               s->r.height = ctx->cap_q.h;
+               s->r.width = ctx->crop_rect.width;
+               s->r.height =  ctx->crop_rect.height;
+               s->r.left = ctx->crop_rect.left;
+               s->r.top = ctx->crop_rect.top;
                break;
        default:
                return -EINVAL;
        }
-       s->r.left = 0;
-       s->r.top = 0;
        return 0;
 }