Skip to content

media: vimc: Add timing controls for fps config

Faizel K B linux-media 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest posting 2/23 patches 0 repliesNew
  2. v3 posting 1/23 patches 0 repliesSuperseded
  3. v23 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches4 repliesSuperseded

Changes in v3 from the cover letter

- Fixed 64-bit division on 32-bit architectures in vimc_calc_vblank()

Patches in v3 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3media: vimc: sensor: Move vimc_sensor_device to common headerdrivers/media/test-drivers/vimc/vimc-common.h drivers/media/test-drivers/vimc/vimc-sensor.c+28 -260 replies
2/3media: vimc: sensor: Add pixel_rate,vblank and hblank configurationdrivers/media/test-drivers/vimc/vimc-common.h drivers/media/test-drivers/vimc/vimc-sensor.c+101 -00 replies
3/3media: vimc: streamer: Apply sensor frame rate in streamer threaddrivers/media/test-drivers/vimc/vimc-streamer.c+31 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH RESEND v3 0/3] media: vimc: Add timing controls for fps config

Control frame timing of vimc sensor by adding support for V4L2 timing controls (VBLANK, HBLANK, PIXEL_RATE). PIXEL_RATE and HBLANK are fixed as readonly with default values. VBLANK is configurable.

First version patch attempted to implement direct frame rate control as fraction. vimc sensor should have controls like real sensor to control the framerate.

Changes in v3:
- Fixed 64-bit division on 32-bit architectures in vimc_calc_vblank()

- Used do_div() for portable 64-bit division
- Link to v2: https://lore.kernel.org/linux-media/[email protected]/

Changes in v2:
- Changed the patch subject to indicate timing control.
- Removed 'v4l2_fract' element from sensor struct
- Removed frameinterval functions for vimc_sensor_pad_ops
- Added PIXEL_RATE,HBLANK,VBLANK V4L2 Controls
- Added fps delay calculation based on timing controls
- Default PIXEL_RATE as 160 MHz. HBLANK as 800
- Default fps 30 for resolution up to 1920 * 1080 (2,073,600 pixels)
above which the fps is 10 (PIXEL_RATE must be changed to support
higher resolutions).
- Link to v1: https://lore.kernel.org/linux-media/cr4tjjlq53ezux7lzrusy4wb7ji26trwkipfkjl33kwv6z4ut7@r6hvuzki66bj/

Example usage:
# Set vblank as 1000
v4l2-ctl -d /dev/v4l-subdev0 --set-ctrl=vertical_blanking=1000

# Capture and verify frame rate.
# Real framerate depends on the CPU performance

  yavta /dev/video2 --capture=100

Faizel K B (3):
media: vimc: sensor: Move vimc_sensor_device to common header
media: vimc: sensor: Add pixel_rate,vblank and hblank configuration
media: vimc: streamer: Apply sensor frame rate in streamer thread

 drivers/media/test-drivers/vimc/vimc-common.h |  41 +++++++
 drivers/media/test-drivers/vimc/vimc-sensor.c | 114 ++++++++++++++----
 .../media/test-drivers/vimc/vimc-streamer.c   |  33 ++++-
 3 files changed, 160 insertions(+), 28 deletions(-)

base-commit: f505e978d1a0442adbbde48aed38c084ddea6d6e

Signature · 1 line
2.43.0