lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <no3r172s-899p-7s78-o199-8q8oq1r2nr71@xreary.bet>
Date: Fri, 31 Oct 2025 10:00:38 +0100 (CET)
From: Jiri Kosina <jikos@...nel.org>
To: Siarhei Vishniakou <svv@...gle.com>
cc: Benjamin Tissoires <bentiss@...nel.org>, 
    Roderick Colenbrander <roderick.colenbrander@...y.com>, 
    linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HID: playstation: Remap joystick axes to be centered at
 0

On Fri, 10 Oct 2025, Siarhei Vishniakou wrote:

> The joystick axes (ABS_X, ABS_Y, ABS_RX, ABS_RY) for PlayStation
> gamepads report a neutral state of 128 over HID, with a full range of
> [0, 255]. The driver previously mapped this directly, resulting in an
> evdev range of [0, 255] with a resting point of 128.
> 
> This approach is unconventional for Linux gamepad drivers and has several
> drawbacks: it requires userspace applications to be aware of the
> non-zero resting state, and it is incompatible with the input
> subsystem's 'flat' (deadzone) logic, which assumes a resting point of 0.
> 
> This patch remaps the four joystick axes to the conventional signed
> 8-bit range of [-128, 127], with 0 as the neutral state. This is
> accomplished by changing their evdev range in ps_gamepad_create() and
> translating the incoming hardware value in the report parsing functions
> by subtracting 128.
> 
> The analog trigger axes (ABS_Z, ABS_RZ) are handled separately. Their
> resting state is 0 (un-pressed), and their hardware range of [0, 255]
> is already the conventional representation. They are left unmodified by
> this patch.
> 
> This makes the joystick behavior consistent with other gamepad drivers
> while preserving the standard behavior for the triggers.
> 
> Signed-off-by: Siarhei Vishniakou <svv@...gle.com>

Hmmm ... as I am rather unaware of the existing playstation userspace 
ecosystem -- is there any way how we could now be breaking existing 
playstation-specific userspace assumptions that have already developed 
based on asumptions that we're centered at 128?

Thanks,

-- 
Jiri Kosina
SUSE Labs


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