summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-10-13 16:09:51 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-10-14 11:39:26 +0000
commit0a203bf753f2dc40257f1fcde20607e8f9853780 (patch)
tree6c36d9356c3eb59f8589667b77cf9fb7a3dbb5ff
parentf0d21f6921275032edfc35bf36f71807b90fdfa2 (diff)
Separate KMS and GBM tests
KMS is no longer a platform plugin so the relevant leftover bits are now removed. As the introduction of the EGLDevice-based backend for eglfs shows, using DRM/KMS is not tied to GBM, separate buffer management approaches, like EGLStreams, work fine as well. Therefore separate KMS from GBM and remove the EGL and GLES dependency in the tests - this way there is nothing preventing us from using GBM without GL for example. Change-Id: Id7ebe172b44b315f9a637892237d2bb62d99aed2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
-rw-r--r--config.tests/qpa/gbm/gbm.cpp44
-rw-r--r--config.tests/qpa/gbm/gbm.pro4
-rw-r--r--config.tests/qpa/kms/kms.cpp7
-rw-r--r--config.tests/qpa/kms/kms.pro2
-rwxr-xr-xconfigure60
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro2
6 files changed, 91 insertions, 28 deletions
diff --git a/config.tests/qpa/gbm/gbm.cpp b/config.tests/qpa/gbm/gbm.cpp
new file mode 100644
index 0000000000..d4f211163d
--- /dev/null
+++ b/config.tests/qpa/gbm/gbm.cpp
@@ -0,0 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the config.tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <stdlib.h>
+#include <stdint.h>
+extern "C" {
+#include <gbm.h>
+}
+
+int main(int, char **)
+{
+ gbm_surface *surface = 0;
+ return 0;
+}
diff --git a/config.tests/qpa/gbm/gbm.pro b/config.tests/qpa/gbm/gbm.pro
new file mode 100644
index 0000000000..19177062a8
--- /dev/null
+++ b/config.tests/qpa/gbm/gbm.pro
@@ -0,0 +1,4 @@
+SOURCES = gbm.cpp
+CONFIG += link_pkgconfig
+PKGCONFIG += gbm
+CONFIG -= qt
diff --git a/config.tests/qpa/kms/kms.cpp b/config.tests/qpa/kms/kms.cpp
index 64c11158c5..ac0c281386 100644
--- a/config.tests/qpa/kms/kms.cpp
+++ b/config.tests/qpa/kms/kms.cpp
@@ -32,17 +32,14 @@
****************************************************************************/
#include <stdlib.h>
+#include <stdint.h>
extern "C" {
-#include <gbm.h>
#include <xf86drmMode.h>
#include <xf86drm.h>
}
-#include <EGL/egl.h>
-#include <GLES2/gl2.h>
int main(int, char **)
{
- // Check for gbm_surface which is quite a recent addition.
- gbm_surface *surface = 0;
+ drmModeCrtcPtr currentMode = drmModeGetCrtc(0, 0);
return 0;
}
diff --git a/config.tests/qpa/kms/kms.pro b/config.tests/qpa/kms/kms.pro
index 618063dbb9..1fb73677e7 100644
--- a/config.tests/qpa/kms/kms.pro
+++ b/config.tests/qpa/kms/kms.pro
@@ -1,4 +1,4 @@
SOURCES = kms.cpp
CONFIG += link_pkgconfig
-PKGCONFIG += libdrm libudev egl gbm glesv2
+PKGCONFIG += libdrm libudev
CONFIG -= qt
diff --git a/configure b/configure
index 3a32487dcf..996990706b 100755
--- a/configure
+++ b/configure
@@ -689,6 +689,7 @@ CFG_EGLFS_EGLDEVICE=no
CFG_EGLFS_MALI=no
CFG_EGLFS_VIV=no
CFG_DIRECTFB=auto
+CFG_GBM=auto
CFG_LINUXFB=auto
CFG_KMS=auto
CFG_MIRCLIENT=auto
@@ -1828,6 +1829,13 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
+ gbm)
+ if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+ CFG_GBM="$VAL"
+ else
+ UNKNOWN_OPT=yes
+ fi
+ ;;
linuxfb)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_LINUXFB="$VAL"
@@ -2667,8 +2675,11 @@ Additional options:
-no-eglfs .......... Do not compile EGLFS (EGL Full Screen/Single Surface) support.
* -eglfs ............. Compile EGLFS support.
- -no-kms ............ Do not compile EGLFS KMS backend.
- * -kms ............... Compile EGLFS KMS backend.
+ -no-kms ............ Do not compile backends for KMS.
+ * -kms ............... Compile backends for KMS.
+
+ -no-gbm ............ Do not compile backends for GBM.
+ * -gbm ............... Compile backends for GBM.
-no-directfb ....... Do not compile DirectFB support.
* -directfb .......... Compile DirectFB support.
@@ -4717,13 +4728,6 @@ if [ "$CFG_EGLFS" = "yes" ]; then
CFG_EGL=yes
fi
-if [ "$CFG_KMS" = "yes" ]; then
- if [ "$CFG_EGL" = "no" ]; then
- echo "The KMS plugin requires EGL support and cannot be built"
- exit 101
- fi
-fi
-
# auto-detect SQL-modules support
for _SQLDR in $CFG_SQL_AVAILABLE; do
case $_SQLDR in
@@ -5353,7 +5357,6 @@ ORIG_CFG_XCB="$CFG_XCB"
ORIG_CFG_EGLFS="$CFG_EGLFS"
ORIG_CFG_DIRECTFB="$CFG_DIRECTFB"
ORIG_CFG_LINUXFB="$CFG_LINUXFB"
-ORIG_CFG_KMS="$CFG_KMS"
ORIG_CFG_MIRCLIENT="$CFG_MIRCLIENT"
if [ "$CFG_LIBUDEV" != "no" ]; then
@@ -5609,6 +5612,20 @@ if [ "$CFG_DIRECTFB" != "no" ]; then
fi
fi
+if [ "$CFG_GBM" != "no" ]; then
+ if compileTest qpa/gbm "GBM"; then
+ CFG_GBM=yes
+ elif [ "$CFG_GBM" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
+ echo " GBM support cannot be enabled due to functionality tests!"
+ echo " Turn on verbose messaging (-v) to $0 to see the final report."
+ echo " If you believe this message is in error you may use the continue"
+ echo " switch (-continue) to $0 to continue."
+ exit 101
+ else
+ CFG_GBM=no
+ fi
+fi
+
if [ "$CFG_LINUXFB" != "no" ]; then
if compileTest qpa/linuxfb "LinuxFB"; then
CFG_LINUXFB=yes
@@ -5768,14 +5785,6 @@ if [ "$CFG_EGLFS" != "no" ]; then
fi
fi
-if [ "$CFG_KMS" = "yes" ]; then
- if [ "$CFG_EGL" = "yes" ]; then
- CFG_KMS="yes"
- else
- CFG_KMS="no"
- fi
-fi
-
# Detect accessibility support
if [ "$CFG_ACCESSIBILITY" = "no" ]; then
echo >&2 "Warning: Disabling Accessibility. This version of Qt is unsupported."
@@ -5821,6 +5830,9 @@ if [ "$CFG_DIRECTFB" = "yes" ]; then
QMakeVar set QMAKE_CFLAGS_DIRECTFB "$QMAKE_CFLAGS_DIRECTFB"
QMakeVar set QMAKE_LIBS_DIRECTFB "$QMAKE_LIBS_DIRECTFB"
fi
+if [ "$CFG_GBM" = "yes" ]; then
+ QT_CONFIG="$QT_CONFIG gbm"
+fi
if [ "$CFG_LINUXFB" = "yes" ]; then
QT_CONFIG="$QT_CONFIG linuxfb"
fi
@@ -5832,9 +5844,9 @@ if [ "$CFG_MIRCLIENT" = "yes" ]; then
fi
if [ "$XPLATFORM_MAC" = "no" ] && [ "$XPLATFORM_MINGW" = "no" ] && [ "$XPLATFORM_QNX" = "no" ] && [ "$XPLATFORM_ANDROID" = "no" ] && [ "$XPLATFORM_HAIKU" = "no" ]; then
- if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ] && [ "$CFG_LINUXFB" = "no" ] && [ "$CFG_KMS" = "no" ] && [ "$CFG_MIRCLIENT" = "no" ]; then
+ if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ] && [ "$CFG_LINUXFB" = "no" ] && [ "$CFG_MIRCLIENT" = "no" ]; then
if [ "$QPA_PLATFORM_GUARD" = "yes" ] &&
- ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] || [ "$ORIG_CFG_LINUXFB" = "auto" ] || [ "$ORIG_CFG_KMS" = "auto" ] || [ "$ORIG_CFG_MIRCLIENT" = "auto" ] ); then
+ ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] || [ "$ORIG_CFG_LINUXFB" = "auto" ] || [ "$ORIG_CFG_MIRCLIENT" = "auto" ] ); then
echo "No QPA platform plugin enabled!"
echo " If you really want to build without a QPA platform plugin you must pass"
echo " -no-qpa-platform-guard to configure. Doing this will"
@@ -6203,6 +6215,12 @@ fi
if [ "$CFG_EGLFS_EGLDEVICE" = "yes" ]; then
QT_CONFIG="$QT_CONFIG eglfs_egldevice"
fi
+if [ "$CFG_EGLFS" = "yes" ] && [ "$CFG_KMS" = "yes" ] && [ "$CFG_GBM" = "yes" ]; then
+ QT_CONFIG="$QT_CONFIG eglfs_gbm"
+ CFG_EGLFS_GBM="yes"
+else
+ CFG_EGLFS_GBM="no"
+fi
if [ "$CFG_EGLFS_MALI" = "yes" ]; then
QT_CONFIG="$QT_CONFIG eglfs_mali"
fi
@@ -7270,7 +7288,7 @@ report_support " DirectFB ............." "$CFG_DIRECTFB"
report_support " EGLFS ................" "$CFG_EGLFS"
report_support " EGLFS i.MX6 ........" "$CFG_EGLFS_VIV"
report_support " EGLFS EGLDevice ...." "$CFG_EGLFS_EGLDEVICE"
-report_support " EGLFS KMS .........." "$CFG_KMS"
+report_support " EGLFS GBM .........." "$CFG_EGLFS_GBM"
report_support " EGLFS Mali ........." "$CFG_EGLFS_MALI"
report_support " EGLFS Raspberry Pi ." "$CFG_EGLFS_BRCM"
report_support " EGLFS X11 .........." "$CFG_EGL_X"
diff --git a/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro b/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro
index f8bb854f1c..cf367d930f 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro
@@ -1,7 +1,7 @@
TEMPLATE = subdirs
contains(QT_CONFIG, egl_x11): SUBDIRS += eglfs_x11
-contains(QT_CONFIG, kms): SUBDIRS += eglfs_kms
+contains(QT_CONFIG, eglfs_gbm): SUBDIRS += eglfs_kms
contains(QT_CONFIG, eglfs_egldevice): SUBDIRS += eglfs_kms_egldevice
contains(QT_CONFIG, eglfs_brcm): SUBDIRS += eglfs_brcm
contains(QT_CONFIG, eglfs_mali): SUBDIRS += eglfs_mali