Relevant details of the iMX8QM setup I am running, based on Yocto dunfell branches:
* iMX Kernel 5.4.47
* imx-gpu-viv 6.4.0.p2.4
* GStreamer stack uses branches MM_04.05.05_2005_L5.4.24, based on upstream 1.16.1
Working on an iMX8QM with the Amphion Malone codec, the v4l2 decoder element in a GStreamer pipeline outputs a NV12 dmabuf object with the DRM_FORMAT_MOD_AMPHION_TILED modifier. I would like to understand whether it's possible to use OpenGL ES to correctly sample from such dmabufs.
Currently, the following playbin invocation incorrectly samples from the decoded dmabufs, producing corrupt/incorrect output (for any H264 or VP8 video stream):
$ gst-launch-1.0 playbin uri=file:///home/root/video_512x512.mp4 video-sink=glimagesink`
Shortly, what happens in the pipeline is that the direct-dmabuf uploader is used in glupload, and that creates an EGLImage wrapping that dmabuf. The same uploader also transforms the caps to the RGBA format, even if the underlying dmabuf is NV12. The EGLImage is then bound to a GL texture through which it is sampled in the glimagesink, as if it were an RGBA texture. All problems bundled together lead to incorrect sampling.
I would like to understand whether the GL drivers actually support sampling from EGLImages that wrap these kinds of dmabufs. If there are existing examples of how this functions, I would love to inspect those so that the GStreamer elements (as well as our custom GStreamer sink, which works similarly to glimagesink) can appropriately handle this data in the most efficient way possible.