[PATCH v2 0/2] media: i2c: Surface Pro 7+ camera flip fixes
From: Jakob Berg Jespersen
Date: Wed Jul 29 2026 - 12:26:53 EST
This series fixes an inverted horizontal-flip control on the two
OmniVision sensors of the Microsoft Surface Pro 7+ (front ov5693 and
rear ov8865). Both sensors are mounted with a 180 degree rotation (ACPI
SSDB rotation 180), so libcamera requests HFLIP=1+VFLIP=1 to correct the
mount and, with the inverted control, gets a mirrored image instead. The
ov5693 patch additionally compensates the Bayer phase, which shifts one
column when the flip bits are cleared.
The inverted-HFLIP behaviour has been confirmed on three platforms: the
Surface Pro 7+ (here), a Surface Pro 9 (Fernando Rimoli), and a Surface
Go (Hans de Goede).
1/2 media: i2c: ov8865: fix horizontal flip control polarity
2/2 media: i2c: ov5693: fix horizontal flip polarity and Bayer phase
Note: bringing these cameras up on the Surface Pro 7+ needs two
prerequisites this series does not itself depend on -- it concerns only
image orientation and colour. The ov5693 front camera streams on IPU6
only with a MIPI clock-lane-gate write being added by Fernando Rimoli
[1]; and the ov8865 rear camera powers on only with an int3472 POWER1
regulator mapping I posted separately [2].
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 the inverted feed 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]. I have not
drawn on their code here.
Thanks to Sakari, Hans, Bryan and Fernando for the review, testing and
suggestions on v1.
[1] https://lore.kernel.org/linux-media/20260720163819.104130-1-fernandorimoli11@xxxxxxxxx/
[2] https://lore.kernel.org/platform-driver-x86/20260729-sp7plus-int3472-v2-1-cdfaf97ac3ad@xxxxxxx/
[3] https://github.com/linux-surface/linux-surface/pull/1867
[4] https://github.com/linux-surface/linux-surface/pull/2201
---
Changes in v2:
- Simplified both commit messages and the code comments (Sakari, Hans).
- ov5693: dropped the "like the ov8865" cross-reference; made the
message self-contained (Hans).
- Added Fixes: and Cc: stable to both patches (Bryan).
- Picked up Reviewed-by (Hans, both) and Tested-by (Fernando, ov5693).
- Dropped the RFC prefix.
- Retested on the Surface Pro 7+ (7.1.5): both cameras correctly
oriented; ov5693 colours correct (Bayer compensation).
- Link to v1: https://patch.msgid.link/20260720-sp7plus-ov-flips-v1-0-5f345b0673de@xxxxxxx
To: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
To: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
To: Kévin L'hôpital <kevin.lhopital@xxxxxxxxxxx>
To: Paul Kocialkowski <paul.kocialkowski@xxxxxxxxxxx>
To: Daniel Scally <dan.scally@xxxxxxxxxxxxxxxx>
To: Jean-Michel Hautbois <jeanmichel.hautbois@xxxxxxxxxx>
Cc: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>
Cc: linux-media@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: Daniel Scally <djrscally@xxxxxxxxx>
Cc: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>
Cc: Tooraj Taraz <tooraj.taraz@xxxxxxxxx>
Cc: Joseph V. Lavigne <jlavig88@xxxxxxxxx>
---
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 | 12 +++++++++++-
drivers/media/i2c/ov8865.c | 3 ++-
2 files changed, 13 insertions(+), 2 deletions(-)
---
base-commit: a52e6f7923c17a672135b485ffd96fbd72f46267
change-id: 20260720-sp7plus-ov-flips-b6cc645236b6
Best regards,
--
Jakob Berg Jespersen <dev@xxxxxxx>