mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Janne Grunau <j@jannau.net>
To: Alice Ryhl <aliceryhl@google.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Sami Tolvanen" <samitolvanen@google.com>,
	"Lyude Paul" <lyude@redhat.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, nova-gpu@lists.linux.dev,
	stable+noautosel@kernel.org
Subject: Re: [PATCH v2 3/5] rust: drm: gem: shmem: Implement prime_import_sg_table callback
Date: Wed, 25 Nov 2026 12:38:46 +0100	[thread overview]
Message-ID: <20261125113846.GB372978@robin.jannau.net> (raw)
In-Reply-To: <awXA70GWssuU991c@google.com>

On Tue, Nov 24, 2026 at 04:53:03PM +0000, Alice Ryhl wrote:
> On Tue, Nov 24, 2026 at 12:37:45PM +0100, Janne Grunau wrote:
> > +        // SAFETY: The DRM shmem helper only invokes this callback for a registered DRM device of
> > +        // type `T::Driver`, which is `Self`'s driver per the `AllocImpl` impl below.
> > +        let dev: &Device<T::Driver> = unsafe { Device::from_raw(raw_dev) };
> 
> `drm::Driver` in `rust/kernel/drm/driver.rs` currently declares:
> 
>     type Object: AllocImpl;
> 
> without any constraint that `T::Object::Driver = T`. I think we should
> introduce one similar to how Driver::File constrains this?

so changing it to `type Object: AllocImpl<Driver = Self>;`?

I think it's hard to get that accidentally wrong but since the change
relies on that constraint and we can express it sure.

I added it locally for v3 but feel free to make that change before
pushing this series to drm-rust-next if there is nothing else that
warrants a v3.

Janne

  reply	other threads:[~2026-11-25 11:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 11:37 [PATCH v2 0/5] Fix import of dma-buf buffers as DRM GEM shmem objects Janne Grunau
2026-11-24 11:37 ` [PATCH v2 1/5] rust: drm: gem: shmem: Do not use drm_gem_shmem_dumb_create() Janne Grunau
2026-11-25 15:03   ` Alice Ryhl
2026-11-24 11:37 ` [PATCH v2 2/5] drm/gem/shmem: Initialize private objects via drm_gem_shmem_init() too Janne Grunau
2026-11-25 15:03   ` Alice Ryhl
2026-11-24 11:37 ` [PATCH v2 3/5] rust: drm: gem: shmem: Implement prime_import_sg_table callback Janne Grunau
2026-11-24 16:53   ` Alice Ryhl
2026-11-25 11:38     ` Janne Grunau [this message]
2026-11-24 11:37 ` [PATCH v2 4/5] rust: drm: gem: add an is_imported() accessor Janne Grunau
2026-11-25 15:03   ` Alice Ryhl
2026-11-24 11:37 ` [PATCH v2 5/5] rust: drm: gem: shmem: Do not free SG table of imported objects Janne Grunau

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=20261125113846.GB372978@robin.jannau.net \
    --to=j@jannau.net \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=lyude@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=nova-gpu@lists.linux.dev \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=samitolvanen@google.com \
    --cc=simona@ffwll.ch \
    --cc=stable+noautosel@kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=tzimmermann@suse.de \
    --cc=work@onurozkan.dev \
    /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

all inboxes | Powered by JetHome®