From 0c986257f994165872733893afa90dbcad3c0459 Mon Sep 17 00:00:00 2001 From: Leandro Ribeiro Date: Mon, 1 Sep 2025 19:31:43 -0300 Subject: [PATCH] gl-renderer: change params of a few functions No behavior change, just to make things easier for next commits. They will need struct gl_renderer *gr in print_egl_config_info(). Signed-off-by: Leandro Ribeiro --- libweston/renderer-gl/egl-glue.c | 22 ++++++++++---------- libweston/renderer-gl/gl-renderer-internal.h | 2 +- libweston/renderer-gl/gl-renderer.c | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libweston/renderer-gl/egl-glue.c b/libweston/renderer-gl/egl-glue.c index 9d6ad14e9..c0e3ac3a6 100644 --- a/libweston/renderer-gl/egl-glue.c +++ b/libweston/renderer-gl/egl-glue.c @@ -196,20 +196,20 @@ print_egl_config_ints(FILE *fp, EGLDisplay egldpy, EGLConfig eglconfig) } static void -print_egl_config_info(FILE *fp, EGLDisplay egldpy, EGLConfig eglconfig) +print_egl_config_info(FILE *fp, struct gl_renderer *gr, EGLConfig eglconfig) { EGLint value; - print_egl_config_ints(fp, egldpy, eglconfig); + print_egl_config_ints(fp, gr->egl_display, eglconfig); fputs("type: ", fp); - if (eglGetConfigAttrib(egldpy, eglconfig, EGL_SURFACE_TYPE, &value)) + if (eglGetConfigAttrib(gr->egl_display, eglconfig, EGL_SURFACE_TYPE, &value)) print_egl_surface_type_bits(fp, value); else fputs("-", fp); fputs(" vis_id: ", fp); - if (eglGetConfigAttrib(egldpy, eglconfig, EGL_NATIVE_VISUAL_ID, &value)) { + if (eglGetConfigAttrib(gr->egl_display, eglconfig, EGL_NATIVE_VISUAL_ID, &value)) { if (value != 0) { const struct pixel_format_info *p; @@ -229,7 +229,7 @@ print_egl_config_info(FILE *fp, EGLDisplay egldpy, EGLConfig eglconfig) } static void -log_all_egl_configs(EGLDisplay egldpy) +log_all_egl_configs(struct gl_renderer *gr) { EGLint count = 0; EGLConfig *configs; @@ -240,14 +240,14 @@ log_all_egl_configs(EGLDisplay egldpy) weston_log("All available EGLConfigs:\n"); - if (!eglGetConfigs(egldpy, NULL, 0, &count) || count < 1) + if (!eglGetConfigs(gr->egl_display, NULL, 0, &count) || count < 1) return; configs = calloc(count, sizeof *configs); if (!configs) return; - if (!eglGetConfigs(egldpy, configs, count, &count)) + if (!eglGetConfigs(gr->egl_display, configs, count, &count)) return; fp = open_memstream(&strbuf, &strsize); @@ -255,7 +255,7 @@ log_all_egl_configs(EGLDisplay egldpy) goto out; for (i = 0; i < count; i++) { - print_egl_config_info(fp, egldpy, configs[i]); + print_egl_config_info(fp, gr, configs[i]); fputc(0, fp); fflush(fp); weston_log_continue(STAMP_SPACE "%s\n", strbuf); @@ -270,7 +270,7 @@ out: } void -log_egl_config_info(EGLDisplay egldpy, EGLConfig eglconfig) +log_egl_config_info(struct gl_renderer *gr, EGLConfig eglconfig) { char *strbuf = NULL; size_t strsize = 0; @@ -278,7 +278,7 @@ log_egl_config_info(EGLDisplay egldpy, EGLConfig eglconfig) fp = open_memstream(&strbuf, &strsize); if (fp) { - print_egl_config_info(fp, egldpy, eglconfig); + print_egl_config_info(fp, gr, eglconfig); fclose(fp); } @@ -480,7 +480,7 @@ gl_renderer_get_egl_config(struct gl_renderer *gr, formats, formats_count); weston_log("No EGLConfig matches %s.\n", what); free(what); - log_all_egl_configs(gr->egl_display); + log_all_egl_configs(gr); return EGL_NO_CONFIG_KHR; } diff --git a/libweston/renderer-gl/gl-renderer-internal.h b/libweston/renderer-gl/gl-renderer-internal.h index 1978fe9cc..aa67d9a65 100644 --- a/libweston/renderer-gl/gl-renderer-internal.h +++ b/libweston/renderer-gl/gl-renderer-internal.h @@ -680,7 +680,7 @@ gl_renderer_log_extensions(struct gl_renderer *gr, const char *name, const char *extensions); void -log_egl_config_info(EGLDisplay egldpy, EGLConfig eglconfig); +log_egl_config_info(struct gl_renderer *gr, EGLConfig eglconfig); EGLConfig gl_renderer_get_egl_config(struct gl_renderer *gr, diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c index f453ac317..6c45f2861 100644 --- a/libweston/renderer-gl/gl-renderer.c +++ b/libweston/renderer-gl/gl-renderer.c @@ -4213,7 +4213,7 @@ gl_renderer_create_window_surface(struct gl_renderer *gr, if (egl_config == EGL_NO_CONFIG_KHR) return EGL_NO_SURFACE; - log_egl_config_info(gr->egl_display, egl_config); + log_egl_config_info(gr, egl_config); if (gr->create_platform_window) egl_surface = gr->create_platform_window(gr->egl_display,