[Patch] psm(4) ClickPad detection (was Re: Lenovo W540 so far)

Anthony Jenkins scoobi_doo at yahoo.com
Thu Jun 19 13:50:55 UTC 2014


Is your X server compiled with devd(8) support (experimental) or hald support?


The keyboard not working bugs me - you might try doing a 'make buildworld/installworld' as per /usr/src/UPDATING (or just copy /usr/src/sys/sys/mouse.h to /usr/include/sys/mouse.h) and rebuild x11-drivers/xf86-input-{mouse|keyboard|synaptics}.  My touchpad detection didn't work because ioctl(/dev/psm0) detected the different sizes of struct synapticshw_t.  You might also try backing out my ClickPad detection patch from psm(4).


I'll probably need your entire /var/log/Xorg.0.log to see why it's not working.  Can you kill your X server, then run

   X -logverbose 99 -verbose 99

, switch back to console with <Ctrl><Alt><F1>, kill the server with <Ctrl>-C and send /var/log/Xorg.0.log?  One difference between us is I'm not using an /etc/X11/Xorg.conf config file.


I was up late last night getting devd support working (when they said "experimental", they weren't lying!) and finally got Xorg to detect my touchpad as a Synaptics device and use the right driver, but my hacks are nowhere near ready for posting.  I had to uninstall xf86-input-mouse to get it to load before the mouse driver.


In total, I think this is what's needed (I'll put these in order I guess):

 - psm(4): Add ClickPad support (detection, click handling)
 - devd(8): Make sure devd(8) properly reports Synaptics devices.
 - x11-servers/xorg-server: Massively clean up devd support

 - x11-drivers/xf86-input-synaptics: Enable detection of psm(4) Synaptics support
 - sysutils/hal: Make sure hald(8) properly reports Synaptics devices.

devd(8) just reports "PS/2 mouse" for the existence of a psm[0-9] device; should probably append attributes like "Synaptics touchpad" or "Synaptics ClickPad" to that.

Anthony



----- Original Message -----
From: Ivan Rokotov <ivan.rokotov.bsd at gmail.com>
To: Anthony Jenkins <Scoobi_doo at yahoo.com>
Cc: Eric McCorkle <eric at metricspace.net>; "freebsd-mobile at freebsd.org" <freebsd-mobile at freebsd.org>
Sent: Thursday, June 19, 2014 8:28 AM
Subject: Re: [Patch] psm(4) ClickPad detection (was Re: Lenovo W540 so far)

Well, with patched synaptics driver + patched kernel = no touchpad at
all, no keyboard (Ctrl+Alt+F1 worked). With patched synaptics +
unpatched kernel = everything works as earlier. (Bluetooth mouse works
all time time.)

I post the relevant part of the logs + my xorg.conf, just for the case.

# cat dmesg.today | grep psm0
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model Synaptics Touchpad, device ID 0

# grep '\(keyboard\|kbd\)' Xorg.0.log
[    32.694] (II) LoadModule: "kbd"
[    32.695] (II) Loading /usr/local/lib/xorg/modules/input/kbd_drv.so
[    32.695] (II) Module kbd: vendor="X.Org Foundation"

# cat messages | grep atkbd
Jun 19 14:00:47 thorium kernel: atkbdc0: <Keyboard controller (i8042)>



port 0x60,0x64 irq 1 on acpi0
Jun 19 14:00:47 thorium kernel: atkbd0: <AT Keyboard> irq 1 on atkbdc0
Jun 19 14:00:47 thorium kernel: kbd0 at atkbd0
Jun 19 14:00:47 thorium kernel: atkbd0: [GIANT-LOCKED]
Jun 19 14:00:47 thorium kernel: psm0: <PS/2 Mouse> irq 12 on atkbdc0

# cat /etc/X11/xorg.conf | grep -v '^[[:space:]]*#' | sed 's/#.*$//'
Section "ServerLayout"
Identifier     "X.org Configured"
Screen      0  "Screen0" 0 0
InputDevice    "Mouse0" "CorePointer"
InputDevice    "Touchpad0" "CorePointer"
InputDevice    "Keyboard0" "CoreKeyboard"
Option "DontZap" "off"
Option "AutoAddDevices" "off"
Option "AllowEmptyInput" "off"
Option         "AIGLX" "true"
EndSection

Section "Server Flags"
    Option               "IgnoreABI"
EndSection

Section "Files"
ModulePath   "/usr/local/lib/xorg/modules"
FontPath     "/usr/local/lib/X11/fonts/misc/"
FontPath     "/usr/local/lib/X11/fonts/TTF/"
FontPath     "/usr/local/lib/X11/fonts/OTF"
FontPath     "/usr/local/lib/X11/fonts/Type1/"
FontPath     "/usr/local/lib/X11/fonts/100dpi/"
FontPath     "/usr/local/lib/X11/fonts/75dpi/"
FontPath "/usr/local/lib/X11/fonts/Droid/"
FontPath "/usr/local/lib/X11/fonts/LinLibertineG/"
FontPath "/usr/local/lib/X11/fonts/Liberation/"
FontPath "/usr/local/lib/X11/fonts/GentiumBasic/"
EndSection

Section "Module"
Load  "dbe"
Load  "dri"
Load  "dri2"
Load  "extmod"
Load  "record"
Load  "glx"
Load  "freetype"
EndSection

Section "InputDevice"
Identifier  "Keyboard0"
Driver      "kbd"
EndSection

Section "InputDevice"
   Identifier     "Mouse0"
   Driver         "mouse"
   Option         "Protocol" "auto"
   Option         "Device" "/dev/sysmouse"
   Option         "ZAxisMapping" "4 5 6 7"
EndSection

Section "InputDevice"
   Identifier  "Touchpad0"
   Driver      "synaptics"
   Option       "SHMConfig" "On"
   Option       "Protocol" "psm"
   Option       "Device"   "/dev/psm0"
   Option      "SendCoreEvents" "true"
        Option "ClickPad" "1"
        Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
        Option "TapButton1" "1"
        Option "TapButton2" "3"
        Option "TapButton3" "2"
        Option "ClickFinger1" "1"
        Option "ClickFinger2" "3"
        Option "ClickFinger3" "2"
        Option "VertTwoFingerScroll" "1"
        Option "HorizTwoFingerScroll" "1"
        Option "VertScrollDelta" "-50"
        Option "HorizScrollDelta" "-60"
        Option "EmulateMidButtonTime" "0"
        Option "EdgeMotionMinSpeed" "30"
        Option "EdgeMotionMaxZ" "60"
        Option "FingerLow" "29"
        Option "FingerHigh" "38"
        Option "MaxTapTime" "250"
        Option "MaxTapMove" "100"
        Option "MaxDoubleTapTime" "100"
        Option "ClickTime" "100"
        Option "SingleTapTimeout" "200"
        Option "MaxSpeed" "1.8"
        Option "HorizHysteresis" "32"
        Option "VertHysteresis" "32"
        Option "AccelFactor" "0.04"
        Option "LockedDrags" "1"
        Option "LockedDragTimeout" "200"
        Option "PalmDetect" "1"
        Option "PalmMinWidth" "10"
        Option "PalmMinZ" "130"
        Option "CoastingSpeed" "0.3"

       Option "VertEdgeScroll" "on"
       Option "HorizEdgeScroll" "on"

EndSection

Section "Monitor"
Identifier   "Monitor0"
VendorName   "Monitor Vendor"
ModelName    "Monitor Model"
Option "DMPS"
EndSection

Section "Device"
Identifier  "Card0"
Driver      "intel"
VendorName  "Intel Corporation"
BoardName   "3rd Gen Core processor Graphics Controller"
BusID       "PCI:0:2:0"
EndSection

Section "Screen"
Option         "AddARGBGLXVisuals" "True"
Identifier "Screen0"
Device     "Card0"
Monitor    "Monitor0"
SubSection "Display"
Viewport   0 0
Depth     1
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     4
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     8
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     15
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     16
EndSubSection
SubSection "Display"
Viewport   0 0
Depth     24
EndSubSection
EndSection

Section "Extensions"
   Option         "Composite" "Enable"
EndSection



More information about the freebsd-mobile mailing list