media: atomisp: Take minimum padding requirement on BYT/ISP2400 into account
authorHans de Goede <hdegoede@redhat.com>
Thu, 1 Jun 2023 14:58:56 +0000 (15:58 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 9 Jun 2023 14:40:24 +0000 (15:40 +0100)
commit72f0ba79a063ec2b21d5874e41c6d82193100515
treec996792eddc623f656105c7be9acd9c0219e49f9
parent0af9078315c1a737675f041996c02582610b7cfd
media: atomisp: Take minimum padding requirement on BYT/ISP2400 into account

The main binary for the pipeline on BYT/ISP2400 has its
ia_css_binary_info.pipeline.left_cropping and .top_cropping fields
set to 12. So a minimum padding of 12 is required.

And for certain bayer-orders additional width / height padding is
necessary so that the ISP crop rectangle for the raw sensor data
can be used to change the bayer-order to the fixed bayer-order
supported by the debayer block.

Without the minmum required padding ia_css_ifmtr_configure() will fail
inside ifmtr_input_start_line() and/or ifmtr_start_column() because
it cannot set the ISP crop rectangle for the raw sensor data.

Fix this by making atomisp_get_padding() take the minimum padding
requirements into account on BYT/ISP2400 (CHT/ISP2401 does not seem to
need this).

Link: https://lore.kernel.org/r/20230601145858.59652-2-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
drivers/staging/media/atomisp/pci/atomisp_common.h