metal: disable IN_FENCE_FD on nvidia driver
This commit is contained in:
parent
14b344a1ae
commit
3cf1b227b6
3 changed files with 32 additions and 2 deletions
|
|
@ -1,5 +1,9 @@
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
# 1.0.3
|
||||||
|
|
||||||
|
- Needs jay-compositor release.
|
||||||
|
|
||||||
# 1.0.2
|
# 1.0.2
|
||||||
|
|
||||||
- Needs jay-compositor release.
|
- Needs jay-compositor release.
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
- Add support for wp-alpha-modifier.
|
- Add support for wp-alpha-modifier.
|
||||||
|
|
||||||
|
# 1.0.3 (2024-04-11)
|
||||||
|
|
||||||
|
- Partially disable explicit sync on nvidia drivers.
|
||||||
|
|
||||||
# 1.0.2 (2024-04-10)
|
# 1.0.2 (2024-04-10)
|
||||||
|
|
||||||
- Fixed a bug that caused the portal to fail.
|
- Fixed a bug that caused the portal to fail.
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ pub struct MetalDrmDevice {
|
||||||
pub ctx: CloneCell<Rc<MetalRenderContext>>,
|
pub ctx: CloneCell<Rc<MetalRenderContext>>,
|
||||||
pub on_change: OnChange<crate::backend::DrmEvent>,
|
pub on_change: OnChange<crate::backend::DrmEvent>,
|
||||||
pub direct_scanout_enabled: Cell<Option<bool>>,
|
pub direct_scanout_enabled: Cell<Option<bool>>,
|
||||||
|
pub is_nvidia: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MetalDrmDevice {
|
impl MetalDrmDevice {
|
||||||
|
|
@ -714,7 +715,9 @@ impl MetalConnector {
|
||||||
c.change(plane.crtc_y.id, crtc_y as u64);
|
c.change(plane.crtc_y.id, crtc_y as u64);
|
||||||
c.change(plane.crtc_w.id, crtc_w as u64);
|
c.change(plane.crtc_w.id, crtc_w as u64);
|
||||||
c.change(plane.crtc_h.id, crtc_h as u64);
|
c.change(plane.crtc_h.id, crtc_h as u64);
|
||||||
c.change(plane.in_fence_fd, in_fence as u64);
|
if !self.dev.is_nvidia {
|
||||||
|
c.change(plane.in_fence_fd, in_fence as u64);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
new_fb = Some(fb);
|
new_fb = Some(fb);
|
||||||
}
|
}
|
||||||
|
|
@ -748,7 +751,9 @@ impl MetalConnector {
|
||||||
c.change(plane.src_y.id, 0);
|
c.change(plane.src_y.id, 0);
|
||||||
c.change(plane.src_w.id, (width as u64) << 16);
|
c.change(plane.src_w.id, (width as u64) << 16);
|
||||||
c.change(plane.src_h.id, (height as u64) << 16);
|
c.change(plane.src_h.id, (height as u64) << 16);
|
||||||
c.change(plane.in_fence_fd, in_fence as u64);
|
if !self.dev.is_nvidia {
|
||||||
|
c.change(plane.in_fence_fd, in_fence as u64);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
changes.change_object(plane.id, |c| {
|
changes.change_object(plane.id, |c| {
|
||||||
|
|
@ -1586,6 +1591,22 @@ impl MetalBackend {
|
||||||
Err(e) => return Err(MetalError::GbmDevice(e)),
|
Err(e) => return Err(MetalError::GbmDevice(e)),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let mut is_nvidia = false;
|
||||||
|
match gbm.drm.version() {
|
||||||
|
Ok(v) => {
|
||||||
|
is_nvidia = v.name.contains_str("nvidia");
|
||||||
|
if is_nvidia {
|
||||||
|
log::warn!(
|
||||||
|
"Device {} use the nvidia driver. IN_FENCE_FD will not be used.",
|
||||||
|
pending.devnode.as_bytes().as_bstr(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
log::warn!("Could not fetch DRM version information: {}", ErrorFmt(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let dev = Rc::new(MetalDrmDevice {
|
let dev = Rc::new(MetalDrmDevice {
|
||||||
backend: self.clone(),
|
backend: self.clone(),
|
||||||
id: pending.id,
|
id: pending.id,
|
||||||
|
|
@ -1608,6 +1629,7 @@ impl MetalBackend {
|
||||||
ctx: CloneCell::new(ctx),
|
ctx: CloneCell::new(ctx),
|
||||||
on_change: Default::default(),
|
on_change: Default::default(),
|
||||||
direct_scanout_enabled: Default::default(),
|
direct_scanout_enabled: Default::default(),
|
||||||
|
is_nvidia,
|
||||||
});
|
});
|
||||||
|
|
||||||
let (connectors, futures) = get_connectors(self, &dev, &resources.connectors)?;
|
let (connectors, futures) = get_connectors(self, &dev, &resources.connectors)?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue