Commit fe7fd489 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mauro Carvalho Chehab

V4L/DVB (12523): tw9910: return updated geometry on successful S_FMT and S_CROP

Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 0f6b0697
...@@ -699,6 +699,11 @@ static int tw9910_set_crop(struct soc_camera_device *icd, ...@@ -699,6 +699,11 @@ static int tw9910_set_crop(struct soc_camera_device *icd,
if (ret < 0) if (ret < 0)
goto tw9910_set_fmt_error; goto tw9910_set_fmt_error;
rect->width = priv->scale->width;
rect->height = priv->scale->height;
rect->left = 0;
rect->top = 0;
return ret; return ret;
tw9910_set_fmt_error: tw9910_set_fmt_error:
...@@ -720,7 +725,7 @@ static int tw9910_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) ...@@ -720,7 +725,7 @@ static int tw9910_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
.width = pix->width, .width = pix->width,
.height = pix->height, .height = pix->height,
}; };
int i; int i, ret;
/* /*
* check color format * check color format
...@@ -732,7 +737,12 @@ static int tw9910_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) ...@@ -732,7 +737,12 @@ static int tw9910_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
if (i == ARRAY_SIZE(tw9910_color_fmt)) if (i == ARRAY_SIZE(tw9910_color_fmt))
return -EINVAL; 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) static int tw9910_try_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
......
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