Calibrate your touch-screen on OpenBSD

       301 words, 2 minutes

I didn’t expected it but my refurbished T460s came with a touch-screen. It is recognized by default on OpenBSD and not well calibrated as-is. But that’s really simple to solve.

Looking at the dmesg, it seems I got an LG screen.

uhidev0 at uhub0 port 10 configuration 1 interface 0 "Melfas LGDisplay Incell Touch" rev 2.00/1.00 addr 4
uhidev0: iclass 3/0, 68 report ids
uhid0 at uhidev0 reportid 8: input=0, output=0, feature=1
ums0 at uhidev0 reportid 16: 1 button, tip
wsmouse2 at ums0 mux 0

Looking at /var/log/Xorg.0.log, we can get more details on that screen.

[171505.669] (II) modeset(0): Manufacturer: LGD Model: 551 Serial#: 0
[171505.669] (II) modeset(0): Year: 2016 Week: 0
[171505.669] (II) modeset(0): EDID Version: 1.4
[171505.670] (II) modeset(0): LG Display
[171505.670] (II) modeset(0): LP140WF5-SPK1
[171505.670] (II) modeset(0): EDID (in hex):
[171505.670] (II) modeset(0): 00ffffffffffff0030e4510500000000
[171505.670] (II) modeset(0): 001a0104951f1178028ac5945b549127
[171505.670] (II) modeset(0): 1b505400000001010101010101010101
[171505.670] (II) modeset(0): 0101010101012e3680a070381f403020
[171505.670] (II) modeset(0): 350035ae10000019282d80a070381f40
[171505.670] (II) modeset(0): 3020350035ae10000019000000fe004c
[171505.670] (II) modeset(0): 4720446973706c61790a2020000000fe
[171505.670] (II) modeset(0): 004c503134305746352d53504b3100de
[171505.670] (II) modeset(0): Printing probed modes for output eDP-1

To calibrate the screen, simply start xtsscale(1) in your nearest available xterm and click on the crosses that appear on screen.

# xtsscale -c 
XRandR extension version 1.6 present

The settings can be tested right away.

# doas wsconsctl -w mouse.scale=15,4120,34,4126,0,1920,1080

The value can be added to /etc/wsconsctl.conf for further automatic configuration on next reboot.

This doesn’t seem to interfere with my click-pad. And this allows to draw directly from the Gimp with your fingers !!!

You can also Alt+ to move the windows using cwm(1), select a tab and scroll the pages on Firefox. I may be missing something but the screen does not seem to provide multi-touch ; so no “pinch to zoom”.

Another great gift from OpenBSD, working out of the box!