Kernel commit
206f533a0a7c
"Input: uinput - reject requests with unreasonable number of slots"
limits the number of slots to 99 - let's manually adjust that so we can
keep creating uinput devices.
Since these are just a test device and we don't use the slots here
anyway (they're all fake MT devices) we can manually work around this.
The real devices won't be affected by this since this is a limitation
in uinput, not the input subsystem.
Also move the comment one line up in the ms-surface device, the previous
comment referred to the wrong event code.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1061>
{ 0x2c, 0, 255, 0, 0, 0 },
{ 0x2d, 0, 255, 0, 0, 0 },
{ 0x2e, 0, 255, 0, 0, 0 },
- { ABS_MT_SLOT, 0, 255, 0, 0, 0 },
+ /* Note: slot count artificially reduced for kernel
+ * commit 206f533a0a7c ("Input: uinput - reject requests with unreasonable number of slots")
+ */
+ { ABS_MT_SLOT, 0, 64, 0, 0, 0 },
{ ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0, 0 },
{ ABS_MT_TOUCH_MINOR, 0, 255, 0, 0, 0 },
{ ABS_MT_WIDTH_MINOR, 0, 255, 0, 0, 0 },
{ 0x2c, 0, 255, 0, 0, 0 },
{ 0x2d, 0, 255, 0, 0, 0 },
{ 0x2e, 0, 255, 0, 0, 0 },
- { 0x2f, 0, 255, 0, 0, 0 },
+ /* Note: slot count artificially reduced for kernel
+ * commit 206f533a0a7c ("Input: uinput - reject requests with unreasonable number of slots")
+ */
+ { 0x2f, 0, 64, 0, 0, 0 },
{ 0x30, 0, 255, 0, 0, 0 },
{ 0x31, 0, 255, 0, 0, 0 },
{ 0x32, 0, 255, 0, 0, 0 },
{ 0x2c, 0, 255, 0, 0, 0 },
{ 0x2d, 0, 255, 0, 0, 0 },
{ 0x2e, 0, 255, 0, 0, 0 },
- { 0x2f, 0, 255, 0, 0, 0 },
+ /* Note: slot count artificially reduced for kernel
+ * commit 206f533a0a7c ("Input: uinput - reject requests with unreasonable number of slots")
+ */
+ { 0x2f, 0, 64, 0, 0, 0 },
{ 0x30, 0, 255, 0, 0, 0 },
{ 0x31, 0, 255, 0, 0, 0 },
{ 0x32, 0, 255, 0, 0, 0 },
{ 44, -127, 127, 0, 0, 0 },
{ 45, -127, 127, 0, 0, 0 },
{ 46, -127, 127, 0, 0, 0 },
- { 47, -127, 127, 0, 0, 0 },
/* ABS_MT range overlap starts here */
- { 48, -127, 127, 0, 0, 0 }, /* ABS_MT_SLOT */
+ /* Note: slot count artificially reduced for kernel
+ * commit 206f533a0a7c ("Input: uinput - reject requests with unreasonable number of slots")
+ */
+ { 47, 0, 64, 0, 0, 0 }, /* ABS_MT_SLOT */
+ { 48, -127, 127, 0, 0, 0 },
{ 49, -127, 127, 0, 0, 0 },
{ 50, -127, 127, 0, 0, 0 },
{ 51, -127, 127, 0, 0, 0 },
.flat = 0,
.resolution = 100
};
+ /* See kernel commit 206f533a0a7c ("Input: uinput - reject requests with unreasonable number of slots") */
+ const struct input_absinfo default_abs_mt_slot = {
+ .value = 0,
+ .minimum = 0,
+ .maximum = 64,
+ .fuzz = 0,
+ .flat = 0,
+ .resolution = 100
+ };
char buf[512];
dev = libevdev_new();
if (type == INPUT_PROP_MAX) {
rc = libevdev_enable_property(dev, code);
} else {
+ const struct input_absinfo *abs =
+ (code == ABS_MT_SLOT) ? &default_abs_mt_slot : &default_abs;
rc = libevdev_enable_event_code(dev, type, code,
- type == EV_ABS ? &default_abs : NULL);
+ type == EV_ABS ? abs : NULL);
}
litest_assert_int_eq(rc, 0);
}