From 3fc74f103addadb0cb022d0a7442a51cd7c57d07 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 16 Sep 2021 12:45:58 +0200 Subject: [PATCH] platforms/drm: drop some unused methods --- .../platforms/drm/drm_abstract_output.h | 1 - src/plugins/platforms/drm/drm_output.cpp | 12 -------- src/plugins/platforms/drm/drm_output.h | 1 - src/plugins/platforms/drm/drm_pipeline.cpp | 28 ++----------------- src/plugins/platforms/drm/drm_pipeline.h | 14 ---------- .../platforms/drm/drm_virtual_output.cpp | 12 -------- .../platforms/drm/drm_virtual_output.h | 1 - 7 files changed, 2 insertions(+), 67 deletions(-) diff --git a/src/plugins/platforms/drm/drm_abstract_output.h b/src/plugins/platforms/drm/drm_abstract_output.h index a48a744147..e1e49e0bb0 100644 --- a/src/plugins/platforms/drm/drm_abstract_output.h +++ b/src/plugins/platforms/drm/drm_abstract_output.h @@ -33,7 +33,6 @@ public: virtual bool needsSoftwareTransformation() const = 0; virtual bool isDpmsEnabled() const = 0; - virtual GbmBuffer *currentBuffer() const = 0; virtual QSize sourceSize() const = 0; virtual bool isFormatSupported(uint32_t drmFormat) const = 0; virtual QVector supportedModifiers(uint32_t drmFormat) const = 0; diff --git a/src/plugins/platforms/drm/drm_output.cpp b/src/plugins/platforms/drm/drm_output.cpp index 907e33975b..527e3244cf 100644 --- a/src/plugins/platforms/drm/drm_output.cpp +++ b/src/plugins/platforms/drm/drm_output.cpp @@ -12,9 +12,6 @@ #include "drm_object_connector.h" #include "drm_gpu.h" #include "drm_pipeline.h" -#if HAVE_GBM -#include "drm_buffer_gbm.h" -#endif #include "composite.h" #include "cursor.h" @@ -436,15 +433,6 @@ DrmPipeline *DrmOutput::pipeline() const return m_pipeline; } -GbmBuffer *DrmOutput::currentBuffer() const -{ -#if HAVE_GBM - return dynamic_cast(m_pipeline->currentBuffer()); -#else - return nullptr; -#endif -} - bool DrmOutput::isDpmsEnabled() const { return m_pipeline->isActive(); diff --git a/src/plugins/platforms/drm/drm_output.h b/src/plugins/platforms/drm/drm_output.h index 868e83002e..eda34fc4b0 100644 --- a/src/plugins/platforms/drm/drm_output.h +++ b/src/plugins/platforms/drm/drm_output.h @@ -54,7 +54,6 @@ public: DrmPipeline *pipeline() const; void setPipeline(DrmPipeline *pipeline); - GbmBuffer *currentBuffer() const override; QSize sourceSize() const override; bool isFormatSupported(uint32_t drmFormat) const override; QVector supportedModifiers(uint32_t drmFormat) const override; diff --git a/src/plugins/platforms/drm/drm_pipeline.cpp b/src/plugins/platforms/drm/drm_pipeline.cpp index c5085ea91c..b6966490ef 100644 --- a/src/plugins/platforms/drm/drm_pipeline.cpp +++ b/src/plugins/platforms/drm/drm_pipeline.cpp @@ -71,18 +71,9 @@ void DrmPipeline::setup() } } -bool DrmPipeline::test(const QVector &pipelines) -{ - if (m_gpu->atomicModeSetting()) { - return checkTestBuffer() && commitPipelines(pipelines, CommitMode::Test); - } else { - return true; - } -} - bool DrmPipeline::test() { - return test(m_gpu->pipelines()); + return checkTestBuffer() && commitPipelines(m_gpu->pipelines(), CommitMode::Test); } bool DrmPipeline::present(const QSharedPointer &buffer) @@ -217,7 +208,7 @@ bool DrmPipeline::populateAtomicValues(drmModeAtomicReq *req, uint32_t &flags) bool DrmPipeline::presentLegacy() { - if ((!currentBuffer() || currentBuffer()->needsModeChange(m_primaryBuffer.get())) && !modeset(m_connector->currentModeIndex())) { + if ((!m_crtc->current() || m_crtc->current()->needsModeChange(m_primaryBuffer.get())) && !modeset(m_connector->currentModeIndex())) { return false; } m_lastFlags = DRM_MODE_PAGE_FLIP_EVENT; @@ -532,11 +523,6 @@ DrmPlane *DrmPipeline::primaryPlane() const return m_primaryPlane; } -DrmBuffer *DrmPipeline::currentBuffer() const -{ - return m_primaryPlane ? m_primaryPlane->current().get() : m_crtc->current().get(); -} - void DrmPipeline::pageFlipped() { m_crtc->flipBuffer(); @@ -566,16 +552,6 @@ void DrmPipeline::updateProperties() m_cursor.dirtyPos = true; } -bool DrmPipeline::isConnected() const -{ - if (m_primaryPlane) { - return m_connector->getProp(DrmConnector::PropertyIndex::CrtcId)->current() == m_crtc->id() - && m_primaryPlane->getProp(DrmPlane::PropertyIndex::CrtcId)->current() == m_crtc->id(); - } else { - return false; - } -} - bool DrmPipeline::isFormatSupported(uint32_t drmFormat) const { return m_formats.contains(drmFormat); diff --git a/src/plugins/platforms/drm/drm_pipeline.h b/src/plugins/platforms/drm/drm_pipeline.h index 784c7149ce..5938693d8f 100644 --- a/src/plugins/platforms/drm/drm_pipeline.h +++ b/src/plugins/platforms/drm/drm_pipeline.h @@ -41,24 +41,12 @@ public: */ void setup(); - /** - * checks if the connector(s) and plane(s) are set to the CRTC(s) - * always returns false in legacy mode - */ - bool isConnected() const; - /** * tests the pending commit first and commits it if the test passes * if the test fails, there is a guarantee for no lasting changes */ bool present(const QSharedPointer &buffer); - /** - * tests the pending commit - * always returns true in legacy mode! - */ - bool test(const QVector &pipelines); - bool modeset(int modeIndex); bool setCursor(const QSharedPointer &buffer, const QPoint &hotspot = QPoint()); bool setActive(bool enable); @@ -78,8 +66,6 @@ public: DrmCrtc *crtc() const; DrmPlane *primaryPlane() const; - DrmBuffer *currentBuffer() const; - void pageFlipped(); void printDebugInfo() const; QSize sourceSize() const; diff --git a/src/plugins/platforms/drm/drm_virtual_output.cpp b/src/plugins/platforms/drm/drm_virtual_output.cpp index 2b141a6601..8fd76df907 100644 --- a/src/plugins/platforms/drm/drm_virtual_output.cpp +++ b/src/plugins/platforms/drm/drm_virtual_output.cpp @@ -14,9 +14,6 @@ #include "drm_gpu.h" #include "drm_backend.h" #include "logging.h" -#if HAVE_GBM -#include "drm_buffer_gbm.h" -#endif namespace KWin { @@ -95,15 +92,6 @@ QSize DrmVirtualOutput::sourceSize() const return pixelSize(); } -GbmBuffer *DrmVirtualOutput::currentBuffer() const -{ -#if HAVE_GBM - return dynamic_cast(m_currentBuffer.get()); -#else - return nullptr; -#endif -} - bool DrmVirtualOutput::isFormatSupported(uint32_t drmFormat) const { Q_UNUSED(drmFormat); diff --git a/src/plugins/platforms/drm/drm_virtual_output.h b/src/plugins/platforms/drm/drm_virtual_output.h index ac967f2398..098889c40a 100644 --- a/src/plugins/platforms/drm/drm_virtual_output.h +++ b/src/plugins/platforms/drm/drm_virtual_output.h @@ -28,7 +28,6 @@ public: ~DrmVirtualOutput() override; bool present(const QSharedPointer &buffer, QRegion damagedRegion) override; - GbmBuffer *currentBuffer() const override; QSize sourceSize() const override; bool isDpmsEnabled() const override;