Commit Graph

20894 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
bdf867ba60 glamor: use NULL instead of NullClient
No need to have another name for NULL, we can use NULL directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 22:24:55 +02:00
Enrico Weigelt, metux IT consult
a15370629a xfixes: use NULL instead of NullClient
No need to have another name for NULL, we can use NULL directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 22:24:55 +02:00
Enrico Weigelt, metux IT consult
e575fb0f1a render: use NULL instead of NullClient
No need to have another name for NULL, we can use NULL directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 22:24:55 +02:00
Enrico Weigelt, metux IT consult
181e63f46e composite: use NULL instead of NullClient
No need to have another name for NULL, we can use NULL directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 22:24:55 +02:00
Enrico Weigelt, metux IT consult
e1d5d60848 fb: use NULL instead of NullClient
No need to have another name for NULL, we can use NULL directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 22:24:55 +02:00
Enrico Weigelt, metux IT consult
007155ba97 dbe: use NULL instead of NullClient
No need to have another name for NULL, we can use NULL directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 22:24:55 +02:00
Enrico Weigelt, metux IT consult
cc289d21ce Xi: use NULL instead of NullClient
No need to have another name for NULL, we can use NULL directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 22:24:55 +02:00
Enrico Weigelt, metux IT consult
e3547224a8 Xext: use NULL instead of NullClient
No need to have another name for NULL, we can use NULL directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 22:24:55 +02:00
Enrico Weigelt, metux IT consult
1d1ae20e75 xwin: use NULL instead of NullClient
No need to have another name for NULL, we can use NULL directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 22:24:55 +02:00
Enrico Weigelt, metux IT consult
1975ae8a5f kdrive: use NULL instead of NullClient
No need to have another name for NULL, we can use NULL directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 22:24:55 +02:00
Enrico Weigelt, metux IT consult
07eb361846 dix: use NULL instead of NullClient
No need to have another name for NULL, we can use NULL directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 22:24:55 +02:00
Enrico Weigelt, metux IT consult
e3acb2454c include: drop obsolete WriteReplyToClient() macro
Not used anymore, and not part of ABI, so no need to keep it around
any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 05:25:56 +02:00
Enrico Weigelt, metux IT consult
43e8b77d2b compext: declare variables when needed
The code is easier to understand if variables are declared when
they're needed first.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 05:25:41 +02:00
Enrico Weigelt, metux IT consult
8222ad2cfa dix: rpcbuf: add x_rpcbuf_write_string_0t_pad()
The existing x_rpcbuf_write_string() function is just writing the string w/o
trailing zero. It's for cases where the string length is known by other means
(eg. some header field). In cases where we also need the trailing zero written
(eg. when sending lists of strings) this isn't sufficient.

Thus introducing another variant of this function, which is always writing
a leading zero. Using this one, the string's characters will be followed
by 1, 2 or 3 zeros (and also be 32bit aligned)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:31 +02:00
Enrico Weigelt, metux IT consult
89f22ea07e bigreq: declare reply struct where needed
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:31 +02:00
Enrico Weigelt, metux IT consult
4efe7768f1 dix: rpcbuf: flag for auto-clear in error case
when the err_clear flag is set, the buffer memory will automatically
be free()ed when allocation failed. This allows simplificatoin of
caller's error pathes: the caller doesn't need to to call x_rpcbuf_clear()
anymore and eg. can directly return out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:31 +02:00
Enrico Weigelt, metux IT consult
d90620f363 dix: rpcbuf: store allocation failure
Remember allocation failure in new `error` field, for easing error
handling in complex callers: those now don't need to check each single
return value, but can (try to) continue their normal operation and
check for error condition later.

For example we can turn this:

     for (....) {
        if (!x_rpcbuf_write_CARD16(&rpcbuf,...)) {
            [ various cleanups ]
            return BadAlloc;
        }
        if (!rpcbuf_write_CARD8s(&rpcbuf,...)) {
            [ various cleanups ]
            return BadAlloc;
        }
        [ more of this ]
    }
    ...

Into:

     for (....) {
        x_rpcbuf_write_CARD16(&rpcbuf,...));
        x_rpcbuf_write_CARD8s(&rpcbuf,...));
        [ more of this ]
    }
    ...

    if (&rpcbuf->error) {
        [ various cleanups ]
        return BadAlloc;
    }

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:31 +02:00
Enrico Weigelt, metux IT consult
7ed470c882 dix: add buffer helper for rpc payload assembly
Since so many request handlers have to assemble complex reply payloads,
we've got a lot complexity on counting the needed space and filling in
the data into the right places.

Thus adding a little dynamic buffer structure, where one just can append
data arbitrarily. The buffer will automatically allocate memory as-needed
and finally leave everything in a big memory block for later write-out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:31 +02:00
Enrico Weigelt, metux IT consult
e3ef0bd5c3 os: osdep.h: drop using HAVE_DIX_CONFIG_H
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>
2025-07-18 04:51:31 +02:00
Dudemanguy
eaf77db9a4 randr: set initial DPI property to a default value for all outputs
X has various ways to deal with DPI but all of the current methods have
some drawback (single global value, manually calculating from physical
dimensions, etc.) What is lacking is a simple value per output that
users and applications can use to communicate desired scaling values.
Fortunately, a generic output property mechanism already exists. And
they already send events whenever there is a change. So all we have to
do is make an "official" property for people to agree on and enshrine
it. In that case, all outputs can just always have the DPI property set
to something. In most cases, this will be 96 (the default), but one
could use the -dpi argument when launching or and that value will be
used instead. The intention is that 96 is the base that is equivalent to
1x scaling. i.e. 192 would be 2x, 144 would be 1.5x and so on. xrandr or
any other utility can modify this property at any time and applications
can choose to use the number in a way that makes sense.

Closes #208. Credit to @dec05eba for essentially coming up with the idea
of using output properties.

Signed-off-by: Dudemanguy <random342@airmail.cc>
2025-07-18 04:51:31 +02:00
stefan11111
daeb288bd9 glamor: Enable dma-buf on nvidia
Nvidia needs dma-buf for glamor acceleration to work
when using the modesetting ddx driver.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-18 04:51:31 +02:00
stefan11111
dd23f1aaf6 glamor: Use EGL_LINUX_DMA_BUF_EXT to create GBM bo EGLImages
Port https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/751
to xlibre

Fixes glamor with modesetting on nvidia

This is needed for glamor to work with modesetting
on nvidia, according to the nvidia docs:
https://download.nvidia.com/XFree86/Linux-x86_64/510.39.01/README/gbm.html

From the mr above:

The X server was passing GBM bos directly to
eglCreateImageKHR using the EGL_NATIVE_PIXMAP_KHR
target. Given the EGL GBM platform spec claims it
is invalid to create a EGLSurface from a native
pixmap on the GBM platform, implying there is no
mapping between GBM objects and EGL's concept of
native pixmaps, this seems a bit questionable.

This change modifies the bo import function to
extract all the required data from the bo and then
imports it as a dma-buf instead when the dma-buf +
modifiers path is available.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-18 04:51:30 +02:00
Enrico Weigelt, metux IT consult
16ef34a41c dix: inpututils_priv.h: clean up guard
Give the guard a more unique name.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:30 +02:00
Enrico Weigelt, metux IT consult
d2093e0cb7 dix: inpututils_priv.h: drop unneeded extern
function prototypes are by default always extern, so no need for
that extra qualifier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:30 +02:00
Enrico Weigelt, metux IT consult
550151d598 dix: inpututils_priv.h: drop HAVE_DIX_CONFIG_H check
It's always defined, so no need to check for it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:30 +02:00
Enrico Weigelt, metux IT consult
030745a0e7 dix: move inpututils.h and rename it to inpututil_privs.h
it's a private header, thus should not be in public include directory.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:30 +02:00
Enrico Weigelt, metux IT consult
ce89617074 os: move probes.h and rename it to probes_priv.h
Private headers should not be in public include directory.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:30 +02:00
Enrico Weigelt, metux IT consult
af38d5881b glx: drop including dix-config.h from internal includes
The consumers always need to include <dix-config.h> at the very top
anyways, so no need to also include it (with extra guards) from
internal headers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:30 +02:00
Enrico Weigelt, metux IT consult
acddffefcb config: drop using HAVE_DIX_CONFIG_H
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>
2025-07-18 04:51:30 +02:00
Enrico Weigelt, metux IT consult
cd1041d7ac fb: fbbits.h: no need to include dix-config.h here
All in-tree consumers already need to include dix-config.h on the very
top anyways, and there are no out-of-tree consumers (private to fb subsys)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:30 +02:00
Enrico Weigelt, metux IT consult
16030f7d9e fb: fbpict.h: no need to include dix-config.h here
All in-tree consumers already need to include dix-config.h on the very
top anyways, and out-of-tree consumers don't have that include at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:30 +02:00
Enrico Weigelt, metux IT consult
eb0ded42ef glamor: glamor.h: don't need to include fbpict.h
This header doesn't need anything from fbpict.h, so no need to
include it here.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:30 +02:00
stefan11111
e89fd17340 kdrive: constitfy kdOsFuncs & document KdOsInit()
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>
2025-07-18 04:51:30 +02:00
stefan11111
512fd49def kdrive: ephyr: initialize OS specific callback vectors
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>
2025-07-18 04:51:30 +02:00
stefan11111
d0a7d42090 kdrive: add KdOsInit
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>
2025-07-18 04:51:30 +02:00
Enrico Weigelt, metux IT consult
36125623fd modesetting: fix skipping on empty properties in drmmode_output_set_property()
We actually need to skip the entry if p->atoms is NULL.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:46:57 +02:00
Enrico Weigelt, metux IT consult
352fb8ad85 vidmode: fix ProcVidModeGetDotClocks() reply size computation
A clock entry is 32 bits instead of 8 bits long.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 01:59:17 +02:00
Enrico Weigelt, metux IT consult
90bfeca905 Xi: drop unused variable and NULL free in ProcXISelectEvents()
The `types` variable is never used, just assigned NULL - and that NULL
value is passed to free(). This code is really doing nothing, never did so
since introduced in 2009.

