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