Skip to contentSkip to conversation

ov02e10: wrong Bayer CFA order when H/V flips are enabled

DISCUSSION Mihail Antsev 1 participant 1 message Jul 26 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hi,

On a Samsung Galaxy Book5 Pro 360 (IPU7 + OV02E10, ACPI HID OVTI02E1), enabling both flips — the orientation this laptop needs, since the camera module is mounted upside-down [1] — produces a green-tinted image with a checkerboard artifact, i.e. debayering with a wrong CFA order.

Measurements on this hardware (raw Bayer phase analysis of ISYS captures):

- unflipped readout: GRBG
- hflip + vflip readout: RGGB

Note RGGB is not the GBRG one would expect from a purely geometric 180 degree transform of GRBG, so it looks like the sensor readout window start is not adjusted when flips are applied, shifting the Bayer phase in one dimension only.

In addition the driver always enumerates/reports MEDIA_BUS_FMT_SGRBG10_1X10 regardless of the flip controls (even though they are flagged V4L2_CTRL_FLAG_MODIFY_LAYOUT). libcamera derives flipped Bayer orders geometrically from the enumerated code, so with flips enabled the sensor-reported format contradicts libcamera's expectation and the pipeline fails to start (EPIPE).

Could the readout window be realigned on flip (datasheet knowledge needed) so the CFA transforms geometrically, with the driver reporting flip-dependent mbus codes like other OmniVision sensor drivers do?

I'm happy to test patches on this hardware.

[1] https://lore.kernel.org/linux-media/[email protected]/

Regards,
Mihail Antsev