From: Hans de Goede <hdegoede@redhat.com>
To: Armin Wolf <W_Armin@gmx.de>, Pavel Machek <pavel@ucw.cz>
Cc: "Werner Sembach" <wse@tuxedocomputers.com>,
"Benjamin Tissoires" <bentiss@kernel.org>,
"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: Tue, 22 Oct 2024 09:58:48 +0200 [thread overview]
Message-ID: <c52019d7-01b4-4585-a2d1-b44b0a773fc9@redhat.com> (raw)
In-Reply-To: <a796f0e7-47a8-40fa-a64e-9dd56117bf78@gmx.de>
Hi Armin,
On 21-Oct-24 10:26 PM, Armin Wolf wrote:
> Am 11.10.24 um 17:26 schrieb Pavel Machek:
>
>> Hi!
>>
>>>> 1.
>>>> https://lore.kernel.org/all/6b32fb73-0544-4a68-95ba-e82406a4b188@gmx.de/
>>>> -> Should be no problem? Because this is not generally exposing wmi
>>>> calls, just mapping two explicitly with sanitized input (whitelisting
>>>> basically).
>>> It would be OK to expose a selected set of WMI calls to userspace and sanitizing the input of protect potentially buggy firmware from userspace.
>>>
>> I don't believe this is good idea. Passthrough interfaces where
>> userland talks directly to hardware are very tricky.
>>
>>> Regarding the basic idea of having a virtual HID interface: i would prefer to create a illumination subsystem instead, but i have to agree that we should be doing this
>>> only after enough drivers are inside the kernel, so we can design a
>>> suitable interface for them. For now, creating a virtual HID
>>> interface seems to be good enough.
>> I have an RGB keyboard, and would like to get it supported. I already
>> have kernel driver for LEDs (which breaks input functionality). I'd
>> like to cooperate on "illumination" subsystem.
>>
>> Best regards,
>> Pavel
>
> Sorry for taking a bit long to respond.
>
> This "illumination" subsystem would (from my perspective) act like some sort of LED subsystem
> for devices with a high count of LEDs, like some RGB keyboards.
>
> This would allow us too:
> - provide an abstract interface for userspace applications like OpenRGB
> - provide an generic LED subsystem emulation on top of the illumination device (optional)
> - support future RGB controllers in a generic way
>
> Advanced features like RGB effects, etc can be added later should the need arise.
>
> I would suggest that we model it after the HID LampArray interface:
>
> - interface for querying:
> - number of LEDs
> - supported colors, etc of those LEDs
> - position of those LEDs if available
> - kind (keyboard, ...)
> - latency, etc
> - interface for setting multiple LEDs at once
> - interface for setting a range of LEDs at once
> - interface for getting the current LED colors
>
> Since sysfs has a "one value per file" rule, i suggest that we use a chardev interface
> for querying per-LED data and for setting/getting LED colors.
>
> I do not know if mixing sysfs (for controller attributes like number of LEDs, etc) and IOCTL
> (for setting/getting LED colors) is a good idea, any thoughts?
I wonder what the advantage of this approach is over simply using HID LampArray
(emulation), openRGB is already going to support HID LampArray and since Microsoft
is pushing this we will likely see it getting used more and more.
Using HID LampArray also has the advantage that work has landed and is landing
to allow safely handing over raw HID access to userspace programs or even
individual graphical apps with the option to revoke that access when it is
no longer desired for the app to have access.
HID LampArray gives us a well designed API + a safe way to give direct access
to e.g. games to control the lighting. I really don't see the advantage of
inventing our own API here only to then also have to design + code some way to
safely give access to sandboxed apps.
Note that giving access to sandboxed apps is a lot of work, it is not just
kernel API it also requires designing a portal interface + implementing
that portal for at least GNOME, KDE and wlroots.
Personally I really like the idea to just emulate a HID LampArray device
for this instead or rolling our own API. I believe there need to be
strong arguments to go with some alternative NIH API and I have not
heard such arguments yet.
Regards,
Hans
next prev parent reply other threads:[~2024-10-22 7:58 UTC|newest]
Thread overview: 68+ 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: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: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 [this message]
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
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=c52019d7-01b4-4585-a2d1-b44b0a773fc9@redhat.com \
--to=hdegoede@redhat.com \
--cc=W_Armin@gmx.de \
--cc=bentiss@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--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=pavel@ucw.cz \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).