media: atomisp: Add enum_framesizes function for sensors with selection / crop support
authorHans de Goede <hdegoede@redhat.com>
Mon, 29 May 2023 10:37:40 +0000 (11:37 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 9 Jun 2023 14:39:40 +0000 (15:39 +0100)
commite980fb04e779730b799a4ba712db901a7b08e8f9
tree65cf2ac780bb89593e2faaa19b994fe247f21385
parent1e28b9e048b5edd29c7bf9c8ce6d9d5dcda6f36b
media: atomisp: Add enum_framesizes function for sensors with selection / crop support

Some sensor drivers with crop support (e.g. the ov5693 driver) only
return the current crop rectangle + 1/2 (binning) of the current crop
rectangle when calling their enum_frame_sizes op.

This causes 2 issues:
1. Atomisp sets to the crop area to include the padding, where as
   the enum_framesizes ioctl should return values without padding.

2. With cropping a lot more standard resolutions are possible then
   just these 2 and many apps limit the list given to the end user
   to the list returned by enum_framesizes.

Add an alternative enum_framesizes function for sensors which support
cropping to fix both issues.

Link: https://lore.kernel.org/r/20230529103741.11904-21-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/TODO
drivers/staging/media/atomisp/pci/atomisp_ioctl.c