[PATCH v2 18/25] media: i2c: imx283: Reduce vertical cutting

From: Kieran Bingham

Date: Fri Feb 13 2026 - 09:08:21 EST


The size should represent the amount of lines to cut vertically
and exclude from the pixel array for the image data.

Keeping this at the expected value causes corruption on the last
line. Reduce by increasing the defined size of the image by
a single line to ensure that the data is valid for the final
output.

Signed-off-by: Kieran Bingham <kieran.bingham@xxxxxxxxxxxxxxxx>
---
drivers/media/i2c/imx283.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/imx283.c b/drivers/media/i2c/imx283.c
index 07958cd1889e..df48793835fd 100644
--- a/drivers/media/i2c/imx283.c
+++ b/drivers/media/i2c/imx283.c
@@ -1154,7 +1154,12 @@ static int imx283_start_streaming(struct imx283 *imx283,
*/
s16 top = mode->crop.top - 16;
u16 veff = mode->scan->veff;
- u16 cut = veff - min(veff, y_out_size);
+
+ /*
+ * Lots of empirical testing shows that we need to cut one less
+ * line than expected or we get corruption in the last line.
+ */
+ u16 cut = veff - min(veff, y_out_size + 1);

u32 v_widcut;
s32 v_pos;

--
2.52.0