aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tty.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-01-05 20:21:42 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2024-01-05 23:23:32 +0400
commit1c7c5b3f28b3222844c3e28b40fda2f4477a37dd (patch)
tree5941020ff21e2ebd028db242e000cc4be9dce9f3 /src/backend/tty.rs
parentb9d7812f1f99c64b34594953129dab98efdd239b (diff)
downloadniri-1c7c5b3f28b3222844c3e28b40fda2f4477a37dd.tar.gz
niri-1c7c5b3f28b3222844c3e28b40fda2f4477a37dd.tar.bz2
niri-1c7c5b3f28b3222844c3e28b40fda2f4477a37dd.zip
tty: Avoid non-linear cross-device formats
Diffstat (limited to 'src/backend/tty.rs')
-rw-r--r--src/backend/tty.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/tty.rs b/src/backend/tty.rs
index 067b3e3e..226d45df 100644
--- a/src/backend/tty.rs
+++ b/src/backend/tty.rs
@@ -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