Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Dec 2020 09:02:47 +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:  <20201203080247.4uqjhkdhucflfxiq@frix230>
In-Reply-To: <20201203070549.d7or5kb43jm3rztz@frix230>
References:  <20201201131430.ol7pzms24h743iwf@frix230> <342519ee-6f73-98be-29b1-cea7890ccb1e@selasky.org> <BD186C8D-AF73-4182-BF89-89005854F618@unrelenting.technology> <20201202102841.ysv52uc6oseuurwh@frix230> <20201203070549.d7or5kb43jm3rztz@frix230>

next in thread | previous in thread | raw e-mail | index | archive | help
Sorry for the noise, you can the patches at the following link:

https://github.com/Alix82/FreeBSD-xorg-drm-hotplug

On 03.12.2020 08:05, Ali Abdallah wrote:
> 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
> 






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




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