mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] rust: drm: enable standard fdinfo for Rust drivers
@ 2026-11-26 17:39 Peder Bergan via B4 Relay
  2026-11-26 22:19 ` Danilo Krummrich
  0 siblings, 1 reply; 2+ messages in thread
From: Peder Bergan via B4 Relay @ 2026-11-26 17:39 UTC (permalink / raw)
  To: Danilo Krummrich, Alice Ryhl
  Cc: David Airlie, Simona Vetter, Miguel Ojeda, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Trevor Gross, Daniel Almeida, Tamir Duberstein,
	Alexandre Courbot, Onur Özkan, Asahi Lina, Lyude Paul,
	dri-devel, rust-for-linux, linux-kernel, linux-api, Janne Grunau

From: Peder Bergan <peder.bergan@gmail.com>

DRM monitoring tools use drm-driver and drm-client-id in procfs fdinfo
to identify DRM clients. The common Rust DRM file operations leave
show_fdinfo unset, so these entries are missing for those clients.

Set show_fdinfo to drm_show_fdinfo. The DRM core helper emits the
standard client information. Rust DRM does not yet expose the optional
driver-specific statistics hook.

Closes: https://github.com/Rust-for-Linux/linux/issues/1266
Tested-by: Janne Grunau <j@jannau.net>
Reviewed-by: Janne Grunau <j@jannau.net>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Peder Bergan <peder.bergan@gmail.com>
---
Danilo, VTABLE.fops points to UnregisteredDevice::FOPS. Procfs calls
FOPS.show_fdinfo, so this patch installs drm_show_fdinfo there. The helper
calls VTABLE.show_fdinfo when the driver supplies additional statistics.

Matt Mireles reported the missing fdinfo fields on an Asahi kernel and
suggested using this helper.

Janne Grunau tested v1 with the downstream Asahi driver on Apple silicon.

OpenAI Codex assisted with coding and testing.
---
Changes in v2:
- Rebase onto drm-rust-next and set the callback in UnregisteredDevice::FOPS
  now that the file operations have moved to drm::device.
- Drop the Fixes tag and clarify that Rust DRM has yet to expose the
  optional driver statistics hook.
- Add the Reviewed-by and Tested-by tags from v1.
- Link to v1: https://patch.msgid.link/20261119-fix-drm-rust-fdinfo-v1-1-c10f4134488d@gmail.com
---
 rust/kernel/drm/device.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rust/kernel/drm/device.rs b/rust/kernel/drm/device.rs
index 1c5b0abb492be..c460ba3706bf9 100644
--- a/rust/kernel/drm/device.rs
+++ b/rust/kernel/drm/device.rs
@@ -273,6 +273,7 @@ extern "C" fn fops_open(inode: *mut bindings::inode, filp: *mut bindings::file)
         fops.read = Some(bindings::drm_read);
         fops.llseek = Some(bindings::noop_llseek);
         fops.mmap = Some(bindings::drm_gem_mmap);
+        fops.show_fdinfo = Some(bindings::drm_show_fdinfo);
         fops.fop_flags = bindings::FOP_UNSIGNED_OFFSET;
 
         fops

---
base-commit: 4325f4aad9727a6e8e7f10c5d2ebf490470cf938
change-id: 20261119-fix-drm-rust-fdinfo-8e17f71dd9c3

Best regards,
--  
Peder Bergan <peder.bergan@gmail.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] rust: drm: enable standard fdinfo for Rust drivers
  2026-11-26 17:39 [PATCH v2] rust: drm: enable standard fdinfo for Rust drivers Peder Bergan via B4 Relay
@ 2026-11-26 22:19 ` Danilo Krummrich
  0 siblings, 0 replies; 2+ messages in thread
From: Danilo Krummrich @ 2026-11-26 22:19 UTC (permalink / raw)
  To: Peder Bergan
  Cc: Danilo Krummrich, Alice Ryhl, David Airlie, Simona Vetter,
	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Trevor Gross, Daniel Almeida,
	Tamir Duberstein, Alexandre Courbot, Onur Özkan, Asahi Lina,
	Lyude Paul, dri-devel, rust-for-linux, linux-kernel, linux-api,
	Janne Grunau

On Thu, 26 Nov 2026 18:39:33 +0100, Peder Bergan wrote:
> [PATCH v2] rust: drm: enable standard fdinfo for Rust drivers

Applied, thanks!

  Branch: drm-rust-next
  Tree:   https://gitlab.freedesktop.org/drm/rust/kernel.git

[1/1] rust: drm: enable standard fdinfo for Rust drivers
      commit: 02efea879e87

The patch will appear in the next linux-next integration (typically within 24
hours on weekdays).

The patch is queued up for the upcoming merge window for the next major kernel
release.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-26 22:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-26 17:39 [PATCH v2] rust: drm: enable standard fdinfo for Rust drivers Peder Bergan via B4 Relay
2026-11-26 22:19 ` Danilo Krummrich

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®