path: root/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
diff options
authorLaszlo Agocs <>2016-11-10 12:32:28 +0100
committerLaszlo Agocs <>2016-11-24 12:08:21 +0000
commit1f81ba45eeb1a0d233bb2515c048da8743c91f6f (patch)
treeb87d2319b77e6b281d5d4a0eb8f24a3ecacfe5d5 /src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
parent705e3f68df83dca165e3cddb914d3816155323f8 (diff)
linuxfb: add experimental support for DRM dumb buffers
Add a QFbScreen implementation that uses DRM dumb buffers and page flipping, thus implementing a vsynced, double (triple) buffered plain software platform plugin. Besides better supporting systems that by now only do fbdev via (possibly buggy) emulation, this can also be an enabler for implementing certain types of 2D accelerated compositors e.g. for Wayland. Enable with QT_QPA_FB_DRM=1. Right now there is no good way to autodetect the support for dumb buffers early enough so the default is always the traditional fbdev path. Long-term this will also enable proper multi-display support like with eglfs' DRM backends. Multiple QScreens are not yet reported currently due to the single-screen limitations of fbconvenience. The generic DRM code is shared with eglfs, meaning configuration happens via the JSON file specified in QT_QPA_(EGLFS_)KMS_CONFIG. This allows changing the screen resolution, disabling outputs, etc. [ChangeLog][Platform Specific Changes][linuxfb] Added experimental support for DRM dumb buffers. Enable by setting the environment variable QT_QPA_FB_DRM to 1. Task-number: QTBUG-56306 Change-Id: I4bdcf16fff67412183220dffa0c4ea235c5cad3d Reviewed-by: Andy Nichols <>
Diffstat (limited to 'src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp')
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
index c1c235588e..ce193bdf90 100644
--- a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
+++ b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
@@ -39,6 +39,9 @@
#include "qlinuxfbintegration.h"
#include "qlinuxfbscreen.h"
+#if QT_CONFIG(kms)
+#include "qlinuxfbdrmscreen.h"
#include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h>
#include <QtServiceSupport/private/qgenericunixservices_p.h>
@@ -69,10 +72,16 @@
QLinuxFbIntegration::QLinuxFbIntegration(const QStringList &paramList)
- : m_fontDb(new QGenericUnixFontDatabase),
+ : m_primaryScreen(nullptr),
+ m_fontDb(new QGenericUnixFontDatabase),
m_services(new QGenericUnixServices)
- m_primaryScreen = new QLinuxFbScreen(paramList);
+#if QT_CONFIG(kms)
+ if (qEnvironmentVariableIntValue("QT_QPA_FB_DRM") != 0)
+ m_primaryScreen = new QLinuxFbDrmScreen(paramList);
+ if (!m_primaryScreen)
+ m_primaryScreen = new QLinuxFbScreen(paramList);