diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-01-03 18:16:20 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-01-03 18:16:20 +0400 |
| commit | 5cd31e5730160f9162502d2388dc00400c7a87ae (patch) | |
| tree | a718ad47e0554263042ae4eebd5e49af34346732 /src/backend/mod.rs | |
| parent | de3fc2def0cf3683fff7994cd294d325e4f033b2 (diff) | |
| download | niri-5cd31e5730160f9162502d2388dc00400c7a87ae.tar.gz niri-5cd31e5730160f9162502d2388dc00400c7a87ae.tar.bz2 niri-5cd31e5730160f9162502d2388dc00400c7a87ae.zip | |
Implement multi-GPU support
Rendering always happens on the primary GPU.
Diffstat (limited to 'src/backend/mod.rs')
| -rw-r--r-- | src/backend/mod.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/mod.rs b/src/backend/mod.rs index 54b504ca..66b05f77 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -5,6 +5,7 @@ use std::time::Duration; use smithay::backend::allocator::dmabuf::Dmabuf; use smithay::backend::renderer::gles::GlesRenderer; use smithay::output::Output; +use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface; use crate::input::CompositorMod; use crate::Niri; @@ -102,6 +103,13 @@ impl Backend { } } + pub fn early_import(&mut self, surface: &WlSurface) { + match self { + Backend::Tty(tty) => tty.early_import(surface), + Backend::Winit(_) => (), + } + } + #[cfg_attr(not(feature = "dbus"), allow(unused))] pub fn connectors(&self) -> Arc<Mutex<HashMap<String, Output>>> { match self { @@ -116,7 +124,7 @@ impl Backend { ) -> Option<smithay::backend::allocator::gbm::GbmDevice<smithay::backend::drm::DrmDeviceFd>> { match self { - Backend::Tty(tty) => tty.gbm_device(), + Backend::Tty(tty) => tty.primary_gbm_device(), Backend::Winit(_) => None, } } |
