Repository navigation
media: i2c: ov5693: Gate the MIPI clock lane for IPU6 Surface front cameras - #180
loisBreant wants to merge 1 commit into
Conversation
…ameras On the IPU6 Surface devices (Pro 8, Pro 9, Go 4) the front ov5693 starts streaming but the IPU6 CSI-2 receiver never gets a frame: the receiver needs the sensor to gate its clock lane when idle (non-continuous clock), which the driver never configures. Set MIPI_CTRL00 (0x4800) bit 5 (clock lane gate) before stream-on when the endpoint is non-continuous. As this kernel's ipu-bridge does not set "clock-noncontinuous" yet, also enable it for the OVTI5693 HID, which is only used on IPU6 Surface devices. Only that bit is touched; the clock_ncont module parameter can force it on or off. This follows the approach of the upstream series "media: Enable the OV5693 front camera on IPU6 Surface devices" (in media next), which gates bit 5 only. Linux-surface PR #2171 writes the whole register (0x2d) on 6.19 instead. Tested on a Surface Pro 9 (i7-1255U, IPU6 8086:465d), 7.2.11-surface-1, Ubuntu 24.04, libcamera 0.7.2 software ISP: 2592x1944 at 28.6 fps, no CSI-2 errors while streaming, 28.6 fps delivered in Chrome through v4l2loopback. Without the change no frame is received. Developed with the help of an AI assistant (Claude); tested on hardware. Link: https://patchew.org/linux/20260717132021.18034-1-fernandorimoli11@gmail.com/ Link: linux-surface/linux-surface#2171 Link: https://github.com/loisBreant/surface-pro-9-camera Patchset: cameras Signed-off-by: Lois Breant <185382558+loisBreant@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Surface Pro 8 (IPU6 Tiger Lake, I tested Fernando Rimoli's series at v5 on this machine. It gates only bit 5 of One thing to watch when testing on the Pro 8: here, the first capture after a cold boot often succeeds even without any |
|
Tested on a Surface Pro 8 (Tiger Lake IPU6, front camera = ov5693, ACPI HID Result: it fixes the Pro 8 front camera, but only with
Suggestion: also match Notes:
|
|
Tested on a Surface Go 4 (Intel N200, IPU6 8086:462e, front OV5693 as INT33BE), Fedora 44, stock 7.2.15-200.fc44 kernel, libcamera 0.7.2. Without a fix, the front camera stalls with "stream stop time out". Setting only bit 5 of MIPI_CTRL00 before stream-on (out-of-tree ov5693 module, applied unconditionally) fixes it: 60/60 frames at 28.6 fps at 2592x1968. The binned 1296x972 mode also streams, at about 55 fps through libcamera. Over three days of repeated starts, dmesg shows no time-outs and one burst of csi2 "Transfer FIFO overflow" and "packet discarded" messages. I tested the same one-bit change rather than this exact PR. The Go 4 uses INT33BE like the Pro 8 tested above, so I'd expect it to need the same handling. I did this with help from Claude. Update: more testing with the same one-bit change. After a reboot, 10 start/stop cycles, a 2-minute stream in the binned mode and suspend/resume all worked, with no csi2 errors or time-outs in dmesg. Other Go 4 findings are in linux-surface/linux-surface#2154. |
|
Surface Pro 7+ data point (Tiger Lake IPU6 Bit 5 alone is enough on the Pro 7+. With a stalled stream (0 frames for ~66 s, Note on the auto-detection: the Pro 7+ front sensor enumerates as |
The front camera of the IPU6 Surface devices (Pro 8, Pro 9, Go 4) still does not stream on the 7.2 kernels. The
ov5693driver starts the sensor, but the IPU6 CSI-2 receiver never gets a frame.This sets
MIPI_CTRL00(0x4800) bit 5 (clock lane gate) before stream-on when the link is non-continuous. Because this kernel'sipu-bridgedoes not setclock-noncontinuousyet, it is also enabled for theOVTI5693HID, which only appears on IPU6 Surfaces. Only that bit is changed, and aclock_ncontmodule parameter (-1auto,0,1) can force it either way.Relation to other work
next), which also gates bit 5 only. Once that series reaches a release, this commit can be dropped in favour of a backport, which moves the decision intoipu-bridgeper IPU PCI ID. I can prepare that backport if you prefer it now.0x2d). This PR targets 7.2, where nothing fixes it yet.Testing: Surface Pro 9 (i7-1255U, IPU6
8086:465d),7.2.11-surface-1, Ubuntu 24.04, libcamera 0.7.2 software ISP:MediaStreamTrack.stats)On this branch's
ov5693.c(identical to 7.2.11-surface-1's), the result builds to exactly the same machine code as the module I have been running (samesrcversion, identical disassembly).The full userspace setup for the Surface Pro 9 (libcamera, v4l2loopback, browser support) is documented in https://github.com/loisBreant/surface-pro-9-camera.
Transparency: I developed this with the help of an AI assistant (Claude). It was built, run and verified on real hardware, and the kernel change was reviewed separately for safety before I used it.