2ae16a6aa4
Some of the generated qapi-types-MODULE.h are included all over the place. Changing a QAPI type can trigger massive recompiling. Top scorers recompile more than 1000 out of some 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h): 6300 qapi/qapi-builtin-types.h 5700 qapi/qapi-types-run-state.h 3900 qapi/qapi-types-common.h 3300 qapi/qapi-types-sockets.h 3000 qapi/qapi-types-misc.h 3000 qapi/qapi-types-crypto.h 3000 qapi/qapi-types-job.h 3000 qapi/qapi-types-block-core.h 2800 qapi/qapi-types-block.h 1300 qapi/qapi-types-net.h Clean up headers to include generated QAPI headers only where needed. Impact is negligible except for hw/qdev-properties.h. This header includes qapi/qapi-types-block.h and qapi/qapi-types-misc.h. They are used only in expansions of property definition macros such as DEFINE_PROP_BLOCKDEV_ON_ERROR() and DEFINE_PROP_OFF_AUTO(). Moving their inclusion from hw/qdev-properties.h to the users of these macros avoids pointless recompiles. This is how other property definition macros, such as DEFINE_PROP_NETDEV(), already work. Improves things for some of the top scorers: 3600 qapi/qapi-types-common.h 2800 qapi/qapi-types-sockets.h 900 qapi/qapi-types-misc.h 2200 qapi/qapi-types-crypto.h 2100 qapi/qapi-types-job.h 2100 qapi/qapi-types-block-core.h 270 qapi/qapi-types-block.h Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190812052359.30071-3-armbru@redhat.com>
56 lines
1.7 KiB
C
56 lines
1.7 KiB
C
#ifndef EGL_HELPERS_H
|
|
#define EGL_HELPERS_H
|
|
|
|
#include <epoxy/gl.h>
|
|
#include <epoxy/egl.h>
|
|
#include <gbm.h>
|
|
#include "ui/console.h"
|
|
#include "ui/shader.h"
|
|
|
|
extern EGLDisplay *qemu_egl_display;
|
|
extern EGLConfig qemu_egl_config;
|
|
extern DisplayGLMode qemu_egl_mode;
|
|
|
|
typedef struct egl_fb {
|
|
int width;
|
|
int height;
|
|
GLuint texture;
|
|
GLuint framebuffer;
|
|
bool delete_texture;
|
|
} egl_fb;
|
|
|
|
void egl_fb_destroy(egl_fb *fb);
|
|
void egl_fb_setup_default(egl_fb *fb, int width, int height);
|
|
void egl_fb_setup_for_tex(egl_fb *fb, int width, int height,
|
|
GLuint texture, bool delete);
|
|
void egl_fb_setup_new_tex(egl_fb *fb, int width, int height);
|
|
void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip);
|
|
void egl_fb_read(void *dst, egl_fb *src);
|
|
|
|
void egl_texture_blit(QemuGLShader *gls, egl_fb *dst, egl_fb *src, bool flip);
|
|
void egl_texture_blend(QemuGLShader *gls, egl_fb *dst, egl_fb *src, bool flip,
|
|
int x, int y, double scale_x, double scale_y);
|
|
|
|
#ifdef CONFIG_OPENGL_DMABUF
|
|
|
|
extern int qemu_egl_rn_fd;
|
|
extern struct gbm_device *qemu_egl_rn_gbm_dev;
|
|
extern EGLContext qemu_egl_rn_ctx;
|
|
|
|
int egl_rendernode_init(const char *rendernode, DisplayGLMode mode);
|
|
int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc,
|
|
EGLuint64KHR *modifier);
|
|
|
|
void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf);
|
|
void egl_dmabuf_release_texture(QemuDmaBuf *dmabuf);
|
|
|
|
#endif
|
|
|
|
EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, EGLNativeWindowType win);
|
|
|
|
int qemu_egl_init_dpy_x11(EGLNativeDisplayType dpy, DisplayGLMode mode);
|
|
int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy, DisplayGLMode mode);
|
|
EGLContext qemu_egl_init_ctx(void);
|
|
|
|
#endif /* EGL_HELPERS_H */
|