Commit Graph

22057 Commits

Author SHA1 Message Date
stefan11111
8b8cde2cb2 modesetting: add "CursorSize" option
On certain setups, it might still be useful to force a particular cursor
size via xorg.conf.
For example, if on a system the automatic probes fail, or if the user wants
a particular cursor size, that is higher that the minimum size.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-10-21 16:12:46 +02:00
stefan11111
cf092cd469 modesetting: probe using the old method if SIZE_HINTS isn't available
On most cards, SIZE_HINTS isn't available.
Without this, most users would have to set the fallback cursor size themselves,
or rely on the 64x64 default.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-10-21 16:12:46 +02:00
stefan11111
6f7731c44c modesetting: Fix cursor buffer not getting cleared when the pitch changes.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-10-21 16:12:46 +02:00
Enrico Weigelt, metux IT consult
db5062c041 xkb: variable cleanup in SetUpRemap()
declare variables where necessary.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-21 14:27:33 +02:00
Enrico Weigelt, metux IT consult
fb5274d7ac render: consolidate byte-swapping in ProcRenderFillRectangles()
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-10-21 14:17:56 +02:00
stefan11111
7e8d887085 CI: Build Xfbdev on linux CI, and only on linux CI
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-10-21 14:13:21 +02:00
Enrico Weigelt, metux IT consult
a2068d6662 Xext: shm: drop obsolete ShmScreenClose()
Since it's now doing nothing more than unhooking itself, we really
don't need it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-21 13:53:41 +02:00
Alan Coopersmith
37226395ad Xi: set value for led_values in CopySwapKbdFeedback()
(The existing setting of led_mask is probably wrong, but has been set
 like this since X11R5 and going back as far as the first version in
 the X Consortium source control archives.)

Reported in https://gitlab.freedesktop.org/xorg/xserver/-/issues/1817:

xwayland-24.1.6/redhat-linux-build/../Xi/getfctl.c:108:9:
 warning[-Wanalyzer-use-of-uninitialized-value]:
 use of uninitialized value ‘*k2.led_values’
108|->         swapl(&k2->led_values);

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2075>
2025-10-21 13:02:04 +02:00
Alan Coopersmith
e26cad2421 Xi: avoid null dereference if wOtherInputMasks() returns NULL
The wOtherInputMasks(win) macro will return NULL if
win->optional is NULL.

Reported in https://gitlab.freedesktop.org/xorg/xserver/-/issues/1817:

xwayland-24.1.6/redhat-linux-build/../Xi/exevents.c:1390:13:
 warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’

xwayland-24.1.6/redhat-linux-build/../Xi/exevents.c:1404:13:
 warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’

xwayland-24.1.6/redhat-linux-build/../Xi/exevents.c:2293:9:
 warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’

xwayland-24.1.6/redhat-linux-build/../Xi/exevents.c:3244:22:
 warning[-Wanalyzer-null-dereference]: dereference of NULL ‘inputMasks’

xwayland-24.1.6/redhat-linux-build/../Xi/exevents.c:3338:9:
 warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2075>
2025-10-21 13:02:04 +02:00
Alan Coopersmith
238c1ccf4b Xext/xtest: avoid null dereference in ProcXTestFakeInput()
Reported in https://gitlab.freedesktop.org/xorg/xserver/-/issues/1817:

xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:383:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:348:9: release_memory: ‘dev’ is NULL
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:383:14: danger: dereference of NULL ‘dev’

xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:395:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:348:9: release_memory: ‘dev’ is NULL
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:395:14: danger: dereference of NULL ‘dev’

xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:426:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
xwayland-24.1.6/redhat-linux-build/../Xext
/xtest.c:348:9: release_memory: ‘dev’ is NULL
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:426:14: danger: dereference of NULL ...
2025-10-21 13:02:04 +02:00
Alan Coopersmith
640a9cf51e Xext/xselinux: avoid memory leak in SELinuxAtomToSID()
Reported in https://gitlab.freedesktop.org/xorg/xserver/-/issues/1817:

xwayland-24.1.6/redhat-linux-build/../Xext/xselinux_label.c:142:13: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xwayland-24.1.6/redhat-linux-build/../Xext/xselinux_label.c:133:1: enter_function: entry to ‘SELinuxAtomToSID’
xwayland-24.1.6/redhat-linux-build/../Xext/xselinux_label.c:141:15: acquire_memory: allocated here
xwayland-24.1.6/redhat-linux-build/../Xext/xselinux_label.c:69:12: branch_true: following ‘true’ branch...
xwayland-24.1.6/redhat-linux-build/../Xext/xselinux_label.c:142:13: danger: ‘rec’ leaks here; was allocated at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
  140|       if (!rec) {
  141|           rec = calloc(1, sizeof(SELinuxAtomRec));
  142|->         if (!rec || !SELinuxArraySet(&arr_atoms, atom, rec))
  143|               return BadAlloc;
  144|       }

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2072>
2025-10-21 13:02:04 +02:00
Alan Coopersmith
c45edc0c51 Xext/xselinux: add fast path to ProcSELinuxListSelections()
If there's nothing to send, skip over a bunch of code to make a list
that won't be used, and hopefully make the code path clearer to both
humans and static analyzers, who raise errors as seen in https://gitlab.freedesktop.org/xorg/xserver/-/issues/1817 of
dereferencing NULL pointers when count == 0.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2072>
2025-10-21 13:02:04 +02:00
Alan Coopersmith
5a8effe1e7 Xext/sync: Avoid dereference of invalid pointer if malloc() failed
Reported incorrectly in https://gitlab.freedesktop.org/xorg/xserver/-/issues/1817 as:

