mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mirela Rabulea <mirela.rabulea@nxp.com>
To: mchehab@kernel.org, sakari.ailus@linux.intel.com,
	hverkuil-cisco@xs4all.nl,
	laurent.pinchart+renesas@ideasonboard.com, ribalda@chromium.org,
	jai.luthra@ideasonboard.com, laurentiu.palcu@nxp.com
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	LnxRevLi@nxp.com, julien.vuillaumier@nxp.com,
	celine.laurencin@nxp.com
Subject: [RFC v2 0/5] Add standard exposure and gain controls for multiple captures
Date: Mon, 18 Aug 2025 18:58:04 +0300	[thread overview]
Message-ID: <20250818155809.469479-1-mirela.rabulea@nxp.com> (raw)

All controls are in the same class.
They can be set atomically via VIDIOC_S_EXT_CTRLS, this could turn out
to be useful in case of sensors with context switching.

Each element of the array will hold an u32 value (exposure or gain)
for one capture. The size of the array is up to the sensor driver which
will implement the controls and initialize them via v4l2_ctrl_new_custom().
With this approach, the user-space will have to set valid values
for all the captures represented in the array. The order of elements inside
the array is from the longest to the shortest exposure.

The v4l2-core only supports one scalar min/max/step value for the
entire array, and each element is validated and adjusted to be within
these bounds in v4l2_ctrl_type_op_validate(). The significance for the
maximum value for the exposure control could be "the max value for the
long exposure" or "the max value for the sum of all exposures". If none
of these is ok, the sensor driver can adjust the values as supported and
the user space can use the TRY operation to query the sensor for the
minimum or maximum values.

Changes in v2:
	- Update documentation according to review comments
	- Patch #3 adds v4l2 helpers for backward compatibility with single-capture controls
	- Patch #4 uses those helpers in the v4l2 core functions, 
	  to aleviate the backward compatibility task from new drivers implementing
	  only multi-capture controls
	- Patch #5 is a less aggresive alternative to patch #4, without v4l2 core
	  changes, but which requires more actions in the drivers, including a s_ctrl
	  implementation for single-capture controls, but using the helpers
	- We will have to pick either patch #4 or patch #5
	

Mirela Rabulea (2):
  media: Add exposure and gain controls for multiple captures
  Documentation: media: Describe exposure and gain controls for multiple
    captures
  media: v4l2-ctrls: Add v4l2 helper functions for single-capture
    controls
  media: v4l2-ctrls: Use the single-capture control helpers in v4l2 core
  media: v4l2-ctrls: Add __v4l2_s_ctrl_single_to_multi helper function

 .../media/v4l/ext-ctrls-image-source.rst      |  21 +++
 drivers/media/v4l2-core/v4l2-ctrls-api.c      |  28 +++-
 drivers/media/v4l2-core/v4l2-ctrls-core.c     | 120 +++++++++++++++++-
 drivers/media/v4l2-core/v4l2-ctrls-defs.c     |   8 ++
 include/media/v4l2-ctrls.h                    |  93 ++++++++++++++
 include/uapi/linux/v4l2-controls.h            |   3 +
 6 files changed, 268 insertions(+), 5 deletions(-)

-- 
2.43.0


             reply	other threads:[~2025-08-18 15:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-18 15:58 Mirela Rabulea [this message]
2025-08-18 15:58 ` [RFC v2 1/5] media: Add " Mirela Rabulea
2025-08-18 15:58 ` [RFC v2 2/5] Documentation: media: Describe " Mirela Rabulea
2025-08-18 15:58 ` [RFC v2 3/5] media: v4l2-ctrls: Add v4l2 helper functions for single-capture controls Mirela Rabulea
2025-08-18 15:58 ` [RFC v2 4/5] media: v4l2-ctrls: Use the single-capture control helpers in v4l2 core Mirela Rabulea
2025-08-18 15:58 ` [RFC v2 5/5] media: v4l2-ctrls: Add __v4l2_s_ctrl_single_to_multi helper function Mirela Rabulea

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=20250818155809.469479-1-mirela.rabulea@nxp.com \
    --to=mirela.rabulea@nxp.com \
    --cc=LnxRevLi@nxp.com \
    --cc=celine.laurencin@nxp.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jai.luthra@ideasonboard.com \
    --cc=julien.vuillaumier@nxp.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=laurentiu.palcu@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ribalda@chromium.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®