Commit Graph

9982 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
553f13fdca xfree86: dri: ProcXF86DRIGetDrawableInfo(): cache screen pointer
Cache the screen pointer in local variable, instead of fetching it
from global array several times. Follow-up commits will use some
inline helper for that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-04 11:22:23 +02:00
Enrico Weigelt, metux IT consult
b8bfb5792a kdrive: KdCursorOffScreen(): move dx and dy into local scope
These are just used locally and always assigned at loop body start,
so it's cleaner to declare them locally inside the loop body.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-04 11:06:33 +02:00
Enrico Weigelt, metux IT consult
e2d9dc4054 kdrive: fix KdCursorOffScreen()
Bug slipped through: we have to substract the coordinates from the walked
screen to the current one, instead of the walked one from itself :o

Fixes: 97d72431cf
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-03 17:12:54 +02:00
Enrico Weigelt, metux IT consult
015fd1c4ee xquartz: dri: use X_SEND_REPLY_SIMPLE() for simple replies
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 12:51:58 +02:00
Enrico Weigelt, metux IT consult
a389034c2d xfree86: dga: ProcXDGAOpenFramebuffer() use x_rpcbuf_t
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 12:49:29 +02:00
Enrico Weigelt, metux IT consult
9f8a9f4f8c xfree86: dga: use X_SEND_REPLY_SIMPLE() for simple replies
Use the X_SEND_REPLY_SIMPLE() macro for simple replies.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 16:56:57 +02:00
Enrico Weigelt, metux IT consult
48cb1118ee treewide: drop unnecessary pixmap field initialization
The PixmapRec is already calloc()'ed, so no need for additional zero-writes
into individual fields. This also removes some unncessary #ifdefs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 13:31:52 +02:00
Enrico Weigelt, metux IT consult
89b900063e xfree86: DGA: remove obsolete comment
Forgotten to remove an obsolete comment when ancient DGA-1.0 was removed.

Fixes: 4615067264
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 12:49:54 +02:00
Enrico Weigelt, metux IT consult
4615067264 xfree86: dga: drop support for old DGA 1.0 protocol
This is a relic from the 90s, giving really unsafe direct framebuffer
acccess. The very few known clients ever using this already been ported
to DGA 2.0 decades ago. The code is heavily tied to 32 bit architectures
anyways, so unlikely to even work on non-acient hardware.

So, without any clients left, there's no need to keep, let alone (try to)
repair that old cruft.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 11:13:48 +02:00
Enrico Weigelt, metux IT consult
2044c1506a xwin: use X_SEND_REPLY_SIMPLE() for simple replies
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 10:53:11 +02:00
Enrico Weigelt, metux IT consult
286a15de4c xfree86: dri: use X_SEND_REPLY_SIMPLE() for simple replies
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-31 14:17:06 +02:00
Enrico Weigelt, metux IT consult
37ebc7d74b treewide: explicitly cast %p printf parameters to void*
Do it the ISO C way, so -pendantic is shouting a little bit less.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-31 10:03:34 +02:00
stefan11111
65a7f1d6a1 kdrive: add build system bits for kdrive input drivers
They are all disabled for now, build options for enabling them
will be added when Xfbdev is added.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-31 10:02:32 +02:00
stefan11111
dcc29cce96 kdrive: small C cleanups we missed
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-31 10:02:32 +02:00
Enrico Weigelt, metux IT consult
2a5bca08ef xfree86: x86emu: drop assert() on uninitialized variable
If assert()s actually enabled, we're having undefined behaviour.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-29 19:02:40 +02:00
stefan11111
5df7b1fa5c modesetting: Fix uninitialized drmmode_crtc->cursor_{width,height}
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-29 12:04:49 +02:00
stefan11111
cef7cda851 include: modesetting: rename LIBDRM_PLANE_SIZE_HINTS to LIBDRM_HAS_PLANE_SIZE_HINTS
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-29 12:01:18 +02:00
stefan11111
8c2b6dec47 kdrive: replace dix-config.h with kdrive-config.h
In preparation for adding the Xfbdev kdrive X11 server

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-28 18:51:55 +02:00
notbabaisyou
e6c980f08e hw/modesetting: Fix up cursor size probing.
modesetting has a sort of broken concept of getting the cursor dimensions since 1f41320e1c, which causes issues on virtual machines and older AMD hardware. Our solution is to use SIZE_HINTS which is available in i915 since 2023 otherwise fallback to getting the cursor size provided by the driver, if a driver wants to have a more optimal cursor size, it is more than welcome to implement SIZE_HINTS in it's DRM interface.

Taken from my own fork of Xorg.

v2: Fix some bugs in the implemenation.
2025-08-28 16:56:25 +02:00
notbabaisyou
e7455f48a3 hw/modesetting: Add drmmode_get_cursor_limit.
Used in upcoming commit.
2025-08-28 16:56:25 +02:00
notbabaisyou
c390441ca9 hw/modesetting: Add required structs and data.
Will be used by the next commits.
2025-08-28 16:56:25 +02:00
Martin von Gagern
7789b3ff88 modesetting: Check for NULL mode_output before printing warning message
Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1816

Signed-off-by: Martin von Gagern <gagern@google.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1938>
2025-08-25 11:33:39 +02:00
Alan Coopersmith
40845a467e xfree86: Fix builds with gcc -Wpedantic
```
../hw/xfree86/loader/loadmod.c:85:33: warning: ISO C forbids empty
 initializer braces before C23 [-Wpedantic]
   85 | static int ModuleDuplicated[] = { };
      |                                 ^
../hw/xfree86/loader/loadmod.c:85:12: error: zero or negative size array
 ‘ModuleDuplicated’
   85 | static int ModuleDuplicated[] = { };
      |            ^~~~~~~~~~~~~~~~
```

