qeglfskmsscreen.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6extern const QLoggingCategory &qLcEglfsKmsDebug();-
7-
8class QEglFSKmsInterruptHandler : public QObject-
9{-
10public:-
11 QEglFSKmsInterruptHandler(QEglFSKmsScreen *screen) : m_screen(screen) {-
12 m_vtHandler = static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration())->vtHandler();-
13 connect(m_vtHandler, &QFbVtHandler::interrupted, this, &QEglFSKmsInterruptHandler::restoreVideoMode);-
14 connect(m_vtHandler, &QFbVtHandler::aboutToSuspend, this, &QEglFSKmsInterruptHandler::restoreVideoMode);-
15 }
never executed: end of block
0
16-
17public :-
18 void restoreVideoMode() { m_screen->restoreMode(); }
never executed: end of block
0
19-
20private:-
21 QFbVtHandler *m_vtHandler;-
22 QEglFSKmsScreen *m_screen;-
23};-
24-
25QEglFSKmsScreen::QEglFSKmsScreen(QEglFSKmsIntegration *integration,-
26 QEglFSKmsDevice *device,-
27 QEglFSKmsOutput output,-
28 QPoint position)-
29 : QEglFSScreen(eglGetDisplay(device->nativeDisplay()))-
30 , m_integration(integration)-
31 , m_device(device)-
32 , m_output(output)-
33 , m_pos(position)-
34 , m_powerState(PowerStateOn)-
35 , m_interruptHandler(new QEglFSKmsInterruptHandler(this))-
36{-
37 m_siblings << this;-
38}
never executed: end of block
0
39-
40QEglFSKmsScreen::~QEglFSKmsScreen()-
41{-
42 if (m_output.dpms_prop
m_output.dpms_propDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
43 drmModeFreeProperty(m_output.dpms_prop);-
44 m_output.dpms_prop = nullptr;-
45 }
never executed: end of block
0
46 restoreMode();-
47 if (m_output.saved_crtc
m_output.saved_crtcDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
48 drmModeFreeCrtc(m_output.saved_crtc);-
49 m_output.saved_crtc = nullptr;-
50 }
never executed: end of block
0
51 delete m_interruptHandler;-
52}
never executed: end of block
0
53-
54QRect QEglFSKmsScreen::geometry() const-
55{-
56 const int mode = m_output.mode;-
57 return
never executed: return QRect(m_pos.x(), m_pos.y(), m_output.modes[mode].hdisplay, m_output.modes[mode].vdisplay);
QRect(m_pos.x(), m_pos.y(),
never executed: return QRect(m_pos.x(), m_pos.y(), m_output.modes[mode].hdisplay, m_output.modes[mode].vdisplay);
0
58 m_output.modes[mode].hdisplay,
never executed: return QRect(m_pos.x(), m_pos.y(), m_output.modes[mode].hdisplay, m_output.modes[mode].vdisplay);
0
59 m_output.modes[mode].vdisplay);
never executed: return QRect(m_pos.x(), m_pos.y(), m_output.modes[mode].hdisplay, m_output.modes[mode].vdisplay);
0
60}-
61-
62int QEglFSKmsScreen::depth() const-
63{-
64 return
never executed: return 32;
32;
never executed: return 32;
0
65}-
66-
67QImage::Format QEglFSKmsScreen::format() const-
68{-
69 return
never executed: return QImage::Format_RGB32;
QImage::Format_RGB32;
never executed: return QImage::Format_RGB32;
0
70}-
71-
72QSizeF QEglFSKmsScreen::physicalSize() const-
73{-
74 return
never executed: return m_output.physical_size;
m_output.physical_size;
never executed: return m_output.physical_size;
0
75}-
76-
77QDpi QEglFSKmsScreen::logicalDpi() const-
78{-
79 const QSizeF ps = physicalSize();-
80 const QSize s = geometry().size();-
81-
82 if (!ps.isEmpty()
!ps.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
&& !s.isEmpty()
!s.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
83 return
never executed: return QDpi(25.4 * s.width() / ps.width(), 25.4 * s.height() / ps.height());
QDpi(25.4 * s.width() / ps.width(),
never executed: return QDpi(25.4 * s.width() / ps.width(), 25.4 * s.height() / ps.height());
0
84 25.4 * s.height() / ps.height());
never executed: return QDpi(25.4 * s.width() / ps.width(), 25.4 * s.height() / ps.height());
0
85 else-
86 return
never executed: return QDpi(100, 100);
QDpi(100, 100);
never executed: return QDpi(100, 100);
0
87}-
88-
89Qt::ScreenOrientation QEglFSKmsScreen::nativeOrientation() const-
90{-
91 return
never executed: return Qt::PrimaryOrientation;
Qt::PrimaryOrientation;
never executed: return Qt::PrimaryOrientation;
0
92}-
93-
94Qt::ScreenOrientation QEglFSKmsScreen::orientation() const-
95{-
96 return
never executed: return Qt::PrimaryOrientation;
Qt::PrimaryOrientation;
never executed: return Qt::PrimaryOrientation;
0
97}-
98-
99QString QEglFSKmsScreen::name() const-
100{-
101 return
never executed: return m_output.name;
m_output.name;
never executed: return m_output.name;
0
102}-
103-
104void QEglFSKmsScreen::destroySurface()-
105{-
106}-
107-
108void QEglFSKmsScreen::waitForFlip()-
109{-
110}-
111-
112void QEglFSKmsScreen::flip()-
113{-
114}-
115-
116void QEglFSKmsScreen::flipFinished()-
117{-
118}-
119-
120void QEglFSKmsScreen::restoreMode()-
121{-
122 if (m_output.mode_set
m_output.mode_setDescription
TRUEnever evaluated
FALSEnever evaluated
&& m_output.saved_crtc
m_output.saved_crtcDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
123 drmModeSetCrtc(m_device->fd(),-
124 m_output.saved_crtc->crtc_id,-
125 m_output.saved_crtc->buffer_id,-
126 0, 0,-
127 &m_output.connector_id, 1,-
128 &m_output.saved_crtc->mode);-
129-
130 m_output.mode_set = false;-
131 }
never executed: end of block
0
132}
never executed: end of block
0
133-
134qreal QEglFSKmsScreen::refreshRate() const-
135{-
136 quint32 refresh = m_output.modes[m_output.mode].vrefresh;-
137 return
never executed: return refresh > 0 ? refresh : 60;
refresh > 0 ? refresh : 60;
never executed: return refresh > 0 ? refresh : 60;
0
138}-
139-
140QPlatformScreen::SubpixelAntialiasingType QEglFSKmsScreen::subpixelAntialiasingTypeHint() const-
141{-
142 switch (m_output.subpixel) {-
143 default
never executed: default:
:
never executed: default:
0
144 case
never executed: case DRM_MODE_SUBPIXEL_UNKNOWN:
DRM_MODE_SUBPIXEL_UNKNOWN:
never executed: case DRM_MODE_SUBPIXEL_UNKNOWN:
0
145 case
never executed: case DRM_MODE_SUBPIXEL_NONE:
DRM_MODE_SUBPIXEL_NONE:
never executed: case DRM_MODE_SUBPIXEL_NONE:
0
146 return
never executed: return Subpixel_None;
Subpixel_None;
never executed: return Subpixel_None;
0
147 case
never executed: case DRM_MODE_SUBPIXEL_HORIZONTAL_RGB:
DRM_MODE_SUBPIXEL_HORIZONTAL_RGB:
never executed: case DRM_MODE_SUBPIXEL_HORIZONTAL_RGB:
0
148 return
never executed: return Subpixel_RGB;
Subpixel_RGB;
never executed: return Subpixel_RGB;
0
149 case
never executed: case DRM_MODE_SUBPIXEL_HORIZONTAL_BGR:
DRM_MODE_SUBPIXEL_HORIZONTAL_BGR:
never executed: case DRM_MODE_SUBPIXEL_HORIZONTAL_BGR:
0
150 return
never executed: return Subpixel_BGR;
Subpixel_BGR;
never executed: return Subpixel_BGR;
0
151 case
never executed: case DRM_MODE_SUBPIXEL_VERTICAL_RGB:
DRM_MODE_SUBPIXEL_VERTICAL_RGB:
never executed: case DRM_MODE_SUBPIXEL_VERTICAL_RGB:
0
152 return
never executed: return Subpixel_VRGB;
Subpixel_VRGB;
never executed: return Subpixel_VRGB;
0
153 case
never executed: case DRM_MODE_SUBPIXEL_VERTICAL_BGR:
DRM_MODE_SUBPIXEL_VERTICAL_BGR:
never executed: case DRM_MODE_SUBPIXEL_VERTICAL_BGR:
0
154 return
never executed: return Subpixel_VBGR;
Subpixel_VBGR;
never executed: return Subpixel_VBGR;
0
155 }-
156}-
157-
158QPlatformScreen::PowerState QEglFSKmsScreen::powerState() const-
159{-
160 return
never executed: return m_powerState;
m_powerState;
never executed: return m_powerState;
0
161}-
162-
163void QEglFSKmsScreen::setPowerState(QPlatformScreen::PowerState state)-
164{-
165 if (!m_output.dpms_prop
!m_output.dpms_propDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
166 return;
never executed: return;
0
167-
168 drmModeConnectorSetProperty(m_device->fd(), m_output.connector_id,-
169 m_output.dpms_prop->prop_id, (int)state);-
170 m_powerState = state;-
171}
never executed: end of block
0
172-
173-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9