Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qeglfskmsgbmscreen_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
6
7#ifndef QEGLFSKMSGBMSCREEN_H
8#define QEGLFSKMSGBMSCREEN_H
9
10//
11// W A R N I N G
12// -------------
13//
14// This file is not part of the Qt API. It exists purely as an
15// implementation detail. This header file may change from version to
16// version without notice, or even be removed.
17//
18// We mean it.
19//
20
21#include <private/qeglfskmsscreen_p.h>
22#include <QMutex>
23#include <QWaitCondition>
24
25#include <gbm.h>
26
28
30
31class Q_EGLFS_EXPORT QEglFSKmsGbmScreen : public QEglFSKmsScreen
32{
33public:
34 QEglFSKmsGbmScreen(QEglFSKmsDevice *device, const QKmsOutput &output, bool headless);
35 ~QEglFSKmsGbmScreen();
36
37 QPlatformCursor *cursor() const override;
38
39 gbm_surface *createSurface(EGLConfig eglConfig);
40 void resetSurface();
41
42 void initCloning(QPlatformScreen *screenThisScreenClones,
43 const QList<QPlatformScreen *> &screensCloningThisScreen);
44
45 void waitForFlip() override;
46
47 virtual void flip();
48 virtual void updateFlipStatus();
49
50 virtual uint32_t gbmFlags() { return GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING; }
51
52protected:
53 void flipFinished();
54 void ensureModeSet(uint32_t fb);
55 void cloneDestFlipFinished(QEglFSKmsGbmScreen *cloneDestScreen);
56 void waitForFlipWithEventReader(QEglFSKmsGbmScreen *screen);
57 static void nonThreadedPageFlipHandler(int fd,
58 unsigned int sequence,
59 unsigned int tv_sec,
60 unsigned int tv_usec,
61 void *user_data);
62
63 gbm_surface *m_gbm_surface;
64
65 gbm_bo *m_gbm_bo_current;
66 gbm_bo *m_gbm_bo_next;
67 bool m_flipPending;
68
69 QMutex m_flipMutex;
70 QWaitCondition m_flipCond;
71 static QMutex s_nonThreadedFlipMutex;
72
73 QScopedPointer<QEglFSKmsGbmCursor> m_cursor;
74
75 struct FrameBuffer {
76 uint32_t fb = 0;
77 };
78 static void bufferDestroyedHandler(gbm_bo *bo, void *data);
79 FrameBuffer *framebufferForBufferObject(gbm_bo *bo);
80
81 QEglFSKmsGbmScreen *m_cloneSource;
82 struct CloneDestination {
83 QEglFSKmsGbmScreen *screen = nullptr;
84 bool cloneFlipPending = false;
85 };
86 QList<CloneDestination> m_cloneDests;
87
88 bool needsNewModeSetForNextFb = false;
89};
90
91QT_END_NAMESPACE
92
93#endif // QEGLFSKMSGBMSCREEN_H
void pointerEvent(const QMouseEvent &event) override
This method is called by Qt whenever a QMouseEvent is generated by the underlying pointer input.
void changeCursor(QCursor *windowCursor, QWindow *window) override
This method is called by Qt whenever the cursor graphic should be changed.
void setPos(const QPoint &pos) override
QPoint pos() const override
QEglFSKmsGbmScreen * screen() const
Combined button and popup list for selecting options.
#define DRM_CAP_CURSOR_HEIGHT
#define DRM_CAP_CURSOR_WIDTH