media: atomisp: Set crop before setting fmt
authorHans de Goede <hdegoede@redhat.com>
Mon, 29 May 2023 10:37:39 +0000 (11:37 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 9 Jun 2023 14:38:13 +0000 (15:38 +0100)
commit1e28b9e048b5edd29c7bf9c8ce6d9d5dcda6f36b
treee2fd76633e314541a47a63daff9ad8ea7acd3ae1
parent3e399cf20f69b7f810bcdf98c8df6b1c2af88465
media: atomisp: Set crop before setting fmt

Some drivers which implement selections/crop only allow setting the format
with and height to either the crop rectangle width and height or to half
the crop rectangle width and height (binning). An example of such
a driver is the standard v4l2 ov5693 driver.

First set the crop rectangle to match the requested format
when trying or setting the sensor format, to match these drivers
expectations.

Link: https://lore.kernel.org/r/20230529103741.11904-20-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