Merge branch 'optional-glx-dri' into 'main'

glx: include: meson_options.txt: Allow disabling DRI glx backends

Closes #1638 and #1819

See merge request xorg/xserver!2198
This commit is contained in:
stefan11111 2026-06-06 15:18:37 +00:00
commit e8ef10c5a2
9 changed files with 37 additions and 11 deletions

View file

@ -272,7 +272,12 @@ glxClientCallback(CallbackListPtr *list, void *closure, void *data)
/************************************************************************/
static __GLXprovider *__glXProviderStack = &__glXDRISWRastProvider;
static __GLXprovider *__glXProviderStack =
#ifdef BUILD_GLX_DRI
&__glXDRISWRastProvider;
#else
NULL;
#endif
void
GlxPushProvider(__GLXprovider * provider)

View file

@ -13,8 +13,6 @@ srcs_glx = [
'glxcmds.c',
'glxcmdsswap.c',
'glxext.c',
'glxdriswrast.c',
'glxdricommon.c',
'glxscreens.c',
'render2.c',
'render2swap.c',
@ -30,6 +28,16 @@ srcs_glx = [
'xfont.c',
]
srcs_glxdri2 = []
if build_glx_dri
srcs_glx += 'glx_dri/glxdriswrast.c'
srcs_glx += 'glx_dri/glxdricommon.c'
if build_dri2 or build_dri3
srcs_glxdri2 = files('glx_dri/glxdri2.c')
endif
endif
libxserver_glx = []
if build_glx
libxserver_glx = static_library('libxserver_glx',
@ -50,11 +58,6 @@ if build_glx
)
endif
srcs_glxdri2 = []
if build_dri2 or build_dri3
srcs_glxdri2 = files('glxdri2.c')
endif
srcs_vnd = [
'vndcmds.c',
'vndext.c',

View file

@ -6,8 +6,6 @@ patch = version_split[2].to_int()
# convert to the old-style 1.x.y version scheme used up to 1.20.x for backwards compatibility
release = 1 * 10000000 + major * 100000 + minor * 1000 + patch
dri_dep = dependency('dri', required: build_glx)
conf_data = configuration_data()
conf_data.set('_DIX_CONFIG_H_', '1')
@ -227,7 +225,10 @@ conf_data.set('DPMSExtension', build_dpms ? '1' : false)
conf_data.set('DRI2', build_dri2 ? '1' : false)
conf_data.set('DRI3', build_dri3 ? '1' : false)
if build_glx
conf_data.set_quoted('DRI_DRIVER_PATH', dri_dep.get_variable(pkgconfig : 'dridriverdir'))
if build_glx_dri
conf_data.set_quoted('DRI_DRIVER_PATH', dri_dep.get_variable(pkgconfig : 'dridriverdir'))
conf_data.set('BUILD_GLX_DRI', 1)
endif
endif
conf_data.set('HAS_SHM', build_mitshm ? '1' : false)
conf_data.set('MITSHM', build_mitshm ? '1' : false)

View file

@ -510,6 +510,20 @@ if build_glx
build_hashtable = true
endif
dri_dep = dependency('dri', required: false)
glx_dri_opt = get_option('glx_dri')
build_glx_dri = (glx_dri_opt != 'false')
if not dri_dep.found()
if glx_dri_opt == 'auto'
build_glx_dri = false
endif
if glx_dri_opt == 'true'
error('DRI glx backends requested, but dri.pc was not found')
endif
endif
libdrm_dep = dependency('libdrm', version: libdrm_req, required: false)
if get_option('dri1') == 'auto'

View file

@ -30,6 +30,9 @@ option('fontrootdir', type: 'string',
option('serverconfigdir', type: 'string',
description: 'Miscellaneous server configuration files path. Default: $libdir/xorg')
option('glx_dri', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto',
description: 'Build the dri-based glx backends. Default: true')
option('glx', type: 'boolean', value: true)
option('xdmcp', type: 'boolean', value: true)
option('xdm-auth-1', type: 'boolean', value: true)