[linux-fbdev] SDL and Vesafb problems

Dermot Bradley wrote:

Vesafb does not support changing the video mode

and my program seems to hang at that point. Later in the program the code
does call SDL_SetVideoMode […]

Suggestions?

Don’t set the video mode, as vesafb does not support doing so. :slight_smile:

Query the video mode only, or handle SetVideoMode failure appropriately.

Jeff-- 

Jeff Garzik |
Building 1024 | Free beer tomorrow.
MandrakeSoft, Inc. |

Don’t set the video mode, as vesafb does not support doing so. :slight_smile:

Query the video mode only, or handle SetVideoMode failure appropriately.

The point is that the program hangs on doing an SDL_Init with this error.On Mon, 26 Jun 2000, Jeff Garzik wrote:


Dermot Bradley
@Dermot_Bradley, bradley at debian.org

Folks

I’m trying to write my first SDL-based program. I am using the vesafb in
640x480, 24bit mode and whenever my simple SDL program does an
SDL_Init(SDL_INIT_VIDEO) I get an error on the console:

Vesafb does not support changing the video mode

and my program seems to hang at that point. Later in the program the code
does call SDL_SetVideoMode to set the resolution and colour depth but
obviously with the Init failing it never gets to this portion of the code.

Suggestions?

You should always test a mode before actually setting it. With fbdev you
can call the FBIOPUT_VSCREENINFO ioctl with a struct fb_var_screeninfo
which has the activate field set to the FB_ACTIVATE_TEST flag. If you get
a error then grab the current video mode and see if you can work with it.
If you don’t get a error the returned var should be used to actually set
the video mode. The reason being is the requested video mode might be
close to what the hardware can support but it had to be twicked abit to
make it work. You then call FBIOPUT_VSCREENINFO again with this var but to
be safe set the activate field with this var to FB_ACTIVATE_NOW. If you
need help let me know. I can patch up this SDL as long as you tell me
where this code is at.

Q: Why did they deprecate a.out support in linux?

James Simmons [jsimmons at linux-fbdev.org] ___/|
fbdev/console/gfx developer \ o.O|
http://www.linux-fbdev.org =(
)=
http://linuxgfx.sourceforge.net U
http://linuxconsole.sourceforge.netOn Mon, 26 Jun 2000, Dermot Bradley wrote:
A: Because a nasty coff is bad for your elf.

You should always test a mode before actually setting it. With fbdev you
can call the FBIOPUT_VSCREENINFO ioctl with a struct fb_var_screeninfo
which has the activate field set to the FB_ACTIVATE_TEST flag. If you get
a error then grab the current video mode and see if you can work with it.
If you don’t get a error the returned var should be used to actually set
the video mode. The reason being is the requested video mode might be
close to what the hardware can support but it had to be twicked abit to
make it work. You then call FBIOPUT_VSCREENINFO again with this var but to
be safe set the activate field with this var to FB_ACTIVATE_NOW. If you
need help let me know. I can patch up this SDL as long as you tell me
where this code is at.

src/video/fbcon/SDL_fbvideo.c

Thanks!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software