Repository navigation
media: backport the IPU6 ov5693 clock-lane gate and ov13858 flip controls from v7.4-rc1 - #193
Open
CmdrShepardsPie wants to merge 7 commits into
Open
CmdrShepardsPie wants to merge 7 commits into
CmdrShepardsPie wants to merge 7 commits into
Conversation
Add ipu_bridge_get_ipu6() for obtaining the IPU 6 (or soon later) PCI device. This isn't technically a job of the IPU bridge, but the functionality is required in conjunction with the firmware definitions that necessitate the use of the IPU bridge on many systems. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Antti Laakso <antti.laakso@linux.intel.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> (cherry picked from commit eda381f) [ backport: taken as a prerequisite of 8e3def7, which uses the IPU6 PCI IDs from <media/ipu6-pci-table.h> that this commit includes ] Patchset: cameras
The ov5693 never programs MIPI_CTRL00 (0x4800), leaving it at its 0x00 power-on default, which lets the MIPI clock run freely. The IPU3 CSI-2 receiver tolerates this, but the IPU6 receiver (e.g. on Microsoft Surface Pro 7+, Pro 8, Pro 9 and Surface Go 4) fails to lock onto the link, so the sensor streams but capture times out with "stream stop time out". On most affected machines no frames arrive at all; on some the failure is intermittent. Gate the clock lane while idle at stream on when the endpoint requests a non-continuous clock. Only the gate bit is touched, so platforms that do not request it are unaffected. No counterpart is needed at stream off, as the link is down by then and the register returns to its default when the sensor is powered off. The property is supplied by the ipu-bridge in a subsequent patch. Link: linux-surface/linux-surface#2171 Co-developed-by: Arsalan Naeem <naeemarsalan@gmail.com> Signed-off-by: Arsalan Naeem <naeemarsalan@gmail.com> Signed-off-by: Fernando Rimoli <fernandorimoli11@gmail.com> Tested-by: Jakob Berg Jespersen <dev@berg.pm> # Surface Pro 7+, IPU6 Tiger Lake Tested-by: Fil Dunsky <filipp.dunsky@gmail.com> # Surface Pro 8, IPU6 Tiger Lake (8086:9a19) Tested-by: Lucas Lis <lucaseze.lis@gmail.com> # Surface Pro 7+, IPU6 Tiger Lake (0x9a19) Tested-by: Kengo Oki <dev.kengo.fugu0141@gmail.com> # Surface Go 4, IPU6 Alder Lake-N 8086:462e Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> (cherry picked from commit 0e12587) Patchset: cameras
Index the ep_properties array dynamically instead of plain numerical values as is done in mipi-disco-img.c. Signed-off-by: Fernando Rimoli <fernandorimoli11@gmail.com> Tested-by: Jakob Berg Jespersen <dev@berg.pm> # Surface Pro 7+, IPU6 Tiger Lake Tested-by: Fil Dunsky <filipp.dunsky@gmail.com> # Surface Pro 8, IPU6 Tiger Lake (8086:9a19) Tested-by: Lucas Lis <lucaseze.lis@gmail.com> # Surface Pro 7+, IPU6 Tiger Lake (0x9a19) Tested-by: Kengo Oki <dev.kengo.fugu0141@gmail.com> # Surface Go 4, IPU6 Alder Lake-N 8086:462e Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> (cherry picked from commit 3436405) Patchset: cameras
Some sensors need different treatment depending on which IPU they are connected to, so the ACPI HID alone is not enough. Match on an optional list of IPU PCI product IDs. Entries for one HID must be adjacent, IPU-specific ones first, so the generic entry is skipped once a specific one has matched. Signed-off-by: Fernando Rimoli <fernandorimoli11@gmail.com> Tested-by: Jakob Berg Jespersen <dev@berg.pm> # Surface Pro 7+, IPU6 Tiger Lake Tested-by: Fil Dunsky <filipp.dunsky@gmail.com> # Surface Pro 8, IPU6 Tiger Lake (8086:9a19) Tested-by: Lucas Lis <lucaseze.lis@gmail.com> # Surface Pro 7+, IPU6 Tiger Lake (0x9a19) Tested-by: Kengo Oki <dev.kengo.fugu0141@gmail.com> # Surface Go 4, IPU6 Alder Lake-N 8086:462e Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> (cherry picked from commit b883954) Patchset: cameras
The ov5693 (INT33BE / OVTI5693) needs its MIPI clock lane gated while idle for the IPU6 CSI-2 receiver to lock onto the link, which the sensor driver does when the endpoint requests a non-continuous clock. The same sensor works with a free-running clock on the IPU3, so request it only for the IPU6 variants where it has been confirmed on hardware: Tiger Lake, Alder Lake-P and Alder Lake-N. Signed-off-by: Fernando Rimoli <fernandorimoli11@gmail.com> Tested-by: Jakob Berg Jespersen <dev@berg.pm> # Surface Pro 7+, IPU6 Tiger Lake Tested-by: Fil Dunsky <filipp.dunsky@gmail.com> # Surface Pro 8, IPU6 Tiger Lake (8086:9a19) Tested-by: Lucas Lis <lucaseze.lis@gmail.com> # Surface Pro 7+, IPU6 Tiger Lake (0x9a19) Tested-by: Kengo Oki <dev.kengo.fugu0141@gmail.com> # Surface Go 4, IPU6 Alder Lake-N 8086:462e Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> (cherry picked from commit 8e3def7) [ backport: linux-surface's "Add camera support for Surface Pro 9" lists OVTI5693 after INT33F0 rather than in sorted order, so the new OVTI5693 entry goes just before that one instead of at the sorted position; no other change ] Assisted-by: LLM Patchset: cameras
…rodata The software nodes ipu-bridge registers on a successful init are never unregistered. There is no module_exit and no remove hook, and every software_node_unregister_node_group() call sits on an error unwind label inside ipu_bridge_init(), so on success the nodes stay registered and readable after the module is unloaded, which a later rebind relies on. Nothing reachable from a registered node may therefore point into the module image. PROPERTY_ENTRY_BOOL() stores a pointer to its name, so the "clock-noncontinuous" string literal leaves the surviving node carrying a dangling property name once ipu-bridge is gone. Add the name to struct ipu_property_names, which is copied by value into each struct ipu_sensor, and use that copy, as every other endpoint property name already does. Fixes: 8e3def7 ("media: ipu-bridge: Request non-continuous clock for ov5693 on IPU6") Reported-by: D. Manresa <dmanresa@gmail.com> Closes: https://lore.kernel.org/linux-media/20260905211307.542810-1-dmanresa@gmail.com/ Signed-off-by: Fernando Rimoli <fernandorimoli11@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> (cherry picked from commit a20c843) Patchset: cameras
The Microsoft Surface Pro 11 for Business (Intel) mounts this sensor upside down, as commit b238116 ("media: ipu-bridge: Add upside-down quirk for Surface Pro 11") records, and the driver has no flip controls to compensate. Add V4L2_CID_HFLIP and V4L2_CID_VFLIP on bits 3 and 4 of register 0x3820. The mirror bit is active low, as in Intel's out-of-tree ov13858 driver. The Bayer order does not change with either flip, so the controls do not set V4L2_CTRL_FLAG_MODIFY_LAYOUT. They are clustered, and grabbed while streaming. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Sergey Lebedev <lsa.uz@pm.me> Tested-by: German Pablo Lindo <germanpapulindez@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> (cherry picked from commit deb515f) Patchset: cameras
|
Tested on a Surface Pro 7+ (IPU6 Tiger Lake I cherry-picked the six ipu-bridge/ov5693 commits (not the ov13858 one, there is no such sensor here) onto
Two things I noticed that are not caused by this PR:
So for the Pro 7+ front camera: works for me with this backport. |
This was referenced Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Seven cherry-picks from mainline v7.4-rc1 that fix the two camera problems the Surface Pro 9 still has on the 7.3 kernels:
0x4800). This coversINT33BE(Pro 7+, Pro 8, Go 4) andOVTI5693(Pro 9). IPU3 machines are unaffected.V4L2_CID_HFLIP/VFLIP(0x3820bits 3 and 4). The Bayer order doesn't change, and the crop window is left alone.Six are clean cherry-picks with the same patch-id as mainline. In 5, the new
OVTI5693entry goes directly before the existing one from "Add camera support for Surface Pro 9", which sits afterINT33F0rather than in sorted order, because ipu-bridge needs the entries for one HID to be adjacent. The commit message notes this. None of the seven is tagged for stable, so they won't arrive through 7.3.y, and they can be dropped at the move to 7.4.Related work:
OVTID858line that 5 uses as context. Whichever lands second needs a one-line rebase, which I can do here.Testing, Surface Pro 9 (IPU6 Alder Lake-P,
8086:465d), Fedora 45:7.3.3-1as released: the front camera shows no picture (privacy LED on). The rear sensor reports Rotation 0, has no flip controls, and its image is upside down.cam30-frame captures, 3 runs: front got frames in 1 of 3 starts (none in the other two); rear 30/30 each, Rotation 0, no flip controls.ipu-bridge,ov5693andov13858built fromv7.3-surface(so including Surface Pro 9: fix rear camera rotation #170) plus these commits, loaded in a boot where the stock camera modules never ran (the rear sensor rebound once after the bridge built its graph, since it had probed first): front 30/30 frames with data in 3 of 3 starts; rear 30/30 in 3 of 3, Rotation 180, Location back,HFLIP/VFLIPpresent. In GNOME Snapshot both cameras show a picture and both are upright.camcaptures at 2592x1944 got 30/30 frames with data in 12 of 12 starts, in each of 3 runs. Rear: 90/90 frames at 29.95 fps, 3 runs.git amand no fuzz tov7.3-surface-develandv7.3-surface.ipu-bridge,ov5693andov13858build withW=1and no warnings.