[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <D8FC5C8BR1Q4.16X95BO48L6WF@proton.me>
Date: Thu, 13 Mar 2025 18:04:54 +0000
From: Benno Lossin <benno.lossin@...ton.me>
To: Rahul Rameshbabu <sergeantsagara@...tonmail.com>, linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org, linux-input@...r.kernel.org, dri-devel@...ts.freedesktop.org
Cc: Jiri Kosina <jikos@...nel.org>, Benjamin Tissoires <bentiss@...nel.org>, Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, Björn Roy Baron <bjorn3_gh@...tonmail.com>, Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, Danilo Krummrich <dakr@...nel.org>
Subject: Re: [PATCH RFC 0/3] Initial work for Rust abstraction for HID device driver development
On Thu Mar 13, 2025 at 5:02 PM CET, Rahul Rameshbabu wrote:
> Hello,
>
> I am a hobbyist developer who has been working on a project to create a new Rust
> HID device driver and the needed core abstractions for writing more HID device
> drivers in Rust. My goal is to support the USB Monitor Control Class needed for
> functionality such as backlight control for monitors like the Apple Studio
> Display and Apple Pro Display XDR. A new backlight API will be required to
> support multiple backlight instances and will be mapped per DRM connector. The
> current backlight API is designed around the assumption of only a single
> internal panel being present. I am currently working on making this new API for
> DRM in parallel to my work on the HID side of the stack for supporting these
> displays.
>
> https://binary-eater.github.io/tags/usb-monitor-control/
>
> Julius Zint had attempted to do so a year ago with a C HID driver but was gated
> by the lack of an appropriate backlight API for external displays. I asked him
> for permission to do the work need in Rust and plan to accredit him for the HID
> report handling for backlight in the USB Monitor Control Class standard.
>
> https://lore.kernel.org/lkml/f95da7ff-06dd-2c0e-d563-7e5ad61c3bcc@redhat.com/
>
> I was hoping to get initial feedback on this work to make sure I am on the right
> path for making a Rust HID abstraction that would be acceptable upstream. The
> patches compile with WERROR being disabled. This is necessary since Rust treats
> missing documentation comments as warnings (which is a good thing). I also need
> to go in and add more SAFETY comments.
>
> Thanks,
> Rahul Rameshbabu
>
> Rahul Rameshbabu (3):
> rust: core abstractions for HID drivers
> rust: hid: USB Monitor Control Class driver
> rust: hid: demo the core abstractions for probe and remove
>
> drivers/hid/Kconfig | 16 ++
> drivers/hid/Makefile | 1 +
> drivers/hid/hid_monitor_control.rs | 42 +++++
> rust/bindings/bindings_helper.h | 1 +
> rust/kernel/hid.rs | 245 +++++++++++++++++++++++++++++
> rust/kernel/lib.rs | 2 +
> 6 files changed, 307 insertions(+)
> create mode 100644 drivers/hid/hid_monitor_control.rs
> create mode 100644 rust/kernel/hid.rs
I have taken a very quick look and haven't seen any big problems,
there are some minor things, but not worth mentioning for an RFC.
---
Cheers,
Benno
Powered by blists - more mailing lists