Re: [PATCH v3 0/4] media: i2c: ov5693: Fix mode changes, flips and autosuspend

From: Tony Garcia

Date: Tue Dec 01 2026 - 12:18:10 EST


Hi Marco,

Tested v3 on a Surface Pro 7 (Ice Lake). Its front OV5693 sits behind an
IPU4P, which I run with ruslanbay's IPU4P-on-IPU6 RFC series on
linux-surface 7.3.0-rc7. The four patches were applied to the 7.3
ov5693.c. One hunk of patch 2 needed a context-only fix, because
set_fmt() has no client_info argument on 7.3; the added
ov5693_mode_update() is unchanged and the diff is still 106+/25-. Raw
capture from the ISYS video node with v4l2-ctl, frames saved and checked
buffer by buffer, no libcamera. Each of the tests below was also run on
the unpatched 7.3 driver as a control.

Patch 2, format changes on a powered sensor: with the sensor held
powered (power/control=on), 8 changes from 2592x1944 to a centred
1920x1080 crop and 8 back. OUTPUT_SIZE_X/Y (0x3808/0x380a) read over I2C
during each stream matched 16 of 16 times and all 16 streams delivered
frames. Unpatched: 0x3808 stayed at 2592 after each of 3 changes to the
crop and none of those streams produced a frame.

Patch 2, during the autosuspend delay: with autosuspend_delay_ms set to
3000, I set the other format on the sensor pad right after a stream
stopped and read 0x3808/0x380a about 50 ms later, with no stream
running. 6 of 6 showed the new size, the sensor active before and after.
Unpatched, same test: 0 of 6, the registers kept the old size.

Patch 2, -EBUSY: 1 s into a 90-frame stream, VIDIOC_SUBDEV_S_FMT
(1296x972) and VIDIOC_SUBDEV_S_SELECTION (the 1920x1080 crop) on the
active state both failed with EBUSY, 3 of 3 runs. The active format and
crop were unchanged and the streams carried on normally. Unpatched, both
calls returned 0 and the stream broke up (CSI-2 FIFO overflow and frame
sync errors).

Patch 3, flips: 2592x1944 at all four hflip/vflip settings. The sensor
reported SBGGR10 and the 2x2 sub-plane test found the green pair on the
BGGR/RGGB diagonal in all four. Unpatched it moved to the GBRG/GRBG
diagonal at both single-flip settings. Image profiles against
hflip=0/vflip=0 confirmed the three flipped settings really mirrored
the image. One caveat: the room was dark, so I raised exposure and gain
for this, and I couldn't check the blue/red order this time as I did on
v1.

Patch 4, autosuspend at stream stop: after a 60-frame stream the sensor
was suspended at the 1.1 s sample in one run and the 1.3 s sample in two
(100 ms sampling, default 1 s delay). Unpatched it was already suspended
at the first sample, 3 of 3.

Patch 1 has no test of its own, but everything above ran with it
applied. The first buffer of a stream was often partly empty, with and
without the series, so that's not from these patches.

One more thing I ran into, which is not caused by this series:
VIDIOC_SUBDEV_S_FMT with which=TRY oopses with a divide error in
ov5693_set_fmt(), e.g. "v4l2-ctl -d /dev/v4l-subdevN --try-subdev-fmt
pad=0,width=1296,height=972". I hit it with this series and also with
the 7.3 driver I normally run, which doesn't have patch 2. I didn't run
it on the pure stock build, but the code there is the same. The driver
has no init_state, so I think the TRY crop is 0x0, width gets clamped
to 0 and DIV_ROUND_CLOSEST(crop->width, width) divides by it. It
matters a bit more with patch 2 though: set_fmt() now holds the lock
through guard(mutex) when the oops hits, so afterwards stream stop and
get_selection hang and the module can't be unloaded until a reboot.
With my usual driver the camera kept working after the oops. Since
you're in this function anyway, an init_state that sets the default crop
and format might fit in v4. Happy to test it.

The tests were scripted and run on my Surface Pro 7 by an AI coding
assistant (Claude) at my direction, and it drafted this summary.

For the series, on the Surface Pro 7 (IPU4P):

Tested-by: Tony Garcia <tony@xxxxxxxxxxxx>