treewide: Move the dri2 extension to Xext and use it for all X servers

This is needed to get proton working in Xfbdev, but is probably useful in other places too.

Xephyr has some unrelated issues regaring Xinput, so steam doesn't work there.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
stefan11111 2026-01-01 13:42:08 +02:00 committed by Enrico Weigelt
parent 2a41522349
commit dc39eda42b
26 changed files with 47 additions and 61 deletions

View File

@ -30,9 +30,7 @@
* Kristian Høgsberg (krh@redhat.com)
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include <dix-config.h>
#include <errno.h>
@ -49,7 +47,17 @@
#include "dri2_priv.h"
#include "dri2int.h"
#include "damage.h"
#include "xf86.h"
/* needs xf86.h otherwise */
/* format is treated as part of the varargs to swallow the comma */
#define xf86DrvMsg(scrnIndex, type, /* format, */ ...) \
do { \
(void)scrnIndex; \
if (type == X_ERROR) { \
printf(__VA_ARGS__); \
} \
} while (0);
CARD8 dri2_major; /* version of DRI2 supported by DDX */
CARD8 dri2_minor;

View File

@ -30,9 +30,7 @@
* Kristian Høgsberg (krh@redhat.com)
*/
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include <dix-config.h>
#include <X11/X.h>
#include <X11/Xproto.h>
@ -52,9 +50,9 @@
#include "dri2int.h"
#include "protocol-versions.h"
/* The only xf86 includes */
#include "xf86Module.h"
#include "xf86Extensions.h"
/* For the static extension loader */
Bool noDRI2Extension = FALSE;
void DRI2ExtensionInit(void);
static int DRI2EventBase;

18
Xext/dri2/meson.build Normal file
View File

@ -0,0 +1,18 @@
srcs_dri2 = [
'dri2.c',
'dri2ext.c',
]
libxserver_dri2 = []
if build_dri2
libxserver_dri2 = static_library('xserver_dri2',
srcs_dri2,
include_directories: inc,
dependencies: [ common_dep, libdrm_dep ],
)
endif
if build_xorg
install_data('dri2.h', install_dir: xorgsdkdir)
endif

View File

@ -66,3 +66,4 @@ if build_xorg
endif
subdir('damage')
subdir('dri2')

View File

@ -22,7 +22,7 @@
#include <kdrive-config.h>
#include "fbdev.h"
#include "miext/extinit_priv.h"
#include "os/cmdline.h"
#include "os/ddx_priv.h"
@ -32,18 +32,6 @@ InitCard(char *name)
KdCardInfoAdd(&fbdevFuncs, 0);
}
static const ExtensionModule ephyrExtensions[] = {
#ifdef GLXEXT
{ GlxExtensionInit, "GLX", &noGlxExtension },
#endif
};
static
void ephyrExtensionInit(void)
{
LoadExtensionList(ephyrExtensions, ARRAY_SIZE(ephyrExtensions), TRUE);
}
#if INPUTTHREAD
/** This function is called in Xserver/os/inputthread.c when starting
the input thread. */
@ -56,7 +44,6 @@ ddxInputThreadInit(void)
void
InitOutput(int argc, char **argv)
{
ephyrExtensionInit();
KdInitOutput(argc, argv);
}

View File

@ -53,7 +53,6 @@
Bool noXFree86VidModeExtension = FALSE;
Bool noXFree86DGAExtension = FALSE;
Bool noXFree86DRIExtension = FALSE;
Bool noDRI2Extension = FALSE;
/*
* DDX-specific extensions.
@ -80,13 +79,6 @@ static const ExtensionModule extensionModules[] = {
&noXFree86DRIExtension
},
#endif
#ifdef DRI2
{
DRI2ExtensionInit,
DRI2_NAME,
&noDRI2Extension
}
#endif
};
static void

View File

@ -33,12 +33,6 @@ extern Bool noXFree86DRIExtension;
void XFree86DRIExtensionInit(void);
#endif
#ifdef DRI2
#include <X11/extensions/dri2proto.h>
extern Bool noDRI2Extension;
void DRI2ExtensionInit(void);
#endif
#ifdef XF86VIDMODE
#include <X11/extensions/xf86vmproto.h>
extern Bool noXFree86VidModeExtension;

View File

@ -1,16 +0,0 @@
srcs_xorg_dri2 = [
'dri2.c',
'dri2ext.c',
]
xorg_dri2 = static_library('xorg_dri2',
srcs_xorg_dri2,
include_directories: [inc, xorg_inc],
dependencies: [
common_dep,
libdrm_dep,
],
c_args: xorg_c_args,
)
install_data('dri2.h', install_dir: xorgsdkdir)

View File

@ -4,7 +4,6 @@ module_abi_dir = join_paths(module_dir, module_abi_tag)
xorg_inc = include_directories(
'common',
'ddc',
'dri2',
'i2c',
'int10',
'loader',
@ -33,9 +32,6 @@ subdir('ddc')
if build_dri1
subdir('dri')
endif
if build_dri2
subdir('dri2')
endif
subdir('i2c')
subdir('loader')
subdir('modes')
@ -76,9 +72,6 @@ xorg_link = [
if build_dri1
xorg_link += xorg_dri
endif
if build_dri2
xorg_link += xorg_dri2
endif
if host_machine.system() == 'cygwin' or host_machine.system() == 'windows'
linker_export_flags = '-Wl,--export-all-symbols'

View File

@ -649,6 +649,7 @@ common_dep = [
inc = include_directories(
'.',
'Xext',
'Xext/dri2',
'Xi',
'composite',
'exa',
@ -810,6 +811,7 @@ libxserver = [
libxserver_os,
]
libxserver += libxserver_dri2
libxserver += libxserver_dri3
if build_namespace

View File

@ -152,6 +152,9 @@ static const ExtensionModule staticExtensions[] = {
#ifdef PRESENT
{present_extension_init, "Present", NULL},
#endif
#ifdef DRI2
{DRI2ExtensionInit, DRI2_NAME, &noDRI2Extension},
#endif
#ifdef DRI3
{dri3_extension_init, "DRI3", NULL},
#endif

View File

@ -8,6 +8,12 @@
#include "extinit.h"
#ifdef DRI2
#include <X11/extensions/dri2proto.h>
extern Bool noDRI2Extension;
void DRI2ExtensionInit(void);
#endif
/* required by: the 470 and 390 nvidia DDX drivers */
extern _X_EXPORT Bool noDamageExtension;