[PATCH 0/7] rust: dma: add from-slice constructors and use them in nova-core

Alexandre Courbot posted 7 patches 1 week, 6 days ago
There is a newer version of this series
drivers/gpu/nova-core/dma.rs                       |  53 -----------
drivers/gpu/nova-core/falcon.rs                    |   6 +-
drivers/gpu/nova-core/fb.rs                        |   6 +-
drivers/gpu/nova-core/firmware/fwsec/bootloader.rs |   6 +-
drivers/gpu/nova-core/firmware/gsp.rs              |  27 +++---
drivers/gpu/nova-core/firmware/riscv.rs            |   6 +-
drivers/gpu/nova-core/nova_core.rs                 |   1 -
rust/kernel/dma.rs                                 | 102 +++++++++++++++++++++
8 files changed, 129 insertions(+), 78 deletions(-)
[PATCH 0/7] rust: dma: add from-slice constructors and use them in nova-core
Posted by Alexandre Courbot 1 week, 6 days ago
nova-core's `DmaObject` type has been created to serve the same purpose
as `dma::Coherent`, with the addition of a handy constructor to create
an object from a slice of bytes, but without the flexibility of
`dma::Coherent` since `DmaObject` is limited to slices of bytes.

This series adds new constructors to `Coherent` and `CoherentBox` to
cover this (arguably common) use-case, and updates the nova-core code to
use them. This results in more consistent code overall, and allows us to
retire `DmaObject` and nova-core's `dma` module.

Depends on drm-rust-next as of 2026-03-21 + [1].

[1] https://lore.kernel.org/all/20260320194626.36263-1-dakr@kernel.org/

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
Alexandre Courbot (7):
      rust: dma: add from-slice constructors for Coherent and CoherentBox
      gpu: nova-core: firmware: riscv: use dma::Coherent
      gpu: nova-core: firmware: fwsec: use dma::Coherent
      gpu: nova-core: falcon: use dma::Coherent
      gpu: nova-core: fb: use dma::Coherent
      gpu: nova-core: firmware: gsp: use dma::Coherent for signatures
      gpu: nova-core: firmware: gsp: use dma::Coherent for level0 table

 drivers/gpu/nova-core/dma.rs                       |  53 -----------
 drivers/gpu/nova-core/falcon.rs                    |   6 +-
 drivers/gpu/nova-core/fb.rs                        |   6 +-
 drivers/gpu/nova-core/firmware/fwsec/bootloader.rs |   6 +-
 drivers/gpu/nova-core/firmware/gsp.rs              |  27 +++---
 drivers/gpu/nova-core/firmware/riscv.rs            |   6 +-
 drivers/gpu/nova-core/nova_core.rs                 |   1 -
 rust/kernel/dma.rs                                 | 102 +++++++++++++++++++++
 8 files changed, 129 insertions(+), 78 deletions(-)
---
base-commit: 19761c783a46bc4fb2ba0ef22111f7dd27b441e6
change-id: 20260321-b4-nova-dma-removal-a7e88d4a6790

Best regards,
-- 
Alexandre Courbot <acourbot@nvidia.com>
Re: [PATCH 0/7] rust: dma: add from-slice constructors and use them in nova-core
Posted by Gary Guo 1 week, 4 days ago
On Sat Mar 21, 2026 at 1:36 PM GMT, Alexandre Courbot wrote:
> nova-core's `DmaObject` type has been created to serve the same purpose
> as `dma::Coherent`, with the addition of a handy constructor to create
> an object from a slice of bytes, but without the flexibility of
> `dma::Coherent` since `DmaObject` is limited to slices of bytes.
>
> This series adds new constructors to `Coherent` and `CoherentBox` to
> cover this (arguably common) use-case, and updates the nova-core code to
> use them. This results in more consistent code overall, and allows us to
> retire `DmaObject` and nova-core's `dma` module.
>
> Depends on drm-rust-next as of 2026-03-21 + [1].
>
> [1] https://lore.kernel.org/all/20260320194626.36263-1-dakr@kernel.org/
>
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>

Looks like a good cleanup. For the series (with nits fixed in first patch):

Reviewed-by: Gary Guo <gary@garyguo.net>

Best,
Gary

> ---
> Alexandre Courbot (7):
>       rust: dma: add from-slice constructors for Coherent and CoherentBox
>       gpu: nova-core: firmware: riscv: use dma::Coherent
>       gpu: nova-core: firmware: fwsec: use dma::Coherent
>       gpu: nova-core: falcon: use dma::Coherent
>       gpu: nova-core: fb: use dma::Coherent
>       gpu: nova-core: firmware: gsp: use dma::Coherent for signatures
>       gpu: nova-core: firmware: gsp: use dma::Coherent for level0 table
>
>  drivers/gpu/nova-core/dma.rs                       |  53 -----------
>  drivers/gpu/nova-core/falcon.rs                    |   6 +-
>  drivers/gpu/nova-core/fb.rs                        |   6 +-
>  drivers/gpu/nova-core/firmware/fwsec/bootloader.rs |   6 +-
>  drivers/gpu/nova-core/firmware/gsp.rs              |  27 +++---
>  drivers/gpu/nova-core/firmware/riscv.rs            |   6 +-
>  drivers/gpu/nova-core/nova_core.rs                 |   1 -
>  rust/kernel/dma.rs                                 | 102 +++++++++++++++++++++
>  8 files changed, 129 insertions(+), 78 deletions(-)
> ---
> base-commit: 19761c783a46bc4fb2ba0ef22111f7dd27b441e6
> change-id: 20260321-b4-nova-dma-removal-a7e88d4a6790
>
> Best regards,