Bug 89211 - Freescale Sabre Smart touch screen does not work with libinput+weston
Summary: Freescale Sabre Smart touch screen does not work with libinput+weston
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: ARM All
: medium normal
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-18 18:57 UTC by Dario Freddi
Modified: 2015-09-02 06:22 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
weston execution (2.21 KB, text/plain)
2015-02-18 18:57 UTC, Dario Freddi
Details
evemu-describe on touchscreen (2.94 KB, text/plain)
2015-02-18 18:57 UTC, Dario Freddi
Details
Patch for libinput (1.31 KB, patch)
2015-02-22 14:29 UTC, Dario Freddi
Details | Splinter Review

Description Dario Freddi 2015-02-18 18:57:18 UTC
Created attachment 113626 [details]
weston execution

Running Weston 1.7 on Libinput 0.10 on a Freescale Sabre Smart iMX6.Q board, the board touchscreen does not work with "failed to create input device '/dev/input/event0'", apparently coming from libinput.

Attaching the log of weston run and evemu-describe. Also please note that evemu-record perfectly works with the touchscreen.
Comment 1 Dario Freddi 2015-02-18 18:57:58 UTC
Created attachment 113627 [details]
evemu-describe on touchscreen
Comment 2 Dario Freddi 2015-02-21 15:32:18 UTC
Further investigation, I found out the failure happens when checking for mtdev slots.

if (device->mtdev->caps.slot.minimum < 0 || num_slots <= 0)

caps.slot.minimum and num_slots are both 0.

Running evemu-record with multitouch events, I get this for the first finger:

E: 9.378526 0003 0039 0000      # EV_ABS / ABS_MT_TRACKING_ID   0
E: 9.378526 0003 0030 0001      # EV_ABS / ABS_MT_TOUCH_MAJOR   1
E: 9.378526 0003 0035 12176     # EV_ABS / ABS_MT_POSITION_X    12176
E: 9.378526 0003 0036 4416      # EV_ABS / ABS_MT_POSITION_Y    4416
E: 9.378526 0000 0002 0000      # ++++++++++++ SYN_MT_REPORT (0) ++++++++++
E: 9.378526 0000 0000 0000      # ------------ SYN_REPORT (0) ----------

And this for the second finger:

E: 40.668868 0003 0039 0001     # EV_ABS / ABS_MT_TRACKING_ID   1
E: 40.668868 0003 0030 0001     # EV_ABS / ABS_MT_TOUCH_MAJOR   1
E: 40.668868 0003 0035 10944    # EV_ABS / ABS_MT_POSITION_X    10944
E: 40.668868 0003 0036 5824     # EV_ABS / ABS_MT_POSITION_Y    5824
E: 40.668868 0000 0002 0000     # ++++++++++++ SYN_MT_REPORT (0) ++++++++++
E: 40.668868 0000 0000 0000     # ------------ SYN_REPORT (0) ----------

mtdev-test:

# mtdev-test /dev/input/event0 
supported mt events:
   ABS_MT_TOUCH_MAJOR
   ABS_MT_WIDTH_MAJOR
   ABS_MT_POSITION_X
   ABS_MT_POSITION_Y
   ABS_MT_TRACKING_ID
014bacc41bed 00 3 0030 1
014bacc41bed 00 3 0035 12176
014bacc41bed 00 3 0036 13632
014bacc41bed 00 3 0039 0
014bacc41bed 00 0 0000 0
014bacc41cea 01 3 002f 1
014bacc41cea 01 3 0030 1
014bacc41cea 01 3 0035 10080
014bacc41cea 01 3 0036 7488
014bacc41cea 01 3 0039 1
014bacc41cea 01 0 0000 0

The two events are with two different fingers.
Comment 3 Dario Freddi 2015-02-22 14:29:20 UTC
Created attachment 113742 [details] [review]
Patch for libinput

This patch makes the touchscreen work - it has been done after a look on what xf86-input-evdev does.
Comment 4 Peter Hutterer 2015-02-25 07:40:24 UTC
that's weird, it looks like this device is sort-of tracking a finger but not really. does the tracking ID actually identify the finger here? if so, this device should be swiftched to protocol B in the kernel.

that aside, the maximum comparison is a bug but the patch could cause out-of-bounds array indices. mtdev allocates the number of slots dynamically (up to 32 iirc) so on a device that supports more than 2 fingers we need more than this.

Patch is on the list now, please give it a test.
http://lists.freedesktop.org/archives/wayland-devel/2015-February/020244.html
Comment 5 Dario Freddi 2015-02-27 11:12:07 UTC
The tracking ID indeed identifies the finger. +1 on the patch for me.
Comment 6 Peter Hutterer 2015-03-02 03:15:33 UTC
fixed with this commit, but I'm CCing benjamin for a comment on the kernel issue

commit bb78357f0479d3d44bb5896a30591e7f32fae1a1
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Feb 25 16:04:04 2015 +1000

    evdev: force-assign 10 slots to mtdev devices
Comment 7 Benjamin Tissoires 2015-04-07 14:28:51 UTC
Sorry for the wait.

Can you post your dmesg of your system? I can not find any matching driver given your evemu recordings and I wonder if you are using a plain vanilla kernel or a modified one with a custom egalax touchscreen driver (or maybe just an old one).
Comment 8 Peter Hutterer 2015-09-02 06:22:03 UTC
Closing as fixed as per comment #6. 

The rest has been in needinfo since April for the kernel issue, so can't be that important.


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.