mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Campos Ramos <capitain_jack@yahoo.com>
To: "Tomasz Pakuła" <tomasz.pakula.oficjalny@gmail.com>
Cc: dmitry.torokhov@gmail.com, corbet@lwn.net, jikos@kernel.org,
	bentiss@kernel.org, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	vi@endrift.com, linux-kernel@altimeter.info,
	peter.hutterer@who-t.net,
	Ricardo Esteves <ricardo.lopes.esteves@oracle.com>
Subject: Re: [RFC PATCH 0/6] Input: New EV_BTN event for generic buttons
Date: Wed, 18 Nov 2026 12:00:15 -0300	[thread overview]
Message-ID: <179501401503.113617.9596561330028866042@yahoo.com> (raw)
In-Reply-To: <20260104213132.163904-1-tomasz.pakula.oficjalny@gmail.com>

Hi Tomasz,

Your EV_BTN series has a home. I carry the six patches as posted in
the kernel of Sparky Stereo OS, my edition of SparkyLinux, in all
three flavours we build (normal, x86-64-v3 and PREEMPT_RT), on 7.3.4.
Your SDL pull request 14758 and your Wine merge request 9853 are in
our SDL and Wine packages beside it.

Thank you for this work. Thanks also to Ivan Gorinov and Ricardo
Esteves, whose patches of December and February went at the same
limit from the other side.

Why I wanted it: more than 80 buttons is ordinary hardware now. Sim
racing and flight cockpits, button boxes, control surfaces and
accessibility devices built from many switches all pass that number.
Linux can be the platform for these, and today it stops at button 80.

What I measured, with a virtual HID joystick (uhid) of 128 buttons,
eight hats and twelve axes:

  With the series:
    EVIOCGBTNCNT gives 128.
    All 128 buttons arrive as EV_BTN, the first 80 also as EV_KEY.
    SDL3 with pull request 14758 reads 128 buttons, and so do SDL2
    programs through sdl2-compat.
    Wine with merge request 9853 gives DirectInput 128 buttons, by
    the udev backend and by the SDL bus.
  Without the series:
    80 buttons as EV_KEY, and SDL reads 79.

Two notes on those results. The SDL number is with one small fix on
top of the pull request: built against kernel headers that have no
EV_BTN, its fallback define never asks the kernel, and SDL stays at
79 buttons. The Wine number needed two small fixes in Wine itself,
outside your merge request. Both belong to those projects and not to
this thread.

One thing for a next version. A report that changes many buttons at
once overflows the evdev client buffer. With all 128 buttons changing
in one report the client received 44 of the 128 EV_BTN events and a
SYN_DROPPED. input_estimate_events_per_packet() makes room for "KEY
and MSC events" with a constant 7 and does not count EV_BTN. Counting
one event per button when the device has EV_BTN gives 128 of 128 and
no SYN_DROPPED here:

 	/* Make room for KEY and MSC events */
 	events += 7;
 
+	/* Every generic button can change in one report */
+	if (test_bit(EV_BTN, dev->evbit))
+		events += dev->button_count;
+
 	return events;

It only makes sense on top of your patch 2, so take it into the
series if it is useful.

Benjamin's review of patches 3 and 4 reads to me as the way to a
next version. The test device's descriptor and the result tables are
available to anyone who wants them.

I work with AI partners on this distribution. I read and ran what is
reported here and I answer for it.

Daniel Campos Ramos
Sparky Stereo OS
https://github.com/Sparky-OS/sparky-stereo-os

      parent reply	other threads:[~2026-11-18 15:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-04 21:31 Tomasz Pakuła
2026-01-04 21:31 ` [RFC PATCH 1/6] Input: Introduce " Tomasz Pakuła
2026-01-04 22:30   ` Randy Dunlap
2026-01-04 21:31 ` [RFC PATCH 2/6] Input: Add info about EV_BTN Tomasz Pakuła
2026-01-04 21:31 ` [RFC PATCH 3/6] Input: Fire EV_BTN if found in ev_bit Tomasz Pakuła
2026-01-08 10:48   ` Benjamin Tissoires
2026-01-04 21:31 ` [RFC PATCH 4/6] Input: Assign EV_BTN event to HID Joysticks Tomasz Pakuła
2026-01-08 10:50   ` Benjamin Tissoires
2026-01-04 21:31 ` [RFC PATCH 5/6] Input: Realign rest of the HID_UP_BUTTON cases Tomasz Pakuła
2026-01-04 21:31 ` [RFC PATCH 6/6] Input: Add EVIOCGBTNCNT Tomasz Pakuła
2026-01-07  5:44 ` [RFC PATCH 0/6] Input: New EV_BTN event for generic buttons Ivan Gorinov
2026-01-08  3:24 ` Peter Hutterer
2026-11-18 15:00 ` Daniel Campos Ramos [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179501401503.113617.9596561330028866042@yahoo.com \
    --to=capitain_jack@yahoo.com \
    --cc=bentiss@kernel.org \
    --cc=corbet@lwn.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@altimeter.info \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.hutterer@who-t.net \
    --cc=ricardo.lopes.esteves@oracle.com \
    --cc=tomasz.pakula.oficjalny@gmail.com \
    --cc=vi@endrift.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®