Linux Media Controller development
 help / color / mirror / Atom feed
From: Tony Garcia <tony@loafecho.com>
To: Marco Ziliani <rylos78@gmail.com>
Cc: Daniel Scally <dan.scally@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, Chris Simpson <chris@nilk.net>,
	Simon Kruse <simon0x+git@proton.me>,
	"D. Manresa" <dmanresa@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/4] media: i2c: ov5693: Fix mode changes, flips and autosuspend
Date: Tue, 01 Dec 2026 17:17:49 +0000	[thread overview]
Message-ID: <listreply-76b57ee473a13c274b13@loafecho.com> (raw)
In-Reply-To: <20261128-ov5693-fixes-v3-0-bcdd169958b6@gmail.com>

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@loafecho.com>


      parent reply	other threads:[~2026-12-01 17:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 23:11 [PATCH v3 0/4] media: i2c: ov5693: Fix mode changes, flips and autosuspend Marco Ziliani
2026-11-27 23:11 ` [PATCH v3 1/4] media: i2c: ov5693: Keep driver-managed registers out of the global list Marco Ziliani
2026-11-27 23:11 ` [PATCH v3 2/4] media: i2c: ov5693: Write format and crop changes to a powered sensor Marco Ziliani
2026-11-27 23:11 ` [PATCH v3 3/4] media: i2c: ov5693: Keep the Bayer order when flipping at full resolution Marco Ziliani
2026-11-27 23:11 ` [PATCH v3 4/4] media: i2c: ov5693: Use autosuspend when stopping the stream Marco Ziliani
2026-12-01 17:17 ` Tony Garcia [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=listreply-76b57ee473a13c274b13@loafecho.com \
    --to=tony@loafecho.com \
    --cc=chris@nilk.net \
    --cc=dan.scally@ideasonboard.com \
    --cc=dmanresa@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rylos78@gmail.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=simon0x+git@proton.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox