Optimus laptop stop panning on Nvidia screen

Hi,

I have a Dell E6520 with Optimus. I’m using the docking station with 2 external monitors and laptop lvds screen. I’m running Fedora 20 with the 331.104 drivers.

Bottom it works great except for some reason the monitor driven by the Nvidia card always starts off panning. I can eventually get it to stop by running the below script multiple times, but have no idea why it stops.

The way that I’m using it is using RandR to setup the additional monitors. The only setup in my xorg.conf file is the nvidia screen. I’m not sure if this is a RandR issue or something else.

Here the script I use:

output=“$(xrandr --listproviders)”

src=$(echo “$output” | grep " Source" | head -n1 | awk ‘{print $NF}’ | cut -d: -f2)
sink=$(echo -e “$output” | grep " Sink" | head -n1 | awk ‘{print $NF}’ | cut -d: -f2)

Pass provider or sink and source

xrandr --setprovideroutputsource “$sink” “$src”

Make sure xrandr sees all the outputs

xrandr --auto

Do not move up. Only now xrandr shows the outputs

Do not move up. Only now xrandr shows the outputs

each one of these settings is determined by what connection is

enabled. use xrandr |grep -i " connected" to see what connectors are set

lvds=$(xrandr | grep -i “lvds” |grep -i " connected" | awk ‘{ print $1 }’)
dp=$(xrandr | grep -i “dp” |grep -i " connected" | awk ‘{ print $1 }’)
vga=$(xrandr | grep -i “vga” |grep -i " connected" | awk ‘{ print $1 }’)

xrandr --output “$lvds” --off --output “$vga” --off --output $dp --off
#xrandr --output “$lvds” --auto
#xrandr --output “$vga” --auto

#may need this first before the second one. Not sure.
#xrandr --fb 5760x1080 --output $dp --mode 1920x1080 --panning 5780x1080+0+0 --primary
xrandr --fb 1920x1080
#xrandr --fb 5760x1080 --output $dp --mode 1920x1080 --primary --output $lvds --mode 1920x1080 --right-of $dp --output $vga --mode 1920x1080 --right-of $lvds

xrandr --output $lvds --mode 1920x1080 --right-of $dp --output $vga --mode 1920x1080 --right-of $lvds

xrandr --output $lvds --mode 1920x1080 --output $vga --mode 1920x1080 --right-of $lvds --output$dp --mode 1920x1080 right-of $vga

#xrandr --output $lvds --mode 1920x1080 --right-of $dp --output $vga --mode 1920x1080 --right-of $lvds --output $dp --mode 1920x1080 --primary

xrandr --output $dp --mode 1920x1080 --primary --output $lvds --mode 1920x1080 --right-of $dp --output $vga --mode 1920x1080 --right-of $lvds

#Sometimes the $dp screen is scrolling. For some reason this prevents

it

Not needing this anymore

xrandr --fb 5760x1080
xrandr --fb 1920x1080

Here is my xorg.conf

Section “Device”
Identifier “nvidia”
Driver “nvidia”
Option “NoLogo” “true”
Option “DPI” “96 x 96”
VendorName “NVIDIA Corporation”
BoardName “NVS 4200M”
# Specify Nvidia PCI device
BusID “PCI:1:0:0”
# Make sure X starts also when no outputs are connected to the Nvidia chip
Option “AllowEmptyInitialConfiguration”
Option “ConstrainACursor” “0”
Option “PanAllDisplays” “0”
Option “nvidiaXineramaInfoOverride” “1920x1080+1280+0, 1920x1080+3840, 1920x1080+5760”
EndSection

Slave device

Section “Device”
Identifier “intel”
# Simple output, no full Intel driver
Driver “modesetting”
# BusID “PCI:0:2:0”
EndSection

Section “Screen”
Identifier “intel”
Device “intel”
EndSection

Section “Screen”
Identifier “nvidia”
Device “nvidia”
EndSection

Make sure the Nvidia device is the first in the server

Section “ServerLayout”
Identifier “layout”
Screen 0 “nvidia”
Inactive “intel”