Fullscreen resolution setting weirdness under X

I’m having a problem with fullscreen SDL under Linux/X11. When I
SetVideoMode with a height and width of 800x500, SDL sets the X
resolution to 800x600. (This is what I expect).

When I request 1024x768, SDL sets the X resolution to 1024x768. (Also
what I expect)

But when I request 1024x700, I SDL sets the resolution 1600x1200 (my
biggest resolution, and the only one bigger than 1024x768 that I have
defined). I expected SDL to set the resolution to 1024x768.

Test code is available at
http://people.vanderbilt.edu/~kevin.m.smyth/sdl-bug/sdl-test.cpp

I can set the resolution to 1600x1200, 1024x768, and 800x600 manually
(using Ctrl-Alt-Num+) just fine.

Can anyone explain why this is happening? Is this a bug in SDL?

Thanks for your help.
Kevin

Kevin Smyth wrote:

I’m having a problem with fullscreen SDL under Linux/X11. When I
SetVideoMode with a height and width of 800x500, SDL sets the X
resolution to 800x600. (This is what I expect).

When I request 1024x768, SDL sets the X resolution to 1024x768. (Also
what I expect)

But when I request 1024x700, I SDL sets the resolution 1600x1200 (my
biggest resolution, and the only one bigger than 1024x768 that I have
defined). I expected SDL to set the resolution to 1024x768.

Test code is available at
http://people.vanderbilt.edu/~kevin.m.smyth/sdl-bug/sdl-test.cpp

I can set the resolution to 1600x1200, 1024x768, and 800x600 manually
(using Ctrl-Alt-Num+) just fine.

Can anyone explain why this is happening? Is this a bug in SDL?

I don’t have this problem here, I use SDL from cvs.
What version of SDL are you using ? Some distributions use patched
versions, they especially like to patch the video mode stuff.

Stephane

I don’t have this problem here, I use SDL from cvs.
What version of SDL are you using ? Some distributions use patched
versions, they especially like to patch the video mode stuff.

Stephane

I just downloaded and compiled SDL from CVS. Same results.

I think I found the cause of this strange behavior: the nvidia driver.

I have an NVidia card capable of TwinView in my laptop (in the "clone"
configuration), so I’ll use the TV output on occasion (and the
closed-source binary driver). To configure the TV-out, one lists pairs
of resolutions in XF86Config, one resolution for the TV, and the other
for the LCD. With NVidia’s recent driver upgrade, the driver no longer
considers 1024x768 to be a valid TV mode, so when I switch to 1024x768,
there is no TV output, just LCD output.

I just tested SetVideoMode with 1024x700 without TwinView enabled, and
SDL correctly set the mode to 1024x768. So the obvious fix is to not put
invalid TV modes in XF86Config.

It’s still a mystery to me, however, that SDL sets the resolution
correctly when SetVideoMode is given 1024x768, but sets it incorrectly
with 1024x700.

For reference/reproduction:
option “metamodes” “null,1600x1200; 1024x768,1024x768; 800x600,800x600;
640x480,640x480;”

From XFree86.0.log (w/ TwinView enabled)
(WW) NVIDIA(0): Not using mode “1024x768” (not a valid TV mode)

I’ll try to investigate this further and let you know what I find.

Thanks.
Kevin SmythOn Stephane Marchesin wrote:

From my XF86Config: