From: Maxime Ripard <mripard@kernel.org>
To: Albert Esteve <aesteve@redhat.com>
Cc: "Rob Herring" <robh@kernel.org>,
"Saravana Kannan" <saravanak@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Onur Özkan" <work@onurozkan.dev>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
devicetree@vger.kernel.org, rust-for-linux@vger.kernel.org,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 0/5] rust: drm: add panel bindings
Date: Tue, 18 Aug 2026 13:45:26 +0200 [thread overview]
Message-ID: <20260818-encouraging-lime-kestrel-d0d819@houat> (raw)
In-Reply-To: <20260817-drm_panel_bindings-v1-0-1f974508a31c@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3513 bytes --]
Hi,
On Mon, Aug 17, 2026 at 01:40:45PM +0200, Albert Esteve wrote:
> This series adds Rust abstractions for the DRM panel subsystem,
> covering both the consumer and producer sides of the API.
> This helps closing the gap so that future panel drivers
> can be written directly in Rust.
>
> Background
> ----------
> The DRM panel C API has been progressively hardened over the past
> year (see [1], [2], and [3]). All panel drivers were fully migrated
> to kref-based allocation via devm_drm_panel_alloc(). Panel lookup
> functions (i.e., of_drm_find_panel() and find_panel_by_fwnode())
> were also updated to acquire a reference before returning.
>
> Note this series depends on [3] being merged in the base
> tree. Currently it has been only applied to drm-misc-next.
> The other series mentioned above are already part of the
> base for the current version of this series.
>
> As a personal note, part of my motivation for creating this series
> was learning more about Rust in the kernel. I would appreciate
> feedback on Rust-specific idioms or kernel conventions used here
> that I may have missed.
>
> What this series does
> ---------------------
> Patch 1 adds of::Node, a Rust wrapper for struct device_node
> implementing AlwaysRefCounted. C helpers are added so that of_node_get()
> and of_node_put() are reachable from Rust independently of CONFIG_OF_DYNAMIC.
>
> Patch 2 adds drm::Connector, a minimal Rust wrapper for
> struct drm_connector. Its sole purpose is to provide a typed reference
> for the get_modes() callback argument; no ownership or refcounting is
> exposed at this stage.
>
> Patch 3 adds the consumer side of the panel abstraction:
> - Panel wraps struct drm_panel and implements AlwaysRefCounted via
> drm_panel_get/put. Consumer lifecycle methods are exposed as safe wrappers.
> - PanelOrientation wraps enum drm_panel_orientation and provides
> from_of_node() to read the "rotation" device tree property.
> - Registration manages the panel's presence in the global registry
> via drm_panel_add/remove, decoupling registry lifetime from
> reference count lifetime.
>
> Patch 4 adds the producer side:
> - PanelFuncs is a #[vtable] trait that panel drivers implement to
> provide their callbacks. All but get_modes are optional.
> - Panel::new wraps __devm_drm_panel_alloc, returning an ARef<Panel>.
> Registration with the global registry is kept separate via
> Registration::register, following the pattern of drm::Device::new.
> - ConnectorType mirrors the DRM_MODE_CONNECTOR_* defines from
> include/uapi/drm/drm_mode.h, required by Panel::new to specify the
> panel's connector type.
>
> Patch 5 adds gated tests, covering data type conversions and layout
> invariants.
So while it's definitely welcome on principle, I wonder if panels would
be a place to invest in at the moment
The series
https://lore.kernel.org/dri-devel/20260814-drm-bridge-every-panel-v1-0-19cd5277cc8d@bootlin.com/
is likely to move every consumer to use bridges exclusively.
https://lore.kernel.org/ksummit/0fa2fb42-0714-49f7-ba43-22928e1dd488@linaro.org/
raised a discussion that the panel API is very limited at the moment
(while the bridge API isn't, or could be much more easily extended).
This is supposed to be discussed at plumbers, but I seriously think the
outcome of that discussion would be to just deprecate panels.
Bridges would be a much more long-term-proof investment.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
next prev parent reply other threads:[~2026-08-18 11:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 11:40 [PATCH 0/5] rust: drm: add panel bindings Albert Esteve
2026-08-17 11:40 ` [PATCH 1/5] rust: of: add Node type Albert Esteve
2026-08-17 11:49 ` sashiko-bot
2026-08-17 15:18 ` Rob Herring
2026-08-18 7:20 ` Albert Esteve
2026-08-17 11:40 ` [PATCH 2/5] rust: drm: add connector abstraction Albert Esteve
2026-08-17 11:46 ` sashiko-bot
2026-08-17 11:40 ` [PATCH 3/5] rust: drm: add panel consumer abstractions Albert Esteve
2026-08-17 11:51 ` sashiko-bot
2026-08-17 11:40 ` [PATCH 4/5] rust: drm: add panel producer abstractions Albert Esteve
2026-08-17 11:53 ` sashiko-bot
2026-08-17 11:40 ` [PATCH 5/5] rust: drm: add KUnit tests for panel Albert Esteve
2026-08-17 11:52 ` sashiko-bot
2026-08-18 11:45 ` Maxime Ripard [this message]
2026-08-18 12:43 ` [PATCH 0/5] rust: drm: add panel bindings Albert Esteve
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=20260818-encouraging-lime-kestrel-d0d819@houat \
--to=mripard@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aesteve@redhat.com \
--cc=airlied@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=robh@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=saravanak@kernel.org \
--cc=simona@ffwll.ch \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/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