linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/17] fbcon: Initialize new driver when old driver is released
@ 2005-10-18  9:15 Antonino A. Daplas
  0 siblings, 0 replies; only message in thread
From: Antonino A. Daplas @ 2005-10-18  9:15 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Fbdev development list

If machine has more than 1 driver installed, and they all drive the same
hardware, it's possible that the driver's fb_release() method will attempt
to restore the hardware state to the initial state.  This will leave
the new driver in an undefined state.  To prevent this problem, initialize
the new driver by calling fb_set_par() when the old driver is released by
fbcon.

Signed-off-by: Antonino Daplas<adaplas@pol.net>
---
 fbcon.c |    9 +++++++++
 1 files changed, 9 insertions(+)


diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -630,6 +630,15 @@ static int con2fb_release_oldinfo(struct
 		kfree(oldinfo->fbcon_par);
 		oldinfo->fbcon_par = NULL;
 		module_put(oldinfo->fbops->owner);
+		/*
+		  If oldinfo and newinfo are driving the same hardware,
+		  the fb_release() method of oldinfo may attempt to
+		  restore the hardware state.  This will leave the
+		  newinfo in an undefined state. Thus, a call to
+		  fb_set_par() may be needed for the newinfo.
+		*/
+		if (newinfo->fbops->fb_set_par)
+			newinfo->fbops->fb_set_par(newinfo);
 	}
 
 	return err;




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-10-18 20:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-18  9:15 [PATCH 4/17] fbcon: Initialize new driver when old driver is released Antonino A. Daplas

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