Hello,
I'm trying to find a good replacement for vc_dispmanx_snapshot when using vc4-kms-v3d.
When using dispmanx, vc_dispmanx_snapshot + vc_dispmanx_resource_read_data could provide a buffer with readable image data very quickly. I measured the time it was around 10ms.
For KMS, I found a few techniques: I started with drmPrimeHandleToFD + mmap. This seems to provide an (uncomposited) buffer with image data, with a layout described by DRM_FORMAT_XRGB8888 but with the modfier DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED. I tried to transform this in C to a readable image, and I drafted a working version, but that takes around 120ms. I could optimise it but it does seem too far from an acceptable solution for me, unless there is some trick to improve the performance.
I read here in the forum that another suitable solution may be the DRM writeback connector, but that seems to require that requests are done by the DRM master: I'd prefer to do this from another process.
Anyone who can suggest a better alternative to the old vc_dispmanx_snapshot + vc_dispmanx_resource_read_data, usable from a separate process and with similar performance?
Thanks!
I'm trying to find a good replacement for vc_dispmanx_snapshot when using vc4-kms-v3d.
When using dispmanx, vc_dispmanx_snapshot + vc_dispmanx_resource_read_data could provide a buffer with readable image data very quickly. I measured the time it was around 10ms.
For KMS, I found a few techniques: I started with drmPrimeHandleToFD + mmap. This seems to provide an (uncomposited) buffer with image data, with a layout described by DRM_FORMAT_XRGB8888 but with the modfier DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED. I tried to transform this in C to a readable image, and I drafted a working version, but that takes around 120ms. I could optimise it but it does seem too far from an acceptable solution for me, unless there is some trick to improve the performance.
I read here in the forum that another suitable solution may be the DRM writeback connector, but that seems to require that requests are done by the DRM master: I'd prefer to do this from another process.
Anyone who can suggest a better alternative to the old vc_dispmanx_snapshot + vc_dispmanx_resource_read_data, usable from a separate process and with similar performance?
Thanks!
Statistics: Posted by luc4 — Mon Aug 26, 2024 12:31 pm — Replies 0 — Views 34