ipu3-cio2: Fix pixel-rate derived link frequency
Subsystems (2)
Sakari Ailus
maintainerPATCH 1/1 ipu3-cio2: Fix pixel-rate derived link frequency
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.
--- drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/intel/ipu3/ipu3-cio2-main.c +1 -1
@@ -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;
Signature · 1 line
2.29.2
Hi Sakari,
Thank you for the patch.
Quoted 8 lines · Sakari Ailus
The driver uses
v4l2_get_link_freq()helper to obtain the link frequency using theLINK_FREQbut also thePIXEL_RATEcontrol. The divisor for the pixel rate derived link frequency was wrong, missing the bus uses double data rate. Fix this.Reported-by Laurent Pinchart <[email protected]>Fixes 4b6c129e87a3 ("media: ipu3-cio2: Use v4l2_get_link_freq helper")Signed-off-by Sakari Ailus <[email protected]>
Quoted 17 lines
--- drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/pci/intel/ipu3/ipu3-cio2-main.c +1
-1@@ -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;
Signature · 3 lines
Regards, Laurent Pinchart
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.
Quoted 33 lines · Laurent Pinchart
Hi Sakari,
Thank you for the patch.
Quoted 8 lines · Sakari Ailus
The driver uses
v4l2_get_link_freq()helper to obtain the link frequency using theLINK_FREQbut also thePIXEL_RATEcontrol. The divisor for the pixel rate derived link frequency was wrong, missing the bus uses double data rate. Fix this.Reported-by Laurent Pinchart <[email protected]>Fixes 4b6c129e87a3 ("media: ipu3-cio2: Use v4l2_get_link_freq helper")Signed-off-by Sakari Ailus <[email protected]>Reviewed-by Laurent Pinchart <[email protected]>Quoted 17 lines
--- drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/pci/intel/ipu3/ipu3-cio2-main.c +1
-1@@ -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;
Signature · 3 lines
Regards, Laurent Pinchart
Laurent and Sakari, thanks.
Quoted 18 lines · Sakari Ailus
The driver uses
v4l2_get_link_freq()helper to obtain the link frequency using theLINK_FREQbut also thePIXEL_RATEcontrol. The divisor for the pixel rate derived link frequency was wrong, missing the bus uses double data rate. Fix this.Reported-by Laurent Pinchart <[email protected]>Fixes 4b6c129e87a3 ("media: ipu3-cio2: Use v4l2_get_link_freq helper")Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/pci/intel/ipu3/ipu3-cio2-main.c +0
-0
drivers/media/pci/intel/ipu3/ipu3-cio2-main.c static int cio2_csi2_calc_timing(struct cio2_device *cio2, struct cio2_queue *q, · line 308
Quoted 8 lines
drivers/media/pci/intel/ipu3/ipu3-cio2-main.c +1
-1@@ -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;
Signature · 2 lines
Best regards, Bingbu Cao