drm: img: implement imported dmabuf re-export#40
Merged
Conversation
This allows re-exporting dmabufs that is exported to PVRSRV, which is needed by Zink renderonly. The logic here is like drm_gem_prime_handle_to_fd(). Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnable re-exporting imported dmabuf-backed PMRs by special-casing PMR_TYPE_DMABUF in PhysmemExportDmaBuf, reusing the existing dma_buf instead of creating a new export, while preserving refcounting and cleanup semantics based on whether the dma_buf is external or internally exported. Sequence diagram for re-exporting imported dmabuf-backed PMRsequenceDiagram
participant Caller
participant PhysmemExportDmaBuf
participant PMR
participant PMRWrapper
participant dma_buf
Caller->>PhysmemExportDmaBuf: request export for psPMR
PhysmemExportDmaBuf->>PMR: PMR_IsExportable(psPMR)
PMR-->>PhysmemExportDmaBuf: status
PhysmemExportDmaBuf->>PMRWrapper: PhysmemGetOrCreatePMRWrapper(psPMR)
PMRWrapper-->>PhysmemExportDmaBuf: psPMRWrapper
PhysmemExportDmaBuf->>PMR: PMR_GetType(psPMR)
PMR-->>PhysmemExportDmaBuf: PMR_TYPE_DMABUF
PhysmemExportDmaBuf->>PMR: PhysmemGetDmaBuf(psPMR)
PMR-->>PhysmemExportDmaBuf: psDmaBuf
PhysmemExportDmaBuf->>dma_buf: get_dma_buf(psDmaBuf)
Note over PhysmemExportDmaBuf,dma_buf: Reuse existing dma_buf and bump refcount
PhysmemExportDmaBuf->>Caller: return file descriptor for reused dma_buf
alt later failure while exporting fd
PhysmemExportDmaBuf->>dma_buf: dma_buf_put(psDmaBuf)
Note over PhysmemExportDmaBuf,PMR: PMRUnrefPMR is skipped because bIsExternalDmaBuf is true
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
This allows re-exporting dmabufs that is exported to PVRSRV, which is needed by Zink renderonly.
The logic here is like drm_gem_prime_handle_to_fd().
Summary by Sourcery
Allow re-exporting dma-bufs that originate from imported dma-buf PMRs in the IMG Rogue DRM driver.
New Features:
Enhancements: