-
Notifications
You must be signed in to change notification settings - Fork 5.2k
VCSM Improvements - dmabuf support #1806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Importing of dmabufs done. https://github.com/6by9/yavta is a simplish demo app that is plumbing V4L2 (driver MUST use the videobuf2-dma-contig allocator) into MMAL. |
Are there any plans for dma-buf export? Or alternatively, I'd be happy to hear any suggestions for alternative ways to manage my use case: Sharing a GLES FBO cross-process. I'm currently using EGL_IMAGE_BRCM_VCSM to create an FBO, render to it, then map on the CPU. I'd like to share that FBO to another process. I don't think the GLES driver supports EGL_EXT_image_dma_buf_import (correct me if I'm wrong), and EGL_IMAGE_BRCM_VCSM seems to only support creating VCSM buffers, not importing them (so I can't import a dma-buf to VCSM then give that to GLES). Can VCSM handles be shared directly cross-process? I had a try, but it doesn't look like handles can be used in a different process. |
One of the many things in progress is a rewrite of vcsm that uses CMA instead of gpu_mem. All handles then become dmabuf fds, so can be shared around in the normal manner. It's using the same hooks to import into vcsm at the moment. The GLES driver isn't being developed further. I believe you are correct that it doesn't support EGL_EXT_image_dma_buf_import. Current VCSM handles are linked to the allocating PID. |
Thanks for the super speedy reply, and thanks for the pointer to the driver code. I did call The VCSM rewrite sounds good, though I guess I should probably try and switch my stack to V4L2 + VC4/Mesa before too long, as that seems to be the right "future" direction. |
I suspect that a vcsm_malloc_share handle can just be used with the normal vcsm calls for mapping, locking, unlocking, etc, but don't know for definite. Switching to vc4/mesa would be sensible if you can. |
I figured out Process 1:
Process 2:
My use case is camera -> GPU -> other process. Your Update: gist for VCSM sharing incase anyone stumbles across this and wants to do the same: https://gist.github.com/usedbytes/0bf272864bfbc8b561c10e48d590116f |
(This is more a placeholder for a job that needs doing than a bug)
VCSM ideally wants to be able to support importing and exporting dmabufs to make multimedia work sensibly with the upstream GL/DRM/KMS stuff.
For import:
On exporting:
The text was updated successfully, but these errors were encountered: