xfree86: parser: drop obsolete / dead DRI section

The DRI section isn't used at all for aeons now - just been relevant
for DRI1, which is already gone for over a decade now. Thus no practical
need to carry non-functional remains of it for any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2026-08-05 16:48:28 +02:00 • committed by Enrico Weigelt
commit e01f6a678f
12 changed files with 4 additions and 199 deletions

View file

@ -139,7 +139,6 @@ static Bool configInput(InputInfoPtr pInfo, XF86ConfInputPtr conf_input,
static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display);
static Bool addDefaultModes(MonPtr monitorp);
static void configDRI(XF86ConfDRIPtr drip);
static void configExtensions(XF86ConfExtensionsPtr conf_ext);
/*
@ -2182,27 +2181,6 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active, Bool g
return TRUE;
}
static void
configDRI(XF86ConfDRIPtr drip)
{
struct group *grp;
xf86ConfigDRI.group = -1;
xf86ConfigDRI.mode = 0;
if (drip) {
if (drip->dri_group_name) {
if ((grp = getgrnam(drip->dri_group_name)))
xf86ConfigDRI.group = grp->gr_gid;
}
else {
if (drip->dri_group >= 0)
xf86ConfigDRI.group = drip->dri_group;
}
xf86ConfigDRI.mode = drip->dri_mode;
}
}
static void
configExtensions(XF86ConfExtensionsPtr conf_ext)
{
@ -2498,7 +2476,6 @@ xf86HandleConfigFile(Bool autoconfig)
/* Now process everything else */
configFiles(xf86configptr->conf_files);
configExtensions(xf86configptr->conf_extensions);
configDRI(xf86configptr->conf_dri);
checkInput(&xf86ConfigLayout, implicit_layout);

View file

@ -64,8 +64,6 @@ GDevPtr autoConfigDevice(GDevPtr preconf_device);
void xf86SetVerbosity(int verb);
void xf86SetLogVerbosity(int verb);
extern confDRIRec xf86ConfigDRI;
extern const char *xf86ConfigFile;
extern const char *xf86ConfigDir;

View file

@ -685,7 +685,7 @@ DoConfigure(void)
xf86config->conf_videoadaptor_lst = NULL;
xf86config->conf_modes_lst = NULL;
xf86config->conf_vendor_lst = NULL;
xf86config->conf_dri = NULL;
xf86config->padding0 = NULL;
xf86config->conf_input_lst = configureInputSection();
xf86config->conf_layout_lst = configureLayoutSection();

View file

@ -139,7 +139,6 @@ MessageType xf86LogFileFrom = X_DEFAULT;
MessageType xf86FontserverFrom = X_DEFAULT;
Bool xf86LogFileWasOpened = FALSE;
serverLayoutRec xf86ConfigLayout = { NULL, };
confDRIRec xf86ConfigDRI = { 0, };
XF86ConfigPtr xf86configptr = NULL;
Bool xf86Resetting = FALSE;

View file

@ -813,17 +813,9 @@ dri_drm_debug_print(const char *format, va_list ap)
return 0;
}
static void
dri_drm_get_perms(gid_t * group, mode_t * mode)
{
*group = xf86ConfigDRI.group;
*mode = xf86ConfigDRI.mode;
}
drmServerInfo DRIDRMServerInfo = {
dri_drm_debug_print,
xf86LoadKernelModule,
dri_drm_get_perms,
.debug_print = dri_drm_debug_print,
.load_module = xf86LoadKernelModule,
};
Bool

View file

@ -1,121 +0,0 @@
/* DRI.c -- DRI Section in XF86Config file
* Created: Fri Mar 19 08:40:22 1999 by faith@precisioninsight.com
* Revised: Thu Jun 17 16:08:05 1999 by faith@precisioninsight.com
*
* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*
*/
#include <xorg-config.h>
#include "os.h"
#include "xf86Parser.h"
#include "xf86tokens.h"
#include "Configint.h"
static const xf86ConfigSymTabRec DRITab[] = {
{ENDSECTION, "endsection"},
{GROUP, "group"},
{MODE, "mode"},
{-1, ""},
};
#define CLEANUP xf86freeDRI
XF86ConfDRIPtr
xf86parseDRISection(void)
{
int token;
parsePrologue(XF86ConfDRIPtr, XF86ConfDRIRec);
/* Zero is a valid value for this. */
ptr->dri_group = -1;
while ((token = xf86getToken(DRITab)) != ENDSECTION) {
switch (token) {
case GROUP:
if ((token = xf86getSubToken(&(ptr->dri_comment))) == XF86_TOKEN_STRING)
ptr->dri_group_name = xf86_lex_val.str;
else if (token == NUMBER)
ptr->dri_group = xf86_lex_val.num;
else
Error(GROUP_MSG);
break;
case MODE:
if (xf86getSubToken(&(ptr->dri_comment)) != NUMBER)
Error(NUMBER_MSG, "Mode");
if (xf86_lex_val.numType != PARSE_OCTAL)
Error(MUST_BE_OCTAL_MSG, xf86_lex_val.num);
ptr->dri_mode = xf86_lex_val.num;
break;
case EOF_TOKEN:
Error(UNEXPECTED_EOF_MSG);
break;
case COMMENT:
ptr->dri_comment = xf86addComment(ptr->dri_comment, xf86_lex_val.str);
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
break;
default:
Error(INVALID_KEYWORD_MSG, xf86tokenString());
break;
}
}
#ifdef DEBUG
ErrorF("DRI section parsed\n");
#endif
return ptr;
}
#undef CLEANUP
void
xf86printDRISection(FILE * cf, XF86ConfDRIPtr ptr)
{
if (ptr == NULL)
return;
fprintf(cf, "Section \"DRI\"\n");
if (ptr->dri_comment)
fprintf(cf, "%s", ptr->dri_comment);
if (ptr->dri_group_name)
fprintf(cf, "\tGroup \"%s\"\n", ptr->dri_group_name);
else if (ptr->dri_group >= 0)
fprintf(cf, "\tGroup %d\n", ptr->dri_group);
if (ptr->dri_mode)
fprintf(cf, "\tMode 0%o\n", ptr->dri_mode);
fprintf(cf, "EndSection\n\n");
}
void
xf86freeDRI(XF86ConfDRIPtr ptr)
{
if (ptr == NULL)
return;
TestFree(ptr->dri_comment);
free(ptr);
}

View file

@ -123,15 +123,6 @@ xf86setSection(const char *section);
int
xf86getStringToken(const xf86ConfigSymTabRec * tab);
/* write.c */
/* DRI.c */
XF86ConfDRIPtr
xf86parseDRISection(void);
void
xf86printDRISection(FILE * cf, XF86ConfDRIPtr ptr);
void
xf86freeDRI(XF86ConfDRIPtr ptr);
/* Extensions.c */
XF86ConfExtensionsPtr
xf86parseExtensionsSection(void);

View file

@ -16,7 +16,6 @@ srcs_xorg_parser = [
'read.c',
'scan.c',
'write.c',
'DRI.c',
'Extensions.c',
]

View file

@ -188,11 +188,6 @@ xf86readConfigFile(void)
HANDLE_LIST(conf_vendor_lst, xf86parseVendorSection,
XF86ConfVendorPtr);
}
else if (xf86nameCompare(xf86_lex_val.str, "dri") == 0) {
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
HANDLE_RETURN(conf_dri, xf86parseDRISection());
}
else if (xf86nameCompare(xf86_lex_val.str, "extensions") == 0) {
free(xf86_lex_val.str);
xf86_lex_val.str = NULL;
@ -300,7 +295,6 @@ xf86freeConfig(XF86ConfigPtr p)
xf86freeLayoutList(p->conf_layout_lst);
xf86freeInputList(p->conf_input_lst);
xf86freeVendorList(p->conf_vendor_lst);
xf86freeDRI(p->conf_dri);
xf86freeExtensions(p->conf_extensions);
TestFree(p->conf_comment);

View file

@ -108,8 +108,6 @@ doWriteConfigFile(const char *filename, XF86ConfigPtr cptr)
xf86printScreenSection(cf, cptr->conf_screen_lst);
xf86printDRISection(cf, cptr->conf_dri);
xf86printExtensionsSection(cf, cptr->conf_extensions);
fclose(cf);

View file

@ -424,13 +424,6 @@ typedef struct {
char *vnd_comment;
} XF86ConfVendorRec, *XF86ConfVendorPtr;
typedef struct {
const char *dri_group_name;
int dri_group;
int dri_mode;
char *dri_comment;
} XF86ConfDRIRec, *XF86ConfDRIPtr;
typedef struct {
XF86OptionPtr ext_option_lst;
char *extensions_comment;
@ -450,7 +443,7 @@ typedef struct {
XF86ConfOutputClassPtr conf_outputclass_lst;
XF86ConfLayoutPtr conf_layout_lst;
XF86ConfVendorPtr conf_vendor_lst;
XF86ConfDRIPtr conf_dri;
void *padding0;
XF86ConfExtensionsPtr conf_extensions;
char *conf_comment;
} XF86ConfigRec, *XF86ConfigPtr;

View file

@ -397,21 +397,6 @@ typedef struct _serverlayoutrec {
void *options;
} serverLayoutRec, *serverLayoutPtr;
typedef struct _confdribufferrec {
int count;
int size;
enum {
XF86DRI_WC_HINT = 0x0001 /* Placeholder: not implemented */
} flags;
} confDRIBufferRec, *confDRIBufferPtr;
typedef struct _confdrirec {
int group;
int mode;
int bufs_count;
confDRIBufferRec *bufs;
} confDRIRec, *confDRIPtr;
#define NUM_RESERVED_INTS 4
#define NUM_RESERVED_POINTERS 4
#define NUM_RESERVED_FUNCS 4