Skip to content

Commit

Permalink
Enable IN_FENCE_FD on Nvidia 560 driver
Browse files Browse the repository at this point in the history
  • Loading branch information
ids1024 authored and cmeissl committed Sep 13, 2024
1 parent f364c73 commit 1259a69
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/backend/drm/compositor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ use std::{
io::ErrorKind,
os::unix::io::{AsFd, OwnedFd},
rc::Rc,
str::FromStr,
sync::{Arc, Mutex},
};

Expand Down Expand Up @@ -1690,7 +1691,7 @@ where
}))
})?
&& plane_has_property(&*surface, surface.plane(), "IN_FENCE_FD")?
&& !is_nvidia;
&& !(is_nvidia && nvidia_drm_version().unwrap_or((0, 0, 0)) < (560, 35, 3));

for format in color_formats {
debug!("Testing color format: {}", format);
Expand Down Expand Up @@ -4505,3 +4506,12 @@ impl<
}
}
}

fn nvidia_drm_version() -> Option<(u32, u32, u32)> {
let ver = std::fs::read_to_string("/sys/module/nvidia_drm/version").ok()?;
let mut components = ver.trim().split('.');
let major = u32::from_str(components.next()?).ok()?;
let minor = u32::from_str(components.next()?).ok()?;
let patch = u32::from_str(components.next()?).ok()?;
Some((major, minor, patch))
}

0 comments on commit 1259a69

Please sign in to comment.