Commit fa654bda authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

drm: Improve QDebug of DrmOutput

Instead of printing as QObject, provide actual information of the
instance.
parent a13ecf8d
......@@ -1089,3 +1089,10 @@ bool DrmOutput::setGammaRamp(const GammaRamp &gamma)
}
}
QDebug& operator<<(QDebug& s, const KWin::DrmOutput* output)
{
if (!output)
return s.nospace() << "DrmOutput()";
return s.nospace() << "DrmOutput(" << output->name() << ", crtc:" << output->crtc() << ", connector:" << output->connector() << ", geometry:" << output->geometry() << ')';
}
......@@ -68,14 +68,25 @@ public:
Suspend = DRM_MODE_DPMS_SUSPEND,
Off = DRM_MODE_DPMS_OFF
};
Q_ENUM(DpmsMode);
bool isDpmsEnabled() const {
// We care for current as well as pending mode in order to allow first present in AMS.
return m_dpmsModePending == DpmsMode::On;
}
DpmsMode dpmsMode() const {
return m_dpmsMode;
}
DpmsMode dpmsModePending() const {
return m_dpmsModePending;
}
const DrmCrtc *crtc() const {
return m_crtc;
}
const DrmConnector *connector() const {
return m_conn;
}
const DrmPlane *primaryPlane() const {
return m_primaryPlane;
}
......@@ -181,5 +192,7 @@ private:
Q_DECLARE_METATYPE(KWin::DrmOutput*)
QDebug& operator<<(QDebug& stream, const KWin::DrmOutput *);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment