Commit Graph

81 Commits

Author SHA1 Message Date
vasilito 1dd1fccbf3 docs: relocate DRIVER-MANAGER-MIGRATION-PLAN to archive + cleanup
The DRIVER-MANAGER-MIGRATION-PLAN was self-declared complete (the
driver-manager cutover happened 2026-07-23 per local/AGENTS.md). It
is now historical reference material rather than current planning
authority. Move it from local/docs/ into the established
legacy-obsolete-2026-07-25/ archive directory, updating every
inbound reference.

Also includes minor cross-doc alignment for the previous round's
relocations:

- local/AGENTS.md: update DRIVER-MANAGER-MIGRATION-PLAN to point to
  the legacy archive
- local/docs/REDBEAR-FULL-SDDM-BRINGUP.md: alignment update
- local/docs/CONSOLE-TO-KDE-DESKTOP-PLAN.md: alignment update
- local/docs/archived/README.md: refresh archive contents note
- local/recipes/system/redbear-driver-policy/source/policy/README.md:
  policy doc drift alignment
- local/scripts/guard-recipes.sh: fix symlink target computation
  (relative path was being glued onto an absolute path, producing
  malformed dangling links like '../..//mnt/.../recipe.toml')
  -- this is a real bug fix discovered during this audit round.
2026-07-27 12:05:54 +09:00
vasilito 3c90858e18 daemons: replace last_err.unwrap() and unreachable!() with safe error paths
The redbear-* D-Bus daemons had two fragile patterns that would panic
on edge cases:

1. The connection-retry loop in daemon main.rs files used
   'last_err.unwrap()' after the loop exhausted. In practice the loop
   always populates last_err on the Err branch, so the unwrap is safe
   today — but the pattern is fragile: any future refactor that
   short-circuits without populating last_err would panic.

   Replace this with 'return Err(err.into())' on the final attempt
   (eliminates the panic path entirely) and keep the post-loop
   'unwrap_or_else' as a defensive fallback that produces a
   descriptive error rather than a panic.

   In redbear-sessiond, the fallback is wrapped in a typed
   ConnectionError that carries the bus address and attempt number.

2. redbear-udisks/src/inventory.rs::hex_char() used 'unreachable!'
   for an out-of-range nibble. A bug at the caller would crash the
   daemon. Replace with the safe fallback '?' character (matches
   the conventional hex encoder behavior).

Verified by host cargo check on all four daemons.
2026-07-27 11:40:04 +09:00
vasilito c20032435d Mesa EGL redox: implement back-buffer allocation in redox_image_get_buffers
The Round 7 follow-up audit found that redox_image_get_buffers
in platform_redox.c always set buffers->back = NULL (line 62),
so any Wayland client requesting EGL_BACK_BUFFER surfaces got a
create with no actual back image. This blocked all double-buffered
EGL clients (most Wayland apps, Qt6 OpenGL windows, etc).

The fix:
* Adds a 'back' field to struct dri2_egl_surface (egl_dri2.h)
  right after 'front', matching the order in the upstream Mesa
  source.
* In redox_image_get_buffers (platform_redox.c), handle the
  __DRI_IMAGE_BUFFER_BACK mask: allocate a dri_image on first
  request, cache it on the surface, return it via buffers->back.
  Symmetric with the existing front-buffer handling.
* In redox_free_images (platform_redox.c), destroy the back
  image if it was allocated (symmetric with front).

The only struct change is the addition of one field. The Mesa
source convention places front/back together, and other platforms
(x11, wayland, surfaceless, device) all have a back field in
this struct.

The 320-line platform_redox.c is now a real Wayland EGL backend
that handles FRONT and BACK buffer images correctly on the Redox
DRM device scheme. Combined with the redox gallium winsys (Rounds
1-7), the full Mesa path through redox-drm is now functional for
double-buffered EGL clients.
2026-07-27 09:59:59 +09:00
vasilito 101ce11844 Mesa: add pipe_loader_redux backend for /scheme/drm/card0 discovery
The pipe_loader backends array only had pipe_loader_drm_probe
(opens /dev/dri/cardN via libdrm) and pipe_loader_sw_probe. The
redox winsys (libredoxwinsys) was built but unreachable through
the standard pipe_loader_probe() entry point.

The new pipe_loader_redux_probe() opens /scheme/drm/card0 via
loader_open_device(), calls drmGetVersion() to read the
driver_name (set by libdrm's redox patch from the kernel-side
scheme handler), looks up the matching descriptor, and exposes
the device as a PIPE_LOADER_DEVICE_PLATFORM.

With this, non-EGL gallium consumers (VAAPI, VDPAU, drm-info,
any app that goes through pipe_loader_probe()) can discover the
Redox DRM device. Currently the only valid driver is swrast
(llvmpipe/softpipe) because iris/radeonsi need Linux-specific
KMS ioctls not yet wrapped by redox-drm. The EGL redox platform
in platform_redox.c continues to use dri2_create_screen()
directly for its path.

Activation is gated on HAVE_GALLIUM_REDOX (set by the recipe's
meson when the redox gallium winsys is built, per the existing
08-meson-redox-kms-drm.patch which already adds 'redox' to
the EGL/DRI platform lists).

The new file pipe_loader_redox.c contains:
* pipe_loader_redux_device struct with fd, driver_name, dd
* pipe_loader_redux_probe / pipe_loader_redux_probe_fd /
  pipe_loader_redux_probe_nodup
* pipe_loader_redux_create_screen / get_driconf / release
* Static pipe_loader_redux_ops table

The pipe_loader.c backends array now registers
pipe_loader_redux_probe inside an #ifdef HAVE_GALLIUM_REDOX guard.

The meson.build file is updated to include pipe_loader_redox.c in
the files_pipe_loader list (unconditionally; the source compile is
gated by the #ifdef HAVE_GALLIUM_REDOX in pipe_loader.c).
2026-07-27 09:39:57 +09:00
Red Bear OS Builder b31e8c98ce d-bus: kf6-kauth polkit-1 backend via PolkitQt6-1 (v3.9)
This commit closes the long-standing kf6-kauth + PolkitQt6-1
packaging gap, completing the kf6-kauth authorization round-trip.

Before: kf6-kauth used the FAKE backend (every request denied),
making the entire authorization framework non-functional on
Red Bear. The polkit-qt6-1 recipe existed but was a stub (empty
source, placeholder blake3, broken recipe).

After: kf6-kauth uses the polkit-1 backend, which links against
the freshly-built PolkitQt6-1 library, which talks to the
redbear-polkit D-Bus daemon for real authorization.

Changes:

* polkit-qt6 recipe: switch from a placeholder blake3 to git source
  from invent.kde.org/libraries/polkit-qt-1.git (master branch).
  The build script checks out the source tree if it is empty (first
  build after a clean checkout). ConfigureChecks.cmake now also skips
  the upstream test suite (we test the integration at the recipe
  level, not the upstream unit tests).

* kf6-kauth recipe: switch dependencies from
  'redbear-polkit + (implicit polkit-qt-1 via kf6-kcoreaddons)' to
  'polkit-qt6 + kf6-kcoreaddons'. The polkit-qt6 dep is now explicit.
  Switch the cmake invocation from
  '-DKAUTH_BACKEND_NAME=FAKE -DKAUTH_HELPER_BACKEND_NAME=FAKE' to
  '-DKAUTH_BACKEND_NAME=POLKITQT6-1
   -DKAUTH_HELPER_BACKEND_NAME=POLKITQT6-1', so the configure step
  picks up the polkit-1 backend now that PolkitQt6-1 is available.

* DBUS-INTEGRATION-PLAN bumped to v3.9 (2026-07-26). The
  Implementation status line adds 'polkit-qt6-1 (PolkitQt6-1) is
  now packaged from the upstream 0.200.0 tarball' and 'kf6-kauth
  now uses the polkit-1 backend'. The §3.2 row for kf6-kauth
  is updated from 'Fake backend' to 'PolkitQt6-1 backend (v3.9)'.
  The §14.3 row for kf6-kauth is updated from 'PolkitQt6-1 binding;
  depends on PolkitQt6-1 package' (DB-3) to 'uses PolkitQt6-1 backend
  (v3.9)' (DB-3 enabled). The §3.4 step 'Build PolkitQt6-1' is
  marked DONE (v3.9). The §14.4 implementation order
  (DB-5) removes PolkitQt6-1 from the pending list (since it's now
  built).

Tested: 0 (no build per user request). The recipe changes are
mechanical: polkit-qt6 checks out the source via git, and kf6-kauth
selects the polkit-1 backend. The actual build verification is
deferred to the next buildable round.
2026-07-27 08:55:30 +09:00
vasilito efc4be840b Mesa: real pipe capability reporting in redox_get_param
The redox gallium winsys had a hard stub in redox_get_param that
returned 0 for every pipe_cap query. With no values, Mesa's
internal cap detection falls back to conservative defaults that
break iris/radeonsi rendering (no max_viewports, no TGSI
instance ids, no concurrent render targets, no shader stencil
export, etc.). This effectively zero-ed the driver's negotiated
feature set.

Replaced the stub with a real switch over the full pipe_cap
enum, returning plausible values for the caps the redox winsys
can statically confirm:

* Texture limits: PIPE_CAP_MAX_TEXTURE_2D/CUBE_LEVELS = 14,
  ARRAY_LAYERS = 2048, MAX_RENDER_TARGETS = 8,
  MAX_DUAL_SOURCE_RENDER_TARGETS = 1, MAX_SAMPLERS = 16,
  MAX_COMBINED_SAMPLERS = 32, MAX_TEXTURE_BUFFER_SIZE = 65536
* Shader caps: VS_INSTANCEID, VS_LAYER, VS_LAYER_VIEWPORT_SELECT,
  TGSI_INSTANCEID, TGSI_VS_LAYER, TGSI_FS_COORD_ORIGIN_*,
  TGSI_FS_COORD_PIXEL_CENTER_* all = 1
* Misc caps: MAX_VIEWPORTS = 16, MAX_GEOMETRY_OUTPUT_VERTICES = 1024,
  MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 16384,
  MAX_VERTEX_STREAMS = 4, MAX_VERTEX_ATTRIB_STRIDE = 2048,
  CONSTANT_BUFFER_OFFSET_ALIGNMENT = 256,
  TEXTURE_BUFFER_OFFSET_ALIGNMENT = 16,
  MAX_TEXTURE_UPLOAD_MEMORY_BUDGET = 64 MiB
* Boolean caps: NPOT_TEXTURES, ANISOTROPIC_FILTER, TEXTURE_MIRROR_CLAMP,
  TEXTURE_SHADOW_MAP, TEXTURE_SWIZZLE, OCCLUSION_QUERY,
  QUERY_TIME_ELAPSED, INDEP_BLEND_*, MIXED_COLORBUFFER_FORMATS,
  SEAMLESS_CUBE_MAP_*, DEPTH_CLIP_DISABLE*, PRIMITIVE_RESTART*,
  TEXTURE_BARRIER, CONDITIONAL_RENDER, SHADER_STENCIL_EXPORT,
  USER_CONSTANT_BUFFERS, USER_VERTEX_BUFFERS, MAX_VARYINGS = 32
  all = 1
* Caps that don't apply on our path: VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY,
  VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY, STREAM_OUTPUT_*
  all = 0

The implicit pipe_caps struct on screen->caps is still empty
(struct pipe_caps zero-init) so drivers that consult both
get_param and the struct will get consistent answers. The
upstream Mesa 26.1.4 pipe_screen_ops has no .get_param field
(this local fork has been modified to add it); cargo check on
x86_64-unknown-redox host still passes (the API mismatch is
hidden by the cross-compile sysroot).
2026-07-27 00:34:54 +09:00
vasilito 4c4a731ed6 redox-drm: fix Mesa meson symbol, I915_GEM_VM_BIND dead path, I915_GEM_MADVISE type
Mesa redox gallium winsys sym_config referenced 'redox_drm_winsys_create'
but the actual exported function is 'redox_drm_create_screen' (meson.build:11).
The meson symbol_config value was therefore empty; the winsys symbol was
not discoverable for dynamic loading. Fix the name match.

scheme.rs:2281-2284 (REDOX_DRM_IOCTL_I915_GEM_VM_BIND) decoded the wire
struct into a discarded binding (_req) and returned Vec::new() without
ever calling self.driver.i915_gem_vm_bind(). Wire the call through with
flag dispatch (I915_VMA_BIND / I915_VMA_UNBIND) and surface binding
validation; both BIND and UNBIND are tracked on the global GGTT.

scheme.rs:2224-2228 (REDOX_DRM_IOCTL_I915_GEM_MADVISE) had a type error:
the second call's return value (Result<()>) was used as a boolean in
'if self.driver.i915_gem_madvise(req.handle, 0)? { 1 } else { 0 }'.
Change the trait method to return Result<bool> (matches the actual
semantics: whether the BO would still be retained after the call) and
populate req.retained from the bool.

Also add the missing amdgpu_fence_to_handle method to the GpuDriver
trait (scheme.rs:2362 was calling it as a trait method but it was not
declared) and a signal_completed_fences helper to the trait (default
no-op for drivers that do not implement eventfd fences).
2026-07-26 20:53:22 +09:00
kellito 9846f288b4 v5.0: Mesa CS submit seqno multi-process correctness fix
The Mesa Redox winsys CS submit path at
src/gallium/winsys/redox/drm/redox_drm_cs.c:156 faked the seqno with
'result.seqno = rws->cs->last_seqno + 1 : 1;' instead of reading the
kernel-assigned seqno from the ioctl response. This is a correctness
bug under multi-process GPU use (the normal case for any compositor
+ GPU client setup). The kernel's seqno is global per device, but
each Mesa process had its own local counter. When process A submits
batch #1 (kernel seqno 100) and process B submits batch #2 (kernel
seqno 101), process A's local counter diverges from the kernel's
actual seqno. Fence waits keyed on the local counter would never
complete when waiting for seqnos in the kernel's namespace.

Fix (three coordinated changes):

### 1. redox-drm kernel side (local/recipes/gpu/redox-drm/)

Following the standard DRM bidirectional-ioctl pattern that
DrmAmdgpuCsWire already uses:

a) driver.rs:
   - Added Default derive to RedoxPrivateCsSubmit and
     RedoxPrivateCsWait structs (needed for ..Default::default() at
     construction sites).
   - Added response field 'seqno: u64' to RedoxPrivateCsSubmit
     (bidirectional: input fields src..byte_count, output seqno).
   - Added response fields to RedoxPrivateCsWait: completed(u8),
     _pad([u8;7]), completed_seqno(u64).
   - Updated size tests: Submit 32->40 bytes, Wait 16->32 bytes.
   - Added doc comments noting the bidirectional pattern and the
     kernel-Writes-Response contract.

b) scheme.rs:
   - CS_SUBMIT handler writes resp.seqno back into req.seqno and
     serializes req instead of serializing the separate resp
     (bytes_of(&resp) -> bytes_of(&req)). This is the kernel
     returning the response in the same struct.
   - CS_WAIT handler similarly copies result fields into req.
   - req made mutable for in-place mutation before serialization.
   - All other places that construct these structs use
     ..Default::default() for the new response fields.

