public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Re: About CITOR register value for pxa_camera
@ 2008-11-07 12:01 fpantaleao
  2008-11-29  1:42 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 16+ messages in thread
From: fpantaleao @ 2008-11-07 12:01 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: video4linux-list@redhat.com

On Fri, 7 Nov 2008, g.liakhovetski@gmx.de wrote:

> On Fri, 7 Nov 2008, fpantaleao@mobisensesystems.com wrote:
>
> > To be more general (sensor clocked by MCLK or not), I think we  
> should request
> > the sensor its PCLK, by adding a get_pclk member in soc_camera_ops for
> > example.
>
> Yes, that should be even better, and pass master-clock frequency as  
> a parameter? What shall we take for default? pclk == mclk or some  
> safe conservative value? Don't think requiring every camera driver  
> to provide this method would be very good.

MCLK as a parameter is fine.
For the default, I suggest:
   PCLK = MCLK when MCLK is enabled,
   13MHz otherwise which is a low value for PCLK.

I agree we must keep things simple even if a correct value for CITOR  
really improves acquisition performance.

>
> Another question, are there situations, when a sensor might decide  
> to change its pixelclock dynamically? Then it might need to inform  
> the host driver about the change?

PCLK changes dynamically with sensor resolution, subsampling, pixel  
format and so on. Every time a format change occurs, CITOR could be  
updated in 2 steps:
1. PCLK value should be updated by the camera driver.
The computation is based on the sensor input clock (provided by  
platform data) and current settings.
To make things more simple, the camera driver can use a constant equal  
to the lowest possible value.
2. PCLK value should be read to compute the new CITOR value.

Best regards.

Florian


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




--
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] 16+ messages in thread
* Re: About CITOR register value for pxa_camera
@ 2008-11-07  6:22 fpantaleao
  2008-11-07  7:58 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 16+ messages in thread
From: fpantaleao @ 2008-11-07  6:22 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: video4linux-list@redhat.com

> On Thu, 6 Nov 2008, fpantaleao@mobisensesystems.com wrote:
>
> > Sure we can do it that way if the sensor is clocked by MCLK and no  
> prescale is
> > done by the sensor.
> > In other cases, PCLK is controlled by sensor:
> > - sensor has its own clock
> > - MCLK is prescaled by the sensor.
>
> Right, then maybe we should request the sensor what quotient it's  
> running its pixel clock respective our master clock? In the master  
> mode, of course.

To be more general (sensor clocked by MCLK or not), I think we should  
request the sensor its PCLK, by adding a get_pclk member in  
soc_camera_ops for example.
Then CITOR value can be computed.
On the sensor side, PCLK value can be defined in its platform data. I  
agree this is redundant for a MT9V022 clocked by MCLK but to my point  
of view, this is not the general case.

Best regards

Florian

