From 256a8042830e6ac1c3dd2e912e3c45769dd709cc Mon Sep 17 00:00:00 2001 From: Janusz Krzysztofik Date: Mon, 17 May 2010 03:20:13 +0200 Subject: OMAPFB: LCDC: change update_mode to DISABLED when going suspend I was observing the following error messages on my OMAP1 based Amstrad Delta board when first changing from text to graphics mode or vice versa after the LCD display had been blanked: omapfb omapfb: timeout waiting for FRAME DONE with a followup error message while unblanking it back: omapfb omapfb: resetting (status 0xffffffb2,reset count 1) As a visible result, image pixels happened to be shifted by a few bits, giving wrong colors. Examining the code, I found that this problem occures when an OMAP1 internal LCD controller is disabled from omap_lcdc_suspend() and then a subsequent omap_lcdc_setup_plane() calls disable_controller() again. This potentially error provoking behaviour is triggered by the lcdc.update_mode flag being kept at OMAP_AUTO_UPDATE, regardless of the controller and panel being suspended. This patch tries to correct the problem by replacing both omap_lcdc_suspend() and omap_lcdc_resume() function bodies with single calls to omap_lcdc_set_update_mode() with a respective OMAP_UPDATE_DISABLE or OMAP_AUTO_UPDATE argument. As a result, exactly the same lower level operations are performed, with addition of changing the lcdc.update_mode flag to a value better suited for the controller state. This prevents any further calls to disable_controller() from omap_lcdc_setup_plane() while the display is suspended. Created against linux-2.6.34-rc7. Tested on Amstrad Delta. Signed-off-by: Janusz Krzysztofik Signed-off-by: Tomi Valkeinen --- drivers/video/omap/lcdc.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'drivers') diff --git a/drivers/video/omap/lcdc.c b/drivers/video/omap/lcdc.c index 43ab7d8b66b2..7767338f8b14 100644 --- a/drivers/video/omap/lcdc.c +++ b/drivers/video/omap/lcdc.c @@ -572,22 +572,12 @@ static enum omapfb_update_mode omap_lcdc_get_update_mode(void) /* PM code called only in internal controller mode */ static void omap_lcdc_suspend(void) { - if (lcdc.update_mode == OMAPFB_AUTO_UPDATE) { - disable_controller(); - omap_stop_lcd_dma(); - } + omap_lcdc_set_update_mode(OMAPFB_UPDATE_DISABLED); } static void omap_lcdc_resume(void) { - if (lcdc.update_mode == OMAPFB_AUTO_UPDATE) { - setup_regs(); - load_palette(); - setup_lcd_dma(); - set_load_mode(OMAP_LCDC_LOAD_FRAME); - enable_irqs(OMAP_LCDC_IRQ_DONE); - enable_controller(); - } + omap_lcdc_set_update_mode(OMAPFB_AUTO_UPDATE); } static void omap_lcdc_get_caps(int plane, struct omapfb_caps *caps) -- cgit v1.2.3 From bc092a303a1b980c67324920471e23354b0721cd Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 7 Jun 2010 10:46:10 +0300 Subject: OMAP: OMAPFB: fix rfbi.c compile error The code in rfbi.c tried to get the omapdss platform_device via a static member defined in dispc.c, leading to a compile error. The same platform_device is available through rfbi-struct. Signed-off-by: Tomi Valkeinen --- drivers/video/omap/rfbi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/video/omap/rfbi.c b/drivers/video/omap/rfbi.c index 1162603c72e5..eada9f12efc7 100644 --- a/drivers/video/omap/rfbi.c +++ b/drivers/video/omap/rfbi.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "omapfb.h" #include "dispc.h" @@ -83,13 +84,13 @@ static inline u32 rfbi_read_reg(int idx) static int rfbi_get_clocks(void) { - rfbi.dss_ick = clk_get(&dispc.fbdev->dssdev->dev, "ick"); + rfbi.dss_ick = clk_get(&rfbi.fbdev->dssdev->dev, "ick"); if (IS_ERR(rfbi.dss_ick)) { dev_err(rfbi.fbdev->dev, "can't get ick\n"); return PTR_ERR(rfbi.dss_ick); } - rfbi.dss1_fck = clk_get(&dispc.fbdev->dssdev->dev, "dss1_fck"); + rfbi.dss1_fck = clk_get(&rfbi.fbdev->dssdev->dev, "dss1_fck"); if (IS_ERR(rfbi.dss1_fck)) { dev_err(rfbi.fbdev->dev, "can't get dss1_fck\n"); clk_put(rfbi.dss_ick); -- cgit v1.2.3