public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [soc-camera] about the y_skip_top parameter
@ 2008-09-05 10:39 Sascha Hauer
  2008-09-05 18:12 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2008-09-05 10:39 UTC (permalink / raw)
  To: video4linux-list; +Cc: Guennadi Liakhovetski

Hi all,

The y_skip_top parameter tells the cameras to effectively make the
picture one line higher. I think this parameter was introduced to work
around a bug in the pxa camera interface. The pxa refuses to read the
first line of a picture. The problem with this parameter is that it is
set to 1 in the sensor drivers and not in the pxa driver, so it's the
sensor drivers which work around a bug in the pxa. On other
hardware platforms (mx27 in this particular case) I cannot skip the
first line, so I think this parameter should be set to 1 in the pxa
driver and not the sensor drivers.

What do you think?

Sascha

-- 
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: [soc-camera] about the y_skip_top parameter
  2008-09-05 10:39 [soc-camera] about the y_skip_top parameter Sascha Hauer
@ 2008-09-05 18:12 ` Guennadi Liakhovetski
  2008-09-05 20:16   ` Robert Jarzmik
  2008-09-08 10:34   ` Sascha Hauer
  0 siblings, 2 replies; 6+ messages in thread
From: Guennadi Liakhovetski @ 2008-09-05 18:12 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: video4linux-list

On Fri, 5 Sep 2008, Sascha Hauer wrote:

> Hi all,
> 
> The y_skip_top parameter tells the cameras to effectively make the
> picture one line higher. I think this parameter was introduced to work
> around a bug in the pxa camera interface. The pxa refuses to read the
> first line of a picture. The problem with this parameter is that it is
> set to 1 in the sensor drivers and not in the pxa driver, so it's the
> sensor drivers which work around a bug in the pxa. On other
> hardware platforms (mx27 in this particular case) I cannot skip the
> first line, so I think this parameter should be set to 1 in the pxa
> driver and not the sensor drivers.
> 
> What do you think?

Hm, AFAIR, the reason was different. I was told, that "all" cameras 
corrupt the first line, that's why that parameter has been introduced. I 
don't think it was related to PXA270. In any case, why don't you just set 
this parameter to whatever you need in your hist driver .add method, for 
example, before calling camera's .init?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: [soc-camera] about the y_skip_top parameter
  2008-09-05 18:12 ` Guennadi Liakhovetski
@ 2008-09-05 20:16   ` Robert Jarzmik
  2008-09-08 10:34   ` Sascha Hauer
  1 sibling, 0 replies; 6+ messages in thread
From: Robert Jarzmik @ 2008-09-05 20:16 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: video4linux-list

Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes:

> Hm, AFAIR, the reason was different. I was told, that "all" cameras 
> corrupt the first line, that's why that parameter has been introduced. I 
> don't think it was related to PXA270. In any case, why don't you just set 
> this parameter to whatever you need in your hist driver .add method, for 
> example, before calling camera's .init?

Actually I think there is now one camera at least which doesn't ... the mt9m111
:)

Maybe it has to do with the chip internals, which uses these first lines to
make its calculation on white balance, gamma auto correction etc ...

--
Robert

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: [soc-camera] about the y_skip_top parameter
  2008-09-05 18:12 ` Guennadi Liakhovetski
  2008-09-05 20:16   ` Robert Jarzmik
@ 2008-09-08 10:34   ` Sascha Hauer
  2008-09-09  6:38     ` Guennadi Liakhovetski
  1 sibling, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2008-09-08 10:34 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: video4linux-list

On Fri, Sep 05, 2008 at 08:12:56PM +0200, Guennadi Liakhovetski wrote:
> On Fri, 5 Sep 2008, Sascha Hauer wrote:
> 
> > Hi all,
> > 
> > The y_skip_top parameter tells the cameras to effectively make the
> > picture one line higher. I think this parameter was introduced to work
> > around a bug in the pxa camera interface. The pxa refuses to read the
> > first line of a picture. The problem with this parameter is that it is
> > set to 1 in the sensor drivers and not in the pxa driver, so it's the
> > sensor drivers which work around a bug in the pxa. On other
> > hardware platforms (mx27 in this particular case) I cannot skip the
> > first line, so I think this parameter should be set to 1 in the pxa
> > driver and not the sensor drivers.
> > 
> > What do you think?
> 
> Hm, AFAIR, the reason was different. I was told, that "all" cameras 
> corrupt the first line, that's why that parameter has been introduced. I 
> don't think it was related to PXA270. In any case, why don't you just set 
> this parameter to whatever you need in your hist driver .add method, for 
> example, before calling camera's .init?

