]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
media: ov2680: Stop sending more data then requested
authorHans de Goede <hdegoede@redhat.com>
Mon, 15 Apr 2024 13:03:14 +0000 (15:03 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 22 Apr 2024 09:41:05 +0000 (11:41 +0200)
There is no reason to send OV2680_END_MARGIN extra columns on top of
the mode width and the same for sending extra lines over the mode height.

This sending of extra lines/columns was inherited from the atomisp
ov2680 driver, it is unclear why this was done and this complicates
adding V4L2_CID_VBLANK support, so remove it.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/i2c/ov2680.c

index 4577a8977c85a0d72f64989fbd161f04afe2efa1..ad140d9d4c2e674ec579b6ef8c54878e70b359f1 100644 (file)
@@ -86,9 +86,6 @@
 #define OV2680_PIXELS_PER_LINE                 1704
 #define OV2680_LINES_PER_FRAME                 1294
 
-/* If possible send 16 extra rows / lines to the ISP as padding */
-#define OV2680_END_MARGIN                      16
-
 /* Max exposure time is VTS - 8 */
 #define OV2680_INTEGRATION_TIME_MARGIN         8
 
@@ -359,11 +356,9 @@ static void ov2680_calc_mode(struct ov2680_dev *sensor)
        sensor->mode.v_start = (sensor->mode.crop.top +
                                (sensor->mode.crop.height - height) / 2) & ~1;
        sensor->mode.h_end =
-               min(sensor->mode.h_start + width + OV2680_END_MARGIN - 1,
-                   OV2680_NATIVE_WIDTH - 1);
+               min(sensor->mode.h_start + width - 1, OV2680_NATIVE_WIDTH - 1);
        sensor->mode.v_end =
-               min(sensor->mode.v_start + height + OV2680_END_MARGIN - 1,
-                   OV2680_NATIVE_HEIGHT - 1);
+               min(sensor->mode.v_start + height - 1, OV2680_NATIVE_HEIGHT - 1);
        sensor->mode.h_output_size = orig_width;
        sensor->mode.v_output_size = orig_height;
        sensor->mode.hts = OV2680_PIXELS_PER_LINE;