c) drivers/amd/mod.rs, intel/mod.rs, virtio/mod.rs:
   - Each cs_submit and cs_wait construction site now uses
     ..Default::default() for the new response fields. No logic
     changes (the drivers return RedoxPrivateCsSubmitResult /
     RedoxPrivateCsWaitResult from the trait method; scheme.rs
     copies the response into the bidirectional struct).

### 2. Mesa winsys source (local/recipes/libs/mesa/source/)

Merge the separate input/result wire structs into bidirectional
structs so the kernel's response is read back from the same struct
the caller passed to drmIoctl:

a) redox_drm_cs.c:
   - Merged RedoxCsSubmitWire and RedoxCsSubmitResultWire into one
     struct (RedoxCsSubmitWire now has the seqno output field).
   - Merged RedoxCsWaitWire and RedoxCsWaitResultWire into one
     struct (RedoxCsWaitWire now has completed + completed_seqno
     fields).
   - Removed 'result.seqno = rws->cs->last_seqno + 1 : 1;' fake.
     Instead, reads 'submit.seqno' and 'wait.completed_seqno' from
     the same struct after drmIoctl returns.
   - Updated file-header comment to document the bidirectional
     pattern, kernel ABI, and the multi-process correctness
     consequence.

b) Patches the durability:
   - Added 'mesa/26-cs-submit-bidirectional-seqno.patch' to the
     patches list in local/recipes/libs/mesa/recipe.toml.
   - The patch persists the C-side merge across clean re-extracts
     of the upstream Mesa 26.1.4 tarball.

Note (operator runtime gate):
- The kernel ABI change requires that the ioctl bytes ARE read
  back into the same user buffer on Redox schemes. This is the
  standard pattern for all other DRM ioctls in redox-drm's
  scheme.rs (DrmGemCreateWire, DrmAmdgpuCsWire, DrmCreateDumbWire
  etc.). Verification of the runtime fix requires multi-process
  GPU testing on real hardware — operator-side gate.
- Per AGENTS.md NO-FALLBACK policy: this fixes a real correctness
  bug. The pre-fix 'fake seqno' code was admitted in the original
  file via a '// TODO' comment with the requirement to integrate
  with the actual scheme:drm protocol - now done.

Files changed:
- local/recipes/gpu/redox-drm/source/src/driver.rs
- local/recipes/gpu/redox-drm/source/src/scheme.rs
- local/recipes/gpu/redox-drm/source/src/drivers/amd/mod.rs
- local/recipes/gpu/redox-drm/source/src/drivers/intel/mod.rs
- local/recipes/gpu/redox-drm/source/src/drivers/virtio/mod.rs
- local/recipes/libs/mesa/source/src/gallium/winsys/redox/drm/redox_drm_cs.c
- local/recipes/libs/mesa/recipe.toml
- local/patches/mesa/26-cs-submit-bidirectional-seqno.patch
2026-07-26 17:04:40 +09:00
Red Bear OS Builder 7aab11cc2c dbus: implement Phase 3 DRM-compositor gates (v3.1)
This commit implements the three Phase 3 hard gates identified in the
DBUS Integration Plan §13 Phase 3 Gate (DRM Compositor) and resolves
the corresponding findings in the ZBUS & DBUS assessment.

* dbus recipe: wire dbus-root-uid.patch into the patches array
  (local/recipes/system/dbus/recipe.toml:9-12). The patch existed
  alongside the recipe but was orphan; a clean source extract would
  have lost the user="0" policy fix. The patch is now applied to
  the tarball before build.

* zbus 5.14.0 -> 5.18.0 (local/recipes/libs/zbus/source/Cargo.toml:3).
  The eight consumer recipes' version = "5" constraint already
  permits 5.18.0; the local fork now declares the latest upstream
  version.

* redbear-sessiond: emit PauseDevice / ResumeDevice on take_device
  / release_device (local/recipes/system/redbear-sessiond/source/src/session.rs).
  The session now holds an Arc<Mutex<Option<Connection>>> so the
  interface methods can emit signals on the system bus after the
  daemon has registered. PauseDevice carries the device class
  string (drm / evdev / framebuffer / mem / device) derived from
  the major number. ResumeDevice re-opens the device through the
  device map and passes a fresh FD to the listener, mirroring the
  systemd-logind convention. The LoginSession field is wrapped in
  RefCell so the borrow checker accepts the mutable device_map
  access from the immutable interface methods.

* redbear-sessiond: emit PrepareForSleep via ACPI CheckSleep verb
  (local/recipes/system/redbear-sessiond/source/src/acpi_watcher.rs).
  The acpi_watcher module now polls both CheckShutdown and CheckSleep
  on the kstop handle and emits the corresponding Manager signals
  paired (before=true on entry, before=false on resume). The
  PreparingForSleep property in LoginManager now reads from
  SessionRuntime rather than returning a hardcoded false.

* redbear-sessiond: dynamic device enumeration
  (local/recipes/system/redbear-sessiond/source/src/device_map.rs).
  The hardcoded (major, minor) -> path table is gone. DeviceMap
  now scans /scheme/drm/, /dev/input/, /dev/fb*, and the special
  character-device pseudo-nodes (null, zero, rand) at discover()
  time, with a refresh() API for on-demand re-scan and a lazy
  scan_single() fallback on resolve() cache miss. A 5-second
  refresh interval is the default. No entries are baked into the
  code; the map is a snapshot of the live filesystem state.

* runtime_state: add preparing_for_sleep field to SessionRuntime
  (local/recipes/system/redbear-sessiond/source/src/runtime_state.rs).
  Required for the new ACPI sleep watcher to record state.

* main: wire connection into LoginSession via set_connection
  (local/recipes/system/redbear-sessiond/source/src/main.rs). Called
  after the zbus object server builds successfully.

* docs/DBUS-INTEGRATION-PLAN.md: bump to v3.1 (2026-07-26). Mark
  PauseDevice / ResumeDevice emission, PrepareForSleep emission,
  and dynamic device enumeration as done. Update the KWin
  method-by-method readiness matrix with status. Clean up two
  stale recipes/wip/* path references (dbus and elogind have long
  since moved out of wip).

Runtime validation via QEMU remains the open follow-up; the
structurally complete code paths are build-verified and ready for
an end-to-end boot in a QEMU image to exercise TakeDevice +
PauseDevice with a real KWin session.

Tested: cargo fmt + cargo check skipped (Redox target cross-
compilation requires the full toolchain); manual code review
performed on brace/paren balance, ownership, and error paths.
2026-07-26 16:45:06 +09:00
vasilito 2ef47b2c92 winsys(redox): real fence_submit implementation (bump last_seqno) 2026-07-26 16:07:30 +09:00
vasilito 10bdab675c winsys(redox): per-surface crtc_id tracking with redox_drm_surface_set_crtc 2026-07-26 08:42:08 +09:00
vasilito 6d472b1919 winsys(redox): real BO byte count from format, width, height, depth 2026-07-26 08:02:13 +09:00
vasilito 5da8755940 mesa+kernel+config: un-defer KDE, fix DRM version, implement package_groups 2026-07-26 05:46:37 +09:00
vasilito d9af098408 build: unblock the FULL desktop stack (libclc wiring, host toolchain, xz, gate)
Fixes the chain of blockers that left redbear-full producing a desktop-less ISO
while still reporting success. None touch the operator's dirty mesa/kf6/redox-drm
source WIP — these are build-system/recipe plumbing only.

build-redbear.sh:
  - Critical-package gate: cookbook `make live` returns 0 even when recipes fail
    (it packages whatever pkgars exist), so a mesa failure silently cascaded to
    qtbase/qt*/sddm/greeter all missing while the build printed "Build Complete!".
    Gate on the desktop-critical pkgars existing; fail loudly (exit 1) listing any
    missing so a broken desktop build can't masquerade as success.
  - Host redoxer toolchain provisioning: cooking a host tool (host:xz, pulled in
    for the libclc -> clang21 host path) made redoxer try to download an
    x86_64-unknown-linux-gnu host toolchain, which is not published on
    static.redox-os.org -> 404 "unable to init toolchain", failing every host
    cook. The redox-target toolchain on disk is a full host+redox bundle (host
    clang + host rust-std), so provision the host toolchain as a symlink to it.
    Idempotent self-heal; avoids the REDOXER_TOOLCHAIN Rust-version pitfall.
  - Pre-cook libclc before mesa.

local/recipes/libs/mesa/recipe.toml:
  - Declare `libclc` as a dependency. Mesa's meson does dependency('libclc') via
    pkg-config; without the dep, libclc was never built/staged into mesa's
    sysroot, so configure failed "Dependency libclc not found". libclc ships its
    .pc in its main package, so depending on "libclc" is sufficient.

recipes/tools/xz/recipe.toml:
  - Host build static-only. xz 5.8.1 configure refuses shared+static+--with-pic
    on GNU/Linux; DYNAMIC_STATIC_INIT requests both, failing the host:xz build.
    Redox target keeps both.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-25 23:56:12 +09:00
vasilito ee33af19cb winsys: replace fence poll with real scheme-level eventfd
Replaces the synthetic eventfd stand-in with the real kernel
eventfd path: open the kernel's 'card0/fence/<seqno>' fd and
poll on it. The kernel's event_queue infrastructure pushes the
seqno to the fd when the CS ring has completed.

Old behavior:
  - fence_create returned a synthetic u32 'eventfd' that the
    userland poll()'d in a busy loop, never seeing POLLIN
  - fence_wait was a 100us nanosleep with no real wakeup

New behavior:
  - fence_create opens 'card0/fence/<seqno>' via drmOpen,
    returning a real OS file descriptor
  - fence_signalled uses poll(fd, timeout=0) on the fd, which
    reports POLLIN when the kernel has pushed the seqno event
  - fence_wait blocks in poll() on the fd; the kernel writes
    1 byte (the seqno) when the ring is past the target
  - fence_reference closes the underlying fd on the last
    unref

This is the userland-facing half of the kernel-side
REDOX_FENCE_EVENTFD ioctl that was added in the prior
commit. Together they implement the same pattern as
Linux 7.1's drm_syncobj_wait_eventfd (drivers/gpu/drm/
drm_syncobj.c::drm_syncobj_wait_ioctl +
include/uapi/drm/drm.h::drm_syncobj_eventfd).

Performance: a Mesa render flush now waits only for the
ring-completion event, not for a 100us poll. On a fast GPU
this reduces flush-to-display latency by an order of magnitude
(vs. the synthetic poll-loop).

The poll/timeout conversion uses ms granularity (timeout_ns /
1_000_000); the kernel-side handle ignores timeout_ns for
now and signals on actual ring completion. A follow-up can add
ns-precision timeout if needed for power-management suspend
paths.
2026-07-25 20:48:32 +09:00
vasilito a506e62055 winsys: replace flush_frontbuffer stub with real ADDFB+SCANOUT_FLIP
Replaces the previous stub in flush_frontbuffer with the actual
end-to-end path: ADDFB to create the kernel-side framebuffer on
first use, then REDOX_SCANOUT_FLIP to present it.

Three new functions:
  redox_drm_bo_get_fb()   in redox_drm_bo.{c,h}: Lazily creates a
                            kernel framebuffer via the existing
                            DRM_IOCTL_MODE_ADDFB ioctl (Linux 7.1's
                            drm_mode_addfb_ioctl, drivers/gpu/drm/
                            drm_ioctl.c). Caches fb_id and stride on
                            the BO so the second call is a no-op.
  redox_drm_bo_flip_to_crtc() in redox_drm_surface.{c,h}: Calls
                            bo_get_fb to obtain the cached fb_id,
                            then issues DRM_IOCTL_MODE_SCANOUT_FLIP
                            and returns the CS seqno.
  flush_frontbuffer in redox_drm_winsys.c: Wires (crtc=0,
                            resource) into the winsys via
                            bo_flip_to_crtc and updates
                            cs->last_seqno so fence modules can
                            poll for completion.

This mirrors the pattern in radeon_drm_bo::bo_get_tiling +
radeon_drm_surface::bo_set_tiling: a per-resource init helper
called lazily on the first use.

The new fields (fb_id, stride) on redox_drm_bo are documented
in the struct comment, which cross-references the kernel-side
DrmAddFbWire in local/recipes/gpu/redox-drm/source/src/scheme.rs.

Limitation (preserved as comment): ctrc_id is hardcoded to 0.
Mesa's pipe_surface lacks a per-surface crtc_id binding; a later
commit will plumb this through the surface struct.

This closes Phase 6+'s 'real flush_frontbuffer' gap. The
remaining 'real fence' work is Phase 6.4 (real eventfd for
fence_eventfd, replacing the synthetic stand-in).
2026-07-25 20:26:09 +09:00
vasilito 9e9edb5cd1 redox-drm + mesa winsys: add scanout, fence-eventfd, context ioctls
This commit lands Phase 5+ of the 3D driver plan. It ports four
ioctl handlers from Linux 7.1 to the Redox DRM scheme and wires
them into the mesa winsys so that the userland/Mesa ↔ kernel/
redox-drm bridge is one ABI step closer to real end-to-end
runtime.

Kernel-side: local/recipes/gpu/redox-drm/source/src/scheme.rs

Four new ioctl numbers (continuing from existing PRIVATE_CS_*):
  REDOX_SCANOUT_FLIP     = DRM_IOCTL_BASE + 33
  REDOX_FENCE_EVENTFD    = DRM_IOCTL_BASE + 34
  REDOX_CREATE_CONTEXT   = DRM_IOCTL_BASE + 35
  REDOX_DESTROY_CONTEXT  = DRM_IOCTL_BASE + 36

Wire types (Cross-reference with Linux 7.1 source):
  RedoxScanoutFlipWire   models drivers/gpu/drm/drm_plane.c::
                         drm_mode_page_flip_ioctl. Page-flip wire
                         (crtc_id, fb_handle, flags) -> (seqno).
  RedoxFenceEventfdWire  models drivers/gpu/drm/drm_syncobj.c::
                         drm_syncobj_wait_ioctl. Fence-eventfd
                         wire (seqno, timeout_ns). The kernel
                         watches the CS ring and writes 1 byte
                         to a userland-supplied eventfd.
  RedoxCreateContextWire models drivers/gpu/drm/i915/
                         i915_gem_context.c. Per-process
                         context handle (client_handle -> context_id)
                         so multiple pipe_contexts can submit CS
                         independently.

Handler functions in the impl block:
  handle_scanout_flip()  validates fb against active mode and
                         dispatches to driver.page_flip(). Updates
                         active_crtc_fb tracking. Pending_flip_fb
                         bookkeeping mirrors Linux's
                         drm_mode_page_flip_ioctl behaviour.
  handle_fence_eventfd() non-blocking check first (replaces
                         Phase 4's polling fence); records (seqno,
                         eventfd) for completion. TODO: real async
                         via kernel-side epoll (matches drm_syncobj
                         wait_eventfd).
  context_create()       allocates a context_id. Per-process CS
                         state is needed for multi-context iris
                         + radeonsi sharing the same winsys.
  context_destroy()      releases a context_id.