Signed-off-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2054>
2025-08-25 11:24:56 +02:00
Oleh Nykyforchyn
3817846c6d xserver: hw/xfree86,include: add a missed ifdef
It is patch 1/7 of a series that provides a convenient way to specify
IgnoreABI and module search paths on a per-driver basis.

It adds #ifdef CONFIG_LEGACY_NVIDIA_PADDING wherever it should be but
is missed.

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
2025-08-24 12:40:19 +02:00
stefan11111
44ffe7d2a3 kdrive: fix warnings about missing prototypes and unused variables
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
aff7f80fbc kdrive: call newly added cfuncs in kdrive.c
In preparation for adding the Xfbdev X11 kdrive server

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
fd2483745b kdrive: call the newly added SIGIO code
The keyboard input driver that will be added to kdrive
only works with old SIGIO code, and doesn't work with
the new threaded input that kdrive uses.

All the code is behind #if's that are never satisfied,
so this commit has no functional changes.

In preparation for adding the Xfbdev X11 kdrive server.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
c85ef2a6b5 kdrive: add SIGIO input code
The keyboard input driver that will be added to kdrive
only works with old SIGIO code, and doesn't work with
the new threaded input that kdrive uses.

All the code is behind #if's that are never satisfied,
so this commit has no functional changes.

In preparation for adding the Xfbdev X11 kdrive server.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
18e544e399 kdrive: add code needed for the future kdrive input drivers
All the code if behind #if's that are never satisfied,
so this commit has no functional changes.

In preparation for adding the Xfbdev X11 kdrive server.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
43200a826e kdrive: call newly added functions in kinput.c
IN preparation for adding the Xfbdev X11 kdrive server

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
451300cd1b kdrive: add fd code to KdDisableInput
In preparation for adding the Xfbdev X11 kdrive server

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
c58220ecec kdrive: add some #includes
In preparation for adding the Xfbdev X11 kdrive server

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
7f3779f062 kdrive: add KdSignalWrapper
In preparation for adding the Xfbdev X11 kdrive server

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
6915ff3312 kdrive: add dpms code to KdSaveScreen
In preparation for adding the Xfbdev X11 kdrive server

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
e763d02a9b kdrive: add more command line options
In preparation for adding the Xfbdev X11 kdrive server

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
5f2d4da4ea kdrive: add some new functions
Add definitions for the forward declarations from the previous commit

In preparation for adding the Xfbdev X11 kdrive server

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
033cd4b2fe kdrive: export some symbols
There are some forward declarations with no definitions in kdrive.h
This doesn't cause a problem right now and makes it easier
to break up the large Xfbdev pr.

In preparation for adding the Xfbdev X11 kdrive server

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
82e922a346 kdrive: add extra fields to structs
In preparation for adding the Xfbdev X11 kdrive server

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
aa6256f7c6 kdrive: add kmode.c
In preparation for adding the Xfbdev X11 kdrive server

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 18:20:39 +02:00
stefan11111
6644e040ae kdrive: add recolorCursor card function
In preparation for adding the Xfbdev X11 kdrive server

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-22 18:18:57 +02:00
Enrico Weigelt, metux IT consult
50cba096da kdrive: drop unused extern declaration of non-existent nClients variable
This variable doesn't even exist, so there shouldn't be any declaration of it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-22 17:40:49 +02:00
stefan11111
b773f7844d xfree86: loader: Make the X server work with both old
and new versions of the proprietary nvidia DDX driver

The 470 driver expects older abi, while the 570 driver
uses different code at runtime depending of the abi version.

This commit tells the new nvdia driver to use the older
abi that the 470 driver expects.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-08-22 17:02:12 +02:00
stefan11111
90846d49cc xfree86: add (optional) ScreenRec padding for legacy Nvidia driver
Commit 3cb3024fea removed pScratchPixmap field
in ScreenRec, which broke legacy Nvidia (proprietary) drivers (470.x), thus
we should add an empty/dummy field here, to ensure correct padding. But this
would break ABI again - can't do that within minor release line.

As compromise, adding a *build time* option CONFIG_LEGACY_NVIDIA_PADDING for
this, so operators/packagers can opt-in to this change.

As it breaks ABI, the option is disabled by default until the next major release
and intended for EXPERTS ONLY who need nvidia390 or nvidia470 drivers.

Note that ALL DRIVERS should be rebuild if it is applied!

This compile-time option, along with the hacks needed to support it
in a non-abi-breaking way, should be droppen in the next major release.

Co-authored-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>

Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-22 17:02:12 +02:00
Enrico Weigelt, metux IT consult
d6089c52c3 treewide: macro for computing extra units needed for reply header
Add and use macro X_REPLY_HEADER_UNITS() for computing how many
extra protocol units are needed for a reply header (for .length field)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-22 14:14:32 +02:00
Enrico Weigelt, metux IT consult
3e76baff89 xwin: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
5823fc2b7f xquartz: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
5bde454490 xnest: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
c77d47a3ac xfree86: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
97d72431cf kdrive: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
34c3a9c7e2 treewide: fix serverGeneration int type mismatch
The global (exported) serverGeneration field is `unsigned long`, while
many other places copy it and compare it two other integer types, eg.
plain `int` (which is signed). Even if it's unlikely ever reaching such
high number of generations that it will ever make trouble, it's still
a good idea to clean this up and use the same type everywhere.

For clearity, introducing a typedef `x_server_generation_t` which is
used everywhere, instead of raw `unsigned long`.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:52:03 +02:00