That's what I'm doing at the moment. I just had the feeling that there
is a bug fixed in the wrong place, but I did not know that it's the cameras
that corrupt the first line.
Anyway, what in case of bayer cameras? don't we have to skip the first
two lines then? I'm asking because I'm still struggling with getting the
correct pixel in the top left corner without introducing funny offsets.
This brings me back to the question: Which color does the top left
corner have? http://v4l2spec.bytesex.org/spec/r3735.htm says the first is a
blue/red line, due to y_skip_top=1 the pxa actually delivers a green/red
line

Sascha


-- 
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: [soc-camera] about the y_skip_top parameter
  2008-09-08 10:34   ` Sascha Hauer
@ 2008-09-09  6:38     ` Guennadi Liakhovetski
  2008-09-09  7:19       ` Sascha Hauer
  0 siblings, 1 reply; 6+ messages in thread
From: Guennadi Liakhovetski @ 2008-09-09  6:38 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: video4linux-list

On Mon, 8 Sep 2008, Sascha Hauer wrote:

> On Fri, Sep 05, 2008 at 08:12:56PM +0200, Guennadi Liakhovetski wrote:
> > 
> > Hm, AFAIR, the reason was different. I was told, that "all" cameras 
> > corrupt the first line, that's why that parameter has been introduced. I 
> > don't think it was related to PXA270. In any case, why don't you just set 
> > this parameter to whatever you need in your hist driver .add method, for 
> > example, before calling camera's .init?
> 
> That's what I'm doing at the moment. I just had the feeling that there
> is a bug fixed in the wrong place, but I did not know that it's the cameras
> that corrupt the first line.
> Anyway, what in case of bayer cameras? don't we have to skip the first
> two lines then?

I think so, yes. Or you start with the wrong line in your user-space 
application.

> I'm asking because I'm still struggling with getting the
> correct pixel in the top left corner without introducing funny offsets.
> This brings me back to the question: Which color does the top left
> corner have? http://v4l2spec.bytesex.org/spec/r3735.htm says the first is a
> blue/red line, due to y_skip_top=1 the pxa actually delivers a green/red
> line

http://www.siliconimaging.com/RGB%20Bayer.htm shows a green/red line on 
the top. But look in your camera datasheet - at least datasheets I was 
working with did describe the specific pattern the camera was producing. 
For example, mt9m001 also specifies green/red at the top.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: [soc-camera] about the y_skip_top parameter
  2008-09-09  6:38     ` Guennadi Liakhovetski
@ 2008-09-09  7:19       ` Sascha Hauer
  0 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2008-09-09  7:19 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: video4linux-list

On Tue, Sep 09, 2008 at 08:38:55AM +0200, Guennadi Liakhovetski wrote:
> On Mon, 8 Sep 2008, Sascha Hauer wrote:
> 
> > On Fri, Sep 05, 2008 at 08:12:56PM +0200, Guennadi Liakhovetski wrote:
> > > 
> > > Hm, AFAIR, the reason was different. I was told, that "all" cameras 
> > > corrupt the first line, that's why that parameter has been introduced. I 
> > > don't think it was related to PXA270. In any case, why don't you just set 
> > > this parameter to whatever you need in your hist driver .add method, for 
> > > example, before calling camera's .init?
> > 
> > That's what I'm doing at the moment. I just had the feeling that there
> > is a bug fixed in the wrong place, but I did not know that it's the cameras
> > that corrupt the first line.
> > Anyway, what in case of bayer cameras? don't we have to skip the first
> > two lines then?
> 
> I think so, yes. Or you start with the wrong line in your user-space 
> application.
> 
> > I'm asking because I'm still struggling with getting the
> > correct pixel in the top left corner without introducing funny offsets.
> > This brings me back to the question: Which color does the top left
> > corner have? http://v4l2spec.bytesex.org/spec/r3735.htm says the first is a
> > blue/red line, due to y_skip_top=1 the pxa actually delivers a green/red
> > line
> 
> http://www.siliconimaging.com/RGB%20Bayer.htm shows a green/red line on 
> the top. But look in your camera datasheet - at least datasheets I was 
> working with did describe the specific pattern the camera was producing. 
> For example, mt9m001 also specifies green/red at the top.

Ah ok, so even the Micron chips are not consistent. I wonder whether we
should move the pictures in kernel so that they all have the same pixel
in the top left corner or introduce a second bayer fourcc then. It
doesn't seem practical that the userspace apps hold a database of camera
chips.

Sascha

-- 
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

end of thread, other threads:[~2008-09-09  7:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-05 10:39 [soc-camera] about the y_skip_top parameter Sascha Hauer
2008-09-05 18:12 ` Guennadi Liakhovetski
2008-09-05 20:16   ` Robert Jarzmik
2008-09-08 10:34   ` Sascha Hauer
2008-09-09  6:38     ` Guennadi Liakhovetski
2008-09-09  7:19       ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox