public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/10] gpu: nova-core: convert registers to use the kernel register macro
@ 2026-03-23 11:07 Alexandre Courbot
  2026-03-23 11:07 ` [PATCH v3 01/10] gpu: nova-core: convert PMC registers to " Alexandre Courbot
                   ` (9 more replies)
  0 siblings, 10 replies; 17+ messages in thread
From: Alexandre Courbot @ 2026-03-23 11:07 UTC (permalink / raw)
  To: Danilo Krummrich, Alice Ryhl, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Trevor Gross
  Cc: John Hubbard, Alistair Popple, Joel Fernandes, Timur Tabi,
	Zhi Wang, Eliot Courtney, dri-devel, linux-kernel, linux-riscv,
	linux-doc, rust-for-linux, Alexandre Courbot

nova-core carried its own helper macro to declare register types. Its
purpose was to be temporary since the beginning, and to serve as a
testbed to develop an equivalent that could be used kernel-wide.

That equivalent has now been merged, so it is time to retire the
nova-core local version.

The kernel register macro has evolved into something significantly
different from the one in nova-core, so it cannot be used as a drop-in
replacement. All declarations and sites using registers need to be
updated. No semantic change should happen as a result.

All the patches in this series could also be squashed into a single one
without altering their reviewability significantly.

I hope to be able to merge this quickly so we can rebase in-flight
series to use the updated register syntax.

This series is based on drm-rust-next as of 2026-03-23 and has been
tested on Turing.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
Changes in v3:
- Remove obsolete part of PMC commit message.
- Add { } brackets around const expression used in `Bounded`
  constructor.
- Use `MAX..` arm to `bounded_enum` to catch missing values in the
  required range of the `From` implementation. (thanks Gary!)
- Remove unneeded const asserts that are already caught by `Bounded::new`.
- Link to v2: https://patch.msgid.link/20260320-b4-nova-register-v2-0-88fcf103e8d4@nvidia.com

Changes in v2:
- Reorder register fields in descending order.
- Drop `nv_reg` macro and use the kernel `register` macro directly.
- Make `FUSE_UCODE1_VERSION` registers return a u16 directly.
- Use `into_raw` instead of accessing the inner value of registers directly.
- Use safer macro to generate the `From` and `TryFrom` implementations
  of falcon enum types.
- Link to v1: https://patch.msgid.link/20260318-b4-nova-register-v1-0-22a358aa4c63@nvidia.com

---
Alexandre Courbot (10):
      gpu: nova-core: convert PMC registers to kernel register macro
      gpu: nova-core: convert PBUS registers to kernel register macro
      gpu: nova-core: convert PFB registers to kernel register macro
      gpu: nova-core: convert GC6 registers to kernel register macro
      gpu: nova-core: convert FUSE registers to kernel register macro
      gpu: nova-core: convert PDISP registers to kernel register macro
      gpu: nova-core: falcon: introduce `bounded_enum` macro
      gpu: nova-core: convert falcon registers to kernel register macro
      gpu: nova-core: remove `io::` qualifier to register macro invocations
      Documentation: nova: remove register abstraction task

 Documentation/gpu/nova/core/todo.rst               |  76 ---
 drivers/gpu/nova-core/falcon.rs                    | 577 ++++++++--------
 drivers/gpu/nova-core/falcon/gsp.rs                |  27 +-
 drivers/gpu/nova-core/falcon/hal/ga102.rs          |  70 +-
 drivers/gpu/nova-core/falcon/hal/tu102.rs          |  12 +-
 drivers/gpu/nova-core/falcon/sec2.rs               |  17 +-
 drivers/gpu/nova-core/fb.rs                        |   6 +-
 drivers/gpu/nova-core/fb/hal/ga100.rs              |  37 +-
 drivers/gpu/nova-core/fb/hal/ga102.rs              |   7 +-
 drivers/gpu/nova-core/fb/hal/tu102.rs              |  17 +-
 drivers/gpu/nova-core/firmware/fwsec/bootloader.rs |  19 +-
 drivers/gpu/nova-core/gfw.rs                       |  11 +-
 drivers/gpu/nova-core/gpu.rs                       |  37 +-
 drivers/gpu/nova-core/gsp/boot.rs                  |  11 +-
 drivers/gpu/nova-core/gsp/cmdq.rs                  |   9 +-
 drivers/gpu/nova-core/regs.rs                      | 601 +++++++++--------
 drivers/gpu/nova-core/regs/macros.rs               | 739 ---------------------
 17 files changed, 760 insertions(+), 1513 deletions(-)
---
base-commit: a19457958c3018783881c4416f272cd594f13049
change-id: 20260318-b4-nova-register-6908b5118552

Best regards,
--  
Alexandre Courbot <acourbot@nvidia.com>


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-03-23 14:23 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-23 11:07 [PATCH v3 00/10] gpu: nova-core: convert registers to use the kernel register macro Alexandre Courbot
2026-03-23 11:07 ` [PATCH v3 01/10] gpu: nova-core: convert PMC registers to " Alexandre Courbot
2026-03-23 11:21   ` Danilo Krummrich
2026-03-23 14:11     ` Alexandre Courbot
2026-03-23 14:21       ` Danilo Krummrich
2026-03-23 11:07 ` [PATCH v3 02/10] gpu: nova-core: convert PBUS " Alexandre Courbot
2026-03-23 11:07 ` [PATCH v3 03/10] gpu: nova-core: convert PFB " Alexandre Courbot
2026-03-23 11:07 ` [PATCH v3 04/10] gpu: nova-core: convert GC6 " Alexandre Courbot
2026-03-23 11:07 ` [PATCH v3 05/10] gpu: nova-core: convert FUSE " Alexandre Courbot
2026-03-23 11:07 ` [PATCH v3 06/10] gpu: nova-core: convert PDISP " Alexandre Courbot
2026-03-23 11:07 ` [PATCH v3 07/10] gpu: nova-core: falcon: introduce `bounded_enum` macro Alexandre Courbot
2026-03-23 11:22   ` Danilo Krummrich
2026-03-23 12:43   ` Gary Guo
2026-03-23 14:22     ` Alexandre Courbot
2026-03-23 11:07 ` [PATCH v3 08/10] gpu: nova-core: convert falcon registers to kernel register macro Alexandre Courbot
2026-03-23 11:07 ` [PATCH v3 09/10] gpu: nova-core: remove `io::` qualifier to register macro invocations Alexandre Courbot
2026-03-23 11:07 ` [PATCH v3 10/10] Documentation: nova: remove register abstraction task Alexandre Courbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox