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 80 - X11 vidmode selection: user vs server
Summary: X11 vidmode selection: user vs server
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: All Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-24 05:07 UTC by Ryan C. Gordon
Modified: 2006-05-05 01:51 UTC (History)
0 users

See Also:


Attachments
first patch (2.88 KB, patch)
2006-01-24 05:08 UTC, Ryan C. Gordon
Details | Diff
second patch (7.37 KB, patch)
2006-01-24 05:08 UTC, Ryan C. Gordon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan C. Gordon 2006-01-24 05:07:16 UTC
(pretty sure this never got fixed...look into it!  --ryan.)


Date: 21 Apr 2003 17:20:20 +0100
From: Alan Swanson <swanson@uklinux.net>
Subject: [SDL] New XFree 4.3 Video Mode Patch


The current patch to fix the issues with XFree 4.3 it is a bit of
overkill to a simple problem.

If you look at the unsorted list of modes returned by X, here's mine;

 1280 x 1024 @ 85.0  >
 1024 x 768 @ 100.3  > USER
 800 x 600 @ 125.5   > SET
 640 x 480 @ 124.9   >
 1280 x 1024 @ 75.0  ]
 1280 x 1024 @ 60.0  ]
 1280 x 960 @ 85.0   ] X11
 1280 x 960 @ 60.0   ] AUTO
 1152 x 864 @ 75.0   ]=20
 1152 x 768 @ 54.8   ]
 960 x 720 @ 120.0   ]
...
 640 x 400 @ 85.1    ] 256k
 576 x 432 @ 150.0   ] 249k PIXEL
 640 x 350 @ 85.1    ] 224k COUNT
 576 x 384 @ 109.6   ] 221k
...

The user set modes come first followed by X set modes which are ordered
by decreasing number of pixels and refresh.

The reason why every other library or program not using SDL working is
due to SDL scanning the modes in reverse getting X11 provided modes
modes with the lowest refresh.

The solution is to scan forward for the first user set mode or highest X
mode. The current qsort still keeps user set modes above higher refresh
modes set by X.

For the best match (I don't like the goto but was following prior code)
we still search for the nearest larger size and then try to find a
higher version of it.

I've included two patches;

Before the current CVS showing the error : sdl-x11-vidmode.diff
The second patches the reverts CVS code  : sdl-x11-vidmode-cvs.diff

Enjoy. Just in time to play Majesty too!

Alan.
Comment 1 Ryan C. Gordon 2006-01-24 05:08:15 UTC
Created attachment 36 [details]
first patch
Comment 2 Ryan C. Gordon 2006-01-24 05:08:52 UTC
Created attachment 37 [details]
second patch


(Please note that these patches are from 2003...they probably need to be updated for CVS.)

--ryan.
Comment 3 Ryan C. Gordon 2006-01-27 11:23:24 UTC
Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

Comment 4 Sam Lantinga 2006-05-05 01:51:58 UTC
I've implemented a fix based on your description, and tested it against X.Org 6.8.2, which has the same behavior.  Thanks!