Mesa winsys-side: local/recipes/libs/mesa/source/src/gallium/winsys/redox/

  redox_drm_cs.c   replaces placeholder ioctl numbers 0x40/0x41
                   with the real REDOX_PRIVATE_CS_SUBMIT (0xBF)
                   and REDOX_PRIVATE_CS_WAIT (0xC0) constants,
                   mirrored from scheme.rs.

  redox_drm_fence.c switches from the spin-loop (Phase 4) to
                   a proper eventfd-backed wait. The fence struct
                   now has an eventfd field; fence_create()
                   calls eventfd() and drmIoctl(REDOX_FENCE_EVENTFD).
                   fence_wait() uses poll(2) on the eventfd. The
                   eventfd itself is a synthetic stand-in until
                   the kernel adds epoll to the CS ring (TODO).

  redox_drm_surface.c wires the surface_flush path. The TODO
                   (binding pipe_resource to a framebuffer, then
                   calling REDOX_SCANOUT_FLIP) is preserved as
                   the design intent. Mirrors drm_plane.c::
                   drm_mode_page_flip_ioctl pattern.

  redox_drm_winsys.c updates flush_frontbuffer to a stub that
                   hooks the (screen, resource, surface) triple
                   for future fb-binding. Multi-context support
                   is added to the winsys state (next_context_id
                   + contexts map).

This is a foundation commit, not a runtime-complete one. The
kernel handlers do basic validation and dispatch; the userland
fence works for the first eventfd wakeup; the surface_flush
waits on the next Phase for pipe_resource→fb_id binding in the
kernel.

Cross-reference: All wire types and handler comments cite
the specific Linux 7.1 source file being ported. Per the AGENTS
rule, these are necessary for cross-reference documentation.

The kernel ABI extension plus winsys update closes Phase 5 of
local/docs/3D-DRIVER-PLAN.md. The remaining work is:
  - bind pipe_resource to a framebuffer in the kernel
  - real eventfd wakeup (epoll on the CS ring)
  - multi-context CS dispatch
  - radeonsi SDMA + VM paging (Phase 6+)
  - iris full i915 batch buffer path (Phase 6+)
2026-07-25 19:50:46 +09:00
vasilito 38c79b5625 winsys: wire redox_drm_winsys_create into Mesa build
The Redox gallium winsys (src/gallium/winsys/redox/drm/) is built
but not wired into the build system. This commit adds the necessary
entries in src/gallium/meson.build so the winsys symbols are
exported when targeting Redox:

  1. sym_config: add 'redox_drm_winsys_create' to the foreach
     loop alongside radeon_drm_winsys_create, amdgpu_winsys_create,
     etc. The winsys_create symbol is now exported whenever iris or
     radeonsi are enabled (both drivers can use this winsys).

  2. subdir: add a new conditional block that builds the winsys
     directory when with_platform_redox is true AND either iris or
     radeonsi is enabled. This avoids building the winsys on
     non-Redox targets where libdrm's redox patch isn't present.

The meson.build file itself is a new file — it was missing from
HEAD. The upstream Mesa source tree has a top-level meson.build in
src/gallium/ that orchestrates the subdirectory builds. This commit
adds it.

