platforms/drm: drop some unused methods

This commit is contained in:
Xaver Hugl 2021-09-16 12:45:58 +02:00
parent 99cd923e4a
commit 3fc74f103a
7 changed files with 2 additions and 67 deletions

View file

@ -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<uint64_t> supportedModifiers(uint32_t drmFormat) const = 0;

View file

@ -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<GbmBuffer*>(m_pipeline->currentBuffer());
#else
return nullptr;
#endif
}
bool DrmOutput::isDpmsEnabled() const
{
return m_pipeline->isActive();

View file

@ -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<uint64_t> supportedModifiers(uint32_t drmFormat) const override;

View file

@ -71,18 +71,9 @@ void DrmPipeline::setup()
}
}
bool DrmPipeline::test(const QVector<DrmPipeline*> &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<DrmBuffer> &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);

View file

@ -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<DrmBuffer> &buffer);
/**
* tests the pending commit
* always returns true in legacy mode!
*/
bool test(const QVector<DrmPipeline*> &pipelines);
bool modeset(int modeIndex);
bool setCursor(const QSharedPointer<DrmDumbBuffer> &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;

View file

@ -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<GbmBuffer*>(m_currentBuffer.get());
#else
return nullptr;
#endif
}
bool DrmVirtualOutput::isFormatSupported(uint32_t drmFormat) const
{
Q_UNUSED(drmFormat);

View file

@ -28,7 +28,6 @@ public:
~DrmVirtualOutput() override;
bool present(const QSharedPointer<DrmBuffer> &buffer, QRegion damagedRegion) override;
GbmBuffer *currentBuffer() const override;
QSize sourceSize() const override;
bool isDpmsEnabled() const override;