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 { - try_pin_init!(BoData {}) + fn new(_dev: &TyrDrmDevice, _size: usize, args: BoCreateArgs) -> impl PinInit { + try_pin_init!(Self { flags: args.flags }) } }