diff options
Diffstat (limited to 'render/egl.c')
-rw-r--r-- | render/egl.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/render/egl.c b/render/egl.c index 7f910e86..96e48c06 100644 --- a/render/egl.c +++ b/render/egl.c @@ -13,7 +13,7 @@ static bool egl_get_config(EGLDisplay disp, EGLint *attribs, EGLConfig *out, ret = eglGetConfigs(disp, NULL, 0, &count); if (ret == EGL_FALSE || count == 0) { - wlr_log(L_ERROR, "eglGetConfigs returned no configs"); + wlr_log(WLR_ERROR, "eglGetConfigs returned no configs"); return false; } @@ -21,7 +21,7 @@ static bool egl_get_config(EGLDisplay disp, EGLint *attribs, EGLConfig *out, ret = eglChooseConfig(disp, attribs, configs, count, &matched); if (ret == EGL_FALSE) { - wlr_log(L_ERROR, "eglChooseConfig failed"); + wlr_log(WLR_ERROR, "eglChooseConfig failed"); return false; } @@ -38,17 +38,17 @@ static bool egl_get_config(EGLDisplay disp, EGLint *attribs, EGLConfig *out, } } - wlr_log(L_ERROR, "no valid egl config found"); + wlr_log(WLR_ERROR, "no valid egl config found"); return false; } -static log_importance_t egl_log_importance_to_wlr(EGLint type) { +static enum wlr_log_importance egl_log_importance_to_wlr(EGLint type) { switch (type) { - case EGL_DEBUG_MSG_CRITICAL_KHR: return L_ERROR; - case EGL_DEBUG_MSG_ERROR_KHR: return L_ERROR; - case EGL_DEBUG_MSG_WARN_KHR: return L_ERROR; - case EGL_DEBUG_MSG_INFO_KHR: return L_INFO; - default: return L_INFO; + case EGL_DEBUG_MSG_CRITICAL_KHR: return WLR_ERROR; + case EGL_DEBUG_MSG_ERROR_KHR: return WLR_ERROR; + case EGL_DEBUG_MSG_WARN_KHR: return WLR_ERROR; + case EGL_DEBUG_MSG_INFO_KHR: return WLR_INFO; + default: return WLR_INFO; } } @@ -92,7 +92,7 @@ static void print_dmabuf_formats(struct wlr_egl *egl) { snprintf(&str_formats[i*5], (num - i) * 5 + 1, "%.4s ", (char*)&formats[i]); } - wlr_log(L_DEBUG, "Supported dmabuf buffer formats: %s", str_formats); + wlr_log(WLR_DEBUG, "Supported dmabuf buffer formats: %s", str_formats); free(formats); } @@ -114,7 +114,7 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *remote_display, } if (eglBindAPI(EGL_OPENGL_ES_API) == EGL_FALSE) { - wlr_log(L_ERROR, "Failed to bind to the OpenGL ES API"); + wlr_log(WLR_ERROR, "Failed to bind to the OpenGL ES API"); goto error; } @@ -125,26 +125,26 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *remote_display, egl->display = eglGetPlatformDisplayEXT(platform, remote_display, NULL); } if (egl->display == EGL_NO_DISPLAY) { - wlr_log(L_ERROR, "Failed to create EGL display"); + wlr_log(WLR_ERROR, "Failed to create EGL display"); goto error; } EGLint major, minor; if (eglInitialize(egl->display, &major, &minor) == EGL_FALSE) { - wlr_log(L_ERROR, "Failed to initialize EGL"); + wlr_log(WLR_ERROR, "Failed to initialize EGL"); goto error; } if (!egl_get_config(egl->display, config_attribs, &egl->config, visual_id)) { - wlr_log(L_ERROR, "Failed to get EGL config"); + wlr_log(WLR_ERROR, "Failed to get EGL config"); goto error; } egl->exts_str = eglQueryString(egl->display, EGL_EXTENSIONS); - wlr_log(L_INFO, "Using EGL %d.%d", (int)major, (int)minor); - wlr_log(L_INFO, "Supported EGL extensions: %s", egl->exts_str); - wlr_log(L_INFO, "EGL vendor: %s", eglQueryString(egl->display, EGL_VENDOR)); + wlr_log(WLR_INFO, "Using EGL %d.%d", (int)major, (int)minor); + wlr_log(WLR_INFO, "Supported EGL extensions: %s", egl->exts_str); + wlr_log(WLR_INFO, "EGL vendor: %s", eglQueryString(egl->display, EGL_VENDOR)); egl->exts.image_base_khr = check_egl_ext(egl->exts_str, "EGL_KHR_image_base") @@ -201,7 +201,7 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *remote_display, egl->context = eglCreateContext(egl->display, egl->config, EGL_NO_CONTEXT, attribs); if (egl->context == EGL_NO_CONTEXT) { - wlr_log(L_ERROR, "Failed to create EGL context"); + wlr_log(WLR_ERROR, "Failed to create EGL context"); goto error; } @@ -210,15 +210,15 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *remote_display, eglQueryContext(egl->display, egl->context, EGL_CONTEXT_PRIORITY_LEVEL_IMG, &priority); if (priority != EGL_CONTEXT_PRIORITY_HIGH_IMG) { - wlr_log(L_INFO, "Failed to obtain a high priority context"); + wlr_log(WLR_INFO, "Failed to obtain a high priority context"); } else { - wlr_log(L_DEBUG, "Obtained high priority context"); + wlr_log(WLR_DEBUG, "Obtained high priority context"); } } if (!eglMakeCurrent(egl->display, EGL_NO_SURFACE, EGL_NO_SURFACE, egl->context)) { - wlr_log(L_ERROR, "Failed to make EGL context current"); + wlr_log(WLR_ERROR, "Failed to make EGL context current"); goto error; } @@ -277,7 +277,7 @@ EGLSurface wlr_egl_create_surface(struct wlr_egl *egl, void *window) { EGLSurface surf = eglCreatePlatformWindowSurfaceEXT(egl->display, egl->config, window, NULL); if (surf == EGL_NO_SURFACE) { - wlr_log(L_ERROR, "Failed to create EGL surface"); + wlr_log(WLR_ERROR, "Failed to create EGL surface"); return EGL_NO_SURFACE; } return surf; @@ -292,7 +292,7 @@ static int egl_get_buffer_age(struct wlr_egl *egl, EGLSurface surface) { EGLBoolean ok = eglQuerySurface(egl->display, surface, EGL_BUFFER_AGE_EXT, &buffer_age); if (!ok) { - wlr_log(L_ERROR, "Failed to get EGL surface buffer age"); + wlr_log(WLR_ERROR, "Failed to get EGL surface buffer age"); return -1; } @@ -302,7 +302,7 @@ static int egl_get_buffer_age(struct wlr_egl *egl, EGLSurface surface) { bool wlr_egl_make_current(struct wlr_egl *egl, EGLSurface surface, int *buffer_age) { if (!eglMakeCurrent(egl->display, surface, surface, egl->context)) { - wlr_log(L_ERROR, "eglMakeCurrent failed"); + wlr_log(WLR_ERROR, "eglMakeCurrent failed"); return false; } @@ -344,7 +344,7 @@ bool wlr_egl_swap_buffers(struct wlr_egl *egl, EGLSurface surface, } if (!ret) { - wlr_log(L_ERROR, "eglSwapBuffers failed"); + wlr_log(WLR_ERROR, "eglSwapBuffers failed"); return false; } return true; @@ -462,24 +462,24 @@ int wlr_egl_get_dmabuf_formats(struct wlr_egl *egl, int **formats) { if (!egl->exts.image_dmabuf_import_ext || !egl->exts.image_dmabuf_import_modifiers_ext) { - wlr_log(L_DEBUG, "dmabuf extension not present"); + wlr_log(WLR_DEBUG, "dmabuf extension not present"); return -1; } EGLint num; if (!eglQueryDmaBufFormatsEXT(egl->display, 0, NULL, &num)) { - wlr_log(L_ERROR, "failed to query number of dmabuf formats"); + wlr_log(WLR_ERROR, "failed to query number of dmabuf formats"); return -1; } *formats = calloc(num, sizeof(int)); if (*formats == NULL) { - wlr_log(L_ERROR, "Allocation failed: %s", strerror(errno)); + wlr_log(WLR_ERROR, "Allocation failed: %s", strerror(errno)); return -1; } if (!eglQueryDmaBufFormatsEXT(egl->display, num, *formats, &num)) { - wlr_log(L_ERROR, "failed to query dmabuf format"); + wlr_log(WLR_ERROR, "failed to query dmabuf format"); free(*formats); return -1; } @@ -490,26 +490,26 @@ int wlr_egl_get_dmabuf_modifiers(struct wlr_egl *egl, int format, uint64_t **modifiers) { if (!egl->exts.image_dmabuf_import_ext || !egl->exts.image_dmabuf_import_modifiers_ext) { - wlr_log(L_DEBUG, "dmabuf extension not present"); + wlr_log(WLR_DEBUG, "dmabuf extension not present"); return -1; } EGLint num; if (!eglQueryDmaBufModifiersEXT(egl->display, format, 0, NULL, NULL, &num)) { - wlr_log(L_ERROR, "failed to query dmabuf number of modifiers"); + wlr_log(WLR_ERROR, "failed to query dmabuf number of modifiers"); return -1; } *modifiers = calloc(num, sizeof(uint64_t)); if (*modifiers == NULL) { - wlr_log(L_ERROR, "Allocation failed: %s", strerror(errno)); + wlr_log(WLR_ERROR, "Allocation failed: %s", strerror(errno)); return -1; } if (!eglQueryDmaBufModifiersEXT(egl->display, format, num, *modifiers, NULL, &num)) { - wlr_log(L_ERROR, "failed to query dmabuf modifiers"); + wlr_log(WLR_ERROR, "failed to query dmabuf modifiers"); free(*modifiers); return -1; } @@ -531,7 +531,7 @@ bool wlr_egl_export_image_to_dmabuf(struct wlr_egl *egl, EGLImageKHR image, return false; } if (attribs->n_planes > WLR_DMABUF_MAX_PLANES) { - wlr_log(L_ERROR, "EGL returned %d planes, but only %d are supported", + wlr_log(WLR_ERROR, "EGL returned %d planes, but only %d are supported", attribs->n_planes, WLR_DMABUF_MAX_PLANES); return false; } |