removed redundant cleanup in InitGraphicsDevice
This commit is contained in:
parent
00a945a30b
commit
ff5d1cc028
60
src/core.c
60
src/core.c
|
|
@ -3089,7 +3089,6 @@ static bool InitGraphicsDevice(int width, int height)
|
||||||
if (!res)
|
if (!res)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "DISPLAY: failed get DRM resources");
|
TRACELOG(LOG_WARNING, "DISPLAY: failed get DRM resources");
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3126,7 +3125,6 @@ static bool InitGraphicsDevice(int width, int height)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "no suitable DRM connector found");
|
TRACELOG(LOG_WARNING, "no suitable DRM connector found");
|
||||||
drmModeFreeResources(res);
|
drmModeFreeResources(res);
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3134,9 +3132,7 @@ static bool InitGraphicsDevice(int width, int height)
|
||||||
if (!enc)
|
if (!enc)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "failed to get DRM mode encoder");
|
TRACELOG(LOG_WARNING, "failed to get DRM mode encoder");
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
drmModeFreeResources(res);
|
drmModeFreeResources(res);
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3153,9 +3149,7 @@ static bool InitGraphicsDevice(int width, int height)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "failed to get DRM mode crtc");
|
TRACELOG(LOG_WARNING, "failed to get DRM mode crtc");
|
||||||
drmModeFreeEncoder(enc);
|
drmModeFreeEncoder(enc);
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
drmModeFreeResources(res);
|
drmModeFreeResources(res);
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3259,9 +3253,7 @@ find_connector_mode:
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "no suitable DRM connector mode found");
|
TRACELOG(LOG_WARNING, "no suitable DRM connector mode found");
|
||||||
drmModeFreeEncoder(enc);
|
drmModeFreeEncoder(enc);
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
drmModeFreeResources(res);
|
drmModeFreeResources(res);
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3279,8 +3271,6 @@ find_connector_mode:
|
||||||
if (!CORE.Window.gbmDevice)
|
if (!CORE.Window.gbmDevice)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "failed to create GBM device");
|
TRACELOG(LOG_WARNING, "failed to create GBM device");
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3289,9 +3279,6 @@ find_connector_mode:
|
||||||
if (!CORE.Window.gbmSurface)
|
if (!CORE.Window.gbmSurface)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "failed to create GBM surface");
|
TRACELOG(LOG_WARNING, "failed to create GBM surface");
|
||||||
gbm_device_destroy(CORE.Window.gbmDevice);
|
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -3512,10 +3499,6 @@ find_connector_mode:
|
||||||
if (CORE.Window.device == EGL_NO_DISPLAY)
|
if (CORE.Window.device == EGL_NO_DISPLAY)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "DISPLAY: Failed to initialize EGL device");
|
TRACELOG(LOG_WARNING, "DISPLAY: Failed to initialize EGL device");
|
||||||
gbm_surface_destroy(CORE.Window.gbmSurface);
|
|
||||||
gbm_device_destroy(CORE.Window.gbmDevice);
|
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3524,12 +3507,6 @@ find_connector_mode:
|
||||||
{
|
{
|
||||||
// If all of the calls to eglInitialize returned EGL_FALSE then an error has occurred.
|
// If all of the calls to eglInitialize returned EGL_FALSE then an error has occurred.
|
||||||
TRACELOG(LOG_WARNING, "DISPLAY: Failed to initialize EGL device");
|
TRACELOG(LOG_WARNING, "DISPLAY: Failed to initialize EGL device");
|
||||||
#if defined(PLATFORM_DRM)
|
|
||||||
gbm_surface_destroy(CORE.Window.gbmSurface);
|
|
||||||
gbm_device_destroy(CORE.Window.gbmDevice);
|
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
close(CORE.Window.fd);
|
|
||||||
#endif
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3537,10 +3514,6 @@ find_connector_mode:
|
||||||
if (!eglGetConfigs(CORE.Window.device, NULL, 0, &numConfigs))
|
if (!eglGetConfigs(CORE.Window.device, NULL, 0, &numConfigs))
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "DISPLAY: Failed to get EGL config count: 0x%x", eglGetError());
|
TRACELOG(LOG_WARNING, "DISPLAY: Failed to get EGL config count: 0x%x", eglGetError());
|
||||||
gbm_surface_destroy(CORE.Window.gbmSurface);
|
|
||||||
gbm_device_destroy(CORE.Window.gbmDevice);
|
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3549,10 +3522,6 @@ find_connector_mode:
|
||||||
EGLConfig *configs = calloc(numConfigs, sizeof(*configs));
|
EGLConfig *configs = calloc(numConfigs, sizeof(*configs));
|
||||||
if (!configs) {
|
if (!configs) {
|
||||||
TRACELOG(LOG_WARNING, "DISPLAY: Failed to get memory for EGL configs");
|
TRACELOG(LOG_WARNING, "DISPLAY: Failed to get memory for EGL configs");
|
||||||
gbm_surface_destroy(CORE.Window.gbmSurface);
|
|
||||||
gbm_device_destroy(CORE.Window.gbmDevice);
|
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3560,10 +3529,6 @@ find_connector_mode:
|
||||||
if (!eglGetConfigs(CORE.Window.device, configs, numConfigs, &matchingNumConfigs)) {
|
if (!eglGetConfigs(CORE.Window.device, configs, numConfigs, &matchingNumConfigs)) {
|
||||||
TRACELOG(LOG_WARNING, "DISPLAY: Failed to get EGL configs: 0x%x", eglGetError());
|
TRACELOG(LOG_WARNING, "DISPLAY: Failed to get EGL configs: 0x%x", eglGetError());
|
||||||
free(configs);
|
free(configs);
|
||||||
gbm_surface_destroy(CORE.Window.gbmSurface);
|
|
||||||
gbm_device_destroy(CORE.Window.gbmDevice);
|
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3573,10 +3538,6 @@ find_connector_mode:
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "DISPLAY: Failed to choose EGL config: 0x%x", eglGetError());
|
TRACELOG(LOG_WARNING, "DISPLAY: Failed to choose EGL config: 0x%x", eglGetError());
|
||||||
free(configs);
|
free(configs);
|
||||||
gbm_surface_destroy(CORE.Window.gbmSurface);
|
|
||||||
gbm_device_destroy(CORE.Window.gbmDevice);
|
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3600,10 +3561,6 @@ find_connector_mode:
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "DISPLAY: Failed to find a suitable EGL config");
|
TRACELOG(LOG_WARNING, "DISPLAY: Failed to find a suitable EGL config");
|
||||||
gbm_surface_destroy(CORE.Window.gbmSurface);
|
|
||||||
gbm_device_destroy(CORE.Window.gbmDevice);
|
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
@ -3619,10 +3576,6 @@ find_connector_mode:
|
||||||
if (CORE.Window.context == EGL_NO_CONTEXT)
|
if (CORE.Window.context == EGL_NO_CONTEXT)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "DISPLAY: Failed to create EGL context");
|
TRACELOG(LOG_WARNING, "DISPLAY: Failed to create EGL context");
|
||||||
gbm_surface_destroy(CORE.Window.gbmSurface);
|
|
||||||
gbm_device_destroy(CORE.Window.gbmDevice);
|
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -3709,11 +3662,6 @@ find_connector_mode:
|
||||||
if (EGL_NO_SURFACE == CORE.Window.surface)
|
if (EGL_NO_SURFACE == CORE.Window.surface)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "DISPLAY: Failed to create EGL window surface: 0x%04x", eglGetError());
|
TRACELOG(LOG_WARNING, "DISPLAY: Failed to create EGL window surface: 0x%04x", eglGetError());
|
||||||
eglDestroyContext(CORE.Window.device, CORE.Window.context);
|
|
||||||
gbm_surface_destroy(CORE.Window.gbmSurface);
|
|
||||||
gbm_device_destroy(CORE.Window.gbmDevice);
|
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
close(CORE.Window.fd);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3731,14 +3679,6 @@ find_connector_mode:
|
||||||
if (eglMakeCurrent(CORE.Window.device, CORE.Window.surface, CORE.Window.surface, CORE.Window.context) == EGL_FALSE)
|
if (eglMakeCurrent(CORE.Window.device, CORE.Window.surface, CORE.Window.surface, CORE.Window.context) == EGL_FALSE)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "DISPLAY: Failed to attach EGL rendering context to EGL surface");
|
TRACELOG(LOG_WARNING, "DISPLAY: Failed to attach EGL rendering context to EGL surface");
|
||||||
#if defined(PLATFORM_DRM)
|
|
||||||
eglDestroySurface(CORE.Window.device, CORE.Window.surface);
|
|
||||||
eglDestroyContext(CORE.Window.device, CORE.Window.context);
|
|
||||||
gbm_surface_destroy(CORE.Window.gbmSurface);
|
|
||||||
gbm_device_destroy(CORE.Window.gbmDevice);
|
|
||||||
drmModeFreeConnector(CORE.Window.connector);
|
|
||||||
close(CORE.Window.fd);
|
|
||||||
#endif
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user