>
> (Please, don't top-post)
>
> Thanks
> Guennadi
>
> > > Florian
> > > ----- Original Message -----
> > From: "Guennadi Liakhovetski" <g.liakhovetski@gmx.de>
> > To: <fpantaleao@mobisensesystems.com>
> > Cc: <video4linux-list@redhat.com>
> > Sent: Wednesday, November 05, 2008 8:31 PM
> > Subject: Re: About CITOR register value for pxa_camera
> > > > > On Wed, 5 Nov 2008, fpantaleao@mobisensesystems.com wrote:
> > > > > > Thank you for your answer.
> > > > I have tested with "67 x 1" resolution (and many others), I can't with
> > > > "1619 x
> > > > 1".
> > > > I don't get overruns with CITOR != 0.
> > > > > Before submitting a patch, I would like to have the opinion of other
> > > > developpers about the CITOR value.
> > > > The resulting time-out is CITOR/CICLK. What we need is a time-out a bit
> > > > longer than 1 pixel period (1/PCLK).
> > > > The condition for CITOR is then: CITOR > CICLK/PCLK.
> > > > Since PCLK is a platform dependent value, I suggest to add a field in
> > > > pxacamera_platform_data.
> > > > If no value is assigned, a value of 16 can be used which equals 2 pixel
> > > > periods when PCLK=13MHz ("slow" sensor) and CICLK=104MHz (highest CI
> > > > clock).
> > > > CITOR can be set in pxa_camera_activate.
> > > > > Don't think we need any extra fields in  
> pxacamera_platform_data, look at
> > > mclk_get_divisor() - it gets already the lcdclk frequency, which  
> is the same
> > > as CICLK, and our target MCLK frequency is set in  
> platform_mclk_10khz, so,
> > > you should have all the data you need...
> > > > > Thanks
> > > Guennadi
> > > > > > > Best regards
> > > > > Florian
> > > > > > fpantaleao@mobisensesystems.com writes:
> > > > > > > > Hi all,
> > > > > > > > > While testing, I think I have found one reason why overruns
> > > > occur with
> > > > > > pxa_camera.
> > > > > > I propose to set CITOR to a non-null value.
> > > > > Yes, seconded.
> > > > > > > > I would appreciate any comment about this.
> > > > > Well, at first sight I would advice to test some corner case  
> to see if
> > > > DMA
> > > > > trailing bytes are handled well. I know this can be a pain,  
> but you seem
> > > > to be
> > > > > testing thouroughly ..
> > > > > > > So, if your configuration/sensor is able to, try some funny
> > > > resolution
> > > > like
> > > > > "1619 x 1", and then "67 x 1", and see what happens. If you  
> don't have
> > > > any
> > > > > capture issue, you're done, and post a patch (only CITOR or CITOR +
> > > > trailling
> > > > > bytes handling).
> > > > > > > Have fun.
> > > > > > > --
> > > > > Robert
> > > > > > ----------------------------------------------------------------
> > > > This message was sent using IMP, the Internet Messaging Program.
> > > > > > > > --
> > > > video4linux-list mailing list
> > > > Unsubscribe  
> mailto:video4linux-list-request@redhat.com?subject=unsubscribe
> > > > https://www.redhat.com/mailman/listinfo/video4linux-list
> > > > > ---
> > > Guennadi Liakhovetski, Ph.D.
> > > Freelance Open-Source Software Developer
> > > ----------------------------------------------------------------
> > This message was sent using IMP, the Internet Messaging Program.
> > > ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




--
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] 16+ messages in thread
* Re: About CITOR register value for pxa_camera
@ 2008-11-06  5:26 fpantaleao
  2008-11-06 23:57 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 16+ messages in thread
From: fpantaleao @ 2008-11-06  5:26 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: video4linux-list@redhat.com


Sure we can do it that way if the sensor is clocked by MCLK and no  
prescale is done by the sensor.
In other cases, PCLK is controlled by sensor:
  - sensor has its own clock
  - MCLK is prescaled by the sensor.

Florian

----- Original Message -----
From: "Guennadi Liakhovetski" <g.liakhovetski@gmx.de>
To: <fpantaleao@mobisensesystems.com>
Cc: <video4linux-list@redhat.com>
Sent: Wednesday, November 05, 2008 8:31 PM
Subject: Re: About CITOR register value for pxa_camera


> On Wed, 5 Nov 2008, fpantaleao@mobisensesystems.com wrote:
>
> > Thank you for your answer.
> > I have tested with "67 x 1" resolution (and many others), I can't  
> with "1619 x
> > 1".
> > I don't get overruns with CITOR != 0.
> > > Before submitting a patch, I would like to have the opinion of other
> > developpers about the CITOR value.
> > The resulting time-out is CITOR/CICLK. What we need is a time-out a bit
> > longer than 1 pixel period (1/PCLK).
> > The condition for CITOR is then: CITOR > CICLK/PCLK.
> > Since PCLK is a platform dependent value, I suggest to add a field in
> > pxacamera_platform_data.
> > If no value is assigned, a value of 16 can be used which equals 2 pixel
> > periods when PCLK=13MHz ("slow" sensor) and CICLK=104MHz (highest  
> CI clock).
> > CITOR can be set in pxa_camera_activate.
>
> Don't think we need any extra fields in pxacamera_platform_data,  
> look at mclk_get_divisor() - it gets already the lcdclk frequency,  
> which is the same as CICLK, and our target MCLK frequency is set in  
> platform_mclk_10khz, so, you should have all the data you need...
>
> Thanks
> Guennadi
>
> > > Best regards
> > > Florian
> > > > fpantaleao@mobisensesystems.com writes:
> > > > > > Hi all,
> > > > > > > While testing, I think I have found one reason why  
> overruns occur with
> > > > pxa_camera.
> > > > I propose to set CITOR to a non-null value.
> > > Yes, seconded.
> > > > > > I would appreciate any comment about this.
> > > Well, at first sight I would advice to test some corner case to  
> see if DMA
> > > trailing bytes are handled well. I know this can be a pain, but you seem
> > to be
> > > testing thouroughly ..
> > > > > So, if your configuration/sensor is able to, try some funny  
> resolution
> > like
> > > "1619 x 1", and then "67 x 1", and see what happens. If you  
> don't have any
> > > capture issue, you're done, and post a patch (only CITOR or CITOR +
> > trailling
> > > bytes handling).
> > > > > Have fun.
> > > > > --
> > > Robert
> > > > ----------------------------------------------------------------
> > This message was sent using IMP, the Internet Messaging Program.
> > > > > > --
> > video4linux-list mailing list
> > Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
> > https://www.redhat.com/mailman/listinfo/video4linux-list
>
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