xwayland-24.1.6/redhat-linux-build/../Xext/sync.c:2835:33: acquire_memory: allocated here
xwayland-24.1.6/redhat-linux-build/../Xext/sync.c:2843:12: danger: ‘priv’ leaks here; was allocated at [(30)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/29)

but the "leak" is really saving the pointer in an uninitalized pointer in
a structure that was already freed when the malloc of the SysCounterInfo
struct failed in SyncCreateSystemCounter(), because it returned the address
of the freed struct instead of NULL to indicate failure.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2072>
2025-10-21 13:02:04 +02:00
Alan Coopersmith
446baf6b15 Xext/sync: avoid null dereference if SysCounterGetPrivate() returns NULL
Reported in https://gitlab.freedesktop.org/xorg/xserver/-/issues/1817:

xwayland-24.1.6/redhat-linux-build/../Xext/sync.c:2664:9: danger: dereference of NULL ‘SysCounterGetPrivate(pCounter)’

xwayland-24.1.6/redhat-linux-build/../Xext/sync.c:2677:14: danger: dereference of NULL ‘SysCounterGetPrivate(pCounter)’

xwayland-24.1.6/redhat-linux-build/../Xext/sync.c:2767:14: danger: dereference of NULL ‘SysCounterGetPrivate(pCounter)’

xwayland-24.1.6/redhat-linux-build/../Xext/sync.c:2800:14: danger: dereference of NULL ‘SysCounterGetPrivate(pCounter)’

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2072>
2025-10-21 13:02:04 +02:00
Enrico Weigelt, metux IT consult
c046c7629e dix: inline SProcPolyText()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-21 10:49:37 +02:00
Enrico Weigelt, metux IT consult
202c452b5f dix: replace XACE_SCREENSAVER_ACCESS by direct callback
Replace complicated xace hook by simple and cheap callback.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-21 10:49:08 +02:00
Enrico Weigelt, metux IT consult
8d19217b56 Xext: shm: move per-screen private structure into privates area
Instead of having a pointer to a struct just consisting of a pointer,
just move that struct directly into the privates area, so we not just
save one extra indirection, but also not having to care about an extra
chunk of malloc'ed memory anymore (thus getting rid of a potential
OOM bug)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-21 10:40:32 +02:00
Enrico Weigelt, metux IT consult
2d71f0579f xkb: inline SProcXkbGetGeometry()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-21 10:26:57 +02:00
Enrico Weigelt, metux IT consult
335dd555fe xkb: inline SProcXkbSetDeviceInfo()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-21 10:26:21 +02:00
Alan Coopersmith
e446fdc14a xfree86: add missing headers to build sun_init.c on Solaris/SPARC
Fixes: 0f715b4ca4 ("xfree86: os-support: move hidden Solaris-specific symbols out of public header")
Fixes: e2fa0d2ae0 ("fix including <sys/mman.h>")

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2070>

Further explanation about this commit by @alanc:

This particular set of `#ifdefs` matches the ones around the code using the fbio ioctls and mmap calls in the `xf86CloseConsole()` code later in the file:
c62cd2feaa/hw/xfree86/os-support/solaris/sun_init.c (L281)
reflecting the lack of /dev/fb style drivers on x86 systems on Solaris.
2025-10-21 10:25:32 +02:00
Alan Coopersmith
855aa4ef86 xfree86: Fix -Wdiscarded-qualifiers warnings in SPARC Sbus probe code
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2070>
2025-10-21 10:25:32 +02:00
Alan Coopersmith
c179700b99 xfree86: fix meson build on 64-bit Solaris/SPARC systems
For cpu_family(), meson returns "sparc" for 32-bit sparc,
and "sparc64" for 64-bit sparc, regardless of the OS in use.

