Commit Graph

19335 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult e76bf69e5e Xext: shm: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:28 +02:00
Enrico Weigelt, metux IT consult b23091f99c dix: add per-screen close notify hook
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:28 +02:00
Enrico Weigelt, metux IT consult 979dfaf30a rootless: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window position notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:28 +02:00
Enrico Weigelt, metux IT consult fc92a13326 dbe: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window position notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:28 +02:00
Enrico Weigelt, metux IT consult af6adeec97 composite: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window position notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:28 +02:00
Enrico Weigelt, metux IT consult 4ccfafe9eb dix: add per-screen window position notify hook
Right now, extension specific actions on window positioning are implemented
by wrapping the ScreenRec's PositionWindow() proc pointer: the extensions are
storing the original pointer in their private data and putting in their own one.
On each call, their proc restores the original one, calls it, and switches back
again. When multiple extensions doing so, they're forming a kind of daisy chain.
(the same is done for lots of other procs)

While that approach is looking nice and elegant on the drawing board, it's
complicated, dangerous like a chainsaw and makes debugging hard, leading to
pretty blurred API borders.

This commit introduces a simple approach for letting extension hook into the
window positioning path safely, w/o having to care much about side effects
with the call chain. Extensions now can simply register their hook proc
(and an opaque pointer) and get called back - w/o ever having to mess with
the ScreenRec's internal structures. These hooks are called before the original
vector (usually handled by DDX/screen driver directly) is called.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:28 +02:00
Enrico Weigelt, metux IT consult 31742b4f9d mi: overlay: use window destructor hook instead of wrapping ScreenRec's DestroyWindow
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:28 +02:00
Enrico Weigelt, metux IT consult 36bd9b85b4 xwayland: use window destructor hook instead of wrapping ScreenRec's DestroyWindow
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:27 +02:00
Enrico Weigelt, metux IT consult 7f15518528 xfree86: dri: use window destructor hook instead of wrapping ScreenRec's DestroyWindow
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:27 +02:00
Enrico Weigelt, metux IT consult c6277392f1 xfree86: xv: use window destructor hook instead of wrapping ScreenRec's DestroyWindow
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:27 +02:00
Enrico Weigelt, metux IT consult 022b504b14 kdrive: xv: use window destructor hook instead of wrapping ScreenRec's DestroyWindow
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:27 +02:00
Enrico Weigelt, metux IT consult 993526582f rootless: use window destructor hook instead of wrapping ScreenRec's DestroyWindow
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

2do: should check whether it's better to directly assign the screen procs,
w/o any wrapping at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:27 +02:00
Enrico Weigelt, metux IT consult 1443d74f73 composite: use window destructor hook instead of wrapping ScreenRec's DestroyWindow
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:27 +02:00
Enrico Weigelt, metux IT consult 795ce1ed2b xv: use window destructor hook instead of wrapping ScreenRec's DestroyWindow
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:27 +02:00
Enrico Weigelt, metux IT consult 71186bb546 damage: use window destructor hook instead of wrapping ScreenRec's DestroyWindow
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:27 +02:00
Enrico Weigelt, metux IT consult dc37180bed render: use window destructor hook instead of wrapping ScreenRec's DestroyWindow
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:27 +02:00
Enrico Weigelt, metux IT consult e367d9adc1 present: use window destructor hook instead of wrapping ScreenRec's DestroyWindow
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:27 +02:00
Enrico Weigelt, metux IT consult 263bb37c2c dbe: use window destructor hook instead of wrapping ScreenRec's DestroyWindow
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.
2024-10-07 14:21:27 +02:00
Enrico Weigelt, metux IT consult 2649cf825b dix: add per-screen window destructor hook
Right now, extension specific window destruction procedures are implemented
by wrapping the ScreenRec's DestroyWindow() proc pointer: the extensions are
storing the original pointer in their private data and putting in their own one.
On each call, their proc restores the original one, calls it, and switches back
again. When multiple extensions doing so, they're forming a kind of daisy chain.
(the same is done for lots of other procs)

While that approach is looking nice and elegant on the drawing board, it's
complicated, dangerous like a chainsaw and makes debugging hard, leading to
pretty blurred API borders.

This commit introduces a simple approach for letting extension hook into the
window destruction safely, w/o having to care much about side effects with
the call chain. Extensions now can simply register their destructor proc
(and an opaque pointer) and get called back - w/o ever having to mess with
the ScreenRec's internal structures.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-07 14:21:27 +02:00
Enrico Weigelt, metux IT consult ed65224ffa (!1705) xwin: drop wrapping on ScreenRec->ModifyPixmapHeader()
Instead of complicated wrapping, just call fbModifyPixmapHeader() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult c5473d9ff6 (!1705) xwin: drop winResizeWindowMultiWindow()
This wrapping function for Screen->ResizeWindow() is does nothing more than
just call the original functions. So no need to keep wrapping it at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult f49c66318f (!1705) xwin: drop wrapping on ScreenRec->MoveWindow()
Instead of complicated wrapping, just call fbMoveWindow() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult fa73cebe8d (!1705) xwin: drop wrapping on ScreenRec->RestackWindow()
This proc vector is optional (callers check for non-null) and neither fb nor
mi set it, so we can just assign our function directly. No need for wrapping.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult a1b8f2d8d7 (!1705) xwin: drop wrapping on ScreenRec->ReparentWindow()
This proc vector is optional (callers check for non-null) and neither fb nor
mi set it, so we can just assign our function directly. No need for wrapping.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult 119b5251a8 (!1705) xwin: drop wrapping on ScreenRec->UnrealizeWindow()
Instead of complicated wrapping, just call fbUnrealizeWindow() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult 0c5082d34f (!1705) xwin: drop wrapping on ScreenRec->RealizeWindow()
Instead of complicated wrapping, just call fbRealizeWindow() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult b96491d3d6 (!1705) xwin: drop wrapping on ScreenRec->SetShape()
Instead of complicated wrapping, just call fbSetShape() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult bafce29ba5 (!1705) xwin: drop winCopyWindowMultiWindow()
This wrapping function for Screen->CopyWindow() is does nothing more than
just call the original functions. So no need to keep wrapping it at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult 04a0d6bca0 (!1705) xwin: call winFinishScreenInitFB() directly
Both engines, GDI as well as DirectDraw, using the same screen init finish function,
so no need to keep indirection via per-engine callback pointer.

