librecore-org / librecore

GNU General Public License v2.0
88 stars 10 forks source link

[x200] Dock DisplayPort hotplug is broken #24

Open ghost opened 7 years ago

ghost commented 7 years ago

When docking an X200 with an external DisplayPort monitor, the latter isn't automatically attached. udevadm monitor doesn't show a single drm-related event.

Wten undocking an X200 with an external DisplayPort monitor, the latter isn't automatically detached either. udevadm monitor doesn't show a single drm-related event.

After (un)docking, one has to run xrandr to force detection of the DisplayPort output. Luckily, this can be bound to a hotkey as it works as a regular user.

However, with Wayland, xrandr no longer works at all..

I have found that running echo detect > /sys/class/drm/card0-HDMI-A-2/status as root forces re-detection of the DP link state, but this can't be run easily, and certainly not as a hotkey command.

Ideally, the (un)docking ACPI code should trigger drm udev events so the kernel automatically enables and disables DisplayPort output. This is much needed with Wayland at least.

ghost commented 7 years ago

Ugliest hack ever, but this seems to work with Wayland:

Add this to /etc/rc.local:

chmod 666 /sys/class/drm/card0-HDMI-A-2/status

Create /usr/local/bin/screen-hotplug:

#!/bin/sh

echo 'detect' > /sys/class/drm/card0-HDMI-A-2/status

Make it executable:

sudo chmod +x /usr/local/bin/screen-hotplug

Bind that script to a key, such as the blue ThinkVantage button. Press it every time you dock and every time you undock.

swiftgeek commented 7 years ago

Works for me with DP<>HDMI adapter, without any workarounds in X11 (enlightenment), wayland (weston) and even just plain VT HW: X200T