summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Wesp <n.wesp@phytec.de>2020-01-28 13:08:36 (GMT)
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2020-02-06 16:30:28 (GMT)
commitcbed22d502d9f6c664734a810e10cb91bb7675a7 (patch)
treec184914f38c00f4b5f00ac29d6c7e0b068ee9cb4
parentf98b801838fdcfbac060de8d7a031b8a8d3ea14c (diff)
downloadmeta-phytec-cbed22d502d9f6c664734a810e10cb91bb7675a7.zip
meta-phytec-cbed22d502d9f6c664734a810e10cb91bb7675a7.tar.bz2
recipes-graphics: mesa: fix build for gallium driver
Partial adaption of not accepted upstream patch: https://patchwork.openembedded.org/patch/160792/ original commit message: Since commit [1] the imx-drm driver is covered by the generic kmsro driver. Unfortunatly we need to patch the autotools path too since the switch commit [1] missed some dependencies. [1] https://gitlab.freedesktop.org/mesa/mesa/commit/ \ 41a0acd6a149ec9f47ea527ad08a2b29bf1ee6b2 Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Norbert Wesp <n.wesp@phytec.de> Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
-rw-r--r--recipes-graphics/mesa/mesa/0001-kmsro-move-entry-points-from-etnaviv-to-kmsro.patch42
-rw-r--r--recipes-graphics/mesa/mesa/0002-mesa-fix-imx-gallium-driver.patch51
-rw-r--r--recipes-graphics/mesa/mesa_%.bbappend16
3 files changed, 107 insertions, 2 deletions
diff --git a/recipes-graphics/mesa/mesa/0001-kmsro-move-entry-points-from-etnaviv-to-kmsro.patch b/recipes-graphics/mesa/mesa/0001-kmsro-move-entry-points-from-etnaviv-to-kmsro.patch
new file mode 100644
index 0000000..e1fde93
--- /dev/null
+++ b/recipes-graphics/mesa/mesa/0001-kmsro-move-entry-points-from-etnaviv-to-kmsro.patch
@@ -0,0 +1,42 @@
+From a3274859b182718aaddef4c86ef163538f6b9a72 Mon Sep 17 00:00:00 2001
+From: Jonathan Marek <jonathan@marek.ca>
+Date: Thu, 1 Aug 2019 12:48:40 -0400
+Subject: [PATCH] kmsro: move entry points from etnaviv to kmsro
+
+These drivers are kmsro drivers so they should be part of the kmsro #if
+
+This fixes missing imx_drm driver when building with only freedreno+kmsro
+
+Signed-off-by: Jonathan Marek <jonathan@marek.ca>
+Reviewed-by: Eric Anholt <eric@anholt.net>
+
+%% original patch: 0001-kmsro-move-entry-points-from-etnaviv-to-kmsro.patch
+---
+ src/gallium/targets/dri/target.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/gallium/targets/dri/target.c b/src/gallium/targets/dri/target.c
+index 6b0ea78..8326151 100644
+--- a/src/gallium/targets/dri/target.c
++++ b/src/gallium/targets/dri/target.c
+@@ -77,14 +77,15 @@ DEFINE_LOADER_DRM_ENTRYPOINT(v3d)
+
+ #if defined(GALLIUM_VC4)
+ DEFINE_LOADER_DRM_ENTRYPOINT(vc4)
++#endif
++
+ #if defined(GALLIUM_KMSRO)
+ DEFINE_LOADER_DRM_ENTRYPOINT(hx8357d)
+ DEFINE_LOADER_DRM_ENTRYPOINT(pl111)
+-#endif
++DEFINE_LOADER_DRM_ENTRYPOINT(imx_drm)
+ #endif
+
+ #if defined(GALLIUM_ETNAVIV)
+-DEFINE_LOADER_DRM_ENTRYPOINT(imx_drm)
+ DEFINE_LOADER_DRM_ENTRYPOINT(etnaviv)
+ #endif
+
+--
+2.7.4
+
diff --git a/recipes-graphics/mesa/mesa/0002-mesa-fix-imx-gallium-driver.patch b/recipes-graphics/mesa/mesa/0002-mesa-fix-imx-gallium-driver.patch
new file mode 100644
index 0000000..322efd6
--- /dev/null
+++ b/recipes-graphics/mesa/mesa/0002-mesa-fix-imx-gallium-driver.patch
@@ -0,0 +1,51 @@
+From 608091fd2c161f2c9af2eb5b1af44929e6710bac Mon Sep 17 00:00:00 2001
+From: Norbert Wesp <n.wesp@phytec.de>
+Date: Tue, 28 Jan 2020 13:00:19 +0100
+Subject: [PATCH] mesa: fix imx gallium driver
+
+original commit message:
+ Fix imx autotools build dependencies
+
+ Since commit 41a0acd6 ("Switch imx to kmsro and remove the imx winsys")
+ the imx-drm is covered by kmsro. During the switch some autotools
+ dependencies are missed. Autotools are marked as deprecated but since
+ yocto still uses them we need to cover this.
+
+ Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
+
+Signed-off-by: Norbert Wesp <n.wesp@phytec.de>
+---
+ configure.ac | 4 ++--
+ src/gallium/drivers/kmsro/Automake.inc | 1 +
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index bfb6b8c..c40a68a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2856,8 +2856,8 @@ AM_CONDITIONAL(HAVE_SWR_BUILTIN, test "x$HAVE_SWR_BUILTIN" = xyes)
+
+ dnl We need to validate some needed dependencies for renderonly drivers.
+
+-if test "x$HAVE_GALLIUM_VC4" != xyes -a "x$HAVE_GALLIUM_KMSRO" = xyes ; then
+- AC_MSG_ERROR([Building with kmsro requires vc4])
++if test "x$HAVE_GALLIUM_VC4" != xyes -a "x$HAVE_GALLIUM_ETNAVIV" != xyes -a "x$HAVE_GALLIUM_KMSRO" = xyes ; then
++ AC_MSG_ERROR([Building with kmsro requires vc4 or etnaviv])
+ fi
+
+ if test "x$HAVE_GALLIUM_NOUVEAU" != xyes -a "x$HAVE_GALLIUM_TEGRA" = xyes; then
+diff --git a/src/gallium/drivers/kmsro/Automake.inc b/src/gallium/drivers/kmsro/Automake.inc
+index d5961c9..ebed424 100644
+--- a/src/gallium/drivers/kmsro/Automake.inc
++++ b/src/gallium/drivers/kmsro/Automake.inc
+@@ -2,6 +2,7 @@ if HAVE_GALLIUM_KMSRO
+
+ TARGET_DRIVERS += pl111
+ TARGET_DRIVERS += hx8357d
++TARGET_DRIVERS += imx-drm
+ TARGET_CPPFLAGS += -DGALLIUM_KMSRO
+ TARGET_LIB_DEPS += \
+ $(top_builddir)/src/gallium/winsys/kmsro/drm/libkmsrodrm.la \
+--
+2.7.4
+
diff --git a/recipes-graphics/mesa/mesa_%.bbappend b/recipes-graphics/mesa/mesa_%.bbappend
index 2bb54fd..8fb09c8 100644
--- a/recipes-graphics/mesa/mesa_%.bbappend
+++ b/recipes-graphics/mesa/mesa_%.bbappend
@@ -1,6 +1,18 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append = " \
+ file://0001-kmsro-move-entry-points-from-etnaviv-to-kmsro.patch \
+ file://0002-mesa-fix-imx-gallium-driver.patch \
+"
+
PACKAGE_ARCH_mx6 = "${MACHINE_SOCARCH}"
+PACKAGECONFIG[kmsro] = ""
+
+GALLIUMDRIVERS_remove ="${@bb.utils.contains('PACKAGECONFIG', 'imx', ',imx', '', d)}"
+GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'kmsro', ',kmsro', '', d)}"
+
# use Etnaviv gallium driver for imxgpu3d machines
# gpu needs to be covered by MACHINE_SOCARCH
-PACKAGECONFIG_append_imxgpu3d = " gallium"
-GALLIUMDRIVERS_imxgpu3d = "etnaviv,kmsro,vc4"
+PACKAGECONFIG_append_imxgpu3d = " gallium kmsro"
+GALLIUMDRIVERS_imxgpu3d = "etnaviv,vc4,swrast"