Commit Graph

21726 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
9856372932 dix: add callback before ClientRec is being destroyed
Existing client-state hook isn't sufficient for this, and so easy to
be extended cleanly (*1). Adding a new callback is trivial and cheap,
so preferring this way, instead of trying to tweak the existing hook
for something it's never been designed for.

*1) see discussion here: https://github.com/X11Libre/xserver/pull/1077

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-22 12:15:31 +02:00
Enrico Weigelt, metux IT consult
4486a554f8 dbe: Xi: use return value of X_SEND_REPLY_SIMPLE()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-22 12:14:12 +02:00
Enrico Weigelt, metux IT consult
5720e3d375 randr: Xi: use return value of X_SEND_REPLY_SIMPLE()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-22 12:13:58 +02:00
Enrico Weigelt, metux IT consult
e4e99bff2d compext: Xi: use return value of X_SEND_REPLY_SIMPLE()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-22 12:13:43 +02:00
Enrico Weigelt, metux IT consult
a6f629cbaa Xext: Xi: use return value of X_SEND_REPLY_SIMPLE()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-22 12:13:27 +02:00
stefan11111
a4d08427cf Xext: composite: xfixes: Fix warnings when building with -Dxinerama=false
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-22 12:12:48 +02:00
stefan11111
0cfe43853e os: hw/xfree86/x86emu: Silence warnings on gcc
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-22 12:12:48 +02:00
Enrico Weigelt, metux IT consult
a6b880a368 dix: Xi: use return value of X_SEND_REPLY_SIMPLE()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-22 12:06:04 +02:00
Enrico Weigelt, metux IT consult
05b832e8b2 dri3: Xi: use return value of X_SEND_REPLY_SIMPLE()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-22 12:05:52 +02:00
Enrico Weigelt, metux IT consult
809b0a7999 glx: Xi: use return value of X_SEND_REPLY_SIMPLE()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-22 12:05:39 +02:00
stefan11111
5943ca5a1d os: Fix builds with -Dxdmcp=false
Fixes: https://github.com/X11Libre/xserver/issues/239
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-22 12:00:14 +02:00
stefan11111
f252e04a78 fbdevhw: Restore accel flags when unmapping mmio
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-22 11:57:41 +02:00
stefan11111
e3aff38742 fbdevhw: Fix -Wunused-result warning in fbdev_open_pci
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-22 11:57:41 +02:00
sesankm
22a51912d1 glx: vndcmds: save unecessary calls to clear current context for same vendor
Signed-off-by: sesankm <26676400+sesankm@users.noreply.github.com>
2025-09-22 11:26:53 +02:00
callmetango
dc390bf006 README.md: update XLibre Test Drivers link
Changed the XLibre Test Drivers link from the discussion of the idea
to the real wiki page. Fixed two typos as well.

Fixes: X11Libre/misc#353
Signed-off-by: callmetango <callmetango@users.noreply.github.com>
2025-09-22 11:25:37 +02:00
stefan11111
4b54da3fc6 fbdevhw: handle 2 digit framebuffer devices in the fallback probe
According to linux's Documentation/admin-guide/devices.txt,
framebuffers are named /dev/fb[0-31].
As such, we have to handle 2 digit numbers in framebuffer devices.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-19 14:03:30 +02:00
stefan11111
698d8a631a fbdevhw: Only accept framebuffers that match the passed pci device in the pci probe
The pci probe was broken already, lots of pci devices were not detected as such.
Since fixing it properly required a bit of extra code complexity,
and those devices would be detected on the fallback probe, I didn't
bother fixing it untill now.

However, there is another problem created by this.
The pci probe was accepting the device passed by the user without
doing any checks on it.
This means that in multi-card setups, fbdevhw might claim the
wrong pci slot.
Fixing this requires fixing the pci probe in order to try and determine
whether the device passed by the user is the same as the pci device
passed to the pci probe.

This commit fixes the pci probe.
If no device is passed by the user, the probe finds a pci framebuffer device.
If a device is passed, the pci probe only return TRUE if the pci device
passed to it is the same as the device passed by the user.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-19 14:03:30 +02:00
stefan11111
c6d39ecc3f fbdevhw: Use a wrapper around open()
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-19 14:03:30 +02:00
Enrico Weigelt, metux IT consult
d1deec0008 xfree86: platform bus: move raw device list to internal header
These xf86_num_platform_devices and xf86_platform_devices fields aren't
_X_EXPORTED, so no drivers can use them - and none are trying so.

Thus move them to internal / non-sdk header.

Not an ABI change.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-19 14:02:30 +02:00
stefan11111
74102a1126 modesetting: Only paint as much of the cursor image as needed
We often use very large cursor sizes, compared to the sizes of the
curor glyphs, e.g. 64x64 cursors and 16x16 or smaller glyphs.

This patch makes is so that we only paint the size of the new
cursor glyph and clear the old one if needed, instead of painting
the entire cursor buffer, which is often far larger than the glyphs.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-19 14:02:03 +02:00
stefan11111
460c5b7d6c modesetting: fix edge cases in cursor size calculations
Split from https://github.com/X11Libre/xserver/pull/840

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-09-19 14:01:04 +02:00
Enrico Weigelt, metux IT consult
4edc5ceaf7 dix: dixutils: fix signedness of numHandlers and sizeHandlers
These are used as counters / sizes, and we're getting lots of warnings
on signedness mismatches. So use size_t instead of (signed) int here.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-18 20:27:02 +02:00
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