drm/fsl-dcu: Fix endian issue when using clk_register_divider
Subsystems (3)
PATCH 1/1 drm/fsl-dcu: Fix endian issue when using clk_register_divider
While clk_register_divider will write register as little endian, Modified the param "shift" from 0 to 24 since DCU is big endian. Or reg "DCU_DIV_RATIO" will be seted as a incorrect value which will cause vblank timing issue etc.
--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1 -1
@@ -386,7 +386,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)snprintf (pix_clk_name,sizeof (pix_clk_name),"%s_pix" , pix_clk_in_name); fsl_dev->pix_clk =clk_register_divider (dev, pix_clk_name, pix_clk_in_name,0 , base +DCU_DIV_RATIO , -0 ,8 ,CLK_DIVIDER_ROUND_CLOSEST ,NULL ); +24 ,8 ,CLK_DIVIDER_ROUND_CLOSEST ,NULL );if (IS_ERR (fsl_dev->pix_clk)) {dev_err (dev,"failed to register pix clk\n" ); ret =PTR_ERR (fsl_dev->pix_clk);
Signature · 6 lines
2.1.0.27.g96db324 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_probe(struct platform_device *pdev) · line 389
Quoted 6 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1
-1fsl_dev->pix_clk =clk_register_divider (dev, pix_clk_name, pix_clk_in_name,0 , base +DCU_DIV_RATIO , -0 ,8 ,CLK_DIVIDER_ROUND_CLOSEST ,NULL ); +24 ,8 ,CLK_DIVIDER_ROUND_CLOSEST ,NULL );
On LS1021A-TWR board.
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_probe(struct platform_device *pdev) · line 392
Quoted 3 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0
-0if (IS_ERR (fsl_dev->pix_clk)) {dev_err (dev,"failed to register pix clk\n" ); ret =PTR_ERR (fsl_dev->pix_clk);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Stefan Agner
maintainerQuoted 8 lines · Meng Yi
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_probe(struct platform_device *pdev) · line 389
Quoted 4 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1
-1fsl_dev->pix_clk =clk_register_divider (dev, pix_clk_name, pix_clk_in_name,0 , base +DCU_DIV_RATIO , -0 ,8 ,CLK_DIVIDER_ROUND_CLOSEST ,NULL ); +24 ,8 ,CLK_DIVIDER_ROUND_CLOSEST ,NULL );Tested-by Meng Yi <[email protected]>On LS1021A-TWR board.
Yeah I wanted to give this a try on Vybrid, but I don't think that works since on Vybrid the IP is little endian...
We need to come up with a solution which takes that into account. Alternatively we can put the offset into the SoC specific structure...
--
Stefan
Quoted 4 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_probe(struct platform_device *pdev) · line 392
Quoted 4 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +0
-0if (IS_ERR (fsl_dev->pix_clk)) {dev_err (dev,"failed to register pix clk\n" ); ret =PTR_ERR (fsl_dev->pix_clk);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c static int fsl_dcu_drm_probe(struct platform_device *pdev) · line 389
Quoted 4 lines
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +1
-1fsl_dev->pix_clk =clk_register_divider (dev, pix_clk_name, pix_clk_in_name,0 , base +DCU_DIV_RATIO , -0 ,8 ,CLK_DIVIDER_ROUND_CLOSEST ,NULL ); +24 ,8 ,CLK_DIVIDER_ROUND_CLOSEST ,NULL );Tested-by Meng Yi <[email protected]>
Quoted 8 lines
Quoted 1 line
On LS1021A-TWR board.
Yeah I wanted to give this a try on Vybrid, but I don't think that works since on Vybrid the IP is little endian...
We need to come up with a solution which takes that into account. Alternatively we can put the offset into the SoC specific structure...
Ok, I will do this these days.
Best Regards,
Meng
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel