Ok, apparently there's some nasty bug with AMD Catalyst driver especially in my case because I have this switchable GPU setup (Intel + Radeon).
Found a solution in Arch Linux Catalyst wiki in
here, explaining that some xrandr hack may be needed and it works wonder in my case.
The command is like:
Code:
xrandr --output LVDS1 --auto --left-of VGA1 --primary --scale 1x1 --output VGA1 --auto --scale 1.0001x1.0001
And more information in these
Arch Linux forum about setting up a udev rule to execute the xrandr command above every-time a monitor is plugged in.
Basically I created a simple bash script in
/usr/local/bin/monitor-hotplug:
Code:
#!/bin/bash
export DISPLAY=:0
export XAUTHORITY=/home/dwi/.Xauthority
function connect() {
xrandr --output LVDS1 --auto --left-of VGA1 --primary --scale 1x1 \
--output VGA1 --auto --scale 1.0001x1.0001
}
function disconnect() {
xrandr --output VGA1 --off
}
xrandr | grep "VGA1 connected" &> /dev/null && connect || disconnect
And create a custom udev rule for it in
/etc/udev/rules.d/95-monitor-hotplug.rules:
Code:
KERNEL=="card0", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/dwi/.Xauthority", RUN+="/usr/local/bin/monitor-hotplug"
And finally when I plug a second monitor no more screen corruption.
Still there's some problem with this setup:
- It will not run if I have my 2nd monitor plugged in before KDE session is started. Even if I plug my 2nd monitor in KDM I still got garbled screen.
- If I log out from KDE while the monitor is still plugged in, X.org server would crash - still investigating this issue.
Just a few more issue left to be ironed out, anybody have more suggestion what to do next? Hope this post also helps some people out there who's frustrated with their fglrx driver.
Thanks for your reply