From a308997fd4baca8cd97dedd6b360b13195ec1f91 Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Wed, 12 Jul 2023 18:54:53 +0200 Subject: [PATCH] chore: Update smithay --- Cargo.lock | 16 +++++++++++++++- Cargo.toml | 2 +- src/backend/kms/mod.rs | 19 +++++++++++++++++++ src/backend/kms/socket.rs | 1 + src/backend/winit.rs | 1 + src/backend/x11.rs | 3 +++ src/config/mod.rs | 2 ++ src/shell/mod.rs | 1 + src/state.rs | 4 ++++ src/utils/iced.rs | 7 ++++++- src/wayland/protocols/drm.rs | 1 + src/wayland/protocols/output_configuration.rs | 3 +++ src/wayland/protocols/screencopy.rs | 1 + src/wayland/protocols/toplevel_info.rs | 1 + src/wayland/protocols/toplevel_management.rs | 1 + src/wayland/protocols/workspace.rs | 5 +++-- src/xwayland.rs | 1 + 17 files changed, 64 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8ef31141..1d8b9473 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3131,6 +3131,19 @@ name = "profiling" version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "332cd62e95873ea4f41f3dfd6bbbfc5b52aec892d7e8d534197c4720a0bbbab2" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a10adb8d151bb1280afb8bed41ae5db26be1b056964947133c7525b0bf39c0b0" +dependencies = [ + "quote", + "syn 1.0.109", +] [[package]] name = "puffin" @@ -3721,7 +3734,7 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "smithay" version = "0.3.0" -source = "git+https://github.com/smithay//smithay?rev=8d239c79ae#8d239c79ae5a7f08d6acbc17183c0576af3edd38" +source = "git+https://github.com/smithay//smithay?rev=901f64d01e#901f64d01e3dc4ed7448884b821748dbb1ab5455" dependencies = [ "appendlist", "ash", @@ -3746,6 +3759,7 @@ dependencies = [ "nix 0.26.2", "once_cell", "pkg-config", + "profiling", "rand", "scan_fmt", "scopeguard", diff --git a/Cargo.toml b/Cargo.toml index 3806abe2..9b082fb3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -80,4 +80,4 @@ debug = true lto = "fat" [patch."https://github.com/Smithay/smithay.git"] -smithay = { git = "https://github.com/smithay//smithay", rev = "8d239c79ae" } +smithay = { git = "https://github.com/smithay//smithay", rev = "901f64d01e" } diff --git a/src/backend/kms/mod.rs b/src/backend/kms/mod.rs index 783fe394..0a3fdcc8 100644 --- a/src/backend/kms/mod.rs +++ b/src/backend/kms/mod.rs @@ -80,6 +80,7 @@ use std::{ cell::RefCell, collections::{HashMap, HashSet}, ffi::CStr, + fmt, os::unix::io::FromRawFd, path::PathBuf, time::Duration, @@ -93,6 +94,7 @@ use super::render::{init_shaders, CursorMode, GlMultiRenderer}; // for now we assume we need at least 3ms const MIN_RENDER_TIME: Duration = Duration::from_millis(3); +#[derive(Debug)] pub struct KmsState { devices: HashMap, pub api: GpuManager>, @@ -113,6 +115,23 @@ pub struct Device { socket: Option, } +impl fmt::Debug for Device { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Device") + .field("render_node", &self.render_node) + .field("surfaces", &self.surfaces) + .field("drm", &self.drm) + .field("gbm", &self.gbm) + .field("allocator", &"...") + .field("formats", &self.formats) + .field("supports_atomic", &self.supports_atomic) + .field("event_token", &self.event_token) + .field("socket", &self.socket) + .finish() + } +} + +#[derive(Debug)] pub struct Surface { surface: Option, connector: connector::Handle, diff --git a/src/backend/kms/socket.rs b/src/backend/kms/socket.rs index b0f1c897..f8f4fde9 100644 --- a/src/backend/kms/socket.rs +++ b/src/backend/kms/socket.rs @@ -24,6 +24,7 @@ use crate::{ utils::prelude::*, }; +#[derive(Debug)] pub struct Socket { pub token: RegistrationToken, pub drm_global: GlobalId, diff --git a/src/backend/winit.rs b/src/backend/winit.rs index f1988b5b..afba09d8 100644 --- a/src/backend/winit.rs +++ b/src/backend/winit.rs @@ -38,6 +38,7 @@ use crate::state::Fps; use super::render::{init_shaders, CursorMode}; +#[derive(Debug)] pub struct WinitState { // The winit backend currently has no notion of multiple windows pub backend: WinitGraphicsBackend, diff --git a/src/backend/x11.rs b/src/backend/x11.rs index 103a48a4..0d133b46 100644 --- a/src/backend/x11.rs +++ b/src/backend/x11.rs @@ -47,11 +47,13 @@ use crate::state::Fps; use super::render::init_shaders; +#[derive(Debug)] enum Allocator { Gbm(GbmAllocator), Vulkan(PhysicalDevice), } +#[derive(Debug)] pub struct X11State { allocator: Allocator, _egl: EGLDisplay, @@ -204,6 +206,7 @@ impl X11State { } } +#[derive(Debug)] pub struct Surface { window: Window, damage_tracker: OutputDamageTracker, diff --git a/src/config/mod.rs b/src/config/mod.rs index ecf8a5ee..663b4e62 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -29,6 +29,7 @@ use tracing::{debug, error, info, warn}; mod types; pub use self::types::*; +#[derive(Debug)] pub struct Config { pub static_conf: StaticConfig, pub dynamic_conf: DynamicConfig, @@ -60,6 +61,7 @@ pub enum WorkspaceLayout { Horizontal, } +#[derive(Debug)] pub struct DynamicConfig { outputs: (Option, OutputsConfig), inputs: (Option, InputsConfig), diff --git a/src/shell/mod.rs b/src/shell/mod.rs index 932fd0b6..bc6bc931 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -134,6 +134,7 @@ impl ResizeMode { } } +#[derive(Debug)] pub struct Shell { pub popups: PopupManager, pub outputs: Vec, diff --git a/src/state.rs b/src/state.rs index 9382fb0f..4ec87119 100644 --- a/src/state.rs +++ b/src/state.rs @@ -109,11 +109,13 @@ pub struct Data { pub state: State, } +#[derive(Debug)] pub struct State { pub backend: BackendData, pub common: Common, } +#[derive(Debug)] pub struct Common { pub config: Config, @@ -156,6 +158,7 @@ pub struct Common { pub xwayland_state: Option, } +#[derive(Debug)] pub enum BackendData { X11(X11State), Winit(WinitState), @@ -677,6 +680,7 @@ pub struct Egui { pub state: smithay_egui::EguiState, } +#[derive(Debug)] pub struct Fps { #[cfg(feature = "debug")] pub rd: Option>, diff --git a/src/utils/iced.rs b/src/utils/iced.rs index 53ceb470..91bdd5f6 100644 --- a/src/utils/iced.rs +++ b/src/utils/iced.rs @@ -56,9 +56,14 @@ use smithay::{ }, }; -#[derive(Debug)] pub struct IcedElement(Arc>>); +impl fmt::Debug for IcedElement

{ + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Debug::fmt(&self.0, f) + } +} + // SAFETY: We cannot really be sure about `iced_native::program::State` sadly, // but the rest should be fine. unsafe impl Send for IcedElementInternal

{} diff --git a/src/wayland/protocols/drm.rs b/src/wayland/protocols/drm.rs index 17259828..40bf651f 100644 --- a/src/wayland/protocols/drm.rs +++ b/src/wayland/protocols/drm.rs @@ -38,6 +38,7 @@ use tracing::trace; use std::{convert::TryFrom, path::PathBuf, sync::Arc}; +#[derive(Debug)] pub struct WlDrmState; /// Data associated with a drm global. diff --git a/src/wayland/protocols/output_configuration.rs b/src/wayland/protocols/output_configuration.rs index 9a98c52d..8be6c734 100644 --- a/src/wayland/protocols/output_configuration.rs +++ b/src/wayland/protocols/output_configuration.rs @@ -27,6 +27,7 @@ use std::{ }, }; +#[derive(Debug)] pub struct OutputConfigurationState { outputs: Vec, removed_outputs: Vec, @@ -48,12 +49,14 @@ pub struct OutputMngrGlobalData { filter: Box Fn(&'a Client) -> bool + Send + Sync>, } +#[derive(Debug)] struct OutputMngrInstance { obj: ZwlrOutputManagerV1, active: Arc, heads: Vec, } +#[derive(Debug)] struct OutputHeadInstance { output: Output, head: ZwlrOutputHeadV1, diff --git a/src/wayland/protocols/screencopy.rs b/src/wayland/protocols/screencopy.rs index d8fefa3d..d0065f60 100644 --- a/src/wayland/protocols/screencopy.rs +++ b/src/wayland/protocols/screencopy.rs @@ -38,6 +38,7 @@ use super::{ }; /// Screencopy global state +#[derive(Debug)] pub struct ScreencopyState { global: GlobalId, } diff --git a/src/wayland/protocols/toplevel_info.rs b/src/wayland/protocols/toplevel_info.rs index 3f988deb..734e3cbc 100644 --- a/src/wayland/protocols/toplevel_info.rs +++ b/src/wayland/protocols/toplevel_info.rs @@ -29,6 +29,7 @@ pub trait Window: IsAlive + Clone + Send { fn user_data(&self) -> &UserDataMap; } +#[derive(Debug)] pub struct ToplevelInfoState { dh: DisplayHandle, pub(super) toplevels: Vec, diff --git a/src/wayland/protocols/toplevel_management.rs b/src/wayland/protocols/toplevel_management.rs index ffb807c0..3ac3dd77 100644 --- a/src/wayland/protocols/toplevel_management.rs +++ b/src/wayland/protocols/toplevel_management.rs @@ -18,6 +18,7 @@ use cosmic_protocols::toplevel_management::v1::server::zcosmic_toplevel_manager_ use super::toplevel_info::{window_from_handle, ToplevelInfoHandler, ToplevelState, Window}; +#[derive(Debug)] pub struct ToplevelManagementState { instances: Vec, capabilities: Vec, diff --git a/src/wayland/protocols/workspace.rs b/src/wayland/protocols/workspace.rs index aeaa4177..ee358773 100644 --- a/src/wayland/protocols/workspace.rs +++ b/src/wayland/protocols/workspace.rs @@ -21,6 +21,7 @@ pub use cosmic_protocols::workspace::v1::server::{ zcosmic_workspace_handle_v1::ZcosmicWorkspaceCapabilitiesV1 as WorkspaceCapabilities, }; +#[derive(Debug)] pub struct WorkspaceState where D: GlobalDispatch @@ -50,7 +51,7 @@ where crate::utils::id_gen!(next_group_id, GROUP_ID, GROUP_IDS); crate::utils::id_gen!(next_workspace_id, WORKSPACE_ID, WORKSPACE_IDS); -#[derive(Default)] +#[derive(Debug, Default)] pub struct WorkspaceGroup { id: usize, instances: Vec, @@ -72,7 +73,7 @@ pub struct WorkspaceGroupDataInner { } pub type WorkspaceGroupData = Mutex; -#[derive(Default)] +#[derive(Debug, Default)] pub struct Workspace { id: usize, instances: Vec, diff --git a/src/xwayland.rs b/src/xwayland.rs index 7285b6eb..0f4aea12 100644 --- a/src/xwayland.rs +++ b/src/xwayland.rs @@ -29,6 +29,7 @@ use smithay::{ }; use tracing::{error, trace, warn}; +#[derive(Debug)] pub struct XWaylandState { pub xwm: Option, pub display: u32,