89ea968a | 06-May-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: skip tests with HID-BPF if udev-hid-bpf is not installed
udev-hid-bpf is still not installed everywhere, and we should probably not assume it is installed automatically.
Link: https:
selftests/hid: skip tests with HID-BPF if udev-hid-bpf is not installed
udev-hid-bpf is still not installed everywhere, and we should probably not assume it is installed automatically.
Link: https://lore.kernel.org/r/20240506143612.148031-1-bentiss@kernel.org Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
b22cbfb4 | 10-Apr-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: add tests for the Raptor Mach 2 joystick
The only interesting bit is the HAT switch, and we use a BPF program to fix it. So ensure this works correctly.
Link: https://lore.kernel.org
selftests/hid: add tests for the Raptor Mach 2 joystick
The only interesting bit is the HAT switch, and we use a BPF program to fix it. So ensure this works correctly.
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-18-a8bf16033ef8@kernel.org Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
aa7e5604 | 10-Apr-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: move the gamepads definitions in the test file
More in line with the other test_* files.
No code change
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-17-a8bf16033ef8@kerne
selftests/hid: move the gamepads definitions in the test file
More in line with the other test_* files.
No code change
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-17-a8bf16033ef8@kernel.org Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
c6b03c73 | 10-Apr-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: import base_gamepad.py from hid-tools
We need to slightly change base_device.py for supporting HID-BPF, so instead of monkey patching, let's just embed it in the kernel tree.
Link: h
selftests/hid: import base_gamepad.py from hid-tools
We need to slightly change base_device.py for supporting HID-BPF, so instead of monkey patching, let's just embed it in the kernel tree.
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-16-a8bf16033ef8@kernel.org Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
51de9ee0 | 10-Apr-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: add Huion Kamvas Pro 19 tests
This tablets gets a lot of things wrong: - the secondary button is reported through Secondary Tip Switch - the third button is reported through Invert
W
selftests/hid: add Huion Kamvas Pro 19 tests
This tablets gets a lot of things wrong: - the secondary button is reported through Secondary Tip Switch - the third button is reported through Invert
We need to add some out of proximity intermediate state when moving back and forth with the eraser mode as it can only be triggered by physically returning the pen, meaning that the tolerated transitions can never happen.
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-15-a8bf16033ef8@kernel.org Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
1b2c3caf | 10-Apr-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: tablets: also check for XP-Pen offset correction
The values are taken from the HID-BPF file. Basically we are recomputing the array provided there.
Link: https://lore.kernel.org/r/20
selftests/hid: tablets: also check for XP-Pen offset correction
The values are taken from the HID-BPF file. Basically we are recomputing the array provided there.
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-14-a8bf16033ef8@kernel.org Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
03899011 | 10-Apr-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: tablets: add a couple of XP-PEN tablets
Those tablets don't need special initialization, but are reporting the events with the wrong usages: - tip switch is used when the eraser shoul
selftests/hid: tablets: add a couple of XP-PEN tablets
Those tablets don't need special initialization, but are reporting the events with the wrong usages: - tip switch is used when the eraser should be used - eraser is used instead of the secondary barrel switch
Add tests for those so we don't regress in the future.
Currently we set x/y tilt to 0 to not trigger the bpf program compensate_coordinates_by_tilt()
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-13-a8bf16033ef8@kernel.org Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
e14d88d9 | 10-Apr-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: tablets: reduce the number of pen state
All the *_WITH*BUTTON states were almost identical except for the button itself.
I need to add a new device with a third button, and adding a
selftests/hid: tablets: reduce the number of pen state
All the *_WITH*BUTTON states were almost identical except for the button itself.
I need to add a new device with a third button, and adding a bunch of states is going to be quite cumbersome.
So convert the `button` parameter of PenState as a boolean, and store which button is the target as an argument to all functions that need it.
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-12-a8bf16033ef8@kernel.org Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
e9064630 | 10-Apr-2024 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: add support for HID-BPF pre-loading before starting a test
few required changes: - we need to count how many times a udev 'bind' event happens - we need to tell `udev-hid-bpf` to not
selftests/hid: add support for HID-BPF pre-loading before starting a test
few required changes: - we need to count how many times a udev 'bind' event happens - we need to tell `udev-hid-bpf` to not automatically attach the provided HID-BPF objects - we need to manually attach the ones from the kernel tree, and wait for the second udev 'bind' event to happen
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-11-a8bf16033ef8@kernel.org Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
da2c1b86 | 07-Dec-2023 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: fix failing tablet button tests
An overlook from commit 74452d6329be ("selftests/hid: tablets: add variants of states with buttons"), where I don't use the Enum...
Fixes: 74452d6329b
selftests/hid: fix failing tablet button tests
An overlook from commit 74452d6329be ("selftests/hid: tablets: add variants of states with buttons"), where I don't use the Enum...
Fixes: 74452d6329be ("selftests/hid: tablets: add variants of states with buttons") Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://lore.kernel.org/r/20231207-b4-wip-selftests-v1-1-c4e13fe04a70@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
f556aa95 | 06-Dec-2023 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: fix ruff linter complains
rename ambiguous variables l, r, and m, and ignore the return values of uhdev.get_evdev() and uhdev.get_slot()
Acked-by: Jiri Kosina <jkosina@suse.com> Link
selftests/hid: fix ruff linter complains
rename ambiguous variables l, r, and m, and ignore the return values of uhdev.get_evdev() and uhdev.get_slot()
Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-15-c0350c2f5986@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
ed5bc56c | 06-Dec-2023 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: fix mypy complains
No code change, only typing information added/ignored
Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-14-c0350c2
selftests/hid: fix mypy complains
No code change, only typing information added/ignored
Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-14-c0350c2f5986@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
ab9b8290 | 06-Dec-2023 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: tablets: be stricter for some transitions
To accommodate for legacy devices, we rely on the last state of a transition to be valid: for example when we test PEN_IS_OUT_OF_RANGE to PEN
selftests/hid: tablets: be stricter for some transitions
To accommodate for legacy devices, we rely on the last state of a transition to be valid: for example when we test PEN_IS_OUT_OF_RANGE to PEN_IS_IN_CONTACT, any "normal" device that reports an InRange bit would insert a PEN_IS_IN_RANGE state between the 2.
This is of course valid, but this solution prevents to detect false releases emitted by some firmware: when pressing an "eraser mode" button, they might send an extra PEN_IS_OUT_OF_RANGE that we may want to filter.
So define 2 sets of transitions: one that is the ideal behavior, and one that is OK, it won't break user space, but we have serious doubts if we are doing the right thing. And depending on the test, either ask only for valid transitions, or tolerate weird ones.
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-13-c0350c2f5986@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
76df1f72 | 06-Dec-2023 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: tablets: add a secondary barrel switch test
Some tablets report 2 barrel switches. We better test those too.
Use the same transistions description from the primary button tests.
Rev
selftests/hid: tablets: add a secondary barrel switch test
Some tablets report 2 barrel switches. We better test those too.
Use the same transistions description from the primary button tests.
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-12-c0350c2f5986@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
1f01537e | 06-Dec-2023 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: tablets: convert the primary button tests
We get more descriptive in what we are doing, and also get more information of what is actually being tested. Instead of having a non exhaust
selftests/hid: tablets: convert the primary button tests
We get more descriptive in what we are doing, and also get more information of what is actually being tested. Instead of having a non exhaustive button changes that are semi-randomly done, we can describe all the states we want to test.
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-11-c0350c2f5986@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
74452d63 | 06-Dec-2023 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: tablets: add variants of states with buttons
Turns out that there are transitions that are unlikely to happen: for example, having both the tip switch and a button being changed at th
selftests/hid: tablets: add variants of states with buttons
Turns out that there are transitions that are unlikely to happen: for example, having both the tip switch and a button being changed at the same time (in the same report) would require either a very talented and precise user or a very bad hardware with a very low sampling rate.
So instead of manually building the button test by hand and forgetting about some cases, let's reuse the state machine and transitions we have.
This patch only adds the states and the valid transitions. The actual tests will be replaced later.
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-10-c0350c2f5986@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
83912f83 | 06-Dec-2023 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: tablets: define the elements of PenState
This introduces a little bit more readability by not using the raw values but a dedicated Enum
Acked-by: Jiri Kosina <jkosina@suse.com> Link:
selftests/hid: tablets: define the elements of PenState
This introduces a little bit more readability by not using the raw values but a dedicated Enum
Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-9-c0350c2f5986@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
e08e493f | 06-Dec-2023 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: tablets: set initial data for tilt/twist
Avoids getting a null event when these usages are set
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jiri Kosina <jkosina@s
selftests/hid: tablets: set initial data for tilt/twist
Avoids getting a null event when these usages are set
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-8-c0350c2f5986@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
d8d7aa22 | 06-Dec-2023 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: tablets: do not set invert when the eraser is used
Turns out that the chart from Microsoft is not exactly what I got here: when the rubber is used, and is touching the surface, invert
selftests/hid: tablets: do not set invert when the eraser is used
Turns out that the chart from Microsoft is not exactly what I got here: when the rubber is used, and is touching the surface, invert can (should) be set to 0...
[0] https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/windows-pen-states
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-7-c0350c2f5986@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
881ccc36 | 06-Dec-2023 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: tablets: move move_to function to PenDigitizer
We can easily subclass PenDigitizer for introducing firmware bugs when subclassing Pen is harder.
Move move_to from Pen to PenDigitizer
selftests/hid: tablets: move move_to function to PenDigitizer
We can easily subclass PenDigitizer for introducing firmware bugs when subclassing Pen is harder.
Move move_to from Pen to PenDigitizer so we get that ability
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-6-c0350c2f5986@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|
d52f5206 | 06-Dec-2023 |
Benjamin Tissoires <bentiss@kernel.org> |
selftests/hid: tablets: move the transitions to PenState
Those transitions have nothing to do with `Pen`, so migrate them to `PenState`.
The hidden agenda is to remove `Pen` and integrate it into `
selftests/hid: tablets: move the transitions to PenState
Those transitions have nothing to do with `Pen`, so migrate them to `PenState`.
The hidden agenda is to remove `Pen` and integrate it into `PenDigitizer` so that we can tweak the events in each state to emulate firmware bugs.
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Jiri Kosina <jkosina@suse.com> Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-5-c0350c2f5986@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
show more ...
|