File indexing completed on 2024-05-19 05:32:34

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 
0016 class DrmBackend;
0017 class DrmGpu;
0018 class DrmLeaseDeviceV1Interface;
0019 class DrmLeaseConnectorV1Interface;
0020 class Display;
0021 
0022 class DrmLeaseManagerV1 : public QObject
0023 {
0024     Q_OBJECT
0025 public:
0026     DrmLeaseManagerV1(DrmBackend *backend, Display *display, QObject *parent = nullptr);
0027     ~DrmLeaseManagerV1();
0028 
0029 private:
0030     void addGpu(DrmGpu *gpu);
0031     void removeGpu(DrmGpu *gpu);
0032     void handleOutputsQueried();
0033 
0034     DrmBackend *const m_backend;
0035     Display *const m_display;
0036     QHash<DrmGpu *, DrmLeaseDeviceV1Interface *> m_leaseDevices;
0037 };
0038 }