[PATCH] FB/SM501: Ensure console suspended before saving state
From: Ben Dooks <ben-linux@fluff.org>
Date: 2007-11-19 18:07:40
Move the console suspend to before we save the state of the framebuffer to ensure that it does not try and change the fb state again once we have copied it out. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Index: linux-2.6.22-quilt9/drivers/video/sm501fb.c ===================================================================
--- linux-2.6.22-quilt9.orig/drivers/video/sm501fb.c
+++ linux-2.6.22-quilt9/drivers/video/sm501fb.c@@ -1681,6 +1681,15 @@ static int sm501fb_suspend_fb(struct sm5 if (par->screen.size == 0) return 0; + /* blank the relevant interface to ensure unit power minimised */ + (par->ops.fb_blank)(FB_BLANK_POWERDOWN, fbi); + + /* tell console/fb driver we are suspending */ + + acquire_console_sem(); + fb_set_suspend(fbi, 1); + release_console_sem(); + /* backup copies in case chip is powered down over suspend */ par->store_fb = vmalloc(par->screen.size);
@@ -1700,12 +1709,6 @@ static int sm501fb_suspend_fb(struct sm5 memcpy_fromio(par->store_fb, par->screen.k_addr, par->screen.size); memcpy_fromio(par->store_cursor, par->cursor.k_addr, par->cursor.size); - /* blank the relevant interface to ensure unit power minimised */ - (par->ops.fb_blank)(FB_BLANK_POWERDOWN, fbi); - - acquire_console_sem(); - fb_set_suspend(fbi, 1); - release_console_sem(); return 0;
--
Ben (ben@fluff.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/