media: i2c: imx219: Restore the 1920x1080 to using a 1:1 PAR

Commit 0af46fbc33 ("media: i2c: imx219: Calculate crop rectangle
dynamically") meant that the 1920x1080 switched from using no binning
to using vertical binning but no horizontal binning.

Restore the original behaviour by ensuring the two binning settings
are the same.

Fixes: 0af46fbc33 ("media: i2c: imx219: Calculate crop rectangle dynamically")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
Dave Stevenson
2025-04-15 15:38:55 +01:00
committed by Dom Cobley
parent 7ffabf70e0
commit 335715ba13

View File

@@ -856,7 +856,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
const struct imx219_mode *mode;
struct v4l2_mbus_framefmt *format;
struct v4l2_rect *crop;
u8 bin_h, bin_v;
u8 bin_h, bin_v, binning;
u32 prev_line_len;
format = v4l2_subdev_state_get_format(state, 0);
@@ -876,10 +876,11 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
*/
bin_h = min(IMX219_PIXEL_ARRAY_WIDTH / format->width, 2U);
bin_v = min(IMX219_PIXEL_ARRAY_HEIGHT / format->height, 2U);
binning = min(bin_h, bin_v);
crop = v4l2_subdev_state_get_crop(state, 0);
crop->width = format->width * bin_h;
crop->height = format->height * bin_v;
crop->width = format->width * binning;
crop->height = format->height * binning;
crop->left = (IMX219_NATIVE_WIDTH - crop->width) / 2;
crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2;