drm/tilcdc: fix raster control register setting
Subsystems (3)
PATCH RESEND 1/1 drm/tilcdc: fix raster control register setting
The fdd property of the tilcdc_panel_info structure must set the reqdly bit field (bit 12 to 19) of the raster control register. The previous statement set the least significant bit instead.
---
drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +1 -1
@@ -393,7 +393,7 @@ static void tilcdc_crtc_set_mode(struct drm_crtc *crtc)return ; } } - reg |= info->fdd <12 ; + reg |= info->fdd <<12 ;tilcdc_write (dev,LCDC_RASTER_CTRL_REG , reg);if (info->invert_pxl_clk)
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 17 lines · Dario Binacchi
The fdd property of the
tilcdc_panel_infostructure must set the reqdly bit field (bit 12 to 19) of the raster control register. The previous statement set the least significant bit instead.Signed-off-by Dario Binacchi <[email protected]>---
drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/tilcdc/tilcdc_crtc.c +0
-0
drivers/gpu/drm/tilcdc/tilcdc_crtc.c static void tilcdc_crtc_set_mode(struct drm_crtc *crtc) · line 399
Quoted 8 lines
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +1
-1@@ -393,7 +393,7 @@ static void tilcdc_crtc_set_mode(struct drm_crtc *crtc)return ; } } - reg |= info->fdd <12 ; + reg |= info->fdd <<12 ;tilcdc_write (dev,LCDC_RASTER_CTRL_REG , reg);if (info->invert_pxl_clk)
This is interesting, looks like this has always been broken, and in many cases sets bits 0, which is the enable bit. So we enable LCDC before even setting the fb address. How does this not blow up LCDC totally?
The fix looks correct to me, but it will change the register value for boards that have apparently been working for years.
Dario, did you test this on actual HW, or did you just spot the error?
Tomi
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Tomi,
Quoted 34 lines
Il 17/02/2021 07:41 Tomi Valkeinen <[email protected]> ha scritto:
Quoted 17 lines · Dario Binacchi
The fdd property of the
tilcdc_panel_infostructure must set the reqdly bit field (bit 12 to 19) of the raster control register. The previous statement set the least significant bit instead.Signed-off-by Dario Binacchi <[email protected]>---
drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/tilcdc/tilcdc_crtc.c +0
-0drivers/gpu/drm/tilcdc/tilcdc_crtc.c static void tilcdc_crtc_set_mode(struct drm_crtc *crtc) · line 399
Quoted 8 lines
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +1
-1@@ -393,7 +393,7 @@ static void tilcdc_crtc_set_mode(struct drm_crtc *crtc)return ; } } - reg |= info->fdd <12 ; + reg |= info->fdd <<12 ;tilcdc_write (dev,LCDC_RASTER_CTRL_REG , reg);if (info->invert_pxl_clk)This is interesting, looks like this has always been broken, and in many cases sets bits 0, which is the enable bit. So we enable LCDC before even setting the fb address. How does this not blow up LCDC totally?
Quoted 4 lines
The fix looks correct to me, but it will change the register value for boards that have apparently been working for years.
Dario, did you test this on actual HW, or did you just spot the error?
I tested it on Beaglebone Black + LCD cape (4.3inch). I also checked the register value with devmem.
Regards,
Dario
Quoted 8 lines
Reviewed-by Tomi Valkeinen <[email protected]>Tomi
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 5 lines · Dario Binacchi
The fdd property of the
tilcdc_panel_infostructure must set the reqdly bit field (bit 12 to 19) of the raster control register. The previous statement set the least significant bit instead.Signed-off-by Dario Binacchi <[email protected]>
Thanks for a good catch. I'll merge to this drm-misc-next soon.
Best regards,
Jyri
Quoted 20 lines
---
drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/tilcdc/tilcdc_crtc.c +1
-1@@ -393,7 +393,7 @@ static void tilcdc_crtc_set_mode(struct drm_crtc *crtc)return ; } } - reg |= info->fdd <12 ; + reg |= info->fdd <<12 ;tilcdc_write (dev,LCDC_RASTER_CTRL_REG , reg);
Quoted 1 line
if (
info->invert_pxl_clk)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel