diff --git a/local/docs/CONSOLE-TO-KDE-DESKTOP-PLAN.md b/local/docs/CONSOLE-TO-KDE-DESKTOP-PLAN.md index 6b8b19dc47..575d2119cf 100644 --- a/local/docs/CONSOLE-TO-KDE-DESKTOP-PLAN.md +++ b/local/docs/CONSOLE-TO-KDE-DESKTOP-PLAN.md @@ -983,9 +983,9 @@ 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** | Direct edit of `recipes/libs/mesa/recipe.toml`: removed `liborbital` dep, added `wayland` + `wayland-protocols` deps, changed `-Dplatforms=redox` to `-Dplatforms=wayland`, replaced `-lorbital` with `-lwayland-client -lwayland-server -lwayland-egl -lwayland-drm` in LDFLAGS. The Red Bear fork model: this is now the canonical Red Bear recipe in mainline. | +| 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** | The `source` symlink at `local/recipes/gpu/redox-drm/` previously had `../../../local/sources/redox-drm` (3 levels) which resolved to `/local/local/sources/redox-drm` (double `local/local`). Fixed to `../../../../local/sources/redox-drm` (4 levels). Note: per the NO OVERLAY-STYLE PATCHES policy (AGENTS.md), this `source` symlink is a transitional artifact for the core Red Bear fork model (kernel/base/relibc/bootloader/installer) — recipes are owned entirely in `local/recipes/` and do not use symlinks. | +| `redox-drm` dangling symlink | ✅ **FIXED** | `local/recipes/gpu/redox-drm/source` symlink had `../../../local/sources/redox-drm` (3 levels) which resolved to `/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. | | Stale `input/evdev` consumer blocking evdevd | ✅ **RESOLVED** | Before v6.0, evdevd crashed with `failed to open /scheme/input/evdev: No such device`. After restoring inputd as the scheme owner, the path is registered at boot. | | `evdevd` listed in `redbear-full.toml` | ✅ **DONE** (pre-existing) | `10_evdevd.service` is defined in `redbear-mini.toml` and inherited. | diff --git a/local/recipes/libs/mesa/recipe.toml b/local/recipes/libs/mesa/recipe.toml new file mode 100644 index 0000000000..57d7d6ec37 --- /dev/null +++ b/local/recipes/libs/mesa/recipe.toml @@ -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" +""" diff --git a/recipes/libs/mesa/recipe.toml b/recipes/libs/mesa/recipe.toml index 9a78e81288..57d7d6ec37 100644 --- a/recipes/libs/mesa/recipe.toml +++ b/recipes/libs/mesa/recipe.toml @@ -8,9 +8,8 @@ template = "custom" dependencies = [ "expat", "libdrm", + "liborbital", "llvm21", - "wayland", - "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" """