diff options
author | Hans de Goede <hdegoede@redhat.com> | 2023-05-06 19:56:05 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-06-09 14:26:04 +0100 |
commit | 649920afc4269fe3db74feadffb8f18dea057dc1 (patch) | |
tree | 53e30c1e9f9b4cd3189b3c87b8ac9867d23d12c6 /drivers/staging | |
parent | 5c3213e9e2dd5dee0ba54a65a491ad4e43b615d0 (diff) | |
download | linux-stable-649920afc4269fe3db74feadffb8f18dea057dc1.tar.gz linux-stable-649920afc4269fe3db74feadffb8f18dea057dc1.tar.bz2 linux-stable-649920afc4269fe3db74feadffb8f18dea057dc1.zip |
media: atomisp: Remove res_overflow parameter from atomisp_try_fmt()
The only remaining caller of atomisp_try_fmt() always passes NULL
for the res_overflow parameter. Drop it and simplify atomisp_try_fmt().
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_cmd.c | 21 | ||||
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_cmd.h | 3 | ||||
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 2 |
3 files changed, 6 insertions, 20 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index aa790ae746f3..bb49d6f2e67f 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -3881,8 +3881,7 @@ static void __atomisp_init_stream_info(u16 stream_index, } /* This function looks up the closest available resolution. */ -int atomisp_try_fmt(struct video_device *vdev, struct v4l2_pix_format *f, - bool *res_overflow) +int atomisp_try_fmt(struct video_device *vdev, struct v4l2_pix_format *f) { struct atomisp_device *isp = video_get_drvdata(vdev); struct atomisp_sub_device *asd = atomisp_to_video_pipe(vdev)->asd; @@ -3940,6 +3939,8 @@ int atomisp_try_fmt(struct video_device *vdev, struct v4l2_pix_format *f, } f->pixelformat = fmt->pixelformat; + f->width = format.format.width; + f->height = format.format.height; /* * If the format is jpeg or custom RAW, then the width and height will @@ -3948,22 +3949,8 @@ int atomisp_try_fmt(struct video_device *vdev, struct v4l2_pix_format *f, * the sensor driver. */ if (f->pixelformat == V4L2_PIX_FMT_JPEG || - f->pixelformat == V4L2_PIX_FMT_CUSTOM_M10MO_RAW) { - f->width = format.format.width; - f->height = format.format.height; + f->pixelformat == V4L2_PIX_FMT_CUSTOM_M10MO_RAW) return 0; - } - - if (!res_overflow || (format.format.width < f->width && - format.format.height < f->height)) { - f->width = format.format.width; - f->height = format.format.height; - /* Set the flag when resolution requested is - * beyond the max value supported by sensor - */ - if (res_overflow) - *res_overflow = true; - } /* app vs isp */ f->width = rounddown(clamp_t(u32, f->width, ATOM_ISP_MIN_WIDTH, diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.h b/drivers/staging/media/atomisp/pci/atomisp_cmd.h index 399b549bcf83..3cf086eba06d 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.h +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.h @@ -259,8 +259,7 @@ int atomisp_compare_grid(struct atomisp_sub_device *asd, struct atomisp_grid_info *atomgrid); /* This function looks up the closest available resolution. */ -int atomisp_try_fmt(struct video_device *vdev, struct v4l2_pix_format *f, - bool *res_overflow); +int atomisp_try_fmt(struct video_device *vdev, struct v4l2_pix_format *f); int atomisp_set_fmt(struct video_device *vdev, struct v4l2_format *f); diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index 384f31fc66c5..4d927799f53b 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -896,7 +896,7 @@ static int atomisp_try_fmt_cap(struct file *file, void *fh, f->fmt.pix.width += pad_w; f->fmt.pix.height += pad_h; - ret = atomisp_try_fmt(vdev, &f->fmt.pix, NULL); + ret = atomisp_try_fmt(vdev, &f->fmt.pix); if (ret) return ret; |