SDL CVS update (DGA 2.0)

The latest CVS snapshot of Simple DirectMedia Layer contains experimental
DGA 2.0 support:
http://www.devolution.com/~slouken/SDL/cvs.html

The good:
It works! DGA 2.0 supports page flipping, surfaces in video memory,
and hardware accelerated color fill and solid/colorkey blitting.

The bad:
I’ve only tested this on my Matrox Millennium card, which seems to
have a bug in the X server which prevents any graphics from showing up
in > 8 bpp. Also, I just added colorkey blits to CVS, and have not yet
tested them - though they should work. :slight_smile:

The ugly:
You need to set the SDL_VIDEODRIVER environment variable to “dga” and run
the application as root to get access to the XFree86 DGA 2.0 support.

Kudos to the XFree86 folks - great job on the DGA support! :slight_smile:

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

The bad:
I’ve only tested this on my Matrox Millennium card, which seems to
have a bug in the X server which prevents any graphics from showing up
in > 8 bpp. Also, I just added colorkey blits to CVS, and have not yet
tested them - though they should work. :slight_smile:
No SDL app seems to be able to set the video mode for me when I try to use
DGA, at any depth.

./testvidinfo returns:

Current display: 16 bits-per-pixel
Red Mask = 0x0000f800
Green Mask = 0x000007e0
Blue Mask = 0x0000001f
No available fullscreen video modes
Hardware surfaces are available (32768K video memory)
Copy blits between hardware surfaces are accelerated
Color fills on hardware surfaces are accelerated

Besides the fast that there are no fullscreen modes available, its also
reporting 32M’s of video ram. I have a voodoo banshee with only 16M.

Long live the confused,
Akawaka.On Fri, 31 Mar 2000, Sam Lantinga wrote:

Bother! said Pooh, as he felt Vader’s presence.

No SDL app seems to be able to set the video mode for me when I try to use
DGA, at any depth.

Can you use the debugger to trace through where it sets up the video modes?

[hercules at coral test]$ su
Password:
[root at coral test]# export SDL_VIDEODRIVER=dga
[root at coral test]# gdb testvidinfo
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “i386-redhat-linux”…
Breakpoint 1 at 0x8048755: file testvidinfo.c, line 15.
(gdb) r
Starting program: /home/hercules/public_cvs/SDL-1.1/test/testvidinfo

Breakpoint 1, main (argc=1, argv=0xbffffb64) at testvidinfo.c:15
15 if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
(gdb) b DGA_VideoInit
Breakpoint 2 at 0x4004a28d: file SDL_dgavideo.c, line 267.
(gdb) c
Continuing.

Breakpoint 2, DGA_VideoInit (this=0x804a018, vformat=0xbffffab0)
at SDL_dgavideo.c:267
warning: Source file is more recent than executable.

267 DGA_Display = XOpenDisplay(display);
(gdb) list
262 int i, num_modes;
263
264 /* Open the X11 display /
265 display = NULL; /
Get it from DISPLAY environment variable /
266
267 DGA_Display = XOpenDisplay(display);
[lines snipped for brevity]
313
314 /
Open access to the framebuffer /
315 if ( ! XDGAOpenFramebuffer(DGA_Display, DGA_Screen) ) {
316 SDL_SetError(“Unable to map the video memory”);
317 XCloseDisplay(DGA_Display);
318 return(-1);
319 }
320
321 /
Query for the list of available video modes */
(gdb) list
322 modes = XDGAQueryModes(DGA_Display, DGA_Screen, &num_modes);
323 for ( i=0; i<num_modes; ++i ) {
324 if ( (modes[i].visualClass == PseudoColor) ||
325 (modes[i].visualClass == TrueColor) ) {
326 DGA_AddMode(this, modes[i].bitsPerPixel,
327 modes[i].viewportWidth,
328 modes[i].viewportHeight);
329 }
330 }
331 UpdateHWInfo(this, modes);
(gdb) b 322
Breakpoint 3 at 0x4004a466: file SDL_dgavideo.c, line 322.
(gdb) c
Continuing.

Breakpoint 3, DGA_VideoInit (this=0x804a018, vformat=0xbffffab0)
at SDL_dgavideo.c:322
322 modes = XDGAQueryModes(DGA_Display, DGA_Screen, &num_modes);
(gdb) n
323 for ( i=0; i<num_modes; ++i ) {
(gdb) p num_modes
$1 = 31
(gdb) p modes
$2 = (XDGAMode *) 0x804b678
(gdb)

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

No SDL app seems to be able to set the video mode for me when I try to use
DGA, at any depth.

Can you use the debugger to trace through where it sets up the video modes?
num_modes gets set equ. 9, but none of those modes are
PseudoColor/TrueColor.

Long live the confused,
Akawaka.On Sat, 1 Apr 2000, Sam Lantinga wrote:

Bother, said Pooh, as he was butchered for his paws and liver.