NVIDIA GPU driver infrastructure
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Janne Grunau" <j@jannau.net>, "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>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"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>, "Janne Grunau" <j@jananu.net>,
	"Sami Tolvanen" <samitolvanen@google.com>,
	"Lyude Paul" <lyude@redhat.com>
Cc: dri-devel@lists.freedesktop.org, nova-gpu@lists.linux.dev
Subject: Re: [PATCH 2/3] rust: drm: gem: add an is_imported() accessor
Date: Mon, 26 Oct 2026 11:53:31 +0000	[thread overview]
Message-ID: <sashiko-outbox-185127@kernel.org> (raw)
In-Reply-To: <20261026-rust-drm-gem-shmem-imported-sgt-v1-2-36f15ace04b1@jannau.net>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] rust: drm: gem: missing #[inline] on BaseObject::is_imported()
--

commit 870fd74aba497ab1671a05a6bf7eca2012bd1ed7
Author: Sami Tolvanen <samitolvanen@google.com>

rust: drm: gem: add an is_imported() accessor

This commit adds BaseObject::is_imported() and a corresponding C helper
shim to check whether a DRM GEM object is PRIME-imported.

> diff --git a/rust/kernel/drm/gem/mod.rs b/rust/kernel/drm/gem/mod.rs
> index e01b8311dd895..5da8627275a29 100644
> --- a/rust/kernel/drm/gem/mod.rs
> +++ b/rust/kernel/drm/gem/mod.rs
> @@ -187,6 +187,13 @@ fn size(&self) -> usize {
>          unsafe { (*self.as_raw()).size }
>      }
>  
> +    /// Returns whether the object's backing buffer is imported from another
> +    /// driver.
> +    fn is_imported(&self) -> bool {
> +        // SAFETY: `self.as_raw()` is guaranteed to be a pointer to a valid `struct drm_gem_object`.
> +        unsafe { bindings::drm_gem_is_imported(self.as_raw()) }
> +    }

[Severity: Low]
This isn't a bug, but since BaseObject::is_imported() in
rust/kernel/drm/gem/mod.rs is a small abstraction method in the kernel
crate that directly forwards to bindings::drm_gem_is_imported(), should it
be annotated with #[inline] per the Rust coding guidelines?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261026-rust-drm-gem-shmem-imported-sgt-v1-0-36f15ace04b1@jannau.net?part=2

  reply	other threads:[~2026-10-26 11:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26 11:14 [PATCH 0/3] Fix import of dma-buf buffers as DRM GEM shmem objects Janne Grunau
2026-10-26 11:14 ` [PATCH 1/3] rust: drm: gem: shmem: implement gem_create_object for prime imports Janne Grunau
2026-10-26 11:14 ` [PATCH 2/3] rust: drm: gem: add an is_imported() accessor Janne Grunau
2026-10-26 11:53   ` sashiko-bot [this message]
2026-10-26 11:14 ` [PATCH 3/3] 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=sashiko-outbox-185127@kernel.org \
    --to=sashiko-bot@kernel.org \
    --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=j@jananu.net \
    --cc=j@jannau.net \
    --cc=lossin@kernel.org \
    --cc=lyude@redhat.com \
    --cc=nova-gpu@lists.linux.dev \
    --cc=ojeda@kernel.org \
    --cc=samitolvanen@google.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=simona@ffwll.ch \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --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