1// Copyright (C) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
2// Copyright (C) 2016 The Qt Company Ltd.
3// Copyright (C) 2016 Pelagicore AG
4// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
5
6#ifndef QEGLFSKMSSCREEN_H
7#define QEGLFSKMSSCREEN_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include "private/qeglfsscreen_p.h"
21#include <QtCore/QList>
22#include <QtCore/QMutex>
23
24#include <QtKmsSupport/private/qkmsdevice_p.h>
25#include <QtGui/private/qedidparser_p.h>
26
27QT_BEGIN_NAMESPACE
28
29class QEglFSKmsDevice;
30class QEglFSKmsInterruptHandler;
31
32class Q_EGLFS_EXPORT QEglFSKmsScreen : public QEglFSScreen
33{
34public:
35 QEglFSKmsScreen(QEglFSKmsDevice *device, const QKmsOutput &output, bool headless = false);
36 ~QEglFSKmsScreen();
37
38 void setVirtualPosition(const QPoint &pos);
39
40 QRect rawGeometry() const override;
41
42 int depth() const override;
43 QImage::Format format() const override;
44
45 QSizeF physicalSize() const override;
46 QDpi logicalDpi() const override;
47 QDpi logicalBaseDpi() const override;
48 Qt::ScreenOrientation nativeOrientation() const override;
49 Qt::ScreenOrientation orientation() const override;
50
51 QString name() const override;
52
53 QString manufacturer() const override;
54 QString model() const override;
55 QString serialNumber() const override;
56
57 qreal refreshRate() const override;
58
59 QList<QPlatformScreen *> virtualSiblings() const override { return m_siblings; }
60 void setVirtualSiblings(QList<QPlatformScreen *> sl) { m_siblings = sl; }
61
62 QList<QPlatformScreen::Mode> modes() const override;
63
64 int currentMode() const override;
65 int preferredMode() const override;
66
67 QEglFSKmsDevice *device() const { return m_device; }
68
69 virtual void waitForFlip();
70
71 QKmsOutput &output() { return m_output; }
72 void restoreMode();
73
74 SubpixelAntialiasingType subpixelAntialiasingTypeHint() const override;
75
76 QPlatformScreen::PowerState powerState() const override;
77 void setPowerState(QPlatformScreen::PowerState state) override;
78
79 bool isCursorOutOfRange() const { return m_cursorOutOfRange; }
80 void setCursorOutOfRange(bool b) { m_cursorOutOfRange = b; }
81
82 virtual void pageFlipped(unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec);
83protected:
84 QEglFSKmsDevice *m_device;
85
86 QKmsOutput m_output;
87 QEdidParser m_edid;
88 QPoint m_pos;
89 bool m_cursorOutOfRange;
90
91 QList<QPlatformScreen *> m_siblings;
92
93 PowerState m_powerState;
94
95 QEglFSKmsInterruptHandler *m_interruptHandler;
96
97 bool m_headless;
98};
99
100QT_END_NAMESPACE
101
102#endif
103

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