rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC WIP 0/3] DRM Jobqueue
@ 2025-11-18 13:25 Philipp Stanner
  2025-11-18 13:25 ` [RFC WIP 1/3] rust: list: Add unsafe for container_of Philipp Stanner
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Philipp Stanner @ 2025-11-18 13:25 UTC (permalink / raw)
  To: Alice Ryhl, Danilo Krummrich, Christian König,
	Tvrtko Ursulin, Alexandre Courbot, Daniel Almeida,
	Boris Brezillon, Dave Airlie, Lyude Paul, Peter Colberg
  Cc: dri-devel, linux-kernel, rust-for-linux, Philipp Stanner

It is time to share a sneek peek into the DRM JQ design. It's all highly
WIP, but I hope that it transfers the general design idea.

I can compile this code, but it cannot actually submit anything yet.

Patch 1 of this series can be ignored. It solves a blocker in the Rust
infrastructure and is included so that interested factions can build the
code.

Patch 2 contains a slightly modified version of the already published
DMA fence RFC [1]. This version removes the DmaFenceNames trait callbacks and
replaces the name strings with dummies. Reason being that these strings
are only ever accessed through certain accessor functions which the Rust
DmaFence currently does not expose anyways, and the only user in C is
i915 [2].
The trait caused some trouble while compiling because for JQ's hw_fence
we don't need to pass fence data, but it was mandatory since that
data hosted said trait, but also needs to be pinned etc.

Patch 3 is the actual JQ code as it exists so far. Please see that
patch's commit message for the current state.

I'll revisit my DmaFence RFC soon and try to get it in line with
Christian's life time rework [3] and fix some other issues and implement the
feedback which the RFC received so far.

Feedback for JQ is obviously welcome; the most notable problem I'm
currently having is with the list implementation. I don't know yet how I
can get job_lists to work with jobs containing the driver's generic data
`T` – data which the JQ by the way doesn't need to access, it just wants
to pass it back to the driver later in run_job().


Greetings,
Philipp

[1] https://lore.kernel.org/dri-devel/20250918123100.124738-2-phasta@kernel.org/
[2] https://elixir.bootlin.com/linux/v6.18-rc4/A/ident/dma_fence_timeline_name
[3] https://lore.kernel.org/dri-devel/20251113145332.16805-1-christian.koenig@amd.com/

Philipp Stanner (3):
  rust: list: Add unsafe for container_of
  rust: sync: Add dma_fence abstractions
  rust/drm: Add initial jobqueue sceleton

 rust/bindings/bindings_helper.h        |   1 +
 rust/helpers/dma_fence.c               |  23 ++
 rust/helpers/helpers.c                 |   1 +
 rust/helpers/spinlock.c                |   5 +
 rust/kernel/drm/jq.rs                  | 398 +++++++++++++++++++++++++
 rust/kernel/drm/mod.rs                 |   2 +
 rust/kernel/list/impl_list_item_mod.rs |  12 +-
 rust/kernel/sync.rs                    |   2 +
 rust/kernel/sync/dma_fence.rs          | 380 +++++++++++++++++++++++
 9 files changed, 818 insertions(+), 6 deletions(-)
 create mode 100644 rust/helpers/dma_fence.c
 create mode 100644 rust/kernel/drm/jq.rs
 create mode 100644 rust/kernel/sync/dma_fence.rs

-- 
2.49.0


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

end of thread, other threads:[~2025-11-21 23:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-18 13:25 [RFC WIP 0/3] DRM Jobqueue Philipp Stanner
2025-11-18 13:25 ` [RFC WIP 1/3] rust: list: Add unsafe for container_of Philipp Stanner
2025-11-18 13:25 ` [RFC WIP 2/3] rust: sync: Add dma_fence abstractions Philipp Stanner
2025-11-21 23:03   ` Lyude Paul
2025-11-18 13:25 ` [RFC WIP 3/3] rust/drm: Add initial jobqueue sceleton Philipp Stanner

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).