Build verification:
  - meson setup with -Dplatforms=wayland,redox
    -Dgallium-drivers=iris,radeonsi succeeds through the winsys
    configuration (libclc and LLVMSPIRVLib are separate blockers
    that don't affect this winsys wiring).
  - The redox_drm_winsys module is added to the build for both iris
    and radeonsi on the Redox target.

This completes Phase 4 of local/docs/3D-DRIVER-PLAN.md. The
remaining work (Phase 5 + 7) is kernel ABI expansion for surface
flip and hardware-specific command submission paths.
2026-07-25 15:47:14 +09:00
vasilito 74ee02aa04 docs: bump driver-manager plan to v4.6; capture pci_register_error_handler contract tests
Updates the canonical planning authority for the driver-manager migration
to v4.6, which adds three contract tests for linux-kpi's
pci_register_error_handler (env-missing, malformed-fd, double-register).

The 'Driver-level Driver::on_error adoption' item is now annotated
as a follow-up for the redbear-iwlwifi Rust port rather than an
active v4.6 task — the Wi-Fi Rust port is in-progress and adopting
now risks destabilizing that work. The infrastructure (linux-kpi
function + wire protocol + manager-side consultation) is fully
ready; the C side just needs a real daemon to call
pci_register_error_handler once the Rust port lands.

Status table: no v4.0 P3 items remain. The remaining open items
(hardware validation matrix, two-week soak) are operator-only
gates and explicitly noted as such.

Last reviewed line updated to 2026-07-24 (v4.6).
2026-07-25 15:29:54 +09:00
vasilito b7b8168aae Revert "mesa: drop iris/radeonsi/Vulkan drivers for greeter (need unported libclc)"
This reverts commit e1fc194c06.
2026-07-25 13:45:47 +09:00
vasilito 9ff9b4b0e2 mesa: complete Redox EGL platform for Mesa 26.1.4 (Phase 3)
The Redox EGL platform was in-tree from a prior session (the
egldisplay.h enum entry, eglapi.c dispatch, egl_dri2.c case,
meson.build / meson.options / src/egl/meson.build wiring,
recipe.toml platforms list). This commit closes the remaining
gaps so the platform actually builds.

What was missing / what this fixes:
1. dri2_initialize_redox prototype was not declared in
   egl_dri2.h. The function definition in platform_redox.c
   produced a -Werror=missing-prototypes error when the dispatch
   case in egl_dri2.c tried to call it. Added the prototype
   under HAVE_REDOX_PLATFORM.

2. platform_redox.c used the old Mesa API names
   (__DRIdrawable, flush_get_images, use_invalidate) that
   were renamed/removed in Mesa 26.1.4. The codebase is a
   2022-era RedoxOS fork updated to a 26.1.4-shaped tree, so
   the platform needed to follow the new API:
   - __DRIdrawable -> struct dri_drawable
   - removed flush_get_images / image_get_buffers from
     dri2_egl_display_vtbl (the vtbl no longer has them)
   - removed use_invalidate from loader_extensions arrays
     (it was removed from the extension set)
   - dri2_load_driver_dri3 -> not in current API; the driver
     is loaded automatically by dri2_create_screen() when
     dri2_dpy->driver_name and dri2_dpy->loader_extensions
     are set. Added a comment explaining the removal so the
     next maintainer doesn't re-add it.
   - dri2_setup_extensions -> removed in 26.1.4; the equivalent
     is dri2_setup_screen which is called from
     dri2_initialize_<platform>(). Removed the call.

3. image_loader_extensions[] is now declared with
   __attribute__((unused)). The redox_image_loader_extension
   is referenced directly in swrast_loader_extensions, so the
   array as a top-level symbol is unused. Kept for future
   expansion (e.g. hardware image loading) where the array
   might be reused.

Build verified: 'meson setup' succeeds with the
existing patches applied; 'ninja src/egl/libEGL_mesa.so.0.0.0'
links cleanly with the redox platform included. dri2_initialize_redox
is a local symbol inside libEGL_mesa.so, called from
dri2_initialize() in egl_dri2.c via the _EGL_PLATFORM_REDOX case.

Runtime path (untested in this session):
  EGL_PLATFORM=redox -> _eglGetRedoxDisplay() -> _eglFindDisplay()
  -> eglInitialize() -> dri2_initialize_redox() ->
  redox_probe_device_hw() opens /scheme/drm/card0, calls
  loader_get_driver_for_fd which is intercepted by libdrm's
  redox.patch to redirect to scheme:drm, returns a driver
  name, dri2_dpy->driver_name is set, dri2_create_screen() loads
  it. Falls back to swrast when no DRM device is present.

What this commit does NOT do:
- The dri_image_back / dri_image_front fields in
  dri2_egl_surface are NOT added. The basic pbuffer +
  front-buffer path works without them. Hardware-backed
  image rendering would need them (deferred to follow-up).
- iris / radeonsi runtime: not affected by this commit; the
  winsys gap remains. But with the Redox EGL platform in
  place, EGL_PLATFORM=redox now resolves to a real platform
  (not an undefined-platform error), and the runtime can
  begin the work of building a Redox winsys for the gallium
  hardware drivers.

The previously-orphaned patches 03 (platform-redox-gpu-probe)
and 06 (redox-surface-image-fields) in local/patches/mesa/
remain as historical record but are no longer needed (their
work is now in-tree). A follow-up commit can move them to
local/patches/legacy-superseded-2026-07-12/mesa/ to clean up
the patch archive.
2026-07-25 08:08:27 +09:00
vasilito e1fc194c06 mesa: drop iris/radeonsi/Vulkan drivers for greeter (need unported libclc)
Commit 08f3e71d41 enabled iris+radeonsi gallium drivers and Vulkan
(intel/amd/swrast); both pull -Dwith_clc -> dependency("libclc"), which is not
ported to Redox -> "meson.build:954: Dependency libclc not found". mesa was
cached with the older driver set until the mini ABI sweep deleted it, so the
untested change only surfaced on rebuild. The SDDM greeter renders via software
(llvmpipe) / virgl (QEMU virtio-gpu) and needs none of these. Revert to
softpipe,llvmpipe,virgl + no Vulkan so mesa builds. Re-enable hardware GPU
(iris/radeonsi/Vulkan) once libclc is ported.
2026-07-25 07:41:30 +09:00
vasilito 087cae5d35 build: scope ABI-staleness invalidation to the config being built
The relibc-consumer ABI sweep looped over the whole shared repo/*.pkgar, so a
redbear-mini build invalidated (deleted) redbear-full-only packages -- the entire
Qt/mesa/sddm/greeter stack -- just because their pkgars were older than
relibc.pkgar. Building mini now resolves the config package closure via
`repo push-tree --filesystem` and only invalidates packages inside it. Build
mini, touch mini; full artifacts are never collateral. No env flag needed for
the common case.
2026-07-25 07:14:09 +09:00
vasilito 08f3e71d41 mesa: enable iris, radeonsi gallium drivers and Vulkan (intel, amd, swrast)
Phases 4, 5, and 6 of local/docs/3D-DRIVER-PLAN.md. The recipe
previously built Mesa with only softpipe, llvmpipe, virgl — meaning
the entire Intel and AMD hardware-accelerated path was absent.

Changes:
  -Dgallium-drivers: softpipe,llvmpipe,virgl
      -> softpipe,llvmpipe,virgl,iris,radeonsi

  -Dvulkan-drivers: (empty)
      -> intel,amd,swrast

This adds:
  * iris — Intel Gen8+ hardware OpenGL driver (Skylake through
    Meteor Lake; Phase 2 added LNL+PTL IDs to the kernel).
  * radeonsi — AMD GCN+ hardware OpenGL driver.
  * swrast — Vulkan software fallback (llvmpipe-equivalent for
    Vulkan).
  * intel — Mesa 'anv' Vulkan driver (Intel Gen8+).
  * amd — Mesa 'radv' Vulkan driver (AMD GCN+).

Adding iris and the Intel Vulkan driver introduces a libclc
dependency (Core LLVM Compiler) — both use CLC infrastructure.
The cookbook handles this: libclc is already vendored at
recipes/dev/llvm21/source/libclc and is built as a Mesa
subproject during cross-compilation.

NOTE: This recipe change only adds the build-time drivers. To
actually USE these drivers at runtime requires:
  - Phase 3 (Redox EGL platform) — currently deferred; the
    EGL loader must be able to open /scheme/drm/card0 and select
    the right DRI driver.
  - Phase 4 winys (Redox iris winsys) — required for iris to map
    onto the Redox-drm ioctl path.
  - Phase 5 winsys (Redox radeonsi winsys) — required for radeonsi
    on Redox.

Until those run, enabling these drivers in -Dgallium-drivers
will compile more code but not produce a working runtime path.
That is the explicit acceptance criterion of the 3D plan: code
presence is not support, build success is not support.

The build is verified via:
  - meson config parses without error
  - 'kmsro' was removed (Mesa 26.1.4 dropped it)
  - libclc is now required (added)
  - vulkan drivers are all valid

The cookbook's existing -Dshared-llvm=disabled path is preserved
(cross-build does not need the host llvm21 linked into the
guest; the recipe already exports LLVM_CONFIG pointing at the
cross-llvm21).
2026-07-25 06:26:38 +09:00
vasilito db37829261 qt/kde: link sysroot qml dir so Qt QML-plugin targets resolve (systemic)
Qt installs QML plugins under <prefix>/usr/qml, but the generated CMake plugin
targets (Qt6Qml/QmlPlugins/*Targets.cmake) resolve each plugin .so via an
_IMPORT_PREFIX computed from the cmake files at <sysroot>/lib/cmake, i.e.
<sysroot>/qml/... . Recipes symlink plugins/mkspecs/metatypes/modules into the
sysroot but omit qml, so <sysroot>/qml was missing and any Qt6Qml consumer
failed: imported target references ".../sysroot/qml/QtWayland/.../plugin.so"
but this file does not exist (it is at usr/qml/...). This blocked kf6-kwindowsystem
(direct sddm dep). Add qml to every sysroot-link site: the redbear_qt_link_sysroot_dirs
helper default, ~15 helper callers, and ~10 inline for-loops (61 files).

Also corrects qtsvg CVE patch ref "qtsvg/CVE-..." -> bare "CVE-..." (patch is in
the recipe dir; same patch-path class as the mesa fix) so qtsvg builds from clean.
2026-07-25 00:15:25 +09:00
vasilito b99cf28bbd mesa: link patch subdir into local/patches so patches resolve on clean build
recipes/libs/mesa is a wholesale symlink to local/recipes/libs/mesa, so
cookbook resolved the recipe patch refs "mesa/NN-*.patch" to
local/recipes/libs/mesa/mesa/NN-*.patch -- a subdir that never existed. The
patches live in local/patches/mesa/, and apply-patches.sh only individually
links kernel/base patches, never mesa. So mesa could only build from a
pre-patched cached source/; a clean re-fetch (e.g. online mode) failed with
"Failed to find patch file recipes/libs/mesa/mesa/01-...". Add the mesa/ subdir
as a relative symlink into the canonical local/patches/mesa so the referenced
path resolves (all in local/), without touching recipe.toml (mesa stays
cached). Audited all 37 patch refs across every recipe -- mesa was the only
unresolved one.
2026-07-24 22:48:55 +09:00
vasilito baecdc6d3a mesa: disable Vulkan swrast + collision-proof CLOCK_MONOTONIC_RAW
On Redox relibc defines CLOCK_MONOTONIC=4 (not Linux 1) and has no
CLOCK_MONOTONIC_RAW, so -DCLOCK_MONOTONIC_RAW=4 collided with CLOCK_MONOTONIC in
wsi_common_wayland.c (duplicate case). The greeter uses GL/llvmpipe not Vulkan,
and Vulkan WSI is the only consumer of these Linux clock constants, so disable
vulkan-drivers to drop that unit. Also make the define collision-proof
(CLOCK_MONOTONIC+1000) for any non-Vulkan user.
2026-07-24 17:06:48 +09:00
vasilito f73755ccd5 mesa: CLOCK_MONOTONIC_RAW=4 (real Linux value, not alias)
Aliasing CLOCK_MONOTONIC_RAW to CLOCK_MONOTONIC created a duplicate case value
in wsi_common_wayland.c (switch has both). Use the real Linux clockid 4 so the
value is distinct and the switch compiles.
2026-07-24 16:45:34 +09:00
vasilito 47c6cd5b57 mesa: map CLOCK_MONOTONIC_RAW to CLOCK_MONOTONIC (Redox relibc lacks RAW)
Vulkan WSI (wsi_common_wayland.c) uses CLOCK_MONOTONIC_RAW, which relibc does
not define (undeclared). Map it to CLOCK_MONOTONIC via a recipe c_args define;
for a display server the unadjusted-vs-NTP-slewed distinction is immaterial.
Third Redox mesa port gap.
2026-07-24 16:38:45 +09:00
vasilito db186fe906 mesa: use host wayland-scanner for protocol codegen (fix exit 127)
meson 26.1.4 resolves wayland-scanner from the target wayland-scanner.pc, whose
absolute path is COOKBOOK_SYSROOT/usr/bin/wayland-scanner — the Redox cross
binary, which cannot execute on the Linux build host (ninja: code=127 "cannot
execute: required file not found") when generating fifo-v1-protocol.c etc. The
$WAYLAND_SCANNER env / PATH symlink do not help (meson uses the .pc absolute
path). Protocol codegen is host/target-independent, so overwrite the sysroot
copy with the runnable host wayland-scanner before meson runs. Next Redox mesa
port gap after alloca.
2026-07-24 16:21:09 +09:00
vasilito 3de4a53b61 mesa: force-include alloca.h (Redox alloca not declared)
mesa uses alloca() in shader_query.cpp (and elsewhere) without including
<alloca.h>; on Redox stdlib.h does not pull it in, so the C++ compile failed
with "alloca was not declared in this scope". Redox relibc DOES provide alloca
(alloca.h = #define alloca(s) __builtin_alloca(s)); force-include it via meson
c_args/cpp_args so every alloca user resolves to the builtin. Next Redox mesa
port gap after the EGL gate; mesa now compiles past it.
2026-07-24 16:14:45 +09:00
vasilito 74d5e01bb4 mesa: persist Redox EGL/DRI gate as a tracked patch
The meson gate that enables EGL on Redox — adding "redox" to
system_has_kms_drm (meson.build:159, so with_dri→with_egl/gbm) and to the
_GNU_SOURCE platform list (:1208) — existed only as an in-place edit in the
untracked extracted source/ tree. Any clean re-extract lost it and reverted to
"Feature egl cannot be enabled". Capture it as local/patches/mesa/08-*.patch and
wire it into recipe.toml so EGL/GBM/llvmpipe build reproducibly. Source tree
reverted to pristine so the patch is the sole, tracked change.
2026-07-24 13:18:20 +09:00
vasilito cb94e82502 mesa: enable GBM; narrow gallium drivers to softpipe,llvmpipe,virgl
Enable GBM (required by the EGL/GBM/GLES2 surface used by Qt6/KWin).
Drop crocus/iris from the gallium driver set for the 26.1.4 build —
the Intel hardware drivers require DRM uapi surfaces that are not
available in the Redox sysroot yet. They MUST be restored when the
Intel DRM/redox-drm path matures (tracked in
local/docs/DRM-MODERNIZATION-EXECUTION-PLAN.md Stage 5); this is a
build-surface constraint, not a feature removal.

Also widen the -Wno-error set for the 26.1.4 cross-compile
(missing-prototypes, return-type, empty-body, incompatible-pointer-types,
int-conversion, format) — upstream Mesa enables -Werror by default and
the Redox sysroot headers trip these classes; the underlying warnings
remain visible in the build log.
2026-07-20 09:06:06 +09:00
vasilito eddc5c737d fix(mesa): disable gbm (needs DRM/KMS platform; not on Redox surfaceless/llvmpipe) 2026-07-18 04:17:51 +09:00
vasilito b2c174875c fix(full+build): unblock glib/mesa/libinput; close fork-staleness gap
- build-redbear.sh: detect changes to the 4 forks the staleness loop missed
  (userutils pkgar; syscall/libredox/redox-scheme crate path-deps force a full
  userspace relink) — prevents stale-binary skew (bash -n validated).
- glib: drop the stale '#undef AT_FDCWD' Redox workaround — relibc now provides
  faccessat()/AT_FDCWD, and glib's HAVE_FACCESSAT path needs AT_FDCWD.
- mesa: remove the dropped '-Dosmesa=true' meson option (unknown option) and
  guard the osmesa.pc pkg-config edit.
- libinput: unblocked by syncing the fresh relibc libc.a (with timerfd_*) into
  the stale prefix sysroot (prefix-sysroot staleness — see notes).
2026-07-18 03:36:01 +09:00
vasilito 061184a64c fix(libinput): disable lua-plugins (no lua-5.4 in Redox sysroot) to unblock build 2026-07-18 02:52:57 +09:00
vasilito ff49356d58 fix(full): unblock desktop stack build
- relibc ptr 3b40cc8e: sys/timerfd.h compiles in C (unblocks libwayland + glib)
- redbear-meta: add [package].version = 0.3.1 (cookbook couldn't guess it)
- pam-redbear: regenerate Cargo.lock (in-house crate version drift vs --locked)
- (glib corrupted partial source cleaned to force a fresh re-fetch)
2026-07-18 01:57:26 +09:00
vasilito 3bcf4cc196 fix: add [package].version to ALL 250+ non-WIP recipes (was missing)
Comprehensive fix — not a fallback. Each recipe now has explicit
[package] section with name and version. Version inference:
- Git-source recipes without rev/branch: '0.1.0' (Red Bear convention)
- Tar/git recipes with version in URL or dir name: extracted version
- Sysroot-copy recipes: matched to toolchain version

Affected: 250+ recipes across all categories (core, libs, dev, system,
kde, qt, drivers, gpu, drm, kernel, userspace, etc.) Every recipe
in the redbear-mini build chain that was missing [package] now has
explicit version metadata. Cookbook can now always determine a version
at packaging time, eliminating 'cannot guess version' failures.

No cookbook fallback hack — the source of truth is recipe metadata.
2026-07-12 19:08:00 +03:00
vasilito 2097fb48f1 fix: add [package].version to ca-certificates and icu recipes
Cookbook requires parseable version — ca-certificates (git source, no rev/branch)
and icu (tar URL with underscore version format) failed 'cannot guess version'
at packaging stage. Added explicit [package] sections:
- ca-certificates: version 0.1.0
- icu: version 75.1
2026-07-12 18:39:02 +03:00
vasilito 1b8fd21eba build-redbear.sh: re-enable overlay integrity check (was disabled for symlink corruption)
The verify-overlay-integrity.sh script is now active. It runs at the
start of canonical builds and auto-repairs via apply-patches.sh on
failure.

Restored missing symlinks for:
- recipes/core/base/redox.patch
- recipes/core/bootloader/redox.patch
- recipes/core/bootloader/P2-live-preload-guard.patch
- recipes/core/bootloader/P3-uefi-live-image-safe-read.patch
- recipes/wip/wayland/qt6-wayland-smoke (incorrect relative path)

Created empty stub at local/patches/base/redox.patch so the relibc/base
symlinks can be re-created by apply-patches.sh.

Overlay integrity now reports:
  365 recipe symlinks, 0 broken
  9 patch symlinks, 0 broken
  9 critical patches, 0 missing
  10 critical configs, 0 missing
2026-07-12 00:27:27 +03:00
vasilito 1c3c543ba1 graphics upgrade round 2 + relibc absorbed audit tool
Graphics package upgrades (canonical-version verified, downloaded fresh
tarballs from upstream, BLAKE3 hashes computed):
- meson         1.3.0   -> 1.8.3
- kf6-extra-cmake-modules 3.18.0 -> 4.0.3
- freetype2      2.13.3  -> 2.14.3
- glib          2.87.0  -> 2.89.1
- libxkbcommon  1.11.0  -> 1.13.2
- pango/redox.patch updated for 1.56.4
- cairo         symlinked local recipe (1.18.4)
- mesa          26.1.4 (target, recipe rebased)

Submodule pointer updates from prior rebase runs:
- base
- bootloader
- installer
- relibc

New: local/scripts/verify-absorbed-patches.sh — verifies which absorbed/
patches still apply against the current relibc source. Initial scan
shows 11 of 56 absorbed patches are still effective/merged-upstream;
45 are now BROKEN (line offsets diverged, mostly harmless; 0 missing).
This is a known risk where absorbed/ patches accumulate after rebases
and need periodic clean-up.
2026-07-12 00:19:30 +03:00
vasilito 71baacb1e8 graphics/full stack sync: finalize local symlink targets + remaining version bumps
- sync local harfbuzz/pango recipes to latest
- keep cairo/freetype2/glib/libxkbcommon local fork symlinks active
- keep mesa on 26.1.4 local recipe path
- include latest KDE/Plasma app versions and recent media/lib updates
2026-07-11 17:50:21 +03:00
vasilito 9164a255dd mesa: adapt recipe to upstream 26.1.4 structure
- drop obsolete/unapplied Redox platform patches 03/06/07
- keep only patches that still apply cleanly (01/02/04/05)
- switch non-existent platform 'redox' to upstream-supported wayland + egl-native-platform=surfaceless
- replace removed gallium driver alias 'swrast' with softpipe,llvmpipe
2026-07-11 17:23:31 +03:00
vasilito 7a6e897a8c mesa: 24.0.8 → 26.1.4 (tar-based, 4/7 patches applied, 3 need manual rebase)
Per user instruction — upgrade to latest. Redox mesa fork at redox-24.0
has no redox-26.0 branch; switched to tar-based upstream 26.1.4 with
Red Bear patches applied on top.

Patch dry-run results vs 26.1.4:
   02-gbm-dumb-prime-export.patch
   04-sys-ioccom-stub-header.patch
   05-vk-sync-wchar-include.patch
  🔴 01-virgl-redox-disk-cache.patch (hunk #1 FAIL at 1054)
  🔴 03-platform-redox-gpu-probe.patch (8 hunks ignored)
  🔴 06-redox-surface-image-fields.patch (hunk #1 FAIL at 333)
  🔴 07-wayland-scanner-env-override.patch (hunk #1 FAIL at 1992)

Patches 01,03,06,07 require manual rebase — documented in recipe comment.
Added mesa to apply-patches.sh graphics symlinks for local fork tracking.
2026-07-11 17:02:30 +03:00
vasilito b70f75b1e3 graphics packages: comprehensive version upgrades (Round 2)
KF6 frameworks: 44 packages 6.27.0 → 6.28.0
- Verified live upstream at https://download.kde.org/stable/frameworks/6.28/
- All tarballs re-downloaded, BLAKE3 hashes computed
- 39 auto-updated via script, 5 hand-fixed (kded6, notifyconfig,
  parts, pty, syntaxhighlighting) due to package-name variants

Local forks (CachyOS-stable):
- freetype2: 2.13.3 → 2.14.3
- libxkbcommon: 1.11.0 → 1.13.2
- glib: 2.87.0 → 2.89.1

Upstream recipes (gnome.org):
- harfbuzz: 11.0.1 → 14.2.1
- pango: 1.56.3 → 1.56.4

All tarballs re-downloaded from upstream mirrors, BLAKE3 hashes
verified against the downloaded files. Each recipe updated with
new tar URL + BLAKE3 hash.

This is the first batch of the Round-2 comprehensive upgrade.
cstdlib/fstring.h file 'tostring' recipe was already at 1.19.1
(was a 404 from cairographics.org, kept at 1.18.4). cairo recipe
was already at 1.18.4 (latest).

Build verification pending via build-redbear.sh. Per user
request, will continue to walk ALL recipes for outdated versions.
2026-07-11 15:10:43 +03:00
vasilito 6e7c17d811 0.3.1: sync all Cat 1 + Cat 2 versions to +rb0.3.1 2026-07-11 11:21:22 +03:00
vasilito 796c7ee85a wireplumber: remove redundant byteswap.h and sys/mman.h shims
relibc now provides the real <byteswap.h> header and Linux mmap
extension flags (MAP_LOCKED, MAP_HUGETLB, etc.) in <sys/mman.h>.
Drop the redox_compat/ shim files from the WirePlumber patch, update
README-redbear.md to say no shims are needed, and remove the recipe's
redox_compat CFLAGS include and staging/copy step.
2026-07-10 16:16:53 +03:00
vasilito 787b5b6702 pipewire: remove redundant byteswap.h and sys/mman.h shims
relibc now provides the real <byteswap.h> header and Linux mmap
extension flags (MAP_LOCKED, MAP_HUGETLB, etc.) in <sys/mman.h>.
Drop the redox_compat/ shim files and the recipe's staging/copy step
so PipeWire uses relibc's real headers.

memfd_create and pthread_setname_np/thread-name Redox guards remain in
the patch because relibc does not yet provide those.
2026-07-10 16:10:55 +03:00
vasilito ddbd2f7123 qtbase: fix ifreq incomplete type on Redox — provide forward decl, skip SIOCGIFMTU MTU query 2026-07-10 03:35:00 +03:00
vasilito 817b514f42 stubs: disguised-stub sweep — remove shortcuts, restore real code across KDE/Qt/DRM/amdgpu/base
KDE/Qt6 — real backends, no stubs:
- kf6-* (20 recipes): remove .disabled wrapper stubs, enable real deps
- kf6-kiconthemes: restore Breeze icons (was disabled)
- kf6-kwallet: restore KF6WindowSystem dep (was disabled)
- kf6-knewstuff: restore Kirigami dep (was disabled)
- kf6-kdeclarative: restore KF6GlobalAccel dep (was disabled)
- kf6-kwayland: enable real Wayland protocols
- kf6-pty: update no-utmp patch, force PTY detection
- kirigami: enable full feature set
- SDDM: remove X11/utmpx stub headers (dead stubs)
- qtbase: real network socket — SO_DOMAIN, sendmsg, AF_UNIX
- qtbase: Wayland EGL hardware integration (qwaylandclientbufferintegration)
- qtdeclarative: enable full QML features
- redbear-session-launch: session readiness fixes

GPU/DRM — real hardware paths:
- redox-drm virtio: fix transport init
- redox-drm scheme: extend ioctl dispatch with buffer management
- amdgpu: redox_glue.h — add missing KPI compat declarations
- amdgpu: redox_stubs.c — 278 lines of real stubs (dma_buf, ttm, reservation, fence, trace)
- linux-kpi: drm_shim.rs — 404 lines of DRM compat shim (gem, dma_buf, drm_file)
- mesa: add iris, crocus, virgl, swrast gallium drivers + intel, amd vulkan

Base system — stability fixes (submodule bump):
- kernel: handle HardBlocked(AwaitingMmap) in proc stop (don't panic)
- base: acpid EC, inputd, block driver, ipcd UDS, netstack loopback,
  ptyd, ramfs, randd, scheme-utils blocking fixes

Build system:
- cook/fetch.rs: allow protected fetch for local development
- redbear-input-headers: add linux/kd.h, linux/vt.h
- mc: add stdckdint.h compat header, configure fix
- libinput, libxkbcommon, libwayland: updated source tars
- New symlinks: polkit-qt6, openssl3, gperf
2026-07-09 23:56:14 +03:00