(FBDev) Cleanups/unifications
This commit is contained in:
parent
80e3170e93
commit
e1a5379886
|
@ -110,9 +110,6 @@ static void *gfx_ctx_mali_fbdev_init(void *video_driver)
|
||||||
frontend_driver_install_signal_handler();
|
frontend_driver_install_signal_handler();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Disable cursor blinking so it's not visible in RetroArch. */
|
|
||||||
system("setterm -cursor off");
|
|
||||||
|
|
||||||
#ifdef HAVE_EGL
|
#ifdef HAVE_EGL
|
||||||
if (!egl_init_context(&mali->egl, EGL_DEFAULT_DISPLAY,
|
if (!egl_init_context(&mali->egl, EGL_DEFAULT_DISPLAY,
|
||||||
&major, &minor, &n, attribs))
|
&major, &minor, &n, attribs))
|
||||||
|
@ -208,7 +205,9 @@ static bool gfx_ctx_mali_fbdev_set_video_mode(void *data,
|
||||||
egl_report_error();
|
egl_report_error();
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_EGL
|
||||||
if (!egl_create_surface(&mali->egl, &mali->native_window))
|
if (!egl_create_surface(&mali->egl, &mali->native_window))
|
||||||
goto error;
|
goto error;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -34,6 +34,8 @@ typedef struct
|
||||||
#ifdef HAVE_EGL
|
#ifdef HAVE_EGL
|
||||||
egl_ctx_data_t egl;
|
egl_ctx_data_t egl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
EGLNativeWindowType native_window;
|
||||||
bool resize;
|
bool resize;
|
||||||
unsigned width, height;
|
unsigned width, height;
|
||||||
} vivante_ctx_data_t;
|
} vivante_ctx_data_t;
|
||||||
|
@ -42,12 +44,16 @@ static void gfx_ctx_vivante_destroy(void *data)
|
||||||
{
|
{
|
||||||
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
|
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
|
||||||
|
|
||||||
|
if (viv)
|
||||||
|
{
|
||||||
#ifdef HAVE_EGL
|
#ifdef HAVE_EGL
|
||||||
egl_destroy(&viv->egl);
|
egl_destroy(&viv->egl);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
viv->resize = false;
|
viv->resize = false;
|
||||||
free(viv);
|
free(viv);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *gfx_ctx_vivante_init(void *video_driver)
|
static void *gfx_ctx_vivante_init(void *video_driver)
|
||||||
|
@ -74,11 +80,14 @@ static void *gfx_ctx_vivante_init(void *video_driver)
|
||||||
if (!viv)
|
if (!viv)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
(void)video_driver;
|
|
||||||
|
|
||||||
#ifdef HAVE_EGL
|
#ifdef HAVE_EGL
|
||||||
frontend_driver_install_signal_handler();
|
frontend_driver_install_signal_handler();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Disable cursor blinking so it's not visible in RetroArch. */
|
||||||
|
system("setterm -cursor off");
|
||||||
|
|
||||||
|
#ifdef HAVE_EGL
|
||||||
if (!egl_init_context(&viv->egl, EGL_DEFAULT_DISPLAY, &major, &minor,
|
if (!egl_init_context(&viv->egl, EGL_DEFAULT_DISPLAY, &major, &minor,
|
||||||
&n, attribs))
|
&n, attribs))
|
||||||
{
|
{
|
||||||
|
@ -153,7 +162,6 @@ static bool gfx_ctx_vivante_set_video_mode(void *data,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_EGL
|
#ifdef HAVE_EGL
|
||||||
EGLNativeWindowType window;
|
|
||||||
static const EGLint attribs[] = {
|
static const EGLint attribs[] = {
|
||||||
EGL_CONTEXT_CLIENT_VERSION, 2, /* Use version 2, even for GLES3. */
|
EGL_CONTEXT_CLIENT_VERSION, 2, /* Use version 2, even for GLES3. */
|
||||||
EGL_NONE
|
EGL_NONE
|
||||||
|
@ -178,10 +186,10 @@ static bool gfx_ctx_vivante_set_video_mode(void *data,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
window = fbCreateWindow(fbGetDisplayByIndex(0), 0, 0, 0, 0);
|
viv->native_window = fbCreateWindow(fbGetDisplayByIndex(0), 0, 0, 0, 0);
|
||||||
|
|
||||||
#ifdef HAVE_EGL
|
#ifdef HAVE_EGL
|
||||||
if (!egl_create_surface(&viv->egl, window))
|
if (!egl_create_surface(&viv->egl, viv->native_window))
|
||||||
goto error;
|
goto error;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -230,11 +238,21 @@ static bool gfx_ctx_vivante_has_windowed(void *data)
|
||||||
static void gfx_ctx_vivante_set_swap_interval(void *data, unsigned swap_interval)
|
static void gfx_ctx_vivante_set_swap_interval(void *data, unsigned swap_interval)
|
||||||
{
|
{
|
||||||
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
|
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
|
||||||
|
|
||||||
#ifdef HAVE_EGL
|
#ifdef HAVE_EGL
|
||||||
egl_set_swap_interval(&viv->egl, swap_interval);
|
egl_set_swap_interval(&viv->egl, swap_interval);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void gfx_ctx_vivante_swap_buffers(void *data)
|
||||||
|
{
|
||||||
|
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
|
||||||
|
|
||||||
|
#ifdef HAVE_EGL
|
||||||
|
egl_swap_buffers(&viv->egl);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static gfx_ctx_proc_t gfx_ctx_vivante_get_proc_address(const char *symbol)
|
static gfx_ctx_proc_t gfx_ctx_vivante_get_proc_address(const char *symbol)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_EGL
|
#ifdef HAVE_EGL
|
||||||
|
@ -253,15 +271,6 @@ static void gfx_ctx_vivante_bind_hw_render(void *data, bool enable)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_vivante_swap_buffers(void *data)
|
|
||||||
{
|
|
||||||
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
|
|
||||||
|
|
||||||
#ifdef HAVE_EGL
|
|
||||||
egl_swap_buffers(&viv->egl);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint32_t gfx_ctx_vivante_get_flags(void *data)
|
static uint32_t gfx_ctx_vivante_get_flags(void *data)
|
||||||
{
|
{
|
||||||
uint32_t flags = 0;
|
uint32_t flags = 0;
|
||||||
|
|
Loading…
Reference in New Issue