From 43ae30d0852a30a80d2c2ac1a784441b356000ee Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Thu, 7 Oct 2021 10:36:35 +0300 Subject: toradex: use the correct DRI device with KMS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The correct DRI device to be used with Qt varies with each Toradex board. Fill the kms.conf with correct device based on the selected target machine. The KMS is used with mx8, but also when ever mainline bsp is used instead of NXP. Change-Id: I8872c752f7f13210d33ec061fc9125329388ec41 Reviewed-by: Pasi Petäjäjärvi (cherry picked from commit baaf0a989166abfddb4762f2e8e721ba65504162) Reviewed-by: Mikko Gronoff --- .../conf/distro/include/toradex.inc | 11 ++++++++ .../boot2qt-addons/default-qt-envs.bbappend | 18 ++++++++++--- .../boot2qt-addons/default-qt-envs/kms.conf.in | 4 +++ .../boot2qt-addons/default-qt-envs/mx8/kms.conf | 4 --- .../boot2qt-addons/default-qt-envs.bbappend | 30 ---------------------- .../boot2qt-addons/default-qt-envs/mx8/kms.conf | 4 --- 6 files changed, 30 insertions(+), 41 deletions(-) create mode 100644 meta-boot2qt-distro/dynamic-layers/freescale-layer/recipes-qt/boot2qt-addons/default-qt-envs/kms.conf.in delete mode 100644 meta-boot2qt-distro/dynamic-layers/freescale-layer/recipes-qt/boot2qt-addons/default-qt-envs/mx8/kms.conf delete mode 100644 meta-boot2qt-distro/dynamic-layers/toradex-nxp-layer/recipes-qt/boot2qt-addons/default-qt-envs.bbappend delete mode 100644 meta-boot2qt-distro/dynamic-layers/toradex-nxp-layer/recipes-qt/boot2qt-addons/default-qt-envs/mx8/kms.conf diff --git a/meta-boot2qt-distro/conf/distro/include/toradex.inc b/meta-boot2qt-distro/conf/distro/include/toradex.inc index 02517d59..12e56557 100644 --- a/meta-boot2qt-distro/conf/distro/include/toradex.inc +++ b/meta-boot2qt-distro/conf/distro/include/toradex.inc @@ -58,5 +58,16 @@ GPULESS_FEATURES = "wayland opengl vulkan webengine" GPULESS_FEATURES_imxgpu = "" DISTRO_FEATURES_remove = "${GPULESS_FEATURES}" +# Suitable DRI device +DRI_DEVICE_apalis-imx6 = "card1" +DRI_DEVICE_colibri-imx6 = "card1" +DRI_DEVICE_colibri-imx7-emmc = "card0" +DRI_DEVICE_apalis-imx8 = "card1" +DRI_DEVICE_apalis-imx8x = "card0" +DRI_DEVICE_colibri-imx8x = "card1" +DRI_DEVICE_colibri-imx8x-v10b = "card1" +DRI_DEVICE_verdin-imx8mm = "card0" +DRI_DEVICE_verdin-imx8mp = "card0" + # remove support for 256MB version colibri-imx6ull in tezi image, since image will be too large for it. TORADEX_PRODUCT_IDS_remove_colibri-imx6ull = "0036" diff --git a/meta-boot2qt-distro/dynamic-layers/freescale-layer/recipes-qt/boot2qt-addons/default-qt-envs.bbappend b/meta-boot2qt-distro/dynamic-layers/freescale-layer/recipes-qt/boot2qt-addons/default-qt-envs.bbappend index 0a71fe20..91cae3f3 100644 --- a/meta-boot2qt-distro/dynamic-layers/freescale-layer/recipes-qt/boot2qt-addons/default-qt-envs.bbappend +++ b/meta-boot2qt-distro/dynamic-layers/freescale-layer/recipes-qt/boot2qt-addons/default-qt-envs.bbappend @@ -29,7 +29,10 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -SRC_URI_append_mx8 = " file://kms.conf" +SRC_URI += "file://kms.conf.in" + +# Default DRI device to use with KMS +DRI_DEVICE ?= "card0" do_configure_append() { echo "FB_MULTI_BUFFER=2" >> ${WORKDIR}/defaults @@ -40,10 +43,19 @@ do_configure_append_mx8() { echo "QT_QPA_EGLFS_FORCE888=1" >> ${WORKDIR}/defaults echo "QT_QPA_EGLFS_KMS_ATOMIC=1" >> ${WORKDIR}/defaults echo "QT_QPA_EGLFS_KMS_CONFIG=/etc/kms.conf" >> ${WORKDIR}/defaults + sed -e 's/@DEVICE@/${DRI_DEVICE}/' ${WORKDIR}/kms.conf.in > ${WORKDIR}/kms.conf +} + +do_configure_append_use-mainline-bsp() { + echo "QT_QPA_EGLFS_KMS_ATOMIC=1" >> ${WORKDIR}/defaults + echo "QT_QPA_EGLFS_KMS_CONFIG=/etc/kms.conf" >> ${WORKDIR}/defaults + sed -e 's/@DEVICE@/${DRI_DEVICE}/' ${WORKDIR}/kms.conf.in > ${WORKDIR}/kms.conf } -do_install_append_mx8() { - install -m 0644 ${WORKDIR}/kms.conf ${D}${sysconfdir}/ +do_install_append() { + if [ -e ${WORKDIR}/kms.conf ]; then + install -m 0644 ${WORKDIR}/kms.conf ${D}${sysconfdir}/ + fi } do_configure_append_mx8mm() { diff --git a/meta-boot2qt-distro/dynamic-layers/freescale-layer/recipes-qt/boot2qt-addons/default-qt-envs/kms.conf.in b/meta-boot2qt-distro/dynamic-layers/freescale-layer/recipes-qt/boot2qt-addons/default-qt-envs/kms.conf.in new file mode 100644 index 00000000..4cf3ba67 --- /dev/null +++ b/meta-boot2qt-distro/dynamic-layers/freescale-layer/recipes-qt/boot2qt-addons/default-qt-envs/kms.conf.in @@ -0,0 +1,4 @@ +{ + "hwcursor": false, + "device": "/dev/dri/@DEVICE@" +} diff --git a/meta-boot2qt-distro/dynamic-layers/freescale-layer/recipes-qt/boot2qt-addons/default-qt-envs/mx8/kms.conf b/meta-boot2qt-distro/dynamic-layers/freescale-layer/recipes-qt/boot2qt-addons/default-qt-envs/mx8/kms.conf deleted file mode 100644 index 416a053e..00000000 --- a/meta-boot2qt-distro/dynamic-layers/freescale-layer/recipes-qt/boot2qt-addons/default-qt-envs/mx8/kms.conf +++ /dev/null @@ -1,4 +0,0 @@ -{ - "hwcursor": false, - "device": "/dev/dri/card0" -} diff --git a/meta-boot2qt-distro/dynamic-layers/toradex-nxp-layer/recipes-qt/boot2qt-addons/default-qt-envs.bbappend b/meta-boot2qt-distro/dynamic-layers/toradex-nxp-layer/recipes-qt/boot2qt-addons/default-qt-envs.bbappend deleted file mode 100644 index 419b167c..00000000 --- a/meta-boot2qt-distro/dynamic-layers/toradex-nxp-layer/recipes-qt/boot2qt-addons/default-qt-envs.bbappend +++ /dev/null @@ -1,30 +0,0 @@ -############################################################################ -## -## Copyright (C) 2021 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the Boot to Qt meta layer. -## -## $QT_BEGIN_LICENSE:GPL$ -## 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 https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 or (at your option) any later version -## approved by the KDE Free Qt Foundation. The licenses are as published by -## the Free Software Foundation and appearing in the file LICENSE.GPL3 -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################ - -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" diff --git a/meta-boot2qt-distro/dynamic-layers/toradex-nxp-layer/recipes-qt/boot2qt-addons/default-qt-envs/mx8/kms.conf b/meta-boot2qt-distro/dynamic-layers/toradex-nxp-layer/recipes-qt/boot2qt-addons/default-qt-envs/mx8/kms.conf deleted file mode 100644 index 19a208c0..00000000 --- a/meta-boot2qt-distro/dynamic-layers/toradex-nxp-layer/recipes-qt/boot2qt-addons/default-qt-envs/mx8/kms.conf +++ /dev/null @@ -1,4 +0,0 @@ -{ - "hwcursor": false, - "device": "/dev/dri/card1" -} -- cgit v1.2.3