]> Gentwo Git Trees - linux/.git/commit
gpu: nova-core: register: add support for register arrays
authorAlexandre Courbot <acourbot@nvidia.com>
Fri, 18 Jul 2025 07:26:22 +0000 (16:26 +0900)
committerAlexandre Courbot <acourbot@nvidia.com>
Fri, 15 Aug 2025 03:02:56 +0000 (12:02 +0900)
commit20ed4a8695b277c296e3a30306ef8551903e1e04
treec4649c14df5a3a1ca996745fdce0466ad2494e63
parente617f3a3702ca1ca2a498edbad0b12ceadc27321
gpu: nova-core: register: add support for register arrays

Having registers that can be interpreted identically in a contiguous I/O
area (or at least, following a given stride) is a common way to organize
registers, and is used by NVIDIA hardware. Thus, add a way to simply and
safely declare such a layout using the register!() macro.

Build-time bound-checking is effective for array accesses performed with
a constant. For cases where the index cannot be known at compile time,
`try_` variants of the accessors are also made available that return
`EINVAL` if the access is out-of-bounds.

Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20250718-nova-regs-v2-17-7b6a762aa1cd@nvidia.com
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
drivers/gpu/nova-core/gpu.rs
drivers/gpu/nova-core/regs.rs
drivers/gpu/nova-core/regs/macros.rs