mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] media: i2c: ov8865: Fix long frame lengths, VBLANK on mode change and gain steps
@ 2026-12-03 17:54 Marco Ziliani
  2026-12-03 17:54 ` [PATCH 1/3] media: i2c: ov8865: Fix the VTS high byte mask Marco Ziliani
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marco Ziliani @ 2026-12-03 17:54 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus
  Cc: Daniel Scally, linux-media, linux-kernel

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>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-03 17:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-03 17:54 [PATCH 0/3] media: i2c: ov8865: Fix long frame lengths, VBLANK on mode change and gain steps Marco Ziliani
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

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®