diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2005-11-07 04:00:38 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:53:51 -0500 |
commit | dd0314f7bb407bc4bdb3ea769b9c8a3a5d39ffd7 (patch) | |
tree | 474e589f2d9022f8ce63993e19069da273033e55 /drivers/video/console/fbcon.c | |
parent | 3084a895c2a963cb9b32271061c832977ff7293c (diff) |
[PATCH] fbcon: Initialize new driver when old driver is released
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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/console/fbcon.c')
-rw-r--r-- | drivers/video/console/fbcon.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index e111a88612f7..5ff51cd0a2a9 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -630,6 +630,15 @@ static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info *oldinfo, | |||
630 | kfree(oldinfo->fbcon_par); | 630 | kfree(oldinfo->fbcon_par); |
631 | oldinfo->fbcon_par = NULL; | 631 | oldinfo->fbcon_par = NULL; |
632 | module_put(oldinfo->fbops->owner); | 632 | module_put(oldinfo->fbops->owner); |
633 | /* | ||
634 | If oldinfo and newinfo are driving the same hardware, | ||
635 | the fb_release() method of oldinfo may attempt to | ||
636 | restore the hardware state. This will leave the | ||
637 | newinfo in an undefined state. Thus, a call to | ||
638 | fb_set_par() may be needed for the newinfo. | ||
639 | */ | ||
640 | if (newinfo->fbops->fb_set_par) | ||
641 | newinfo->fbops->fb_set_par(newinfo); | ||
633 | } | 642 | } |
634 | 643 | ||
635 | return err; | 644 | return err; |