From ac3c09ba757a0ce6ae1c212c1b47fbf3d4e67be8 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 29 Apr 2021 09:07:45 +0300 Subject: [PATCH] Remove Platform::areOutputsEnabled() This flag is redundant. If an output is disabled, the compositor won't attempt to perform compositing on it. --- autotests/integration/kwin_wayland_test.cpp | 1 - src/composite.cpp | 6 +----- src/platform.h | 7 ------- src/plugins/platforms/drm/drm_backend.cpp | 11 ----------- src/plugins/platforms/drm/drm_backend.h | 1 - 5 files changed, 1 insertion(+), 25 deletions(-) diff --git a/autotests/integration/kwin_wayland_test.cpp b/autotests/integration/kwin_wayland_test.cpp index 284cbd643d..61422edd39 100644 --- a/autotests/integration/kwin_wayland_test.cpp +++ b/autotests/integration/kwin_wayland_test.cpp @@ -74,7 +74,6 @@ WaylandTestApplication::WaylandTestApplication(OperationMode mode, int &argc, ch WaylandTestApplication::~WaylandTestApplication() { setTerminating(); - kwinApp()->platform()->setOutputsEnabled(false); // need to unload all effects prior to destroying X connection as they might do X calls // also before destroy Workspace, as effects might call into Workspace if (effects) { diff --git a/src/composite.cpp b/src/composite.cpp index 6a90da11f2..9fcb33db69 100644 --- a/src/composite.cpp +++ b/src/composite.cpp @@ -586,11 +586,7 @@ void Compositor::addRepaintFull() void Compositor::handleFrameRequested(RenderLoop *renderLoop) { - // If outputs are disabled, we return to the event loop and - // continue processing events until the outputs are enabled again - if (kwinApp()->platform()->areOutputsEnabled()) { - composite(renderLoop); - } + composite(renderLoop); } void Compositor::composite(RenderLoop *renderLoop) diff --git a/src/platform.h b/src/platform.h index ef43cb115f..89f0b92f55 100644 --- a/src/platform.h +++ b/src/platform.h @@ -344,12 +344,6 @@ public: bool supportsPointerWarping() const { return m_pointerWarping; } - bool areOutputsEnabled() const { - return m_outputsEnabled; - } - void setOutputsEnabled(bool enabled) { - m_outputsEnabled = enabled; - } int initialOutputCount() const { return m_initialOutputCount; } @@ -583,7 +577,6 @@ private: QSize m_initialWindowSize; QByteArray m_deviceIdentifier; bool m_pointerWarping = false; - bool m_outputsEnabled = true; int m_initialOutputCount = 1; qreal m_initialOutputScale = 1; EGLDisplay m_eglDisplay; diff --git a/src/plugins/platforms/drm/drm_backend.cpp b/src/plugins/platforms/drm/drm_backend.cpp index 5795414017..b1dd60dab8 100644 --- a/src/plugins/platforms/drm/drm_backend.cpp +++ b/src/plugins/platforms/drm/drm_backend.cpp @@ -312,7 +312,6 @@ bool DrmBackend::updateOutputs() if (oldOutputs != m_outputs) { readOutputsConfiguration(); } - updateOutputsEnabled(); if (!m_outputs.isEmpty()) { emit screensQueried(); } @@ -443,7 +442,6 @@ void DrmBackend::enableOutput(DrmOutput *output, bool enable) emit output->gpu()->outputDisabled(output); emit outputDisabled(output); } - updateOutputsEnabled(); checkOutputsAreOn(); emit screensQueried(); } @@ -582,15 +580,6 @@ OpenGLBackend *DrmBackend::createOpenGLBackend() #endif } -void DrmBackend::updateOutputsEnabled() -{ - bool enabled = false; - for (auto it = m_enabledOutputs.constBegin(); it != m_enabledOutputs.constEnd(); ++it) { - enabled = enabled || (*it)->isDpmsEnabled(); - } - setOutputsEnabled(enabled); -} - QVector DrmBackend::supportedCompositors() const { if (selectedCompositor() != NoCompositing) { diff --git a/src/plugins/platforms/drm/drm_backend.h b/src/plugins/platforms/drm/drm_backend.h index 83f97407f2..e348716a16 100644 --- a/src/plugins/platforms/drm/drm_backend.h +++ b/src/plugins/platforms/drm/drm_backend.h @@ -91,7 +91,6 @@ private: void readOutputsConfiguration(); void writeOutputsConfiguration(); QString generateOutputConfigurationUuid() const; - void updateOutputsEnabled(); void handleUdevEvent(); DrmGpu *addGpu(std::unique_ptr device);