510.x messes up multiple displays arrangement occasionally

I have two displays attached: a DisplayPort monitor and an HDMI TV. The DP monitor is the main screen and the TV is configured to extend the main screen to the right.

Occasionally, after boot or after switching the main screen to the TV and back, I can see that the display arrangement is changed - the TV extends the DP monitor upwards (i.e. it is placed above the monitor).

I have not observed this with the 470 series drivers and first noticed this with 510.39.01. This does not happen reliably, and not very often - maybe once every few days. I don’t have a reliable way to reproduce the issue.

To switch the primary display to the TV, I’m using the following script:

#!/bin/bash

finalize ()
{
    xrandr --output DP-0 --primary
}

set -e

xrandr --output HDMI-0 --primary
trap finalize EXIT

"$@"

I.e. this script switches the primary screen and runs a command (e.g. a fullscreen game). When the command terminates, the primary screen is restored back to the DP monitor.

I have tried to work around the issue by adding Option "MetaModeOrientation" "HDMI-0 RightOf DP-0" to xorg.conf, but that doesn’t seem to have any effect - the issue still reproduces from time to time.

nvidia-bug-report.log.gz (355.2 KB)

You’re running KDE, the monitor arrangement is handled by the kscreen2 service. This doesn’t like the display config being changed by xrandr/nvidia-settings.

This doesn’t only happen on configuration changes. Also, it doesn’t happen with 470 series.