After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748213 - Xrandr fails to set the desired resolution
Xrandr fails to set the desired resolution
Status: RESOLVED NOTGNOME
Product: gdm
Classification: Core
Component: general
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-20 20:25 UTC by mario.k.1003
Modified: 2015-04-21 13:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description mario.k.1003 2015-04-20 20:25:15 UTC
Hello, 

I don't know if this is the right place, but please check it out.

I need some help in figuring out why does xrandr failes to set the desired resolution.

I have a dual monitor setup:

- 13" laptop preferring 2560x1440 resolution
- 24" monitor preferring 1920x1200 resolution

Because of the high-dpi stuff, I want to push the laptop resolution to 1920x1080 which does not get recognized by the display manager.

I get only this:

    2560x1440     59.95*+
    1920x1440     60.00  
    1856x1392     60.01  
    1792x1344     60.01  
    1600x1200     60.00  
    1400x1050     59.98  
    1280x1024     60.02  
    1280x960      60.00  
    1024x768      60.00  
    800x600       60.32    56.25  
    640x480       59.94 

To get the modeline, I use:

    cvt 1920 1080 

Then to make changes persistent across sessions, I add the following lines into a script in following folder which gets executed during x11 init:

    /etc/X11/xinit/xinitrc.d

Contents (add-fullhd-to-edp1.sh):

    xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
    xrandr --addmode eDP1 1920x1080_60.00

After which I get that the resolution is now supported in xrandr

    2560x1440     59.95*+
    1920x1440     60.00  
    1856x1392     60.01  
    1792x1344     60.01  
    1600x1200     60.00  
    1400x1050     59.98  
    1280x1024     60.02  
    1280x960      60.00  
    1024x768      60.00  
    800x600       60.32    56.25  
    640x480       59.94  
    1920x1080_60.00  59.96

So after I choose the resolution either with xrandr or the GUI I get the screen flashing once while it tries to set the resolution, and then second time for the revert. Entries in Xorg.log while that happens are only framebuffer resizes:

    (II) intel(0): resizing framebuffer to 1920x2280
    (II) intel(0): switch to mode 1920x1200@60.0 on HDMI1 using pipe 0, position (0, 0), rotation normal, reflection none
    (II) intel(0): switch to mode 1920x1080@60.0 on eDP1 using pipe 1, position (0, 1200), rotation normal, reflection none
    (II) intel(0): resizing framebuffer to 2560x2640
    (II) intel(0): switch to mode 1920x1200@60.0 on HDMI1 using pipe 1, position (0, 0), rotation normal, reflection none
    (II) intel(0): switch to mode 2560x1440@60.0 on eDP1 using pipe 0, position (0, 1200), rotation normal, reflection none
    (II) intel(0): switch to mode 1920x1200@60.0 on HDMI1 using pipe 0, position (0, 0), rotation normal, reflection none
    (II) intel(0): switch to mode 2560x1440@60.0 on eDP1 using pipe 1, position (0, 1200), rotation normal, reflection none

As you can see, I'm have an intel driver, Iris graphics.

    00:02.0 VGA compatible controller: Intel Corporation Device 0a2e (rev 09)
Comment 1 Ray Strode [halfline] 2015-04-20 20:38:05 UTC
try dropping this file into /etc/X11/xorg.conf.d (call it 20-intel.conf):

Section "Device"
	Identifier  "Intel Graphics"
        Driver      "intel"
        Option      "monitor-eDP1" "eDP1"
EndSection

Section "Monitor"
        Identifier      "eDP1"
	Modeline "1920x1080"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync
	Modeline "1600x900"  119.00  1600 1696 1864 2128  900 901 904 932  -HSync +Vsync
EndSection

instead of the xinitrc.d thing.  does that work better?
Comment 2 mario.k.1003 2015-04-20 21:06:17 UTC
It works.

I didn't like the static config because I was a smart ass. What seems to be the difference here? 

Thanks, man. :)

Sorry for the bug report but I kind of guessed both ways should work equally.
Comment 3 mario.k.1003 2015-04-21 08:31:57 UTC
Do you think this is worth to post as as bug to the X developers, xrandr? We can close the issue here, if you wish.
Comment 4 Ray Strode [halfline] 2015-04-21 13:02:32 UTC
not actually sure off hand why the xrandr commands aren't working.  might be racing with gnome-settings-daemon start up (which can change the mode based on monitors.xml)? 

The timings are slightly different, too, between what I posted and what you were using. Thought it's not clear to me why that would be the problem.

Would need more investigation to know the full scoop.  You could try asking in #xorg-devel on IRC and see if anyone has any insight.