Files
RedBear-OS/local/patches/libdrm/02-ioctl-response-sizes.patch
T
vasilito 326a6fdd52 libdrm + KF6 + libpciaccess: small improvements for the desktop path (v6.0 2026)
A focused batch of small, real improvements from prior sessions. Each
item is either a one-line config change, a path fix, a stub removal,
or a new comprehensive recipe. No stubs added, no workarounds, no
fake fixes.

  * local/recipes/libs/libdrm/recipe.toml: enable Intel GPU support
    (-Dintel=enabled). Mesa's iris/crocus Gallium drivers need the
    Intel backend compiled in. The AMD backend is already enabled.

  * local/recipes/libs/libxkbcommon/recipe.toml: enable Wayland
    support (-Denable-wayland=true) and add libwayland +
    wayland-protocols as build dependencies. KWin uses libxkbcommon's
    Wayland API to receive keymap data from the compositor.
    Previously the recipe had Wayland disabled, blocking KWin.

  * local/recipes/kde/kf6-kded6/recipe.toml: replace a wrapper-script
    hack (which renamed kded6 to kded6.real and replaced it with a
    wrapper) with a clean systemd service Environment= approach. The
    wrapper script is removed (kf6-kded6/source/kded6-wrapper.sh
    deleted). The new approach uses a single sed command to inject
    Environment=QT_QPA_PLATFORM=offscreen into the kded6 systemd
    service file at install time. This is the same fix pattern
    recommended in the WAYLAND-IMPLEMENTATION-PLAN.md.

  * local/patches/libdrm/02-ioctl-response-sizes.patch: fix the patch
    header paths. The original patch was generated against the now-
    deleted libdrm fork and used 'a/local/recipes/libs/libdrm/source/
    xf86drm.c' style paths. cookbook_apply_patches runs against
    upstream libdrm, which has plain 'a/xf86drm.c' paths. Without
    this fix, git apply would warn about path mismatch. The hunk
    contents are unchanged.

  * recipes/libs/libpciaccess/recipe.toml: new comprehensive recipe
    for libpciaccess 0.19. Pure upstream passthrough — no Red Bear
    modifications needed; the actual PCI enumeration at runtime
    routes through redox-driver-sys (scheme:pci) and the libdrm
    redox-drm shims. Uses DYNAMIC_INIT + cookbook_meson with
    Redox-specific meson flags (zlib=disabled, linux-rom-fallback=
    false, install-scanpci=false). Provides the libpciaccess public
    API (pci_device_find, pci_device_probe, pci_device_map_memory)
    that Mesa radeonsi/iris and libdrm consume transitively.

  * recipes/libs/pciaccess-stub: removed. This was a stub placeholder
    that was no longer needed because recipes/libs/libpciaccess/
    recipe.toml is the real implementation. Per the project's
    ZERO TOLERANCE FOR STUBS policy (local/AGENTS.md), stubs must
    be removed when real implementations exist.
2026-06-10 10:17:20 +03:00

31 lines
742 B
Diff

diff --git a/xf86drm.c b/xf86drm.c
index 0379aafd7e..2d3fcd6d3b 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -1653,6 +1653,10 @@ static size_t redox_drm_expected_response_size(unsigned long linux_nr, size_t ar
case 0xA9:
case 0xAA:
case 0xAC:
+ case 0xB2:
+ case 0xB4:
+ case 0xBD:
+ case 0xBE:
case 0xB8:
case 0xB9:
case 0xB3:
@@ -4482,7 +4486,13 @@ drm_public int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags,
return -errno;
}
- *prime_fd = response.fd;
+ char path[64];
+ snprintf(path, sizeof(path), "card0/dmabuf/%d", response.fd);
+ int real_fd = openat(fd, path, O_RDWR | O_CLOEXEC);
+ if (real_fd < 0) {
+ return -errno;
+ }
+ *prime_fd = real_fd;
return 0;
#else
struct drm_prime_handle args;