Re: [Patch 1/3] media: ov5640: add PIXEL_RATE control

From: Jacopo Mondi
Date: Wed Oct 02 2019 - 10:30:49 EST


Hi Benoit,

On Wed, Oct 02, 2019 at 07:14:38AM -0500, Benoit Parrot wrote:
> Hi Jacopo,
>
> Maybe, I miss spoke when I mentioned a helper I did not intent a framework
> level generic function. Just a function to help in this case :)

Yes indeed, the discussion thread I linked here was mostly interesting
because Hugues tried to do the same for LINK_FREQ iirc, and there
where some usefult pointers.

>
> That being said, I re-read the thread you mentioned. And as Hughes pointed
> out dynamically generating a "working" link frequency value which can be
> used by a CSI2 receiver to properly configure its PHY is not trivial.
>
> When I created this patch, I also had another to add V4L2_CID_LINK_FREQ
> support. I am testing this against the TI CAL CSI2 receiver, which already
> uses the V4L2_CID_PIXEL_RATE value for that purpose, so I also had a patch
> to add support for V4L2_CID_LINK_FREQ to that driver as well.
>
> Unfortunately, similar to Hughes' findings I was not able to make it "work"
> with all supported resolution/framerate.

As reported by Hugues findings, the PLL calculation procedure might be
faulty, and the actuall frequencies on the bus are different from the
calculated ones.

I wish I had more time to re-look at that, as they worked for my and
Sam's use case, but deserve some rework.

>
> Unlike my V4L2_CID_PIXEL_RATE solution which now works in all mode with the
> same receiver.
>

It seems to me you're reporting a fixed rate. It might make your
receiver happy, but does not report what is acutally put on the bus.
Am I missing something ?

> So long story short I dropped the V4L2_CID_LINK_FREQ patch and focused on
> V4L2_CID_PIXEL_RATE instead.
>

As Sakari pointed out, going from one to the other is trivial and
could be done on top.

Thanks
j

> Regard,
> Benoit
>
> Jacopo Mondi <jacopo@xxxxxxxxxx> wrote on Wed [2019-Oct-02 09:59:51 +0200]:
> > Hi Benoit,
> > +Hugues
> >
> > If you're considering an helper, this thread might be useful to you:
> > https://patchwork.kernel.org/patch/11019673/
> >
> > Thanks
> > j
> >
>
>

Attachment: signature.asc
Description: PGP signature