diff --git a/gfx/common/egl_common.c b/gfx/common/egl_common.c index dd0341de43..a2814c9a35 100644 --- a/gfx/common/egl_common.c +++ b/gfx/common/egl_common.c @@ -21,6 +21,8 @@ #include "gl_common.h" #endif +volatile sig_atomic_t g_egl_quit; + EGLContext g_egl_ctx; EGLContext g_egl_hw_ctx; EGLSurface g_egl_surf; diff --git a/gfx/common/egl_common.h b/gfx/common/egl_common.h index e15d6f5f40..55fa35d60e 100644 --- a/gfx/common/egl_common.h +++ b/gfx/common/egl_common.h @@ -16,6 +16,8 @@ #ifndef __EGL_COMMON_H #define __EGL_COMMON_H +#include + #include #include @@ -23,6 +25,8 @@ #include "../video_context_driver.h" +volatile sig_atomic_t g_egl_quit; + extern EGLContext g_egl_ctx; extern EGLContext g_egl_hw_ctx; extern EGLSurface g_egl_surf; diff --git a/gfx/drivers_context/drm_egl_ctx.c b/gfx/drivers_context/drm_egl_ctx.c index 2f8efc8472..7857da1f90 100644 --- a/gfx/drivers_context/drm_egl_ctx.c +++ b/gfx/drivers_context/drm_egl_ctx.c @@ -73,8 +73,6 @@ typedef struct gfx_ctx_drm_egl_data struct gbm_surface *g_gbm_surface; } gfx_ctx_drm_egl_data_t; -static volatile sig_atomic_t g_quit; - static enum gfx_ctx_api g_api; static unsigned g_major; @@ -134,7 +132,7 @@ static struct drm_fb *drm_fb_get_from_bo( static void sighandler(int sig) { (void)sig; - g_quit = 1; + g_egl_quit = 1; } static void gfx_ctx_drm_egl_swap_interval(void *data, unsigned interval) @@ -153,7 +151,7 @@ static void gfx_ctx_drm_egl_check_window(void *data, bool *quit, (void)height; *resize = false; - *quit = g_quit; + *quit = g_egl_quit; } static unsigned first_page_flip; @@ -377,8 +375,8 @@ static void gfx_ctx_drm_egl_destroy_resources(gfx_ctx_drm_egl_data_t *drm) free_drm_resources(drm); - drm->g_drm_mode = NULL; - g_quit = 0; + drm->g_drm_mode = NULL; + g_egl_quit = 0; drm->g_crtc_id = 0; drm->g_connector_id = 0; diff --git a/gfx/drivers_context/mali_fbdev_ctx.c b/gfx/drivers_context/mali_fbdev_ctx.c index 140d15bb6d..0fb8849b1d 100644 --- a/gfx/drivers_context/mali_fbdev_ctx.c +++ b/gfx/drivers_context/mali_fbdev_ctx.c @@ -35,12 +35,10 @@ struct fbdev_window native_window; static bool g_resize; static unsigned g_width, g_height; -static volatile sig_atomic_t g_quit; - static void gfx_ctx_mali_fbdev_sighandler(int sig) { (void)sig; - g_quit = 1; + g_egl_quit = 1; } static void gfx_ctx_mali_fbdev_destroy(void *data) @@ -50,7 +48,7 @@ static void gfx_ctx_mali_fbdev_destroy(void *data) egl_destroy(data); - g_quit = 0; + g_egl_quit = 0; g_resize = false; /* Clear framebuffer and set cursor on again */ @@ -147,7 +145,7 @@ static void gfx_ctx_mali_fbdev_check_window(void *data, bool *quit, *resize = true; } - *quit = g_quit; + *quit = g_egl_quit; } static void gfx_ctx_mali_fbdev_set_resize(void *data, diff --git a/gfx/drivers_context/vc_egl_ctx.c b/gfx/drivers_context/vc_egl_ctx.c index 9597aa246c..82fb0f5dd3 100644 --- a/gfx/drivers_context/vc_egl_ctx.c +++ b/gfx/drivers_context/vc_egl_ctx.c @@ -67,7 +67,7 @@ static INLINE bool gfx_ctx_vc_egl_query_extension(const char *ext) static void sighandler(int sig) { (void)sig; - g_quit = 1; + g_egl_quit = 1; } static void gfx_ctx_vc_check_window(void *data, bool *quit, @@ -79,7 +79,7 @@ static void gfx_ctx_vc_check_window(void *data, bool *quit, (void)height; *resize = false; - *quit = g_quit; + *quit = g_egl_quit; } static void gfx_ctx_vc_set_resize(void *data, unsigned width, unsigned height) diff --git a/gfx/drivers_context/vivante_fbdev_ctx.c b/gfx/drivers_context/vivante_fbdev_ctx.c index 6ead5ac49e..a0bba72046 100644 --- a/gfx/drivers_context/vivante_fbdev_ctx.c +++ b/gfx/drivers_context/vivante_fbdev_ctx.c @@ -26,18 +26,17 @@ static bool g_resize; static unsigned g_width, g_height; -static volatile sig_atomic_t g_quit; static void sighandler(int sig) { (void)sig; - g_quit = 1; + g_egl_quit = 1; } static void gfx_ctx_vivante_destroy(void *data) { egl_destroy(data); - g_quit = 0; + g_egl_quit = 0; g_resize = false; } @@ -113,7 +112,7 @@ static void gfx_ctx_vivante_check_window(void *data, bool *quit, *resize = true; } - *quit = g_quit; + *quit = g_egl_quit; } static void gfx_ctx_vivante_set_resize(void *data, diff --git a/gfx/drivers_context/wayland_ctx.c b/gfx/drivers_context/wayland_ctx.c index 599d33860f..3789fb9ddd 100644 --- a/gfx/drivers_context/wayland_ctx.c +++ b/gfx/drivers_context/wayland_ctx.c @@ -50,7 +50,6 @@ static enum gfx_ctx_api g_api; static unsigned g_major; static unsigned g_minor; -static volatile sig_atomic_t g_quit; #ifndef EGL_OPENGL_ES3_BIT_KHR #define EGL_OPENGL_ES3_BIT_KHR 0x0040 @@ -59,7 +58,7 @@ static volatile sig_atomic_t g_quit; static void sighandler(int sig) { (void)sig; - g_quit = 1; + g_egl_quit = 1; } /* Shell surface callbacks. */ @@ -194,7 +193,7 @@ static void flush_wayland_fd(void) if (fd.revents & (POLLERR | POLLHUP)) { close(wl->g_fd); - g_quit = true; + g_egl_quit = true; } if (fd.revents & POLLIN) @@ -226,7 +225,7 @@ static void gfx_ctx_wl_check_window(void *data, bool *quit, *height = new_height; } - *quit = g_quit; + *quit = g_egl_quit; } static void gfx_ctx_wl_set_resize(void *data, unsigned width, unsigned height) @@ -344,7 +343,7 @@ static bool gfx_ctx_wl_init(void *data) attrib_ptr = NULL; } - g_quit = 0; + g_egl_quit = 0; wl->g_dpy = wl_display_connect(NULL); if (!wl->g_dpy)