Previously, when parsing multiple configuration files containing the same
section names, only the last occurrence of each section would be retained.
Earlier definitions were silently discarded due to unconditional memory
allocation and overwriting of pointers during parsing.
This resulted in incomplete or incorrect configuration state when users
intended to merge or extend configuration through multiple files.
The section parsing functions in Files.c, Flags.c, and Module.c now
accept existing section pointers. These functions allocate new memory only
if the input pointer is NULL, preserving earlier data when re-parsing.
read.c has been updated to detect and pass existing section pointers when
encountering duplicate sections across files, preventing loss of prior content.
With these changes, the parser properly accumulates and merges configuration
data across multiple files, ensuring that all relevant settings are preserved.
Backport from Xorg.
References:
https://gitlab.freedesktop.org/xorg/xserver/-/issues/467https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2045Fixes: #279
Signed-off-by: callmetango <callmetango@users.noreply.github.com>
Both are potentially tunable variables, and MAXCLIENTS is (still) used by
intel-driver, but also by os specific parts that must not include misc.h
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit changes legacy behavior, if anyone was relying on it,
they can make an issue and we can change it back.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
if the framebuffer device was passed by the user and not guessed
Assume the user knows what they are doing if they tell us to
use a particular framebuffer device, and skip the checks we
have for guessed devices
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
The fbdev pci probe doesn't use the fbdev passed by the user,
and instead tries to guess what framebuffer the user wants to use.
Only if that fails, fbdev falls back to the option passed by the user.
This is backwards, if the user explicitly passes a framebuffer
device to use, the X server should use that, and fall back on
guessing if that fails.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
The 'mode' argument for open() is only used when files
are created, and files aren't created here.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
In preparation of potentially more drivers being move in-tree,
put the input drivers into `input` subdirectory.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
In preparation of potentially more drivers being move in-tree,
put the video drivers into `video` subdirectory.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
And OS/platform callback by which individual server implementations
can extra event polling, eg. device IO.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
New OS/platform callbacks that are called when screens are enabled
or disabled. This allows individual Kdrive implementations to take
specific action, eg. configure/reset graphics hardware.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
For better code structuring, move the meson logic for drivers into the
drivers/ subdir.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
No need to have extra check for whether the Atom already exists,
just create it on demand.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
These are always enablde (x11_t is defined when XSERV_t is defined),
so no need for the #ifdef's anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Not supposed to be written to (once the pointer is assigned),
so should be marked const. Also document KdOsInit()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
These will be used by subsequent commits for generic Kdrive
functions calling back into the OS specific parts
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Kdrive X servers used to do the OS-speciffic init part using KdOsInit.
This was changed in modern Xorg because Xephyr is the only kdrive
X server there, so there was no need to keep this generic.
Since we want to eventually add Xfbdev, we need to add this back.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Some display drivers might cause p->atoms to be null if the display is
disabled. This will cause segfault when checking
if p->atoms[0] != property .
Some display drivers owned by qualcomm is known to cause this bug.
Signed-off-by: fish4terrisa-MSDSM <flyingfish.msdsm@gmail.com>
This symbol is always defined, and the header is always present,
so no need to check for it.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Directly calling abort() doesn't print a stack trace, nor any useful message.
Instead FatalError() should be used in cases, where there's really no other
way than terminating the Xserver. The FatalError function also tries to make
a smooth shutdown (eg. resetting video mode), so console doesn't end up locked.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The passed name buffer isn't changed by those functions ever
(it would be a bug if they did so), therefore it should be const.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>