File indexing completed on 2025-04-20 10:57:32

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2021 Xaver Hugl <xaver.hugl@gmail.com>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 
0011 #include "core/output.h"
0012 
0013 namespace KWin
0014 {
0015 
0016 class DrmBackend;
0017 class DrmGpu;
0018 class DrmOutputLayer;
0019 
0020 class DrmAbstractOutput : public Output
0021 {
0022     Q_OBJECT
0023 public:
0024     DrmAbstractOutput(DrmGpu *gpu);
0025 
0026     RenderLoop *renderLoop() const override;
0027     void frameFailed() const;
0028     void pageFlipped(std::chrono::nanoseconds timestamp) const;
0029     QVector<int32_t> regionToRects(const QRegion &region) const;
0030     DrmGpu *gpu() const;
0031 
0032     virtual bool present() = 0;
0033     virtual DrmOutputLayer *primaryLayer() const = 0;
0034 
0035     void updateEnabled(bool enabled);
0036 
0037 protected:
0038     friend class DrmGpu;
0039 
0040     std::unique_ptr<RenderLoop> m_renderLoop;
0041     DrmGpu *const m_gpu;
0042 };
0043 
0044 }