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

next in thread | previous in thread | raw e-mail | index | archive | help

--3gegjkejxlz4nh2u
Content-Type: multipart/mixed; boundary="rv2hyufnfu3ijhtj"
Content-Disposition: inline


--rv2hyufnfu3ijhtj
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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:
>=20
> udev_monitor_filter_add_match_subsystem_devtype
>=20
> 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).
>=20
> 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-platfo=
rm.c

UDEV_CONFIGURE_ON=3D      --disable-config-udev-kms

to

UDEV_CONFIGURE_ON=3D      --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.

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


--rv2hyufnfu3ijhtj--

--3gegjkejxlz4nh2u
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEUaD0oMjPyY+ELqmouUVW+ByF0NUFAl/IjkkACgkQuUVW+ByF
0NUsCA/9Hc2GWzRh2jU21Cl3p57lW5+/jkeUqYt6xko7CN16DDDRLDCtTzBB2Ulx
3EWD35NEjB0Gti7OBoQV9EopIHxbu5DXxdbZEn9P3wF6ZQmLSPG+kkGucaEaeXFf
ScNbWoBKLs7g7lqgORHjFS4/vKiVNB5CZ0D9cAgOeNAQClOGzkjwyCRWujGz8kzd
SmOzLdmuNpLpL5EactupsJnFuKFDA6IG8c0kWTpVx4TG2ggO0twQjaP4L+pOaP/1
qRAgYIZUIA4DlhmCqjwQXr+VhHtzK1w8WOk6xx/4nnyt05gEu5mkrYLakdqouuvN
WuBWhTENWkux5f5qP6jzcGjEqEsvzYFZoVkhZTr/X4aShe6a8ThVABNNUFL0oJTC
hJAYNe45jdxvwDEOulFbLWs1yL5bvwQ0PV4CDQTP1jWgLEWYGJc4uGmvqhSYE7gg
IQk9zV4fZoPRM8mBWzhGK8avytZKPA/kMJjF7to/Cc3g0/VPPZXNNF2iAJyF9bY9
CZycBmaYH9GWVFlVKumAACFKODegwexZec4epqsJMEDmWpCbXudNS2UqQ//jjxw0
MDXgiJMWTgsue/gp08usuNgOLJmyWeRX73quej7rr85QDmS+Ris+0ReY5PBtIGsW
npLxdm/hHqa222nbcYvXrby0VtBzRSm5ICQJDgtF2Hmij9koHh8=
=XCZ9
-----END PGP SIGNATURE-----

--3gegjkejxlz4nh2u--



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