Commit Graph

21704 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
12b003a975 dix: dixutils: fix signedness of numCallbackListsToCleanup
It's a counter and size value - we're getting lots of signedness warnings,
so use size_t instead of (signed) int.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-18 20:26:49 +02:00
Enrico Weigelt, metux IT consult
d244e8a097 include: pixmapstr.h: inline PixmapBox() and fix signedness
Not used anywhere else than just once in this header, so we can directly
inline it. Also adding explicit typecast to silence signedness warning.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-18 20:26:31 +02:00
Enrico Weigelt, metux IT consult
55140c469d dix: fix parameter types of SetClipRects()
Use the X11 protocol types where possible and fix signedness warnings.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-18 20:26:13 +02:00
b-aaz
679d1796c5 meson.build: Enable epoll-shim for DFBSD.
DragonFlyBSD also uses epoll-shim and it is necessary for DRI3.

Signed-off-by: b-aaz <b-aazbsd@proton.me>
2025-09-17 13:47:28 +02:00
Enrico Weigelt, metux IT consult
9e209798f1 Xext: panoramix: inline SProc*()'s
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:46:27 +02:00
Enrico Weigelt, metux IT consult
a040a93f59 Xi: inline SProcXChangeDeviceKeyMapping()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:43:47 +02:00
Enrico Weigelt, metux IT consult
1bc760156f dix: dix_priv.h: cast size sequenceNumber value
The X11 protocol defines the sequenceNumber reply fields as `CARD16`, but the
Xserver is traditionally sloppy and using just `int`. Need to explicitly cast,
in order to silence compiler warnings.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:37:53 +02:00
Enrico Weigelt, metux IT consult
37a17df4d5 include: misc.h: bytes_to_int32(): use CARD32 as return value
Callers usually need this value as CARD32 (the X11 protocol's native type
of the .length header field), so convert it here in order to reduce
unnecessary compiler warnings.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:37:43 +02:00
Enrico Weigelt, metux IT consult
f8950412e2 dix: rpcbuf: x_rpcbuf_write_counted_string_pad() silence size mismatch warning
strlen() returns an size_t, but the string lengths here is limited to 16bit,
so we need to explictly cast, in order to shut down compiler warning.
Strings longer than 64k really shouldn't ever happen.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:37:31 +02:00
Enrico Weigelt, metux IT consult
8439b00fd1 render: consolidate byte-swapping in ProcRenderComposite()
No need for extra functions and call tables for the few trivial lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:37:19 +02:00
Enrico Weigelt, metux IT consult
52ea21c7c2 render: consolidate byte-swapping in ProcRenderCreateAnimCursor()
No need for extra functions and call tables for the few trivial lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:37:01 +02:00
Enrico Weigelt, metux IT consult
141a96237f render: consolidate byte-swapping in ProcRenderQueryFilters()
No need for extra functions and call tables for the few trivial lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:36:32 +02:00
Enrico Weigelt, metux IT consult
70428787cd render: consolidate byte-swapping in ProcRenderCreateCursor()
No need for extra functions and call tables for the few trivial lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:36:18 +02:00
Enrico Weigelt, metux IT consult
24885d9019 render: consolidate byte-swapping in ProcRenderCreateGlyphSet()
No need for extra functions and call tables for the few trivial lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:36:06 +02:00
Enrico Weigelt, metux IT consult
fd4f402d12 render: consolidate byte-swapping in ProcRenderQueryPictIndexValues()
No need for extra functions and call tables for the few trivial lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:35:51 +02:00
Enrico Weigelt, metux IT consult
898251b461 xkb: ProcXkbGetKbdByName(): use return code of X_SEND_REPLY_WITH_RPCBUF()
The macro will automatically return BadAlloc if the buffer is broken,
otherwise Success. Thus, we don't need extra prior rpcbuf check.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:35:36 +02:00
Enrico Weigelt, metux IT consult
ce69e8a520 dix: fix ClientRec->numSaved to unsigned
this field is used a counter, thus should be unsigned, instead of having
dozens of signess warnings or adding casts to suppress them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-16 19:13:46 +02:00
Enrico Weigelt, metux IT consult
e55281e2a5 dix: ValidateGC(): fix serialNumber assignment
GC's serialNumber field is unsigned int, but DrawableRec's is unsigned long,
so we need to typecast.

It would be better if they all had the same type, but we can't change them easily,
as that might cause ABI break.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-16 14:38:21 +02:00
Enrico Weigelt, metux IT consult
a449d5950e dix: AllocARGBCursor(): make color parameters unsigned short
These values are assigned to `unsigned short` fields, and we're only
getting in smaller numbers that fit well into it. So fixing compiler
warning on type size mismatch by using short args.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-15 19:38:25 +02:00
Enrico Weigelt, metux IT consult
32f6ac7dbf dix: dix_priv.h: cast size value on WriteToClient() calls
We're trying to use size_t for sizes whereever possible, but WriteToClient()
is part of ABI, so we can't fix it's parameter types - need to explicitly
cast, in order to silence the compiler warnings.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-15 19:04:44 +02:00
b-aaz
1271a098e6 .github: Added DragonFlyBSD to CI.
Added DragonFlyBSD to CI, based on the FreeBSD build.

Signed-off-by: b-aaz <b-aazbsd@proton.me>
2025-09-15 16:24:07 +02:00
Enrico Weigelt, metux IT consult
5d9cfd981e dri3: fix warning on incompatible int32 pointer types
on PPC/Gentoo:

> ../xlibre-server-9999/dri3/dri3_request.c: In function 'proc_dri3_buffers_from_pixmap':
> ../xlibre-server-9999/dri3/dri3_request.c:518:37: error: passing argument 2 of 'x_rpcbuf_write_CARD32s' from incompatible pointer type [-Wincompatible-pointer-types]
>   518 |     x_rpcbuf_write_CARD32s(&rpcbuf, strides, num_fds);
>       |                                     ^~~~~~~
>       |                                     |
>      |                                     uint32_t * {aka unsigned int *}

See: https://github.com/X11Libre/xserver/issues/1042
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-15 16:19:36 +02:00
Enrico Weigelt, metux IT consult
03b2e9d1ad Xext: xv: suppress false alarm on unused typedef
> In file included from ../Xext/xvdisp.c:33:
> ../Xext/xvdisp.c: In function ‘ProcXvQueryImageAttributes’:
> ../Xext/xvdisp.c:768:19: warning: typedef ‘int_size_wrong_’ locally defined but not used [-Wunused-local-typedefs]
>  768 |     __size_assert(int, sizeof(INT32));
>      |                   ^~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-15 16:17:26 +02:00
Enrico Weigelt, metux IT consult
d7e7d2c142 meson.build: add -Wincompatible-pointer-types
Add some more compiler warning type.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-15 16:16:39 +02:00
stefan11111
ccc81e1b14 fbdevhw: Print a better error message
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-15 15:53:03 +02:00
stefan11111
4296a31161 fbdevhw: document the FRAMEBUFFER envvar
Follow-up after https://github.com/X11Libre/xserver/pull/399

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-15 15:53:03 +02:00
stefan11111
e432e4a8b0 fbdevhw: Use more consistent naming
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-15 15:53:03 +02:00
stefan11111
da8a57809e fbdevhw: don't reject pci devices on the fallback probe
Now that we know the root couse of what this code tried to fix,
we can safely remove it.

Fixes: https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev/-/issues/9
Fixes: fc78bcca21
Fixes: a8e41a8190
Fixes: 728b54528d
Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1798
Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1826

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-15 15:53:03 +02:00
Enrico Weigelt, metux IT consult
cf50d3b37b .github: purge workflows on deleted branches
No need to keep workflows on already deleted branches, so purge them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-15 14:08:09 +02:00
stefan11111
dbfd395b28 Xext: add __size_assert in xvdisp.c
See: https://github.com/X11Libre/xserver/pull/1021
See: https://github.com/X11Libre/xserver/issues/706

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-15 13:39:03 +02:00
Enrico Weigelt, metux IT consult
765d0de418 xfree86: dri: ProcXF86DRIGetDrawableInfo() use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly and X_SEND_REPLY_WITH_RPCBUF()
for sending it all out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-15 11:28:34 +02:00
stefan11111
fd3af5fc7a Xext: Fix type mismatch in xvdisp.c
Fixes: https://github.com/X11Libre/xserver/issues/706

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-15 11:23:48 +02:00
Enrico Weigelt, metux IT consult
eb9a9e0708 xkb: ProcXkbGetKbdByName(): rename child buffers to childbuf
rename them to indicate that they're not the global payload buffer,
but temporary childs for sub-replies.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-15 11:20:36 +02:00
stefan11111
d09b3dae3e hw/xfree86/common: remove {fb,platform,pci,sbus}SlotClaimed
These were global variables that were tracking how many
slots of one kind were claimed by drivers,
or if slots of one kind were claimed by drivers.

There were used inconsistently, sometimes they were `int`'s,
sometimes they were `Bool`'s.

All they were doing was to kill the server in various circumstances,
that were often incorrect and lead to bug reports, and guard against
a very speciffic kind of driver code error in `xf86ClaimFbSlot`,
that was also prone to false-positives.

Now that both these uses were removed,
these globals are no longer used, so we can remove them.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-15 11:19:20 +02:00
stefan11111
d3fd8c385b hw/xfree86/common: remove broken checks from xf86ClaimFbSlot
The intent of both these checks, I assume,
is that drivers don't claim 2 slots at once (fb, pci, plarform).
If we actually want to implement checking like this,
we would have to put a {fb,pci,platform}SlotClaimed in each driver struct.
We could definitely do that, but it seems weird
to single out this error to protect against.
By design, drivers are able to execute arbitrary code.
Nothing is stopping them from doing `*(volatile char*)0=0;`
in preinit or in one of the probes.

If we do decide to keep these checks, we have to be careful of corner cases.
What happens if a driver is used with multiple cards, one pci one not?
We could also keep track of how many slots a driver claims,
and reject any further claims after the count reaches 1.
We would still have to make that counter per driver and per card.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-15 11:19:20 +02:00
stefan11111
22d963bc4d hw/xfree86/common: remove xf86PostProbe
A long time ago, this function used to initialize
various screen resources.
Now, this function just kills the X server in various circumstances
for no good reason.

Fixes: fc78bcca21
Fixes: 728b54528d
Fixes: https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev/-/issues/9
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-15 11:19:20 +02:00
Enrico Weigelt, metux IT consult
f8973ffc2e .github: use our own mirrors of build dependencies
f.d.o is failing too often in recent times, so switching to our
own mirrors at github.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-15 11:13:22 +02:00
sesankm
71d0f66365 xkb: XKBMisc: use C99 declarations in XkbApplyCompatMapToKey
Signed-off-by: sesankm <26676400+sesankm@users.noreply.github.com>
2025-09-15 10:47:40 +02:00
b-aaz
52a357dbf3 xfree86: os-support: Deal with DFBSD correctly.
In DragonFlyBSD the host_machine.system() variable is set to 'dragonfly' and does not end with 'bsd'. Changed a check to correctly detect 'dragonfly' as a member of BSD OSs.

bsd/bsd_kmod.c is used for dealing with kernel modules on FreeBSD, enabled this file for DragonFlyBSD too, because they both have the same APIs in this context.

Signed-off-by: b-aaz <b-aazbsd@proton.me>
2025-09-15 10:27:07 +02:00
stefan11111
77b396d09b include: update comment about exported noPanoramiXExtension
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-15 10:26:11 +02:00
stefan11111
b11c28b13e modesetting: handle pitch when painting the hardware cursor
The cursor pitch can depend on crtc.

Since we only use the sizes reported by SIZE_HINTS,
we can allocate a small cache for pitches in each crtc.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-15 09:06:52 +02:00
Enrico Weigelt, metux IT consult
56c4d68140 treewide: drop ScreenInfoPtr parameter from InitOutput()
Nobody's using this pointer anymore, everybody's using the global
screenInfo structure.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 19:49:23 +02:00
sesankm
16d6182e15 glx: glxcmds: use rpcbuf for payload in __glXDisp_QueryExtensionsString
Signed-off-by: sesankm <26676400+sesankm@users.noreply.github.com>
2025-09-12 19:36:21 +02:00
sesankm
5a0b736952 dix: rpcbuf: exporting x_rpcbuf_write_string_0t_pad for glx
Signed-off-by: sesankm <26676400+sesankm@users.noreply.github.com>
2025-09-12 19:36:21 +02:00
Enrico Weigelt, metux IT consult
d1bec2b2c0 dbe: inline SProc*()'s
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 19:33:57 +02:00
Enrico Weigelt, metux IT consult
a1522644ff Xext: vidmode: inline SProc*()'s
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 15:37:25 +02:00
Enrico Weigelt, metux IT consult
4f65d06116 os: replace GenerateRandomData() by custom arc4random_buf() on platforms that missing it
arc4random_buf() is a pretty standard libc function on Unix'oid platforms,
but not all our targets have it, thus we need a fallback there. Currently we
have GenerateRandomData(), which either just wraps arc4random_buf() or provides
some fallback implementation.

For those cases it's easier to just implement missing functions directly
instead of having custom wrapper functions. So, drop GenerateRandomData()
in favor of arc4random_buf() and provide fallback implementation for where
it is missing.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 15:37:13 +02:00
Enrico Weigelt, metux IT consult
f503962970 render: consolidate duplicate Proc* functions
dropping lots of duplicate functions which are doing the same like others.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 15:30:07 +02:00
Enrico Weigelt, metux IT consult
358f76f2ad treewide: fix misleading firstScreen variable naming to masterScreen
Follow-up on renaming dixGetFirstScreenPtr() to dixGetMasterScreen():
also rename the target variables for correct technical terminology.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 11:44:05 +02:00
Enrico Weigelt, metux IT consult
b0ffa7b286 treewide: rename dixGetFirstScreenPtr() to dixGetMasterScreen() for correct semantics
In Xinerama/Panoramix configuration there's one screen that's having special
meaning - it's used for simulating as the frontend for all client operations:
the clients (should) only talk to that screen, while panoramix subsystem is
proxying those operations to all the other screens (with certain changed
applied, eg. coordinate transformations).

Historically, this screen happens to be the first one in the system (some of
it's proc's are hooked up in order to achieve desired behaviour). That's why it
used to be accessed via screenInfo.screens[0] - that already had been encapsulated
into a tiny helper `dixGetFirstScreen()`.

a) the correct terminus technicus for a situation where one device (or SW entity)
   entirely controlling others is a master-slave-relationship: the controlling
   device/entity is `master`, the controlled ones are `slave` (to that specific
   master).

b) the term "first screen" is inacurate and misleading here: what the caller's are
   actually interest in isn't the first entry in the screen array, but the screen
   that's controlling the others. With upcoming refactoring of the Xinerama/Panoramix
   subsystem, this might well be a different array index than 0.

c) the term `default` also wouldn't match: `default` implies there's a real practical
   choice, and such value applies when no explicit choice has been made. But in this
   case, it practically doesn't make sense (except perhaps for debugging purpose)
   for a client to use any different screen.

Therefore fixing the function name to the correct technical terminology.
(for sake of patch readability, renaming corresponding variables is left to
subsequent patches).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 11:44:05 +02:00