media: atomisp: Remove atomisp_try_fmt() call from atomisp_set_fmt()
authorHans de Goede <hdegoede@redhat.com>
Sun, 5 Mar 2023 18:53:15 +0000 (18:53 +0000)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sat, 15 Apr 2023 09:40:49 +0000 (10:40 +0100)
commitdf1697fa1778be545218945d8858581f3d023ff2
treecc92964f63f1edae598e4f47fbb4f34fafca601e
parentec1d974fcff32eaa5a15883e4930534073538741
media: atomisp: Remove atomisp_try_fmt() call from atomisp_set_fmt()

atomisp_set_fmt() first calls:

v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
                 pad, set_fmt, ...);

with v4l2_subdev_format.which set to V4L2_SUBDEV_FORMAT_ACTIVE and then
reduces width + height by padding_w / padding_h followed by calling
atomisp_try_fmt() which then sets res_overflow if the requested resolution
is larger then the sensor's max resolution, but that will never happen
since we are requesting for the result of a set_fmt call minus padding,
so res_overflow will always be false.

And when called with a res_overflow parameter, combined with there
being no overflow then atomisp_try_fmt() does not change the passed
in width/height.

Except when using JPEG or CUSTOM_M10MO_RAW as pixelformat, then
atomisp_try_fmt() does change the width/height but in that case
atomisp_set_fmt actually restores the old widht/height which it
has saved before the atomisp_try_fmt() call. So this too is a no-op.

TL;DR: The atomisp_try_fmt() call in atomisp_set_fmt() is a no-op,
remove it.

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>
drivers/staging/media/atomisp/pci/atomisp_cmd.c