backends/drm: support link-status
Userspace is expected to do a modeset and set link-status to good again, if link-status gets bad. This is needed to prevent some black screen situations. BUG: 448177
This commit is contained in:
parent
031bb305e3
commit
802d855785
3 changed files with 22 additions and 0 deletions
|
@ -101,6 +101,10 @@ DrmConnector::DrmConnector(DrmGpu *gpu, uint32_t connectorId)
|
|||
QByteArrayLiteral("Limited 16:235")
|
||||
}),
|
||||
PropertyDefinition(QByteArrayLiteral("max bpc"), Requirement::Optional),
|
||||
PropertyDefinition(QByteArrayLiteral("link-status"), Requirement::Optional, {
|
||||
QByteArrayLiteral("Good"),
|
||||
QByteArrayLiteral("Bad")
|
||||
}),
|
||||
}, DRM_MODE_OBJECT_CONNECTOR)
|
||||
, m_pipeline(new DrmPipeline(this))
|
||||
, m_conn(drmModeGetConnector(gpu->fd(), connectorId))
|
||||
|
@ -421,6 +425,14 @@ void DrmConnector::disable()
|
|||
setPending(PropertyIndex::CrtcId, 0);
|
||||
}
|
||||
|
||||
DrmConnector::LinkStatus DrmConnector::linkStatus() const
|
||||
{
|
||||
if (const auto &property = getProp(PropertyIndex::LinkStatus)) {
|
||||
return property->enumForValue<LinkStatus>(property->current());
|
||||
}
|
||||
return LinkStatus::Good;
|
||||
}
|
||||
|
||||
QDebug& operator<<(QDebug& s, const KWin::DrmConnector *obj)
|
||||
{
|
||||
QDebugStateSaver saver(s);
|
||||
|
|
|
@ -66,6 +66,7 @@ public:
|
|||
Underscan_hborder = 8,
|
||||
Broadcast_RGB = 9,
|
||||
MaxBpc = 10,
|
||||
LinkStatus = 11,
|
||||
Count
|
||||
};
|
||||
|
||||
|
@ -74,6 +75,10 @@ public:
|
|||
On = 1,
|
||||
Auto = 2,
|
||||
};
|
||||
enum class LinkStatus : uint32_t {
|
||||
Good = 0,
|
||||
Bad = 1
|
||||
};
|
||||
|
||||
bool init() override;
|
||||
bool needsModeset() const override;
|
||||
|
@ -105,6 +110,7 @@ public:
|
|||
bool vrrCapable() const;
|
||||
bool hasRgbRange() const;
|
||||
AbstractWaylandOutput::RgbRange rgbRange() const;
|
||||
LinkStatus linkStatus() const;
|
||||
|
||||
private:
|
||||
QScopedPointer<DrmPipeline> m_pipeline;
|
||||
|
|
|
@ -230,6 +230,9 @@ void DrmPipeline::prepareAtomicModeset()
|
|||
if (const auto &prop = m_connector->getProp(DrmConnector::PropertyIndex::Broadcast_RGB)) {
|
||||
prop->setEnum(pending.rgbRange);
|
||||
}
|
||||
if (const auto &prop = m_connector->getProp(DrmConnector::PropertyIndex::LinkStatus)) {
|
||||
prop->setEnum(DrmConnector::LinkStatus::Good);
|
||||
}
|
||||
|
||||
pending.crtc->setPending(DrmCrtc::PropertyIndex::Active, activePending());
|
||||
pending.crtc->setPending(DrmCrtc::PropertyIndex::ModeId, activePending() ? mode->blobId() : 0);
|
||||
|
@ -501,6 +504,7 @@ bool DrmPipeline::needsModeset() const
|
|||
|| pending.modeIndex != m_current.modeIndex
|
||||
|| pending.rgbRange != m_current.rgbRange
|
||||
|| pending.bufferTransformation != m_current.bufferTransformation
|
||||
|| m_connector->linkStatus() == DrmConnector::LinkStatus::Bad
|
||||
|| m_modesetPresentPending;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue