mirror of
https://github.com/ilya-zlobintsev/LACT.git
synced 2025-02-25 18:55:26 -06:00
feat: make DRM mandatory for amdgpu
This commit is contained in:
@@ -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")?,
|
||||
))
|
||||
}
|
||||
|
||||
@@ -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")?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user