feat: make DRM mandatory for amdgpu

This commit is contained in:
Ilya Zlobintsev
2025-02-05 14:36:31 +02:00
parent e24b0e2dad
commit eef331fa0c
2 changed files with 7 additions and 9 deletions

View File

@@ -193,7 +193,7 @@ pub(crate) fn init_controller(
// We use the AMD controller as the fallback even for non-AMD devices, it will at least
// display basic device information from the SysFS
Ok(Box::new(
AmdGpuController::new_from_path(common, amd_drm.as_ref())
AmdGpuController::new_from_path(common, None)
.context("Could initialize fallback controller")?,
))
}

View File

@@ -67,14 +67,12 @@ impl AmdGpuController {
#[allow(unused_mut)]
let mut drm_handle = None;
#[cfg(not(test))]
if matches!(handle.get_driver(), "amdgpu" | "radeon") && libdrm_amdgpu.is_some() {
match get_drm_handle(&handle, libdrm_amdgpu.as_ref().unwrap()) {
Ok(handle) => {
drm_handle = Some(handle);
}
Err(err) => {
warn!("Could not get DRM handle: {err}");
}
if let Some(libdrm_amdgpu) = libdrm_amdgpu {
if handle.get_driver() == "amdgpu" {
drm_handle = Some(
get_drm_handle(&handle, libdrm_amdgpu)
.context("Could not get AMD DRM handle")?,
);
}
}