Commit dd0314f7 authored by Antonino A. Daplas's avatar Antonino A. Daplas Committed by Linus Torvalds

[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: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3084a895
...@@ -630,6 +630,15 @@ static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info *oldinfo, ...@@ -630,6 +630,15 @@ static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info *oldinfo,
kfree(oldinfo->fbcon_par); kfree(oldinfo->fbcon_par);
oldinfo->fbcon_par = NULL; oldinfo->fbcon_par = NULL;
module_put(oldinfo->fbops->owner); 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; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment