linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][RFT][PATCH] OMAPFB: LCDC: change update_mode to DISABLED when going suspend
@ 2010-05-17  1:20 Janusz Krzysztofik
  2010-05-23 12:09 ` Janusz Krzysztofik
  0 siblings, 1 reply; 4+ messages in thread
From: Janusz Krzysztofik @ 2010-05-17  1:20 UTC (permalink / raw)
  To: linux-fbdev@vger.kernel.org; +Cc: linux-omap, Tomi Valkeinen

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 <jkrzyszt@tis.icnet.pl>
---
Hi,

Those of you having access to other display equipped OMAP1 boards, could you 
please test if this patch doesn't break anything?

Thanks,
Janusz

 drivers/video/omap/lcdc.c |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

--- git/drivers/video/omap/lcdc.c.orig	2010-05-16 21:39:20.000000000 +0200
+++ git/drivers/video/omap/lcdc.c	2010-05-17 00:00:43.000000000 +0200
@@ -572,22 +572,12 @@ static enum omapfb_update_mode omap_lcdc
 /* 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)

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

end of thread, other threads:[~2010-05-25 17:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-17  1:20 [RFC][RFT][PATCH] OMAPFB: LCDC: change update_mode to DISABLED when going suspend Janusz Krzysztofik
2010-05-23 12:09 ` Janusz Krzysztofik
2010-05-24  7:26   ` [RFC][RFT][PATCH] OMAPFB: LCDC: change update_mode to DISABLED Tomi Valkeinen
2010-05-25 17:31     ` [RFC][RFT][PATCH] OMAPFB: LCDC: change update_mode to DISABLED when going suspend Janusz Krzysztofik

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).