]> git.proxmox.com Git - mirror_qemu.git/blame - include/ui/egl-helpers.h
configure: Improve OpenGL dependency detections
[mirror_qemu.git] / include / ui / egl-helpers.h
CommitLineData
7ced9e9f
GH
1#ifndef EGL_HELPERS_H
2#define EGL_HELPERS_H
3
4#include <epoxy/gl.h>
5#include <epoxy/egl.h>
bc6a3565 6#ifdef CONFIG_GBM
1e316598 7#include <gbm.h>
bc6a3565 8#endif
ec150c7e
MA
9#include "ui/console.h"
10#include "ui/shader.h"
7ced9e9f
GH
11
12extern EGLDisplay *qemu_egl_display;
13extern EGLConfig qemu_egl_config;
54d208ff 14extern DisplayGLMode qemu_egl_mode;
7ced9e9f 15
6fafc260
GH
16typedef struct egl_fb {
17 int width;
18 int height;
19 GLuint texture;
20 GLuint framebuffer;
21 bool delete_texture;
22} egl_fb;
23
24void egl_fb_destroy(egl_fb *fb);
25void egl_fb_setup_default(egl_fb *fb, int width, int height);
74083f9c
GH
26void egl_fb_setup_for_tex(egl_fb *fb, int width, int height,
27 GLuint texture, bool delete);
28void egl_fb_setup_new_tex(egl_fb *fb, int width, int height);
6fafc260 29void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip);
d2329237 30void egl_fb_read(DisplaySurface *dst, egl_fb *src);
6fafc260 31
0eb50c27
GH
32void egl_texture_blit(QemuGLShader *gls, egl_fb *dst, egl_fb *src, bool flip);
33void egl_texture_blend(QemuGLShader *gls, egl_fb *dst, egl_fb *src, bool flip,
051a0cde 34 int x, int y, double scale_x, double scale_y);
0eb50c27 35
bc6a3565 36#ifdef CONFIG_GBM
1e316598
GH
37
38extern int qemu_egl_rn_fd;
39extern struct gbm_device *qemu_egl_rn_gbm_dev;
40extern EGLContext qemu_egl_rn_ctx;
41
54d208ff 42int egl_rendernode_init(const char *rendernode, DisplayGLMode mode);
5fc1fb62
GH
43int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc,
44 EGLuint64KHR *modifier);
1e316598 45
86c0522c
GH
46void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf);
47void egl_dmabuf_release_texture(QemuDmaBuf *dmabuf);
48
1e316598
GH
49#endif
50
fbd57c75 51EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, EGLNativeWindowType win);
7ced9e9f 52
bc6a3565
AO
53#if defined(CONFIG_X11) || defined(CONFIG_GBM)
54
54d208ff
GH
55int qemu_egl_init_dpy_x11(EGLNativeDisplayType dpy, DisplayGLMode mode);
56int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy, DisplayGLMode mode);
bc6a3565
AO
57
58#endif
59
7ced9e9f 60EGLContext qemu_egl_init_ctx(void);
0df5c72b 61bool qemu_egl_has_dmabuf(void);
7ced9e9f
GH
62
63#endif /* EGL_HELPERS_H */