Skip to content

Commit de7e484

Browse files
committed
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 1af55c5 commit de7e484

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
@@ -838,7 +838,7 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
838838
const struct imx219_mode *mode;
839839
struct v4l2_mbus_framefmt *format;
840840
struct v4l2_rect *crop;
841-
unsigned int bin_h, bin_v;
841+
unsigned int bin_h, bin_v, binning;
842842

843843
mode = v4l2_find_nearest_size(supported_modes,
844844
ARRAY_SIZE(supported_modes),
@@ -856,10 +856,11 @@ static int imx219_set_pad_format(struct v4l2_subdev *sd,
856856
*/
857857
bin_h = min(IMX219_PIXEL_ARRAY_WIDTH / format->width, 2U);
858858
bin_v = min(IMX219_PIXEL_ARRAY_HEIGHT / format->height, 2U);
859+
binning = min(bin_h, bin_v);
859860

860861
crop = v4l2_subdev_state_get_crop(state, 0);
861-
crop->width = format->width * bin_h;
862-
crop->height = format->height * bin_v;
862+
crop->width = format->width * binning;
863+
crop->height = format->height * binning;
863864
crop->left = (IMX219_NATIVE_WIDTH - crop->width) / 2;
864865
crop->top = (IMX219_NATIVE_HEIGHT - crop->height) / 2;
865866

0 commit comments

Comments
 (0)