The winFinishScreenInitFB() can also be made static now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult 0769399234 (!1705) xwin: glx: drop glxWinUnrealizeWindow()
It does nothing more than just calling the original/wrapped function,
so we don't need that at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult 85a6e08ea0 (!1705) xwin: glx: drop glxWinRealizeWindow()
It does nothing more than just calling the original/wrapped function,
so we don't need that at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult 571ba4df1f (!1705) xwin: drop wrapping on ScreenRec->ChangeWindowAttributes()
Instead of complicated wrapping, just call fbCreateWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult 704dc1a610 (!1705) xwin: drop wrapping on ScreenRec->CreateWindow()
Instead of complicated wrapping, just call fbCreateWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult c5baa87d81 (!1705) xwin: drop wrapping on ScreenRec->PositionWindow()
Instead of complicated wrapping, just call fbPositionWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:06 +02:00
Enrico Weigelt, metux IT consult 611be98709 (!1705) xwin: drop wrapping on ScreenRec->DestroyWindow()
Instead of complicated wrapping, just call fbDestroyWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:05 +02:00
Enrico Weigelt, metux IT consult 03a2cebc02 xfree86: dri: unexport DRIDestroyWindow() and make it static
This function is only called inside dri.c, not used by any drivers
(and wouldn't make sense to do so), so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:05 +02:00
Enrico Weigelt, metux IT consult a792aa063a mi: miInitVisuals: clean up variable declarations
The code is easier to understand when variables are declared where they're
used for the first time, scoped to where they're needed and not reused
for separate things.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:05 +02:00
Doug Brown edf7fd0d4b dri2: Protect against dri2ClientPrivate assertion failures
If DRI2ScreenInit hasn't been called yet, DRI2Authenticate and
DRI2CreateDrawable2 cause the X server to crash. This has been observed
to happen on multiple modern Linux distros in various conditions,
including QEMU and VMware VMs. Make these functions more robust in order
to prevent the crash.

This patch was originally provided by Bernhard Übelacker and expanded
upon by Mark Wagner.

Signed-off-by: Doug Brown <doug@schmorgal.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1053
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1534
2024-10-04 13:49:05 +02:00
Enrico Weigelt, metux IT consult 35ec98dd42 xnest: add pixmap depths to global depth list
Right now, we're only registering the depths of our visuals, which are
mirroring upstream's visuals. But forgotten to register the pixmap depths
that don't have an assiocated visual.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:05 +02:00
Enrico Weigelt, metux IT consult 8076ab751d (!1700) meson: drop defining BIGREQS
This symbol isn't used for decades, so no need to define it at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:05 +02:00
Enrico Weigelt, metux IT consult 3b9c6f699e dix: lookup function for WindowPtr by XID
This new lookup function retrieves a pointer to WindowRec structure by
associated XID. Unlike dixLookupWindow(), this one works globally, instead
of just on one specific client, and it doesn't do any XACE calls.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:05 +02:00
Enrico Weigelt, metux IT consult 296bbbe009 ci: always build with drivers 2024-10-04 13:49:05 +02:00
Enrico Weigelt, metux IT consult 41f8104ed8 ci: freebsd: fix missing xcb-aux and xcb-util-wm
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:05 +02:00
Enrico Weigelt, metux IT consult b4ded31d94 bsd: drop PCCONS support
The old PCCONS driver only seems to be used on minimal install disks and
cannot coexist with newer ones, so there's probably no practical use case for
supporting it in Xorg anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:05 +02:00
Enrico Weigelt, metux IT consult e1d210521c 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>
2024-10-04 13:49:05 +02:00
Enrico Weigelt, metux IT consult e2ca5adc7c WIP: reorder includes
(submit/cursor-api) dix: drop superfluous XineramaGetCursorScreen()

It's only used for record extension, no external callers, thus doesn't
need to be exported. Since it's just for retrieving one struct value,
it's not needed at all - we can do this directly (just like we do in
many other places)

Note: the check on noPanoramixExtensions is superfluous, since the only
call site already does it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:05 +02:00
Enrico Weigelt, metux IT consult 8de8ab6fe2 (!1695) dix: unexport Ones()
It's not used by any module/driver, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:05 +02:00
Enrico Weigelt, metux IT consult 5bc9eb2ceb (!1694) xvmc: unexport XvMCFindXvImage()
It's not needed by any driver, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:05 +02:00
Enrico Weigelt, metux IT consult 2fadf3eb39 (!1693) xvmc: move over protocol version defines into xvmc.c
These are exclusively used in one source file, so no need to keep them
in a global header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:05 +02:00
Enrico Weigelt, metux IT consult eb0841e1eb (!1692) Xext: xvmc: drop unused XvMCScreenInitProc
This pointer field isn't used anywhere, neither in Xorg nor in drivers.
No need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-04 13:49:05 +02:00