Repository navigation
Conversation
GPUs without per-process pagetables (a2xx..a5xx) give every context the same global VM. msm_gem_close() still tears down the VMAs of the object in ctx->vm, which is that shared VM, whenever any handle to it is closed. A buffer shared between processes is then unmapped as soon as one of them closes its handle. For example, a window buffer passed from an application to the compositor as a dma-buf. The other process keeps using the stale iova. On Adreno 306 running Android this shows up as a flood of IOMMU faults and corrupted rendering. Skip the teardown on handle close for the shared VM. Do it in msm_gem_vma_put() instead, once vma_ref drops to zero, the same way the KMS VM is handled. The teardown cannot simply be left to msm_gem_free_object(): the VMA holds a reference on the object through its drm_gpuvm_bo, so the object would never be freed. Tested on MSM8916 (Adreno 306) with Android: no IOMMU faults, and the number of GEM objects stays stable. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Vladimir Bely <vlwwwwww@gmail.com>
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.
Adreno 2xx–5xx share one GPU VM between all processes. Closing one GEM handle unmapped buffers that other processes (the compositor) still used, which caused a flood of IOMMU faults and corrupted rendering. The mapping is now torn down after the last user, which also keeps the objects from leaking.
Tested on a Samsung Galaxy A3 (SM-A300F, MSM8916) running LineageOS 24. No IOMMU faults; the number of GEM objects stays around 1000 under use.
Per
CONTRIBUTING.mdthis touches a shared upstream driver, so it is posted here for early review before going to the upstream lists.