From: Marco Ziliani <rylos78@gmail.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Daniel Scally <dan.scally@ideasonboard.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] media: i2c: ov8865: Fix long frame lengths, VBLANK on mode change and gain steps
Date: Thu, 03 Dec 2026 18:54:58 +0100 [thread overview]
Message-ID: <20261203-ov8865-fixes-v1-0-2bedf7e05579@gmail.com> (raw)
Three fixes for the ov8865, found on the Microsoft Surface Pro 5 and
Surface Book 2 (IPU3) and tested on a Surface Pro 7+ (IPU6) as well.
Patch 1 fixes the VTS high byte mask, which keeps only bits 11:8 and
wraps any frame length above 4095 lines. libcamera now sets VBLANK on
the IPU3 pipeline and its AGC raises the exposure up to the frame
length, so with libcamera master the rear camera of the Surface Book 2
goes black, or the stream stalls. It would be good to have this fixed
before the next libcamera release.
Patch 2 resets VBLANK to the mode default on every active format
change, so that a frame length left over from the previous mode or user
doesn't stick.
Patch 3 lowers the analogue gain step from 128 (integer gains only) to
1, which the sensor resolves to about 1/128 of the current gain.
Tested on a Surface Pro 5 with the media next driver plus this series,
built for the running kernel, against the unpatched driver, at 800x600:
unpatched patched
VBLANK 5400 VTS read 1904, 30.25 fps VTS 6000, 9.60 fps
VBLANK 14760 VTS read 3072, 18.75 fps VTS 15360, 3.75 fps
VBLANK after full -> 800x600
14760 (stale) 40 (mode default)
analogue gain step 128 1
The patches come from the linux-surface tree [1], where irishchug
(Surface Book 2) and Firas Sharary (Surface Pro 7+) tested them.
I used an AI coding assistant to draft these patches and the changelogs;
I reviewed them and can answer for them.
[1] https://github.com/linux-surface/kernel/pull/181
Signed-off-by: Marco Ziliani <rylos78@gmail.com>
---
Marco Ziliani (3):
media: i2c: ov8865: Fix the VTS high byte mask
media: i2c: ov8865: Reset VBLANK on mode change
media: i2c: ov8865: Allow fine analogue gain steps
drivers/media/i2c/ov8865.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
---
base-commit: d7e7bca7169873b46e857c025c10f3336c1258d8
change-id: 20261203-ov8865-fixes-033b44cfd7a4
Best regards,
--
Marco Ziliani <rylos78@gmail.com>
next reply other threads:[~2026-12-03 17:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 17:54 Marco Ziliani [this message]
2026-12-03 17:54 ` [PATCH 1/3] media: i2c: ov8865: Fix the VTS high byte mask Marco Ziliani
2026-12-03 17:55 ` [PATCH 2/3] media: i2c: ov8865: Reset VBLANK on mode change Marco Ziliani
2026-12-03 17:55 ` [PATCH 3/3] media: i2c: ov8865: Allow fine analogue gain steps Marco Ziliani
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=20261203-ov8865-fixes-v1-0-2bedf7e05579@gmail.com \
--to=rylos78@gmail.com \
--cc=dan.scally@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/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
all inboxes | Powered by JetHome®