[libcamera-devel,v1,0/9] Raspberry Pi: Horizontal blanking control
mbox series

Message ID 20221003083934.31629-1-naush@raspberrypi.com
Headers show
Series
  • Raspberry Pi: Horizontal blanking control
Related show

Message

Naushir Patuck Oct. 3, 2022, 8:39 a.m. UTC
Hi,

This series adds full automatic sensor horizontal blanking control (to compliment
the existing vertical blanking control) for exposure and/or frame duration calculations.

In the new calculations, we always prioritise extending vblank until it reaches its
limits, then extend hblank to make up the shortfall. This is to minimise the "wobble"
effect of the rolling shutter in the sensor. The rkisp1 and ipu3 IPAs are updated
to use the minimum reported hblank value in their calculations for the same reason.

Patches 1-2 adds a max line length field to the IPACameraSensorInfo and CameraMode structures.
Patchs 3-6 update the IPA and pipeline handler to pass around a current line length value.
Patches 7-8 update the calculations to return a hblank number to program in the sensor.
Patch 9 updates the embedded data parsers to extract current line length values.

Regards,
Naush

Naushir Patuck (9):
  camera_sensor: Add minimum and maximum line length to
    IPACameraSensorInfo
  ipa: raspberrypi: Add minimum and maximum line length fields to
    CameraMode
  ipa: raspberrypi: Pass lineLength into the CamHelper API
  pipeline: ipa: raspberrypi: Add HBLANK control to DelayedControls
  ipa: raspberrypi: Add pixel clock rate to the CameraMode structure
  ipa: raspberrypi: Add line length to DeviceStatus
  ipa: raspberrypi: Add line length calculations helper functions
  ipa: raspberrypi: Allow full line length control
  ipa: raspberrypi: Extract line length from the embedded data parser

 include/libcamera/ipa/core.mojom              | 21 +++--
 include/libcamera/ipa/raspberrypi.mojom       |  1 +
 src/ipa/ipu3/ipu3.cpp                         |  2 +-
 src/ipa/raspberrypi/cam_helper.cpp            | 81 ++++++++++++++-----
 src/ipa/raspberrypi/cam_helper.h              | 18 +++--
 src/ipa/raspberrypi/cam_helper_imx219.cpp     | 10 ++-
 src/ipa/raspberrypi/cam_helper_imx290.cpp     |  5 +-
 src/ipa/raspberrypi/cam_helper_imx296.cpp     | 10 ++-
 src/ipa/raspberrypi/cam_helper_imx477.cpp     | 39 +++++----
 src/ipa/raspberrypi/cam_helper_imx519.cpp     | 39 +++++----
 src/ipa/raspberrypi/cam_helper_ov5647.cpp     |  5 +-
 src/ipa/raspberrypi/cam_helper_ov9281.cpp     |  5 +-
 src/ipa/raspberrypi/controller/camera_mode.h  |  6 +-
 .../raspberrypi/controller/device_status.cpp  |  1 +
 .../raspberrypi/controller/device_status.h    |  4 +-
 src/ipa/raspberrypi/raspberrypi.cpp           | 61 ++++++++------
 src/ipa/rkisp1/rkisp1.cpp                     |  2 +-
 src/libcamera/camera_sensor.cpp               |  6 +-
 .../pipeline/raspberrypi/raspberrypi.cpp      |  1 +
 19 files changed, 216 insertions(+), 101 deletions(-)

Comments

Dave Stevenson Oct. 3, 2022, 1:41 p.m. UTC | #1
On Mon, 3 Oct 2022 at 09:40, Naushir Patuck via libcamera-devel
<libcamera-devel@lists.libcamera.org> wrote:
>
> Hi,
>
> This series adds full automatic sensor horizontal blanking control (to compliment
> the existing vertical blanking control) for exposure and/or frame duration calculations.
>
> In the new calculations, we always prioritise extending vblank until it reaches its
> limits, then extend hblank to make up the shortfall. This is to minimise the "wobble"
> effect of the rolling shutter in the sensor. The rkisp1 and ipu3 IPAs are updated
> to use the minimum reported hblank value in their calculations for the same reason.
>
> Patches 1-2 adds a max line length field to the IPACameraSensorInfo and CameraMode structures.
> Patchs 3-6 update the IPA and pipeline handler to pass around a current line length value.
> Patches 7-8 update the calculations to return a hblank number to program in the sensor.
> Patch 9 updates the embedded data parsers to extract current line length values.

For the series:
Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.com>

(on OV9281 using mainline ov9282 driver plus a set of patches I'm
about to send to linux-media)

> Regards,
> Naush
>
> Naushir Patuck (9):
>   camera_sensor: Add minimum and maximum line length to
>     IPACameraSensorInfo
>   ipa: raspberrypi: Add minimum and maximum line length fields to
>     CameraMode
>   ipa: raspberrypi: Pass lineLength into the CamHelper API
>   pipeline: ipa: raspberrypi: Add HBLANK control to DelayedControls
>   ipa: raspberrypi: Add pixel clock rate to the CameraMode structure
>   ipa: raspberrypi: Add line length to DeviceStatus
>   ipa: raspberrypi: Add line length calculations helper functions
>   ipa: raspberrypi: Allow full line length control
>   ipa: raspberrypi: Extract line length from the embedded data parser
>
>  include/libcamera/ipa/core.mojom              | 21 +++--
>  include/libcamera/ipa/raspberrypi.mojom       |  1 +
>  src/ipa/ipu3/ipu3.cpp                         |  2 +-
>  src/ipa/raspberrypi/cam_helper.cpp            | 81 ++++++++++++++-----
>  src/ipa/raspberrypi/cam_helper.h              | 18 +++--
>  src/ipa/raspberrypi/cam_helper_imx219.cpp     | 10 ++-
>  src/ipa/raspberrypi/cam_helper_imx290.cpp     |  5 +-
>  src/ipa/raspberrypi/cam_helper_imx296.cpp     | 10 ++-
>  src/ipa/raspberrypi/cam_helper_imx477.cpp     | 39 +++++----
>  src/ipa/raspberrypi/cam_helper_imx519.cpp     | 39 +++++----
>  src/ipa/raspberrypi/cam_helper_ov5647.cpp     |  5 +-
>  src/ipa/raspberrypi/cam_helper_ov9281.cpp     |  5 +-
>  src/ipa/raspberrypi/controller/camera_mode.h  |  6 +-
>  .../raspberrypi/controller/device_status.cpp  |  1 +
>  .../raspberrypi/controller/device_status.h    |  4 +-
>  src/ipa/raspberrypi/raspberrypi.cpp           | 61 ++++++++------
>  src/ipa/rkisp1/rkisp1.cpp                     |  2 +-
>  src/libcamera/camera_sensor.cpp               |  6 +-
>  .../pipeline/raspberrypi/raspberrypi.cpp      |  1 +
>  19 files changed, 216 insertions(+), 101 deletions(-)
>
> --
> 2.25.1
>