<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/rust/kernel/drm, branch master</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>rust: drm: gem: shmem: Add DRM shmem helper abstraction</title>
<updated>2026-03-27T20:38:40+00:00</updated>
<author>
<name>Asahi Lina</name>
<email>lina@asahilina.net</email>
</author>
<published>2026-03-16T21:16:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=80df573af9ef3aa63e1bacb6e17d57a7cd69afe2'/>
<id>80df573af9ef3aa63e1bacb6e17d57a7cd69afe2</id>
<content type='text'>
The DRM shmem helper includes common code useful for drivers which
allocate GEM objects as anonymous shmem. Add a Rust abstraction for
this. Drivers can choose the raw GEM implementation or the shmem layer,
depending on their needs.

Signed-off-by: Asahi Lina &lt;lina@asahilina.net&gt;
Signed-off-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Reviewed-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Janne Grunau &lt;j@jananu.net&gt;
Tested-by: Deborah Brouwer &lt;deborah.brouwer@collabora.com&gt;
Link: https://patch.msgid.link/20260316211646.650074-6-lyude@redhat.com
[ * DRM_GEM_SHMEM_HELPER is a tristate; when a module driver selects it,
    it becomes =m. The Rust kernel crate and its C helpers are always
    built into vmlinux and can't reference symbols from a module,
    causing link errors.

    Thus, add RUST_DRM_GEM_SHMEM_HELPER bool Kconfig that selects
    DRM_GEM_SHMEM_HELPER, forcing it built-in when Rust drivers need it;
    use cfg(CONFIG_RUST_DRM_GEM_SHMEM_HELPER) for the shmem module.

  * Add cfg_attr(not(CONFIG_RUST_DRM_GEM_SHMEM_HELPER), expect(unused))
    on pub(crate) use impl_aref_for_gem_obj and BaseObjectPrivate, so
    that unused warnings are suppressed when shmem is not enabled.

  * Enable const_refs_to_static (stabilized in 1.83) to prevent build
    errors with older compilers.

  * Use &amp;raw const for bindings::drm_gem_shmem_vm_ops and add
    #[allow(unused_unsafe, reason = "Safe since Rust 1.82.0")].

  * Fix incorrect C Header path and minor spelling and formatting
    issues.

  * Drop shmem::Object::sg_table() as the current implementation is
    unsound.

    - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The DRM shmem helper includes common code useful for drivers which
allocate GEM objects as anonymous shmem. Add a Rust abstraction for
this. Drivers can choose the raw GEM implementation or the shmem layer,
depending on their needs.

Signed-off-by: Asahi Lina &lt;lina@asahilina.net&gt;
Signed-off-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Reviewed-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Janne Grunau &lt;j@jananu.net&gt;
Tested-by: Deborah Brouwer &lt;deborah.brouwer@collabora.com&gt;
Link: https://patch.msgid.link/20260316211646.650074-6-lyude@redhat.com
[ * DRM_GEM_SHMEM_HELPER is a tristate; when a module driver selects it,
    it becomes =m. The Rust kernel crate and its C helpers are always
    built into vmlinux and can't reference symbols from a module,
    causing link errors.

    Thus, add RUST_DRM_GEM_SHMEM_HELPER bool Kconfig that selects
    DRM_GEM_SHMEM_HELPER, forcing it built-in when Rust drivers need it;
    use cfg(CONFIG_RUST_DRM_GEM_SHMEM_HELPER) for the shmem module.

  * Add cfg_attr(not(CONFIG_RUST_DRM_GEM_SHMEM_HELPER), expect(unused))
    on pub(crate) use impl_aref_for_gem_obj and BaseObjectPrivate, so
    that unused warnings are suppressed when shmem is not enabled.

  * Enable const_refs_to_static (stabilized in 1.83) to prevent build
    errors with older compilers.

  * Use &amp;raw const for bindings::drm_gem_shmem_vm_ops and add
    #[allow(unused_unsafe, reason = "Safe since Rust 1.82.0")].

  * Fix incorrect C Header path and minor spelling and formatting
    issues.

  * Drop shmem::Object::sg_table() as the current implementation is
    unsound.

    - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: drm: gem: Add raw_dma_resv() function</title>
<updated>2026-03-27T20:37:45+00:00</updated>
<author>
<name>Lyude Paul</name>
<email>lyude@redhat.com</email>
</author>
<published>2026-03-16T21:16:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=89b4964c0456d9939a9f5187891a36bb87111e58'/>
<id>89b4964c0456d9939a9f5187891a36bb87111e58</id>
<content type='text'>
For retrieving a pointer to the struct dma_resv for a given GEM object. We
also introduce it in a new trait, BaseObjectPrivate, which we automatically
implement for all gem objects and don't expose to users outside of the
crate.

Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Janne Grunau &lt;j@jananu.net&gt;
Tested-by: Janne Grunau &lt;j@jannau.net&gt;
Tested-by: Deborah Brouwer &lt;deborah.brouwer@collabora.com&gt;
Link: https://patch.msgid.link/20260316211646.650074-3-lyude@redhat.com
[ Fix incorrect reference in safety comment. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For retrieving a pointer to the struct dma_resv for a given GEM object. We
also introduce it in a new trait, BaseObjectPrivate, which we automatically
implement for all gem objects and don't expose to users outside of the
crate.

Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Janne Grunau &lt;j@jananu.net&gt;
Tested-by: Janne Grunau &lt;j@jannau.net&gt;
Tested-by: Deborah Brouwer &lt;deborah.brouwer@collabora.com&gt;
Link: https://patch.msgid.link/20260316211646.650074-3-lyude@redhat.com
[ Fix incorrect reference in safety comment. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: drm: use new sync::aref path for imports</title>
<updated>2026-03-26T15:45:49+00:00</updated>
<author>
<name>Alice Ryhl</name>
<email>aliceryhl@google.com</email>
</author>
<published>2026-03-26T15:25:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bdf6b22fd52954f5ac88689eeaf960ac9687b78c'/>
<id>bdf6b22fd52954f5ac88689eeaf960ac9687b78c</id>
<content type='text'>
ARef and AlwaysRefCounted are being moved to sync::aref, and the
re-exports under types are planned to be removed. Thus, update imports
to the new path.

Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Link: https://patch.msgid.link/20260326-drm-rust-next-fix-aref-v1-2-7f6f58d2828a@google.com
Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ARef and AlwaysRefCounted are being moved to sync::aref, and the
re-exports under types are planned to be removed. Thus, update imports
to the new path.

Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Link: https://patch.msgid.link/20260326-drm-rust-next-fix-aref-v1-2-7f6f58d2828a@google.com
Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: drm: dispatch delayed work items to the private data</title>
<updated>2026-03-26T13:08:49+00:00</updated>
<author>
<name>Daniel Almeida</name>
<email>daniel.almeida@collabora.com</email>
</author>
<published>2026-03-23T23:27:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=206bada308d0d715d62ac841784af34a2ca22ff6'/>
<id>206bada308d0d715d62ac841784af34a2ca22ff6</id>
<content type='text'>
Much like the patch that dispatched (regular) work items, we also need to
dispatch delayed work items in order not to trigger the orphan rule. This
allows a drm::Device&lt;T&gt; to dispatch the delayed work to T::Data.

Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Signed-off-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Link: https://lore.kernel.org/r/20260323-aref-workitem-v3-4-f59729b812aa@collabora.com
Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Much like the patch that dispatched (regular) work items, we also need to
dispatch delayed work items in order not to trigger the orphan rule. This
allows a drm::Device&lt;T&gt; to dispatch the delayed work to T::Data.

Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Signed-off-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Link: https://lore.kernel.org/r/20260323-aref-workitem-v3-4-f59729b812aa@collabora.com
Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: drm: dispatch work items to the private data</title>
<updated>2026-03-26T13:08:48+00:00</updated>
<author>
<name>Daniel Almeida</name>
<email>daniel.almeida@collabora.com</email>
</author>
<published>2026-03-23T23:27:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=72a723df8decf70e04f799a6defda8bb62d41848'/>
<id>72a723df8decf70e04f799a6defda8bb62d41848</id>
<content type='text'>
This implementation dispatches any work enqueued on ARef&lt;drm::Device&lt;T&gt;&gt; to
its driver-provided handler. It does so by building upon the newly-added
ARef&lt;T&gt; support in workqueue.rs in order to call into the driver
implementations for work_container_of and raw_get_work.

This is notably important for work items that need access to the drm
device, as it was not possible to enqueue work on a ARef&lt;drm::Device&lt;T&gt;&gt;
previously without failing the orphan rule.

The current implementation needs T::Data to live inline with drm::Device in
order for work_container_of to function. This restriction is already
captured by the trait bounds. Drivers that need to share their ownership of
T::Data may trivially get around this:

// Lives inline in drm::Device
struct DataWrapper {
  work: ...,
  // Heap-allocated, shared ownership.
  data: Arc&lt;DriverData&gt;,
}

Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Signed-off-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Link: https://lore.kernel.org/r/20260323-aref-workitem-v3-2-f59729b812aa@collabora.com
Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This implementation dispatches any work enqueued on ARef&lt;drm::Device&lt;T&gt;&gt; to
its driver-provided handler. It does so by building upon the newly-added
ARef&lt;T&gt; support in workqueue.rs in order to call into the driver
implementations for work_container_of and raw_get_work.

This is notably important for work items that need access to the drm
device, as it was not possible to enqueue work on a ARef&lt;drm::Device&lt;T&gt;&gt;
previously without failing the orphan rule.

The current implementation needs T::Data to live inline with drm::Device in
order for work_container_of to function. This restriction is already
captured by the trait bounds. Drivers that need to share their ownership of
T::Data may trivially get around this:

// Lives inline in drm::Device
struct DataWrapper {
  work: ...,
  // Heap-allocated, shared ownership.
  data: Arc&lt;DriverData&gt;,
}

Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Signed-off-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Link: https://lore.kernel.org/r/20260323-aref-workitem-v3-2-f59729b812aa@collabora.com
Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: gem: Introduce DriverObject::Args</title>
<updated>2026-03-26T01:08:04+00:00</updated>
<author>
<name>Lyude Paul</name>
<email>lyude@redhat.com</email>
</author>
<published>2026-03-16T21:16:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=442ba16a5a51368f5bafd011609f40782aec6d65'/>
<id>442ba16a5a51368f5bafd011609f40782aec6d65</id>
<content type='text'>
This is an associated type that may be used in order to specify a
data-type to pass to gem objects when constructing them, allowing for
drivers to more easily initialize their private-data for gem objects.

Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Reviewed-by: Janne Grunau &lt;j@jananu.net&gt;
Tested-by: Deborah Brouwer &lt;deborah.brouwer@collabora.com&gt;
Link: https://patch.msgid.link/20260316211646.650074-5-lyude@redhat.com
[ Resolve merge conflicts in Tyr. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is an associated type that may be used in order to specify a
data-type to pass to gem objects when constructing them, allowing for
drivers to more easily initialize their private-data for gem objects.

Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Reviewed-by: Janne Grunau &lt;j@jananu.net&gt;
Tested-by: Deborah Brouwer &lt;deborah.brouwer@collabora.com&gt;
Link: https://patch.msgid.link/20260316211646.650074-5-lyude@redhat.com
[ Resolve merge conflicts in Tyr. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: drm: Add gem::impl_aref_for_gem_obj!</title>
<updated>2026-03-26T01:05:29+00:00</updated>
<author>
<name>Lyude Paul</name>
<email>lyude@redhat.com</email>
</author>
<published>2026-03-16T21:16:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e64b9cc293ae710c815c2de1ec9dcaa0784a8017'/>
<id>e64b9cc293ae710c815c2de1ec9dcaa0784a8017</id>
<content type='text'>
In the future we're going to be introducing more GEM object types in rust
then just gem::Object&lt;T&gt;. Since all types of GEM objects have refcounting,
let's introduce a macro that we can use in the gem crate in order to copy
this boilerplate implementation for each type: impl_aref_for_gem_obj!().

Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Reviewed-by: Janne Grunau &lt;j@jananu.net&gt;
Tested-by: Deborah Brouwer &lt;deborah.brouwer@collabora.com&gt;
Link: https://patch.msgid.link/20260316211646.650074-2-lyude@redhat.com
[ Resolve merge conflicts. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the future we're going to be introducing more GEM object types in rust
then just gem::Object&lt;T&gt;. Since all types of GEM objects have refcounting,
let's introduce a macro that we can use in the gem crate in order to copy
this boilerplate implementation for each type: impl_aref_for_gem_obj!().

Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Reviewed-by: Janne Grunau &lt;j@jananu.net&gt;
Tested-by: Deborah Brouwer &lt;deborah.brouwer@collabora.com&gt;
Link: https://patch.msgid.link/20260316211646.650074-2-lyude@redhat.com
[ Resolve merge conflicts. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust/drm: Remove imports covered by prelude::*</title>
<updated>2026-02-24T15:11:41+00:00</updated>
<author>
<name>Lyude Paul</name>
<email>lyude@redhat.com</email>
</author>
<published>2026-01-22T21:43:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6ad005ce6994599e2ae338007a54dd21063aae15'/>
<id>6ad005ce6994599e2ae338007a54dd21063aae15</id>
<content type='text'>
This just removes any explicit imports of items in files that are already
being pulled in by `use prelude::*;`.

There should be no functional changes in this patch.

Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Link: https://patch.msgid.link/20260122214316.3281257-2-lyude@redhat.com
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This just removes any explicit imports of items in files that are already
being pulled in by `use prelude::*;`.

There should be no functional changes in this patch.

Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Link: https://patch.msgid.link/20260122214316.3281257-2-lyude@redhat.com
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust/drm: Fixup import styles</title>
<updated>2026-02-24T15:10:09+00:00</updated>
<author>
<name>Lyude Paul</name>
<email>lyude@redhat.com</email>
</author>
<published>2026-01-22T21:43:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b7a124928b5875675539b6a6f708f56911f271f7'/>
<id>b7a124928b5875675539b6a6f708f56911f271f7</id>
<content type='text'>
This is to match
  https://docs.kernel.org/rust/coding-guidelines.html#imports

There should be no functional changes in this patch.

Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Link: https://patch.msgid.link/20260122214316.3281257-1-lyude@redhat.com
[ Move trailing `//` at the end. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is to match
  https://docs.kernel.org/rust/coding-guidelines.html#imports

There should be no functional changes in this patch.

Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Link: https://patch.msgid.link/20260122214316.3281257-1-lyude@redhat.com
[ Move trailing `//` at the end. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust/drm: Fix Registration::{new,new_foreign_owned}() docs</title>
<updated>2026-01-23T19:18:07+00:00</updated>
<author>
<name>Lyude Paul</name>
<email>lyude@redhat.com</email>
</author>
<published>2026-01-22T22:10:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=638eeda8abaa3e6afe6bd5758ef8045a7f33b9a0'/>
<id>638eeda8abaa3e6afe6bd5758ef8045a7f33b9a0</id>
<content type='text'>
Looks like we've actually had a malformed rustdoc reference in the rustdocs
for Registration::new_foreign_owned() for a while that, when fixed, still
couldn't resolve properly because it refers to a private item.

This is probably leftover from when Registration::new() was public, so drop
the documentation from that function and fixup the documentation for
Registration::new_foreign_owned().

Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Fixes: 0600032c54b7 ("rust: drm: add DRM driver registration")
Cc: &lt;stable@vger.kernel.org&gt; # v6.16+
Link: https://patch.msgid.link/20260122221037.3462081-1-lyude@redhat.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Looks like we've actually had a malformed rustdoc reference in the rustdocs
for Registration::new_foreign_owned() for a while that, when fixed, still
couldn't resolve properly because it refers to a private item.

This is probably leftover from when Registration::new() was public, so drop
the documentation from that function and fixup the documentation for
Registration::new_foreign_owned().

Signed-off-by: Lyude Paul &lt;lyude@redhat.com&gt;
Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Fixes: 0600032c54b7 ("rust: drm: add DRM driver registration")
Cc: &lt;stable@vger.kernel.org&gt; # v6.16+
Link: https://patch.msgid.link/20260122221037.3462081-1-lyude@redhat.com
</pre>
</div>
</content>
</entry>
</feed>