For cpu(), meson returns values like "sun4v" on Solaris/SPARC,
and doesn't promise stability of the values, or portability across
OS'es, unlike cpu_family().

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2070>
2025-10-21 10:25:32 +02:00
Enrico Weigelt, metux IT consult
4825c4584a Xext: shm: shmint.h: drop superflous extern on function prototypes
Functions are already `extern` by default.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-21 10:23:11 +02:00
Enrico Weigelt, metux IT consult
f19e7a24a1 Xext: shm: unexport ShmSegType variable
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-21 10:22:47 +02:00
Enrico Weigelt, metux IT consult
a641a197f4 render: consolidate byte-swapping in ProcRenderCompositeGlyphs()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-21 10:22:14 +02:00
Enrico Weigelt, metux IT consult
9370aafb36 Xi: inline SProcXUngrabDeviceButton()
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-10-21 10:21:52 +02:00
Enrico Weigelt, metux IT consult
a28cacbef2 Xi: inline SProcXIAllowEvents()
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-10-21 10:21:31 +02:00
Enrico Weigelt, metux IT consult
34d4c56432 render: consolidate byte-swapping in ProcRenderTriFan()
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-10-20 11:45:13 +02:00
Enrico Weigelt, metux IT consult
8399c4e263 dix: consolidate struct _CallbackList and struct _CallbackRec into dixutil.c
These structs are only used inside dixutils, the actual callback handling
functions. Therefore no need to keep them in public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-20 10:30:22 +02:00
kohnish
166dec4701 Fix missing include and signature mismatch on gentoo linux 2025-10-20 10:25:28 +02:00
Enrico Weigelt, metux IT consult
437515032b Xi: inline SProcXGetDeviceMotionEvents()
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-10-20 10:01:40 +02:00
Enrico Weigelt, metux IT consult
302533aac8 Xi: inline ProcXSetDeviceFocus()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-20 10:01:19 +02:00
Enrico Weigelt, metux IT consult
5330084bd5 xkb: inline SProcXkbSetMap()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-20 10:00:41 +02:00
callmetango
24a4dd4606 README.md: updated links to new packaging repository pt2
Updated remaining links to new packaging repository and the discussions
moved there.

Part-of: X11Libre/misc#406
Signed-off-by: callmetango <callmetango@users.noreply.github.com>
2025-10-17 09:46:20 -04:00
Enrico Weigelt, metux IT consult
be69bc3aae Xext: shm: fix missing ScreenClose hook registration
ShmScreenClose() needs to be registered as ScreenClose hook into
all screens - otherwise it won't be called and so we're missing
cleanup work.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-14 19:45:15 +02:00
stefan11111
214d0e67de xfree86/common: Match drivers "modesetting" and "nvidia" on nvidia cards
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-10-14 10:39:22 +02:00
callmetango
9b94133f1c README.md: fixed some misspellings
Signed-off-by: callmetango <callmetango@users.noreply.github.com>
2025-10-13 11:42:14 -04:00
callmetango
163c5a495b README.md: updated links to new packaging repository
* updated links to new packaging repository and the discussions moved
  there
* removed links to the creation of DEB and RPM packages since this has
  been done

Fixes: X11Libre/misc#406
Signed-off-by: callmetango <callmetango@users.noreply.github.com>
2025-10-13 11:42:14 -04:00
stefan11111
036432980b modesetting: Initialize the cursor image with the smallest size supported by all CRTCs.
We try to find the smallest size we can use for the cursor image.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-10-13 14:01:04 +02:00
stefan11111
702625f028 modesetting: use MAX macro in more places
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-10-13 14:01:04 +02:00
Enrico Weigelt, metux IT consult
6730fd8251 dix: fix missing includes of extinit.h
Don't rely on this file just being included indirectly by somebody else
just by accident.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-07 11:07:00 +02:00
Enrico Weigelt, metux IT consult
a56e1665a1 dix: inline SProcPoly()
Yet another step for getting rid of the unnecessarily complicated SProc*
machinery. Later, all those swap*() calls will be replaced by macros.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-07 11:06:37 +02:00
Enrico Weigelt, metux IT consult
92af1b26ff render: consolidate byte-swapping in ProcRenderTriStrip()
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-10-07 10:55:23 +02:00
Enrico Weigelt, metux IT consult
81a8619bda dix: replace XACE_CLIENT_ACCESS by direct callback
Replace complicated xace hook by simple and cheap callback.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-07 10:52:54 +02:00
Enrico Weigelt, metux IT consult
0f0164882f Xi: inline SProcXGetExtensionVersion()
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-10-03 17:27:58 +02:00
stefan11111
4984b12967 modesetting: Use the same cursor mask interleave as other drivers
There is no explanation for these values, but the one we are
currently using doesn't work.

Use the values from vendor-speciffic drivers, which do work.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-10-02 18:49:40 +02:00
stefan11111
bbcf22183a modesetting: Only use the querried fallback if both querries succeed
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-10-02 18:49:40 +02:00
stefan11111
25cae34122 modesetting: add braces around an if
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-10-02 18:49:40 +02:00
stefan11111
d5162b4493 modesetting: Handle cursor images and buffers smaller than 64x64 correctly
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-10-02 18:49:40 +02:00
stefan11111
5752116343 modesetting: Clear the cursor buffer explicitly
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-10-02 18:49:40 +02:00