I believe the approach is to not use a GL framebuffer and export its texture, but instead have Mesa render into a gbm surface and get the linear output from there. kmscube might help with that: Once you have the gbm_bo, you can get a handle for it, which I think you should be able to convert into a dmabuf filedescriptor using drmPrimeHandleToFD.
In my tool, the GL surfaces all looks like this in /sys/kernel/debug/dma_buf/bufinfo:
1920*1080*4 (RGBA) = 8294400. So it has the expected size, has a single plane, the modifier is DRM_FORMAT_MOD_LINEAR and format is DRM_FORMAT_ARGB8888.
In my tool, the GL surfaces all looks like this in /sys/kernel/debug/dma_buf/bufinfo:
Code:
08294400 00000000 00080005 00000005 drm 00000878 <none> write fence:drm_sched v3d_render seq 119 unsignalled Attached Devices: 1002000000.v3dStatistics: Posted by dividuum — Thu Jul 03, 2025 9:59 am