From owner-freebsd-current@freebsd.org Wed Dec 2 10:28:46 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 93E4C476C64 for ; Wed, 2 Dec 2020 10:28:46 +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 4CmFYp3FgNz4dNZ; Wed, 2 Dec 2020 10:28:46 +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 262E0AB7F; Wed, 2 Dec 2020 10:28:44 +0000 (UTC) Date: Wed, 2 Dec 2020 11:28:41 +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: <20201202102841.ysv52uc6oseuurwh@frix230> References: <20201201131430.ol7pzms24h743iwf@frix230> <342519ee-6f73-98be-29b1-cea7890ccb1e@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4CmFYp3FgNz4dNZ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] 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: Wed, 02 Dec 2020 10:28:46 -0000 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