Bug 13748 - [GM965] Display Start is set incorrectly when switching resolution
Summary: [GM965] Display Start is set incorrectly when switching resolution
Status: RESOLVED NOTOURBUG
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Wang Zhenyu
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-19 17:51 UTC by Richard Goedeken
Modified: 2008-02-19 20:10 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
sdltest.c (3.51 KB, text/plain)
2007-12-19 17:54 UTC, Richard Goedeken
no flags Details

Description Richard Goedeken 2007-12-19 17:51:30 UTC
- System: AOpen MiniPC MP965-DR
 - CPU/RAM: Core 2 duo T7500, 2GB 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 believe that the X server has one or more frame buffers in video memory which are the size of the Virtual Screen as determined at startup time.  The actual sub-set of this virtual screen which is shown on the monitor (or TV) has a starting point which is arbitrary and a rectangular size which is determined by the resolution of the current display mode.

This bug occurs when switching out of fullscreen mode in an SDL program.  To replicate this bug, compile the attached test program and do the following:

1. Boot MiniPC with only the TV attached, using format NTSC-M, and with the PreferredMode for the TV set to 800x600 in the xorg.conf file.
2. Run 'xrandr --output TV --mode 1024x768' to switch to the higher resolution
3. Run './sdltest 1024 768'
4. The pattern will display correctly in 1024x768 resolution
5. The bug will occur after switching out of SDL fullscreen mode

Expected behavior: display should remain in 1024x768 mode
Actual behavior: display will revert to 800x600 mode, and the display start will be set with positive X and Y offsets.  The top and left sides of the desktop will be chopped off and the bottom taskbar will be lifted ~30 pixels above the bottom of the screen.

The incorrect display start can then be corrected by using xrandr to switch back to 1024x768.
Comment 1 Richard Goedeken 2007-12-19 17:54:50 UTC
Created attachment 13245 [details]
sdltest.c

Run the following to compile this test program:

gcc -o sdltest `sdl-config --cflags --libs` sdltest.c
Comment 2 Richard Goedeken 2007-12-20 04:57:56 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 3 Eric Anholt 2008-02-13 10:30:32 UTC
This is probably just an issue with SDL being unaware of randr and smashing your setup as a result by using old extensions to set the mode, but I haven't tried to reproduce/debug it myself.
Comment 4 Richard Goedeken 2008-02-14 05:51:27 UTC
(In reply to comment #3)
> This is probably just an issue with SDL being unaware of randr and smashing
> your setup as a result by using old extensions to set the mode, but I haven't
> tried to reproduce/debug it myself.
> 

I'm using Fedora 8, which includes the latest SDL (1.2.13).  According to the this list of configure script flags (http://www.genunix.org/wiki/index.php/Configure_options_-_sdl), SDL does have support for XRandr fullscreen mode, and it is enabled by default. I don't know how the Fedora team built the included SDL library, but it seems unlikely that they would disable this feature.

I performed another test this morning: I added "Omit XFree86-VidModeExtension" to my xorg.conf, restarted X, and looked at the Xorg.0.log to verify that the VidMode extension was not loaded.  I then performed the test given in the original bug description, and the bug was still present.
Comment 5 Richard Goedeken 2008-02-19 20:10:01 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.