File indexing completed on 2024-05-19 16:35:18

0001 /*
0002     SPDX-FileCopyrightText: 2021-2022 Xaver Hugl <xaver.hugl@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005  */
0006 #pragma once
0007 
0008 #include <QHash>
0009 #include <QObject>
0010 #include <map>
0011 #include <memory>
0012 
0013 namespace KWin
0014 {
0015 class DrmBackend;
0016 class DrmGpu;
0017 }
0018 
0019 namespace KWaylandServer
0020 {
0021 
0022 class DrmLeaseDeviceV1Interface;
0023 class DrmLeaseConnectorV1Interface;
0024 class Display;
0025 
0026 class DrmLeaseManagerV1 : public QObject
0027 {
0028     Q_OBJECT
0029 public:
0030     DrmLeaseManagerV1(KWin::DrmBackend *backend, Display *display, QObject *parent = nullptr);
0031     ~DrmLeaseManagerV1();
0032 
0033 private:
0034     void addGpu(KWin::DrmGpu *gpu);
0035     void removeGpu(KWin::DrmGpu *gpu);
0036     void handleOutputsQueried();
0037 
0038     KWin::DrmBackend *const m_backend;
0039     Display *const m_display;
0040     QHash<KWin::DrmGpu *, DrmLeaseDeviceV1Interface *> m_leaseDevices;
0041 };
0042 }