summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2020-01-17 16:02:31 +0100
committerRolf Eike Beer <eb@emlix.com>2020-01-22 08:47:57 +0100
commitdd23313d66846022894b56ad25b6c2c0fdb54762 (patch)
treee09088d0b2256c3dfcaa9e85b0a2503daaf0d68a /src/plugins
parent4b875caa6b47df1e22214593acad95865910c5fe (diff)
eglfs: find correct framebuffer index even if device node is symlink
Using the Vivante driver on a board with different device trees I found the need to let udev point me to the framebuffer actually connected to HDMI by adding a symlink. Since the extraction of the framebuffer index failed and always returned 0 the GUI still always showed up on the first framebuffer. Change-Id: Ib4aa0fdd6e85d296c17fd977921cbc78e52dcdcf Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
index 81bad45cd2..dbfb0e6058 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
@@ -52,6 +52,7 @@
#include <QScreen>
#include <QDir>
#if QT_CONFIG(regularexpression)
+# include <QFileInfo>
# include <QRegularExpression>
#endif
#include <QLoggingCategory>
@@ -144,7 +145,12 @@ int QEglFSDeviceIntegration::framebufferIndex() const
int fbIndex = 0;
#if QT_CONFIG(regularexpression)
QRegularExpression fbIndexRx(QLatin1String("fb(\\d+)"));
- QRegularExpressionMatch match = fbIndexRx.match(QString::fromLocal8Bit(fbDeviceName()));
+ QFileInfo fbinfo(QString::fromLocal8Bit(fbDeviceName()));
+ QRegularExpressionMatch match;
+ if (fbinfo.isSymLink())
+ match = fbIndexRx.match(fbinfo.symLinkTarget());
+ else
+ match = fbIndexRx.match(fbinfo.fileName());
if (match.hasMatch())
fbIndex = match.captured(1).toInt();
#endif