From owner-freebsd-ports@FreeBSD.ORG Sat Sep 21 11:55:01 2013 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F2C2C963; Sat, 21 Sep 2013 11:55:00 +0000 (UTC) (envelope-from vmagerya@gmail.com) Received: from mail-ea0-x22d.google.com (mail-ea0-x22d.google.com [IPv6:2a00:1450:4013:c01::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 461912B07; Sat, 21 Sep 2013 11:55:00 +0000 (UTC) Received: by mail-ea0-f173.google.com with SMTP id g10so767920eak.32 for ; Sat, 21 Sep 2013 04:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=+Y5Og9L6DiZt9986yEzbd0ff3W03kchOnzcCH2U3O24=; b=nEM+Ixu3hjjEX/urSEY7qFaTsDkt50Mm3SMxvk27jeiAcWKxQRJEQE7UW5qlcwEwSI avWbW/yYDbgJO6bxf5cJB0dr1AAPnuWEgEj18XK1TvsMsiKoKudCBD93GIvRFBf41ELl 1NPmYnND8fgG52IVjzFo1xqXLC6KbfHZVP4eX2dsvSTiMZZ3GQjvMU75EiINglogvytH E3/BQP/fASYio3ALI49D8jWrzsNWANDNmgNBNo+8MXyfKENOqXUCS9BH7WDvFItwtr// 8C0zBh9d7ihmPmmXckaSm6cB7/ElIpEZslP0LlR2hAWBuWAzzkeUdxT+VTEeBOqm9RbH gTRw== X-Received: by 10.14.218.197 with SMTP id k45mr18822284eep.32.1379764498558; Sat, 21 Sep 2013 04:54:58 -0700 (PDT) Received: from [172.16.0.2] (tx97.net. [85.198.160.156]) by mx.google.com with ESMTPSA id r48sm26418824eev.14.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Sep 2013 04:54:57 -0700 (PDT) Message-ID: <523D8904.5010501@gmail.com> Date: Sat, 21 Sep 2013 14:54:44 +0300 From: Vitaly Magerya User-Agent: Thunderbird MIME-Version: 1.0 To: Niclas Zeising Subject: New devd-based X.Org autoconfiguration backend References: <522DC3EB.4060607@freebsd.org> <522DE093.9080504@freebsd.org> In-Reply-To: <522DE093.9080504@freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: ports@FreeBSD.org, x11@FreeBSD.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2013 11:55:01 -0000 On 09/09/2013 17:52, Niclas Zeising wrote: >> The attached patch, also available in the latest updated version at >> http://people.freebsd.org/~zeising/xorg-mesaupdate.diff >> updates various xorg related libraries and drivers, most of this is >> visible for all users of xorg. >> xorg-server now has the possibility to use devd instead of hal for >> autoconfiguration. And here's an update to that patch that implements a (hopefully) better devd-based autoconfiguration backend. Comments, questions, failure reports are welcome. Note that this backend is only enabled if you're using WITH_NEW_XORG. My attempts to port it to older xserver has so far been a failure (I left a piece of code that will compile with xserver-1.5.x, but X will fail to load drivers when my code asks it to). == How to install it Apply xorg-mesaupdate.diff to your ports tree, or grab the ports tree from Xorg development repo [2] (which is what I do). Apply the patch at [1] on top of that. Reinstall x11-servers/xorg-server with DEVD option on. As a first-time measure, either reboot or run "service xhotplug start". Then (re)start X server (don't forget to remove InputDevice sections from your xorg.conf, if you've been using static configuration before). == What it does The backend will first add two devices: syscons keyboard device and sysmouse mouse device. Then, any atp(4), joy(4), psm(4), uep(4), uhid(4) and ums(4) devices will be added and removed dynamically, as they appear in your system. atp, psm and ums devices will by default use xf86-input-mouse driver; uep will use xf86-input-egalax, if it's installed. The rest will have no default driver. You can change the driver, and set any needed options for any of the devices by using InputClass section of xorg.conf (see xorg.conf man page). == Cooperation with moused(8) The backend will try to play along with moused(8): if you have moused_enable=YES (by default it's NO), or moused_nondefault_enable=YES (by default it's YES) set in your rc.conf, moused will be given the priority to take over psm and ums devices. The upside of this is that you'll have mouse working in console. The downside is that X server will only see the combined mouse device (sysmouse), and will not be able to configure each mouse individually. == Keyboards While it is possible to make X server to see and configure each keyboard individually, this backend chooses to let kbdmux(4) take over any ukbd device that appears in your system, and only expose X to one combined keyboard. This is so that your keyboards would work in both X and the console. The alternative (to let Xorg see each keyboard separately, but not to enable them in console) seems too error prone for my taste. == Multiple Xorg servers running at once As discussed earlier in this thread, sharing input devices is not really possible in FreeBSD. If multiple X servers are running on your machine at the same time, each will try to grab every input device, but aside from syscons and sysmouse, they will fail, and only the first server will be able to actually use the device. == Debugging hotplug (Users are not expected to know or care about this part). You can get a list of devices the backend tried to add by running "service xhotplug list". Here's what it should show on a typical machine: # service xhotplug list syscons driver=kbd device= flags=keyboard name=System%20Keyboard product=syscons sysmouse driver=mouse flags=pointer name=System%20Mouse product=sysmouse psm0 driver=mouse flags=pointer name=PS%2f2%20Mouse You can remove any device like this: # service xhotplug remove psm0 ... and add it back, with different options: # service xhotplug add psm0 Emulate3Buttons=OFF To verify that X actually has all the devices you think it should have, you can use x11/xinput utility: # xinput ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ System Mouse id=7 [slave pointer (2)] ⎜ ↳ PS/2 Mouse id=8 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ System Keyboard id=6 [slave keyboard (3)] [1] http://tx97.net/~magv/diff/xorg-server-1.12.4_2.hotplug.diff [2] https://wiki.freebsd.org/Xorg#Development_Repo