All of lore.kernel.org
 help / color / mirror / Atom feed
* [Q] {enum,s,g}_input for subdev ops
@ 2011-02-22 15:16 Guennadi Liakhovetski
       [not found] ` <ddc4d0fcf85526c5fc88594e100f192b.squirrel@webmail.xs4all.nl>
  0 siblings, 1 reply; 5+ messages in thread
From: Guennadi Liakhovetski @ 2011-02-22 15:16 UTC (permalink / raw)
  To: Linux Media Mailing List

Hi

Any thoughts about the subj? Hasn't anyone run into a need to select 
inputs on subdevices until now? Something like

struct v4l2_subdev_video_ops {
	...
	int (*enum_input)(struct v4l2_subdev *sd, struct v4l2_input *inp);
	int (*g_input)(struct v4l2_subdev *sd, unsigned int *i);
	int (*s_input)(struct v4l2_subdev *sd, unsigned int i);

For example, we discussed implementing sensor test patterns as separate 
inputs.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Q] {enum,s,g}_input for subdev ops
       [not found]   ` <Pine.LNX.4.64.1102221733350.1380@axis700.grange>
@ 2011-02-22 17:07     ` Hans Verkuil
  2011-02-22 17:10       ` Guennadi Liakhovetski
  2011-02-23 10:13       ` Guennadi Liakhovetski
  0 siblings, 2 replies; 5+ messages in thread
From: Hans Verkuil @ 2011-02-22 17:07 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: linux-media

On Tuesday, February 22, 2011 17:39:25 Guennadi Liakhovetski wrote:
> On Tue, 22 Feb 2011, Hans Verkuil wrote:
> 
> > > Hi
> > >
> > > Any thoughts about the subj? Hasn't anyone run into a need to select
> > > inputs on subdevices until now? Something like
> > >
> > > struct v4l2_subdev_video_ops {
> > > 	...
> > > 	int (*enum_input)(struct v4l2_subdev *sd, struct v4l2_input *inp);
> > > 	int (*g_input)(struct v4l2_subdev *sd, unsigned int *i);
> > > 	int (*s_input)(struct v4l2_subdev *sd, unsigned int i);
> > 
> > That's done through s_routing. Subdevices know nothing about inputs as
> > shown to userspace.
> > 
> > If you want a test pattern, then the host driver needs to add a "Test
> > Pattern" input and call s_routing with the correct values (specific to
> > that subdev) to set it up.
> 
> Hm, maybe I misunderstood something, but if we understand "host" in the 
> same way, then this doesn't seem very useful to me. What shall the host 
> have to do with various sensor inputs? It cannot know, whether the sensor 
> has a test-pattern "input" and if yes - how many of them. Many sensors 
> have several such patterns, and, I think, some of them also have some 
> parameters, like colour values, etc., which we don't have anything to map 
> to. But even without that - some sensors have several test patterns, which 
> they well might want to be able to switch between by presenting not just 
> one but several test inputs. So, shouldn't we have some enum_routing or 
> something for them?

What you really want is to select a test pattern. A good solution would be
to create a sensor menu control with all the test patterns it supports.

Regards,

	Hans

> 
> Feel free to re-add the ML to CC.
> 
> Thanks
> Guennadi
> 
> > The saa7127 subdev does something like this (see include/media/saa7127.h).
> > The ivtv host driver only selects this during firmware load, though. It's
> > not mapped to a user input.
> > 
> > Regards,
> > 
> >      Hans
> > 
> > >
> > > For example, we discussed implementing sensor test patterns as separate
> > > inputs.
> > >
> > > Thanks
> > > Guennadi
> > > ---
> > > Guennadi Liakhovetski, Ph.D.
> > > Freelance Open-Source Software Developer
> > > http://www.open-technology.de/
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-media" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > >
> > 
> > 
> 
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
> 

-- 
Hans Verkuil - video4linux developer - sponsored by Cisco

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Q] {enum,s,g}_input for subdev ops
  2011-02-22 17:07     ` Hans Verkuil
@ 2011-02-22 17:10       ` Guennadi Liakhovetski
  2011-02-23 10:13       ` Guennadi Liakhovetski
  1 sibling, 0 replies; 5+ messages in thread
From: Guennadi Liakhovetski @ 2011-02-22 17:10 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

On Tue, 22 Feb 2011, Hans Verkuil wrote:

> On Tuesday, February 22, 2011 17:39:25 Guennadi Liakhovetski wrote:
> > On Tue, 22 Feb 2011, Hans Verkuil wrote:
> > 
> > > > Hi
> > > >
> > > > Any thoughts about the subj? Hasn't anyone run into a need to select
> > > > inputs on subdevices until now? Something like
> > > >
> > > > struct v4l2_subdev_video_ops {
> > > > 	...
> > > > 	int (*enum_input)(struct v4l2_subdev *sd, struct v4l2_input *inp);
> > > > 	int (*g_input)(struct v4l2_subdev *sd, unsigned int *i);
> > > > 	int (*s_input)(struct v4l2_subdev *sd, unsigned int i);
> > > 
> > > That's done through s_routing. Subdevices know nothing about inputs as
> > > shown to userspace.
> > > 
> > > If you want a test pattern, then the host driver needs to add a "Test
> > > Pattern" input and call s_routing with the correct values (specific to
> > > that subdev) to set it up.
> > 
> > Hm, maybe I misunderstood something, but if we understand "host" in the 
> > same way, then this doesn't seem very useful to me. What shall the host 
> > have to do with various sensor inputs? It cannot know, whether the sensor 
> > has a test-pattern "input" and if yes - how many of them. Many sensors 
> > have several such patterns, and, I think, some of them also have some 
> > parameters, like colour values, etc., which we don't have anything to map 
> > to. But even without that - some sensors have several test patterns, which 
> > they well might want to be able to switch between by presenting not just 
> > one but several test inputs. So, shouldn't we have some enum_routing or 
> > something for them?
> 
> What you really want is to select a test pattern. A good solution would be
> to create a sensor menu control with all the test patterns it supports.

Ok, so, we think using extra inputs for test patterns is not all that of a 
good idea after all? Maybe you're right. A control menu seems a pretty 
good option to me too.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Q] {enum,s,g}_input for subdev ops
  2011-02-22 17:07     ` Hans Verkuil
  2011-02-22 17:10       ` Guennadi Liakhovetski
@ 2011-02-23 10:13       ` Guennadi Liakhovetski
  2011-02-23 10:29         ` Hans Verkuil
  1 sibling, 1 reply; 5+ messages in thread
From: Guennadi Liakhovetski @ 2011-02-23 10:13 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

On Tue, 22 Feb 2011, Hans Verkuil wrote:

> On Tuesday, February 22, 2011 17:39:25 Guennadi Liakhovetski wrote:
> > On Tue, 22 Feb 2011, Hans Verkuil wrote:
> > 
> > > > Hi
> > > >
> > > > Any thoughts about the subj? Hasn't anyone run into a need to select
> > > > inputs on subdevices until now? Something like
> > > >
> > > > struct v4l2_subdev_video_ops {
> > > > 	...
> > > > 	int (*enum_input)(struct v4l2_subdev *sd, struct v4l2_input *inp);
> > > > 	int (*g_input)(struct v4l2_subdev *sd, unsigned int *i);
> > > > 	int (*s_input)(struct v4l2_subdev *sd, unsigned int i);
> > > 
> > > That's done through s_routing. Subdevices know nothing about inputs as
> > > shown to userspace.
> > > 
> > > If you want a test pattern, then the host driver needs to add a "Test
> > > Pattern" input and call s_routing with the correct values (specific to
> > > that subdev) to set it up.
> > 
> > Hm, maybe I misunderstood something, but if we understand "host" in the 
> > same way, then this doesn't seem very useful to me. What shall the host 
> > have to do with various sensor inputs? It cannot know, whether the sensor 
> > has a test-pattern "input" and if yes - how many of them. Many sensors 
> > have several such patterns, and, I think, some of them also have some 
> > parameters, like colour values, etc., which we don't have anything to map 
> > to. But even without that - some sensors have several test patterns, which 
> > they well might want to be able to switch between by presenting not just 
> > one but several test inputs. So, shouldn't we have some enum_routing or 
> > something for them?
> 
> What you really want is to select a test pattern. A good solution would be
> to create a sensor menu control with all the test patterns it supports.

Ok, thinking a bit further about it. Let's take mt9p031 as an example - a 
pretty simple bayer-only sensor. The driver is not yet in the mainline, 
but I'll be pushing something simple in the mainline soon. I just picked 
it up as an example, because it has quite a few test modes.

On the total it can generate 9 test patterns, including gradients, bars, 
constant colour-field, etc. Apart from selecting a specific test pattern, 
the RGB colour values and monochrome "intensity" values and bar widths can 
be set for the colour-field and monochrome-bars test-patterns respectively.

Using a control menu we can select one of the 9 test-modes. But do we also 
want standard controls for colour values and bar widths? Or are they too 
hardware-specific and too unimportant and can only be supported by private 
controls?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Q] {enum,s,g}_input for subdev ops
  2011-02-23 10:13       ` Guennadi Liakhovetski
@ 2011-02-23 10:29         ` Hans Verkuil
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Verkuil @ 2011-02-23 10:29 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: Hans Verkuil, linux-media

On Wednesday, February 23, 2011 11:13:57 Guennadi Liakhovetski wrote:
> On Tue, 22 Feb 2011, Hans Verkuil wrote:
> 
> > On Tuesday, February 22, 2011 17:39:25 Guennadi Liakhovetski wrote:
> > > On Tue, 22 Feb 2011, Hans Verkuil wrote:
> > > 
> > > > > Hi
> > > > >
> > > > > Any thoughts about the subj? Hasn't anyone run into a need to select
> > > > > inputs on subdevices until now? Something like
> > > > >
> > > > > struct v4l2_subdev_video_ops {
> > > > > 	...
> > > > > 	int (*enum_input)(struct v4l2_subdev *sd, struct v4l2_input 
*inp);
> > > > > 	int (*g_input)(struct v4l2_subdev *sd, unsigned int *i);
> > > > > 	int (*s_input)(struct v4l2_subdev *sd, unsigned int i);
> > > > 
> > > > That's done through s_routing. Subdevices know nothing about inputs as
> > > > shown to userspace.
> > > > 
> > > > If you want a test pattern, then the host driver needs to add a "Test
> > > > Pattern" input and call s_routing with the correct values (specific to
> > > > that subdev) to set it up.
> > > 
> > > Hm, maybe I misunderstood something, but if we understand "host" in the 
> > > same way, then this doesn't seem very useful to me. What shall the host 
> > > have to do with various sensor inputs? It cannot know, whether the 
sensor 
> > > has a test-pattern "input" and if yes - how many of them. Many sensors 
> > > have several such patterns, and, I think, some of them also have some 
> > > parameters, like colour values, etc., which we don't have anything to 
map 
> > > to. But even without that - some sensors have several test patterns, 
which 
> > > they well might want to be able to switch between by presenting not just 
> > > one but several test inputs. So, shouldn't we have some enum_routing or 
> > > something for them?
> > 
> > What you really want is to select a test pattern. A good solution would be
> > to create a sensor menu control with all the test patterns it supports.
> 
> Ok, thinking a bit further about it. Let's take mt9p031 as an example - a 
> pretty simple bayer-only sensor. The driver is not yet in the mainline, 
> but I'll be pushing something simple in the mainline soon. I just picked 
> it up as an example, because it has quite a few test modes.
> 
> On the total it can generate 9 test patterns, including gradients, bars, 
> constant colour-field, etc. Apart from selecting a specific test pattern, 
> the RGB colour values and monochrome "intensity" values and bar widths can 
> be set for the colour-field and monochrome-bars test-patterns respectively.
> 
> Using a control menu we can select one of the 9 test-modes. But do we also 
> want standard controls for colour values and bar widths? Or are they too 
> hardware-specific and too unimportant and can only be supported by private 
> controls?

I think all test pattern controls would be prime candidates as subdev-specific 
controls: they are hardware specific so it's difficult anyway to make them 
generic controls and they are typically only used for debugging.

But we can't do that until the MC code is merged. This also requires that the 
subdev uses the control framework.

The MC code will hopefully be merged soon and I have worked on the control 
framework patches for soc-camera, although those need more work.

Regards,

	Hans

> 
> Thanks
> Guennadi
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-23 10:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-22 15:16 [Q] {enum,s,g}_input for subdev ops Guennadi Liakhovetski
     [not found] ` <ddc4d0fcf85526c5fc88594e100f192b.squirrel@webmail.xs4all.nl>
     [not found]   ` <Pine.LNX.4.64.1102221733350.1380@axis700.grange>
2011-02-22 17:07     ` Hans Verkuil
2011-02-22 17:10       ` Guennadi Liakhovetski
2011-02-23 10:13       ` Guennadi Liakhovetski
2011-02-23 10:29         ` Hans Verkuil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.