aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <[email protected]>2023-06-01 15:58:58 +0100
committerMauro Carvalho Chehab <[email protected]>2023-06-09 15:42:05 +0100
commit930d333a00e1c7ac6caa83b70402367069f6c377 (patch)
treec080d8821c661a78cbfc80a0c8b377205dab6058
parent0f417dc1b7330aae06f155ea505899fa74b2eabe (diff)
media: atomisp: Fix binning check in atomisp_set_crop()
The fmt / size passed to atomisp_set_crop() includes padding, so the binning check should be against 1/2 of the native rect. of the sensor, rather then 1/2 of the active rect. This fixes binning not being used when using e.g. 800x600 on a 1600x1200 sensor leading to a very small field of view. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
index 68550cd49a83..e27f9dc8e7aa 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
@@ -3769,8 +3769,8 @@ static int atomisp_set_crop(struct atomisp_device *isp,
return 0;
/* Cropping is done before binning, when binning double the crop rect */
- if (input->binning_support && sel.r.width <= (input->active_rect.width / 2) &&
- sel.r.height <= (input->active_rect.height / 2)) {
+ if (input->binning_support && sel.r.width <= (input->native_rect.width / 2) &&
+ sel.r.height <= (input->native_rect.height / 2)) {
sel.r.width *= 2;
sel.r.height *= 2;
}