mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
gpu: nova: separate driver type from driver data
Split NovaDriver into a unit struct for trait implementations and a separate Nova struct for the private driver data. Reviewed-by: Eliot Courtney <ecourtney@nvidia.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Tested-by: Alexandre Courbot <acourbot@nvidia.com> Link: https://patch.msgid.link/20260525225838.276108-6-dakr@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
This commit is contained in:
parent
859805f070
commit
dc395c2831
|
|
@ -15,9 +15,11 @@
|
|||
use crate::file::File;
|
||||
use crate::gem::NovaObject;
|
||||
|
||||
pub(crate) struct NovaDriver {
|
||||
pub(crate) struct NovaDriver;
|
||||
|
||||
pub(crate) struct Nova {
|
||||
#[expect(unused)]
|
||||
drm: ARef<drm::Device<Self>>,
|
||||
drm: ARef<drm::Device<NovaDriver>>,
|
||||
}
|
||||
|
||||
/// Convienence type alias for the DRM device type for this driver
|
||||
|
|
@ -51,19 +53,19 @@ pub(crate) struct NovaData {
|
|||
|
||||
impl auxiliary::Driver for NovaDriver {
|
||||
type IdInfo = ();
|
||||
type Data<'bound> = Self;
|
||||
type Data<'bound> = Nova;
|
||||
const ID_TABLE: auxiliary::IdTable<Self::IdInfo> = &AUX_TABLE;
|
||||
|
||||
fn probe<'bound>(
|
||||
adev: &'bound auxiliary::Device<Core<'_>>,
|
||||
_info: &'bound Self::IdInfo,
|
||||
) -> impl PinInit<Self, Error> + 'bound {
|
||||
) -> impl PinInit<Self::Data<'bound>, Error> + 'bound {
|
||||
let data = try_pin_init!(NovaData { adev: adev.into() });
|
||||
|
||||
let drm = drm::Device::<Self>::new(adev.as_ref(), data)?;
|
||||
drm::Registration::new_foreign_owned(&drm, adev.as_ref(), 0)?;
|
||||
|
||||
Ok(Self { drm })
|
||||
Ok(Nova { drm })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user