Re: [PATCH] gpu: nova-core: gsp: move Cmdq's DMA handle to a struct member
From: Alexandre Courbot
Date: Tue Mar 24 2026 - 03:24:06 EST
On Thu Mar 19, 2026 at 3:00 PM JST, Alexandre Courbot wrote:
> The command-queue structure has a `dma_handle` method that returns the
> DMA handle to the memory segment shared with the GSP. This works, but is
> not ideal for the following reasons:
>
> - That method is effectively only ever called once, and is technically
> an accessor method since the handle doesn't change over time,
> - It feels a bit out-of-place with the other methods of `Cmdq` which
> only deal with the sending or receiving of messages,
> - The method has `pub(crate)` visibility, allowing other driver code to
> access this highly-sensitive handle.
>
> Address all these issues by turning `dma_handle` into a struct member
> with `pub(super)` visibility. This keeps the method space focused, and
> also ensures the member is not visible outside of the modules that need
> it.
>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
Pushed to drm-rust-next, thanks!