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
qeglfskmsegldevice.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 Pelagicore AG
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
include
"qeglfskmsegldevice.h"
6
#
include
"qeglfskmsegldevicescreen.h"
7
#
include
"qeglfskmsegldeviceintegration.h"
8
#
include
"private/qeglfsintegration_p.h"
9
#
include
"private/qeglfscursor_p.h"
10
11
#
include
<
QtCore
/
private
/
qcore_unix_p
.
h
>
12
13
QT_BEGIN_NAMESPACE
14
15
QEglFSKmsEglDevice
::
QEglFSKmsEglDevice
(QEglFSKmsEglDeviceIntegration *devInt, QKmsScreenConfig *screenConfig,
const
QString &path)
16
: QEglFSKmsDevice(screenConfig, path),
17
m_devInt(devInt),
18
m_globalCursor(
nullptr
)
19
{
20
}
21
22
bool
QEglFSKmsEglDevice
::
open
()
23
{
24
Q_ASSERT(fd() == -1);
25
26
int
fd = -1;
27
28
if
(devicePath().compare(
"drm-nvdc"
) == 0)
29
fd = drmOpen(devicePath().toLocal8Bit().constData(),
nullptr
);
30
else
31
fd = qt_safe_open(devicePath().toLocal8Bit().constData(), O_RDWR);
32
if
(Q_UNLIKELY(fd < 0))
33
qFatal(
"Could not open DRM (NV) device"
);
34
35
setFd(fd);
36
37
return
true
;
38
}
39
40
void
QEglFSKmsEglDevice
::
close
()
41
{
42
// Note: screens are gone at this stage.
43
44
if
(drmClose(fd()) == -1)
45
qErrnoWarning(
"Could not close DRM (NV) device"
);
46
47
setFd(-1);
48
}
49
50
void
*
QEglFSKmsEglDevice
::
nativeDisplay
()
const
51
{
52
return
m_devInt->eglDevice();
53
}
54
55
QPlatformScreen
*
QEglFSKmsEglDevice
::
createScreen
(
const
QKmsOutput &output)
56
{
57
QEglFSKmsScreen *screen =
new
QEglFSKmsEglDeviceScreen
(
this
, output);
58
#
if
QT_CONFIG
(
opengl
)
59
if
(!m_globalCursor && !screenConfig()->separateScreens()) {
60
qCDebug(qLcEglfsKmsDebug,
"Creating new global mouse cursor"
);
61
m_globalCursor =
new
QEglFSCursor(screen);
62
}
63
#
endif
64
return
screen;
65
}
66
67
void
QEglFSKmsEglDevice
::
destroyGlobalCursor
()
68
{
69
if
(m_globalCursor) {
70
qCDebug(qLcEglfsKmsDebug,
"Destroying global mouse cursor"
);
71
delete
m_globalCursor;
72
m_globalCursor =
nullptr
;
73
}
74
}
75
76
QT_END_NAMESPACE
QEglFSKmsEglDeviceScreen
Definition
qeglfskmsegldevicescreen.h:13
QEglFSKmsEglDevice
Definition
qeglfskmsegldevice.h:16
QEglFSKmsEglDevice::createScreen
QPlatformScreen * createScreen(const QKmsOutput &output) override
Definition
qeglfskmsegldevice.cpp:55
QEglFSKmsEglDevice::open
bool open() override
Definition
qeglfskmsegldevice.cpp:22
QEglFSKmsEglDevice::close
void close() override
Definition
qeglfskmsegldevice.cpp:40
QEglFSKmsEglDevice::destroyGlobalCursor
void destroyGlobalCursor()
Definition
qeglfskmsegldevice.cpp:67
QEglFSKmsEglDevice::nativeDisplay
void * nativeDisplay() const override
Definition
qeglfskmsegldevice.cpp:50
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qrandomaccessasyncfile_darwin.mm:17
qtbase
src
plugins
platforms
eglfs
deviceintegration
eglfs_kms_egldevice
qeglfskmsegldevice.cpp
Generated on
for Qt by
1.16.1