Bug 24438 - SDL games don't allow to change resolution due to missing vidmode extension
Summary: SDL games don't allow to change resolution due to missing vidmode extension
Status: RESOLVED NOTOURBUG
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-09 21:03 UTC by maximlevitsky
Modified: 2009-10-16 22:32 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description maximlevitsky 2009-10-09 21:03:32 UTC
I use -git of all graphics components (drm,mesa,xorg,intel driver)

I recently noticed that all SDL games have lost ability to change resolution, and now only allow native resolution (1280x1024)
Comment 1 Julien Cristau 2009-10-10 09:06:14 UTC
On Fri, Oct  9, 2009 at 21:03:33 -0700, bugzilla-daemon@freedesktop.org wrote:

> I use -git of all graphics components (drm,mesa,xorg,intel driver)
> 
> I recently noticed that all SDL games have lost ability to change resolution,
> and now only allow native resolution (1280x1024)
> 
AFAIK you can tell sdl to use randr for resolution changes.
Comment 2 maximlevitsky 2009-10-10 10:17:07 UTC
That makes sense.

I had used sdl from ubuntu 9.04. I would expect them to use xrand.
Maybe, they just enumerate the modes via XVidMode.

Best regards,
      Maxim Levitsky
Comment 3 maximlevitsky 2009-10-10 11:04:06 UTC
I did a tcp trace on an SDL game (neverball). It never queries the Xrandr extension, but does query the 'XFree86-VidModeExtension' which was removed and god riddance.

So I guess that the fault of ubuntu developers not compiling xrandr into SDL.

I close that as wontfix.
Comment 4 maximlevitsky 2009-10-16 22:14:14 UTC
Well, I compiled the latest SDL tarball with following arguments:

./configure --disable-dga --disable-video-x11-vm --disable-video-x11-xme --enable-video-x11-xrandr


...
-- dynamic libX11ext -> libXext.so.6
checking for X11/extensions/Xrandr.h... yes
-- dynamic libXrender -> libXrender.so.1
-- dynamic libXrandr -> libXrandr.so.2
checking for X11/extensions/dpms.h... yes
checking for framebuffer console support... yes
...


And yet, I couldn't change the resolution in any game.
I should probably report that to SDL.
Comment 5 maximlevitsky 2009-10-16 22:32:14 UTC
Found the problem:

Inside SDL source, in file src/video/x11/SDL_x11modes.c in function:

#if SDL_VIDEO_DRIVER_X11_XRANDR
static int CheckXRandR(_THIS, int *major, int *minor)
{
    const char *env;

    /* Default the extension not available */
    *major = *minor = 0;

    /* Allow environment override */
    env = getenv("SDL_VIDEO_X11_XRANDR");
    if ( env && !SDL_atoi(env) ) {
        return 0;
    }

    /* This defaults off now, due to KDE window maximize problems */
    if ( !env ) {
        return 0;
    }

    if ( !SDL_X11_HAVE_XRANDR ) {
        return 0;
    }

    /* Query the extension version */
    if ( !XRRQueryVersion(SDL_Display, major, minor) ) {
        return 0;
    }
    return 1;
}


Yes, exporting SDL_VIDEO_X11_XRANDR=1 fixed this...


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.