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

0001 /*
0002     SPDX-FileCopyrightText: 2023 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include "transaction.h"
0010 
0011 #include <QObject>
0012 #include <QSocketNotifier>
0013 
0014 namespace KWin
0015 {
0016 
0017 class TransactionDmaBufLocker : public QObject
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     static TransactionDmaBufLocker *get(GraphicsBuffer *buffer);
0023 
0024     void add(Transaction *transaction);
0025 
0026 private:
0027     explicit TransactionDmaBufLocker(const DmaBufAttributes *attributes);
0028 
0029     bool arm();
0030 
0031     QList<Transaction *> m_transactions;
0032     QList<QSocketNotifier *> m_pending;
0033     std::vector<std::unique_ptr<QSocketNotifier>> m_notifiers;
0034 };
0035 
0036 } // namespace KWin