We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 702

Summary: XRANDR video modes are not used although it is configured.
Product: SDL Reporter: Sami Näätänen <sn.ml>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: mkallman, vedenko
Version: HG 2.0   
Hardware: x86   
OS: Linux   
Attachments: patch against revision 4428 to obey the configured X11 XRANDR video driver support.
lshw output for Ubuntu 11.10 x86, GeForce 8800 GT

Description Sami Näätänen 2009-02-17 01:00:51 UTC
Created attachment 298 [details]
patch against revision 4428 to obey the configured X11 XRANDR video driver support.

Found out that 
src/video/x11/SDL_x11modes.c undefs the
SDL_VIDEO_DRIVER_X11_XRANDR value and thus disables the XRANDR video modes.

This prevents any SDL program from changing resolution.

FIX: Remove the undef -> make, make install.
TEST: Make the tests and run them with fullscreen and with different geometry settings and everything works.

The VIDMODE and XINERAMA extensions are similarly also disabled, but I didn't test those.

Test case with X11MODES_DEBUG enabled:

sami@who ~/prog/cvs/SDL/test $ ./testsprite2 --geometry 1280x960 --fullscreen
XRANDR: XRRQueryVersion: V1.2
XRANDR: mode =    0[0], w = 1600, h = 1200, rate =   50
XRANDR: mode =    0[1], w = 1600, h = 1200, rate =   51
XRANDR: mode =    0[2], w = 1600, h = 1200, rate =   56
XRANDR: mode =    0[3], w = 1600, h = 1200, rate =   57
XRANDR: mode =    0[4], w = 1600, h = 1200, rate =   58
XRANDR: mode =    1[0], w = 1024, h =  768, rate =   52
XRANDR: mode =    1[1], w = 1024, h =  768, rate =   67
XRANDR: mode =    1[2], w = 1024, h =  768, rate =   68
XRANDR: mode =    1[3], w = 1024, h =  768, rate =   69
XRANDR: mode =    1[4], w = 1024, h =  768, rate =   70
XRANDR: mode =    2[0], w =  800, h =  600, rate =   53
XRANDR: mode =    2[1], w =  800, h =  600, rate =   72
XRANDR: mode =    2[2], w =  800, h =  600, rate =   73
XRANDR: mode =    2[3], w =  800, h =  600, rate =   74
XRANDR: mode =    2[4], w =  800, h =  600, rate =   75
XRANDR: mode =    2[5], w =  800, h =  600, rate =   76
XRANDR: mode =    3[0], w =  640, h =  480, rate =   54
XRANDR: mode =    3[1], w =  640, h =  480, rate =   80
XRANDR: mode =    3[2], w =  640, h =  480, rate =   81
XRANDR: mode =    3[3], w =  640, h =  480, rate =   82
XRANDR: mode =    4[0], w =  320, h =  240, rate =   55
XRANDR: mode =    4[1], w =  320, h =  240, rate =   89
XRANDR: mode =    5[0], w = 1400, h = 1050, rate =   59
XRANDR: mode =    5[1], w = 1400, h = 1050, rate =   60
XRANDR: mode =    6[0], w = 1280, h = 1024, rate =   61
XRANDR: mode =    6[1], w = 1280, h = 1024, rate =   62
XRANDR: mode =    6[2], w = 1280, h = 1024, rate =   63
XRANDR: mode =    7[0], w = 1280, h =  960, rate =   64
XRANDR: mode =    7[1], w = 1280, h =  960, rate =   65
XRANDR: mode =    8[0], w = 1152, h =  864, rate =   66
XRANDR: mode =    9[0], w =  832, h =  624, rate =   71
XRANDR: mode =   10[0], w =  720, h =  400, rate =   77
XRANDR: mode =   11[0], w =  700, h =  525, rate =   78
XRANDR: mode =   11[1], w =  700, h =  525, rate =   79
XRANDR: mode =   12[0], w =  640, h =  400, rate =   83
XRANDR: mode =   13[0], w =  640, h =  350, rate =   84
XRANDR: mode =   14[0], w =  512, h =  384, rate =   85
XRANDR: mode =   14[1], w =  512, h =  384, rate =   86
XRANDR: mode =   14[2], w =  512, h =  384, rate =   87
XRANDR: mode =   15[0], w =  400, h =  300, rate =   88
XRANDR: mode =   16[0], w =  320, h =  175, rate =   90
XRandR is enabled
XRANDR: get_real_resolution: w = 1600, h = 1200, rate = 58
XRANDR: set_best_resolution(): w = 1280, h = 960
2424.31 frames per second
XRANDR: get_real_resolution: w = 1280, h = 960, rate = 58
XRANDR: set_best_resolution(): w = 1600, h = 1200
Comment 1 Sam Lantinga 2009-10-10 12:24:29 UTC
I'll re-enable XRANDR modes when I re-implement fullscreen support.

Thanks!
Comment 2 Sam Lantinga 2009-10-10 12:42:03 UTC
*** Bug 693 has been marked as a duplicate of this bug. ***
Comment 3 Sam Lantinga 2010-07-14 07:28:10 UTC
Done! :)
Comment 4 Martin Kallman 2012-04-24 07:28:19 UTC
Created attachment 849 [details]
lshw output for Ubuntu 11.10 x86, GeForce 8800 GT
Comment 5 Martin Kallman 2012-04-24 07:31:34 UTC
Issue appears to have resurfaced as of 6305.

On Ubuntu 11.10 x86, with NVIDIA's proprietary driver (version 173) and GeForce 8800 GT, SDL only reports one mode (the current desktop mode) as available when using SDL_GetNumDisplayModes / SDL_GetDisplayMode.

This seems to be driver-specific as the same setup works correctly under VMWare with the VMWare SVGA II adapter.

lshw output attached.
Comment 6 Martin Kallman 2012-04-24 07:35:33 UTC
Also note that the 'nvidia' driver is not found by SDL.

> Issue appears to have resurfaced as of 6305.
> 
> On Ubuntu 11.10 x86, with NVIDIA's proprietary driver (version 173) and GeForce
> 8800 GT, SDL only reports one mode (the current desktop mode) as available when
> using SDL_GetNumDisplayModes / SDL_GetDisplayMode.
> 
> This seems to be driver-specific as the same setup works correctly under VMWare
> with the VMWare SVGA II adapter.
> 
> lshw output attached.
Comment 7 Sam Lantinga 2012-10-03 11:29:09 UTC
Please enter a separate bug for the NVidia issue.  There really isn't anything SDL can do if the X server doesn't pick up the nvidia driver and advertise XRandR support.