Skip to content

Commit 2e96146

Browse files
6by9popcornmix
authored andcommitted
media: i2c: imx219: Restore the 1920x1080 to using a 1:1 PAR
Commit 0af46fb ("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: 0af46fb ("media: i2c: imx219: Calculate crop rectangle dynamically") Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent fdfe40e commit 2e96146

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/media/i2c/imx219.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
866866
const struct imx219_mode *mode;
867867
struct v4l2_mbus_framefmt *format;
868868
struct v4l2_rect *crop;
869-
u8 bin_h, bin_v;
869+
u8 bin_h, bin_v, binning;
870870
u32 prev_line_len;
871871

872872
format = v4l2_subdev_state_get_format(state, 0);
@@ -886,10 +886,11 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
886886
*/
887887
bin_h = min(IMX219_PIXEL_ARRAY_WIDTH / format->width, 2U);
888888
bin_v = min(IMX219_PIXEL_ARRAY_HEIGHT / format->height, 2U);
889+
binning = min(bin_h, bin_v);
889890

890891
crop = v4l2_subdev_state_get_crop(state, 0);
891-
crop->width = format->width * bin_h;
892-
crop->height = format->height * bin_v;
892+
crop->width = format->width * binning;
893+
crop->height = format->height * binning;
893894
crop->left = (IMX219_NATIVE_WIDTH - crop->width) / 2;
894895
crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2;
895896

0 commit comments

Comments
 (0)