wayland: Fix GPU acceleration (zwp_linux_dmabuf_v1 feedback (v4))#833
Closed
mtwebster wants to merge 4 commits into
Closed
wayland: Fix GPU acceleration (zwp_linux_dmabuf_v1 feedback (v4))#833mtwebster wants to merge 4 commits into
mtwebster wants to merge 4 commits into
Conversation
On multi-GPU SoCs like RK3588 (Rockchip), the mainline kernel exposes
two DRM devices: card0 (rockchip-drm, display-only, no 3D) and card1
(panthor, Mali-G610 GPU with full 3D). Muffin's choose_primary_gpu_unchecked()
selects the first platform device with render capability, which picks
card0 — a display controller with no OpenGL/Vulkan support.
This causes EGL clients to fall back to llvmpipe (software rendering),
as the compositor advertises the wrong device via wl_drm.
GNOME's Mutter solved this by introducing a udev tag mechanism
(mutter-device-preferred-primary) that lets system integrators
explicitly mark which GPU should be used as primary. This commit ports
that mechanism to Muffin using the tag "muffin-device-preferred-primary".
Changes:
- meta-udev.c/h: Add meta_is_udev_device_preferred_primary() that
checks for the "muffin-device-preferred-primary" udev tag
- meta-kms-types.h: Add META_KMS_DEVICE_FLAG_PREFERRED_PRIMARY flag
- meta-backend-native.c: Propagate the flag during GPU initialization
- meta-gpu-kms.c/h: Add meta_gpu_kms_is_preferred_primary() accessor
- meta-renderer-native.c: Check preferred_primary before platform_device
and boot_vga in choose_primary_gpu_unchecked()
Example udev rule for RK3588 boards:
SUBSYSTEM=="drm", KERNEL=="card1", DRIVERS=="panthor", \
TAG+="muffin-device-preferred-primary"
Tested on Rock 5B+ (RK3588) running BredOS with kernel 7.0-rc1 and
6.19.1, Cinnamon Wayland session. Verified that Muffin correctly
selects panthor (renderD128) as primary GPU with this patch applied.
Note: This fixes the compositor-side GPU selection (Part A). Full
client-side GPU discovery requires upgrading zwp_linux_dmabuf_v1
from v3 to v4+ with device feedback (Part B, separate work).
Ref: Mutter meta-udev.c meta_is_udev_device_preferred_primary()
Decouple modifier advertisement from KMS scanout usage so clients get importable modifiers; NVIDIA's EGL rejects imports made with DRM_FORMAT_MOD_INVALID, crashing accelerated XWayland clients.
Backported somewhat from mutter. Temporarily includes #811.
Member
|
Merged in master. |
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.
wayland/dma-buf: Implement zwp_linux_dmabuf_v1 feedback (v4)
Temporarily includes #811 and a couple of other small fixes.