diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-06-21 07:53:41 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-06-21 08:55:46 +0300 |
| commit | 198b5a502dbee0c4b3ce6168a5c7a9cfe017930a (patch) | |
| tree | 76045d92127a050f3ae04a85e4afc5a65586233f /src | |
| parent | cb0ebd35ce237a23a32aeb50ec475645db00bcac (diff) | |
| download | niri-198b5a502dbee0c4b3ce6168a5c7a9cfe017930a.tar.gz niri-198b5a502dbee0c4b3ce6168a5c7a9cfe017930a.tar.bz2 niri-198b5a502dbee0c4b3ce6168a5c7a9cfe017930a.zip | |
Update dependencies
Diffstat (limited to 'src')
| -rw-r--r-- | src/backend/tty.rs | 28 | ||||
| -rw-r--r-- | src/backend/winit.rs | 6 |
2 files changed, 19 insertions, 15 deletions
diff --git a/src/backend/tty.rs b/src/backend/tty.rs index 05164041..ff806723 100644 --- a/src/backend/tty.rs +++ b/src/backend/tty.rs @@ -16,8 +16,9 @@ use bytemuck::cast_slice_mut; use libc::dev_t; use niri_config::Config; use smithay::backend::allocator::dmabuf::Dmabuf; +use smithay::backend::allocator::format::FormatSet; use smithay::backend::allocator::gbm::{GbmAllocator, GbmBufferFlags, GbmDevice}; -use smithay::backend::allocator::{Format, Fourcc}; +use smithay::backend::allocator::Fourcc; use smithay::backend::drm::compositor::{DrmCompositor, PrimaryPlaneElement}; use smithay::backend::drm::{ DrmDevice, DrmDeviceFd, DrmEvent, DrmEventMetadata, DrmEventTime, DrmNode, NodeType, @@ -516,7 +517,7 @@ impl Tty { niri.layout.update_shaders(); // Create the dmabuf global. - let primary_formats = renderer.dmabuf_formats().collect::<HashSet<_>>(); + let primary_formats = renderer.dmabuf_formats(); let default_feedback = DmabufFeedbackBuilder::new(render_node.dev_id(), primary_formats.clone()) .build() @@ -880,11 +881,13 @@ impl Tty { // Filter out the CCS modifiers as they have increased bandwidth, causing some monitor // configurations to stop working. - let mut render_formats = render_formats.clone(); - render_formats.retain(|format| { - !matches!( - format.modifier, - Modifier::I915_y_tiled_ccs + let render_formats = render_formats + .iter() + .copied() + .filter(|format| { + !matches!( + format.modifier, + Modifier::I915_y_tiled_ccs // I915_FORMAT_MOD_Yf_TILED_CCS | Modifier::Unrecognized(0x100000000000005) | Modifier::I915_y_tiled_gen12_rc_ccs @@ -897,8 +900,9 @@ impl Tty { | Modifier::Unrecognized(0x10000000000000b) // I915_FORMAT_MOD_4_TILED_DG2_RC_CCS_CC | Modifier::Unrecognized(0x10000000000000c) - ) - }); + ) + }) + .collect::<FormatSet>(); // Create the compositor. let mut compositor = DrmCompositor::new( @@ -921,7 +925,7 @@ impl Tty { let mut dmabuf_feedback = None; if let Ok(primary_renderer) = self.gpu_manager.single_renderer(&self.primary_render_node) { - let primary_formats = primary_renderer.dmabuf_formats().collect::<HashSet<_>>(); + let primary_formats = primary_renderer.dmabuf_formats(); match surface_dmabuf_feedback( &compositor, @@ -1945,7 +1949,7 @@ fn primary_node_from_config(config: &Config) -> Option<(DrmNode, DrmNode)> { fn surface_dmabuf_feedback( compositor: &GbmDrmCompositor, - primary_formats: HashSet<Format>, + primary_formats: FormatSet, primary_render_node: DrmNode, surface_render_node: DrmNode, ) -> Result<SurfaceDmabufFeedback, io::Error> { @@ -1958,7 +1962,7 @@ fn surface_dmabuf_feedback( .iter() .chain(planes.overlay.iter().flat_map(|p| p.formats.iter())) .copied() - .collect::<HashSet<_>>(); + .collect::<FormatSet>(); // 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. diff --git a/src/backend/winit.rs b/src/backend/winit.rs index 432904e2..677cb10c 100644 --- a/src/backend/winit.rs +++ b/src/backend/winit.rs @@ -15,7 +15,7 @@ use smithay::output::{Mode, Output, PhysicalProperties, Subpixel}; use smithay::reexports::calloop::LoopHandle; use smithay::reexports::wayland_protocols::wp::presentation_time::server::wp_presentation_feedback; use smithay::reexports::winit::dpi::LogicalSize; -use smithay::reexports::winit::window::WindowBuilder; +use smithay::reexports::winit::window::Window; use super::{IpcOutputMap, RenderResult}; use crate::niri::{Niri, RedrawState, State}; @@ -36,11 +36,11 @@ impl Winit { config: Rc<RefCell<Config>>, event_loop: LoopHandle<State>, ) -> Result<Self, winit::Error> { - let builder = WindowBuilder::new() + let builder = Window::default_attributes() .with_inner_size(LogicalSize::new(1280.0, 800.0)) // .with_resizable(false) .with_title("niri"); - let (backend, winit) = winit::init_from_builder(builder)?; + let (backend, winit) = winit::init_from_attributes(builder)?; let output = Output::new( "winit".to_string(), |
