Skip to content

Commit c7534c9

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 a9054e7 commit c7534c9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/media/i2c/imx219.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
842842
const struct imx219_mode *mode;
843843
struct v4l2_mbus_framefmt *format;
844844
struct v4l2_rect *crop;
845-
unsigned int bin_h, bin_v;
845+
unsigned int bin_h, bin_v, binning;
846846

847847
mode = v4l2_find_nearest_size(supported_modes,
848848
ARRAY_SIZE(supported_modes),
@@ -860,10 +860,11 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
860860
*/
861861
bin_h = min(IMX219_PIXEL_ARRAY_WIDTH / format->width, 2U);
862862
bin_v = min(IMX219_PIXEL_ARRAY_HEIGHT / format->height, 2U);
863+
binning = min(bin_h, bin_v);
863864

864865
crop = v4l2_subdev_state_get_crop(state, 0);
865-
crop->width = format->width * bin_h;
866-
crop->height = format->height * bin_v;
866+
crop->width = format->width * binning;
867+
crop->height = format->height * binning;
867868
crop->left = (IMX219_NATIVE_WIDTH - crop->width) / 2;
868869
crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2;
869870

0 commit comments

Comments
 (0)