I have nvidia driver 340.98
with GT218M [NVS 3100M], Xubuntu 16.04, any results below are from this environment if I don't mention otherwise. Here is my testing environment info, the output of:
sudo apt-get install pastebinit; \
sudo sh -c "lsb_release -sd; \
dmidecode -s system-product-name; echo ==; \
lshw -c display; echo ==; \
xrandr --verbose; echo ==; \
cat /etx/X11/xorg.conf" \
| tee ~/Desktop/ubuntu-graphic-info.txt \
| pastebinit
Weird and complex stack to debug specially using proprietary drivers. Most of the time, I get unexpected behaviors, may be due to lack of knowledge about the current Linux graphics stack setup.
- I wrote this answer before, that may introduce some debugging tools like
xtrace
- Avoid running multiple/sequential
xrandr
commands, only after X server reset. Same command may have different result depending on previous commands. I have noticed that with --scale
(see test case from my answer, linked above) --transform
& --fb
. Still don't know an easy way only by logout/login. So always logout/login before making another trial.
- Screenshots take only pixel size image from FB, so I will add camera photos to show the real results.
Method 1: xrandr --output .. --scale HCoefxVCoef
or --scale-from WxH
Note, works fine for me. --scale
is a shortcut for --transform
, see method3
(VGA-0 below DP-3)
xrandr \
--output DP-3 --mode 1280x800 --scale 1x1 --pos 0x0 --fb 2880x2600 \
--output VGA-0 --mode 1440x900 --scale 2x2 --pos 0x800
or:
xrandr \
--output DP-3 --mode 1280x800 --pos 0x0 --fb 2880x2600 \
--output VGA-0 --mode 1440x900 --scale-from 2880x1800 --pos 0x800
FrameBuffer size calculation:
width = max(1280,1440*2) = 2880
height = 800+900*2 = 2600
Results:
Method 2: nvidia-settings
View Port In/Out
Note, doesn't work well. nvidia-settings
does not change frame-buffer to the required size as in xrandr
command. It seems a bug (kind of, nvidia
has its own FB), need more research.
Tried to replicate xrandr
setup directly using nvidia-settings
(I used xrandr from method1, marked down nvidia setting, reset settings, then used nvidia-settings directly):
gksu nvidia-settings
→ X Server Display Configuration
- Select external monitor → advanced...
- Make ViewPortIn & Panning double of ViewPortOut (which is the same as original resolution)
- Leave internal monitor unchanged then Apply
Example:
Results: Notice the mouse pointer, it can reach all edges of the 2nd monitor even it only draws the top left quarter.
Update: Well, I could finally get a workaround trick. Add 1px to the width or height of panning (Panning
)
Panning: 2881x1800 or 2880x1801
New Results: I can't explain this, just the background is corrupted if i use below, otherwise every thing seems ok.
nvidia-settings viewportin with panning trick screenshot
lowered the color quality of above picture to make less then 2MB imgur limit
nvidia -settings viewportin with panning trick photo
Method 3: xrandr --output .. --transform "H,0,0,0,V,0,0,0,1"
Note, works fine for me, same as method1
(VGA-0 right of DP-3)
xrandr \
--output DP-3 -primary --mode 1280x800 --pos 0x0 --transform "1,0,0,0,1,0,0,0,1" --fb 4160x1800 \
--output VGA-0 --mode 1440x900 --transform "2,0,0,0,2,0,0,0,1" --right-of DP-3
FrameBuffer size calculation:
width = 1280+1440*2 = 4160
height = max(800,900*2) = 1800
Results:
Best Answer
if you're using Gnome on Ubuntu, you can use
xrandr
command to make screens different from one another. For example:--scale 2x2
- make everything on 4K screen twice larger--mode XxY
- explicitly set the resolution for the screen (not necessary if is already set)--fb XxY
- set the size of a virtual screen (framebuffer) (this iss very important. Without this, you will be able to use only a fourth of your screen). That maximum framebuffer size might be specified in xorg.conf - then you cannot exceed it (it is written in the first line of xrandr -q output).--pos XxY
- in my case I set the absolute positioning of the screens, so my laptop screen is directly on the bottom of the external screen.sources: Arch Wiki Page and This post