mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
Create egl_install_sighandlers
This commit is contained in:
parent
ad311d3bb0
commit
80369a8823
@ -164,3 +164,20 @@ void egl_get_video_size(void *data, unsigned *width, unsigned *height)
|
|||||||
*height = gl_height;
|
*height = gl_height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void egl_sighandler(int sig)
|
||||||
|
{
|
||||||
|
(void)sig;
|
||||||
|
g_egl_quit = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void egl_install_sighandlers(void)
|
||||||
|
{
|
||||||
|
struct sigaction sa = {{0}};
|
||||||
|
|
||||||
|
sa.sa_handler = egl_sighandler;
|
||||||
|
sa.sa_flags = SA_RESTART;
|
||||||
|
sigemptyset(&sa.sa_mask);
|
||||||
|
sigaction(SIGINT, &sa, NULL);
|
||||||
|
sigaction(SIGTERM, &sa, NULL);
|
||||||
|
}
|
||||||
|
@ -49,4 +49,6 @@ void egl_set_swap_interval(void *data, unsigned interval);
|
|||||||
|
|
||||||
void egl_get_video_size(void *data, unsigned *width, unsigned *height);
|
void egl_get_video_size(void *data, unsigned *width, unsigned *height);
|
||||||
|
|
||||||
|
void egl_install_sighandlers(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -129,12 +129,6 @@ static struct drm_fb *drm_fb_get_from_bo(
|
|||||||
return fb;
|
return fb;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sighandler(int sig)
|
|
||||||
{
|
|
||||||
(void)sig;
|
|
||||||
g_egl_quit = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_drm_egl_swap_interval(void *data, unsigned interval)
|
static void gfx_ctx_drm_egl_swap_interval(void *data, unsigned interval)
|
||||||
{
|
{
|
||||||
g_interval = interval;
|
g_interval = interval;
|
||||||
@ -376,7 +370,6 @@ static void gfx_ctx_drm_egl_destroy_resources(gfx_ctx_drm_egl_data_t *drm)
|
|||||||
free_drm_resources(drm);
|
free_drm_resources(drm);
|
||||||
|
|
||||||
drm->g_drm_mode = NULL;
|
drm->g_drm_mode = NULL;
|
||||||
g_egl_quit = 0;
|
|
||||||
drm->g_crtc_id = 0;
|
drm->g_crtc_id = 0;
|
||||||
drm->g_connector_id = 0;
|
drm->g_connector_id = 0;
|
||||||
|
|
||||||
@ -655,7 +648,6 @@ static bool gfx_ctx_drm_egl_set_video_mode(void *data,
|
|||||||
EGLint major, minor, n, egl_attribs[16], *attr;
|
EGLint major, minor, n, egl_attribs[16], *attr;
|
||||||
float refresh_mod;
|
float refresh_mod;
|
||||||
int i, ret = 0;
|
int i, ret = 0;
|
||||||
struct sigaction sa = {{0}};
|
|
||||||
struct drm_fb *fb = NULL;
|
struct drm_fb *fb = NULL;
|
||||||
driver_t *driver = driver_get_ptr();
|
driver_t *driver = driver_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
@ -665,11 +657,7 @@ static bool gfx_ctx_drm_egl_set_video_mode(void *data,
|
|||||||
if (!drm)
|
if (!drm)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
sa.sa_handler = sighandler;
|
egl_install_sighandlers();
|
||||||
sa.sa_flags = SA_RESTART;
|
|
||||||
sigemptyset(&sa.sa_mask);
|
|
||||||
sigaction(SIGINT, &sa, NULL);
|
|
||||||
sigaction(SIGTERM, &sa, NULL);
|
|
||||||
|
|
||||||
switch (g_api)
|
switch (g_api)
|
||||||
{
|
{
|
||||||
|
@ -35,12 +35,6 @@ struct fbdev_window native_window;
|
|||||||
static bool g_resize;
|
static bool g_resize;
|
||||||
static unsigned g_width, g_height;
|
static unsigned g_width, g_height;
|
||||||
|
|
||||||
static void gfx_ctx_mali_fbdev_sighandler(int sig)
|
|
||||||
{
|
|
||||||
(void)sig;
|
|
||||||
g_egl_quit = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_mali_fbdev_destroy(void *data)
|
static void gfx_ctx_mali_fbdev_destroy(void *data)
|
||||||
{
|
{
|
||||||
int fb;
|
int fb;
|
||||||
@ -75,7 +69,6 @@ static bool gfx_ctx_mali_fbdev_init(void *data)
|
|||||||
EGLint num_config;
|
EGLint num_config;
|
||||||
EGLint egl_version_major, egl_version_minor;
|
EGLint egl_version_major, egl_version_minor;
|
||||||
EGLint format;
|
EGLint format;
|
||||||
struct sigaction sa = {{0}};
|
|
||||||
static const EGLint attribs[] = {
|
static const EGLint attribs[] = {
|
||||||
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
||||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
||||||
@ -86,13 +79,7 @@ static bool gfx_ctx_mali_fbdev_init(void *data)
|
|||||||
EGL_NONE
|
EGL_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
(void)data;
|
egl_install_sighandlers();
|
||||||
|
|
||||||
sa.sa_handler = gfx_ctx_mali_fbdev_sighandler;
|
|
||||||
sa.sa_flags = SA_RESTART;
|
|
||||||
sigemptyset(&sa.sa_mask);
|
|
||||||
sigaction(SIGINT, &sa, NULL);
|
|
||||||
sigaction(SIGTERM, &sa, NULL);
|
|
||||||
|
|
||||||
/* Disable cursor blinking so it's not visible in RetroArch. */
|
/* Disable cursor blinking so it's not visible in RetroArch. */
|
||||||
system("setterm -cursor off");
|
system("setterm -cursor off");
|
||||||
|
@ -64,12 +64,6 @@ static INLINE bool gfx_ctx_vc_egl_query_extension(const char *ext)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sighandler(int sig)
|
|
||||||
{
|
|
||||||
(void)sig;
|
|
||||||
g_egl_quit = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_vc_check_window(void *data, bool *quit,
|
static void gfx_ctx_vc_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
||||||
{
|
{
|
||||||
@ -305,17 +299,10 @@ static bool gfx_ctx_vc_set_video_mode(void *data,
|
|||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
struct sigaction sa = {{0}};
|
|
||||||
|
|
||||||
if (g_inited)
|
if (g_inited)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
sa.sa_handler = sighandler;
|
egl_install_sighandlers();
|
||||||
sa.sa_flags = SA_RESTART;
|
|
||||||
sigemptyset(&sa.sa_mask);
|
|
||||||
sigaction(SIGINT, &sa, NULL);
|
|
||||||
sigaction(SIGTERM, &sa, NULL);
|
|
||||||
|
|
||||||
egl_set_swap_interval(data, g_interval);
|
egl_set_swap_interval(data, g_interval);
|
||||||
|
|
||||||
g_inited = true;
|
g_inited = true;
|
||||||
|
@ -26,12 +26,6 @@
|
|||||||
static bool g_resize;
|
static bool g_resize;
|
||||||
static unsigned g_width, g_height;
|
static unsigned g_width, g_height;
|
||||||
|
|
||||||
static void sighandler(int sig)
|
|
||||||
{
|
|
||||||
(void)sig;
|
|
||||||
g_egl_quit = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_vivante_destroy(void *data)
|
static void gfx_ctx_vivante_destroy(void *data)
|
||||||
{
|
{
|
||||||
egl_destroy(data);
|
egl_destroy(data);
|
||||||
@ -44,7 +38,6 @@ static bool gfx_ctx_vivante_init(void *data)
|
|||||||
EGLint num_config;
|
EGLint num_config;
|
||||||
EGLint egl_version_major, egl_version_minor;
|
EGLint egl_version_major, egl_version_minor;
|
||||||
EGLint format;
|
EGLint format;
|
||||||
struct sigaction sa = {{0}};
|
|
||||||
static const EGLint attribs[] = {
|
static const EGLint attribs[] = {
|
||||||
#if 0
|
#if 0
|
||||||
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
||||||
@ -60,11 +53,7 @@ static bool gfx_ctx_vivante_init(void *data)
|
|||||||
|
|
||||||
(void)data;
|
(void)data;
|
||||||
|
|
||||||
sa.sa_handler = sighandler;
|
egl_install_sighandlers();
|
||||||
sa.sa_flags = SA_RESTART;
|
|
||||||
sigemptyset(&sa.sa_mask);
|
|
||||||
sigaction(SIGINT, &sa, NULL);
|
|
||||||
sigaction(SIGTERM, &sa, NULL);
|
|
||||||
|
|
||||||
RARCH_LOG("[Vivante fbdev]: Initializing context\n");
|
RARCH_LOG("[Vivante fbdev]: Initializing context\n");
|
||||||
|
|
||||||
|
@ -55,12 +55,6 @@ static unsigned g_minor;
|
|||||||
#define EGL_OPENGL_ES3_BIT_KHR 0x0040
|
#define EGL_OPENGL_ES3_BIT_KHR 0x0040
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void sighandler(int sig)
|
|
||||||
{
|
|
||||||
(void)sig;
|
|
||||||
g_egl_quit = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Shell surface callbacks. */
|
/* Shell surface callbacks. */
|
||||||
static void shell_surface_handle_ping(void *data,
|
static void shell_surface_handle_ping(void *data,
|
||||||
struct wl_shell_surface *shell_surface,
|
struct wl_shell_surface *shell_surface,
|
||||||
@ -503,14 +497,9 @@ static bool gfx_ctx_wl_set_video_mode(void *data,
|
|||||||
driver_t *driver = driver_get_ptr();
|
driver_t *driver = driver_get_ptr();
|
||||||
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)
|
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)
|
||||||
driver->video_context_data;
|
driver->video_context_data;
|
||||||
struct sigaction sa = {{0}};
|
|
||||||
EGLint *attr = NULL;
|
EGLint *attr = NULL;
|
||||||
|
|
||||||
sa.sa_handler = sighandler;
|
egl_install_sighandlers();
|
||||||
sa.sa_flags = SA_RESTART;
|
|
||||||
sigemptyset(&sa.sa_mask);
|
|
||||||
sigaction(SIGINT, &sa, NULL);
|
|
||||||
sigaction(SIGTERM, &sa, NULL);
|
|
||||||
|
|
||||||
attr = egl_fill_attribs(egl_attribs);
|
attr = egl_fill_attribs(egl_attribs);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user