aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tty.rs
diff options
context:
space:
mode:
authorChristian Meissl <meissl.christian@gmail.com>2024-07-05 21:49:08 +0200
committerIvan Molodetskikh <yalterz@gmail.com>2024-07-08 08:30:00 +0300
commit570bf1cb3c1f9ffc847359009c6061e062c72871 (patch)
treef087b302e1f25c61556170735fe9a70fe14ce9bb /src/backend/tty.rs
parent6ec9c72539684ed409427649a11837ab56a0250c (diff)
downloadniri-570bf1cb3c1f9ffc847359009c6061e062c72871.tar.gz
niri-570bf1cb3c1f9ffc847359009c6061e062c72871.tar.bz2
niri-570bf1cb3c1f9ffc847359009c6061e062c72871.zip
bump smithay
Diffstat (limited to 'src/backend/tty.rs')
-rw-r--r--src/backend/tty.rs39
1 files changed, 15 insertions, 24 deletions
diff --git a/src/backend/tty.rs b/src/backend/tty.rs
index 0654f4f0..dc0954d3 100644
--- a/src/backend/tty.rs
+++ b/src/backend/tty.rs
@@ -24,9 +24,9 @@ use smithay::backend::drm::{
DrmDevice, DrmDeviceFd, DrmEvent, DrmEventMetadata, DrmEventTime, DrmNode, NodeType,
};
use smithay::backend::egl::context::ContextPriority;
-use smithay::backend::egl::{EGLContext, EGLDevice, EGLDisplay};
+use smithay::backend::egl::{EGLDevice, EGLDisplay};
use smithay::backend::libinput::{LibinputInputBackend, LibinputSessionInterface};
-use smithay::backend::renderer::gles::{Capability, GlesRenderer};
+use smithay::backend::renderer::gles::GlesRenderer;
use smithay::backend::renderer::multigpu::gbm::GbmGlesBackend;
use smithay::backend::renderer::multigpu::{GpuManager, MultiFrame, MultiRenderer};
use smithay::backend::renderer::{DebugFlags, ImportDma, ImportEgl, Renderer};
@@ -148,7 +148,16 @@ impl OutputDevice {
builder.add_connector(connector);
builder.add_crtc(*crtc);
let planes = self.drm.planes(crtc).map_err(LeaseRejected::with_cause)?;
- builder.add_plane(planes.primary.handle);
+ let (primary_plane, primary_plane_claim) = planes
+ .primary
+ .iter()
+ .find_map(|plane| {
+ self.drm
+ .claim_plane(plane.handle, *crtc)
+ .map(|claim| (plane, claim))
+ })
+ .ok_or_else(LeaseRejected::default)?;
+ builder.add_plane(primary_plane.handle, primary_plane_claim);
}
Ok(builder)
}
@@ -239,25 +248,7 @@ impl Tty {
})
.unwrap();
- let config_ = config.clone();
- let create_renderer = move |display: &EGLDisplay| {
- let color_transforms = config_
- .borrow()
- .debug
- .enable_color_transformations_capability;
-
- let egl_context = EGLContext::new_with_priority(display, ContextPriority::High)?;
- let gles = if color_transforms {
- unsafe { GlesRenderer::new(egl_context)? }
- } else {
- let capabilities = unsafe { GlesRenderer::supported_capabilities(&egl_context) }?
- .into_iter()
- .filter(|c| *c != Capability::ColorTransformations);
- unsafe { GlesRenderer::with_capabilities(egl_context, capabilities)? }
- };
- Ok(gles)
- };
- let api = GbmGlesBackend::with_factory(Box::new(create_renderer));
+ let api = GbmGlesBackend::with_context_priority(ContextPriority::High);
let gpu_manager = GpuManager::new(api).context("error creating the GPU manager")?;
let (primary_node, primary_render_node) = primary_node_from_config(&config.borrow())
@@ -1987,8 +1978,8 @@ fn surface_dmabuf_feedback(
let surface = compositor.surface();
let planes = surface.planes();
- let plane_formats = planes
- .primary
+ let plane_formats = surface
+ .plane_info()
.formats
.iter()
.chain(planes.overlay.iter().flat_map(|p| p.formats.iter()))