Without /etc/fb.modes on a embedded device, how can use the SDL

Hello all.

I cross-compile this library successfully on freescale i.mx31ads. But when I
run the test applications on this broad, sush as graywin. I always get the
Segmentation fault. After debug the souce codes. I find out the key
problems. There is no /etc/fb.modes on this broad and the broad seems only
support the mode is

mode "240x320-60"
geometry 240 320 240 640 16
timings 185925 9 16 7 9 1 1
accel false
rgba 5/11,6/5,5/0,0/0
endmode

When fb.modes file fails to open, it seems that the library use the hard
codes array checkres to check the mode whether can be supported. As we all
know, the test applications run with the 640x480. Just because this mode is
contained in the checkres, so the SDL get the error information when it asks
the frame buffer can support it. When use this mode, the Segmentation fault
happens.

Please give me some advices how to sovle this problem. Modifiy the test
applications make the mode is 240x320 or modify other codes such as
checkres?

Thanks for any hint.

Regards

XiaGuangTai

Please give me some advices how to sovle this problem. Modifiy the test
applications make the mode is 240x320 or modify other codes such as
checkres?

If you can’t install an /etc/fb.modes file, you should probably modify
checkres to support your needs. That being said, you’ll need to change
the test applications, since 640x480 obviously won’t ever work if the
hardware only supports 240x320.

In most cases, the test applications don’t care what resolution they
use; 640x480 was just a convenient size that most systems can handle.

–ryan.

When fb.modes file fails to open, it seems that the library use the hard
codes array checkres to check the mode whether can be supported. As we all
know, the test applications run with the 640x480. Just because this mode is
contained in the checkres, so the SDL get the error information when it asks
the frame buffer can support it. When use this mode, the Segmentation fault
happens.

Is the bug that SDL is ingoring the return value of the check? Or is it
that the kernel isn’t failing the check?

See ya,
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

I don’t make sure which layer causes this problem, maybe the fault comes
from framebuffer driver for this device. I have debugged and found that
when SDL check whether 640x480 mode can be supported with the function
ioctl, the return code tells the SDL this mode can be supported. When SDL
use this mode to clear the the surface, the Segmenttion fault happens. I
don’t know how to sovle this problem elegantly, modfiy the framebuffer’s
driver codes or SDL codes.

XiaGuangTaiOn 7/25/07, Sam Lantinga wrote:

When fb.modes file fails to open, it seems that the library use the hard
codes array checkres to check the mode whether can be supported. As we
all
know, the test applications run with the 640x480. Just because this mode
is
contained in the checkres, so the SDL get the error information when it
asks
the frame buffer can support it. When use this mode, the Segmentation
fault
happens.

Is the bug that SDL is ingoring the return value of the check? Or is it
that the kernel isn’t failing the check?

See ya,
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I don’t make sure which layer causes this problem, maybe the fault comes
from framebuffer driver for this device. I have debugged and found that
when SDL check whether 640x480 mode can be supported with the function
ioctl, the return code tells the SDL this mode can be supported. When
SDL use this mode to clear the the surface, the Segmenttion fault
happens. I don’t know how to sovle this problem elegantly, modfiy the
framebuffer’s driver codes or SDL codes.

If the ioctl says it supports 640x480, but the hardware really doesn’t,
that’s probably a Linux kernel driver bug.

–ryan.

I don’t make sure which layer causes this problem, maybe the fault comes
from framebuffer driver for this device. I have debugged and found that
when SDL check whether 640x480 mode can be supported with the function
ioctl, the return code tells the SDL this mode can be supported. When SDL
use this mode to clear the the surface, the Segmenttion fault happens. I
don’t know how to sovle this problem elegantly, modfiy the framebuffer’s
driver codes or SDL codes.

Can the frame buffer hardware actually run that mode? If so, then it’s
probably an SDL bug. If not, then the driver shouldn’t report that the
mode is available.

-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment