rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Stanner <phasta@mailbox.org>
To: Daniel Almeida <daniel.almeida@collabora.com>,
	Philipp Stanner <phasta@kernel.org>
Cc: "Alice Ryhl" <aliceryhl@google.com>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Christian König" <ckoenig.leichtzumerken@gmail.com>,
	"Tvrtko Ursulin" <tursulin@ursulin.net>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Boris Brezillon" <boris.brezillon@collabora.com>,
	"Dave Airlie" <airlied@redhat.com>,
	"Lyude Paul" <lyude@redhat.com>,
	"Peter Colberg" <pcolberg@redhat.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	rust-for-linux@vger.kernel.org
Subject: Re: [RFC WIP 2/3] rust: sync: Add dma_fence abstractions
Date: Fri, 28 Nov 2025 12:08:52 +0100	[thread overview]
Message-ID: <19e9f6fb270b28b06bfeddf274ad3bcacdc22e0d.camel@mailbox.org> (raw)
In-Reply-To: <E55D72FC-AEF6-4D2D-973F-123306E4EB4C@collabora.com>

On Mon, 2025-11-24 at 09:49 -0300, Daniel Almeida wrote:
> Hi Phillipp,
> 
> > On 18 Nov 2025, at 10:25, Philipp Stanner <phasta@kernel.org> wrote:
> > 
> > dma_fence is a synchronization mechanism which is needed by virtually
> > all GPU drivers.
> > 

[…]

> > +#[pin_data]
> > +pub struct DmaFence<T> {
> > +    /// The actual dma_fence passed to C.
> > +    #[pin]
> > +    inner: Opaque<bindings::dma_fence>,
> > +    /// User data.
> > +    #[pin]
> > +    data: T,
> 
> Same here: we should probably deref to this type.

Oh, wait.

There's another problem:

done_fences are created by JQ and returned to the driver. The JQ
doesn't need to stuff any data into those fences (it just wants to
signal them, and register events on done_fences coming from other JQs).

So I was about to investigate how we could have a DmaFence<()> to make
the data optional (see the following patch, there I still use an i32 as
dummy data).

Is that compatible with Deref?
Ideas?


P.

  parent reply	other threads:[~2025-11-28 11:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-24  9:31     ` Alice Ryhl
2025-11-27 13:45     ` Philipp Stanner
2025-11-24 12:49   ` Daniel Almeida
2025-11-25  9:48     ` Philipp Stanner
2025-11-25 10:58       ` Boris Brezillon
2025-11-25 12:20         ` Philipp Stanner
2025-11-25 13:50           ` Boris Brezillon
2025-11-26 13:42             ` Philipp Stanner
2025-11-26 14:55               ` Boris Brezillon
2025-11-27 13:48       ` Daniel Almeida
2025-11-28 11:08     ` Philipp Stanner [this message]
2025-11-28 12:21       ` Daniel Almeida
2025-11-18 13:25 ` [RFC WIP 3/3] rust/drm: Add initial jobqueue sceleton Philipp Stanner
2025-11-24 13:58   ` Daniel Almeida
2025-11-25 13:20     ` Philipp Stanner
2025-11-27 14:13       ` Daniel Almeida
2025-11-28 10:07         ` Philipp Stanner

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=19e9f6fb270b28b06bfeddf274ad3bcacdc22e0d.camel@mailbox.org \
    --to=phasta@mailbox.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@redhat.com \
    --cc=aliceryhl@google.com \
    --cc=boris.brezillon@collabora.com \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=pcolberg@redhat.com \
    --cc=phasta@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tursulin@ursulin.net \
    /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;
as well as URLs for NNTP newsgroup(s).