Re: [AD] fbcon backgrounding |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Wed, Nov 28, 2001 at 03:13:30PM +1100, Peter Wang wrote:
> Running exswitch, if I select SWITCH_BACKAMNESIA then switch to
> another VT, graphics that are drawn will be visible on screen. For
> example, I can see the "Time:" string still incrementing and the
> fractal being drawn while I'm typing this (which is cool, but not the
> intended effect, I think ;-)
>
> It doesn't happen with any other switching mode, but I'm assuming this
> only doesn't happen in SWITCH_AMNESIA because the program is paused.
> Is this a bug in the fbcon driver, or is something weird happening
> with vesafb on my system? Can anybody reproduce this?
I don't know if it's a bug in fbcon driver: looks like mplayer does
the same, once you start running it no matter where you go you see the
video playing, and IIRC somebody on the fbdev ml once said that true
virtualization of the framebuffer was not going to exist at least until
2.6.x, so we have to patch this behaviour or the user will get messed
up screens.
The only difference between a SWITCH_BACKGROUND (which works ok) and
SWITCH_BACKAMNESIA, is line 375 at src/dispsw.c: with SWITCH_BACKGROUND
Allegro creates a virtual screen and all write operations go to this
screen.
Now, the ideal thing would be that there existed a '/dev/null' graphic
driver, and Allegro could set it up generically with SWITCH_BACKAMNESIA
(which would eliminate any possible related problems with other
drivers). Other than that, I think that the only possible thing would be
to do something in fb_save() at src/linux/fbcon.c:456, like invalidating
there all drawing calls (only with SWITCH_BACKAMNESIA) until we get a
SWITCH_IN event.
However, fb_save doesn't get the type of switch mode (from
linux/vtswitch.c:85). Is there some way fb_save can get the type of
switch_mode? And BTW, how would the driver invalidate drawing calls? Maybe
unmmaping the fb device? There's doesn't seem to be anything useful
about that in the GFX_DRIVER structure.