lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 12 Dec 2012 00:06:56 +0200
From:	Sakari Ailus <sakari.ailus@....fi>
To:	Hans Verkuil <hverkuil@...all.nl>
Cc:	Prabhakar Lad <prabhakar.csengg@...il.com>,
	LMML <linux-media@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	LDOC <linux-doc@...r.kernel.org>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Kyungmin Park <kyungmin.park@...sung.com>,
	Guennadi Liakhovetski <g.liakhovetski@....de>,
	Sylwester Nawrocki <s.nawrocki@...sung.com>,
	Hans Verkuil <hans.verkuil@...co.com>,
	Hans de Goede <hdegoede@...hat.com>,
	Chris MacGregor <chris@...ermato.com>,
	Rob Landley <rob@...dley.net>,
	Jeongtae Park <jtp.park@...sung.com>,
	Mauro Carvalho Chehab <mchehab@...radead.org>
Subject: Re: [PATCH RFC v2] media: v4l2-ctrl: Add gain controls

Hi Hans,

On Tue, Dec 11, 2012 at 09:56:42AM +0100, Hans Verkuil wrote:
...
> > > > 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,
> 
> Are you talking about GAIN_RED vs GAIN_RED_OFFSET or GAIN_OFFSET vs RED_OFFSET?
> Or both?

Per-component vs. global controls.

Few devices support both; AFAIR on SMIA the user can choose which one to
use, but the driver implements neither currently.

> > 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.
> 
> There are no standardized units for gain at the moment, and I don't really see
> that happening any time soon. Fixed point isn't supported at all as a control
> type, so that will have to be converted to an integer anyway.

Do you think it'd require a new control type? There might be many; some
devices use funny fixed point values, such as u8.u5. I guess you could use
step for those, sure.

For instance, some sensors natively use lines to tell the exposure value
(and in low level sensors control the granularity really matters, so lines
it should be) whereas some SoC ones could use µs instead.

This is about units and prefixes IMO. Fixed point is just a prefix, such as
milli or micro, but instead of being a power of ten it's a power of two.

This would also allow telling the user about a gain control that e.g. the
value 0x100 means "no gain".

I think someone should write an RFC about this. :-)

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@....fi	XMPP: sailus@...iisi.org.uk
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