media: v4l: Bring back array_size parameter to v4l2_find_nearest_size
An older version of the driver patches were merged accidentally which resulted in missing the array_size parameter that tells the length of the array that contains the different supported sizes. Bring it back to v4l2_find_nearest size and make the corresponding change for the drivers using it as well. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
dd5747fb92
commit
d2dc57b10a
@@ -1375,7 +1375,9 @@ ov13858_set_pad_format(struct v4l2_subdev *sd,
|
||||
if (fmt->format.code != MEDIA_BUS_FMT_SGRBG10_1X10)
|
||||
fmt->format.code = MEDIA_BUS_FMT_SGRBG10_1X10;
|
||||
|
||||
mode = v4l2_find_nearest_size(supported_modes, width, height,
|
||||
mode = v4l2_find_nearest_size(supported_modes,
|
||||
ARRAY_SIZE(supported_modes),
|
||||
width, height,
|
||||
fmt->format.width, fmt->format.height);
|
||||
ov13858_update_pad_format(mode, fmt);
|
||||
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
|
||||
|
||||
@@ -2230,7 +2230,9 @@ static int ov5670_set_pad_format(struct v4l2_subdev *sd,
|
||||
|
||||
fmt->format.code = MEDIA_BUS_FMT_SGRBG10_1X10;
|
||||
|
||||
mode = v4l2_find_nearest_size(supported_modes, width, height,
|
||||
mode = v4l2_find_nearest_size(supported_modes,
|
||||
ARRAY_SIZE(supported_modes),
|
||||
width, height,
|
||||
fmt->format.width, fmt->format.height);
|
||||
ov5670_update_pad_format(mode, fmt);
|
||||
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
|
||||
|
||||
@@ -561,8 +561,9 @@ int vivid_try_fmt_vid_cap(struct file *file, void *priv,
|
||||
mp->field = vivid_field_cap(dev, mp->field);
|
||||
if (vivid_is_webcam(dev)) {
|
||||
const struct v4l2_frmsize_discrete *sz =
|
||||
v4l2_find_nearest_size(webcam_sizes, width, height,
|
||||
mp->width, mp->height);
|
||||
v4l2_find_nearest_size(webcam_sizes,
|
||||
VIVID_WEBCAM_SIZES, width,
|
||||
height, mp->width, mp->height);
|
||||
|
||||
w = sz->width;
|
||||
h = sz->height;
|
||||
|
||||
Reference in New Issue
Block a user