freedreno/kgsl: try dma-buf export before shadowing#91
Draft
lfdevs wants to merge 1 commit into
Draft
Conversation
Imported KGSL BOs can already carry a valid dma-buf fd even when the pipe resource was not created with PIPE_BIND_SHARED. Shadowing such resources before attempting export unnecessarily replaces their backing storage and can leave cached texture state referring to the old resource sequence number. Keep the LINEAR modifier requirement, but try the normal export path first. Native KGSL BOs that cannot be exported still fall back to a shared linear shadow resource. This avoids Xwayland aborts when presenting imported Vulkan DRI3 buffers.
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.
Note
This PR will not be merged, because although it resolves the issue of running "Weston (Anland) + XWayland + Vulkan" under Termux native and has almost no impact on the performance of KWin (Anland) under Termux native, it will cause the performance of KWin (Anland) accelerated by Freedreno & Turnip drivers inside PRoot/Chroot containers to drop significantly on certain GPU models (such as Adreno 730).
If you need to resolve the issue of running "Weston (Anland) + XWayland + Vulkan" under Termux native, you can find the corresponding build artifacts here: https://github.com/lfdevs/termux-packages/actions/runs/29795986556?pr=17#artifacts
Currently, using Anland: Termux and drivers built by this project in Termux native, and under a Weston session, running applications with the XWayland + Vulkan combination will crash. The key logs are as follows. This PR aims to resolve this issue.
The Weston Termux package with the added Anland 5.13 backend comes from: lfdevs/termux-packages#14
Imported KGSL BOs can already carry a valid dma-buf fd even when the pipe resource was not created with PIPE_BIND_SHARED. Shadowing such resources before attempting export unnecessarily replaces their backing storage and can leave cached texture state referring to the old resource sequence number.
Keep the LINEAR modifier requirement, but try the normal export path first. Native KGSL BOs that cannot be exported still fall back to a shared linear shadow resource. This avoids Xwayland aborts when presenting imported Vulkan DRI3 buffers.