Comment 2 for bug 1394665

Revision history for this message
solazs (solazs) wrote :

Update:
I've managed to get things working, here is what I've done:

First I've created a file, 90-force-crt.conf in /usr/share/X11/xorg.conf.d with the following content:
Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration" "on"
    Option "IgnoreDisplayDevices" ""
EndSection

This made sure nvidia recognizes a non-existent display even when xorg.conf is regenerated.
Next, using the built in display manager, I've aligned the displays so the HDMI display is on the right and the internal display and the non-existent display are on the left, the internal screen completely overlapping with the virtual display.

This worked pretty well, but I had to write a small script to set the resolution of virtual display to match the laptop screen size. The script runs at login and contains the following:
#!/bin/bash

if prime-select query | grep -q "nvidia"; then
 if xrandr | grep -q "HDMI-0 connected"; then
  xrandr --newmode "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync
  xrandr --addmode VGA-0 "1600x900"
  xrandr --output VGA-0 --mode "1600x900"
 fi
fi

Now everything works.

I'll attach my xorg.0.log created with the above config.