Skip to content

wayland: Additional fixes for PRIME and cursor handling#834

Open
clefebvre wants to merge 4 commits into
masterfrom
prime-cursor
Open

wayland: Additional fixes for PRIME and cursor handling#834
clefebvre wants to merge 4 commits into
masterfrom
prime-cursor

Conversation

@clefebvre

Copy link
Copy Markdown
Member

This is being reviewed - experimental.

Open the DRM render node separately and pass it to gbm_create_device()
instead of reusing the KMS primary fd. This matches how wlroots-based
compositors initialize rendering and avoids hardware-specific issues
(e.g. amdgpu refusing ACCEL_WORKING queries on the primary fd) that
cause Mesa to fall back to software rendering.

Fall back to the primary fd if no render node is available.
…arate fds

When the GBM device fd differs from the KMS fd (render node vs primary
node), GEM handles from GBM are not valid on the KMS fd. Export each
handle as a dmabuf via drmPrimeHandleToFD and re-import it on the KMS
fd before calling drmModeAddFB2. Close the imported handles after the
FB takes its own reference.
With GBM now on the render node, cursor BOs created via the render
node GBM device have GEM handles that are invalid on the KMS fd, causing
drmModeSetCursor to fail on every frame.

Create a second GBM device from the KMS fd specifically for cursor BO
allocation. This keeps cursor GEM handles in the KMS fd's namespace
where the cursor plane expects them.
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.

1 participant