From owner-freebsd-current@freebsd.org Thu Dec 3 08:02:51 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 544A147E2A4 for ; Thu, 3 Dec 2020 08:02:51 +0000 (UTC) (envelope-from ali.abdallah@suse.com) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.suse.de", Issuer "Let's Encrypt Authority X3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CmpGy47Y6z3Ckh; Thu, 3 Dec 2020 08:02:50 +0000 (UTC) (envelope-from ali.abdallah@suse.com) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 429B9ABCE; Thu, 3 Dec 2020 08:02:48 +0000 (UTC) Date: Thu, 3 Dec 2020 09:02:47 +0100 From: Ali Abdallah To: myfreeweb Cc: freebsd-current@freebsd.org, Hans Petter Selasky , Scott Long Subject: Re: Issues with USB-C external monitors Message-ID: <20201203080247.4uqjhkdhucflfxiq@frix230> References: <20201201131430.ol7pzms24h743iwf@frix230> <342519ee-6f73-98be-29b1-cea7890ccb1e@selasky.org> <20201202102841.ysv52uc6oseuurwh@frix230> <20201203070549.d7or5kb43jm3rztz@frix230> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201203070549.d7or5kb43jm3rztz@frix230> X-Rspamd-Queue-Id: 4CmpGy47Y6z3Ckh X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.20 / 15.00]; MID_RHS_NOT_FQDN(0.50)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:195.135.220.15]; MIME_GOOD(-0.10)[text/plain]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; DWL_DNSWL_MED(-2.00)[suse.com:dkim]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[suse.com:+]; RCVD_IN_DNSWL_MED(-0.20)[195.135.220.15:from]; DMARC_POLICY_ALLOW(-0.50)[suse.com,quarantine]; RWL_MAILSPIKE_GOOD(0.00)[195.135.220.15:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:29298, ipnet:195.135.220.0/22, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-current] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2020 08:02:51 -0000 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