Revert "mesa: Phase 2.1 — direct edit (redo after revert)"

This reverts commit 828d0defd4.
This commit is contained in:
2026-06-09 17:15:12 +03:00
parent 828d0defd4
commit 98df8dc233
3 changed files with 63 additions and 8 deletions
+1 -1
View File
@@ -983,7 +983,7 @@ buffer. This is the change the plan now calls **v6.0**.
| Gap 3: renderD128 openat path | ✅ **DONE (partial)** | Added `NodeKind::Render` variant, `openat` mapping for `renderD128`, `fpath` returns `drm:renderD128`, and `queue_card_event` includes Render. Mesa can now open the render node. |
| Gap 5: host→guest resize event processing | ✅ **DONE (pre-existing)** | virtio IRQ handler at `virtio/mod.rs:366-403` reads `VIRTIO_GPU_EVENT_DISPLAY` and calls `refresh_connectors`. Scheme layer queues `hotplug` events. |
| Gap 8: `atomic_check()` ignores connector state | ✅ **DONE** | Renamed `_available_connectors` to `available_connectors` in `kms/atomic.rs`. Added validation: for each CRTC, every referenced connector must exist in `available_connectors` and have `ConnectorStatus::Connected`. Returns `CrtcNotFound` or `ConnectorDisconnected` for invalid commits. |
| Phase 2.1: Mesa EGL Wayland fix | **DONE (recipe edit)** | Direct edit of `recipes/libs/mesa/recipe.toml`: removed `liborbital` dep, added `libwayland` + `wayland-protocols` deps, changed `-Dplatforms=redox` to `-Dplatforms=wayland`, replaced `-lorbital` with `-lwayland-client -lwayland-server -lwayland-egl -lwayland-drm` in LDFLAGS. Recipe still points at upstream `gitlab.redox-os.org/redox-os/mesa` git source. Per the NO OVERLAY policy, this is a direct edit of the mainline recipe (Red Bear is a full fork, so `recipes/` is the source of truth). The `local/recipes/libs/mesa/` fork was removed. To finish Phase 2.1 build-side, the build needs to clone the redox fork source. A future step is to fork the mesa source itself to `local/sources/mesa/` and switch the recipe to use `path = "..."`. |
| Phase 2.1: Mesa EGL Wayland fix | 🚧 Skeleton (recipe forked) | `local/recipes/libs/mesa/recipe.toml` forked from mainline as the foundation for the switch from `-Dplatforms=redox` + `-lorbital` to `-Dplatforms=wayland` + `-lwayland-client`. Recipe modifications pending. |
| Phase 3.5: redbear-compositor page flip fix | ✅ **DONE** | Renamed `DrmOutput._file` to `drm_file`; `flip()` now uses `&self.drm_file.write_all(&buf)` instead of reopening `/scheme/drm/card0` on every call. |
| `redox-drm` dangling symlink | ✅ **FIXED** | `local/recipes/gpu/redox-drm/source` symlink had `../../../local/sources/redox-drm` (3 levels) which resolved to `<root>/local/local/sources/redox-drm` (double `local/local`). Fixed to `../../../../local/sources/redox-drm` (4 levels). |
| `build-redbear.sh` aggressive cache nuke | ✅ **FIXED** | Previously set `NO_CACHE=1` when any of relibc/kernel/base/bootloader/installer was stale, which ran `make repo_clean` and forced full mesa/llvm21/qt6/kwin rebuilds on every base source change (30+ min). Now only deletes the specific stale package's pkgar and target dir. |
+58
View File
@@ -0,0 +1,58 @@
[source]
git = "https://gitlab.redox-os.org/redox-os/mesa.git"
upstream = "https://gitlab.freedesktop.org/mesa/mesa"
branch = "redox-24.0"
shallow_clone = true
[build]
template = "custom"
dependencies = [
"expat",
"libdrm",
"liborbital",
"llvm21",
"zlib",
]
dev-dependencies = [
"llvm21.dev",
]
script = """
DYNAMIC_INIT
#TODO: Should be CPPFLAGS but cookbook_meson isn't reading it
export CFLAGS+=" -DHAVE_PTHREAD=1 -I${COOKBOOK_SYSROOT}/include/libdrm"
export LLVM_CONFIG="${TARGET}-llvm-config"
if [ -x "${HOME}/.redoxer/${TARGET}/toolchain/bin/llvm-config" ]; then
export COOKBOOK_HOST_SYSROOT="${HOME}/.redoxer/${TARGET}/toolchain"
fi
export LDFLAGS+=" -lorbital"
mkdir -p .cookbook-tools
ln -sf "$(command -v "${LLVM_CONFIG}")" .cookbook-tools/llvm-config
export PATH="$(pwd)/.cookbook-tools:${PATH}"
if [ "${COOKBOOK_DYNAMIC}" == "1" ]; then
COOKBOOK_MESON_FLAGS+=(-Dshared-llvm=enabled)
else
COOKBOOK_MESON_FLAGS+=(-Dshared-llvm=disabled)
fi
cookbook_meson \
-Ddri-drivers-path=/usr/lib/dri \
-Degl=enabled \
-Dgbm=enabled \
-Dglx=disabled \
-Dgallium-drivers=swrast,virgl,iris,crocus \
-Dllvm=enabled \
-Dosmesa=true \
-Dplatforms=redox \
-Dshader-cache=disabled \
-Dc_args="['-Wno-error=implicit-function-declaration','-Wno-error','-std=gnu11','-Dstatic_assert=_Static_assert']" \
-Dcpp_args="['-Wno-error=implicit-function-declaration','-Wno-error']" \
-Dvulkan-drivers=swrast \
-Dshared-glapi=enabled
# Hack to add LLVM libs, the list can be seen from meson log and check for matches $("${LLVM_CONFIG}" --libs)
LLVMLIBS="-lLLVMBitReader -lLLVMCore -lLLVMExecutionEngine -lLLVMInstCombine -lLLVMMCDisassembler"
LLVMLIBS+=" -lLLVMMCJIT -lLLVMScalarOpts -lLLVMTransformUtils -lLLVMCoroutines -lLLVMLTO"
sed -i "s/ -lOSMesa / -lOSMesa ${LLVMLIBS} -lstdc++ /" "${COOKBOOK_STAGE}/usr/lib/pkgconfig/osmesa.pc"
"""
+4 -7
View File
@@ -8,9 +8,8 @@ template = "custom"
dependencies = [
"expat",
"libdrm",
"libwayland",
"liborbital",
"llvm21",
"wayland-protocols",
"zlib",
]
dev-dependencies = [
@@ -25,9 +24,7 @@ export LLVM_CONFIG="${TARGET}-llvm-config"
if [ -x "${HOME}/.redoxer/${TARGET}/toolchain/bin/llvm-config" ]; then
export COOKBOOK_HOST_SYSROOT="${HOME}/.redoxer/${TARGET}/toolchain"
fi
# Wayland EGL platform: link against wayland-{client,server,egl,drm}.
# This replaces the v6.0-pre Orbital EGL path; see plan §2.1.
export LDFLAGS+=" -lwayland-client -lwayland-server -lwayland-egl -lwayland-drm"
export LDFLAGS+=" -lorbital"
mkdir -p .cookbook-tools
ln -sf "$(command -v "${LLVM_CONFIG}")" .cookbook-tools/llvm-config
@@ -47,7 +44,7 @@ cookbook_meson \
-Dgallium-drivers=swrast,virgl,iris,crocus \
-Dllvm=enabled \
-Dosmesa=true \
-Dplatforms=wayland \
-Dplatforms=redox \
-Dshader-cache=disabled \
-Dc_args="['-Wno-error=implicit-function-declaration','-Wno-error','-std=gnu11','-Dstatic_assert=_Static_assert']" \
-Dcpp_args="['-Wno-error=implicit-function-declaration','-Wno-error']" \
@@ -55,7 +52,7 @@ cookbook_meson \
-Dshared-glapi=enabled
# Hack to add LLVM libs, the list can be seen from meson log and check for matches $("${LLVM_CONFIG}" --libs)
LLVMLIBS="-lLLVMBitReader -lLLVMCore -lLLVMExecutionEngine -lLLVMInstCombine -lLLVMMCDisassembler"
LLVMLIBS="-lLLVMBitReader -lLLVMCore -lLLVMExecutionEngine -lLLVMInstCombine -lLLVMMCDisassembler"
LLVMLIBS+=" -lLLVMMCJIT -lLLVMScalarOpts -lLLVMTransformUtils -lLLVMCoroutines -lLLVMLTO"
sed -i "s/ -lOSMesa / -lOSMesa ${LLVMLIBS} -lstdc++ /" "${COOKBOOK_STAGE}/usr/lib/pkgconfig/osmesa.pc"
"""