On Fri, 27 Feb 2026 16:17:35 -0800
Deborah Brouwer <[email protected]> wrote:

> On Fri, Feb 20, 2026 at 11:25:47AM -0300, Daniel Almeida wrote:
> > 
> >   
> > > On 11 Feb 2026, at 22:37, Deborah Brouwer <[email protected]> 
> > > wrote:
> > > 
> > > 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. A new_dummy_object()
> > > helper is provided to create a dummy GEM object for use as a GPUVM root.
> > > 
> > > The Bo type alias is added to simplify working with Tyr's shmem-backed
> > > GEM objects throughout the driver.
> > > 
> > > Co-developed-by: Boris Brezillon <[email protected]>
> > > Signed-off-by: Boris Brezillon <[email protected]>
> > > Signed-off-by: Deborah Brouwer <[email protected]>
> > > ---
> > > drivers/gpu/drm/tyr/gem.rs | 52 ++++++++++++++++++++++++++++++++------
> > > 1 file changed, 44 insertions(+), 8 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/tyr/gem.rs b/drivers/gpu/drm/tyr/gem.rs
> > > index c1208d332dea..6a58f2da88d3 100644
> > > --- a/drivers/gpu/drm/tyr/gem.rs
> > > +++ b/drivers/gpu/drm/tyr/gem.rs
> > > @@ -1,28 +1,64 @@
> > > // 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,
> > > +        gem::shmem,
> > >         DeviceContext, //
> > >     },
> > > -    prelude::*, //
> > > +    prelude::*,
> > > +    sync::aref::ARef, //
> > > };
> > > 
> > > -use crate::driver::TyrDrmDriver;
> > > +use crate::driver::{
> > > +    TyrDrmDevice,
> > > +    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: &kernel::drm::Device<TyrDrmDriver, Ctx>,
> > > +        _dev: &TyrDrmDevice<Ctx>,  
> > 
> > Unrelated change?  
> 
> I switched to use the convenience type alias `TyrDrmDevice<Ctx>`
> here instead of using its full path. I can flag that in the commit
> mesage if that is what you mean?

I'd probably do that in a separate commit, like Daniel suggested, even
if that means introducing a one-line commit just for that cosmetic
change.

Reply via email to