Re: [PATCH 2/3] media: i2c: ov5693: Keep the Bayer order when flipping at full resolution
From: Marco Ziliani
Date: Wed Oct 28 2026 - 07:33:44 EST
Hi Dan,
On 28/10/2026 09:31, Dan Scally wrote:
> Hm. But what's the right approach? To allow flips without changing the
> media bus format code by offsetting the output rectangle, or to have
> flips change the media bus format that the driver reports and flag the
> flip controls with V4L2_CTRL_FLAG_MODIFY_LAYOUT. At the moment that
> would mean that you couldn't set flips whilst streaming though, which
> is suboptimal.
I went for the offset because it keeps the flips usable while
streaming and keeps the format the driver has always reported, so
nothing changes for existing users. Other drivers do the same: ov13b10
and ov01a10 shift the window offset by one pixel when flipping to keep
the Bayer order, and in imx290 the sensor itself moves the readout by
one pixel for the same reason.
The cost is one extra column of the pixel array, which is why the crop
end is widened by two columns, clamped to the array. The reported
format, crop rectangle and size don't change, and the binned modes are
left alone since the flips don't move their Bayer phase.
If you and Sakari would rather have the MODIFY_LAYOUT approach, I can
switch to it in v2.
Regards,
Marco