From e01f6a678fec8da2c31482e87fef3da2a90c0fdc Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 5 Aug 2026 16:48:28 +0200 Subject: [PATCH] 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 --- hw/xfree86/common/xf86Config.c | 23 ------ hw/xfree86/common/xf86Config.h | 2 - hw/xfree86/common/xf86Configure.c | 2 +- hw/xfree86/common/xf86Globals.c | 1 - hw/xfree86/dri/dri.c | 12 +-- hw/xfree86/parser/DRI.c | 121 ------------------------------ hw/xfree86/parser/configProcs.h | 9 --- hw/xfree86/parser/meson.build | 1 - hw/xfree86/parser/read.c | 6 -- hw/xfree86/parser/write.c | 2 - include/xf86Parser.h | 9 +-- include/xf86str.h | 15 ---- 12 files changed, 4 insertions(+), 199 deletions(-) delete mode 100644 hw/xfree86/parser/DRI.c diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index a3680cda96..dc97faa8a8 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -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); diff --git a/hw/xfree86/common/xf86Config.h b/hw/xfree86/common/xf86Config.h index 7618cfb6de..57eb306edf 100644 --- a/hw/xfree86/common/xf86Config.h +++ b/hw/xfree86/common/xf86Config.h @@ -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; diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index f040e1d5bf..68d750780f 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -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(); diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c index 3e309a5c59..1f49213089 100644 --- a/hw/xfree86/common/xf86Globals.c +++ b/hw/xfree86/common/xf86Globals.c @@ -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; diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index ff7c80acb7..8a2c46f899 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -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 diff --git a/hw/xfree86/parser/DRI.c b/hw/xfree86/parser/DRI.c deleted file mode 100644 index b5764a8aa6..0000000000 --- a/hw/xfree86/parser/DRI.c +++ /dev/null @@ -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 - -#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); -} diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h index d652fc8f3f..731add88e6 100644 --- a/hw/xfree86/parser/configProcs.h +++ b/hw/xfree86/parser/configProcs.h @@ -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); diff --git a/hw/xfree86/parser/meson.build b/hw/xfree86/parser/meson.build index 785369179b..5051d11269 100644 --- a/hw/xfree86/parser/meson.build +++ b/hw/xfree86/parser/meson.build @@ -16,7 +16,6 @@ srcs_xorg_parser = [ 'read.c', 'scan.c', 'write.c', - 'DRI.c', 'Extensions.c', ] diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c index 3ad9d7c196..9481bfb9a6 100644 --- a/hw/xfree86/parser/read.c +++ b/hw/xfree86/parser/read.c @@ -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); diff --git a/hw/xfree86/parser/write.c b/hw/xfree86/parser/write.c index 4adfa88dfc..34dfdfe419 100644 --- a/hw/xfree86/parser/write.c +++ b/hw/xfree86/parser/write.c @@ -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); diff --git a/include/xf86Parser.h b/include/xf86Parser.h index 8ffd2ba3cc..b4c33a3c37 100644 --- a/include/xf86Parser.h +++ b/include/xf86Parser.h @@ -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; diff --git a/include/xf86str.h b/include/xf86str.h index d62da94986..7841002666 100644 --- a/include/xf86str.h +++ b/include/xf86str.h @@ -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