diff --git a/plugins/platforms/drm/drm_output.cpp b/plugins/platforms/drm/drm_output.cpp index ad91d8aa63..82eb518777 100644 --- a/plugins/platforms/drm/drm_output.cpp +++ b/plugins/platforms/drm/drm_output.cpp @@ -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() << ')'; +} diff --git a/plugins/platforms/drm/drm_output.h b/plugins/platforms/drm/drm_output.h index 52d383bd93..e2e0403f4a 100644 --- a/plugins/platforms/drm/drm_output.h +++ b/plugins/platforms/drm/drm_output.h @@ -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