* [PATCH 1/5] drm/tyr: move clock cleanup into Clocks Drop impl
2026-04-28 19:19 [PATCH 0/5] drm/tyr: prereqs for firmware loading and MCU boot Deborah Brouwer
@ 2026-04-28 19:19 ` Deborah Brouwer
2026-04-28 19:19 ` [PATCH 2/5] drm/tyr: rename TyrObject to BoData Deborah Brouwer
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Deborah Brouwer @ 2026-04-28 19:19 UTC (permalink / raw)
To: Danilo Krummrich, Alice Ryhl, Daniel Almeida, David Airlie,
Simona Vetter, Benno Lossin, Gary Guo, Miguel Ojeda, Boqun Feng,
Björn Roy Baron, Andreas Hindborg, Trevor Gross
Cc: dri-devel, linux-kernel, rust-for-linux, boris.brezillon,
beata.michalska, work, alvin.sun, Deborah Brouwer
Currently Tyr disables its clocks from TyrDrmDeviceData::drop(), which
causes them to be shut down before any other fields in TyrDrmDeviceData
are dropped. This prevents us from using the clocks when dropping the
other fields in TyrDrmDeviceData.
In order to better control when the clocks are dropped, move this cleanup
logic into a Drop implementation on the Clocks struct itself.
Since it serves no further purpose, remove the PinnedDrop implementation
for TyrDrmDeviceData.
Also, while here, remove the #[pin_data] annotation from both the struct
Clocks and struct Regulators since neither of these structs need this
macro to create structurally pinned fields.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
---
drivers/gpu/drm/tyr/driver.rs | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
index e8acd2d69468..bb56a9b996a0 100644
--- a/drivers/gpu/drm/tyr/driver.rs
+++ b/drivers/gpu/drm/tyr/driver.rs
@@ -52,7 +52,7 @@ pub(crate) struct TyrPlatformDriverData {
_device: ARef<TyrDrmDevice>,
}
-#[pin_data(PinnedDrop)]
+#[pin_data]
pub(crate) struct TyrDrmDeviceData {
pub(crate) pdev: ARef<platform::Device>,
@@ -157,17 +157,6 @@ impl PinnedDrop for TyrPlatformDriverData {
fn drop(self: Pin<&mut Self>) {}
}
-#[pinned_drop]
-impl PinnedDrop for TyrDrmDeviceData {
- fn drop(self: Pin<&mut Self>) {
- // TODO: the type-state pattern for Clks will fix this.
- let clks = self.clks.lock();
- clks.core.disable_unprepare();
- clks.stacks.disable_unprepare();
- clks.coregroup.disable_unprepare();
- }
-}
-
// We need to retain the name "panthor" to achieve drop-in compatibility with
// the C driver in the userspace stack.
const INFO: drm::DriverInfo = drm::DriverInfo {
@@ -191,14 +180,20 @@ impl drm::Driver for TyrDrmDriver {
}
}
-#[pin_data]
struct Clocks {
core: Clk,
stacks: OptionalClk,
coregroup: OptionalClk,
}
-#[pin_data]
+impl Drop for Clocks {
+ fn drop(&mut self) {
+ self.core.disable_unprepare();
+ self.stacks.disable_unprepare();
+ self.coregroup.disable_unprepare();
+ }
+}
+
struct Regulators {
_mali: Regulator<regulator::Enabled>,
_sram: Regulator<regulator::Enabled>,
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 2/5] drm/tyr: rename TyrObject to BoData
2026-04-28 19:19 [PATCH 0/5] drm/tyr: prereqs for firmware loading and MCU boot Deborah Brouwer
2026-04-28 19:19 ` [PATCH 1/5] drm/tyr: move clock cleanup into Clocks Drop impl Deborah Brouwer
@ 2026-04-28 19:19 ` Deborah Brouwer
2026-04-28 19:19 ` [PATCH 3/5] drm/tyr: use shmem GEM object type in TyrDrmDriver Deborah Brouwer
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Deborah Brouwer @ 2026-04-28 19:19 UTC (permalink / raw)
To: Danilo Krummrich, Alice Ryhl, Daniel Almeida, David Airlie,
Simona Vetter, Benno Lossin, Gary Guo, Miguel Ojeda, Boqun Feng,
Björn Roy Baron, Andreas Hindborg, Trevor Gross
Cc: dri-devel, linux-kernel, rust-for-linux, boris.brezillon,
beata.michalska, work, alvin.sun, Deborah Brouwer
From: Boris Brezillon <boris.brezillon@collabora.com>
Currently the GEM inner driver data object is called `TyrObject` which
is a fairly generic name. To make the code easier to understand,
rename `TyrObject` to `BoData` so that the name better reflects its
role.
No functional change is intended.
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-developed-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
---
drivers/gpu/drm/tyr/driver.rs | 4 ++--
drivers/gpu/drm/tyr/gem.rs | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
index bb56a9b996a0..bb90324043ed 100644
--- a/drivers/gpu/drm/tyr/driver.rs
+++ b/drivers/gpu/drm/tyr/driver.rs
@@ -34,7 +34,7 @@
use crate::{
file::TyrDrmFileData,
- gem::TyrObject,
+ gem::BoData,
gpu,
gpu::GpuInfo,
regs::gpu_control::*, //
@@ -171,7 +171,7 @@ fn drop(self: Pin<&mut Self>) {}
impl drm::Driver for TyrDrmDriver {
type Data = TyrDrmDeviceData;
type File = TyrDrmFileData;
- type Object = drm::gem::Object<TyrObject>;
+ type Object = drm::gem::Object<BoData>;
const INFO: drm::DriverInfo = INFO;
diff --git a/drivers/gpu/drm/tyr/gem.rs b/drivers/gpu/drm/tyr/gem.rs
index 5cc6eb0b5d3f..66c427a16c31 100644
--- a/drivers/gpu/drm/tyr/gem.rs
+++ b/drivers/gpu/drm/tyr/gem.rs
@@ -12,13 +12,13 @@
/// GEM Object inner driver data
#[pin_data]
-pub(crate) struct TyrObject {}
+pub(crate) struct BoData {}
-impl gem::DriverObject for TyrObject {
+impl gem::DriverObject for BoData {
type Driver = TyrDrmDriver;
type Args = ();
fn new(_dev: &TyrDrmDevice, _size: usize, _args: ()) -> impl PinInit<Self, Error> {
- try_pin_init!(TyrObject {})
+ try_pin_init!(BoData {})
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 3/5] drm/tyr: use shmem GEM object type in TyrDrmDriver
2026-04-28 19:19 [PATCH 0/5] drm/tyr: prereqs for firmware loading and MCU boot Deborah Brouwer
2026-04-28 19:19 ` [PATCH 1/5] drm/tyr: move clock cleanup into Clocks Drop impl Deborah Brouwer
2026-04-28 19:19 ` [PATCH 2/5] drm/tyr: rename TyrObject to BoData Deborah Brouwer
@ 2026-04-28 19:19 ` Deborah Brouwer
2026-04-28 19:19 ` [PATCH 4/5] drm/tyr: set DMA mask using GPU physical address Deborah Brouwer
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Deborah Brouwer @ 2026-04-28 19:19 UTC (permalink / raw)
To: Danilo Krummrich, Alice Ryhl, Daniel Almeida, David Airlie,
Simona Vetter, Benno Lossin, Gary Guo, Miguel Ojeda, Boqun Feng,
Björn Roy Baron, Andreas Hindborg, Trevor Gross
Cc: dri-devel, linux-kernel, rust-for-linux, boris.brezillon,
beata.michalska, work, alvin.sun, Deborah Brouwer
From: Alvin Sun <alvin.sun@linux.dev>
Tyr buffer objects are shmem-backed, so the driver should use
drm::gem::shmem::Object<BoData> as its GEM object type instead of the base
drm::gem::Object<BoData> type.
Switching to the shmem GEM object type matches how Tyr allocates and
manages its buffer objects, and uses the shmem-specific GEM abstraction
provided by the DRM Rust bindings.
Select RUST_DRM_GEM_SHMEM_HELPER to ensure the required helpers are
available when DRM_TYR is enabled.
Signed-off-by: Alvin Sun <alvin.sun@linux.dev>
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
---
drivers/gpu/drm/tyr/Kconfig | 1 +
drivers/gpu/drm/tyr/driver.rs | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tyr/Kconfig b/drivers/gpu/drm/tyr/Kconfig
index e933e6478027..51a68ef8212c 100644
--- a/drivers/gpu/drm/tyr/Kconfig
+++ b/drivers/gpu/drm/tyr/Kconfig
@@ -8,6 +8,7 @@ config DRM_TYR
depends on !GENERIC_ATOMIC64 # for IOMMU_IO_PGTABLE_LPAE
depends on COMMON_CLK
default n
+ select RUST_DRM_GEM_SHMEM_HELPER
help
Rust DRM driver for ARM Mali CSF-based GPUs.
diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
index bb90324043ed..cdb9b13bdb32 100644
--- a/drivers/gpu/drm/tyr/driver.rs
+++ b/drivers/gpu/drm/tyr/driver.rs
@@ -171,7 +171,7 @@ fn drop(self: Pin<&mut Self>) {}
impl drm::Driver for TyrDrmDriver {
type Data = TyrDrmDeviceData;
type File = TyrDrmFileData;
- type Object = drm::gem::Object<BoData>;
+ type Object = drm::gem::shmem::Object<BoData>;
const INFO: drm::DriverInfo = INFO;
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 4/5] drm/tyr: set DMA mask using GPU physical address
2026-04-28 19:19 [PATCH 0/5] drm/tyr: prereqs for firmware loading and MCU boot Deborah Brouwer
` (2 preceding siblings ...)
2026-04-28 19:19 ` [PATCH 3/5] drm/tyr: use shmem GEM object type in TyrDrmDriver Deborah Brouwer
@ 2026-04-28 19:19 ` Deborah Brouwer
2026-04-28 19:19 ` [PATCH 5/5] drm/tyr: add shmem backing for GEM objects Deborah Brouwer
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Deborah Brouwer @ 2026-04-28 19:19 UTC (permalink / raw)
To: Danilo Krummrich, Alice Ryhl, Daniel Almeida, David Airlie,
Simona Vetter, Benno Lossin, Gary Guo, Miguel Ojeda, Boqun Feng,
Björn Roy Baron, Andreas Hindborg, Trevor Gross
Cc: dri-devel, linux-kernel, rust-for-linux, boris.brezillon,
beata.michalska, work, alvin.sun, Deborah Brouwer
From: Beata Michalska <beata.michalska@arm.com>
Configure the device DMA mask during probe using the GPU's physical
address capability reported in GpuInfo. This ensures DMA allocations
use an appropriate address mask.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Beata Michalska <beata.michalska@arm.com>
Co-developed-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
---
drivers/gpu/drm/tyr/driver.rs | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
index cdb9b13bdb32..e20a5978eed6 100644
--- a/drivers/gpu/drm/tyr/driver.rs
+++ b/drivers/gpu/drm/tyr/driver.rs
@@ -11,6 +11,10 @@
Device, //
},
devres::Devres,
+ dma::{
+ Device as DmaDevice,
+ DmaMask, //
+ },
drm,
drm::ioctl,
io::{
@@ -124,6 +128,14 @@ fn probe(
let gpu_info = GpuInfo::new(pdev.as_ref(), &iomem)?;
gpu_info.log(pdev.as_ref());
+ let pa_bits = MMU_FEATURES::from_raw(gpu_info.mmu_features)
+ .pa_bits()
+ .get();
+ // SAFETY: No concurrent DMA allocations or mappings can be made because
+ // the device is still being probed and therefore isn't being used by
+ // other threads of execution.
+ unsafe { pdev.dma_set_mask_and_coherent(DmaMask::try_new(pa_bits)?)? };
+
let platform: ARef<platform::Device> = pdev.into();
let data = try_pin_init!(TyrDrmDeviceData {
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 5/5] drm/tyr: add shmem backing for GEM objects
2026-04-28 19:19 [PATCH 0/5] drm/tyr: prereqs for firmware loading and MCU boot Deborah Brouwer
` (3 preceding siblings ...)
2026-04-28 19:19 ` [PATCH 4/5] drm/tyr: set DMA mask using GPU physical address Deborah Brouwer
@ 2026-04-28 19:19 ` Deborah Brouwer
2026-04-29 6:08 ` [PATCH 0/5] drm/tyr: prereqs for firmware loading and MCU boot Alice Ryhl
2026-05-01 11:04 ` Alice Ryhl
6 siblings, 0 replies; 8+ messages in thread
From: Deborah Brouwer @ 2026-04-28 19:19 UTC (permalink / raw)
To: Danilo Krummrich, Alice Ryhl, Daniel Almeida, David Airlie,
Simona Vetter, Benno Lossin, Gary Guo, Miguel Ojeda, Boqun Feng,
Björn Roy Baron, Andreas Hindborg, Trevor Gross
Cc: dri-devel, linux-kernel, rust-for-linux, boris.brezillon,
beata.michalska, work, alvin.sun, Deborah Brouwer
Add support for GEM buffer objects backed by shared memory.
This introduces the BoCreateArgs structure for passing creation parameters
including flags, and adds a flags field to BoData.
Co-developed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
---
drivers/gpu/drm/tyr/gem.rs | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/tyr/gem.rs b/drivers/gpu/drm/tyr/gem.rs
index 66c427a16c31..1640a161754b 100644
--- a/drivers/gpu/drm/tyr/gem.rs
+++ b/drivers/gpu/drm/tyr/gem.rs
@@ -1,4 +1,8 @@
// SPDX-License-Identifier: GPL-2.0 or MIT
+//! GEM buffer object management for the Tyr driver.
+//!
+//! This module provides buffer object (BO) management functionality using
+//! DRM's GEM subsystem with shmem backing.
use kernel::{
drm::gem,
@@ -10,15 +14,23 @@
TyrDrmDriver, //
};
-/// GEM Object inner driver data
+/// Tyr's DriverObject type for GEM objects.
#[pin_data]
-pub(crate) struct BoData {}
+pub(crate) struct BoData {
+ flags: u32,
+}
+
+/// Provides a way to pass arguments when creating BoData
+/// as required by the gem::DriverObject trait.
+pub(crate) struct BoCreateArgs {
+ flags: u32,
+}
impl gem::DriverObject for BoData {
type Driver = TyrDrmDriver;
- type Args = ();
+ type Args = BoCreateArgs;
- fn new(_dev: &TyrDrmDevice, _size: usize, _args: ()) -> impl PinInit<Self, Error> {
- try_pin_init!(BoData {})
+ fn new(_dev: &TyrDrmDevice, _size: usize, args: BoCreateArgs) -> impl PinInit<Self, Error> {
+ try_pin_init!(Self { flags: args.flags })
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 0/5] drm/tyr: prereqs for firmware loading and MCU boot
2026-04-28 19:19 [PATCH 0/5] drm/tyr: prereqs for firmware loading and MCU boot Deborah Brouwer
` (4 preceding siblings ...)
2026-04-28 19:19 ` [PATCH 5/5] drm/tyr: add shmem backing for GEM objects Deborah Brouwer
@ 2026-04-29 6:08 ` Alice Ryhl
2026-05-01 11:04 ` Alice Ryhl
6 siblings, 0 replies; 8+ messages in thread
From: Alice Ryhl @ 2026-04-29 6:08 UTC (permalink / raw)
To: Deborah Brouwer
Cc: Danilo Krummrich, Daniel Almeida, David Airlie, Simona Vetter,
Benno Lossin, Gary Guo, Miguel Ojeda, Boqun Feng,
Björn Roy Baron, Andreas Hindborg, Trevor Gross, dri-devel,
linux-kernel, rust-for-linux, boris.brezillon, beata.michalska,
work, alvin.sun
On Tue, Apr 28, 2026 at 9:20 PM Deborah Brouwer
<deborah.brouwer@collabora.com> wrote:
>
> This series extracts patches from the Tyr firmware boot series that have
> no additional prerequisites and can be applied directly to drm-rust-next.
>
> Most of the patches are unchanged from the fw-boot series, except
> "drm/tyr: use shmem GEM object type in TyrDrmDriver"
> which now also selects RUST_DRM_GEM_SHMEM_HELPER in Kconfig.
>
> Link to [PATCH v4 00/20] drm/tyr: firmware loading and MCU boot support
> - https://lore.kernel.org/rust-for-linux/20260424-b4-fw-boot-v4-v4-0-a5d91050789d@collabora.com/
>
> Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
> ---
> Alvin Sun (1):
> drm/tyr: use shmem GEM object type in TyrDrmDriver
>
> Beata Michalska (1):
> drm/tyr: set DMA mask using GPU physical address
>
> Boris Brezillon (1):
> drm/tyr: rename TyrObject to BoData
>
> Deborah Brouwer (2):
> drm/tyr: move clock cleanup into Clocks Drop impl
> drm/tyr: add shmem backing for GEM objects
These commits look good to me. I will pick them up in a few days
unless anybody else complains.
Alice
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 0/5] drm/tyr: prereqs for firmware loading and MCU boot
2026-04-28 19:19 [PATCH 0/5] drm/tyr: prereqs for firmware loading and MCU boot Deborah Brouwer
` (5 preceding siblings ...)
2026-04-29 6:08 ` [PATCH 0/5] drm/tyr: prereqs for firmware loading and MCU boot Alice Ryhl
@ 2026-05-01 11:04 ` Alice Ryhl
6 siblings, 0 replies; 8+ messages in thread
From: Alice Ryhl @ 2026-05-01 11:04 UTC (permalink / raw)
To: Deborah Brouwer
Cc: Danilo Krummrich, Daniel Almeida, David Airlie, Simona Vetter,
Benno Lossin, Gary Guo, Miguel Ojeda, Boqun Feng,
Björn Roy Baron, Andreas Hindborg, Trevor Gross, dri-devel,
linux-kernel, rust-for-linux, boris.brezillon, beata.michalska,
work, alvin.sun
On Tue, Apr 28, 2026 at 9:20 PM Deborah Brouwer
<deborah.brouwer@collabora.com> wrote:
>
> This series extracts patches from the Tyr firmware boot series that have
> no additional prerequisites and can be applied directly to drm-rust-next.
>
> Most of the patches are unchanged from the fw-boot series, except
> "drm/tyr: use shmem GEM object type in TyrDrmDriver"
> which now also selects RUST_DRM_GEM_SHMEM_HELPER in Kconfig.
>
> Link to [PATCH v4 00/20] drm/tyr: firmware loading and MCU boot support
> - https://lore.kernel.org/rust-for-linux/20260424-b4-fw-boot-v4-v4-0-a5d91050789d@collabora.com/
>
> Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
> ---
> Alvin Sun (1):
> drm/tyr: use shmem GEM object type in TyrDrmDriver
>
> Beata Michalska (1):
> drm/tyr: set DMA mask using GPU physical address
>
> Boris Brezillon (1):
> drm/tyr: rename TyrObject to BoData
>
> Deborah Brouwer (2):
> drm/tyr: move clock cleanup into Clocks Drop impl
> drm/tyr: add shmem backing for GEM objects
>
> drivers/gpu/drm/tyr/Kconfig | 1 +
> drivers/gpu/drm/tyr/driver.rs | 39 +++++++++++++++++++++++----------------
> drivers/gpu/drm/tyr/gem.rs | 24 ++++++++++++++++++------
> 3 files changed, 42 insertions(+), 22 deletions(-)
Applied to drm-rust-next. Thanks!
^ permalink raw reply [flat|nested] 8+ messages in thread