Commit e041d81a authored by Danilo Krummrich's avatar Danilo Krummrich
Browse files

gpu: nova-core: register auxiliary device for nova-drm



Register an auxiliary device for nova-drm.

For now always use zero for the auxiliary device's ID; we don't use it
yet anyways. However, once it lands, we should switch to XArray.

Acked-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://lore.kernel.org/r/20250424160452.8070-2-dakr@kernel.org


Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
parent 42055939
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
config NOVA_CORE
	tristate "Nova Core GPU driver"
	depends on AUXILIARY_BUS
	depends on PCI
	depends on RUST
	depends on RUST_FW_LOADER_ABSTRACTIONS
+8 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0

use kernel::{bindings, c_str, device::Core, pci, prelude::*};
use kernel::{auxiliary, bindings, c_str, device::Core, pci, prelude::*};

use crate::gpu::Gpu;

@@ -8,6 +8,7 @@
pub(crate) struct NovaCore {
    #[pin]
    pub(crate) gpu: Gpu,
    _reg: auxiliary::Registration,
}

const BAR0_SIZE: usize = 8;
@@ -38,6 +39,12 @@ fn probe(pdev: &pci::Device<Core>, _info: &Self::IdInfo) -> Result<Pin<KBox<Self
        let this = KBox::pin_init(
            try_pin_init!(Self {
                gpu <- Gpu::new(pdev, bar)?,
                _reg: auxiliary::Registration::new(
                    pdev.as_ref(),
                    c_str!("nova-drm"),
                    0, // TODO: Once it lands, use XArray; for now we don't use the ID.
                    crate::MODULE_NAME
                )?,
            }),
            GFP_KERNEL,
        )?;
+2 −0
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@
mod regs;
mod util;

pub(crate) const MODULE_NAME: &kernel::str::CStr = <LocalModule as kernel::ModuleMetadata>::NAME;

kernel::module_pci_driver! {
    type: driver::NovaCore,
    name: "NovaCore",