|
From: Antonino D. <ad...@po...> - 2003-03-06 01:16:50
|
On Thu, 2003-03-06 at 02:37, James Simmons wrote: > > > So we just make fbcon permanently loaded unconditionally? The current > > code allows 'rmmod fbcon', but it will freeze the system. > > Because no other console takes over. This is not a easy problem to solve. > Which driver takes over when we switch from one console driver to > another. I have already a working fbcon module unloading code in my local copy. The way it works is like this. 1. If take_over_console() is called with the "default" flag clear, it behaves as usual. It takes only a subset of console numbers but "conswitchp" still points to the console driver that was loaded at boot time. 2. If take_over_console() is called with the "default" flag set, it will replace "conswitchp", but the original value of "conswitchp" is saved. 3. If take_over_console() with the "default" flag set is called again, it will fail. It's not logical to just overwrite "conswitchp" over and over again. 4. If give_up_console() is called and if the previous take_over_console() did not overwrite "conswitchp", it proceeds as usual. 5. If give_up_console() is called and if the previous take_over_console() overwrote "conswitchp", give_up_console() will also call take_over_console() but using the saved "conswitchp". I can then load fbdev and fbcon as modules. If I "rmmod fbcon", I get back again to vgacon/dummycon/whatever. I can then load and unload different fbdev's and load fbcon at will. If I want to load mdacon, it will still work on top of fbcon, because mdacon calls take_over_console() with the "default" flag cleared. If you need to load other console drivers, then fbcon must be unloaded first. This is because the rest of the console drivers call take_over_console() with the "default" flag set. I can already load/unload fbcon using vga16fb, rivafb or i810fb as the backend at will. Drivers that wish to allow fbcon unloading can define the xxxfb_release() method. They can choose to save/restore the state (if they have a vga core and running as primary), or just define the xxfb_release method as a dummy (if no vga core or running as secondary). What do you think? Any suggestions to improve this (multiple console drivers for instance)? I would rather have the above, or disallow unloading, than having the whole console system freeze on me. Tony |