fix(wayland): export all DMA-BUF planes for wlroots capture#5427
Open
ninele7 wants to merge 1 commit into
Open
fix(wayland): export all DMA-BUF planes for wlroots capture#5427ninele7 wants to merge 1 commit into
ninele7 wants to merge 1 commit into
Conversation
Since LizardByte#5132 the capture buffer is allocated with gbm_bo_create_with_modifiers(), letting the driver pick an explicit modifier from the set advertised by the compositor. That modifier may describe a multi-planar layout - on radeonsi the best match for XRGB8888 is an AMD DCC modifier, where a second plane holds the compression metadata. The buffer was still exported as a single plane, so the compositor received a DCC modifier with its metadata plane missing and rejected the import with EGL_BAD_MATCH, failing every capture. Drivers whose preferred modifier happens to be single-plane were unaffected, which is why this only reproduced on some GPUs. Export every plane reported by gbm_bo_get_plane_count() instead. The consuming side already handles up to four planes, so no changes are needed there. Also fix two issues in the same path: - gbm_bo_create_with_modifiers() takes no usage flags, silently dropping the GBM_BO_USE_RENDERING hint the implicit-modifier path passes. Use the gbm_bo_create_with_modifiers2() variant and pass it explicitly. - Filter DRM_FORMAT_MOD_INVALID out of the modifier list. It requests an implicit-modifier allocation and is not a valid entry in an explicit list.
ninele7
marked this pull request as draft
July 18, 2026 10:10
ninele7
marked this pull request as ready for review
July 18, 2026 10:12
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



In comments to #5132 I pointed out a regression on my setup. On my Proxmox LXC with Headless Sway and 8060s GPU WLR capture just stopped working completely https://gist.github.com/ninele7/15a83db0104c94ddcbb26dbca7fa6340..
I honestly have no understanding of the situation, but given that initial regression was introduced by fully AI driven PR, I decided to try to fix it the same way.
Claude identified the issue based on the logs. And created small test script to check used formats: https://gist.github.com/ninele7/0ea3d852ff6d0d0da6bfe6f70a4cdff5.
Script output:
After that it produced a fix, which I've tested with and without
WLR_RENDERER=vulkan. It works on my hardware in both cases.Working logs: https://gist.github.com/ninele7/e07621f3c6042ff5647fb529095cbc23
Probably would need testing from someone else. Also claude says, that it might fix problem that #5288 tries to fix.
Description
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage
See our AI usage policy.
I don't understand the code, so it contradicts AI usage guidelines. But PR which introduced the regression also doesn't follow that specific guideline.