linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ipu3-cio2: Fix pixel-rate derived link frequency
@ 2021-02-15  7:57 Sakari Ailus
  2021-02-15 11:25 ` Laurent Pinchart
  2021-02-16 10:34 ` Bingbu Cao
  0 siblings, 2 replies; 4+ messages in thread
From: Sakari Ailus @ 2021-02-15  7:57 UTC (permalink / raw)
  To: linux-media; +Cc: laurent.pinchart, bingbu.cao

The driver uses v4l2_get_link_freq() helper to obtain the link frequency
using the LINK_FREQ but also the PIXEL_RATE control. The divisor for the
pixel rate derived link frequency was wrong, missing the bus uses double
data rate. Fix this.

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Fixes: 4b6c129e87a3 ("media: ipu3-cio2: Use v4l2_get_link_freq helper")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
index 6e8c0c230e11..fecef85bd62e 100644
--- a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
@@ -302,7 +302,7 @@ static int cio2_csi2_calc_timing(struct cio2_device *cio2, struct cio2_queue *q,
 	if (!q->sensor)
 		return -ENODEV;
 
-	freq = v4l2_get_link_freq(q->sensor->ctrl_handler, bpp, lanes);
+	freq = v4l2_get_link_freq(q->sensor->ctrl_handler, bpp, lanes * 2);
 	if (freq < 0) {
 		dev_err(dev, "error %lld, invalid link_freq\n", freq);
 		return freq;
-- 
2.29.2


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

* Re: [PATCH 1/1] ipu3-cio2: Fix pixel-rate derived link frequency
  2021-02-15  7:57 [PATCH 1/1] ipu3-cio2: Fix pixel-rate derived link frequency Sakari Ailus
@ 2021-02-15 11:25 ` Laurent Pinchart
  2021-03-23 15:27   ` Laurent Pinchart
  2021-02-16 10:34 ` Bingbu Cao
  1 sibling, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2021-02-15 11:25 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media, bingbu.cao

Hi Sakari,

Thank you for the patch.

On Mon, Feb 15, 2021 at 09:57:42AM +0200, Sakari Ailus wrote:
> The driver uses v4l2_get_link_freq() helper to obtain the link frequency
> using the LINK_FREQ but also the PIXEL_RATE control. The divisor for the
> pixel rate derived link frequency was wrong, missing the bus uses double
> data rate. Fix this.
> 
> Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Fixes: 4b6c129e87a3 ("media: ipu3-cio2: Use v4l2_get_link_freq helper")
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
> index 6e8c0c230e11..fecef85bd62e 100644
> --- a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
> +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
> @@ -302,7 +302,7 @@ static int cio2_csi2_calc_timing(struct cio2_device *cio2, struct cio2_queue *q,
>  	if (!q->sensor)
>  		return -ENODEV;
>  
> -	freq = v4l2_get_link_freq(q->sensor->ctrl_handler, bpp, lanes);
> +	freq = v4l2_get_link_freq(q->sensor->ctrl_handler, bpp, lanes * 2);
>  	if (freq < 0) {
>  		dev_err(dev, "error %lld, invalid link_freq\n", freq);
>  		return freq;

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/1] ipu3-cio2: Fix pixel-rate derived link frequency
  2021-02-15  7:57 [PATCH 1/1] ipu3-cio2: Fix pixel-rate derived link frequency Sakari Ailus
  2021-02-15 11:25 ` Laurent Pinchart
@ 2021-02-16 10:34 ` Bingbu Cao
  1 sibling, 0 replies; 4+ messages in thread
From: Bingbu Cao @ 2021-02-16 10:34 UTC (permalink / raw)
  To: Sakari Ailus, linux-media; +Cc: laurent.pinchart, bingbu.cao

Laurent and Sakari, thanks.

On 2/15/21 3:57 PM, Sakari Ailus wrote:
> The driver uses v4l2_get_link_freq() helper to obtain the link frequency
> using the LINK_FREQ but also the PIXEL_RATE control. The divisor for the
> pixel rate derived link frequency was wrong, missing the bus uses double
> data rate. Fix this.
> 
> Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Fixes: 4b6c129e87a3 ("media: ipu3-cio2: Use v4l2_get_link_freq helper")
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
> index 6e8c0c230e11..fecef85bd62e 100644
> --- a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
> +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
> @@ -302,7 +302,7 @@ static int cio2_csi2_calc_timing(struct cio2_device *cio2, struct cio2_queue *q,
>  	if (!q->sensor)
>  		return -ENODEV;
>  
> -	freq = v4l2_get_link_freq(q->sensor->ctrl_handler, bpp, lanes);
> +	freq = v4l2_get_link_freq(q->sensor->ctrl_handler, bpp, lanes * 2);
>  	if (freq < 0) {
>  		dev_err(dev, "error %lld, invalid link_freq\n", freq);
>  		return freq;
> 

Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>

-- 
Best regards,
Bingbu Cao

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

* Re: [PATCH 1/1] ipu3-cio2: Fix pixel-rate derived link frequency
  2021-02-15 11:25 ` Laurent Pinchart
@ 2021-03-23 15:27   ` Laurent Pinchart
  0 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2021-03-23 15:27 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media, bingbu.cao, Jean-Michel Hautbois

Hi Sakari,

Do you plan to send a pull request for this ? I don't see the patch in
neither the master nor fixes branches of Mauro's tree.

On Mon, Feb 15, 2021 at 01:25:45PM +0200, Laurent Pinchart wrote:
> Hi Sakari,
> 
> Thank you for the patch.
> 
> On Mon, Feb 15, 2021 at 09:57:42AM +0200, Sakari Ailus wrote:
> > The driver uses v4l2_get_link_freq() helper to obtain the link frequency
> > using the LINK_FREQ but also the PIXEL_RATE control. The divisor for the
> > pixel rate derived link frequency was wrong, missing the bus uses double
> > data rate. Fix this.
> > 
> > Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Fixes: 4b6c129e87a3 ("media: ipu3-cio2: Use v4l2_get_link_freq helper")
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> > ---
> >  drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
> > index 6e8c0c230e11..fecef85bd62e 100644
> > --- a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
> > +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
> > @@ -302,7 +302,7 @@ static int cio2_csi2_calc_timing(struct cio2_device *cio2, struct cio2_queue *q,
> >  	if (!q->sensor)
> >  		return -ENODEV;
> >  
> > -	freq = v4l2_get_link_freq(q->sensor->ctrl_handler, bpp, lanes);
> > +	freq = v4l2_get_link_freq(q->sensor->ctrl_handler, bpp, lanes * 2);
> >  	if (freq < 0) {
> >  		dev_err(dev, "error %lld, invalid link_freq\n", freq);
> >  		return freq;

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2021-03-23 15:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-15  7:57 [PATCH 1/1] ipu3-cio2: Fix pixel-rate derived link frequency Sakari Ailus
2021-02-15 11:25 ` Laurent Pinchart
2021-03-23 15:27   ` Laurent Pinchart
2021-02-16 10:34 ` Bingbu Cao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).