Skip to content

Some fixes for using Freedreno & Turnip normally under Wayland#76

Open
lfdevs wants to merge 3 commits into
dev/adreno-mainfrom
test/fix-wayland
Open

Some fixes for using Freedreno & Turnip normally under Wayland#76
lfdevs wants to merge 3 commits into
dev/adreno-mainfrom
test/fix-wayland

Conversation

@lfdevs

@lfdevs lfdevs commented Jun 16, 2026

Copy link
Copy Markdown
Owner

In recent days, @superturtlee implemented a new complete solution, anland, for running Wayland desktops (especially KDE Plasma Wayland) with hardware acceleration in Linux containers hosted on Android. This project currently uses an Ubuntu 24.04 Droidspaces container and has been successfully run on devices with GPU such as Adreno 750, 830, and 840.

The patch in this PR comes from superturtlee's repository: superturtlee/anland@4df7180 Many thanks to him.

This patch comes from superturtlee@ca95478.

Implement and export vk_icdGetDeviceProcAddr as the required ICD entrypoint
for the Vulkan loader to query device-level function pointers.
This patch comes from
superturtlee@4aeb52f.

Introduce MESA_VK_DEVICE_SELECT_FORCE_DEFAULT_DEVICE_DRI3 environment variable.

On the kgsl-backed turnip stack, the GBM/DRI3 fd points at the display
device (msm_drm) while the GPU is exposed through kgsl. Because of this,
the render-node DRM major/minor never matches turnip's pdev, causing device
selection to fail and fall back to llvmpipe.

When this option is set, skip the DRM-based matching for the DRI3 path and
let zink take the default (first) physical device.
This patch comes from superturtlee/anland@4df7180,
and introduces compatibility layer support for the KGSL-backed
freedreno driver, ensuring that native GL rendering works correctly in
Android container environments:

- egl/wayland: If the compositor does not advertise wl_drm or v4 dma-buf
  feedback, fall back to opening the /dev/kgsl-3d0 node directly to avoid
  initialization failure.
- freedreno/drm: Split fd tracking into `fd` (GPU submission fd) and
  `control_fd` (identity/screen-cache fd). Under KGSL, the display node fd
  passed in from EGL/GBM is used as the `control_fd` to keep the fd-keyed
  screen cache and DRI3 identity intact, while GPU commands are redirected
  to `/dev/kgsl-3d0`. Support forcing this behavior via FD_FORCE_KGSL=1.
- freedreno/drm: Quietly return -1 for FD_UCHE_TRAP_BASE on KGSL since
  it is not supported, avoiding noisy "invalid param id" errors.
- freedreno/gallium: Force-enable prime import/export capabilities on the
  pipe screen. The display controller node does not report the GPU's PRIME
  support, which otherwise prevents EGL from exposing dmabuf import extensions.
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