Date: Tue, 1 Dec 2020 15:00:55 +0100 From: Hans Petter Selasky <hps@selasky.org> To: Ali Abdallah <ali.abdallah@suse.com>, freebsd-current@freebsd.org, Scott Long <scottl@FreeBSD.org> Subject: Re: Issues with USB-C external monitors Message-ID: <342519ee-6f73-98be-29b1-cea7890ccb1e@selasky.org> In-Reply-To: <20201201131430.ol7pzms24h743iwf@frix230> References: <20201201131430.ol7pzms24h743iwf@frix230>
next in thread | previous in thread | raw e-mail | index | archive | help
On 12/1/20 2:14 PM, Ali Abdallah wrote: > 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? There is missing code in the kernel to handle USB-C PCI express attach/detach. CC'ing Scott Long. --HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?342519ee-6f73-98be-29b1-cea7890ccb1e>