mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
tty: Avoid non-linear cross-device formats
This commit is contained in:
+8
-1
@@ -32,6 +32,7 @@ use smithay::reexports::calloop::{Dispatcher, LoopHandle, RegistrationToken};
|
||||
use smithay::reexports::drm::control::{
|
||||
connector, crtc, property, Device, Mode as DrmMode, ModeFlags, ModeTypeFlags,
|
||||
};
|
||||
use smithay::reexports::gbm::Modifier;
|
||||
use smithay::reexports::input::Libinput;
|
||||
use smithay::reexports::rustix::fs::OFlags;
|
||||
use smithay::reexports::wayland_protocols;
|
||||
@@ -1234,11 +1235,17 @@ fn surface_dmabuf_feedback(
|
||||
|
||||
// We limit the scan-out trache to formats we can also render from so that there is always a
|
||||
// fallback render path available in case the supplied buffer can not be scanned out directly.
|
||||
let scanout_formats = plane_formats
|
||||
let mut scanout_formats = plane_formats
|
||||
.intersection(&primary_formats)
|
||||
.copied()
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// HACK: AMD iGPU + dGPU systems share some modifiers between the two, and yet cross-device
|
||||
// buffers produce a glitched scanout if the modifier is not Linear...
|
||||
if primary_render_node != surface_render_node {
|
||||
scanout_formats.retain(|f| f.modifier == Modifier::Linear);
|
||||
}
|
||||
|
||||
let builder = DmabufFeedbackBuilder::new(primary_render_node.dev_id(), primary_formats);
|
||||
|
||||
let scanout = builder
|
||||
|
||||
Reference in New Issue
Block a user