Re: [RFC PATCH] rust: sync: Add dma_fence abstractions

2025-09-28 Thread Christian König
On 28.09.25 17:26, Philipp Stanner wrote: > On Sun, 2025-09-28 at 16:34 +0200, Christian König wrote: >> On 27.09.25 11:01, Philipp Stanner wrote: >>> On Fri, 2025-09-26 at 09:10 -0700, Boqun Feng wrote: On Thu, Sep 18, 2025 at 02:30:59PM +0200, Philipp Stanner wrote: > dma_fence is a sync

Re: [RFC PATCH] rust: sync: Add dma_fence abstractions

2025-09-28 Thread Danilo Krummrich
On Fri Sep 26, 2025 at 6:10 PM CEST, Boqun Feng wrote: > I missed this part, and I don't think kernel::sync is where dma_fence > should be, as kernel::sync is mostly for the basic synchronization > between threads/irqs. dma_fence is probably better to be grouped with > dma-buf and other dma related

Re: [RFC PATCH] rust: sync: Add dma_fence abstractions

2025-09-28 Thread Philipp Stanner
On Sun, 2025-09-28 at 16:34 +0200, Christian König wrote: > On 27.09.25 11:01, Philipp Stanner wrote: > > On Fri, 2025-09-26 at 09:10 -0700, Boqun Feng wrote: > > > On Thu, Sep 18, 2025 at 02:30:59PM +0200, Philipp Stanner wrote: > > > > dma_fence is a synchronization mechanism which is needed by v

Re: [RFC PATCH] rust: sync: Add dma_fence abstractions

2025-09-28 Thread Christian König
On 27.09.25 11:01, Philipp Stanner wrote: > On Fri, 2025-09-26 at 09:10 -0700, Boqun Feng wrote: >> On Thu, Sep 18, 2025 at 02:30:59PM +0200, Philipp Stanner wrote: >>> dma_fence is a synchronization mechanism which is needed by virtually >>> all GPU drivers. >>> >>> A dma_fence offers many feature

Re: [RFC PATCH] rust: sync: Add dma_fence abstractions

2025-09-27 Thread Boqun Feng
On Sat, Sep 27, 2025 at 02:14:22PM +0200, Miguel Ojeda wrote: > On Fri, Sep 26, 2025 at 6:10 PM Boqun Feng wrote: > > > > Thoughts? Miguel, Greg, Danilo and Lyude, any idea or suggestion? > > Either way sounds OK. > > More generally, one thing to consider nowadays is whether we will want > somet

Re: [RFC PATCH] rust: sync: Add dma_fence abstractions

2025-09-27 Thread Boqun Feng
On Sat, Sep 27, 2025 at 11:01:38AM +0200, Philipp Stanner wrote: [..] > > > --- > > >  rust/bindings/bindings_helper.h |   1 + > > >  rust/helpers/dma_fence.c    |  23 ++ > > >  rust/helpers/helpers.c  |   1 + > > >  rust/helpers/spinlock.c |   5 + > > >  rust/kernel/sync.rs

Re: [RFC PATCH] rust: sync: Add dma_fence abstractions

2025-09-27 Thread Miguel Ojeda
On Fri, Sep 26, 2025 at 6:10 PM Boqun Feng wrote: > > Thoughts? Miguel, Greg, Danilo and Lyude, any idea or suggestion? Either way sounds OK. More generally, one thing to consider nowadays is whether we will want something to eventually live in its own crate etc., but for this I don't think it a

Re: [RFC PATCH] rust: sync: Add dma_fence abstractions

2025-09-27 Thread Philipp Stanner
On Fri, 2025-09-26 at 09:10 -0700, Boqun Feng wrote: > On Thu, Sep 18, 2025 at 02:30:59PM +0200, Philipp Stanner wrote: > > dma_fence is a synchronization mechanism which is needed by virtually > > all GPU drivers. > > > > A dma_fence offers many features, among which the most important ones > > a

Re: [RFC PATCH] rust: sync: Add dma_fence abstractions

2025-09-26 Thread Philipp Stanner
On Thu, 2025-09-18 at 15:52 +0200, Boqun Feng wrote: > On Thu, Sep 18, 2025 at 02:30:59PM +0200, Philipp Stanner wrote: > [...] > > --- > > So. ¡Hola! > > > > This is a highly WIP RFC. It's obviously at many places not yet > > conforming very well to Rust's standards. > > > > Nevertheless, it has

[RFC PATCH] rust: sync: Add dma_fence abstractions

2025-09-18 Thread Philipp Stanner
dma_fence is a synchronization mechanism which is needed by virtually all GPU drivers. A dma_fence offers many features, among which the most important ones are registering callbacks (for example to kick off a work item) which get executed once a fence gets signalled. dma_fence has a number of ca

Re: [RFC PATCH] rust: sync: Add dma_fence abstractions

2025-09-18 Thread Philipp Stanner
On Thu, 2025-09-18 at 15:11 +0200, Christian König wrote: > Oh, now it gets funny. For the Rust compiler maybe ^^' dma_fence is a tough nut to crack because of all its callbacks and strict rules <.< > > Adding Tvrtko as well since he recently looked into making dma_fences more > robust regardin

Re: [RFC PATCH] rust: sync: Add dma_fence abstractions

2025-09-18 Thread Boqun Feng
On Thu, Sep 18, 2025 at 02:30:59PM +0200, Philipp Stanner wrote: [...] > --- > So. ¡Hola! > > This is a highly WIP RFC. It's obviously at many places not yet > conforming very well to Rust's standards. > > Nevertheless, it has progressed enough that I want to request comments > from the community

Re: [RFC PATCH] rust: sync: Add dma_fence abstractions

2025-09-18 Thread Christian König
Oh, now it gets funny. Adding Tvrtko as well since he recently looked into making dma_fences more robust regarding context lifetime. On 18.09.25 14:30, Philipp Stanner wrote: > dma_fence is a synchronization mechanism which is needed by virtually > all GPU drivers. > > A dma_fence offers many f