linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/19] gpu: nova-core: register!() macro improvements
@ 2025-07-18  7:26 Alexandre Courbot
  2025-07-18  7:26 ` [PATCH v2 01/19] gpu: nova-core: register: minor grammar and spelling fixes Alexandre Courbot
                   ` (19 more replies)
  0 siblings, 20 replies; 54+ messages in thread
From: Alexandre Courbot @ 2025-07-18  7:26 UTC (permalink / raw)
  To: Danilo Krummrich, David Airlie, Simona Vetter, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann
  Cc: Daniel Almeida, Beata Michalska, nouveau, dri-devel,
	rust-for-linux, linux-kernel, Alexandre Courbot, John Hubbard,
	Timur Tabi

This patch series introduces a number of improvements to nova-core's
register!() macro in order to make it more useful to Nova itself, and to
bring it closer to graduation into the wider kernel crate.

The first half is trivial fixes and code reorganization to let the
following patches apply more cleanly.

The interesting stuff begins with the introduction of proper `Debug` and
`Default` implementations leveraging the field information that is made
available by the first half of the patchset. `Debug` now displays the
interpreted values of all the fields on top of the hexadecimal
representation of the register; and `Default` now initializes all the
fields to their declared default value instead of just zeroes.

Then goes a complete redesign of the way relative registers work. The
previous way was very unsafe as it accepted any literal value as the
base. Now, valid bases can (and must) be explicitly defined for specific
group of relative registers. All these bases are belong to us, and thus
can be validated at build-time.

Next come arrays of registers, a useful feature to represent contiguous
groups of registers that are interpreted identically. For these we have
both build-time and runtime checked accessors. We immediately make use
of them to clean up the FUSE registers code, which was a bit unsightly
due to the lack of this feature.

Finally, combining the two features: arrays of relative registers, which
we don't really need at the moment, but will become needed for GSP
booting.

There are still features that need to be implemented before this macro
can be considered ready for other drivers:

- Make I/O accessors optional,
- Support other sizes than `u32`,
- Allow visibility control for registers and individual fields,
- Convert the range syntax to inclusive slices instead of NVIDIA's
  OpenRM format,
- ... and proper suitability assessment by other driver contributors.

These should be trivial compared to the work that is done in this
series.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
Changes in v2:
- Improve documentation and add layout diagram for the relative
  registers example.
- Fix build error when fields named `offset` are declared.
- Link to v1: https://lore.kernel.org/r/20250704-nova-regs-v1-0-f88d028781a4@nvidia.com

---
Alexandre Courbot (18):
      gpu: nova-core: register: fix typo
      gpu: nova-core: register: allow fields named `offset`
      gpu: nova-core: register: improve documentation for basic registers
      gpu: nova-core: register: simplify @leaf_accessor rule
      gpu: nova-core: register: remove `try_` accessors for relative registers
      gpu: nova-core: register: move OFFSET declaration to I/O impl block
      gpu: nova-core: register: fix documentation and indentation
      gpu: nova-core: register: add missing doccomments for fixed registers I/O accessors
      gpu: nova-core: register: add fields dispatcher internal rule
      gpu: nova-core: register: improve `Debug` implementation
      gpu: nova-core: register: generate correct `Default` implementation
      gpu: nova-core: register: split @io rule into fixed and relative versions
      gpu: nova-core: register: use #[inline(always)] for all methods
      gpu: nova-core: register: redesign relative registers
      gpu: nova-core: falcon: add distinct base address for PFALCON2
      gpu: nova-core: register: add support for register arrays
      gpu: nova-core: falcon: use register arrays for FUSE registers
      gpu: nova-core: register: add support for relative array registers

John Hubbard (1):
      gpu: nova-core: register: minor grammar and spelling fixes

 Documentation/gpu/nova/core/todo.rst      |   2 -
 drivers/gpu/nova-core/falcon.rs           |  72 +--
 drivers/gpu/nova-core/falcon/gsp.rs       |  16 +-
 drivers/gpu/nova-core/falcon/hal/ga102.rs |  47 +-
 drivers/gpu/nova-core/falcon/sec2.rs      |  13 +-
 drivers/gpu/nova-core/gpu.rs              |   2 +-
 drivers/gpu/nova-core/regs.rs             |  83 ++--
 drivers/gpu/nova-core/regs/macros.rs      | 789 +++++++++++++++++++++++++-----
 8 files changed, 795 insertions(+), 229 deletions(-)
---
base-commit: 14ae91a81ec8fa0bc23170d4aa16dd2a20d54105
change-id: 20250703-nova-regs-24dddef5fba3

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


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

