media: atomisp: Remove redundant atomisp_subdev_set_selection() calls from atomisp_se...
authorHans de Goede <hdegoede@redhat.com>
Mon, 29 May 2023 10:37:28 +0000 (11:37 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 9 Jun 2023 14:27:34 +0000 (15:27 +0100)
commitaf330c965fdd6bb86b8aaf804334f03623d6d2cd
tree5bfad9c0a0da6fc33b64db87e9dd3412076f3889
parent503bf3090a19b6c7ba620b9c224a9409a41d3c91
media: atomisp: Remove redundant atomisp_subdev_set_selection() calls from atomisp_set_fmt()

atomisp_subdev_set_selection(sink-pad, V4L2_SEL_TGT_CROP, rect)
ignores the passed in rect, using the width and height from the last
atomisp_subdev_set_ffmt(ATOMISP_SUBDEV_PAD_SINK, ffmt) call instead.

The atomisp_subdev_set_ffmt() call done by atomisp_set_fmt_to_snr()
already propagates the sink ffmt changes to V4L2_SEL_TGT_CROP
(this is what allows atomisp_set_fmt() to get the isp_sink_crop in
the first place).

Remove the redundant atomisp_subdev_set_selection(sink-pad, ...)
calls.

Note the removed aspect ratio correction in the last else block is
is already done by atomisp_subdev_set_selection() itself when
setting V4L2_SEL_TGT_COMPOSE on the source-pad.

Link: https://lore.kernel.org/r/20230529103741.11904-9-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_cmd.c