linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris MacGregor <chris@cybermato.com>
To: Sakari Ailus <sakari.ailus@iki.fi>,
	Prabhakar Lad <prabhakar.csengg@gmail.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Hans de Goede <hdegoede@redhat.com>,
	dlos <davinci-linux-open-source@linux.davincidsp.com>,
	linux-media <linux-media@vger.kernel.org>,
	Prabhakar Lad <prabhakar.lad@ti.com>,
	Manjunath Hadli <manjunath.hadli@ti.com>
Subject: Re: Gain controls in v4l2-ctrl framework
Date: Wed, 26 Sep 2012 07:42:41 -0700	[thread overview]
Message-ID: <50631461.7080903@cybermato.com> (raw)
In-Reply-To: <20120926074240.GM12025@valkosipuli.retiisi.org.uk>

Hi.

On 09/26/2012 12:42 AM, Sakari Ailus wrote:
> On Wed, Sep 26, 2012 at 12:14:36PM +0530, Prabhakar Lad wrote:
>> Hi All,
>>
>> On Sun, Sep 23, 2012 at 4:56 PM, Prabhakar Lad
>> <prabhakar.csengg@gmail.com> wrote:
>>> Hi All,
>>>
>>> The CCD/Sensors have the capability to adjust the R/ye, Gr/Cy, Gb/G,
>>> B/Mg gain values.
>>> Since these control can be re-usable I am planning to add the
>>> following gain controls as part
>>> of the framework:
>>>
>>> 1: V4L2_CID_GAIN_RED
>>> 2: V4L2_CID_GAIN_GREEN_RED
>>> 3: V4L2_CID_GAIN_GREEN_BLUE
>>> 4: V4L2_CID_GAIN_BLUE
>>> 5: V4L2_CID_GAIN_OFFSET
>>>
>>> I need your opinion's to get moving to add them.
>>>
>> I am listing out the gain controls which is the outcome of above discussion:-
>>
>> 1: V4L2_CID_GAIN_RED
>> 2: V4L2_CID_GAIN_GREEN_RED
>> 3: V4L2_CID_GAIN_GREEN_BLUE
>> 4: V4L2_CID_GAIN_BLUE
>> 5: V4L2_CID_GAIN_OFFSET
>> 6: V4L2_CID_BLUE_OFFSET
>> 7: V4L2_CID_RED_OFFSET
>> 8: V4L2_CID_GREEN_OFFSET
> Hi Prabhakar,
>
> As these are low level controls, I wonder whether it would make sense to
> make a difference between digital and analogue gain. I admit I'm not quite
> as certain whether there's such a large difference as there is for global
> gains for the camera control algorithms.

Sorry to make this more complicated, but the Aptina MT9P031, for 
instance (datasheet at 
http://www.aptina.com/assets/downloadDocument.do?id=865 - see page 35), 
has Digital Gain, an Analog Multiplier, and Analog Gain (for each of R, 
Gr, Gb, and B). For each color channel, there is one register, with the 
bits divided up into the three gain types. Furthermore, the different 
gain types have different units (increments).

Currently (at least in the last version I've used), the driver hides all 
this and provides a single gain control, and prioritizes which gain 
types are adjusted at different user-level gain settings in accordance 
with the datasheet recommendations (e.g. keep the analog gain between 1 
and 4 for best noise performance, and use the multiplier for gains 
between 4 and 8). This seems very sensible. If we try to distinguish 
between analog and digital gains in the control definitions, what should 
this driver do? And what about the multiplier? I suppose it could be 
"hidden" by the driver as part of the analog gain, as the driver 
currently does for the entire gain...

Cheers,
Chris

  parent reply	other threads:[~2012-09-26 14:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-23 11:26 Gain controls in v4l2-ctrl framework Prabhakar Lad
2012-09-23 13:20 ` Sakari Ailus
2012-09-23 16:17   ` Laurent Pinchart
2012-09-23 16:27     ` Sakari Ailus
2012-09-24 11:05       ` Laurent Pinchart
2012-09-24 10:55 ` Hans de Goede
2012-09-24 11:00   ` Laurent Pinchart
2012-09-24 11:04     ` Hans de Goede
2012-09-24 14:42   ` Prabhakar Lad
2012-09-24 17:17     ` Chris MacGregor
2012-09-24 18:46       ` Hans de Goede
2012-09-24 19:16         ` Chris MacGregor
2012-09-24 20:12           ` Sakari Ailus
2012-09-24 20:27           ` Laurent Pinchart
2012-09-24 20:06 ` Sakari Ailus
2012-09-24 20:42   ` Laurent Pinchart
2012-09-26  6:44 ` Prabhakar Lad
2012-09-26  6:53   ` Chris MacGregor
2012-09-26  7:01     ` Prabhakar Lad
2012-09-26  7:42   ` Sakari Ailus
2012-09-26  7:46     ` Prabhakar Lad
2012-09-26  7:54       ` Sakari Ailus
2012-09-26  8:06         ` Prabhakar Lad
2012-09-26 14:42     ` Chris MacGregor [this message]
2012-09-26 15:23       ` Laurent Pinchart
2012-09-26 19:23         ` Sakari Ailus

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=50631461.7080903@cybermato.com \
    --to=chris@cybermato.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=hdegoede@redhat.com \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=manjunath.hadli@ti.com \
    --cc=prabhakar.csengg@gmail.com \
    --cc=prabhakar.lad@ti.com \
    --cc=s.nawrocki@samsung.com \
    --cc=sakari.ailus@iki.fi \
    /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;
as well as URLs for NNTP newsgroup(s).