diff options
author | Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com> | 2020-10-17 10:47:21 +0800 |
---|---|---|
committer | Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com> | 2020-10-19 17:39:07 +0800 |
commit | 9327c1cd0853bdd2413792c0b0dbe7d1d41da650 (patch) | |
tree | 535fd2375c6f3d5b93db4b4f4946fd5548097321 /units | |
parent | 27531c39b348727e42005344c2c252e5014c2e7a (diff) |
Add touchpad EV_ABS ABS_MT_TOOL capability check (LP: #1899879)
The firmware/labeling palm detection is general for mordern touchpad. And libinput requires ABS_MT_TOOL_TYPE event for supporting firmware/lebeling palm detection https://wayland.freedesktop.org/libinput/doc/latest/palm-detection.html#palm-tool Add a test job to check if the touchpad can report the event type. The 55 bit offset is obtained from kernel code ABS_MT_TOOL_TYPE 0x37 https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/input-event-codes.h#L857
Diffstat (limited to 'units')
-rw-r--r-- | units/touchpad/jobs.pxu | 30 | ||||
-rw-r--r-- | units/touchpad/test-plan.pxu | 1 |
2 files changed, 31 insertions, 0 deletions
diff --git a/units/touchpad/jobs.pxu b/units/touchpad/jobs.pxu index 2fcdbc3..bb6f596 100644 --- a/units/touchpad/jobs.pxu +++ b/units/touchpad/jobs.pxu @@ -218,6 +218,36 @@ _siblings: [{ "id": "touchpad/continuous-move-after-suspend", "depends": "suspend/suspend_advanced touchpad/continuous-move" }] +unit: template +template-resource: device +template-filter: device.category == 'TOUCHPAD' +template-unit: job +plugin: shell +category_id: com.canonical.plainbox::touchpad +id: touchpad/palm-rejection-firmware-labeling_{product_slug} +requires: device.driver == 'hid-multitouch' +estimated_duration: 5.0 +command: + abs_caps=$(cat </sys{path}/capabilities/abs) + abs_caps_hex=$((16#"$abs_caps")) + tool_type_bit=$((abs_caps_hex >> 55)) + support=$((tool_type_bit & 1)) + if [ $support -eq 1 ]; then + exit 0 + else + echo "Touchapd info:" + cat </sys{path}/name + cat </sys{path}/modalias + echo "Touchpad EV_ABS capabilities:" + echo "$abs_caps" + exit 1 + fi +_summary: Touchpad EV_ABS capability check +_description: + Libinput firmware/labeling palm detection rely on touchpad ABS_MT_TOOL_TYPE + capability. This test checks touchpad's EV_ABS capability to + make sure that firmware/labeling bit is set in touchpad firmware. + id: touchpad/palm-rejection plugin: user-interact category_id: com.canonical.plainbox::touchpad diff --git a/units/touchpad/test-plan.pxu b/units/touchpad/test-plan.pxu index 188e7f2..39769d0 100644 --- a/units/touchpad/test-plan.pxu +++ b/units/touchpad/test-plan.pxu @@ -30,6 +30,7 @@ _description: Touchpad tests (Automated) include: touchpad/detected-as-mouse certification-status=blocker + touchpad/palm-rejection-firmware-labeling_.* certification-status=blocker id: after-suspend-touchpad-cert-full |