Fixes: 8b6a370058
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-14 20:26:57 +02:00
Enrico Weigelt, metux IT consult
c54d8b1b34 minor release 25.0.0.5
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
xlibre-xserver-25.0.0.5
2025-07-11 17:52:07 +02:00
Enrico Weigelt, metux IT consult
d6225de192 .gitlab: merge release into xserver-build workflow
Not neccessary to have entirely separate workflow for it - that's
just spamming the workflow list.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-11 17:35:46 +02:00
fish4terrisa-MSDSM
c754162a36 modesetting: ignore the drmmode if p->atoms is null
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>
2025-07-11 17:14:07 +02:00
Enrico Weigelt, metux IT consult
cdd81c2744 meson.build: add -Woverride-init
enable override-init warning to catch some more bugs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-11 15:51:39 +02:00
Enrico Weigelt, metux IT consult
fdafb087d8 dix: fix SetPointerMapping reply success code on busy
If ApplyPointerMapping() returns `MappingBusy`, this value needs to be
returned in the `success` reply field. On `Success` the returned value
needs to be `MappingSuccess`.

Closes: https://github.com/X11Libre/xserver/issues/353
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-11 15:51:39 +02:00
Enrico Weigelt, metux IT consult
c5d5e8908d .github: drop obsolete xwayland dependencies
Since Xwayland is long gone, we don't need to install it's build-time
dependencies anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-09 14:09:01 +02:00
Enrico Weigelt, metux IT consult
d3c32cdfa8 Xi: fix wrong assertion in RetrieveTouchDeliveryData()
The assert(iclients) was in a place where the iclients variable could
not have been initialized ever - the first assignment is done *after* that.
Since we already have a BUG_RETURN_VAL() right be before it's actually
dereferenced, there's no need for that assert() at all - so drop it.

See https://github.com/X11Libre/xserver/issues/330

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-09 13:58:31 +02:00
Enrico Weigelt, metux IT consult
939ba0803c .github: add workflow for github releases
when tag xlibre-xserver-* is pushed, automatically create a github release.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-09 13:57:53 +02:00
Enrico Weigelt, metux IT consult
bab9362335 miext: damage: document DamageScreenFuncsRec
This struct (and associated functions) needs to be part of public driver ABI,
so video drivers can get notifications on damage certain operations, but
there hasn't been any documentation on it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-08 17:47:24 +02:00
Enrico Weigelt, metux IT consult
dfcfdd67a6 xquartz: drop using HAVE_DIX_CONFIG_H
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>
2025-07-08 17:43:07 +02:00
Enrico Weigelt, metux IT consult
2c50fedc2d xfree86: inputtest: use FatalError() instead of abort()
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>
2025-07-08 15:56:06 +02:00
stefan11111
c4df9ecdc5 kdrive: add documenation for mouse arguments
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-07-08 13:13:20 +02:00