mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-11 02:51:10 +00:00
Close Zink's emulated GEM handles on KGSL (Xwayland dma-buf leak) The session preload hands out GEM handles on the KGSL render node by duplicating the dma-buf descriptor, and released them only through drmCloseBufferHandle. Zink gives handles back with drmIoctl(DRM_IOCTL_GEM_CLOSE) instead, which KGSL refuses, so every duplicated descriptor stayed open and kept its buffer alive. Xwayland asks for a handle for each buffer it imports through gbm. With "Force game windows fullscreen" fighting a game's own resolution (DiRT 3 at 1280x720), the game recreates its swapchain many times a second and Xwayland piled up ~2,000 old swapchain images (6+ GB) in seconds until Android killed the session. A preload trace on the device put 2,090 of 2,118 open dma-buf descriptors in Xwayland on drmPrimeFDToHandle called from Zink. Handle GEM_CLOSE on the KGSL node in drmIoctl, and check the three DRM symbols are exported in CI. Co-authored-by: The412Banner <the412banner@users.noreply.github.com>