Skip to content

Commit e041d81

Browse files
author
Danilo Krummrich
committed
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: Dave Airlie <airlied@redhat.com> Link: https://lore.kernel.org/r/20250424160452.8070-2-dakr@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
1 parent 4205593 commit e041d81

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

drivers/gpu/nova-core/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
config NOVA_CORE
22
tristate "Nova Core GPU driver"
3+
depends on AUXILIARY_BUS
34
depends on PCI
45
depends on RUST
56
depends on RUST_FW_LOADER_ABSTRACTIONS

drivers/gpu/nova-core/driver.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
// SPDX-License-Identifier: GPL-2.0
22

3-
use kernel::{bindings, c_str, device::Core, pci, prelude::*};
3+
use kernel::{auxiliary, bindings, c_str, device::Core, pci, prelude::*};
44

55
use crate::gpu::Gpu;
66

77
#[pin_data]
88
pub(crate) struct NovaCore {
99
#[pin]
1010
pub(crate) gpu: Gpu,
11+
_reg: auxiliary::Registration,
1112
}
1213

1314
const BAR0_SIZE: usize = 8;
@@ -38,6 +39,12 @@ impl pci::Driver for NovaCore {
3839
let this = KBox::pin_init(
3940
try_pin_init!(Self {
4041
gpu <- Gpu::new(pdev, bar)?,
42+
_reg: auxiliary::Registration::new(
43+
pdev.as_ref(),
44+
c_str!("nova-drm"),
45+
0, // TODO: Once it lands, use XArray; for now we don't use the ID.
46+
crate::MODULE_NAME
47+
)?,
4148
}),
4249
GFP_KERNEL,
4350
)?;

drivers/gpu/nova-core/nova_core.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ mod gpu;
88
mod regs;
99
mod util;
1010

11+
pub(crate) const MODULE_NAME: &kernel::str::CStr = <LocalModule as kernel::ModuleMetadata>::NAME;
12+
1113
kernel::module_pci_driver! {
1214
type: driver::NovaCore,
1315
name: "NovaCore",

0 commit comments

Comments
 (0)