summaryrefslogtreecommitdiffstats
path: root/src
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 18:10:11 +0100
commit303e9168eb912ef3c1f5e504b5aa45a3eed5d757 (patch)
tree05172a6507f2b2b82802a22070617f84610287ba /src
parent5e32c51b7acea2df72f573e7ba6b11643ada280a (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> (cherry picked from commit dd23313d66846022894b56ad25b6c2c0fdb54762)
Diffstat (limited to 'src')
-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