Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Jan 2018 22:21:05 +0100
From:      Michael Gmelin <freebsd@grem.de>
To:        =?UTF-8?B?UmVuw6k=?= Ladan <r.c.ladan@gmail.com>
Cc:        freebsd-x11@freebsd.org
Subject:   Re: Running FreeBSD on the Lenovo Thinkpad T470s (success)
Message-ID:  <20180108222105.3fe10578@bsd64.grem.de>
In-Reply-To: <64F6370C-63CB-41F2-BCAA-C22AA6147C6E@grem.de>
References:  <20171230155857.3ba51994@bsd64.grem.de> <97dc9da5-30f6-0c8d-a3f9-662469974bb2@freebsd.org> <C5452FD8-558E-4305-B5AC-112321BE6B53@grem.de> <8f19b64f-255f-fd14-7b47-dfd149c76e12@unrelenting.technology> <e8e68e9e-d952-895a-7f12-db5aeed68149@gmail.com> <64F6370C-63CB-41F2-BCAA-C22AA6147C6E@grem.de>

next in thread | previous in thread | raw e-mail | index | archive | help



On Mon, 8 Jan 2018 22:05:50 +0100
Michael Gmelin <freebsd@grem.de> wrote:

> > On 8. Jan 2018, at 22:02, René Ladan <r.c.ladan@gmail.com> wrote:
> >   
> >> On 08-01-2018 21:28, Greg V via freebsd-x11 wrote:
> >> 
> >> On 01/08/2018 23:23, Michael Gmelin wrote:  
> >>>> On 8. Jan 2018, at 21:15, René Ladan <rene@freebsd.org> wrote:
> >>>>   
> >>>>> On 30-12-2017 15:58, Michael Gmelin wrote:
> >>>>> Hi,
> >>>>> 
> >>>>> I found some time to play with FreeBSD on a Lenovo Thinkpad
> >>>>> T470s and I'm quite happy with the results, as all important
> >>>>> features work, especially essentials like graphics, touchpad
> >>>>> and suspend to RAM.
> >>>>> 
> >>>>> The configuration is pretty straightforward, but a few things
> >>>>> required research (like evdev, udev and libinput), that's why I
> >>>>> documented my setup here, hoping that it might help others:
> >>>>> 
> >>>>> https://blog.grem.de/pages/t470s.html
> >>>>>   
> >>>> I followed your instructions to try to get the touchpad working
> >>>> on my laptop (Acer E5-773G-78RN) but that didn't work.
> >>>> 
> >>>> libinput-debug-events sees the touchpad (I think, event0) but it
> >>>> doesn't respond to it:
> >>>> 
> >>>> root@e17:~ # libinput-debug-events
> >>>> -event0   DEVICE_ADDED     System mouse
> >>>> seat0 default group1  cap:p left scroll-nat scroll-button
> >>>> -event1   DEVICE_ADDED     System keyboard multiplexer
> >>>> seat0 default group2  cap:k
> >>>> -event2   DEVICE_ADDED     AT keyboard
> >>>> seat0 default group3  cap:k
> >>>> -event3   DEVICE_ADDED     PixArt USB Optical Mouse, class 0/0,
> >>>> rev 1.10/1.00, addr 1 seat0 default group4  cap:p left scroll-nat
> >>>> scroll-button
> >>>> 
> >>>> I have Xorg.0.log and verbose dmesg available  
> >>> Did you install a patched version of xorg (with UDEV enabled) and
> >>> a custom kernel (device and option added)? What is the output of
> >>> xinput? What is the output of evemu-record from devel/evemu? Feel
> >>> free to email me all config- and log files off-list.  
> > 
> > Hmm, there is no option UDEV in 'make config' for xorg-server, only
> > DEVD (default) and HAL?  
> 
> Did you path xorg-server like described? Maybe you applied "patch" in
> the wrong directory. If you're struggling I can send you the patched
> port skeleton directly.
> 
> Best,
> Michael
> 
> 
> 
> >   
> >> If libinput doesn't list it, it's not time to mess with xorg yet :)
> >> 
> >> I guess EVDEV_SUPPORT is enabled since there's a "PixArt USB
> >> Optical Mouse" (ums) device.
> >>   
> > That PixArt thing is physical USB mouse, which always works ;)
> >   
> >> Is the psm module loaded? Is there anything in dmesg about psm?  
> > 
> > Not currently I think:
> > rene@e17:~ % grep -i psm /root/dmesg-v-20180108
> > psm0: unable to allocate IRQ
> > rene@e17:~ % kldstat -v|grep psm
> >        439 acpi/psmcpnp
> >        438 isa/psmcpnp
> >        437 atkbdc/psm
> > rene@e17:~ % ls /boot/kernel/*psm*
> > ls: No match.
> > rene@e17:~ %
> > 

(just saw your email about patches, still sending this response - yes,
you need to apply the patches to the ports tree, both of them, otherwise
all your input is mirrored to the console and weird things are
happening)

I feel like you missed a few steps from the howto at
https://blog.grem.de/pages/t470s.html, let me reiterate what I think
is essential for libinput support:

echo "kern.evdev.rcpt_mask=12" >>/etc/sysctl.conf
echo 'hw.psm.synaptics_support="1"' >>/boot/loader.conf
sysrc dbus_enable=YES

Fix a problem with VT switching without using xf86-input-keyboard -
this is quite important, as otherwise anything you type will be echoed
on the console and some bizarre things can happen. Described in bug
220562. Support udev for autoconfiguration of input devives. Described
in bug 222609 (that's Greg's patch).

Links to patches:
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=184182
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=186724

(Re-)install xorg-server after patching:
cd /usr/ports/x11-servers/xorg-server
make deinstall
make config
# select UDEV as the autoconfiguration backend
make reinstall clean

cat >/usr/local/etc/X11/xorg.conf.d/99-myinput.conf <<EOF
Section "InputClass"
  Identifier "libinput keyboard catchall"
  MatchIsKeyboard "on"
  MatchDevicePath "/dev/input/event*"
  Driver "libinput"
  Option "XkbRules" "evdev"
EndSection

Section "InputClass"
  Identifier "libinput touchpad catchall"
  MatchIsTouchpad "on"
  MatchDevicePath "/dev/input/event*"
  Driver "libinput"
  Option "MiddleEmulation" "on"
  Option "DisableWhileTyping" "off"
EndSection
EOF

(second part only if you don't want three mouse buttons on the touchpad)

You can check most of these settings by doing:

# sysctl kern.features.evdev_support
kern.features.evdev_support: 1
# sysctl kern.evdev.rcpt_mask
kern.evdev.rcpt_mask: 12
# pkg info -R xorg-server | grep UDEV
    UDEV = "on";

Hope that helps.

Best,
Michael



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180108222105.3fe10578>