Skip to content

Commit

Permalink
feat: use VBIOS version field from DRM when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-zlobintsev committed Nov 25, 2023
1 parent 030e827 commit e98df05
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lact-daemon/src/server/gpu_controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,13 @@ impl GpuController {

#[cfg(feature = "libdrm_amdgpu_sys")]
fn get_full_vbios_version(&self) -> Option<String> {
self.handle.get_vbios_version().ok().map(|mut base| {
if let Some(drm_handle) = &self.drm_handle {
if let Ok(vbios_info) = drm_handle.get_vbios_info() {
base = format!("{base} [{}]", vbios_info.date);
}
if let Some(drm_handle) = &self.drm_handle {
if let Ok(vbios_info) = drm_handle.get_vbios_info() {
return Some(format!("{} [{}]", vbios_info.ver, vbios_info.date));
}
base
})
}

self.handle.get_vbios_version().ok()
}

#[cfg(not(feature = "libdrm_amdgpu_sys"))]
Expand Down

0 comments on commit e98df05

Please sign in to comment.