1 #ifndef EGL_HELPERS_H 2 #define EGL_HELPERS_H 3 4 #include <epoxy/gl.h> 5 #include <epoxy/egl.h> 6 #include <gbm.h> 7 8 extern EGLDisplay *qemu_egl_display; 9 extern EGLConfig qemu_egl_config; 10 11 typedef struct egl_fb { 12 int width; 13 int height; 14 GLuint texture; 15 GLuint framebuffer; 16 bool delete_texture; 17 } egl_fb; 18 19 void egl_fb_destroy(egl_fb *fb); 20 void egl_fb_setup_default(egl_fb *fb, int width, int height); 21 void egl_fb_create_for_tex(egl_fb *fb, int width, int height, GLuint texture); 22 void egl_fb_create_new_tex(egl_fb *fb, int width, int height); 23 void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip); 24 void egl_fb_read(void *dst, egl_fb *src); 25 26 #ifdef CONFIG_OPENGL_DMABUF 27 28 extern int qemu_egl_rn_fd; 29 extern struct gbm_device *qemu_egl_rn_gbm_dev; 30 extern EGLContext qemu_egl_rn_ctx; 31 32 int egl_rendernode_init(const char *rendernode); 33 int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc); 34 35 #endif 36 37 EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, Window win); 38 39 int qemu_egl_init_dpy_x11(EGLNativeDisplayType dpy); 40 int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy); 41 EGLContext qemu_egl_init_ctx(void); 42 43 #endif /* EGL_HELPERS_H */ 44