Bug 105408 - CalibrationMatrix not applied
Summary: CalibrationMatrix not applied
Status: RESOLVED NOTABUG
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/libinput (show other bugs)
Version: unspecified
Hardware: ARM Linux (All)
: medium normal
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-09 02:09 UTC by patrik.stutz
Modified: 2018-03-11 01:07 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description patrik.stutz 2018-03-09 02:09:31 UTC
Hi

I'm experimenting with BENJA on a Raspberry PI 3 with the official 7 inch touchscreen attached and am currently trying to swap the axes of the touchscreen.

BENJA runs a weston compositor, which displays a electron kiosk win. But since electron does not currently support wayland, it is running under xwayland, which I think uses the xf86-input-libinput driver.

This driver has the option "CalibrationMatrix" which should allow me to swap the axes.

To try it, I've created the following configuration file under /etc/X11/xorg.conf.d/40-libinput.conf:

ection "InputClass"
    Identifier "libinput touchscreen checkall"
    MatchIsTouchscreen "1"
    Driver "libinput"
    Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"
EndSection

Which should rotate the input by 90 degrees in my opinion. Bud sadly, this setting has no effect.

How can I check, if the option is really set after all?

Thank you very much :)
Comment 1 patrik.stutz 2018-03-09 02:13:12 UTC
Sorry, I've forgot to copy the "S" of "Section". The "S" is there in my configuration file ;)
Comment 2 patrik.stutz 2018-03-09 02:15:35 UTC
I tried to build libinput by myself and hardcode the matrix, but I was not able to build it as it requires the "dot" command, which I could not figure out what it is... :(
Comment 3 Peter Hutterer 2018-03-09 04:06:44 UTC
dot is part of graphviz, but you can just build with --documentation=false to disable that bit. 

> BENJA runs a weston compositor, which displays a electron kiosk win. But
> since electron does not currently support wayland, it is running under
> xwayland, which I think uses the xf86-input-libinput driver.

that's a misunderstanding. the xf86-input-libinput driver is only for Xorg,
not for xwayland which relies on the compositor to manage input devices. so
the calibration option needs to be set in weston.
Comment 4 patrik.stutz 2018-03-09 09:24:38 UTC
Hi Peter

Thanks for this superfast answer :)

Well, that explains a lot :D

Previously, I've already tried to rotate the screen and input using the following settings in the weston.ini file:

[output]
name=HDMI-A-1
transform=90

Which kinda worked, but was buggy as for some reason i got touchend events when i touched the screen, and touchstard event when I released it. Whithout that option, everything worked well again. So I decided to go a bit lower in the stack and modify try to do it there.

So I'm still going to try to hardcode the matrix directly into libinput to see if that would solve the problem.

I was now able to build libinput, so I think I'll figure out the rest, thank you :) I'll of course report back my findings, and maybe look into the weston code afterwards if I had success, to find out why "transform=90" does not work correctly.
Comment 5 patrik.stutz 2018-03-11 01:07:58 UTC
Alright, after looking at the code I found out that I can just set the ENV{LIBINPUT_CALIBRATION_MATRIX} in udev. Always read the docs first :D

Setting this property works great for me, while setting transform=90 in weston.ini does not work correctly.

So we can definitely close this ticket and I'll open a new one at the weston project.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.