Skip to content

Commit

Permalink
compositor: Disable IN_FENCE_FD on Nvidia
Browse files Browse the repository at this point in the history
Atomic commits fail if this is set on the Nvidia driver, it seems:
NVIDIA/open-gpu-kernel-modules#622

Kwin also has a check for this
https://invent.kde.org/plasma/kwin/-/merge_requests/4770.

This fixes Anvil and cosmic-comp on the Nvidia 555 beta driver. (I'm not
sure why it only started to be a problem; `EGL_ANDROID_native_fence_sync`
is present in the 550 driver, etc.)
  • Loading branch information
ids1024 authored and Drakulix committed May 22, 2024
1 parent 8f132ec commit fb44b24
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/backend/drm/compositor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1640,6 +1640,22 @@ where
.overlay
.sort_by_key(|p| std::cmp::Reverse(p.zpos.unwrap_or_default()));

let driver = surface.get_driver().map_err(|err| {
FrameError::DrmError(DrmError::Access(AccessError {
errmsg: "Failed to query drm driver",
dev: surface.dev_path(),
source: err,
}))
})?;
// `IN_FENCE_FD` makes commit fail on Nvidia driver
// https://github.com/NVIDIA/open-gpu-kernel-modules/issues/622
let is_nvidia = driver.name().to_string_lossy().to_lowercase().contains("nvidia")
|| driver
.description()
.to_string_lossy()
.to_lowercase()
.contains("nvidia");

let cursor_size = Size::from((cursor_size.w as i32, cursor_size.h as i32));
let damage_tracker = OutputDamageTracker::from_mode_source(output_mode_source.clone());
let supports_fencing = !surface.is_legacy()
Expand All @@ -1653,7 +1669,8 @@ where
source: err,
}))
})?
&& plane_has_property(&*surface, surface.plane(), "IN_FENCE_FD")?;
&& plane_has_property(&*surface, surface.plane(), "IN_FENCE_FD")?
&& !is_nvidia;

for format in color_formats {
debug!("Testing color format: {}", format);
Expand Down

0 comments on commit fb44b24

Please sign in to comment.