Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Dec 2020 14:14:30 +0100
From:      Ali Abdallah <ali.abdallah@suse.com>
To:        freebsd-current@freebsd.org
Subject:   Issues with USB-C external monitors
Message-ID:  <20201201131430.ol7pzms24h743iwf@frix230>

index | next in thread | raw e-mail

Hello,

I have a T495 with a USB-C docking station with two external monitors,
running current to get the vega 10 amdgpu to work.

When the power is lost for on the USB-C dock, then the X server looses
all external monitors. They appear as disconnected after running xrandr
and I cannot figure out a way to bring them back without killing my
current session and start X again, but that is very annoying...

I tried to debug the issue and I'm pretty sure that the X server on
FreeBSD is not reconfiguring the drm connectors automatically.

Let's say I have DP-4 as external connector, when the power is lost,
DP-4 disappears, when the power is back, DP-4 re-appear again but in
unknown status.

$ sysctl sys.class.drm | grep DP-4
sys.class.drm.card0-DP-4.modes:
sys.class.drm.card0-DP-4.dpms: Off
sys.class.drm.card0-DP-4.enabled: disabled
sys.class.drm.card0-DP-4.status: unknown

Now just running a simple libdrm code to rescan the connectors:

__snippet__
res = drmModeGetResources(fd);
for (int i = 0; i < res->count_connectors; ++i) {
   conn = drmModeGetConnector(fd, res->connectors[i]);

After running the above code, the drm stack is somehow triggered to
re-read the DP-4.status, which appears now to be connected, but not
configured.

$ sysctl sys.class.drm | grep DP-4
sys.class.drm.card0-DP-4.modes: 1920x1080
sys.class.drm.card0-DP-4.dpms: Off
sys.class.drm.card0-DP-4.enabled: disabled
sys.class.drm.card0-DP-4.status: connected

I didn't dig further to see if I can trigger the X server to re-scan drm
connectors and eventually remove those that vanished, and add newly
detected connectors. On Linux that seems to work automatically.

Any thoughts?

Regards,
Ali.


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20201201131430.ol7pzms24h743iwf>