Skip to content
Snippets Groups Projects
Commit ffd3b906 authored by Lyude Paul's avatar Lyude Paul
Browse files

fixup! WIP: drm: Introduce RVKMS!

parent 9c66aa15
No related branches found
No related tags found
No related merge requests found
......@@ -128,15 +128,20 @@ impl platform::Driver for RvkmsDriver {
) -> Result<Pin<KBox<Self>>> {
let dev: &device::Device = pdev.as_ref();
dev_dbg!(dev, "Probing RVKMS...\n");
dev_dbg!(dev, "Found RVKMS device\n");
KBox::new(Self, GFP_KERNEL)
dev_info!(dev, "Creating and registering DRM device\n");
let drm = drv::Registration::<RvkmsDriver>::new(dev, (), 0)?;
KBox::new(Self { drm_drv: drm }, GFP_KERNEL)
.map(|d| d.into())
.map_err(|e| e.into())
}
}
pub(crate) struct RvkmsDriver;
pub(crate) struct RvkmsDriver {
drm_drv: drv::Registration<RvkmsDriver>
}
const MODE_CONFIG_INFO: ModeConfigInfo = ModeConfigInfo {
min_resolution: MIN_RES,
......@@ -149,8 +154,7 @@ pub(crate) type RvkmsRegistration = driver::Registration<platform::Adapter<Rvkms
pub(crate) struct RvkmsModule {
platform_drv: Pin<KBox<RvkmsRegistration>>,
drm_drv: drv::Registration<RvkmsDriver>,
pdev: platform::Device,
pdev: platform::VirtualDevice,
}
impl kernel::Module for RvkmsModule {
......@@ -159,20 +163,12 @@ impl kernel::Module for RvkmsModule {
// Create our platform driver
pr_info!("Registering platform driver\n");
let pdrv = KBox::pin_init(RvkmsRegistration::new(name, module), GFP_KERNEL)?;
let platform_drv = KBox::pin_init(RvkmsRegistration::new(name, module), GFP_KERNEL)?;
pr_info!("Creating platform device\n");
let pdev = platform::Device::create_simple(&NAME, 0)?;
let dev: &device::Device = pdev.as_ref();
dev_info!(dev, "Creating and registering DRM device\n");
let drm = drv::Registration::<RvkmsDriver>::new(dev, (), 0)?;
let pdev = platform::VirtualDevice::new(&NAME, platform::VirtualDeviceId::None)?;
Ok(Self {
platform_drv: pdrv,
drm_drv: drm,
pdev
})
Ok(Self { platform_drv, pdev })
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment