Commit Graph

19837 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult f061315afa rootless: use window destructor hook
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>
2025-06-12 16:44:19 +02:00
Enrico Weigelt, metux IT consult c3d780d07f composite: use window destructor hook
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>
2025-06-12 16:44:16 +02:00
Enrico Weigelt, metux IT consult f208c7a971 xv: use window destructor hook
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>
2025-06-12 16:44:13 +02:00
Enrico Weigelt, metux IT consult c335d5a92e damage: use window destructor hook
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>
2025-06-12 16:44:11 +02:00
Enrico Weigelt, metux IT consult c14783ef81 render: use window destructor hook
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>
2025-06-12 16:44:07 +02:00
Enrico Weigelt, metux IT consult 4b4fba80e2 present: use window destructor hook
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>
2025-06-12 16:44:05 +02:00
Enrico Weigelt, metux IT consult 0b0cabb505 dbe: use window destructor hook
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>
2025-06-12 16:44:02 +02:00
Enrico Weigelt, metux IT consult 3a0edc36b6 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>
2025-06-12 16:43:59 +02:00
Enrico Weigelt, metux IT consult 48ca8adc6d dix: make DeleteCallbackList() non-static and document it
Allow using it by other places outside this file, so we can also support
callback lists in dynamically allocated structures:

Those cases need to explicitly call DeleteCallbackList() before free()ing
the structures - otherwise we're getting heap corruptions, because the
actual deletion can happen asynchronously.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:56 +02:00
Enrico Weigelt, metux IT consult a110b3e02e dix: consolidate screen destruction in dixFreeScreen()
Consolidate duplicated screen destruction logic into new function
dixFreeScreen().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:54 +02:00
Enrico Weigelt, metux IT consult 14de20ce58 dix: replace FreeDefaultStipple()
It's just a one-liner only called once, so no actual need for it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:51 +02:00
Enrico Weigelt, metux IT consult d56d8307c1 dix: let FreeGCperDepth() operate on ScreenPtr and NULL protect it
Instead of retrieving the screen index from ScreenRec and passing this,
so the ScreenRec is looked up again, just pass in the ScreenPtr that
already have anyways.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:48 +02:00
Enrico Weigelt, metux IT consult 1eaf1b0191 dix: NULL-protect FreeGC()
Make it possible to call FreeGC() w/o prior NULL checks.
In case of NULL, BadMatch is returned.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:23 +02:00
Enrico Weigelt, metux IT consult 9266733da3 xwin: fix missing include of mi/mi_priv.h
xwin relies on mi_priv.h being included indirectly, thus depending
on exact include within other header files. This can easily break if
something in other headers slightly changes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:20 +02:00
Enrico Weigelt, metux IT consult 05e5ee3671 miext: sync: drop useless CloseScreen wrapping
This wrapped CloseScreen function doesn't do anything actually useful,
so no need to keep it around any longer. It used to do a free() on the
private data (which had been wrong in the first place) but this had
been removed and so the whole function became useless, it had been
forgotten to be swept away.

Fixes: 469d5bf8b7
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:17 +02:00
Enrico Weigelt, metux IT consult d1e641739b xfree86: unexport xf86RandR12CreateScreenResources()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:14 +02:00
Enrico Weigelt, metux IT consult 7b8a5c4a72 xfree86: unexport xf86RandR12CloseScreen()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:11 +02:00
Enrico Weigelt, metux IT consult f26090eba6 egl: drop unused CreateScreenResources pointer
This field hasn't been actually used, so no need to keep it any longer.

Fixes: 60f14d60f6
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:08 +02:00
Enrico Weigelt, metux IT consult 1a97ed88cc kdrive: drop obsolete ifndef PHOENIX
The symbol isn't set anywhere, and git history didn't show anything
were it ever had been set, thus no need to keep this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:06 +02:00
Enrico Weigelt, metux IT consult a444407473 kdrive: call miCreateScreenResources() drectly
No need for complicated wrapping/unwrapping: it's always just
miCreateResources() anyway - so we can call it directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:03 +02:00
Enrico Weigelt, metux IT consult 981ee4fcf1 kdrive: directly calling KdCloseScreen() instead of wrapping
No need to wrap CloseScreen proc vector, we can call KdCloseScreen() from
KdXVCloseScreen() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:00 +02:00
Enrico Weigelt, metux IT consult d04872f8c4 kdrive: directly calling fbCloseScreen instead of wrapping
No need to wrap CloseScreen proc vector, we can call fbCloseScreen() from
KdCloseScreen() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:57 +02:00
Enrico Weigelt, metux IT consult c839203c8c xwayland: call miCreateScreenResources() directly
No need for complicated wrapping/unwrapping: it's always just
miCreateResources() anyway - so we can call it directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:55 +02:00
Enrico Weigelt, metux IT consult fbc1300cbc xwin: call miCreateScreenResources() directly
No need for complicated wrapping/unwrapping: it's always just
miCreateResources() anyway - so we can call it directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:42:52 +02:00
Enrico Weigelt, metux IT consult 61ac63e8df 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>
2025-06-12 16:42:49 +02:00
Enrico Weigelt, metux IT consult 1758b94520 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>
2025-06-12 16:42:46 +02:00
Enrico Weigelt, metux IT consult 6d8713b6a7 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>
2025-06-12 16:42:43 +02:00
Enrico Weigelt, metux IT consult 0356a26d9f 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>
2025-06-12 16:42:41 +02:00
Enrico Weigelt, metux IT consult a698ebe1f8 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>
2025-06-12 16:42:38 +02:00
Enrico Weigelt, metux IT consult 41531e8220 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>
2025-06-12 16:42:35 +02:00
Enrico Weigelt, metux IT consult 0dfe79f9da 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>
2025-06-12 16:42:32 +02:00
Enrico Weigelt, metux IT consult 7e84650e52 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>
2025-06-12 16:42:30 +02:00
Enrico Weigelt, metux IT consult 6bcfef8cfa 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>
2025-06-12 16:42:26 +02:00
Enrico Weigelt, metux IT consult dce437bb53 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>
2025-06-12 16:42:24 +02:00
Enrico Weigelt, metux IT consult 7cbb183721 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>
2025-06-12 16:42:20 +02:00
Enrico Weigelt, metux IT consult 20aec694e4 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>
2025-06-12 16:41:53 +02:00
Enrico Weigelt, metux IT consult 1b990d3c0c 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>
2025-06-12 16:41:51 +02:00
Enrico Weigelt, metux IT consult acbb76fd70 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>
2025-06-12 16:41:47 +02:00
Enrico Weigelt, metux IT consult 023ee2237f 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>
2025-06-12 16:41:45 +02:00
Enrico Weigelt, metux IT consult b0460841e8 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>
2025-06-12 16:41:42 +02:00
Enrico Weigelt, metux IT consult 66e1b34a88 xfree86: modeset: call miCreateScreenResources() directly
No need for complicated wrapping/unwrapping: it's always just
miCreateResources() anyway - so we can call it directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:39 +02:00
Enrico Weigelt, metux IT consult 1c3150f507 xfixes: use embedded private instead of pointer
The private struct is pretty small and it needs to be allocated anyways,
so save an extra allocation by directly embedding it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:37 +02:00
Enrico Weigelt, metux IT consult bd8b8481da xfree86: fbdevhw: drop unused FBDEVHW_PLANES
Not used anywhere, neither internal nor external.

(BTW, those defines are only used within xf86-video-fbdev, so they maybe
could be moved over there.)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:34 +02:00
Enrico Weigelt, metux IT consult f794511711 xfree86: fbdevhw: drop unused fbdevHWSaveScreenWeak()
Not used anywhere, neither internal nor external (drivers), so no need
to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:31 +02:00
Enrico Weigelt, metux IT consult 95018dca2f xfree86: fbdevhw: drop unused fbdevHWEnterVTWeak()
Not used anywhere, neither internal nor external (drivers), so no need
to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:29 +02:00
Enrico Weigelt, metux IT consult 9bfdcb1ef2 xfree86: fbdevhw: drop unused fbdevHWGetBuildinMode()
Not used anywhere, neither internal nor external (drivers), so no need
to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:24 +02:00
Enrico Weigelt, metux IT consult e9775aad3d xfree86: fbdevhw: drop unused fbdevHWGetFD()
Not used anywhere, neither internal nor external (drivers), so no need
to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:20 +02:00
Enrico Weigelt, metux IT consult 7c60120c02 xfree86: fbdevhw: drop unused fbdevHWFreeRec()
Not used anywhere, neither internal nor external (drivers), so no need
to keep it any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:17 +02:00
Enrico Weigelt, metux IT consult e0b143cfd9 xfree86: fbdevhw: make fbdevHWGetRec() static
Not used by any external consumers, only within the same source file,
so can become static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:15 +02:00
Enrico Weigelt, metux IT consult ac947ad0d6 fb: unexport fbGetScreenPixmap() macro
No external users, so no need to keep it exported any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:41:12 +02:00