V4L/DVB (12523): tw9910: return updated geometry on successful S_FMT and S_CROP
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Tue, 25 Aug 2009 14:46:52 +0000 (11:46 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 19 Sep 2009 03:18:56 +0000 (00:18 -0300)
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/tw9910.c

index 7199e0f71b2a317a5480b99182a7af1ed48031b0..83596cbc9b9823a8e146131b486a14eae0c4d6de 100644 (file)
@@ -699,6 +699,11 @@ static int tw9910_set_crop(struct soc_camera_device *icd,
        if (ret < 0)
                goto tw9910_set_fmt_error;
 
+       rect->width = priv->scale->width;
+       rect->height = priv->scale->height;
+       rect->left = 0;
+       rect->top = 0;
+
        return ret;
 
 tw9910_set_fmt_error:
@@ -720,7 +725,7 @@ static int tw9910_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
                .width  = pix->width,
                .height = pix->height,
        };
-       int i;
+       int i, ret;
 
        /*
         * check color format
@@ -732,7 +737,12 @@ static int tw9910_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
        if (i == ARRAY_SIZE(tw9910_color_fmt))
                return -EINVAL;
 
-       return tw9910_set_crop(icd, &rect);
+       ret = tw9910_set_crop(icd, &rect);
+       if (!ret) {
+               pix->width = rect.width;
+               pix->height = rect.height;
+       }
+       return ret;
 }
 
 static int tw9910_try_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)