From f9f8af10a0e26ebb496e21f347307ec587eec51f Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Thu, 15 Feb 2024 14:18:34 +0100 Subject: [PATCH] kms: Drop early_import as it seems to hurt performance --- src/backend/kms/mod.rs | 17 +++-------------- src/wayland/handlers/compositor.rs | 21 +-------------------- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/src/backend/kms/mod.rs b/src/backend/kms/mod.rs index 546d0827..f49caf0d 100644 --- a/src/backend/kms/mod.rs +++ b/src/backend/kms/mod.rs @@ -1229,7 +1229,9 @@ impl Surface { Ok(()) => { self.pending = true; } - Err(FrameError::EmptyFrame) => {} + Err(FrameError::EmptyFrame) => { + tracing::debug!("Stopped rendering"); + } Err(err) => { return Err(err).with_context(|| "Failed to submit result for display") } @@ -1517,19 +1519,6 @@ impl KmsState { .copied() } - pub fn try_early_import( - &mut self, - surface: &WlSurface, - output: &Output, - target: DrmNode, - shell: &Shell, - ) { - let render = render_node_for_output(&output, self.primary_node, target, &shell); - if let Err(err) = self.api.early_import(render, surface) { - trace!(?err, "Early import failed."); - } - } - pub fn dmabuf_imported( &mut self, _client: Option, diff --git a/src/wayland/handlers/compositor.rs b/src/wayland/handlers/compositor.rs index 8a3f9740..367f6525 100644 --- a/src/wayland/handlers/compositor.rs +++ b/src/wayland/handlers/compositor.rs @@ -1,9 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-only use crate::{ - shell::CosmicSurface, - state::{BackendData, ClientState}, - utils::prelude::*, + shell::CosmicSurface, state::ClientState, utils::prelude::*, wayland::protocols::screencopy::SessionType, }; use calloop::Interest; @@ -33,19 +31,6 @@ use std::sync::Mutex; use super::screencopy::PendingScreencopyBuffers; impl State { - fn early_import_surface(&mut self, surface: &WlSurface) { - let mut import_nodes = std::collections::HashSet::new(); - if let Some(output) = self.common.shell.visible_output_for_surface(&surface) { - if let BackendData::Kms(ref mut kms_state) = &mut self.backend { - if let Some(target) = kms_state.target_node_for_output(&output) { - if import_nodes.insert(target) { - kms_state.try_early_import(surface, &output, target, &self.common.shell); - } - } - } - } - } - fn toplevel_ensure_initial_configure(&mut self, toplevel: &ToplevelSurface) -> bool { // send the initial configure if relevant let initial_configure_sent = with_states(toplevel.wl_surface(), |states| { @@ -225,10 +210,6 @@ impl CompositorHandler for State { //handle window screencopy sessions self.schedule_window_session(surface); - // We need to know every potential output for importing to the right gpu and scheduling a render, - // so call this only after every potential surface map operation has been done. - self.early_import_surface(surface); - // and refresh smithays internal state self.common.shell.popups.commit(surface);