Table of Contents

Work items — kwin_overlay_subsurface

Phase 1 — leading research question

Status: LOCKED 2026-05-02. Answer in phase2_source_findings lead section. Outcome: NO on both promotion paths for windowed Brave on rockchip-drm — Phase 4 design space narrows to architect's hypothesis (a), dmabuf-to-GL-texture import-caching.

On what condition does KWin promote a wp_linux_dmabuf_v1 surface to direct scanout versus falling back to GPU composite, and does the hantro NV12 DRM_FORMAT_MOD_LINEAR output satisfy those conditions on this DRM driver (rockchip-drm on RK3568, Mesa 26.0.5)?

This is the question that materially shapes which Phase 2 hypothesis is even reachable, so it leads. It has a yes/no answer that gates everything downstream:

Either answer also informs the bug-report shape: a “your overlay subsurface composite is slow” frame works for the import-caching case; a “your DRM-plane probe is rejecting buffers it should accept” frame works for the scanout-promotion case. Different messages, different audiences (KWin maintainers vs rockchip-drm or Mesa panfrost-drm interaction maintainers).

How to answer it concretely (Phase 2 source-read goal #0, ahead of file-by-file priorities below):

  1. Read KWin's per-frame promotion check — src/scene/composite.cpp and the strategy code under src/scene/. Find the predicate (something like OutputLayer::testFormat(format, modifier, size) or the plane-probe path). Document the conjunct list it uses.
  2. Cross-check rockchip-drm's advertised plane formats via drm_info or modetest -p on ohm. Compare what scanout planes claim to support (probably NV12 LINEAR + a few tiled modifiers) against what hantro emits (NV12 LINEAR with bytesperline=2240 for 1920-wide).
  3. Check whether KWin's promotion check additionally requires the surface to be the only damageable region of a given plane (i.e. needs the parent surface to be transparent in that region), or whether it composes scanout-eligible subsurfaces with non-eligible parent regions. Brave's page renders the parent surface with chrome UI on top, which would block plane-promotion on most architectures.

Output of this question: a yes/no plus a paragraph naming the specific conjunct(s) that pass or fail. Lands in phase2_source_findings as the lead section, before the file-level reading.

Phase 2 — source archaeology (NO PATCHES YET)

Read the KWin source and document findings before designing anything. Quote directly from architect's 2026-05-02 second consultation: “Do not write any patch before that read is documented. This is the discipline ohm_gl_fix lacked early.”

The Phase 1 leading question above tells you which of these two hypothesis-tracks to prioritise:

Files to read (priority order driven by A2 trajectory hint — cold-path EGL/dmabuf re-import suspected, see phase0_findings):