Re: [AD] GGI patch for 3.9.21

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


George Foot <mert0407@xxxxxxxxxx> writes:
> I still don't see why... my suggestion was to make the low level drivers 
> accept w=h=0 as meaning that anything will do, and replacing the current 
> code in set_gfx_mode with:

I have two objections to that approach:

- it requires cooperation from the low level drivers, or at least for any 
that may be used in safe mode. This is really a platform issue rather than a 
driver issue, though: for example GFX_VGA is the obvious safe driver in DOS, 
but less so in Linux (it requires root access and fiddles with the hardware, 
so fbcon is usually a much less risky choice).

- it has no way to express something like the setup program, which ideally 
wants a 320x200x8 mode, will settle for any 8 bit resolution, but would 
rather abort with an error than be forced to run in hicolor or truecolor.

Another flaw with relying on multiple calls to GFX_AUTODETECT with different 
parameters, is that if the user has specified a particular driver in their 
config file, that will completely override GFX_SAFE. If the driver named in 
the config file doesn't work, I think it is better for GFX_SAFE to ignore it 
and use something else instead.

For DOS and Windows, where there is a fixed 100% reliable mode, I like the 
simplicty of being able to go straight to it. And under X, I presume that we 
will have at least some emulation for running different color depths on any 
format of display, so we can always set a 320x200x8 mode. I like the way 
your solution leaves all the choice up to the drivers, though, rather than 
trying to make the system driver or top level code do too much work.

How about this for a disgustingly simple solution? Leave graphics.c 
unchanged, with fixed SAFE_* constants for DOS and Windows. On Unix, just 
define these constants to be zero, and modify the drivers accordingly. This 
leaves the decision making entirely up to each individual driver: whether 
they want to ignore safe mode requests, or do clever emulation stuff, or 
just set a normal mode. In practice I think that for the Linux console, safe 
mode should be fbcon if it exists, or VGA otherwise, since those are the 
most robust and widely available.



--
Shawn Hargreaves - shawn@xxxxxxxxxx - http://www.talula.demon.co.uk/
"A binary is barely software: it's more like hardware on a floppy disk."



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/