end of thread, other threads:[~2025-08-15  4:44 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-18  7:26 [PATCH v2 00/19] gpu: nova-core: register!() macro improvements Alexandre Courbot
2025-07-18  7:26 ` [PATCH v2 01/19] gpu: nova-core: register: minor grammar and spelling fixes Alexandre Courbot
2025-07-25 16:14   ` Daniel Almeida
2025-07-25 20:43     ` John Hubbard
2025-07-28  4:59     ` Alexandre Courbot
2025-07-28  7:51       ` Steven Price
2025-07-28 11:43         ` Alexandre Courbot
2025-07-28 13:25           ` Steven Price
2025-07-29 13:47             ` Alexandre Courbot
2025-07-30  9:27               ` Steven Price
2025-07-30 12:47                 ` Daniel Almeida
2025-07-18  7:26 ` [PATCH v2 02/19] gpu: nova-core: register: fix typo Alexandre Courbot
2025-07-18 19:05   ` Boqun Feng
2025-07-22 12:38     ` Alexandre Courbot
2025-07-25 16:18   ` Daniel Almeida
2025-07-18  7:26 ` [PATCH v2 03/19] gpu: nova-core: register: allow fields named `offset` Alexandre Courbot
2025-07-25 16:20   ` Daniel Almeida
2025-07-18  7:26 ` [PATCH v2 04/19] gpu: nova-core: register: improve documentation for basic registers Alexandre Courbot
2025-07-25 16:49   ` Daniel Almeida
2025-07-18  7:26 ` [PATCH v2 05/19] gpu: nova-core: register: simplify @leaf_accessor rule Alexandre Courbot
2025-07-25 16:53   ` Daniel Almeida
2025-07-18  7:26 ` [PATCH v2 06/19] gpu: nova-core: register: remove `try_` accessors for relative registers Alexandre Courbot
2025-07-25 16:55   ` Daniel Almeida
2025-07-18  7:26 ` [PATCH v2 07/19] gpu: nova-core: register: move OFFSET declaration to I/O impl block Alexandre Courbot
2025-07-25 17:03   ` Daniel Almeida
2025-07-28  5:02     ` Alexandre Courbot
2025-07-18  7:26 ` [PATCH v2 08/19] gpu: nova-core: register: fix documentation and indentation Alexandre Courbot
2025-07-25 17:04   ` Daniel Almeida
2025-07-18  7:26 ` [PATCH v2 09/19] gpu: nova-core: register: add missing doccomments for fixed registers I/O accessors Alexandre Courbot
2025-07-25 17:06   ` Daniel Almeida
2025-07-18  7:26 ` [PATCH v2 10/19] gpu: nova-core: register: add fields dispatcher internal rule Alexandre Courbot
2025-07-25 17:38   ` Daniel Almeida
2025-07-18  7:26 ` [PATCH v2 11/19] gpu: nova-core: register: improve `Debug` implementation Alexandre Courbot
2025-07-25 17:49   ` Daniel Almeida
2025-07-18  7:26 ` [PATCH v2 12/19] gpu: nova-core: register: generate correct `Default` implementation Alexandre Courbot
2025-07-25 17:53   ` Daniel Almeida
2025-07-18  7:26 ` [PATCH v2 13/19] gpu: nova-core: register: split @io rule into fixed and relative versions Alexandre Courbot
2025-07-25 17:58   ` Daniel Almeida
2025-07-18  7:26 ` [PATCH v2 14/19] gpu: nova-core: register: use #[inline(always)] for all methods Alexandre Courbot
2025-07-25 17:59   ` Daniel Almeida
2025-07-18  7:26 ` [PATCH v2 15/19] gpu: nova-core: register: redesign relative registers Alexandre Courbot
2025-07-25 18:56   ` Daniel Almeida
2025-07-28  5:07     ` Alexandre Courbot
2025-07-18  7:26 ` [PATCH v2 16/19] gpu: nova-core: falcon: add distinct base address for PFALCON2 Alexandre Courbot
2025-07-18 20:23   ` John Hubbard
2025-07-22 12:39     ` Alexandre Courbot
2025-07-18  7:26 ` [PATCH v2 17/19] gpu: nova-core: register: add support for register arrays Alexandre Courbot
2025-07-25 19:12   ` Daniel Almeida
2025-07-25 19:13     ` Daniel Almeida
2025-07-28  5:12     ` Alexandre Courbot
2025-07-18  7:26 ` [PATCH v2 18/19] gpu: nova-core: falcon: use register arrays for FUSE registers Alexandre Courbot
2025-07-18  7:26 ` [PATCH v2 19/19] gpu: nova-core: register: add support for relative array registers Alexandre Courbot
2025-08-14 22:52 ` [PATCH v2 00/19] gpu: nova-core: register!() macro improvements Lyude Paul
2025-08-15  4:44   ` Alexandre Courbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).