summaryrefslogtreecommitdiff
path: root/drivers/staging/media
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-06-19 13:52:08 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-09-27 10:40:02 +0300
commitd86c33af672d126bbba0b61947078c317994dcc5 (patch)
tree836f52de15d4b22e1f81ea4d70d55c70867786c4 /drivers/staging/media
parent0e2c53ff13e2240dea196d5813cc08ea923951dc (diff)
downloadlinux-d86c33af672d126bbba0b61947078c317994dcc5.tar.xz
media: atomisp: Clamp width to max 1920 pixels when in ATOMISP_RUN_MODE_PREVIEW
The pipeline firmware-binaries used in previed mode have ia_css_binary_xinfo.output.max_width set to 1920. This causes ia_css_binary_find() to fail when trying to set a higher resolution resulting in the dump_stack() call in ia_css_binary_find() triggering and resulting in the try_fmt() or set_fmt() IOCTL failing. Fix this by clamping the width to max 1920 when in preview mode. Link: https://lore.kernel.org/r/20230619105212.303653-3-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging/media')
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_cmd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
index 0803b296e9ac..a5110636d6f5 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
@@ -3808,6 +3808,10 @@ int atomisp_try_fmt(struct atomisp_device *isp, struct v4l2_pix_format *f,
return -EINVAL;
}
+ /* The preview pipeline does not support width > 1920 */
+ if (asd->run_mode->val == ATOMISP_RUN_MODE_PREVIEW)
+ f->width = min_t(u32, f->width, 1920);
+
/*
* atomisp_set_fmt() will set the sensor resolution to the requested
* resolution + padding. Add padding here and remove it again after