--
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] 16+ messages in thread
* Re: About CITOR register value for pxa_camera
@ 2008-11-05 14:14 fpantaleao
  2008-11-05 19:31 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 16+ messages in thread
From: fpantaleao @ 2008-11-05 14:14 UTC (permalink / raw)
  To: video4linux-list

Thank you for your answer.
I have tested with "67 x 1" resolution (and many others), I can't with  
"1619 x 1".
I don't get overruns with CITOR != 0.

Before submitting a patch, I would like to have the opinion of other
developpers about the CITOR value.
The resulting time-out is CITOR/CICLK. What we need is a time-out a bit
longer than 1 pixel period (1/PCLK).
The condition for CITOR is then: CITOR > CICLK/PCLK.
Since PCLK is a platform dependent value, I suggest to add a field in
pxacamera_platform_data.
If no value is assigned, a value of 16 can be used which equals 2 pixel
periods when PCLK=13MHz ("slow" sensor) and CICLK=104MHz (highest CI clock).
CITOR can be set in pxa_camera_activate.

Best regards

Florian

> fpantaleao@mobisensesystems.com writes:
>
> > Hi all,
> >
> > While testing, I think I have found one reason why overruns occur with
> > pxa_camera.
> > I propose to set CITOR to a non-null value.
> Yes, seconded.
>
> > I would appreciate any comment about this.
> Well, at first sight I would advice to test some corner case to see if DMA
> trailing bytes are handled well. I know this can be a pain, but you seem
to be
> testing thouroughly ..
>
> So, if your configuration/sensor is able to, try some funny resolution
like
> "1619 x 1", and then "67 x 1", and see what happens. If you don't have any
> capture issue, you're done, and post a patch (only CITOR or CITOR +
trailling
> bytes handling).
>
> Have fun.
>
> --
> Robert


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




--
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] 16+ messages in thread
* About CITOR register value for pxa_camera
@ 2008-10-31 15:05 fpantaleao
  2008-10-31 18:45 ` Robert Jarzmik
  0 siblings, 1 reply; 16+ messages in thread
From: fpantaleao @ 2008-10-31 15:05 UTC (permalink / raw)
  To: video4linux-list

Hi all,

While testing, I think I have found one reason why overruns occur with  
pxa_camera.
I propose to set CITOR to a non-null value.
I have no more overrun for single image grab with CITOR=16 and much
greater reactivity.
There are still overrun for multiple image grab, I investigate that also and
post a message about it soon.

I would appreciate any comment about this.

Best regards.

--
Florian PANTALEAO
MOBISENSE SYSTEMS SARL


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



--
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] 16+ messages in thread

end of thread, other threads:[~2008-12-01 21:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-07 12:01 About CITOR register value for pxa_camera fpantaleao
2008-11-29  1:42 ` Guennadi Liakhovetski
2008-11-30 22:42   ` Robert Jarzmik
2008-11-30 23:59     ` Guennadi Liakhovetski
2008-12-01  9:41     ` [PATCH 1/2] soc-camera: add camera sense data Guennadi Liakhovetski
2008-12-01  9:41       ` [PATCH 2/2] pxa-camera: setup the FIFO inactivity time-out register Guennadi Liakhovetski
2008-12-01 15:14     ` About CITOR register value for pxa_camera Guennadi Liakhovetski
2008-12-01 21:13       ` Robert Jarzmik
  -- strict thread matches above, loose matches on Subject: below --
2008-11-07  6:22 fpantaleao
2008-11-07  7:58 ` Guennadi Liakhovetski
2008-11-06  5:26 fpantaleao
2008-11-06 23:57 ` Guennadi Liakhovetski
2008-11-05 14:14 fpantaleao
2008-11-05 19:31 ` Guennadi Liakhovetski
2008-10-31 15:05 fpantaleao
2008-10-31 18:45 ` Robert Jarzmik

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