Re: [AD] GFX_SAFE mode patch

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


> The patch breaks the GFX_SAFE 'maintain-screen-resolution' feature of the
> framebuffer under linux console, desperately needed by users depending
> on vesafb or with lcd screens.  The attached file fixes this. AFAIK it's
> safe (pun intented) to apply the patch, since _safe_gfx_mode_change is
> only used by fbcon.c.

I wasn't aware of this 'maintain-screen-resolution' feature, only of the
'fixed-screen-depth' requirement. I've attached a revised patch.

> The problem with the previous patch is that it relies on SYSTEM_DRIVER
> to know what's the safe resolution. This is bad for the linux drivers,
> because only fbcon.c would know this information, and that is only half
> through the initialization process, hence the _safe_gfx_mode_change hack
> which let's fbcon.c know it's being initialized with GFX_SAFE.

I don't really see the problem: the get_gfx_safe_mode method must be set
only if there is always a safe gfx mode which is known a priori. It's
clearly not the case under Linux (for some obscure reasons I don't
understand, it seems it is not possible the query the resolution and color
depth of the fb console without "initializing" it ? But it is already
initialized!) so the Linux system driver simply must not set the method.

> One possible solution for this would be to move the get_gfx_safe function
> to each driver and let SYSTEM_DRIVER query all it's drivers.

Not every gfx driver is able to report the modes it supports without trying
to set them first.

> But even then, the new behaviour of set_gfx_mode tries to set the
> requested resolution before trying the safe mode.

Huh... are you sure that it's a new behaviour ? The old code even tried to
set a GFX_AUTODETECTed mode!

> This would still inconvenience framebuffer users (me), because altough the
> framebuffer driver accepts the 320x200 resolution, this is out of range
> for my lcd screen which goes blank.

Yes, there is no other solution for Linux than the _safe_gfx_mode_change
hack. Unless you convinced the fb developers to fix their API.

> Finally, I see no sense on exposing get_safe_gfx_mode to the user,
> since he/she will use GFX_SAFE anyway.

I never intended to do so.

--
Eric Botcazou

Attachment: gfx_safe3.diff
Description: Binary data



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