Revert "glamor: reject configs using unsupported rgbBits size"

This reverts commit b89a563882.

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: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2104>
This commit is contained in:
Olivier Fourdan 2025-11-19 16:23:46 +01:00
parent 065f02d946
commit 0b079e12b2

View file

@ -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,