Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4140

OpenGLES • Re: Pi4 export EGL image DMA-buf and import as libdrm framebuffer

$
0
0
Bit of an update. I sort of got it working. I was able to successfully use the eglimage dmabuf fd with drmPrimeFDToHandle. And then create a framebuffer by passing the handle to drmModeAddFB2WithModifiers

But the snag is the modifiers don't match so the image is garbled. eglImage dma export on the Pi4 only supports the tiled modifier: DRM_FORMAT_MOD_BROADCOM_UIF (obtained by calling eglQueryDmaBufModifiersEXT). And drm planes only seem to support the tiled modifier: DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED.

It seems strange that these two sides don't support the same tiled scheme - maybe I'm missing something? I did try just going with linear (DRM_FORMAT_MOD_LINEAR), but that causes other problems - in our application the eglImage is written to in a GLSL compute shader using Image load/store API - and it seems that compute shaders do not honour DRM_FORMAT_MOD_LINEAR targets, it ignored it and wrote to the image tiled.

Statistics: Posted by PeartreeStudios — Tue Apr 09, 2024 10:19 am



Viewing all articles
Browse latest Browse all 4140

Trending Articles