From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422927Ab2LFJyp (ORCPT ); Thu, 6 Dec 2012 04:54:45 -0500 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:46322 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965010Ab2LFJyh (ORCPT ); Thu, 6 Dec 2012 04:54:37 -0500 Date: Thu, 6 Dec 2012 11:54:32 +0200 From: Sakari Ailus To: Prabhakar Lad Cc: Hans Verkuil , LMML , LKML , LDOC , Laurent Pinchart , Kyungmin Park , Guennadi Liakhovetski , Sylwester Nawrocki , Hans Verkuil , Hans de Goede , Chris MacGregor , Rob Landley , Jeongtae Park , Mauro Carvalho Chehab Subject: Re: [PATCH RFC v2] media: v4l2-ctrl: Add gain controls Message-ID: <20121206095431.GA2887@valkosipuli.retiisi.org.uk> References: <1354708169-1139-1-git-send-email-prabhakar.csengg@gmail.com> <201212051308.34309.hverkuil@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Prabhakar and Hans, On Thu, Dec 06, 2012 at 10:24:18AM +0530, Prabhakar Lad wrote: > Hi Hans, > > On Wed, Dec 5, 2012 at 5:38 PM, Hans Verkuil wrote: > > (resend without HTML formatting) > > > > On Wed 5 December 2012 12:49:29 Prabhakar Lad wrote: > >> From: Lad, Prabhakar > >> > >> add support for per color component digital/analog gain controls > >> and also their corresponding offset. > > > > Some obvious questions below... > > > >> > >> Signed-off-by: Lad, Prabhakar > >> Cc: Sakari Ailus > >> Cc: Laurent Pinchart > >> Cc: Kyungmin Park > >> Cc: Guennadi Liakhovetski > >> Cc: Sylwester Nawrocki > >> Cc: Hans Verkuil > >> Cc: Hans de Goede > >> Cc: Chris MacGregor > >> Cc: Rob Landley > >> Cc: Jeongtae Park > >> Cc: Mauro Carvalho Chehab > >> --- > >> Changes for v2: > >> 1: Fixed review comments pointed by Laurent. > >> 2: Rebased on latest tree. > >> > >> Documentation/DocBook/media/v4l/controls.xml | 54 ++++++++++++++++++++++++++ > >> drivers/media/v4l2-core/v4l2-ctrls.c | 11 +++++ > >> include/uapi/linux/v4l2-controls.h | 11 +++++ > >> 3 files changed, 76 insertions(+), 0 deletions(-) > >> > >> diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml > >> index 7fe5be1..847a9bb 100644 > >> --- a/Documentation/DocBook/media/v4l/controls.xml > >> +++ b/Documentation/DocBook/media/v4l/controls.xml > >> @@ -4543,6 +4543,60 @@ interface and may change in the future. > >> specific test patterns can be used to test if a device is working > >> properly. > >> > >> + > >> + V4L2_CID_GAIN_RED > >> + integer > >> + > >> + > >> + V4L2_CID_GAIN_GREEN_RED > >> + integer > >> + > >> + > >> + V4L2_CID_GAIN_GREEN_BLUE > >> + integer > >> + > >> + > >> + V4L2_CID_GAIN_BLUE > >> + integer > >> + > >> + > >> + V4L2_CID_GAIN_GREEN > >> + integer > >> + > >> + > >> + Some capture/sensor devices have > >> + the capability to set per color component digital/analog gain values. > >> + > >> + > >> + V4L2_CID_GAIN_OFFSET > >> + integer > >> + > >> + > >> + V4L2_CID_BLUE_OFFSET > >> + integer > >> + > >> + > >> + V4L2_CID_RED_OFFSET > >> + integer > >> + > >> + > >> + V4L2_CID_GREEN_OFFSET > >> + integer > >> + > >> + > >> + V4L2_CID_GREEN_RED_OFFSET > >> + integer > >> + > >> + > >> + V4L2_CID_GREEN_BLUE_OFFSET > >> + integer > >> + > >> + > >> + Some capture/sensor devices have the > >> + capability to set per color component digital/analog gain offset values. > >> + V4L2_CID_GAIN_OFFSET is the global gain offset and the rest are per > >> + color component gain offsets. > > > > If I set both V4L2_CID_GAIN_RED and V4L2_CID_RED_OFFSET, how are they supposed > > to interact? Or are they mutually exclusive? > > > > And if I set both V4L2_CID_GAIN_OFFSET and V4L2_CID_RED_OFFSET, how are they supposed > > to interact? > > > > This questions should be answered in the documentation... > > > I haven’t worked on the hardware which supports both, What is the general > behaviour when the hardware supports both per color component and global > and both of them are set ? That could be helpful for me to document. I'd guess most of the time only either one is supported, and when someone thinks of supporting both on the same device, we can start thinking of the interaction of per-component and global ones. That may be hardware specific as well, so standardising it might not be possible. I think it'd be far more important to know which unit is it. Many such controls are indeed fixed point values but the location of the point varies. For unstance, u16,u16 and u8,u8 aren't uncommon. We currently have no way to tell this to the user space. This isn't in any way specific to gain or offset controls, though. -- Kind regards, Sakari Ailus e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk