Create modeline from NVIDIA Xserver settings tool

I recently bought a plasma TV and I’m trying to get my HTPC configured properly for it. Its native resolution is 1920x1080, but without tweaking the screen is too big and too far up and to the left. So I tried the NVIDIA Xserver settings tool, since I’m running NVIDIA drivers rather than the nouveau drivers. I can get the screen to fit correctly using that tool, but after lots and lots of searching, I cannot figure out how to convert those settings to a modeline. So I’m looking for a bit of help.

In the NVIDIA tool, under X Server Display Configuration, Advanced, I have the following:
Selection: Panasonic TV (DFP-1)
Configuration: X screen 0
Resolution: Auto (refresh is grayed out as Auto)
Mode name: nvidia-auto-select (can’t be changed)
Orientation: No Rotation No Reflection
ViewPortIn: 1840x1032
ViewPortOut: 1840x1032+43+21
Panning: 1840x1032

This gives me the desktop centered, using maximum screen real estate, without anything cut off. That’s great, but I have to redo that every time I start a new session. My /etc/x11/xorg.conf.d/xorg.conf has this line in it:

metamods "nvidia-auto-select" +0+0 {viewportin=1840x1032} {viewportout=1840x1032+43+21}

However, when I reboot the PC, those settings aren’t in effect. The screen is positioned correctly, and is the right size vertically and horizontally, but if I scoll the mouse off the right side of the screen, the screen pans to the right and I get a white band down the right side of the screen. I have trouble with text when the screen is like this too. If I used the NVIDIA X server settings tool again, and reset those values, the screen is back to normal and text looks great again.

Can anybody tell me what I’m doing wrong?

Can anybody help me find a resource for properly building a modeline from that NVIDIA X server settings tool? The only stuff I’ve found is stuff that assumes that you have all of the technical specs on the monitor, but I don’t have (and can’t find) any of those.

You should save the settings as /etc/X11/xorg.conf, not /etc/x11/xorg.conf.d/xorg.conf.

So try to move that file to the correct place:

sudo mv /etc/x11/xorg.conf.d/xorg.conf /etc/X11/xorg.conf

That didn’t help. I’m still getting the same result.

Does anybody know if that modeline is correct, or can help me figure out how it should be written?

Are you sure it is in /etc/X11/? Linux is case-sensitive and you wrote /etc/x11/, it won’t be found there.

Could you post the whole file?
If it only has that one line it cannot work.

~> cat /etc/X11/xorg.conf
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 331.20  (buildmeister@swio-display-x86-rhel47-05)  Wed Oct 30 18:20:32 PDT 2013

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from data in "/etc/sysconfig/mouse"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "IMPS/2"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "yes"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Panasonic-TV"
    HorizSync       15.0 - 68.0
    VertRefresh     23.0 - 61.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 570"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-1"
    Option         "metamodes" "nvidia-auto-select +0+0 {viewportin=1842x1036, viewportout=1842x1036+43+21}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection


Here’s output from xrandr is that matters:

~> xrandr --verbose
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
    Identifier: 0x27c
    Timestamp:  51076
    Subpixel:   unknown
    Clones:    
    CRTCs:      0 1
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter: 
    BorderDimensions: 4 
        supported: 4
    Border: 0 0 0 0 
        range: (0, 65535)
    SignalFormat: VGA 
        supported: VGA
    ConnectorType: DVI-I 
    ConnectorNumber: 0 
    _ConnectorLocation: 0 
DVI-I-1 disconnected (normal left inverted right x axis y axis)
    Identifier: 0x27d
    Timestamp:  51076
    Subpixel:   unknown
    Clones:    
    CRTCs:      0 1
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter: 
    BorderDimensions: 4 
        supported: 4
    Border: 0 0 0 0 
        range: (0, 65535)
    SignalFormat: VGA 
        supported: VGA
    ConnectorType: DVI-I 
    ConnectorNumber: 1 
    _ConnectorLocation: 1 
DVI-I-2 disconnected (normal left inverted right x axis y axis)
    Identifier: 0x27e
    Timestamp:  51076
    Subpixel:   unknown
    Clones:    
    CRTCs:      0 1
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter: 
    BorderDimensions: 4 
        supported: 4
    Border: 0 0 0 0 
        range: (0, 65535)
    SignalFormat: TMDS 
        supported: TMDS
    ConnectorType: DVI-I 
    ConnectorNumber: 0 
    _ConnectorLocation: 0 
HDMI-0 connected primary 1842x1036+0+0 (0x280) normal (normal left inverted right x axis y axis) 698mm x 392mm panning 1920x1080+0+0
    Identifier: 0x27f
    Timestamp:  51076
    Subpixel:   unknown
    Gamma:      1.0:1.0:1.0
    Brightness: 1.0
    Clones:    
    CRTC:       0
    CRTCs:      0 1
    Panning:    1920x1080+0+0
    Tracking:   1920x1080+0+0
    Border:     0/0/0/0
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter: 
    _MUTTER_PRESENTATION_OUTPUT: 0 
    EDID: 
        00ffffffffffff0034a996a201010101
        00170103808048780adaffa3584aa229
        17494b21080031404540614081800101
        010101010101023a801871382d40582c
        4500ba882100001e011d8018711c1620
        582c2500ba882100009e000000fc0050
        616e61736f6e69632d54560a000000fd
        00173d0f440f000a202020202020015d
        020341f54f9005202204030207060a0b
        0e230f2438097f070f7f071507503e1f
        c04d02005706006754005f540168030c
        002100b82d0fe2004be3051f01835f00
        00011d007251d01e206e285500ba8821
        00001e8c0ad08a20e02d10103e9600ba
        88210000188c0ad08a20e02d10103e96
        000b88210000180000000000000000a9
    BorderDimensions: 4 
        supported: 4
    Border: 43 21 35 23 
        range: (0, 65535)
    SignalFormat: TMDS 
        supported: TMDS
    ConnectorType: HDMI 
    ConnectorNumber: 2 
    _ConnectorLocation: 2 
  1920x1080 (0x280)  148.5MHz +HSync +VSync *current +preferred
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock   67.5KHz
        v: height 1080 start 1084 end 1089 total 1125           clock   60.0Hz
  1920x1080 (0x281)  148.3MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock   67.4KHz
        v: height 1080 start 1084 end 1089 total 1125           clock   59.9Hz
  1920x1080 (0x282)   74.2MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock   33.7KHz
        v: height 1080 start 1084 end 1089 total 1125           clock   30.0Hz
  1920x1080 (0x283)   74.2MHz +HSync +VSync
        h: width  1920 start 2558 end 2602 total 2750 skew    0 clock   27.0KHz
        v: height 1080 start 1084 end 1089 total 1125           clock   24.0Hz
  1920x1080 (0x284)   74.2MHz +HSync +VSync Interlace
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock   33.8KHz
        v: height 1080 start 1084 end 1094 total 1124           clock   60.1Hz
  1920x1080 (0x285)   74.2MHz +HSync +VSync Interlace
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock   33.7KHz
        v: height 1080 start 1084 end 1094 total 1124           clock   60.0Hz
  1280x1024 (0x286)  108.0MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock   64.0KHz
        v: height 1024 start 1025 end 1028 total 1066           clock   60.0Hz
  1280x720 (0x287)   74.2MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock   45.0KHz
        v: height  720 start  725 end  730 total  750           clock   60.0Hz
  1280x720 (0x288)   74.2MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock   45.0KHz
        v: height  720 start  725 end  730 total  750           clock   59.9Hz
  1024x768 (0x289)   65.0MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock   48.4KHz
        v: height  768 start  771 end  777 total  806           clock   60.0Hz
  800x600 (0x28a)   40.0MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock   37.9KHz
        v: height  600 start  601 end  605 total  628           clock   60.3Hz
  720x480 (0x28b)   27.0MHz -HSync -VSync
        h: width   720 start  736 end  798 total  858 skew    0 clock   31.5KHz
        v: height  480 start  489 end  495 total  525           clock   59.9Hz
  720x480 (0x28c)   13.5MHz -HSync -VSync Interlace
        h: width   720 start  739 end  801 total  858 skew    0 clock   15.7KHz
        v: height  480 start  488 end  494 total  524           clock   60.1Hz
  640x480 (0x28d)   25.2MHz -HSync -VSync
        h: width   640 start  648 end  744 total  800 skew    0 clock   31.5KHz
        v: height  480 start  482 end  484 total  525           clock   60.0Hz
  640x480 (0x28e)   25.2MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock   31.5KHz
        v: height  480 start  490 end  492 total  525           clock   59.9Hz
  480x480 (0x28f)   18.0MHz -HSync -VSync
        h: width   480 start  490 end  532 total  572 skew    0 clock   31.5KHz
        v: height  480 start  489 end  495 total  525           clock   59.9Hz
  411x480 (0x290)   15.4MHz -HSync -VSync
        h: width   411 start  420 end  456 total  490 skew    0 clock   31.5KHz
        v: height  480 start  489 end  495 total  525           clock   60.0Hz
  3x480 (0x291)    0.1MHz -HSync -VSync Interlace
        h: width     3 start    4 end    4 total    4 skew    0 clock   18.5KHz
        v: height  480 start  488 end  494 total  524           clock   70.6Hz
DP-0 disconnected (normal left inverted right x axis y axis)
    Identifier: 0x292
    Timestamp:  51076
    Subpixel:   unknown
    Clones:    
    CRTCs:      0 1
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter: 
    BorderDimensions: 4 
        supported: 4
    Border: 0 0 0 0 
        range: (0, 65535)
    SignalFormat: TMDS 
        supported: TMDS
    ConnectorType: DisplayPort 
    ConnectorNumber: 3 
    _ConnectorLocation: 3 
DVI-I-3 disconnected (normal left inverted right x axis y axis)
    Identifier: 0x293
    Timestamp:  51076
    Subpixel:   unknown
    Clones:    
    CRTCs:      0 1
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter: 
    BorderDimensions: 4 
        supported: 4
    Border: 0 0 0 0 
        range: (0, 65535)
    SignalFormat: TMDS 
        supported: TMDS
    ConnectorType: DVI-I 
    ConnectorNumber: 1 
    _ConnectorLocation: 1 
DP-1 disconnected (normal left inverted right x axis y axis)
    Identifier: 0x294
    Timestamp:  51076
    Subpixel:   unknown
    Clones:    
    CRTCs:      0 1
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter: 
    BorderDimensions: 4 
        supported: 4
    Border: 0 0 0 0 
        range: (0, 65535)
    SignalFormat: DisplayPort 
        supported: DisplayPort
    ConnectorType: DisplayPort 
    ConnectorNumber: 3 
    _ConnectorLocation: 3 


BTW, I’ve discovered something quite strange.

When the screen pans and gives me that white bar on the side, I can go into the NVIDIA X server settings application and the settings are all listed correctly. If I change and apply them, then change them back to those settings listed above (I usually just change the vertical dims by 8), it’s fine again.

Are you using KDE?
I guess the “problem” is kscreen then. It disregards the X configuration and sets its own configured resolution.

So enter “Configure Desktop”->“Display and Monitor”->“Configure Display” and set the resolution there.

If that’s not possible as you would like it, go into “Configure Desktop”->“Startup and Shutdown”->“Service Management” and disable the KScreen2 service there. Your xorg.conf should work then.

Sorry. I’m using GNOME. I should have specified that.

Well, I don’t know how this works in GNOME, but there are similar settings in gnome-control-center.
So maybe try to change the resolution there as well. It may override your system-wide X resolution settings.

“Gnome settings” allows me to change the resolution for my display, but the only options it gives me are:
1920x1080
1280x1024
1280x720
1024x768
800x600.

There is no way to enter custom values. I’ve found that if I change the settings in the NVIDIA X server settings application to fix the problem, as soon as I mess with that resolution in gnome settings, the panning comes back. Regardless of the resolution selected in gnome settings, the white bar is the same relative size. I don’t think that is where the problem lies.

I’ve also looked in the GNOME Tweak Tool, but didn’t find anything for changing screen resolution.

I think it’s strange that something as minor as going into Gnome settings will revert it to panning. I’ve tested it and if the screen saver kicks in, it does not revert. However, once the screen shuts off (after a long time of being idle), it does revert to panning.

Well, maybe it applies its own (saved) settings as soon as you enter it?

Can you try a minimal desktop session like “IceWM” or “twm”? (you should be able to select those at the login screen. if you have auto-login enabled, logout to get there)
Is the resolution ok there?
Then it must be GNOME that overrides Xorg’s resolution.

You could also try with a new user. Maybe GNOME would take Xorg’s settings then as default.

I created and tested a new user. Didn’t change the behavior.

Switched to Icewm. Didn’t change the behavior.

Ok, then it may be the xorg.conf that’s wrong.

Try to create it again with nvidia-settings.

Please upload the /var/log/Xorg.0.log to http://susepaste.org and post a link. Maybe there’s some obvious error message regarding the xorg.conf in there.

Be sure to run nvidia-setings as root. Have to be root to actually change the file

You might get somewhere with this:

https://forums.opensuse.org/showthread.php/441889-Nvidia-for-Newbies-part-1?highlight=NVIDIA+newbies

Though if you do already have a /etc/x11/xorg.conf It 'd be a good idea to rename it xorg.conf.old 1st. Then try out the above.

That’s a nice guide, but it didn’t help the problem at all. When I rebooted, I’m back to getting the white strip to the right.

(Sorry for the delayed reply. I’ve been out of town.)

Strangely, I fixed the problem, though I don’t know how.

I decided to figure out if the problem was with GNOME or NVIDIA, so I installed KDE. I had the same problem with KDE, and the screen was acting weird. So I switched back to GNOME, and now it’s working fine. I don’t know why that would fix it, but it did.

The problem is back. <sigh>