summaryrefslogtreecommitdiff
path: root/drivers/gpu/nova-core/vgpu/hal.rs
blob: 456f8fe27582085a437ba036e9820b93c8a866d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// SPDX-License-Identifier: GPL-2.0

use crate::gpu::{
    Architecture,
    Chipset, //
};

mod gb202;
mod tu102;

pub(super) trait VgpuHal {
    /// Returns whether this chipset can support vGPU.
    fn supports_vgpu(&self) -> bool;
}

pub(super) fn vgpu_hal(chipset: Chipset) -> &'static dyn VgpuHal {
    match chipset.arch() {
        Architecture::BlackwellGB20x => gb202::GB202_HAL,
        Architecture::Turing
        | Architecture::Ampere
        | Architecture::Hopper
        | Architecture::Ada
        | Architecture::BlackwellGB10x => tu102::TU102_HAL,
    }
}