通过下面的代码 建立了一个OpenGL Context,可以绘图
int fd;
fd = open("/dev/dri/card0", O_RDWR);
struct gbm_device *gbm;
gbm = gbm_create_device(fd);
EGLDisplay dpy;
dpy = eglGetDisplay(gbm);
EGLContext ctx;
eglBindAPI(EGL_OPENGL_API);
ctx = eglCreateContext(dpy, NULL, EGL_NO_CONTEXT, NULL);
eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, ctx);
参考资料中不是headless,依赖于modeset及其connector资源。
后续主要搜集 dma_buf
参考资料:
http://virtuousgeek.org/blog/index.php/jbarnes/2011/10/31/writing_stanalone_programs_with_egl_and_
https://patchwork.kernel.org/patch/8348041/ qemu的补丁,通过dma_buf import texture
https://blogs.igalia.com/elima/tag/gpu/
https://elinux.org/images/a/a8/DMA_Buffer_Sharing-_An_Introduction.pdf
https://github.com/wayland-project/weston/blob/master/clients/simple-dmabuf-egl.c
https://gstreamer.freedesktop.org/data/events/gstreamer-conference/2012/omap-dmabuf-gstcon2012.pdf