Re: [AD] fbcon driver color depth |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2007-01-01, Milan Mimica <milan.mimica@xxxxxxxxxx> wrote:
> A call to set_gfx_mode(GFX_FBCON, ...) will crash if color depth
> unsupported by the framebuffer was selected. I'm using vesafb that can't
> change color depth selected at boot time.
>
> Graphic mode is set in src/linux/fbcon.c, line 334:
> /* try to set the mode */
> if (ioctl(fbfd, FBIOPUT_VSCREENINFO, &my_mode) == 0)
> goto got_a_nice_mode;
>
> Apparently, setting a mode with unsupported color depth will not fail.
> It will just modify 'my_mode' to the mode that was actually set. I
> assume that other fields in 'my_mode' are also corrected. I couldn't
> find any documentation that would confirm that. I couldn't find any
> documentation at all for that matter.
>
> Attached is a fix that is rather simple: update allegro to the actual
> color depth and continue, using 'my_mode.bits_per_pixel' instead of
> requested 'color_depth'.
So set_gfx_mode can succeed with a different colour depth to what was
set with set_color_depth?
Peter