From 0b079e12b2cec8025656a75b0422ba2ddc7653d4 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 19 Nov 2025 16:23:46 +0100 Subject: [PATCH] Revert "glamor: reject configs using unsupported rgbBits size" This reverts commit b89a563882f234f6949a874770d3ca075d2d2fdc. This is a fix for a code path that we are about to remove with the next few reverts, so start by reverting this change. See-also: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1848 Part-of: --- glamor/glamor_glx_provider.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/glamor/glamor_glx_provider.c b/glamor/glamor_glx_provider.c index c27141c7c..77ccc3c8b 100644 --- a/glamor/glamor_glx_provider.c +++ b/glamor/glamor_glx_provider.c @@ -140,14 +140,12 @@ egl_create_glx_drawable(ClientPtr client, __GLXscreen *screen, * - drawable type masks is suspicious */ static struct egl_config * -translate_eglconfig(ScreenPtr pScreen, struct egl_screen *screen, EGLConfig hc, +translate_eglconfig(struct egl_screen *screen, EGLConfig hc, struct egl_config *chain, Bool direct_color, Bool double_buffer, Bool duplicate_for_composite, Bool srgb_only) { EGLint value; - bool valid_depth; - int i; struct egl_config *c = calloc(1, sizeof *c); if (!c) @@ -220,19 +218,6 @@ translate_eglconfig(ScreenPtr pScreen, struct egl_screen *screen, EGLConfig hc, } #undef GET - /* Only expose this config if rgbBits matches a supported - * depth value. - */ - valid_depth = false; - for (i = 0; i < pScreen->numDepths && !valid_depth; i++) { - if (pScreen->allowedDepths[i].depth == c->base.rgbBits) - valid_depth = true; - } - if (!valid_depth) { - free(c); - return chain; - } - /* derived state: config caveats */ eglGetConfigAttrib(screen->display, hc, EGL_CONFIG_CAVEAT, &value); if (value == EGL_NONE) @@ -355,13 +340,13 @@ egl_mirror_configs(ScreenPtr pScreen, struct egl_screen *screen) for (j = 0; j < 3; j++) /* direct_color */ for (k = 0; k < 2; k++) /* double_buffer */ { if (can_srgb) - c = translate_eglconfig(pScreen, screen, host_configs[i], c, + c = translate_eglconfig(screen, host_configs[i], c, /* direct_color */ j == 1, /* double_buffer */ k > 0, /* duplicate_for_composite */ j == 0, /* srgb_only */ true); - c = translate_eglconfig(pScreen, screen, host_configs[i], c, + c = translate_eglconfig(screen, host_configs[i], c, /* direct_color */ j == 1, /* double_buffer */ k > 0, /* duplicate_for_composite */ j == 0,