/* KWin - the KDE window manager This file is part of the KDE project. SPDX-FileCopyrightText: 2018 Roman Gilg SPDX-FileCopyrightText: 2021 Xaver Hugl SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once #include "drm_abstract_output.h" #include #include namespace KWin { class SoftwareVsyncMonitor; class VirtualBackend; class DrmVirtualOutput : public DrmAbstractOutput { Q_OBJECT public: DrmVirtualOutput(const QString &name, DrmGpu *gpu, const QSize &size); DrmVirtualOutput(DrmGpu *gpu, const QSize &size); ~DrmVirtualOutput() override; bool present(const QSharedPointer &buffer, QRegion damagedRegion) override; QSize sourceSize() const override; bool isFormatSupported(uint32_t drmFormat) const override; QVector supportedModifiers(uint32_t drmFormat) const override; int maxBpc() const override; int gammaRampSize() const override; bool setGammaRamp(const GammaRamp &gamma) override; bool needsSoftwareTransformation() const override; private: void vblank(std::chrono::nanoseconds timestamp); void setDpmsMode(DpmsMode mode) override; void updateEnablement(bool enable) override; QSharedPointer m_currentBuffer; bool m_pageFlipPending = true; int m_modeIndex = 0; SoftwareVsyncMonitor *m_vsyncMonitor; }; }