Re: Issues with USB-C external monitors

From: Ali Abdallah <ali.abdallah_at_suse.com>
Date: Thu, 3 Dec 2020 08:05:49 +0100
On 02.12.2020 11:28, Ali Abdallah wrote:
> 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

I'm attaching two patches that make hotpluggable drm connectors work on
FreeBSD with xorg-server compiled with UDEV.

If you want to give them a try, for libudev-devd it is enough to apply
patch-libudev-devd-drm-hotplug.c, but for xorg-server you need to change
its Makefile to enable udev-kms, and apply patch-xorg-server-drm-bsd-platform.c

UDEV_CONFIGURE_ON=      --disable-config-udev-kms

to

UDEV_CONFIGURE_ON=      --enabled-config-udev-kms

The bsd-platform code for the xorg-server is basically the same as Linux,
expect for the systemd bit obviously. For now, I appended the code to
hw/xfree86/os-support/bsd/bsd_VTsw.c just because I didn't want to patch
the Makefile.in or Makefile.am and fight with autotools. But that code
should finish in the future in bsd_platform.c.

It is working perfectly fine for me, also got positive feedback from a
friend using it on a Thinkpad X280 with a USB-C dock.

The patches even for onboard connectors deliver for "complete" desktop
plugging/unplugging external monitors events (such as Xfce, gnome, KDE),
and then the external monitors are configured automatically.

I will also later on work on DEVD support as well.

Regards.

-- 
Ali Abdallah | SUSE Linux L3 Engineer
GPG fingerprint: 51A0 F4A0 C8CF C98F 842E  A9A8 B945 56F8 1C85 D0D5


Received on Thu Dec 03 2020 - 06:05:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:26 UTC