Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BCM2712d0 support #884

Merged
merged 9 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 23 additions & 20 deletions embedded/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,51 @@

set -e

BUILDROOT=buildroot
BUILDROOT_TAR=buildroot-20231002.tar.bz2
BUILDROOT=buildroot-2024.02.3
BUILDROOT_TAR=buildroot-2024.02.3.tar.gz

if [ ! -e $BUILDROOT ]; then
tar xjf $BUILDROOT_TAR
patch -p0 < buildroot-mesa3d-pi5.patch
if [ ! -e "${BUILDROOT}" ]; then
tar xvf "${BUILDROOT_TAR}"
cd "${BUILDROOT}" && patch -p1 < "${OLDPWD}/buildroot-mesa3d.patch" && cd -
fi

if [ ! -e $BUILDROOT/.config ]; then
make -C $BUILDROOT BR2_EXTERNAL="$PWD/imager" rpi-imager_defconfig
if [ ! -e "${BUILDROOT}/.config" ]; then
make -C "${BUILDROOT}" BR2_EXTERNAL="${PWD}/imager" rpi-imager_defconfig
fi

#
# Build everything
#
make -C $BUILDROOT BR2_EXTERNAL="$PWD/imager"
make -C "${BUILDROOT}" BR2_EXTERNAL="$PWD/imager"

#
# Copy the files we are interested in from buildroot's "output/images" directory
# to our "output" directory in top level directory
#

# Copy Linux kernel and initramfs
cp $BUILDROOT/output/images/rootfs.cpio.zst $BUILDROOT/output/images/Image.gz output
cp "${BUILDROOT}/output/images/rootfs.cpio.zst" "${BUILDROOT}/output/images/Image.gz" output
# Raspberry Pi firmware files
cp $BUILDROOT/output/images/rpi-firmware/start4.elf output
cp $BUILDROOT/output/images/rpi-firmware/fixup4.dat output
cp $BUILDROOT/output/images/*.dtb output
cp "${BUILDROOT}/output/images/rpi-firmware/start4.elf" output
cp "${BUILDROOT}/output/images/rpi-firmware/fixup4.dat" output

# Not used by Pi 4, but need to be present to make usbboot think it is a valid directory
touch output/bootcode.bin

cp ${BUILDROOT}/output/images/bcm2711*.dtb output/
cp ${BUILDROOT}/output/images/bcm2712*.dtb output/

mkdir -p output/overlays

mv -f output/dwc2-overlay.dtb output/overlays/dwc2.dtbo
mv -f output/vc4-kms-v3d-pi5-overlay.dtb output/overlays/vc4-kms-v3d-pi5.dtbo
mv -f output/vc4-kms-v3d-pi4-overlay.dtb output/overlays/vc4-kms-v3d-pi4.dtbo
mv -f output/disable-bt-overlay.dtb output/overlays/disable-bt.dtbo
mv -f output/disable-wifi-overlay.dtb output/overlays/disable-wifi.dtbo
mv -f output/disable-bt-pi5-overlay.dtb output/overlays/disable-bt-pi5.dtbo
mv -f output/disable-wifi-pi5-overlay.dtb output/overlays/disable-wifi-pi5.dtbo
mv -f output/overlay_map.dtb output/overlays/overlay_map.dtb
cp ${BUILDROOT}/output/images/dwc2-overlay.dtb output/overlays/dwc2.dtbo
cp ${BUILDROOT}/output/images/bcm2712d0-overlay.dtb output/overlays/bcm2712d0.dtbo
cp ${BUILDROOT}/output/images/vc4-kms-v3d-pi5-overlay.dtb output/overlays/vc4-kms-v3d-pi5.dtbo
cp ${BUILDROOT}/output/images/vc4-kms-v3d-pi4-overlay.dtb output/overlays/vc4-kms-v3d-pi4.dtbo
cp ${BUILDROOT}/output/images/disable-bt-overlay.dtb output/overlays/disable-bt.dtbo
cp ${BUILDROOT}/output/images/disable-wifi-overlay.dtb output/overlays/disable-wifi.dtbo
cp ${BUILDROOT}/output/images/disable-bt-pi5-overlay.dtb output/overlays/disable-bt-pi5.dtbo
cp ${BUILDROOT}/output/images/disable-wifi-pi5-overlay.dtb output/overlays/disable-wifi-pi5.dtbo
cp ${BUILDROOT}/output/images/overlay_map.dtb output/overlays/overlay_map.dtb

echo
echo Build complete. Files are in output folder.
Expand Down
Binary file removed embedded/buildroot-20231002.tar.bz2
Binary file not shown.
Binary file added embedded/buildroot-2024.02.3.tar.gz
Binary file not shown.
150 changes: 0 additions & 150 deletions embedded/buildroot-mesa3d-pi5.patch

This file was deleted.

158 changes: 158 additions & 0 deletions embedded/buildroot-mesa3d.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
From c1c0e6e4387de50aab08f650c2ecc3fdbf317031 Mon Sep 17 00:00:00 2001
From: Tom Dewey <tom.dewey@raspberrypi.com>
Date: Tue, 18 Jun 2024 16:42:11 +0100
Subject: [PATCH] Raspberry Pi Imager for BCM2712d0

---
.../0006-drisw-fix-build-without-dri3.patch | 58 -------------------
...on-t-try-zink-if-not-enabled-in-mesa.patch | 42 --------------
package/mesa3d/mesa3d.hash | 5 --
package/mesa3d/mesa3d.mk | 6 +-
4 files changed, 3 insertions(+), 108 deletions(-)
delete mode 100644 package/mesa3d/0006-drisw-fix-build-without-dri3.patch
delete mode 100644 package/mesa3d/0007-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch
delete mode 100644 package/mesa3d/mesa3d.hash

diff --git a/package/mesa3d/0006-drisw-fix-build-without-dri3.patch b/package/mesa3d/0006-drisw-fix-build-without-dri3.patch
deleted file mode 100644
index ab27d384cf..0000000000
--- a/package/mesa3d/0006-drisw-fix-build-without-dri3.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 3ab46dcfda9edf5c9bc27c8f5031146d9d9d8ade Mon Sep 17 00:00:00 2001
-From: Romain Naour <romain.naour@smile.fr>
-Date: Thu, 18 Jan 2024 22:50:16 +0100
-Subject: [PATCH] drisw: fix build without dri3
-
-commit 1887368df41 ("glx/sw: check for modifier support in the kopper path")
-added dri3_priv.h header and dri3_check_multibuffer() function in drisw that
-can be build without dri3.
-
- i686-buildroot-linux-gnu/bin/ld: src/glx/libglx.a.p/drisw_glx.c.o: in function `driswCreateScreenDriver':
- drisw_glx.c:(.text.driswCreateScreenDriver+0x3a0): undefined reference to `dri3_check_multibuffer'
- collect2: error: ld returned 1 exit status
-
-Add HAVE_DRI3 guard around dri3_priv.h header and the zink code using
-dri3_check_multibuffer().
-
-Fixes: 1887368df41 ("glx/sw: check for modifier support in the kopper path")
-
-Upstream: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478
-
-Signed-off-by: Romain Naour <romain.naour@smile.fr>
----
- src/glx/drisw_glx.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
-index 3d3f75259bc..4b19e2d7707 100644
---- a/src/glx/drisw_glx.c
-+++ b/src/glx/drisw_glx.c
-@@ -32,7 +32,9 @@
- #include <dlfcn.h>
- #include "dri_common.h"
- #include "drisw_priv.h"
-+#ifdef HAVE_DRI3
- #include "dri3_priv.h"
-+#endif
- #include <X11/extensions/shmproto.h>
- #include <assert.h>
- #include <vulkan/vulkan_core.h>
-@@ -995,6 +997,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv,
- goto handle_error;
- }
-
-+#ifdef HAVE_DRI3
- if (pdpyp->zink) {
- bool err;
- psc->has_multibuffer = dri3_check_multibuffer(priv->dpy, &err);
-@@ -1005,6 +1008,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv,
- goto handle_error;
- }
- }
-+#endif
-
- glx_config_destroy_list(psc->base.configs);
- psc->base.configs = configs;
---
-2.43.0
-
diff --git a/package/mesa3d/0007-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch b/package/mesa3d/0007-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch
deleted file mode 100644
index f9e4d50fd7..0000000000
--- a/package/mesa3d/0007-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 83b4ff6616708bd7ba5981d22cd5211ca6787d58 Mon Sep 17 00:00:00 2001
-From: Romain Naour <romain.naour@smile.fr>
-Date: Wed, 24 Jan 2024 14:28:32 +0100
-Subject: [PATCH] glxext: don't try zink if not enabled in mesa
-
-Commit 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers")
-added an automatic zink fallback even when the zink gallium is not
-enabled at build time.
-
-It leads to unexpected error log while loading drisw driver and
-zink is not installed on the rootfs:
-
- MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so
-
-Fixes: 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers")
-
-Upstream: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478
-
-Signed-off-by: Romain Naour <romain.naour@smile.fr>
----
- src/glx/glxext.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/glx/glxext.c b/src/glx/glxext.c
-index 39d5f08bdcf..e106eb40046 100644
---- a/src/glx/glxext.c
-+++ b/src/glx/glxext.c
-@@ -904,9 +904,11 @@ __glXInitialize(Display * dpy)
- #endif /* HAVE_DRI3 */
- if (!debug_get_bool_option("LIBGL_DRI2_DISABLE", false))
- dpyPriv->dri2Display = dri2CreateDisplay(dpy);
-+#if defined(HAVE_ZINK)
- if (!dpyPriv->dri3Display && !dpyPriv->dri2Display)
- try_zink = !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) &&
- !getenv("GALLIUM_DRIVER");
-+#endif /* HAVE_ZINK */
- }
- #endif /* GLX_USE_DRM */
- if (glx_direct)
---
-2.43.0
-
diff --git a/package/mesa3d/mesa3d.hash b/package/mesa3d/mesa3d.hash
deleted file mode 100644
index f2c25464f4..0000000000
--- a/package/mesa3d/mesa3d.hash
+++ /dev/null
@@ -1,5 +0,0 @@
-# From https://lists.freedesktop.org/archives/mesa-announce/2024-May/000758.html
-sha256 7454425f1ed4a6f1b5b107e1672b30c88b22ea0efea000ae2c7d96db93f6c26a mesa-24.0.7.tar.xz
-sha512 77b0fae80ab0a07e2e528c113eadef0e3004b8df3e6e98fffe6fc2d8ac39f5ce7fa38ebe5c2ae32bfbac993dd7cbe288ace18ebb03cf2fb445fe7114f74dd45c mesa-24.0.7.tar.xz
-# License
-sha256 a00275a53178e2645fb65be99a785c110513446a5071ff2c698ed260ad917d75 docs/license.rst
diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk
index 6bccdaed04..31a057d51c 100644
--- a/package/mesa3d/mesa3d.mk
+++ b/package/mesa3d/mesa3d.mk
@@ -5,9 +5,9 @@
################################################################################

# When updating the version, please also update mesa3d-headers
-MESA3D_VERSION = 24.0.7
-MESA3D_SOURCE = mesa-$(MESA3D_VERSION).tar.xz
-MESA3D_SITE = https://archive.mesa3d.org
+MESA3D_VERSION = f32a2585
+MESA3D_SITE = https://gitlab.freedesktop.org/mesa/mesa.git
+MESA3D_SITE_METHOD = git
MESA3D_LICENSE = MIT, SGI, Khronos
MESA3D_LICENSE_FILES = docs/license.rst
MESA3D_CPE_ID_VENDOR = mesa3d
--
2.39.3 (Apple Git-146)

Loading