aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/media
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2022-08-13 17:08:44 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-09-24 09:38:52 +0200
commite0ae3048b3db5a380a7196f58d5eeebb6770bad2 (patch)
tree4c2c83b8643fc643f015095d96dd4b6fbc663f2f /drivers/staging/media
parentmedia: atomisp: Fix VIDIOC_TRY_FMT (diff)
downloadlinux-dev-e0ae3048b3db5a380a7196f58d5eeebb6770bad2.tar.xz
linux-dev-e0ae3048b3db5a380a7196f58d5eeebb6770bad2.zip
media: atomisp: Make atomisp_try_fmt_cap() take padding into account
atomisp_try_fmt() gives results with padding included. So when userspace asks for e.g. 1600x1200 then we should pass 1616x1216 to atomisp_try_fmt() this will then get adjusted back to 1600x1200 before returning it to userspace by the atomisp_adjust_fmt() call at the end of atomisp_try_fmt(). This fixes the resolution list in camorama showing resolutions like e.g. 1584x1184 instead of 1600x1200. 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/media')
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_ioctl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index 459645c2e2a7..7ecee39ef5a4 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -960,6 +960,13 @@ static int atomisp_try_fmt_cap(struct file *file, void *fh,
struct atomisp_device *isp = video_get_drvdata(vdev);
int ret;
+ /*
+ * atomisp_try_fmt() gived results with padding included, note
+ * (this gets removed again by the atomisp_adjust_fmt() call below.
+ */
+ f->fmt.pix.width += pad_w;
+ f->fmt.pix.height += pad_h;
+
rt_mutex_lock(&isp->mutex);
ret = atomisp_try_fmt(vdev, &f->fmt.pix, NULL);
rt_mutex_unlock(&isp->mutex);