close
Skip to content

Cog wpebackend fdo fixes - #143

Open
mirko wants to merge 2 commits into
openwrt:masterfrom
mirko:cog-wpebackend-fdo-fixes
Open

Cog wpebackend fdo fixes#143
mirko wants to merge 2 commits into
openwrt:masterfrom
mirko:cog-wpebackend-fdo-fixes

Conversation

@mirko

@mirko mirko commented Jul 18, 2026

Copy link
Copy Markdown
Member

No description provided.

@mirko
mirko requested a review from dangowrt July 18, 2026 21:53
@openwrt openwrt Bot added the not following guidelines Pull request does not follow formatting guidelines label Jul 18, 2026
@mirko
mirko force-pushed the cog-wpebackend-fdo-fixes branch from bfae2d6 to 207eff1 Compare July 18, 2026 21:54
mirko added 2 commits July 18, 2026 21:58
Six upstream-ready patches against 0.18.5 (developed and verified on a
Dell Wyse 5010: radeon PALM/DCE4.1, both llvmpipe/SHM and r600/dmabuf
paths):

- 001: cold-start initialization. CRTC selection required an existing
  encoder binding (none exists without a prior fbcon/firmware modeset),
  kms_screen_create crashed on modeless connectors, init_cursor used
  the possibly-dead screens[0]. The incomplete display setup from the
  old CRTC selection is also what left DCE4.1's cursor fetch
  uninitialized - initially misdiagnosed as a hardware/kernel bug.
- 002: SHM exported-buffer handling. Root cause of a crash family: the
  renderer stored itself in the buffer resource's user_data, which for
  SHM buffers IS libwayland's wl_shm_buffer - from the second attach
  on, wl_shm_buffer_get() returned the renderer as buffer metadata.
  Plus early buffer release (avoids deferred pool-resize stale
  mappings) and copy hardening.
- 003: legacy hardware cursor (drmModeSetCursor) for non-atomic drivers
  without a universal cursor plane, with correct 64x64 tightly-packed
  premultiplied cursor image.
- 004: software cursor option (COG_PLATFORM_DRM_CURSOR=sw), composited
  into SHM frames with in-place motion updates; dmabuf-safe.
- 005: cursor.x/y are unsigned, so the existing 'if (cursor.x < 0)'
  lower clamp was dead code; moving past the top/left edge wrapped the
  position around and the upper clamp teleported the cursor to the
  opposite edge. Clamp in floating point before the unsigned store.
  Present upstream (master) as well.
- 006: scale the 16x16 cursor artwork by the view's device scale factor
  (nearest neighbour; up to 4x within the 64x64 hardware cursor buffer,
  same factor for the modeset renderer's software cursor), so the
  pointer keeps its apparent size next to a --device-scale'd UI.

Makefile: pin the complete meson option set of 0.18.5 (platforms
drm/headless/wayland, wpe_api 2.0, libmanette, plugin path).
PKG_RELEASE 9.

Patchset already proposed upstream:
Igalia/cog#794

Assisted-By: Claude Fable + Opus

Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
Surface::shmBuffer/dmabufBuffer were set at attach and never cleared;
a commit without a fresh attach (frame-callback pacing) re-exported
the previous - potentially dangling - buffer pointer, handing the
embedder garbage buffer metadata. Consume the attached state at commit
and export nothing without a buffer, in both ImplSHM and ImplEGL
(upstream-ready patch with the full story). PKG_RELEASE 5.

Patchset already proposed upstream:
Igalia/WPEBackend-fdo#206

Assisted-By: Claude Opus + Fable

Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
@mirko
mirko force-pushed the cog-wpebackend-fdo-fixes branch from 207eff1 to 7843302 Compare July 18, 2026 22:07
@openwrt openwrt Bot removed the not following guidelines Pull request does not follow formatting guidelines label Jul 18, 2026
@BKPepe

BKPepe commented Jul 22, 2026

Copy link
Copy Markdown
Member

CI/CD is failing:

  make package/wpebackend-fdo/download
  make package/wpebackend-fdo/check
  make package/wpebackend-fdo/refresh
Dirty patches detected, please refresh and review the diff
Error: Process completed with exit code 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants