From owner-freebsd-mobile@FreeBSD.ORG Wed Sep 18 16:12:18 2013 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2B7A7DE5 for ; Wed, 18 Sep 2013 16:12:18 +0000 (UTC) (envelope-from Scoobi_doo@yahoo.com) Received: from nm1-vm1.bullet.mail.bf1.yahoo.com (nm1-vm1.bullet.mail.bf1.yahoo.com [98.139.213.163]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BDA1C248F for ; Wed, 18 Sep 2013 16:12:17 +0000 (UTC) Received: from [66.196.81.173] by nm1.bullet.mail.bf1.yahoo.com with NNFMP; 18 Sep 2013 16:12:16 -0000 Received: from [68.142.230.71] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 18 Sep 2013 16:12:16 -0000 Received: from [127.0.0.1] by smtp228.mail.bf1.yahoo.com with NNFMP; 18 Sep 2013 16:12:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1379520736; bh=5Oiz498QgkRk68Ak3LSP++nmzYoszCKKGDXRkeLqWtE=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; b=kO9jPCH7AWiv8r/zEdstsqACq/OQ4JSc0da44+8KFTSsRzrJl8WJ11Crd5XezJSWtQbrWqrMN8+T67y1NE0L6gYTCKeUDmcHT9eReD5R3lAY1ji6CVcKvCaeeenTiJZBmJXdp7SD55LZh/FeDjBbYX+rx+I5aDVhIkKLn0p13HM= X-Yahoo-Newman-Id: 307721.10089.bm@smtp228.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: JEwKu0EVM1myKpNFCA.vIqDEy5_BpvgpZmILCXRFVDvuBRA I8D8YwHSWS4uZ9AjMYaP_ACCPBeWud1nNdKYUhRrKQs7RpQm6BXfBd.WXxAw lqhCA.SYoJYqDwXiomjgC_VcNPPfVD8rPi4K_FPGITsFHK64RLp8FOIoQGfM wxYPCnuHNzCwjnO9LdZgdz3jk_ZmeViphLLUK.iXrsGF_TZ5RplnmgyjJ5Al oaCRZ21ZFse8nSBsvNlsPYtSMrHK5cgObGx9EQ9Xi6gG3zQ76eV1l9CwpLHk sZnBi7GIuHhQJKP3tYqokRC8v07DGEr1iT3Z1O7Simemesllg20nXabvMGdp jFBdn1oANMTlhpZSaPC5GWd4M5r23afqTO9PI8FJRTcp.tIn2QQlSk64h6GU gkJuyWOYQlFdtP_0XMNsTbE9LxTdRGeHyL9vbomXv5aLDGSYWjpnJ2rQiY70 ExLtbOigUBWEFOEsCv02UwxpU2GTvqy_2Z5p_R9vjW9G0TP3Hnf5sg.luU1k _apGcalmyjQLOkMiAmwXyq22hrODqVOb6tBOxx6.PRQJ0yxb_eg-- X-Yahoo-SMTP: 9sPoSQ2swBBlERuQ.0vs8XLc_MeClW0- X-Rocket-Received: from laptop.qtchat.org (Scoobi_doo@70.90.74.161 with ) by smtp228.mail.bf1.yahoo.com with SMTP; 18 Sep 2013 16:12:16 +0000 UTC Message-ID: <5239D0DF.2080409@yahoo.com> Date: Wed, 18 Sep 2013 12:12:15 -0400 From: Anthony Jenkins User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130918 Thunderbird/17.0.8 MIME-Version: 1.0 To: freebsd-mobile@freebsd.org Subject: PATCH: x11-drivers/xf86-input-synaptics & sysutils/hal Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2013 16:12:18 -0000 It's always bugged me how I can't seem to get Xorg to associate xf86-input-synaptics with my synaptics touchpad on my FreeBSD laptops. These patches appear to work. * sysutils/hal: hal currently declares /dev/psm0 to be an "input.mouse" always; I added code to test for the presence of sysctl hw.psm.synaptics.margin_top and, if found, declare the device to be an "input.touchpad" instead. * x11-drivers/xf86-input-synaptics: There is no AutoDevProbe() method in the SynapticsProtocolOperations struct; I added a naive one which returns TRUE iff the InputInfoPtr name is "PS/2 Mouse" and the char device path starts with "/dev/psm". I have the following ports and their dependencies installed for test (WITHOUT_NEW_XORG=yes in /etc/make.conf): * sysutils/hal * x11/xf86-input-mouse * x11/xf86-input-synaptics Tested the following scenarios: * /etc/rc.conf: moused_enable="YES" added, and commented out * /boot/loader.conf: hw.psm.synaptics_support="1" added, and commented out X server appears to DTRT in each scenario, but I don't seem to have the use of my touchpad scroll area without psm(4) synaptics support turned on. Comments/suggestions welcome, including the proper mailing list/people to send this to and how to get this committed. ...and yes, I know Xorg is dumping sysutils/hal :-) [root@laptop /usr/ports]# svn diff --ignore-properties sysutils/hal x11-drivers/xf86-input-synaptics Index: sysutils/hal/files/patch-hald__freebsd__hf-devtree.c =================================================================== --- sysutils/hal/files/patch-hald__freebsd__hf-devtree.c (revision 0) +++ sysutils/hal/files/patch-hald__freebsd__hf-devtree.c (working copy) @@ -0,0 +1,18 @@ +--- ./hald/freebsd/hf-devtree.c.orig 2013-09-18 08:08:06.796722228 -0400 ++++ ./hald/freebsd/hf-devtree.c 2013-09-18 08:08:21.513708377 -0400 +@@ -203,7 +203,14 @@ + char *devname; + + devname = hf_devtree_device_get_name(device); +- hf_device_set_input(device, "mouse", NULL, devname); ++ if (hf_has_sysctl("hw.psm.synaptics.margin_top")) ++ { ++ hf_device_set_input(device, "touchpad", NULL, devname); ++ } ++ else ++ { ++ hf_device_set_input(device, "mouse", NULL, devname); ++ } + g_free(devname); + } + Index: x11-drivers/xf86-input-synaptics/files/patch-src__psmcomm.c =================================================================== --- x11-drivers/xf86-input-synaptics/files/patch-src__psmcomm.c (revision 0) +++ x11-drivers/xf86-input-synaptics/files/patch-src__psmcomm.c (working copy) @@ -0,0 +1,22 @@ +--- ./src/psmcomm.c.orig 2013-05-12 19:18:02.000000000 -0400 ++++ ./src/psmcomm.c 2013-09-18 08:56:55.344635632 -0400 +@@ -165,11 +165,18 @@ + return PS2ReadHwStateProto(pInfo, &psm_proto_operations, comm, hwRet); + } + ++static Bool ++PSMAutoDevProbe(InputInfoPtr pInfo, const char *device) ++{ ++ return pInfo && pInfo->name && !strcmp(pInfo->name, "PS/2 Mouse") && ++ device && !strncmp(device, "/dev/psm", 8); ++} ++ + struct SynapticsProtocolOperations psm_proto_operations = { + NULL, + NULL, + PSMQueryHardware, + PSMReadHwState, +- NULL, ++ PSMAutoDevProbe, + NULL + }; -- Anthony Jenkins