mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 03:10:12 +00:00
[media] cx25840: relax a Vsrc check
The cx23888 reports a slightly different Vsrc value than the other chip variants do. Relax the check by 1, otherwise cx25840_set_fmt() would fail for the cx23888. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
ee61cd9f12
commit
499ebed3ec
1 changed files with 7 additions and 1 deletions
|
@ -1390,8 +1390,14 @@ static int cx25840_set_fmt(struct v4l2_subdev *sd,
|
||||||
|
|
||||||
Vlines = fmt->height + (is_50Hz ? 4 : 7);
|
Vlines = fmt->height + (is_50Hz ? 4 : 7);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We keep 1 margin for the Vsrc < Vlines check since the
|
||||||
|
* cx23888 reports a Vsrc of 486 instead of 487 for the NTSC
|
||||||
|
* height. Without that margin the cx23885 fails in this
|
||||||
|
* check.
|
||||||
|
*/
|
||||||
if ((fmt->width * 16 < Hsrc) || (Hsrc < fmt->width) ||
|
if ((fmt->width * 16 < Hsrc) || (Hsrc < fmt->width) ||
|
||||||
(Vlines * 8 < Vsrc) || (Vsrc < Vlines)) {
|
(Vlines * 8 < Vsrc) || (Vsrc + 1 < Vlines)) {
|
||||||
v4l_err(client, "%dx%d is not a valid size!\n",
|
v4l_err(client, "%dx%d is not a valid size!\n",
|
||||||
fmt->width, fmt->height);
|
fmt->width, fmt->height);
|
||||||
return -ERANGE;
|
return -ERANGE;
|
||||||
|
|
Loading…
Reference in a new issue