[PATCH RFC 0/2] media: i2c: Surface Pro 7+ camera flip fixes
From: Jakob Berg Jespersen
Date: Mon Jul 20 2026 - 10:41:08 EST
This RFC series fixes two horizontal-flip issues on the front and rear
cameras of the Microsoft Surface Pro 7+ (Tiger Lake IPU6, ACPI/ipu-bridge).
Both were found and validated on real hardware (Surface Pro 7+, Fedora 44,
kernel 7.0.12) and have been in daily use on that machine for over a
month; each is described in detail in its own patch.
1/2 media: i2c: ov8865: fix horizontal flip control polarity
2/2 media: i2c: ov5693: fix horizontal flip polarity and Bayer phase
Both camera sensors on this device are mounted with a 180 degree rotation
(ACPI SSDB rotation 180), so libcamera requests HFLIP=1+VFLIP=1 to
correct the mount. Both patches address the same class of bug on the two
OmniVision sensors: the FORMAT2 FLIP_HORZ bits un-mirror a
natively-mirrored readout, so the V4L2_CID_HFLIP control is inverted. I
isolated this with a live 4-state flip/image matrix on the streaming
sensor (details in each patch). The ov5693 patch (2/2) additionally
compensates the Bayer phase, since clearing the flip bits shifts the
sampling one column off the fixed SBGGR10 the driver reports.
Why RFC:
* Both polarity fixes change behavior for every existing user of
these sensors, not just the SP7+, so confirmation of the flip
direction from other-platform users could be considered before
this is applied. Colors were verified unaffected on the SP7+.
* For the ov5693 Bayer compensation I used a window-offset approach that
keeps the mbus code fixed and userspace untouched; the alternative
idiom is a flip-dependent mbus code + V4L2_CTRL_FLAG_MODIFY_LAYOUT on
the flip controls (similar to that of imx219 from what I understand).
Maintainer preference welcome.
Note: bringing these cameras up on the Surface Pro 7+ takes two
prerequisites this series does not itself depend on. The ov5693 front
camera streams on IPU6 only with a MIPI_CTRL00 (0x4800) clock-lane-gate
write, posted by Fernando Rimoli as "[PATCH v2 0/3] media: Enable the
OV5693 front camera on IPU6 Surface devices" [1] (confirmed here on the
SP7+); and the ov8865 rear camera probes only with an int3472 regulator
patch I posted separately to platform-drivers-x86 [2]. This series is
independent of both: it concerns only image orientation and color, not
bring-up.
I discovered these issues independently, though the motivation to work on
the Surface cameras came from the linux-surface community. I'd like to
credit two parallel efforts there on the same hardware family: Tooraj
Taraz observed both the inverted-feed and power-cycling quirks while
adding Surface Pro 9 camera support out of tree [3], and Joseph V.
Lavigne posted an RFC enabling the ov8865 power supply on the Surface
Pro 7+ itself [4]. These are among my first kernel patches; I read their
work closely only while writing this up and have not drawn on their code
here.
[1] https://lore.kernel.org/linux-media/20260717132021.18034-1-fernandorimoli11@xxxxxxxxx/
[2] https://lore.kernel.org/platform-driver-x86/20260719-sp7plus-int3472-v1-1-521a43f5c191@xxxxxxx/
[3] https://github.com/linux-surface/linux-surface/pull/1867
[4] https://github.com/linux-surface/linux-surface/pull/2201
Signed-off-by: Jakob Berg Jespersen <dev@xxxxxxx>
---
Jakob Berg Jespersen (2):
media: i2c: ov8865: fix horizontal flip control polarity
media: i2c: ov5693: fix horizontal flip polarity and Bayer phase
drivers/media/i2c/ov5693.c | 22 +++++++++++++++++++++-
drivers/media/i2c/ov8865.c | 8 +++++++-
2 files changed, 28 insertions(+), 2 deletions(-)
---
base-commit: a52e6f7923c17a672135b485ffd96fbd72f46267
change-id: 20260720-sp7plus-ov-flips-b6cc645236b6
Best regards,
--
Jakob Berg Jespersen <dev@xxxxxxx>