chore: format for Rust 2024

This commit is contained in:
Vukašin Vojinović 2025-10-16 18:53:57 +02:00 committed by Victoria Brekenfeld
parent 0a8da05847
commit 1f7f0c70b7
99 changed files with 414 additions and 442 deletions

View file

@ -3,7 +3,7 @@
use crate::{
backend::{
kms::render::gles::GbmGlowBackend,
render::{init_shaders, output_elements, CursorMode, GlMultiRenderer, CLEAR_COLOR},
render::{CLEAR_COLOR, CursorMode, GlMultiRenderer, init_shaders, output_elements},
},
config::{CompTransformDef, EdidProduct, ScreenFilter},
shell::Shell,
@ -17,17 +17,17 @@ use libc::dev_t;
use smithay::{
backend::{
allocator::{
Format, Fourcc,
format::FormatSet,
gbm::{GbmAllocator, GbmDevice},
Format, Fourcc,
},
drm::{
DrmDevice, DrmDeviceFd, DrmEvent, DrmNode, NodeType,
compositor::{FrameError, FrameFlags},
exporter::gbm::GbmFramebufferExporter,
output::{DrmOutputManager, LockedDrmOutputManager},
DrmDevice, DrmDeviceFd, DrmEvent, DrmNode, NodeType,
},
egl::{context::ContextPriority, EGLContext, EGLDevice, EGLDisplay},
egl::{EGLContext, EGLDevice, EGLDisplay, context::ContextPriority},
renderer::glow::GlowRenderer,
session::Session,
},
@ -35,10 +35,10 @@ use smithay::{
output::{Mode as OutputMode, Output, PhysicalProperties, Scale, Subpixel},
reexports::{
calloop::{LoopHandle, RegistrationToken},
drm::control::{connector, crtc, Device as ControlDevice, ModeTypeFlags},
drm::control::{Device as ControlDevice, ModeTypeFlags, connector, crtc},
gbm::BufferObjectFlags as GbmBufferFlags,
rustix::fs::OFlags,
wayland_server::{protocol::wl_buffer::WlBuffer, DisplayHandle, Weak},
wayland_server::{DisplayHandle, Weak, protocol::wl_buffer::WlBuffer},
},
utils::{Clock, DevPath, DeviceFd, Monotonic, Point, Transform},
wayland::drm_lease::{DrmLease, DrmLeaseState},
@ -52,7 +52,7 @@ use std::{
fmt,
os::fd::OwnedFd,
path::Path,
sync::{atomic::AtomicBool, mpsc::Receiver, Arc, RwLock},
sync::{Arc, RwLock, atomic::AtomicBool, mpsc::Receiver},
time::Duration,
};

View file

@ -1,15 +1,15 @@
// SPDX-License-Identifier: GPL-3.0-only
use anyhow::{anyhow, Context, Result};
use anyhow::{Context, Result, anyhow};
use libdisplay_info::{edid::DisplayDescriptorTag, info::Info};
use smithay::{
reexports::drm::control::{
AtomicCommitFlags, Device as ControlDevice, Mode, ModeFlags, PlaneType, ResourceHandle,
atomic::AtomicModeReq,
connector::{self, State as ConnectorState},
crtc,
dumbbuffer::DumbBuffer,
property, AtomicCommitFlags, Device as ControlDevice, Mode, ModeFlags, PlaneType,
ResourceHandle,
property,
},
utils::Transform,
};

View file

@ -14,21 +14,21 @@ use indexmap::IndexMap;
use render::gles::GbmGlowBackend;
use smithay::{
backend::{
allocator::{dmabuf::Dmabuf, format::FormatSet, Buffer},
drm::{output::DrmOutputRenderElements, DrmDeviceFd, DrmNode, NodeType, VrrSupport},
allocator::{Buffer, dmabuf::Dmabuf, format::FormatSet},
drm::{DrmDeviceFd, DrmNode, NodeType, VrrSupport, output::DrmOutputRenderElements},
egl::{EGLContext, EGLDevice, EGLDisplay},
input::InputEvent,
libinput::{LibinputInputBackend, LibinputSessionInterface},
renderer::{glow::GlowRenderer, multigpu::GpuManager},
session::{libseat::LibSeatSession, Event as SessionEvent, Session},
udev::{primary_gpu, UdevBackend, UdevEvent},
session::{Event as SessionEvent, Session, libseat::LibSeatSession},
udev::{UdevBackend, UdevEvent, primary_gpu},
},
output::Output,
reexports::{
calloop::{Dispatcher, EventLoop, LoopHandle},
drm::{
control::{connector::Interface, crtc, Device as _},
Device as _,
control::{Device as _, connector::Interface, crtc},
},
input::{self, Libinput},
wayland_server::{Client, DisplayHandle},
@ -36,7 +36,7 @@ use smithay::{
utils::{Clock, DevPath, Monotonic, Size},
wayland::{
dmabuf::DmabufGlobal,
drm_syncobj::{supports_syncobj_eventfd, DrmSyncobjState},
drm_syncobj::{DrmSyncobjState, supports_syncobj_eventfd},
relative_pointer::RelativePointerManagerState,
},
};
@ -46,7 +46,7 @@ use tracing::{debug, error, info, trace, warn};
use std::{
collections::{HashMap, HashSet},
path::Path,
sync::{atomic::AtomicBool, Arc, RwLock},
sync::{Arc, RwLock, atomic::AtomicBool},
};
mod device;
@ -58,7 +58,7 @@ use device::*;
pub(crate) use surface::Surface;
pub use surface::Timings;
use super::render::{output_elements, CursorMode, CLEAR_COLOR};
use super::render::{CLEAR_COLOR, CursorMode, output_elements};
#[derive(Debug)]
pub struct KmsState {
@ -551,8 +551,7 @@ impl KmsState {
Err(err) => {
trace!(
?err,
"Failed to import dmabuf on {:?}",
device.inner.render_node
"Failed to import dmabuf on {:?}", device.inner.render_node
);
last_err = err;
}

View file

@ -1,19 +1,19 @@
// SPDX-License-Identifier: GPL-3.0-only
use smithay::backend::{
SwapBuffersError,
allocator::{
Allocator,
dmabuf::{AnyError, Dmabuf, DmabufAllocator},
gbm::GbmAllocator,
Allocator,
},
drm::{CreateDrmNodeError, DrmNode},
renderer::{
RendererSuper,
gles::{GlesError, GlesRenderer},
glow::GlowRenderer,
multigpu::{ApiDevice, Error as MultiError, GraphicsApi},
RendererSuper,
},
SwapBuffersError,
};
use std::{borrow::Borrow, cell::Cell};
use std::{

View file

@ -7,9 +7,9 @@ use std::{
use smithay::backend::{
allocator::{
Allocator,
dmabuf::{AnyError, Dmabuf, DmabufAllocator},
gbm::{GbmAllocator, GbmBufferFlags, GbmDevice},
Allocator,
},
drm::DrmNode,
renderer::{

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
use anyhow::{anyhow, Context, Result};
use anyhow::{Context, Result, anyhow};
use smithay::{
backend::{
allocator::format::FormatSet,
@ -8,7 +8,7 @@ use smithay::{
},
reexports::{
calloop::RegistrationToken,
wayland_server::{backend::GlobalId, Client, DisplayHandle},
wayland_server::{Client, DisplayHandle, backend::GlobalId},
},
wayland::{
dmabuf::{DmabufFeedbackBuilder, DmabufGlobal},
@ -18,7 +18,7 @@ use smithay::{
use std::sync::Arc;
use tracing::{info, warn};
use crate::state::{advertised_node_for_client, ClientState, State};
use crate::state::{ClientState, State, advertised_node_for_client};
#[derive(Debug)]
pub struct Socket {

View file

@ -2,9 +2,10 @@
use crate::{
backend::render::{
CLEAR_COLOR, CursorMode, GlMultiError, GlMultiRenderer, PostprocessOutputConfig,
PostprocessShader, PostprocessState,
element::{CosmicElement, DamageElement},
init_shaders, output_elements, CursorMode, GlMultiError, GlMultiRenderer,
PostprocessOutputConfig, PostprocessShader, PostprocessState, CLEAR_COLOR,
init_shaders, output_elements,
},
config::ScreenFilter,
shell::Shell,
@ -13,7 +14,7 @@ use crate::{
wayland::{
handlers::{
compositor::recursive_frame_time_estimation,
screencopy::{submit_buffer, FrameHolder, PendingImageCopyData, SessionData},
screencopy::{FrameHolder, PendingImageCopyData, SessionData, submit_buffer},
},
protocols::screencopy::{
FailureReason, Frame as ScreencopyFrame, SessionRef as ScreencopySessionRef,
@ -27,11 +28,12 @@ use cosmic_comp_config::output::comp::AdaptiveSync;
use smithay::{
backend::{
allocator::{
Fourcc,
format::FormatSet,
gbm::{GbmAllocator, GbmBuffer},
Fourcc,
},
drm::{
DrmDeviceFd, DrmEventMetadata, DrmEventTime, DrmNode, VrrSupport,
compositor::{
BlitFrameResultError, FrameError, FrameFlags, PrimaryPlaneElement,
RenderFrameResult,
@ -39,38 +41,36 @@ use smithay::{
exporter::gbm::GbmFramebufferExporter,
gbm::GbmFramebuffer,
output::DrmOutput,
DrmDeviceFd, DrmEventMetadata, DrmEventTime, DrmNode, VrrSupport,
},
egl::EGLContext,
renderer::{
buffer_dimensions, buffer_type,
Bind, Blit, BufferType, Frame, ImportDma, Offscreen, Renderer, RendererSuper, Texture,
TextureFilter, buffer_dimensions, buffer_type,
damage::Error as RenderError,
element::{
Element, Kind, RenderElementStates,
texture::TextureRenderElement,
utils::{
constrain_render_elements, ConstrainAlign, ConstrainScaleBehavior, Relocate,
RelocateRenderElement,
ConstrainAlign, ConstrainScaleBehavior, Relocate, RelocateRenderElement,
constrain_render_elements,
},
Element, Kind, RenderElementStates,
},
gles::{
element::TextureShaderElement, GlesRenderbuffer, GlesRenderer, GlesTexture, Uniform,
GlesRenderbuffer, GlesRenderer, GlesTexture, Uniform, element::TextureShaderElement,
},
glow::GlowRenderer,
multigpu::{ApiDevice, Error as MultiError, GpuManager},
sync::SyncPoint,
utils::with_renderer_surface_state,
Bind, Blit, BufferType, Frame, ImportDma, Offscreen, Renderer, RendererSuper, Texture,
TextureFilter,
},
},
desktop::utils::OutputPresentationFeedback,
output::{Output, OutputNoMode},
reexports::{
calloop::{
channel::{channel, Event, Sender},
timer::{TimeoutAction, Timer},
EventLoop, LoopHandle, RegistrationToken,
channel::{Event, Sender, channel},
timer::{TimeoutAction, Timer},
},
drm::control::{connector, crtc},
wayland_protocols::wp::{
@ -81,7 +81,7 @@ use smithay::{
},
utils::{Clock, Monotonic, Physical, Point, Rectangle, Transform},
wayland::{
dmabuf::{get_dmabuf, DmabufFeedbackBuilder},
dmabuf::{DmabufFeedbackBuilder, get_dmabuf},
presentation::Refresh,
seat::WaylandFocus,
shm::{shm_format_to_fourcc, with_buffer_contents},
@ -91,12 +91,12 @@ use tracing::{error, info, trace, warn};
use std::{
borrow::{Borrow, BorrowMut},
collections::{hash_map, HashMap, HashSet},
collections::{HashMap, HashSet, hash_map},
mem,
sync::{
Arc, RwLock,
atomic::{AtomicBool, Ordering},
mpsc::{Receiver, SyncSender},
Arc, RwLock,
},
thread::JoinHandle,
time::Duration,