1/****************************************************************************
2**
3** Copyright (C) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
4** Copyright (C) 2016 The Qt Company Ltd.
5** Copyright (C) 2016 Pelagicore AG
6** Contact: https://www.qt.io/licensing/
7**
8** This file is part of the plugins of the Qt Toolkit.
9**
10** $QT_BEGIN_LICENSE:LGPL$
11** Commercial License Usage
12** Licensees holding valid commercial Qt licenses may use this file in
13** accordance with the commercial license agreement provided with the
14** Software or, alternatively, in accordance with the terms contained in
15** a written agreement between you and The Qt Company. For licensing terms
16** and conditions see https://www.qt.io/terms-conditions. For further
17** information use the contact form at https://www.qt.io/contact-us.
18**
19** GNU Lesser General Public License Usage
20** Alternatively, this file may be used under the terms of the GNU Lesser
21** General Public License version 3 as published by the Free Software
22** Foundation and appearing in the file LICENSE.LGPL3 included in the
23** packaging of this file. Please review the following information to
24** ensure the GNU Lesser General Public License version 3 requirements
25** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
26**
27** GNU General Public License Usage
28** Alternatively, this file may be used under the terms of the GNU
29** General Public License version 2.0 or (at your option) the GNU General
30** Public license version 3 or any later version approved by the KDE Free
31** Qt Foundation. The licenses are as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
33** included in the packaging of this file. Please review the following
34** information to ensure the GNU General Public License requirements will
35** be met: https://www.gnu.org/licenses/gpl-2.0.html and
36** https://www.gnu.org/licenses/gpl-3.0.html.
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QEGLFSKMSINTEGRATION_H
43#define QEGLFSKMSINTEGRATION_H
44
45#include "private/qeglfsdeviceintegration_p.h"
46#include <QtCore/QMap>
47#include <QtCore/QVariant>
48#include <QtCore/QLoggingCategory>
49
50QT_BEGIN_NAMESPACE
51
52class QKmsDevice;
53class QKmsScreenConfig;
54
55Q_EGLFS_EXPORT Q_DECLARE_LOGGING_CATEGORY(qLcEglfsKmsDebug)
56
57class Q_EGLFS_EXPORT QEglFSKmsIntegration : public QEglFSDeviceIntegration
58{
59public:
60 QEglFSKmsIntegration();
61 ~QEglFSKmsIntegration();
62
63 void platformInit() override;
64 void platformDestroy() override;
65 EGLNativeDisplayType platformDisplay() const override;
66 bool usesDefaultScreen() override;
67 void screenInit() override;
68 QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &inputFormat) const override;
69 bool hasCapability(QPlatformIntegration::Capability cap) const override;
70 void waitForVSync(QPlatformSurface *surface) const override;
71 bool supportsPBuffers() const override;
72 void *nativeResourceForIntegration(const QByteArray &name) override;
73 void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override;
74
75 QKmsDevice *device() const;
76 QKmsScreenConfig *screenConfig() const;
77
78protected:
79 virtual QKmsDevice *createDevice() = 0;
80
81 QKmsDevice *m_device;
82 QKmsScreenConfig *m_screenConfig;
83};
84
85QT_END_NAMESPACE
86
87#endif
88

source code of qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.h