<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/rust/kernel/drm/gem, branch master</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.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.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.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.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: 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.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.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.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.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: Improve safety comment when using `Pin::into_inner_unchecked`</title>
<updated>2026-01-06T22:30:28+00:00</updated>
<author>
<name>Ewan Chorynski</name>
<email>ewan.chorynski@ik.me</email>
</author>
<published>2025-12-28T16:15:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4348796233e736147e2e79c58784d0a9fb48867d'/>
<id>4348796233e736147e2e79c58784d0a9fb48867d</id>
<content type='text'>
The safety requirements for `Pin::into_inner_unchecked` state that the
returned pointer must be treated as pinned until it is dropped. Such a
guarantee is provided by the `ARef` type. This patch improves the safety
comment to better reflect this.

Signed-off-by: Ewan Chorynski &lt;ewan.chorynski@ik.me&gt;
Link: https://patch.msgid.link/20251228-drm-gem-safety-comment-v2-1-99bb861c3371@ik.me
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The safety requirements for `Pin::into_inner_unchecked` state that the
returned pointer must be treated as pinned until it is dropped. Such a
guarantee is provided by the `ARef` type. This patch improves the safety
comment to better reflect this.

Signed-off-by: Ewan Chorynski &lt;ewan.chorynski@ik.me&gt;
Link: https://patch.msgid.link/20251228-drm-gem-safety-comment-v2-1-99bb861c3371@ik.me
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: drm: use `pin_init::zeroed()` for file operations initialization</title>
<updated>2025-12-18T08:17:04+00:00</updated>
<author>
<name>Atharv Dubey</name>
<email>atharvd440@gmail.com</email>
</author>
<published>2025-12-01T15:27:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=97cf6bc0abd381fd84e5d8e978322a62a58fb00e'/>
<id>97cf6bc0abd381fd84e5d8e978322a62a58fb00e</id>
<content type='text'>
Replace the manual `unsafe { core::mem::zeroed() }` initialization of
`bindings::file_operations` with `pin_init::zeroed()`. This removes the
explicit unsafe

Signed-off-by: Atharv Dubey &lt;atharvd440@gmail.com&gt;
Link: https://patch.msgid.link/20251201152759.16429-1-atharvd440@gmail.com
Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace the manual `unsafe { core::mem::zeroed() }` initialization of
`bindings::file_operations` with `pin_init::zeroed()`. This removes the
explicit unsafe

Signed-off-by: Atharv Dubey &lt;atharvd440@gmail.com&gt;
Link: https://patch.msgid.link/20251201152759.16429-1-atharvd440@gmail.com
Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: drm: Update AlwaysRefCounted imports to use sync::aref</title>
<updated>2025-12-18T07:51:57+00:00</updated>
<author>
<name>Shankari Anand</name>
<email>shankari.ak0208@gmail.com</email>
</author>
<published>2025-11-23T09:24:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a625a898ea8f74ca0bb55c6e0c2fcff80edb1068'/>
<id>a625a898ea8f74ca0bb55c6e0c2fcff80edb1068</id>
<content type='text'>
Update call sites to import `AlwaysRefCounted`
from `sync::aref` instead of `types`.

This aligns with the ongoing effort to move `ARef` and
`AlwaysRefCounted` to sync.

Suggested-by: Benno Lossin &lt;lossin@kernel.org&gt;
Link: https://github.com/Rust-for-Linux/linux/issues/1173
Signed-off-by: Shankari Anand &lt;shankari.ak0208@gmail.com&gt;
Link: https://patch.msgid.link/20251123092438.182251-5-shankari.ak0208@gmail.com
Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update call sites to import `AlwaysRefCounted`
from `sync::aref` instead of `types`.

This aligns with the ongoing effort to move `ARef` and
`AlwaysRefCounted` to sync.

Suggested-by: Benno Lossin &lt;lossin@kernel.org&gt;
Link: https://github.com/Rust-for-Linux/linux/issues/1173
Signed-off-by: Shankari Anand &lt;shankari.ak0208@gmail.com&gt;
Link: https://patch.msgid.link/20251123092438.182251-5-shankari.ak0208@gmail.com
Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
