Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Dec 2020 11:28:41 +0100
From:      Ali Abdallah <ali.abdallah@suse.com>
To:        myfreeweb <greg@unrelenting.technology>
Cc:        freebsd-current@freebsd.org, Hans Petter Selasky <hps@selasky.org>, Scott Long <scottl@FreeBSD.org>
Subject:   Re: Issues with USB-C external monitors
Message-ID:  <20201202102841.ysv52uc6oseuurwh@frix230>
In-Reply-To: <BD186C8D-AF73-4182-BF89-89005854F618@unrelenting.technology>
References:  <20201201131430.ol7pzms24h743iwf@frix230> <342519ee-6f73-98be-29b1-cea7890ccb1e@selasky.org> <BD186C8D-AF73-4182-BF89-89005854F618@unrelenting.technology>

next in thread | previous in thread | raw e-mail | index | archive | help
On 01.12.2020 17:10, myfreeweb wrote:
> devd (really drm in the kernel) provides hotplug events (system DRM, type HOTPLUG).
> libudev-devd translates these to UD_ACTION_HOTPLUG.
> This works well with wlroots compositors at least.
> How xorg does this I have no idea, as I don't use xorg.
> If your xorg is built with DEVD instead of UDEV option, it shouldn't work, I don't recall anyone adding support for that there.
> With UDEV it might work?

Actually Xorg on FreeBSD with UDEV is compiled with
--disable-config-udev-kms, thus the server never calls:

udev_monitor_filter_add_match_subsystem_devtype

for GPU devices, and thus libudev-devd doesn't forward kms events to the
server. Actually Xorg doesn't even process them, even if the filter check
is bypassed in libudev-devd (udev-monitor.c:261).

Basically Xorg is missing bsd platform code for drm devices, on Linux
the code that implements that can be found in:
hw/xfree86/os-support/linux/lnx_platform.c

Compiling the server with --enable-config-udev-kms, the server expects
to have the following functions implemented

xf86PlatformReprobeDevice, xf86PlatformDeviceProbe, DeleteGPUDeviceRequest and
xf86PlatformDeviceCheckBusID.

Those are fairly easy to implement to enable Xorg to listen to
libudev-devd drm events and to re-configure the drm connectors. I have
already some scratch code, will test more and probably send upstream.

I will probably also add devd code for that, as I use xorg server
with devd on my FreeBSD 12.x machines.

Thanks,
Ali



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