[PATCH v3 07/13] drm/tyr: add shmem backing for GEM objects

From: Deborah Brouwer

Date: Mon Apr 13 2026 - 18:32:53 EST


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@xxxxxxxxxxxxx>
Signed-off-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>
Signed-off-by: Deborah Brouwer <deborah.brouwer@xxxxxxxxxxxxx>
---
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 11951b507b18..c6d4d6f9bae3 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::{
@@ -13,19 +17,27 @@
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<Ctx: DeviceContext>(
_dev: &TyrDrmDevice<Ctx>,
_size: usize,
- _args: Self::Args,
+ args: BoCreateArgs,
) -> impl PinInit<Self, Error> {
- try_pin_init!(BoData {})
+ try_pin_init!(Self { flags: args.flags })
}
}

--
2.53.0