Skip to content

vulkan/wsi/wayland: track outputs on a private connection - #16

Merged
henrikklee merged 2 commits into
OrchardLinux:mainfrom
brkosebay:pr/wsi-wayland-private-outputs
Nov 18, 2026
Merged

henrikklee merged 2 commits into
OrchardLinux:mainfrom
brkosebay:pr/wsi-wayland-private-outputs

Conversation

@brkosebay

Copy link
Copy Markdown
Contributor

GNOME Web (epiphany 49, WebKitGTK 6.0) aborts on start on the Orchard desktop when GTK renders with GL on Zink over the PowerVR driver. The cause is the Wayland WSI, not WebKit.

The bug

The pre-rotated swapchain code bound wl_output on the application's own Wayland connection to learn the surface's transform. The compositor sends wl_surface.enter / leave for every wl_output resource a client owns. So the application's surfaces received enter events for an output it never bound, or a NULL output after the WSI released it. GTK turns that into GdkSurface::enter-monitor with a NULL GdkMonitor, and WebKitGTK aborts on it.

The fix

One commit, src/vulkan/wsi/wsi_common_wayland.c only:

  • The outputs are tracked on a separate connection to the same compositor: the peer address of the application's socket, one connection per endpoint for the life of the WSI.
  • That connection is dispatched without blocking when the surface capabilities are queried.
  • The transform is reported only when there is exactly one output. Without a named socket, or if the connection fails, the current transform is identity, as before the pre-rotation code.
  • Nothing is bound on the application's connection any more.

Devices

Common Vulkan WSI code: it applies to every driver that uses the Wayland WSI, so the A9 and the A10 alike. A10: enabled, untested on our side.

How to test

On an Orchard install, in the desktop session:

GSK_DEBUG=renderer epiphany --new-window about:blank   # GTK picks GskGLRenderer
WAYLAND_DEBUG=client vkcube --wsi wayland --c 60 2>&1 | grep -c 'bind(.*wl_output'

WAYLAND_DEBUG logs every connection in the process. On the iPad 5, the second command prints 8 before this commit (binds on the app's connection) and 1 after: the single bind on the WSI's own connection, whose registry is a second wl_display#1.

  • Before: epiphany aborts within a second (SIGABRT in libwebkitgtk-6.0, NULL GdkMonitor).
  • After: the epiphany window comes up and stays up. Rotate the screen while vkcube runs: the swapchain follows the new transform.

Hardware

iPad 5 (A9, J71t), current Orchard main kernel plus open PRs, Mesa = Orchard main + this commit:

  • epiphany comes up with GskGLRenderer and stays up for the full 30 s and 60 s runs. The header bar and window render on screen, and there is no NULL-monitor abort.
  • Not fixed here: WebKit's web process still crashes on this GPU. It needs 4x MSAA paths the driver does not have yet, which is separate work. The browser UI survives it.

Offline: a Wayland test compositor counts wl_surface.enter events per output owner.

  • Current main: own=1 foreign=1. The app's surface entered the WSI's output.
  • This commit: own=1 foreign=0 at transform 0, at 270, and across a runtime 0 → 270 rotation. The rotation also gives currentTransform=ROTATE_90 on requery.

🤖 Generated with Claude Code

brkosebay and others added 2 commits November 18, 2026 20:16
Binding wl_output on the application's connection is visible to the
application: the compositor sends wl_surface.enter and leave for every
wl_output resource the client owns, so the application's surfaces
receive enter events that name an output it never bound (or NULL once
the WSI released it). GTK turns that into GdkSurface::enter-monitor with
a NULL monitor, and WebKitGTK aborts on it.

Track the outputs, for the surface's current transform, on a separate
connection to the compositor the application is connected to (the peer
address of its socket), one per endpoint for the life of the WSI, and
dispatch it without blocking when the capabilities are queried. Without
a named socket, or when the connection fails, the current transform is
identity.

Assisted-by: LLM
@henrikklee
henrikklee merged commit 2da8cce into OrchardLinux:main Nov 18, 2026
1 check passed
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