All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Benjamin Tissoires <bentiss@kernel.org>
Cc: "Werner Sembach" <wse@tuxedocomputers.com>,
	"Armin Wolf" <W_Armin@gmx.de>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	dri-devel@lists.freedesktop.org, jelle@vdwaa.nl,
	jikos@kernel.org, lee@kernel.org, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org,
	miguel.ojeda.sandonis@gmail.com, ojeda@kernel.org,
	onitake@gmail.com, platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH 1/1] platform/x86/tuxedo: Add virtual LampArray for TUXEDO NB04 devices
Date: Thu, 3 Oct 2024 12:59:09 +0200	[thread overview]
Message-ID: <Zv54/T+6znqZB3X9@duo.ucw.cz> (raw)
In-Reply-To: <hdahq2vfi3bnvaqswwdtave2kc2qm3ngvcwn6cgfiirfjfbqnz@zk77mbs3yktp>

[-- Attachment #1: Type: text/plain, Size: 5217 bytes --]

Hi!

> > (Hint: it is LEDs below regular keyboard.)
> 
> Yes, I know, and if you read this email and the few others, you'll read
> that I own a few of them already (for a long time), and I worked on a
> cross vendor userspace API to configure them. So I know what I am
> talking about.

Ok.

> > > The positions of the pixels also depend on the physical layout of the
> > > keyboard itself. So with the same vendor ID/Product ID, you might have
> > > different pixel positions if the device is sold in Europe, or in the
> > > US.
> > 
> > If vendor sells different hardware with same IDs, well 1) that's a
> > nono, a 2) that's what kernel parameters are for.
> 
> This is already the case (hello hid-uclogic), and no, kernel parameters
> are not helping. In that case (uclogic), we ask the device a specific
> USB string which has the information, but is not part of HID. This is
> dumb, but we don't control hardware makers.

Well, good you find other solution. Kernel parameter would have worked
as a fallback.

> > > But that's just the "easy" part. We can define a kernel API, for sure,
> > > but then we need users. And there are several problems here:
> > > 
> > > - first, users of this new kernel API need to be root to address the
> > >   LEDs. They probably won't, so they'll rely on a third party daemon for
> > >   that, or just use uaccess (yay!). But that part is easy
> > 
> > Eventually, desktop environment should talk the interface. (Plus, how
> > does HID or BPF craziness help with his?)
> 
> HID helps because we already have the case with game controllers. Steam
> and SDL (both widely use), put rules giving uaccess to hidraw nodes on
> those controllers. So we finally made the jump and now provide in v6.12
> a new hidraw ioctl to allow logind to revoke the hidraw node. This
> should allow us to not give uaccess to those hidraw nodes.
> 
> So in the near future, there will be a portal available, that says
> "please give me a fd for this hidraw node", the compositor will then ask
> logind to open the file for it and then will pass that fd to the final
> application. Once there is a vt-switch, logind will revoke the fd,
> meaning that the application will not have access to the device.

Yes, you can work around kernel not providing abstractions. But you
should not have to.

> > > - but then, even if you make everyones happy, the GUI project is
> > >   actually cross-platform (OpenRGB is, Steam is, SDL is). And what is
> > >   done on Windows is simple: raw access to the HID device. And the
> > >   raw
> > 
> > Yes, Windows is a mess. We don't want to emulate them.
> > 
> > > I've been through this exact same process with Input and game
> > > controllers, and even for libratbag for configuring gaming devices. In
> > > the end, the kernel developer never wins, but the userspace
> > 
> > Yes, we have been in this exact situation. Userland was directly
> > accessing mice. It was called "gpm" and we moved away from that for
> > good reasons.
> 
> There is a slight difference between mouse support and LEDs on your
> keyboard. The former is actually required to bring up the machine and to
> use it, the latter is nice to have.

But that's not the difference that matters. Linux is not microkernel,
and is trying to provide hardware abstractions. (Except for printers,
I guess that's because printers are often network devices).

Besides, mouse was not required to bring up a machine "back then".

Besides,

1) using those keyboards in dark room without backlight is hard,
because their labels are translucent and not having enough contrast.

2) rainbow effects make people ill.

Note how we have drivers for audio, LEDs, cameras, dunno, iio sensors,
none of that is required to bring system up.

We need driver for the WMI stuff in kernel. And that point it should
be pretty clear proper driver/subsystem should be done.

> > > If you want a 100 lines of code program to control your keyboard, with
> > > LampArray, you can, as long as you don't require a GUI and don't require
> > > to be generic. Just write the values directly on the hidraw device,
> > > and
> > 
> > Haha, no. Kernel part was 400+ lines, no way you can parse that in 100
> > lines.
> 
> I'm not saying "parsing", I mean adapt to your use case. If you know
> your device, your simple CLI is just writing a static array of bytes to
> the hidraw interface.

No. Hardware abstraction is kernel work, my application should work
everywhere.

