platforms/drm: fix dpms tracking
DrmGpu::updateOutputs is now changing the state of some drm properties without changing the fitting output state (namely RenderLoop inhibition) which can lead to rendering being inhibited indefinitely in some cases
This commit is contained in:
parent
0f6aa1c4a8
commit
7bca5d737d
8 changed files with 7 additions and 18 deletions
|
@ -32,7 +32,6 @@ public:
|
|||
virtual bool present(const QSharedPointer<DrmBuffer> &buffer, QRegion damagedRegion) = 0;
|
||||
|
||||
virtual bool needsSoftwareTransformation() const = 0;
|
||||
virtual bool isDpmsEnabled() 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;
|
||||
|
|
|
@ -119,7 +119,7 @@ void DrmBackend::checkOutputsAreOn()
|
|||
return;
|
||||
}
|
||||
for (auto it = m_enabledOutputs.constBegin(), end = m_enabledOutputs.constEnd(); it != end; it++) {
|
||||
if (!(*it)->isDpmsEnabled()) {
|
||||
if ((*it)->dpmsMode() != AbstractWaylandOutput::DpmsMode::On) {
|
||||
// dpms still disabled, need to keep the filter
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -320,6 +320,9 @@ bool DrmGpu::updateOutputs()
|
|||
} else if (m_outputs.contains(output)) {
|
||||
// try setting hardware rotation
|
||||
output->updateTransform(output->transform());
|
||||
if (output->dpmsMode() != AbstractWaylandOutput::DpmsMode::On) {
|
||||
pipeline->setActive(false);
|
||||
}
|
||||
} else {
|
||||
qCDebug(KWIN_DRM).nospace() << "New output on GPU " << m_devNode << ": " << pipeline->connector()->modelName();
|
||||
if (!output->initCursor(m_cursorSize)) {
|
||||
|
|
|
@ -256,7 +256,8 @@ void DrmOutput::setDrmDpmsMode(DpmsMode mode)
|
|||
return;
|
||||
}
|
||||
bool active = mode == DpmsMode::On;
|
||||
if (active == m_pipeline->isActive()) {
|
||||
bool isActive = dpmsMode() == DpmsMode::On;
|
||||
if (active == isActive) {
|
||||
setDpmsModeInternal(mode);
|
||||
return;
|
||||
}
|
||||
|
@ -433,11 +434,6 @@ DrmPipeline *DrmOutput::pipeline() const
|
|||
return m_pipeline;
|
||||
}
|
||||
|
||||
bool DrmOutput::isDpmsEnabled() const
|
||||
{
|
||||
return m_pipeline->isActive();
|
||||
}
|
||||
|
||||
QSize DrmOutput::sourceSize() const
|
||||
{
|
||||
return m_pipeline->sourceSize();
|
||||
|
|
|
@ -48,7 +48,6 @@ public:
|
|||
|
||||
bool present(const QSharedPointer<DrmBuffer> &buffer, QRegion damagedRegion) override;
|
||||
void pageFlipped();
|
||||
bool isDpmsEnabled() const override;
|
||||
|
||||
DrmConnector *connector() const;
|
||||
DrmPipeline *pipeline() const;
|
||||
|
|
|
@ -58,7 +58,6 @@ public:
|
|||
bool setRgbRange(AbstractWaylandOutput::RgbRange rgbRange);
|
||||
|
||||
DrmPlane::Transformations transformation() const;
|
||||
bool isActive() const;
|
||||
bool isCursorVisible() const;
|
||||
QPoint cursorPos() const;
|
||||
|
||||
|
@ -91,6 +90,7 @@ private:
|
|||
bool atomicCommit();
|
||||
bool presentLegacy();
|
||||
bool checkTestBuffer();
|
||||
bool isActive() const;
|
||||
|
||||
bool setPendingTransformation(const DrmPlane::Transformations &transformation);
|
||||
|
||||
|
|
|
@ -74,12 +74,6 @@ void DrmVirtualOutput::updateMode(const QSize &size, uint32_t refreshRate)
|
|||
void DrmVirtualOutput::setDpmsMode(DpmsMode mode)
|
||||
{
|
||||
setDpmsModeInternal(mode);
|
||||
m_dpmsEnabled = mode == DpmsMode::On;
|
||||
}
|
||||
|
||||
bool DrmVirtualOutput::isDpmsEnabled() const
|
||||
{
|
||||
return m_dpmsEnabled;
|
||||
}
|
||||
|
||||
void DrmVirtualOutput::updateEnablement(bool enable)
|
||||
|
|
|
@ -29,7 +29,6 @@ public:
|
|||
|
||||
bool present(const QSharedPointer<DrmBuffer> &buffer, QRegion damagedRegion) override;
|
||||
QSize sourceSize() const override;
|
||||
bool isDpmsEnabled() const override;
|
||||
|
||||
bool isFormatSupported(uint32_t drmFormat) const override;
|
||||
QVector<uint64_t> supportedModifiers(uint32_t drmFormat) const override;
|
||||
|
@ -55,7 +54,6 @@ private:
|
|||
QSharedPointer<DrmBuffer> m_currentBuffer;
|
||||
bool m_pageFlipPending = true;
|
||||
int m_modeIndex = 0;
|
||||
bool m_dpmsEnabled = true;
|
||||
|
||||
int m_identifier;
|
||||
SoftwareVsyncMonitor *m_vsyncMonitor;
|
||||
|
|
Loading…
Reference in a new issue