xserver/glamor
stefan11111 eccee47185 glamor: fix Option "GlxVendorLibrary"
The old code tried to use a screen pointer that was uninitialized and set to NULL.
This caused it to segfault when this option was set.

When this option was used with the modesetting driver, `glamor_egl_init`
is called indirectly in the driver PreInit proc.

`xf86ScrnToScreen(scrn)` then returns NULL.

This patch moves setting the gl vendor later in the initialization process,
when we already have a non-null pScreen.

Minimal reproducer:
```
$ cat /etc/X11/xorg.conf.d/99-screen.conf
Section "Screen"
	Identifier "Default"
	Option "GlxVendorLibrary" "Name"
EndSection
```

Backtrace:
```
| #0  in abort ()
| #1  in OsAbort () at os/utils.c:1361
| #2  in AbortServer () at os/log.c:879
| #3  FatalError () at os/log.c:1017
| #4  in OsSigHandler () at os/osinit.c:156
| #5  OsSigHandler () at os/osinit.c:110
| #6  <signal handler called>
| #7  in __pthread_kill_implementation () from /lib64/libc.so.6
| #8  in raise () from /lib64/libc.so.6
| #9  in abort () from /lib64/libc.so.6
| #10 in __assert_fail_base.cold () from /lib64/libc.so.6
| #11 in xf86ScrnToScreen () at hw/xfree86/common/xf86Helper.c:1734
| #12 in glamor_egl_init () at glamor/glamor_egl.c:1108
| #13 in try_enable_glamor () at hw/xfree86/drivers/modesetting/driver.c:984
| #14 PreInit () at hw/xfree86/drivers/modesetting/driver.c:1211
| #15 in InitOutput () at hw/xfree86/common/xf86Init.c:478
| #16 in dix_main () at dix/main.c:190
| #17 main () at dix/stubmain.c:34
```

Fixes: a449bb4c5 - glamor_egl: add support of GlxVendorLibrary option

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2096>
2025-11-27 10:28:03 +00:00
..
glamor.c glamor: handle allocation failure in glamor_create_pixmap() 2025-11-02 11:52:32 -08:00
glamor.h glamor: add glvnd_vendor private 2023-11-07 17:59:24 +03:00
glamor_addtraps.c glamor: Remove _nf rendering functions 2015-03-24 12:01:39 -07:00
glamor_composite_glyphs.c glamor: Fix dual blend on GLES3 2025-06-25 17:24:43 +00:00
glamor_compositerects.c glamor: Make glamor_solid_boxes take a DrawablePtr 2023-07-20 10:14:56 +02:00
glamor_context.h glamor: Assume EGL in glamor_context 2021-09-15 19:14:23 +00:00
glamor_copy.c glamor: Make glamor_set_alu take a DrawablePtr 2024-01-11 10:03:10 +00:00
glamor_core.c glamor: silence false positive in glamor_validate_gc() 2025-11-02 11:52:32 -08:00
glamor_dash.c glamor: avoid null dereference in glamor_dash_setup() 2025-11-04 14:25:07 -08:00
glamor_debug.h glamor: glamor_debug.h: drop unused AbortServer() declaration 2024-03-03 22:29:52 +00:00
glamor_egl.c glamor: fix Option "GlxVendorLibrary" 2025-11-27 10:28:03 +00:00
glamor_egl.h glamor/xwayland: Define EGL_NO_X11 2019-11-04 20:49:33 +01:00
glamor_egl_ext.h glamor: Implement PixmapFromBuffers and BuffersFromPixmap 2018-03-05 13:27:49 -05:00
glamor_eglmodule.c glamor: use explicit field initializers for XF86ModuleData 2025-02-17 19:41:29 +00:00
glamor_fbo.c glamor: drop duplicate _X_EXPORT from .c source 2024-03-03 22:34:26 +00:00
glamor_font.c include: dixfontstr.h: drop silent dependency on libxfont2 2024-09-01 17:45:13 +00:00
glamor_font.h glamor: store old fonts in double width textures. 2016-01-13 11:21:02 +10:00
glamor_glx_provider.c glamor: reject configs using unsupported rgbBits size 2025-01-21 09:16:52 +00:00
glamor_glx_provider.h glamor: Lift the GLX EGL backend from Xwayland 2023-11-07 17:59:24 +03:00
glamor_glyphblt.c Fixed mirrored glyphs on big-endian machines 2023-12-17 16:44:45 +00:00
glamor_gradient.c glamor: don't need NULL check before free() 2025-02-23 17:32:49 +00:00
glamor_image.c glamor: Add and use glamor_drawable_effective_depth helper 2023-07-20 10:14:56 +02:00
glamor_largepixmap.c glamor: handle allocation failures in glamor_largepixmap.c 2025-11-04 14:25:07 -08:00
glamor_lines.c glamor: explicitly draw endpoints of line segments 2025-02-24 20:39:12 +00:00
glamor_picture.c glamor: make use of GL_EXT_texture_format_BGRA8888 2022-12-01 08:41:57 +00:00
glamor_pixmap.c glamor: Fall back for mixed depth 24/32 in glamor_set_alu 2024-01-11 10:03:10 +00:00
glamor_points.c glamor: support GLES3 shaders 2023-10-09 17:25:28 +00:00
glamor_prepare.c glamor: Add and use glamor_drawable_effective_depth helper 2023-07-20 10:14:56 +02:00
glamor_prepare.h glamor: Replace fallback preparation code 2014-06-15 22:02:40 +01:00
glamor_priv.h fix missing includes of <X11/Xfuncproto.h> 2024-07-20 17:18:38 +00:00
glamor_program.c glamor: Fix possible double-free 2024-07-29 13:49:27 +00:00
glamor_program.h glamor: Make program APIs take DrawablePtrs instead of PixmapPtrs 2023-07-18 09:34:39 +00:00
glamor_rects.c glamor: support GLES3 shaders 2023-10-09 17:25:28 +00:00
glamor_render.c glamor: avoid null dereference in glamor_composite_clipped_region() 2025-11-04 14:25:07 -08:00
glamor_segs.c glamor: support GLES3 shaders 2023-10-09 17:25:28 +00:00
glamor_spans.c glamor: support GLES3 shaders 2023-10-09 17:25:28 +00:00
glamor_sync.c glamor: Don't glFlush/ctx switch unless any work has been performed 2023-03-17 12:38:23 +00:00
glamor_text.c Fixed mirrored glyphs on big-endian machines 2023-12-17 16:44:45 +00:00
glamor_transfer.c glamor: check BPP by render_format. 2024-08-01 10:48:11 +03:00
glamor_transfer.h glamor: Take DrawablePtr instead of PixmapPtr in up/download_boxes 2023-07-18 09:34:39 +00:00
glamor_transform.c glamor: Make glamor_set_alu take a DrawablePtr 2024-01-11 10:03:10 +00:00
glamor_transform.h glamor: Add and use glamor_drawable_effective_depth helper 2023-07-20 10:14:56 +02:00
glamor_trapezoid.c glamor: Remove _nf rendering functions 2015-03-24 12:01:39 -07:00
glamor_triangles.c glamor: Remove _nf rendering functions 2015-03-24 12:01:39 -07:00
glamor_utils.c glamor: Make glamor_solid_boxes take a DrawablePtr 2023-07-20 10:14:56 +02:00
glamor_utils.h glamor: Don't glFlush/ctx switch unless any work has been performed 2023-03-17 12:38:23 +00:00
glamor_vbo.c treewide: replace xnfalloc() calls to XNFalloc() 2024-07-26 23:41:33 +00:00
glamor_window.c glamor: Drop tracking of the last picture attached to pixmaps. 2015-07-10 09:42:58 -07:00
glamor_xv.c drop obsolete HAVE_DIX_CONFIG_H 2024-10-10 13:38:31 +00:00
meson.build Xephyr: use glamor glx provider 2023-11-07 18:20:48 +03:00