diff options
| author | John Hubbard <jhubbard@nvidia.com> | 2026-04-10 19:49:27 -0700 |
|---|---|---|
| committer | Alexandre Courbot <acourbot@nvidia.com> | 2026-04-30 10:02:55 +0900 |
| commit | b3bdb42619c8fce6d6d5feb36ad33d184aaa4e3d (patch) | |
| tree | 4a2dfa4a62a7609dd347552c7aa10a27679324d2 /drivers/gpu/nova-core/falcon | |
| parent | 777123bf2be607701b397f07198370700d2bfbdd (diff) | |
| download | linux-b3bdb42619c8fce6d6d5feb36ad33d184aaa4e3d.tar.gz linux-b3bdb42619c8fce6d6d5feb36ad33d184aaa4e3d.zip | |
gpu: nova-core: use GPU Architecture to simplify HAL selections
Replace per-chipset match arms with Architecture-based matching in the
falcon and FB HAL selection functions. This reduces the number of match
arms that need updating when new chipsets are added within an existing
architecture.
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260411024953.473149-3-jhubbard@nvidia.com
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Diffstat (limited to 'drivers/gpu/nova-core/falcon')
| -rw-r--r-- | drivers/gpu/nova-core/falcon/hal.rs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/gpu/nova-core/falcon/hal.rs b/drivers/gpu/nova-core/falcon/hal.rs index f82087df4936..f75b5c315d62 100644 --- a/drivers/gpu/nova-core/falcon/hal.rs +++ b/drivers/gpu/nova-core/falcon/hal.rs @@ -9,7 +9,10 @@ use crate::{ FalconBromParams, FalconEngine, // }, - gpu::Chipset, + gpu::{ + Architecture, + Chipset, // + }, }; mod ga102; @@ -74,14 +77,15 @@ pub(crate) trait FalconHal<E: FalconEngine>: Send + Sync { pub(super) fn falcon_hal<E: FalconEngine + 'static>( chipset: Chipset, ) -> Result<KBox<dyn FalconHal<E>>> { - use Chipset::*; - - let hal = match chipset { - GA100 | // GA100 boots like Turing so use Turing HAL - TU102 | TU104 | TU106 | TU116 | TU117 => { + let hal = match chipset.arch() { + Architecture::Turing => { + KBox::new(tu102::Tu102::<E>::new(), GFP_KERNEL)? as KBox<dyn FalconHal<E>> + } + // GA100 boots like Turing so use Turing HAL + Architecture::Ampere if chipset == Chipset::GA100 => { KBox::new(tu102::Tu102::<E>::new(), GFP_KERNEL)? as KBox<dyn FalconHal<E>> } - GA102 | GA103 | GA104 | GA106 | GA107 | AD102 | AD103 | AD104 | AD106 | AD107 => { + Architecture::Ampere | Architecture::Ada => { KBox::new(ga102::Ga102::<E>::new(), GFP_KERNEL)? as KBox<dyn FalconHal<E>> } }; |