> > What is relevant that these crazy arrays are not going to be merged,
> > and better solution is needed.
> 
> Again, you seemn to miss the point: those crazy arrays should have been
> in the firmware from day one. They are not, so the idea is to convert
> proprietary protocol into a standard. Then we can start thinking what
> comes next.

Firmware is what it is and we have to deal with that.

(Not to mention that "standard" you are citing is not used by anyone
and is ugly as hell. So not even open hardware such as MNT Reform uses
it).

Best regards,
								Pavel
-- 
People of Russia, stop Putin before his war on Ukraine escalates.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2024-10-03 10:59 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-26 17:44 [PATCH 0/1] platform/x86/tuxedo: Add virtual LampArray for TUXEDO NB04 Werner Sembach
2024-09-26 17:44 ` [PATCH 1/1] platform/x86/tuxedo: Add virtual LampArray for TUXEDO NB04 devices Werner Sembach
2024-09-26 18:39   ` Armin Wolf
2024-09-27  6:59     ` Werner Sembach
2024-09-27 11:24       ` Werner Sembach
2024-09-27 17:18         ` Armin Wolf
2024-09-28  7:40           ` Werner Sembach
2024-09-27 17:15       ` Armin Wolf
2024-09-28  7:36         ` Werner Sembach
2024-09-27  8:59   ` kernel test robot
2024-09-27  9:20   ` kernel test robot
2024-09-27 12:18   ` kernel test robot
2024-09-27 21:01   ` Pavel Machek
2024-09-27 22:21     ` Armin Wolf
2024-09-28  7:27       ` Benjamin Tissoires
2024-09-28  8:23         ` Werner Sembach
2024-09-28 10:05           ` Benjamin Tissoires
2024-09-30 15:35             ` Werner Sembach
2024-09-30 16:15               ` Benjamin Tissoires
2024-09-30 16:35                 ` Werner Sembach
2024-09-30 17:06                   ` Benjamin Tissoires
2024-10-01 12:21                     ` Werner Sembach
2024-10-01 12:23                     ` Werner Sembach
2024-10-01 12:28                       ` Werner Sembach
2024-10-01 13:41                       ` Benjamin Tissoires
2024-10-01 16:45                         ` Armin Wolf
2024-10-01 19:32                           ` Werner Sembach
2024-10-02  8:42                             ` Benjamin Tissoires
2024-10-02  9:27                               ` Armin Wolf
2024-10-03 16:01                                 ` Benjamin Tissoires
2024-10-01 19:18                         ` Werner Sembach
2024-10-02  8:31                           ` Benjamin Tissoires
2024-10-07 17:57                             ` Werner Sembach
2024-10-08  9:53                               ` Benjamin Tissoires
2024-10-08 10:45                                 ` Werner Sembach
2024-10-08 12:18                                   ` Benjamin Tissoires
2024-10-08 14:51                                     ` Werner Sembach
2024-10-08 15:21                                       ` Benjamin Tissoires
2024-10-09  9:51                                         ` Werner Sembach
2024-10-09  9:55                                         ` Werner Sembach
2024-10-11 12:14                                           ` Armin Wolf
2024-10-11 15:26                                             ` Pavel Machek
2024-10-21 20:26                                               ` Armin Wolf
2024-10-22  7:58                                                 ` Hans de Goede
2024-10-22  8:51                                                   ` Benjamin Tissoires
2024-10-22  9:37                                                     ` Pavel Machek
2024-10-22 15:02                                                       ` Armin Wolf
2024-10-23 17:54                                                         ` Werner Sembach
2024-10-22  9:47                                                   ` Pavel Machek
2024-10-22 15:18                                                     ` Armin Wolf
2024-10-22 19:15                                                       ` Pavel Machek
2024-10-23  7:03                                                         ` Armin Wolf
2024-10-23 17:14                                                         ` Werner Sembach
2024-10-23 17:47                                                           ` Pavel Machek
2024-10-23 16:38                                                     ` Werner Sembach
2024-10-22  9:05                                           ` Benjamin Tissoires
2024-10-23 17:23                                             ` Werner Sembach
2024-10-01 21:03                         ` Pavel Machek
2024-10-02  8:13                           ` Benjamin Tissoires
2024-10-02  9:53                             ` Pavel Machek
2024-10-02 10:21                               ` Benjamin Tissoires
2024-10-03 10:59                                 ` Pavel Machek [this message]
2024-10-03 12:54                                   ` Benjamin Tissoires
2024-10-11 15:23                                     ` Pavel Machek
2024-09-28  8:09       ` Werner Sembach
2024-10-01 20:47         ` Pavel Machek
2024-09-28  7:55     ` Werner Sembach
2024-09-27 16:08 ` [PATCH 0/1] platform/x86/tuxedo: Add virtual LampArray for TUXEDO NB04 Benjamin Tissoires
2024-09-27 21:03   ` Pavel Machek
2024-09-28  7:31   ` Werner Sembach

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=Zv54/T+6znqZB3X9@duo.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=W_Armin@gmx.de \
    --cc=bentiss@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jelle@vdwaa.nl \
    --cc=jikos@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=onitake@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=wse@tuxedocomputers.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.