[0/3] ipu3: Fix support for small sensors such as the OV9734
mbox series

Message ID 20261103104131.87331-1-guyliandejong@proton.me
Headers show
Series
  • ipu3: Fix support for small sensors such as the OV9734
Related show

Message

GuyliandeJong Nov. 3, 2026, 10:41 a.m. UTC
This series fixes three issues found while bringing up the OV9734 front
camera of the Microsoft Surface Laptop 2 (Intel IPU3) with libcamera and
PipeWire. None of the fixes is specific to that laptop. The kernel side
(power handling in the ov9734 driver and an ipu-bridge entry) is
handled separately.

Patch 1/3 adds a camera sensor helper for the OV9734. Without it the
IPU3 IPA fails to initialize.

Patch 2/3 initializes the cached test pattern mode in CameraSensorLegacy
and CameraSensorRaw. It was left uninitialized, which made the IPU3
start() fail at random for sensors without test pattern support.

Patch 3/3 bounds the default IPU3 viewfinder size to what validate()
accepts. For sensors no wider than 1280 pixels or no taller than 736
lines, validate() always adjusted the reported size, which made
WirePlumber abort.

The fixes were tested on a Surface Laptop 2 on top of v0.7.2. Repeated
camera starts succeed, and PipeWire streams up to 1024x600. On master,
the series was build tested only.

While rebasing I dropped a fix for an unsigned underflow of
minIFHeight in calculateBDSHeight(), as commit b7a4bfe13e84
("libcamera: pipeline: ipu3: Fix unsigned wrap in IF height search")
already fixes it on master.

GuyliandeJong (3):
  libipa: camera_sensor_helper: Add OV9734
  libcamera: camera_sensor: Initialize test pattern mode
  libcamera: pipeline: ipu3: Bound viewfinder size to the ImgU limits

 src/ipa/libipa/camera_sensor_helper.cpp       | 13 +++++++++++++
 src/libcamera/pipeline/ipu3/ipu3.cpp          |  8 ++++++--
 src/libcamera/sensor/camera_sensor_legacy.cpp |  1 +
 src/libcamera/sensor/camera_sensor_raw.cpp    |  6 ++++--
 4 files changed, 24 insertions(+), 4 deletions(-)