mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rust: drm: enable standard fdinfo for Rust drivers
@ 2026-11-19  9:48 Peder Bergan via B4 Relay
  0 siblings, 0 replies; only message in thread
From: Peder Bergan via B4 Relay @ 2026-11-19  9:48 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

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 and calls the separate driver statistics
hook if the driver provides one.

Fixes: c284d3e42338 ("rust: drm: gem: Add GEM object abstraction")
Closes: https://github.com/Rust-for-Linux/linux/issues/1266
Signed-off-by: Peder Bergan <peder.bergan@gmail.com>
---
Matt Mireles reported the missing fdinfo fields on an Asahi kernel and
suggested using this helper.

The x86-64 LLVM=1 CLIPPY=1 build adds the drm_show_fdinfo callback to
nova-drm.ko's file operations table.

The pending move of the file operations into drm::device [1] should
carry this assignment into UnregisteredDevice::FOPS.

[1] https://lore.kernel.org/dri-devel/20261118163203.2483856-4-dakr@kernel.org/

OpenAI Codex assisted with coding and testing.
---
 rust/kernel/drm/gem/mod.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/rust/kernel/drm/gem/mod.rs b/rust/kernel/drm/gem/mod.rs
index 85657a39e146..b37695f870d4 100644
--- a/rust/kernel/drm/gem/mod.rs
+++ b/rust/kernel/drm/gem/mod.rs
@@ -388,6 +388,7 @@ pub(super) const fn create_fops(owner: *mut bindings::module) -> 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: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261119-fix-drm-rust-fdinfo-8e17f71dd9c3

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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-19  9:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19  9:48 [PATCH] rust: drm: enable standard fdinfo for Rust drivers Peder Bergan via B4 Relay

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®