Fabio Alemagna <[EMAIL PROTECTED]> wrote: > Stupid question from an outsider: couldn't it be possible to make the > application still run by making it use an offscreen buffer while not > "visible" because of VT switching? It would be really annoying, imho, if > the application stopped altogether...
Been there, done that. Annoying. Early versions of scrdrv (the ancestor of KGI) did that. That was o.k., then, when we were dealing with 1MB graphics memory or similar. Even then I even went as far as making up a userspace _daemon_ that saved away the framebuffer for the application and then switched (with kernel help) mappings under the application's ass to keep the application happy and running. However that didn't and doesn't work with the application accessing the Hardware in any other way than just the framebuffer or kernelside calls (the old ioctl() method we used) anyway. The Hardware has quite some state, and not all of it can be retirieved easily. Thus basically IMHO we will have to face the fact, that the application will have to cooperate a little when switching away. Of course there should be a way to forcefully switch away an uncooperative application. Nowadays the situation is worse. Graphics RAM size increases, accels become more and more important and fast, thus demanding fast-tracked access to them without routing it all through a "bookkeeping layer". Jos is basically correct with his statements about RAMsize, just exaggerating a little. My typical configuration here runs X at 1600x1200x32. That's about 8MB. Now if I run quite a set of Apps on some consoles, I'm quickly at 40MB, even if I use no texture or similar at all. Higher end stuff will easily use all available graphics mem, but well. Now what happens on switch away: We will then _NEED_ the memory. Giving it only if available doesn't help. Either I can rely on being backing-stored or not. Thus the mem would have to be paged free if necessary ... can take quite some time when mem is tight and disks are slow. Next point: The app must specify in any case, what it wants to do, if switched away. Most apps will not want to burn CPU while they cannot be viewed and may just want to be stopped. Others will want to continue, to do bookkeeping stuff (like keeping network connections alive) in the meantime without need for the graphics subsystem to be there, while a third kind of application will want to run on transparently. If the application gets called back on switch-away, it can easily choose and do all of the above itself. Plus it can gracefully terminate ongoing accel transactions. If we want to outsmart the app, we just get a lot of work for very little gain. CU, Andy -- = Andreas Beck | Email : <[EMAIL PROTECTED]> =