Bug 13643

Summary: [GM965] Cannot set SDL Fullscreen mode larger than current resolution
Product: xorg Reporter: Richard Goedeken <SirRichard>
Component: Driver/intelAssignee: Wang Zhenyu <zhenyu.z.wang>
Status: RESOLVED NOTOURBUG QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
sdltest.c none

Description Richard Goedeken 2007-12-13 06:37:47 UTC
- Machine: Core 2 duo T7500, 1GB ram
 - OS: Fedora 8
 - X server: xorg 1.4.99.1-0.10.fc9
 - intel_drv.so: built from git checkout 12/09
 - mesa/drm drivers: built from git checkout 12/09
 - system outputs: VGA, TMDS-1, LVDS, TV
 - TV: 32" Sony WEGA, NTSC 480i only

I have discovered a problem with setting up a fullscreen graphics mode via SDL when using the TV output.  This problem was found when the current mode was set with 'xrandr --output TV --mode 800x600'.  The display had a resolution of 800x600 as expected.  However, when running an SDL program which tried to set the resolution to either 848x480 or 1024x768 (a higher res), the following error occurred:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  134 (XFree86-VidModeExtension)
  Minor opcode of failed request:  10 (XF86VidModeSwitchToMode)
  Value in failed request:  0x79
  Serial number of failed request:  109
  Current serial number in output stream:  111

Note that I could successfully run a program setting a lower res (640x480) without problem and it appeared correctly in fullscreen at the lower resolution.

When I used xrandr to set a resolution of 1024x768, this problem went away - I could run SDL programs setting any available resolution without error.  However this also caused a different odd behavior.  In this case, if a program set 800x600, the TV stayed in 1024x768 but only the upper-left 800x600 were repainted.  However, if a program set 848x480, the TV would switch out of 1024x768 and the display would again take up the full screen.
Comment 1 Gordon Jin 2007-12-18 17:37:29 UTC
Keith, is this caused by vidmodextension compatibility with randr?
Comment 2 Richard Goedeken 2007-12-19 17:01:13 UTC
Created attachment 13242 [details]
sdltest.c

Attached is the C source for a test program to replicate this bug.  Compile with:

gcc -o sdltest `sdl-config --cflags --libs` sdltest.c

To replicate the bug:
1. Boot MiniPC with only TV connected
2. Run 'xrandr --output TV --mode 800x600'
3. Run './sdltest 1024 768'
4. Program will not run, X error will be displayed
Comment 3 Gordon Jin 2007-12-19 23:35:15 UTC
This issue only happens on TV output, and works on VGA, right?
Comment 4 Richard Goedeken 2007-12-20 04:54:13 UTC
I tested this morning and found that this bug occurs in both TV-only and VGA-only configurations; apparently it is not dependent on the output type.
Comment 5 Gordon Jin 2007-12-20 17:21:34 UTC
OK, so let's discuss in the normal (VGA) scope. TV may involve some side issues.
Comment 6 Richard Goedeken 2008-02-19 20:10:45 UTC
After further testing, I concluded that this bug is not specific to the Intel video drivers.  I searched through the SDL bugzilla and mailing lists and found references to problems with SDL+XRANDR going back to 2003.  I am able to work around this problem by setting an undocumented environment variable: SDL_VIDEO_X11_XRANDR=1.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.