Compare commits

...

109 Commits

Author SHA1 Message Date
Faith Ekstrand 376cef6710 glamor: Enable dma-buf on Zink
Zink badly needs dma-buf and modifiers as it can't handle BO import of
tiled buffers without modifiers.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1857>
2025-07-03 10:29:33 +00:00
Nathan Kidd a4df686888 glx: Don't blindly write 8 bytes in GLX single replies
Previously we leaked stack when invalid enum parameters were
specified and caused __glGet*_size functions to return a 0 size.

Further, we read out-of-bounds (and leaked) when the input data was less
than 8 bytes (__glXDispSwap_GetFramebufferAttachmentParameteriv and
__glXDisp_GetRenderbufferParameteriv).

Now we only write a single element in the reply padding, and only when there
is a single element. This is what the Mesa client-side libGL expects, and
restores original GLX server behaviour, matching both pre-public (1996) SGI GLX
and XFree86 4.

The main risk of this change is if we have any error in element count or size;
previously it may not have mattered but now it does.

There are no piglit result changes from this modification using either mesa
libGLX or NVIDIA libGLX.

For performance considerations, an extra conditional and variable-length
memcpy has no meaningful impact on the indirect rendering pipeline cost.

There is still the possiblity to leak if our size checks allow an enum that
the GL implemention does not. Guarding against that requires zero-initializing
all temp storage, which wants re-evaluation of the blind 200-byte buffers
used for many calls and thus is a much bigger change.

Signed-off-by: Nathan Kidd <nkidd@rocketsoftware.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1647>
2025-07-02 13:00:47 -04:00
Nathan Kidd 29cfcf5259 glx: Fix out-of-bounds reads from negative return
The callers of these functions were casting -1 to unsigned and then
using 4GB indexes. By returning 0 we match all the other size functions.

GLX size functions return -1 to indicate error, but GL size functions return 0.

Signed-off-by: Nathan Kidd <nkidd@rocketsoftware.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1647>
2025-07-02 12:54:39 -04:00
Icenowy Zheng eba15f1ba7 glamor: Fix dual blend on GLES3
The EXT_blend_func_extended extension on ESSL always requires explicit
request to allow two FS out variables because of limitations of the ESSL
language, which is mentioned as the No.6 issue of the extension's
specification.

Fix this by adding the extension request.

The original behavior on GLES3 is slightly against the specification of
GL_EXT_blend_func_extended extension, however Mesa and older version of
PowerVR closed drivers will just ignore this issue. Newest PowerVR
closed driver will bail out on this problem, so it deems a fix now.

Fixes: ee107cd491 ("glamor: support GLES3 shaders")
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1750>
2025-06-25 17:24:43 +00:00
Vlad Zahorodnii 60f0bfe852 xwayland: Dispatch tablet tool tip events after frame events
Xwayland dispatches tablet tool tip events immediately when they arrive.

With compositors such as mutter and sway, it is not an issue because
their libinput backends synthetize axis events before tip events. In
other words, axis data and the tip status belong to different frames.

On the other hand, kwin sends axis and tip events in a single frame
(its libinput backend generates a single tip event with axis data
attached to it). Since the tip events are dispatched immediately,
they can have wrong information associated with them, for example tool
position or pressure. It results in undesired "streaks" when the user
presses the tablet tool against the tablet.

See also https://bugs.kde.org/show_bug.cgi?id=479856.

Signed-off-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2032>
2025-06-25 11:44:07 +00:00
Marge Bot c1a3e99ce0 Merge branch 'revert-1691' into 'master'
Revert !1691 ("os: log: consolidate sigsafe and non-sigsafe logging paths")

See merge request xorg/xserver!2036
2025-06-24 23:46:29 +00:00
Alan Coopersmith fc4fd8f2a9 Revert "os: log: drop unused variables"
This reverts commit f5fe8a6379.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2036>
2025-06-24 23:40:52 +00:00
Alan Coopersmith f421a33bb7 Revert "os: log: consolidate log formatting functions"
This reverts commit 71b8953597.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2036>
2025-06-24 23:40:52 +00:00
Alan Coopersmith 4916da381b Revert "os: log: make LogVMessageVerb() signal safe"
This reverts commit 5962211612.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2036>
2025-06-24 23:40:51 +00:00
Alan Coopersmith 6a9b2f37bb Revert "os: log: replace LogMessageVerbSigSafe() by LogMessageVerb()"
This reverts commit dd37cc4855.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2036>
2025-06-24 23:40:51 +00:00
Alan Coopersmith 8ff12a8e53 Revert "os: log: replace ErrorFSigSafe() by ErrorF()"
This reverts commit 2d18c353b4.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2036>
2025-06-24 23:40:50 +00:00
Alan Coopersmith 6dc94cb934 Revert "os: log: replace VErrorFSigSafe() by VErrorF()"
This reverts commit da22bc9ae0.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2036>
2025-06-24 23:40:50 +00:00
Alan Coopersmith 523409ca2c Revert "xwin: drop duplicate OsVendorVErrorF()"
This reverts commit 9652bc73e2.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2036>
2025-06-24 23:40:49 +00:00
Alan Coopersmith ebcec3629c Revert "os: log: replace VErrorF() by LogVMessageVerb()"
This reverts commit f4eb217f11.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2036>
2025-06-24 23:40:49 +00:00
Alan Coopersmith 6a49a358e3 Revert "xfree86: common: unexport UnloadModule() and UnloadSubModule()"
This reverts commit 00f69564c5.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2037>
2025-06-24 23:23:50 +00:00
Aaron Plattner 1bec46dda1 Revert "os: unexport SetCriticalOutputPending()"
The NVIDIA driver uses this function.

This reverts commit d973c43810.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2025-06-24 11:23:14 -07:00
Aaron Plattner c4470c3dca Revert "os: drop unused TimerCheck()"
The NVIDIA driver uses this function.

This reverts commit 1dc648b1b7.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2025-06-24 11:23:14 -07:00
Aaron Plattner 3fb85ab045 Revert "Xext: geext: drop unused GEInitEvent()"
The NVIDIA GLX extension module (libglxserver_nvidia.so) uses this
function.

This reverts commit 6fa340c578.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2025-06-24 11:23:14 -07:00
Aaron Plattner d258c26626 Revert "panoramix: don't install panoramiX.h and panoramiXsrv.h"
The NVIDIA driver still supports GLX across physical screens in Xinerama
configurations, and uses the definitions in these headers to do that.

This reverts commit 3f469acb96.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2025-06-24 11:23:14 -07:00
Aaron Plattner 3d05f2b8a8 Revert "dix: unexport AllocColor()"
libwfb.so has a reference to this function:

 $ nm -D ./build.debug/hw/xfree86/dixmods/libwfb.so | grep AllocColor
                  U AllocColor

This reverts commit b48e4a9cb7.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2025-06-24 11:23:10 -07:00
Aaron Plattner 15ca09904a Revert "mi: unexport miWindowExposures()"
libwfb.so has a reference to this function:

 $ nm -D ./build.debug/hw/xfree86/dixmods/libwfb.so | grep miWindowExposures
                  U miWindowExposures

This reverts commit e424f49cdb.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2025-06-24 10:52:53 -07:00
Aaron Plattner 946ff9eac6 Revert "mi: unexport miExpandDirectColors()"
libwfb.so has a reference to this function:

 $ nm -D ./build.debug/hw/xfree86/dixmods/libwfb.so | grep miExpandDirectColors
                  U miExpandDirectColors

This reverts commit c3c538784a.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2025-06-24 10:52:27 -07:00
Aaron Plattner d1ea5a6090 Revert "mi: unexport miCreateScreenResources()"
libwfb.so has a reference to this function:

 $ nm -D build.debug/hw/xfree86/dixmods/libwfb.so | grep miCreateScreenResources
                  U miCreateScreenResources

This reverts commit d14ae53e1f.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2025-06-24 10:52:27 -07:00
Olivier Fourdan c34f59ee15 randr: Do not leak the provider property
When changing the RandR provider property, if the property does not
already exists, it is created.

In case of error, however, it doesn't get freed, leading to a leak of
the allocated property.

Make sure to free the RandR property in case of error if was to be
added.

Found by OpenScanHub.

Fixes: 3c3a4b767 - randr: Check for overflow in RRChangeProviderProperty()
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2035>
2025-06-24 06:32:54 +00:00
Alan Coopersmith bfd15d6e5a Revert "xvmc: move over protocol version defines into xvmc.c"
This reverts commit a33639f975

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2034>
2025-06-22 09:17:25 -07:00
Alan Coopersmith 8006778970 Revert "xfree86: common: move private defs out of xf86sbusBus.h"
This reverts commit 50d1a98c6a.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith 4e315f0b94 Revert "xfree86: int10: move private defs out of xf86int10.h"
This reverts commit a0eea4e0ec.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith 711fdc51f1 Revert "xfree86: common: move private defs from xf86Xinput.h to xf86Xinput_priv.h"
This reverts commit df33e1c51b.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith c692580d74 Revert "xfree86: common: move private defs out of xf86VGAarbiter.h"
This reverts commit 013eaacdd0.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith d13ba4a9e5 Revert "xfree86: modes: move private definitions out of from xf86RandR12.h"
This reverts commit ac5e95be49.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith 58f469947b Revert "xfree86: parser: move private defs from xf86Parser.h to xf86Parser_priv.h"
This reverts commit d4724009ce.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith 98e082ffe4 Revert "xfree86: ddc: move private definitions from xf86DDC.h to xf86DDC_priv.h"
This reverts commit 00c2a8fb0a.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith 781a12fb8d Revert "xfree86: move private definitions out of dri2.h"
This reverts commit 1d3c26446d.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith 41a55b1e2a Revert "xfree86: move private definitions out of dri.h"
This reverts commit cf03948572.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith 44c89ebf32 Revert "xfree86: sdksyms.sh: add more headers"
This reverts commit 1efb2151e3.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Olivier Fourdan 4fc4d76b2c os: Check for integer overflow on BigRequest length
Check for another possible integer overflow once we get a complete xReq
with BigRequest.

Related to CVE-2025-49176

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Suggested-by: Peter Harris <pharris2@rocketsoftware.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2028>
2025-06-18 11:40:54 +02:00
Marge Bot 2a0f6ec920 Merge branch 'revert-1591' into 'master'
Revert parts of !1591 ("Xext: saver: misc cleanups & tiny bugfix (#1704)")

See merge request xorg/xserver!2023
2025-06-17 21:06:02 +00:00
Alan Coopersmith 5ad38ac585 Revert "Xext: saver: skip unneeded zero init and zero-swapping"
This reverts commit 40469a9d51.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2023>
2025-06-17 21:02:03 +00:00
Alan Coopersmith 74182c52e9 Revert "Xext: saver: use explicit switch/case for dispatching"
This reverts commit 8236ef3b56.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2023>
2025-06-17 21:02:03 +00:00
Marge Bot 3e168d8e6a Merge branch 'revert-1519' into 'master'
Revert !1519 ("refactor no*Extension flags")

See merge request xorg/xserver!2022
2025-06-17 21:00:16 +00:00
Alan Coopersmith b82110826f Revert "os: move out extension disable flags to corresponing extensions"
This reverts commit 356e18dcc6.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2022>
2025-06-17 20:54:49 +00:00
Alan Coopersmith 33a11228cf Revert "include: unexport no*Extension flags"
This reverts commit e3cbde9914.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2022>
2025-06-17 20:54:49 +00:00
Marge Bot e610fa3234 Merge branch 'revert-xf86Msg' into 'master'
Revert !1681 ("(trivial) xfree86: use LogMessageVerb() instead of xf86MsgVerb()")

See merge request xorg/xserver!2021
2025-06-17 20:49:44 +00:00
Alan Coopersmith d7e741665b Revert "xfree86: drop xf86MsgVerb() in favor of LogMessageVerb()"
This reverts commit 14767eccc0.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2021>
2025-06-17 20:42:06 +00:00
Alan Coopersmith 64593971d7 Revert "xfre86: drop xf86Msg() in favor of LogMessageVerb()"
This reverts commit a136ce3d57.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2021>
2025-06-17 20:42:06 +00:00
Alan Coopersmith 746f249a0d Revert "xfree86: use LogMessageVerb() instead of xf86MsgVerb()"
This reverts commit 6fc4f35f62.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2021>
2025-06-17 20:42:05 +00:00
Alan Coopersmith 6b60f92ac2 Revert "glx: use LogMessageVerb() instead of xf86Msg()"
This reverts commit 76874498be.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2021>
2025-06-17 20:42:05 +00:00
Alan Coopersmith 692800af00 Revert "xfree86: i2c: use LogMessageVerb() instead of xf86Msg()"
This reverts commit 1f93ec5c33.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2021>
2025-06-17 20:42:05 +00:00
Alan Coopersmith 714d7ea170 Revert "xfree86: os-support: use LogMessageVerb() instead of xf86Msg()"
This reverts commit 4ba0cf1f55.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2021>
2025-06-17 20:42:05 +00:00
Alan Coopersmith 5b7b8f99cd Revert "xfree86: fbdevhw: use LogMessageVerb() instead of xf86Msg()"
This reverts commit 5fd918421a.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2021>
2025-06-17 20:42:05 +00:00
Alan Coopersmith 8e8f28279d Revert "xfree86: common: use LogMessageVerb() instead of xf86Msg()"
This reverts commit bcbc7479f3.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2021>
2025-06-17 20:42:05 +00:00
Marge Bot 81b14fb1a6 Merge branch 'revert-1711' into 'master'
Revert !1711 ("use dixDestroyPixmap() instead of direct driver calls")

See merge request xorg/xserver!2020
2025-06-17 20:12:22 +00:00
Alan Coopersmith 2a9c3abf3e Revert "doc: document that ScreenRec->DestroyPixmap() shouldn't be called directly"
This reverts commit 984da40fbb.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 60a224e457 Revert "Xext: saver: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 7ce19233bc.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith babe8e429d Revert "Xext: shm: use dixDestroyPixmap() instead of direct driver call"
This reverts commit c0f3b5bcef.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith dd823c7370 Revert "dix: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 5b541780c1.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 2de9ed7604 Revert "composite: use dixDestroyPixmap() instead of direct driver call"
This reverts commit eb5476381a.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith f0d6ec1c8a Revert "dbe: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 668d9fc40e.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith b91182cc16 Revert "dri3: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 4694b8488e.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith a5a89e9fa2 Revert "exa: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 9ca03e6da0.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 5ead727d52 Revert "fb: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 08ec122fa7.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 6142282bfe Revert "glamor: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 7a0f8301c5.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 37d2db4398 Revert "miext: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 372a510ef0.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 6f4ad392bd Revert "mi: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 4628254698.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 918a343710 Revert "randr: use dixDestroyPixmap() instead of direct driver call"
This reverts commit d2a93d0346.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 3802252040 Revert "render: use dixDestroyPixmap() instead of direct driver call"
This reverts commit c8607ca66f.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 9550b2d105 Revert "xnest: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 0a54e24721.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 51cfefd59f Revert "kdrive: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 4378656cbb.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 1b6b2bcee1 Revert "vfb: use dixDestroyPixmap() instead of direct driver call"
This reverts commit c117925ace.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith ab5e559771 Revert "xfree86: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 4d1953728e.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 21de52dfbe Revert "xwayland: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 0132baa422.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 23dcedf8ba Revert "glx: use dixDestroyPixmap() instead of direct driver call"
This reverts commit 69837185c0.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith 8b47b53226 Revert "exa: simplify CreatePixmap()/DestroyPixmap() handlers error pathes"
This reverts commit ee798cf212.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Alan Coopersmith e48b1aaa97 Revert "dix: add in-code docs for dixDestroyPixmap()"
This reverts commit b61647f3a1.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2020>
2025-06-17 20:02:16 +00:00
Olivier Fourdan 0235121c6a xfree86: Check for RandR provider functions
Changing XRandR provider properties if the driver has set no provider
function such as the modesetting driver will cause a NULL pointer
dereference and a crash of the Xorg server.

Related to CVE-2025-49180

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 14:21:24 +02:00
Olivier Fourdan 3c3a4b767b randr: Check for overflow in RRChangeProviderProperty()
A client might send a request causing an integer overflow when computing
the total size to allocate in RRChangeProviderProperty().

To avoid the issue, check that total length in bytes won't exceed the
maximum integer value.

CVE-2025-49180

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 14:21:24 +02:00
Olivier Fourdan 2bde9ca49a record: Check for overflow in RecordSanityCheckRegisterClients()
The RecordSanityCheckRegisterClients() checks for the request length,
but does not check for integer overflow.

A client might send a very large value for either the number of clients
or the number of protocol ranges that will cause an integer overflow in
the request length computation, defeating the check for request length.

To avoid the issue, explicitly check the number of clients against the
limit of clients (which is much lower than an maximum integer value) and
the number of protocol ranges (multiplied by the record length) do not
exceed the maximum integer value.

This way, we ensure that the final computation for the request length
will not overflow the maximum integer limit.

CVE-2025-49179

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 14:21:24 +02:00
Olivier Fourdan d55c54cecb os: Account for bytes to ignore when sharing input buffer
When reading requests from the clients, the input buffer might be shared
and used between different clients.

If a given client sends a full request with non-zero bytes to ignore,
the bytes to ignore may still be non-zero even though the request is
full, in which case the buffer could be shared with another client who's
request will not be processed because of those bytes to ignore, leading
to a possible hang of the other client request.

To avoid the issue, make sure we have zero bytes to ignore left in the
input request when sharing the input buffer with another client.

CVE-2025-49178

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 14:21:24 +02:00
Olivier Fourdan ab02fb96b1 xfixes: Check request length for SetClientDisconnectMode
The handler of XFixesSetClientDisconnectMode does not check the client
request length.

A client could send a shorter request and read data from a former
request.

Fix the issue by checking the request size matches.

CVE-2025-49177

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Fixes: e167299f6 - xfixes: Add ClientDisconnectMode
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 14:21:24 +02:00
Olivier Fourdan 03731b326a os: Do not overflow the integer size with BigRequest
The BigRequest extension allows requests larger than the 16-bit length
limit.

It uses integers for the request length and checks for the size not to
exceed the maxBigRequestSize limit, but does so after translating the
length to integer by multiplying the given size in bytes by 4.

In doing so, it might overflow the integer size limit before actually
checking for the overflow, defeating the purpose of the test.

To avoid the issue, make sure to check that the request size does not
overflow the maxBigRequestSize limit prior to any conversion.

The caller Dispatch() function however expects the return value to be in
bytes, so we cannot just return the converted value in case of error, as
that would also overflow the integer size.

To preserve the existing API, we use a negative value for the X11 error
code BadLength as the function only return positive values, 0 or -1 and
update the caller Dispatch() function to take that case into account to
return the error code to the offending client.

CVE-2025-49176

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 14:21:10 +02:00
Olivier Fourdan 0885e0b262 render: Avoid 0 or less animated cursors
Animated cursors use a series of cursors that the client can set.

By default, the Xserver assumes at least one cursor is specified
while a client may actually pass no cursor at all.

That causes an out-of-bound read creating the animated cursor and a
crash of the Xserver:

 | Invalid read of size 8
 |    at 0x5323F4: AnimCursorCreate (animcur.c:325)
 |    by 0x52D4C5: ProcRenderCreateAnimCursor (render.c:1817)
 |    by 0x52DC80: ProcRenderDispatch (render.c:1999)
 |    by 0x4A1E9D: Dispatch (dispatch.c:560)
 |    by 0x4B0169: dix_main (main.c:284)
 |    by 0x4287F5: main (stubmain.c:34)
 |  Address 0x59aa010 is 0 bytes after a block of size 0 alloc'd
 |    at 0x48468D3: reallocarray (vg_replace_malloc.c:1803)
 |    by 0x52D3DA: ProcRenderCreateAnimCursor (render.c:1802)
 |    by 0x52DC80: ProcRenderDispatch (render.c:1999)
 |    by 0x4A1E9D: Dispatch (dispatch.c:560)
 |    by 0x4B0169: dix_main (main.c:284)
 |    by 0x4287F5: main (stubmain.c:34)
 |
 | Invalid read of size 2
 |    at 0x5323F7: AnimCursorCreate (animcur.c:325)
 |    by 0x52D4C5: ProcRenderCreateAnimCursor (render.c:1817)
 |    by 0x52DC80: ProcRenderDispatch (render.c:1999)
 |    by 0x4A1E9D: Dispatch (dispatch.c:560)
 |    by 0x4B0169: dix_main (main.c:284)
 |    by 0x4287F5: main (stubmain.c:34)
 |  Address 0x8 is not stack'd, malloc'd or (recently) free'd

To avoid the issue, check the number of cursors specified and return a
BadValue error in both the proc handler (early) and the animated cursor
creation (as this is a public function) if there is 0 or less cursor.

CVE-2025-49175

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 14:18:58 +02:00
Alan Coopersmith 3bdb541e04 Revert "os: move BUG_*() macros to own private header"
This reverts commit 346d5f5c35.
That commit did not handle copyright/license notices correctly.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2019>
2025-06-13 17:13:54 -07:00
Alan Coopersmith 538a6dd76f Revert "xfree86: mark LoaderShouldIgnoreABI() and LoaderGetABIVersion() deprecated"
This reverts commit 4f2c6c98b7.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2017>
2025-06-13 22:48:22 +00:00
Alan Coopersmith c7b69f1acb Revert "misc.h: drop LengthRestB() macro"
This reverts commit a6b2eb3780

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2015>
2025-06-13 22:30:27 +00:00
Alan Coopersmith cd583932a1 Revert "misc.h: move out checked_int64_(add|subtract)"
This reverts commit de0aed0543

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2014>
2025-06-13 22:13:22 +00:00
Alan Coopersmith 55ad737a9f Revert "misc.h: move out MAXEXTENSIONS to geext.c"
This reverts commit 80593ab279.

This is a fundamental property of the X11 core protocol,
there is no benefit to hiding it, it can't change.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2013>
2025-06-13 22:03:45 +00:00
Marge Bot ff8d250589 Merge branch 'xrandr-reverts' into 'master'
Revert "randr cleanups"

See merge request xorg/xserver!2012
2025-06-13 21:58:15 +00:00
Alan Coopersmith e3d0666386 Revert "randr: let SProc*'s call their Proc*'s directly"
This reverts commit ed17224403.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:44:43 -07:00
Alan Coopersmith c35a285398 Revert "randr: use explicit case statement instead of ProcRandrVector table"
This reverts commit 42677ae1e3.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:44:30 -07:00
Alan Coopersmith bc76e25994 Revert "randr: use explicit case statement instead of SProcRandrVector table"
This reverts commit 058815bed1.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:44:17 -07:00
Alan Coopersmith 9f72353a51 Revert "randr: RRCrtcCreate(): drop unnecessary zero assigments"
This reverts commit 6d2c42d0c8.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:44:02 -07:00
Alan Coopersmith 160abf285c Revert "randr: use struct initializer for reply structs"
This reverts commit 7eff742ef2.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:43:47 -07:00
Alan Coopersmith 9c53c6cf76 Revert "randr: ProcRRGetCrtcInfo(): use locally scoped variables"
This reverts commit 90abc95c85.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:43:36 -07:00
Alan Coopersmith c371d11af0 Revert "randr: ProcRRGetCrtcTransform(): split reply header and payload"
This reverts commit c6f1b8a735.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:43:23 -07:00
Alan Coopersmith 9b753c3970 Revert "randr: ProcRRGetMonitors() use SwapLongs instead of callbacks"
This reverts commit 203f59c6d3.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:43:00 -07:00
Alan Coopersmith a205917752 Revert "randr: ProcRRGetMonitors(): collect reply payload in temporary buffer"
This reverts commit 1bc6ca30a9.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:42:33 -07:00
Alan Coopersmith 896d9d3be8 Revert "randr: RROutputCreate(): use calloc()"
This reverts commit 3d3137513a.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:42:13 -07:00
Alan Coopersmith 9f2b9adbe3 Revert "randr: RRCreateProviderProperty(): use calloc()"
This reverts commit 05188ccec1.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:41:53 -07:00
Alan Coopersmith e77b465eb6 Revert "randr: ProcRRGetOutputProperty(): rename reply struct to "rep""
This reverts commit 53d43bd8dc.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:41:29 -07:00
Alan Coopersmith 01914b1c53 Revert "randr: ProcRRGetOutputProperty(): use SwapShort()/SwapLong()"
This reverts commit 8789be52a4.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:41:13 -07:00
Alan Coopersmith 3a76d12ef0 Revert "randr: ProcRRGetProviderProperty(): use SwapShort()/SwapLong()"
This reverts commit 62b8497999.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:40:33 -07:00
Alan Coopersmith bddafe4001 Revert "randr: ProcRRGetCrtcGamma(): use SwapShort()/SwapLong()"
This reverts commit d9863f7cb0.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:38:23 -07:00
Alan Coopersmith 6a0c430b25 Revert "randr: ProcRRListOutputProperties(): use SwapShort()/SwapLong()"
This reverts commit e3001b71b3.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:38:12 -07:00
Alan Coopersmith 8650028e59 Revert "randr: ProcRRQueryOutputProperty(): use SwapShort()/SwapLong()"
This reverts commit 73467faeb2.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:37:57 -07:00
Alan Coopersmith fc7858a458 Revert "randr: RRScreenInit(): drop unnecessary zero'ing"
This reverts commit 6fad884ce7.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:36:45 -07:00
Alan Coopersmith 36af7a5f9c Revert "randr: fix RRGetCrtcTransform reply length"
This reverts commit 0ca5aaba50.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:36:22 -07:00
Alan Coopersmith eca05b85f9 Revert "randr: fix RRGetCrtcTransform reply length, part 2"
This reverts commit 53876f1ef1.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
2025-06-11 13:35:44 -07:00
Olivier Fourdan 8cb078f8b6 xwayland: Do not pretend leaving the X11 surface if buttons are down
Xwayland has its own XYToWindow() handler to account for the case when
the pointer leaves an X11 surface to enter another Wayland native
window.

When that occurs, Xwayland will treat it as if the pointer had entered
the root window so that the X11 clients receive an appropriate leave
event.

When the pointer leaves the X11 surface, Xwayland will call
CheckMotion() to update the sprite coordinates and possibly the cursor.

However, if we left the surface with a button down, it means the wayland
compositor has grabbed the pointer so we will not get button release
events from the compositor.

Once the button is released, Xwayland will get a pointer enter event from
the compositor, and Xwayland will clear up the buttons pressed.

But that might confuse Xwayland in thinking the pointer has crossed the
windows and leave the wrong cursor showing in the X11 surface.

To avoid the issue, if buttons are down, do not pretend the cursor has
left the X11 surface for the root window.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1811
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2008>
2025-06-05 07:29:03 +00:00
Olivier Fourdan 8a77ab083f Revert "xwayland: Update sprite prior to clearing the focus window"
This breaks regular toplevel enter/leave events when crossing to/from a
native Wayland window.

A better fix for the original issue follows.

This reverts commit b97b459c06.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2008>
2025-06-05 07:29:03 +00:00
211 changed files with 2051 additions and 1762 deletions

View File

@ -46,8 +46,6 @@ Equipment Corporation.
#include "windowstr.h"
#include "protocol-versions.h"
Bool noDPMSExtension = FALSE;
CARD16 DPMSPowerLevel = 0;
Bool DPMSDisabledSwitch = FALSE;
CARD32 DPMSStandbyTime = -1;

View File

@ -31,8 +31,6 @@
#include "protocol-versions.h"
#include "extinit_priv.h"
#define MAXEXTENSIONS 128
DevPrivateKeyRec GEClientPrivateKeyRec;
#define GEClientPrivateKey (&GEClientPrivateKeyRec)
@ -212,3 +210,14 @@ GERegisterExtension(int extension,
/* extension opcodes are > 128, might as well save some space here */
GEExtensions[EXT_MASK(extension)].evswap = ev_swap;
}
/* Sets type and extension field for a generic event. This is just an
* auxiliary function, extensions could do it manually too.
*/
void
GEInitEvent(xGenericEvent *ev, int extension)
{
ev->type = GenericEvent;
ev->extension = extension;
ev->length = 0;
}

View File

@ -38,4 +38,6 @@ extern _X_EXPORT void GERegisterExtension(int extension,
xGenericEvent
*to));
extern _X_EXPORT void GEInitEvent(xGenericEvent *ev, int extension);
#endif /* _GEEXT_H_ */

View File

@ -44,6 +44,7 @@ endif
if build_xinerama
srcs_xext += ['panoramiX.c', 'panoramiXprocs.c', 'panoramiXSwap.c']
hdrs_xext += ['panoramiX.h', 'panoramiXsrv.h']
endif
if build_xsecurity

View File

@ -63,9 +63,6 @@ extern VisualPtr glxMatchVisual(ScreenPtr pScreen,
VisualPtr pVisual, ScreenPtr pMatchScreen);
#endif
/* Xinerama is disabled by default unless enabled via +xinerama */
Bool noPanoramiXExtension = TRUE;
/*
* PanoramiX data declarations
*/

View File

@ -67,8 +67,6 @@ in this Software without prior written authorization from the X Consortium.
// see: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355
#undef CreateWindow
Bool noScreenSaverExtension = FALSE;
static int ScreenSaverEventBase = 0;
static Bool ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force);
@ -277,10 +275,13 @@ setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask)
static void
FreeAttrs(ScreenSaverAttrPtr pAttr)
{
PixmapPtr pPixmap;
CursorPtr pCursor;
dixDestroyPixmap(pAttr->pBackgroundPixmap, 0);
dixDestroyPixmap(pAttr->pBorderPixmap, 0);
if ((pPixmap = pAttr->pBackgroundPixmap) != 0)
(*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
if ((pPixmap = pAttr->pBorderPixmap) != 0)
(*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
if ((pCursor = pAttr->pCursor) != 0)
FreeCursor(pCursor, (Cursor) 0);
}
@ -600,6 +601,7 @@ ProcScreenSaverQueryVersion(ClientPtr client)
xScreenSaverQueryVersionReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.majorVersion = SERVER_SAVER_MAJOR_VERSION,
.minorVersion = SERVER_SAVER_MINOR_VERSION
};
@ -608,6 +610,7 @@ ProcScreenSaverQueryVersion(ClientPtr client)
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
@ -619,6 +622,7 @@ static int
ProcScreenSaverQueryInfo(ClientPtr client)
{
REQUEST(xScreenSaverQueryInfoReq);
xScreenSaverQueryInfoReply rep;
int rc;
ScreenSaverStuffPtr pSaver;
DrawablePtr pDraw;
@ -640,24 +644,30 @@ ProcScreenSaverQueryInfo(ClientPtr client)
UpdateCurrentTime();
lastInput = GetTimeInMillis() - LastEventTime(XIAllDevices).milliseconds;
xScreenSaverQueryInfoReply rep = {
rep = (xScreenSaverQueryInfoReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.window = pSaver->wid
};
if (screenIsSaved != SCREEN_SAVER_OFF) {
rep.state = ScreenSaverOn;
if (ScreenSaverTime)
rep.tilOrSince = lastInput - ScreenSaverTime;
else
rep.tilOrSince = 0;
}
else {
if (ScreenSaverTime) {
rep.state = ScreenSaverOff;
if (ScreenSaverTime >= lastInput)
if (ScreenSaverTime < lastInput)
rep.tilOrSince = 0;
else
rep.tilOrSince = ScreenSaverTime - lastInput;
}
else {
rep.state = ScreenSaverDisabled;
rep.tilOrSince = 0;
}
}
rep.idle = lastInput;
@ -670,6 +680,7 @@ ProcScreenSaverQueryInfo(ClientPtr client)
rep.kind = ScreenSaverInternal;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.window);
swapl(&rep.tilOrSince);
swapl(&rep.idle);
@ -1241,26 +1252,23 @@ ProcScreenSaverSuspend(ClientPtr client)
return Success;
}
static int (*NormalVector[]) (ClientPtr /* client */ ) = {
ProcScreenSaverQueryVersion,
ProcScreenSaverQueryInfo,
ProcScreenSaverSelectInput,
ProcScreenSaverSetAttributes,
ProcScreenSaverUnsetAttributes,
ProcScreenSaverSuspend,
};
static int
ProcScreenSaverDispatch(ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data) {
case X_ScreenSaverQueryVersion:
return ProcScreenSaverQueryVersion(client);
case X_ScreenSaverQueryInfo:
return ProcScreenSaverQueryInfo(client);
case X_ScreenSaverSelectInput:
return ProcScreenSaverSelectInput(client);
case X_ScreenSaverSetAttributes:
return ProcScreenSaverSetAttributes(client);
case X_ScreenSaverUnsetAttributes:
return ProcScreenSaverUnsetAttributes(client);
case X_ScreenSaverSuspend:
return ProcScreenSaverSuspend(client);
default:
return BadRequest;
}
if (stuff->data < ARRAY_SIZE(NormalVector))
return (*NormalVector[stuff->data]) (client);
return BadRequest;
}
static int _X_COLD
@ -1317,26 +1325,23 @@ SProcScreenSaverSuspend(ClientPtr client)
return ProcScreenSaverSuspend(client);
}
static int (*SwappedVector[]) (ClientPtr /* client */ ) = {
ProcScreenSaverQueryVersion,
SProcScreenSaverQueryInfo,
SProcScreenSaverSelectInput,
SProcScreenSaverSetAttributes,
SProcScreenSaverUnsetAttributes,
SProcScreenSaverSuspend,
};
static int _X_COLD
SProcScreenSaverDispatch(ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data) {
case X_ScreenSaverQueryVersion:
return ProcScreenSaverQueryVersion(client);
case X_ScreenSaverQueryInfo:
return SProcScreenSaverQueryInfo(client);
case X_ScreenSaverSelectInput:
return SProcScreenSaverSelectInput(client);
case X_ScreenSaverSetAttributes:
return SProcScreenSaverSetAttributes(client);
case X_ScreenSaverUnsetAttributes:
return SProcScreenSaverUnsetAttributes(client);
case X_ScreenSaverSuspend:
return SProcScreenSaverSuspend(client);
default:
return BadRequest;
}
if (stuff->data < ARRAY_SIZE(NormalVector))
return (*SwappedVector[stuff->data]) (client);
return BadRequest;
}
void

View File

@ -49,8 +49,6 @@ in this Software without prior written authorization from The Open Group.
#include "extinit.h"
#include "protocol-versions.h"
Bool noSecurityExtension = FALSE;
/* Extension stuff */
static int SecurityErrorBase; /* first Security error number */
static int SecurityEventBase; /* first Security event number */

View File

@ -48,8 +48,6 @@ in this Software without prior written authorization from The Open Group.
#include "extinit_priv.h"
#include "protocol-versions.h"
Bool noShapeExtension = FALSE;
typedef RegionPtr (*CreateDftPtr) (WindowPtr /* pWin */
);

View File

@ -101,8 +101,6 @@ typedef struct _ShmScrPrivateRec {
DestroyPixmapProcPtr destroyPixmap;
} ShmScrPrivateRec;
Bool noMITShmExtension = FALSE;
static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS);
static int ShmDetachSegment(void *value, XID shmseg);
static void ShmResetProc(ExtensionEntry *extEntry);
@ -512,7 +510,7 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
else
(void) (*pGC->ops->CopyArea) (&pPixmap->drawable, dst, pGC, 0, 0,
sw, sh, dx, dy);
dixDestroyPixmap(pPixmap, 0);
(*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
}
}
@ -1002,7 +1000,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
result = XaceHookResourceAccess(client, stuff->pid,
X11_RESTYPE_PIXMAP, pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (result != Success) {
dixDestroyPixmap(pMap, 0);
pDraw->pScreen->DestroyPixmap(pMap);
break;
}
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);
@ -1046,7 +1044,7 @@ fbShmCreatePixmap(ScreenPtr pScreen,
BitsPerPixel(depth),
PixmapBytePad(width, depth),
(void *) addr)) {
dixDestroyPixmap(pPixmap, 0);
(*pScreen->DestroyPixmap) (pPixmap);
return NullPixmap;
}
return pPixmap;
@ -1117,7 +1115,7 @@ ProcShmCreatePixmap(ClientPtr client)
rc = XaceHookResourceAccess(client, stuff->pid, X11_RESTYPE_PIXMAP,
pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (rc != Success) {
dixDestroyPixmap(pMap, 0);
pDraw->pScreen->DestroyPixmap(pMap);
return rc;
}
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);

View File

@ -59,7 +59,6 @@ PERFORMANCE OF THIS SOFTWARE.
#include <X11/extensions/syncproto.h>
#include "dix/dix_priv.h"
#include "os/bug_priv.h"
#include "os/osdep.h"
#include "scrnintstr.h"
@ -312,35 +311,6 @@ SyncCheckTriggerFence(SyncTrigger * pTrigger, int64_t unused)
return (pFence == NULL || pFence->funcs.CheckTriggered(pFence));
}
static inline Bool
checked_int64_add(int64_t *out, int64_t a, int64_t b)
{
/* Do the potentially overflowing math as uint64_t, as signed
* integers in C are undefined on overflow (and the compiler may
* optimize out our overflow check below, otherwise)
*/
int64_t result = (uint64_t)a + (uint64_t)b;
/* signed addition overflows if operands have the same sign, and
* the sign of the result doesn't match the sign of the inputs.
*/
Bool overflow = (a < 0) == (b < 0) && (a < 0) != (result < 0);
*out = result;
return overflow;
}
static inline Bool
checked_int64_subtract(int64_t *out, int64_t a, int64_t b)
{
int64_t result = (uint64_t)a - (uint64_t)b;
Bool overflow = (a < 0) != (b < 0) && (a < 0) != (result < 0);
*out = result;
return overflow;
}
static int
SyncInitTrigger(ClientPtr client, SyncTrigger * pTrigger, XID syncObject,
RESTYPE resType, Mask changes)

View File

@ -69,8 +69,6 @@
#include "xf86bigfontsrv.h"
Bool noXFree86BigfontExtension = FALSE;
static void XF86BigfontResetProc(ExtensionEntry *extEntry );
#ifdef MITSHM

View File

@ -34,8 +34,6 @@
#include "compint.h"
#endif
Bool noResExtension = FALSE;
/** @brief Holds fragments of responses for ConstructClientIds.
*
* note: there is no consideration for data alignment */

View File

@ -61,8 +61,6 @@
#include "inpututils.h"
#include "extinit_priv.h"
Bool noTestExtensions = FALSE;
/* XTest events are sent during request processing and may be interrupted by
* a SIGIO. We need a separate event list to avoid events overwriting each
* other's memory.

View File

@ -20,6 +20,7 @@
#include <X11/extensions/Xvproto.h>
#include <X11/extensions/XvMCproto.h>
#include "xvmcext.h"
#include "protocol-versions.h"
#ifdef HAS_XVMCSHM
#include <sys/ipc.h>
@ -27,9 +28,6 @@
#include <sys/shm.h>
#endif /* HAS_XVMCSHM */
#define SERVER_XVMC_MAJOR_VERSION 1
#define SERVER_XVMC_MINOR_VERSION 1
#define DR_CLIENT_DRIVER_NAME_SIZE 48
#define DR_BUSID_SIZE 48

View File

@ -81,7 +81,6 @@ SOFTWARE.
#include <dix-config.h>
#include "dix/cursor_priv.h"
#include "os/bug_priv.h"
#include <X11/X.h>
#include <X11/Xproto.h>

View File

@ -47,7 +47,6 @@
#include "dix/dix_priv.h"
#include "dix/input_priv.h"
#include "mi/mi_priv.h"
#include "os/bug_priv.h"
#include "xibarriers.h"
#include "scrnintstr.h"

View File

@ -41,7 +41,6 @@
#include "dix/dix_priv.h"
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
#include "os/bug_priv.h"
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */

View File

@ -309,7 +309,7 @@ compFreeClientWindow(WindowPtr pWin, XID id)
if (pPixmap) {
compRestoreWindow(pWin, pPixmap);
dixDestroyPixmap(pPixmap, 0);
(*pScreen->DestroyPixmap) (pPixmap);
}
}

View File

@ -49,8 +49,6 @@
#include "compint.h"
#include "compositeext.h"
Bool noCompositeExtension = FALSE;
DevPrivateKeyRec CompScreenPrivateKeyRec;
DevPrivateKeyRec CompWindowPrivateKeyRec;
DevPrivateKeyRec CompSubwindowsPrivateKeyRec;

View File

@ -180,7 +180,7 @@ compCheckRedirect(WindowPtr pWin)
compSetParentPixmap(pWin);
compRestoreWindow(pWin, pPixmap);
dixDestroyPixmap(pPixmap, 0);
(*pScreen->DestroyPixmap) (pPixmap);
}
}
else if (should) {
@ -378,11 +378,13 @@ compImplicitRedirect(WindowPtr pWin, WindowPtr pParent)
static void
compFreeOldPixmap(WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
if (pWin->redirectDraw != RedirectDrawNone) {
CompWindowPtr cw = GetCompWindow(pWin);
if (cw->pOldPixmap) {
dixDestroyPixmap(cw->pOldPixmap, 0);
(*pScreen->DestroyPixmap) (cw->pOldPixmap);
cw->pOldPixmap = NullPixmap;
}
}
@ -615,7 +617,7 @@ compDestroyWindow(WindowPtr pWin)
PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin);
compSetParentPixmap(pWin);
dixDestroyPixmap(pPixmap, 0);
(*pScreen->DestroyPixmap) (pPixmap);
}
ret = (*pScreen->DestroyWindow) (pWin);
cs->DestroyWindow = pScreen->DestroyWindow;

View File

@ -24,7 +24,6 @@
#include <dix-config.h>
#include "dix/dix_priv.h"
#include "os/client_priv.h"
#include "damageextint.h"
#include "damagestr.h"
@ -54,8 +53,6 @@ static DevPrivateKeyRec DamageClientPrivateKeyRec;
#define DamageClientPrivateKey (&DamageClientPrivateKeyRec)
Bool noDamageExtension = FALSE;
static void
DamageNoteCritical(ClientPtr pClient)
{

View File

@ -51,7 +51,6 @@
#include "xace.h"
/* GLOBALS */
Bool noDbeExtension = FALSE;
/* These are globals for use by DDX */
DevPrivateKeyRec dbeScreenPrivKeyRec;

View File

@ -162,7 +162,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
(*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width,
pDbeWindowPriv->height,
pWin->drawable.depth, 0))) {
dixDestroyPixmap(pDbeWindowPriv->pFrontBuffer, 0);
(*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
return BadAlloc;
}
@ -426,11 +426,14 @@ miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId)
*/
/* Destroy the front and back pixmaps. */
if (pDbeWindowPriv->pFrontBuffer)
dixDestroyPixmap(pDbeWindowPriv->pFrontBuffer, 0);
if (pDbeWindowPriv->pBackBuffer)
dixDestroyPixmap(pDbeWindowPriv->pBackBuffer, 0);
if (pDbeWindowPriv->pFrontBuffer) {
(*pDbeWindowPriv->pWindow->drawable.pScreen->
DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
}
if (pDbeWindowPriv->pBackBuffer) {
(*pDbeWindowPriv->pWindow->drawable.pScreen->
DestroyPixmap) (pDbeWindowPriv->pBackBuffer);
}
} /* miDbeWinPrivDelete() */
/******************************************************************************
@ -582,8 +585,13 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
if (!pFrontBuffer || !pBackBuffer) {
/* We failed at creating 1 or 2 of the pixmaps. */
dixDestroyPixmap(pFrontBuffer, 0);
dixDestroyPixmap(pBackBuffer, 0);
if (pFrontBuffer) {
(*pScreen->DestroyPixmap) (pFrontBuffer);
}
if (pBackBuffer) {
(*pScreen->DestroyPixmap) (pBackBuffer);
}
/* Destroy all buffers for this window. */
while (pDbeWindowPriv) {
@ -634,8 +642,8 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
* pixmaps.
*/
dixDestroyPixmap(pDbeWindowPriv->pFrontBuffer, 0);
dixDestroyPixmap(pDbeWindowPriv->pBackBuffer, 0);
(*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
(*pScreen->DestroyPixmap) (pDbeWindowPriv->pBackBuffer);
pDbeWindowPriv->pFrontBuffer = pFrontBuffer;
pDbeWindowPriv->pBackBuffer = pBackBuffer;

View File

@ -33,9 +33,6 @@ int TellGainedMap(WindowPtr pwin, void *value);
int CopyColormapAndFree(Colormap mid, ColormapPtr pSrc, int client);
int AllocColor(ColormapPtr pmap, unsigned short *pred, unsigned short *pgreen,
unsigned short *pblue, Pixel *pPix, int client );
void FakeAllocColor(ColormapPtr pmap, xColorItem *item);
void FakeFreeColor(ColormapPtr pmap, Pixel pixel);

View File

@ -51,7 +51,6 @@ SOFTWARE.
#include "dix/cursor_priv.h"
#include "dix/dix_priv.h"
#include "os/bug_priv.h"
#include "servermd.h"
#include "scrnintstr.h"

View File

@ -61,7 +61,6 @@ SOFTWARE.
#include "dix/input_priv.h"
#include "dix/ptrveloc_priv.h"
#include "mi/mi_priv.h"
#include "os/bug_priv.h"
#include "os/osdep.h"
#include "xkb/xkbsrv_priv.h"

View File

@ -527,9 +527,10 @@ Dispatch(void)
/* now, finally, deal with client requests */
result = ReadRequestFromClient(client);
if (result <= 0) {
if (result < 0)
CloseDownClient(client);
if (result == 0)
break;
else if (result == -1) {
CloseDownClient(client);
break;
}
@ -550,7 +551,7 @@ Dispatch(void)
client->index,
client->requestBuffer);
#endif
if (result > (maxBigRequestSize << 2))
if (result < 0 || result > (maxBigRequestSize << 2))
result = BadLength;
else {
result = XaceHookDispatch(client, client->majorOp);
@ -1524,7 +1525,7 @@ ProcCreatePixmap(ClientPtr client)
rc = XaceHookResourceAccess(client, stuff->pid, X11_RESTYPE_PIXMAP,
pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (rc != Success) {
dixDestroyPixmap(pMap, 0);
(*pDraw->pScreen->DestroyPixmap) (pMap);
return rc;
}
if (AddResource(stuff->pid, X11_RESTYPE_PIXMAP, (void *) pMap))

View File

@ -2026,18 +2026,12 @@ static uint32_t wrap_time_in_millis(void)
return GetTimeInMillis();
}
static void verrorf(const char *f, va_list args) _X_ATTRIBUTE_PRINTF(1, 0);
static void verrorf(const char *f, va_list args)
{
LogVMessageVerb(X_NONE, -1, f, args);
}
static const xfont2_client_funcs_rec xfont2_client_funcs = {
.version = XFONT2_CLIENT_FUNCS_VERSION,
.client_auth_generation = _client_auth_generation,
.client_signal = ClientSignal,
.delete_font_client_id = delete_font_client_id,
.verrorf = verrorf,
.verrorf = VErrorF,
.find_old_font = find_old_font,
.get_client_resolutions = get_client_resolutions,
.get_default_point_size = get_default_point_size,

View File

@ -34,7 +34,6 @@
#include "dix/dix_priv.h"
#include "dix/eventconvert.h"
#include "dix/input_priv.h"
#include "os/bug_priv.h"
#include "inputstr.h"
#include "windowstr.h"

View File

@ -124,8 +124,6 @@ Equipment Corporation.
#include "dix/input_priv.h"
#include "dix/eventconvert.h"
#include "dix/exevents_priv.h"
#include "os/bug_priv.h"
#include "os/client_priv.h"
#include "os/fmt.h"
#include "xkb/xkbsrv_priv.h"

View File

@ -254,7 +254,7 @@ ChangeGC(ClientPtr client, GC * pGC, BITS32 mask, ChangeGCValPtr pUnion)
else {
pPixmap->refcnt++;
if (!pGC->tileIsPixel)
dixDestroyPixmap(pGC->tile.pixmap, 0);
(*pGC->pScreen->DestroyPixmap) (pGC->tile.pixmap);
pGC->tileIsPixel = FALSE;
pGC->tile.pixmap = pPixmap;
}
@ -271,7 +271,7 @@ ChangeGC(ClientPtr client, GC * pGC, BITS32 mask, ChangeGCValPtr pUnion)
if (pPixmap)
pPixmap->refcnt++;
if (pGC->stipple)
dixDestroyPixmap(pGC->stipple, 0);
(*pGC->pScreen->DestroyPixmap) (pGC->stipple);
pGC->stipple = pPixmap;
}
break;
@ -588,7 +588,8 @@ CreateDefaultTile(GCPtr pGC)
(*pGC->pScreen->CreatePixmap) (pGC->pScreen, w, h, pGC->depth, 0);
pgcScratch = GetScratchGC(pGC->depth, pGC->pScreen);
if (!pTile || !pgcScratch) {
dixDestroyPixmap(pTile, 0);
if (pTile)
(*pTile->drawable.pScreen->DestroyPixmap) (pTile);
if (pgcScratch)
FreeScratchGC(pgcScratch);
return FALSE;
@ -667,7 +668,7 @@ CopyGC(GC * pgcSrc, GC * pgcDst, BITS32 mask)
break;
}
if (!pgcDst->tileIsPixel)
dixDestroyPixmap(pgcDst->tile.pixmap, 0);
(*pgcDst->pScreen->DestroyPixmap) (pgcDst->tile.pixmap);
pgcDst->tileIsPixel = pgcSrc->tileIsPixel;
pgcDst->tile = pgcSrc->tile;
if (!pgcDst->tileIsPixel)
@ -679,7 +680,7 @@ CopyGC(GC * pgcSrc, GC * pgcDst, BITS32 mask)
if (pgcDst->stipple == pgcSrc->stipple)
break;
if (pgcDst->stipple)
dixDestroyPixmap(pgcDst->stipple, 0);
(*pgcDst->pScreen->DestroyPixmap) (pgcDst->stipple);
pgcDst->stipple = pgcSrc->stipple;
if (pgcDst->stipple)
pgcDst->stipple->refcnt++;
@ -774,9 +775,9 @@ FreeGC(void *value, XID gid)
(*pGC->funcs->DestroyClip) (pGC);
if (!pGC->tileIsPixel)
dixDestroyPixmap(pGC->tile.pixmap, 0);
(*pGC->pScreen->DestroyPixmap) (pGC->tile.pixmap);
if (pGC->stipple)
dixDestroyPixmap(pGC->stipple, 0);
(*pGC->pScreen->DestroyPixmap) (pGC->stipple);
if (pGC->funcs)
(*pGC->funcs->DestroyGC) (pGC);
@ -884,7 +885,7 @@ CreateDefaultStipple(int screenNum)
tmpval[2].val = FillSolid;
pgcScratch = GetScratchGC(1, pScreen);
if (!pgcScratch) {
dixDestroyPixmap(pScreen->defaultStipple, 0);
(*pScreen->DestroyPixmap) (pScreen->defaultStipple);
return FALSE;
}
(void) ChangeGC(NullClient, pgcScratch,
@ -904,7 +905,8 @@ void
FreeDefaultStipple(int screenNum)
{
ScreenPtr pScreen = screenInfo.screens[screenNum];
dixDestroyPixmap(pScreen->defaultStipple, 0);
(*pScreen->DestroyPixmap) (pScreen->defaultStipple);
}
int

View File

@ -30,7 +30,6 @@
#include "dix/eventconvert.h"
#include "dix/input_priv.h"
#include "mi/mi_priv.h"
#include "os/bug_priv.h"
#include "inputstr.h"
#include "scrnintstr.h"

View File

@ -42,7 +42,6 @@
#include "dix/input_priv.h"
#include "mi/mi_priv.h"
#include "os/bug_priv.h"
#include "misc.h"
#include "resource.h"
@ -1965,8 +1964,8 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
ti = TouchFindByDDXID(dev, ddx_touchid, (type == XI_TouchBegin));
if (!ti) {
ErrorF("[dix] %s: unable to %s touch point %u\n", dev->name,
type == XI_TouchBegin ? "begin" : "find", ddx_touchid);
ErrorFSigSafe("[dix] %s: unable to %s touch point %u\n", dev->name,
type == XI_TouchBegin ? "begin" : "find", ddx_touchid);
return 0;
}
client_id = ti->client_id;
@ -1999,14 +1998,16 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
if (!mask_in ||
!valuator_mask_isset(mask_in, 0) ||
!valuator_mask_isset(mask_in, 1)) {
ErrorF("%s: Attempted to start touch without x/y (driver bug)\n", dev->name);
ErrorFSigSafe("%s: Attempted to start touch without x/y "
"(driver bug)\n", dev->name);
return 0;
}
break;
case XI_TouchUpdate:
event->type = ET_TouchUpdate;
if (!mask_in || valuator_mask_num_valuators(mask_in) <= 0) {
ErrorF("%s: TouchUpdate with no valuators? Driver bug\n", dev->name);
ErrorFSigSafe("%s: TouchUpdate with no valuators? Driver bug\n",
dev->name);
}
break;
case XI_TouchEnd:

View File

@ -96,7 +96,8 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm,
CREATE_PIXMAP_USAGE_SCRATCH);
pGC = GetScratchGC(1, pScreen);
if (!ppix || !pGC) {
dixDestroyPixmap(ppix, 0);
if (ppix)
(*pScreen->DestroyPixmap) (ppix);
if (pGC)
FreeScratchGC(pGC);
free(pbits);
@ -126,7 +127,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm,
XYPixmap, 1, pbits);
*ppbits = (unsigned char *) pbits;
FreeScratchGC(pGC);
dixDestroyPixmap(ppix, 0);
(*pScreen->DestroyPixmap) (ppix);
return Success;
}

View File

@ -27,7 +27,6 @@
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
#include "os/bug_priv.h"
#include "exglobals.h"
#include "misc.h"

View File

@ -63,7 +63,7 @@ GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth,
if ((*pScreen->ModifyPixmapHeader) (pPixmap, width, height, depth,
bitsPerPixel, devKind, pPixData))
return pPixmap;
dixDestroyPixmap(pPixmap, 0);
(*pScreen->DestroyPixmap) (pPixmap);
}
return NullPixmap;
}
@ -73,8 +73,9 @@ void
FreeScratchPixmapHeader(PixmapPtr pPixmap)
{
if (pPixmap) {
ScreenPtr pScreen = pPixmap->drawable.pScreen;
pPixmap->devPrivate.ptr = NULL; /* help catch/avoid heap-use-after-free */
dixDestroyPixmap(pPixmap, 0);
(*pScreen->DestroyPixmap)(pPixmap);
}
}
@ -150,7 +151,7 @@ PixmapPtr PixmapShareToSecondary(PixmapPtr pixmap, ScreenPtr secondary)
ret = secondary->SetSharedPixmapBacking(spix, handle);
if (ret == FALSE) {
dixDestroyPixmap(spix, 0);
secondary->DestroyPixmap(spix);
return NULL;
}

View File

@ -27,7 +27,6 @@
#include <math.h>
#include "dix/ptrveloc_priv.h"
#include "os/bug_priv.h"
#include <ptrveloc.h>
#include <exevents.h>
@ -79,7 +78,7 @@ DeletePredictableAccelerationProperties(DeviceIntPtr,
/*#define PTRACCEL_DEBUGGING*/
#ifdef PTRACCEL_DEBUGGING
#define DebugAccelF(...) ErrorF("dix/ptraccel: " __VA_ARGS__)
#define DebugAccelF(...) ErrorFSigSafe("dix/ptraccel: " __VA_ARGS__)
#else
#define DebugAccelF(...) /* */
#endif

View File

@ -756,7 +756,7 @@ SProcStoreColors(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
swapl(&stuff->cmap);
pItem = (xColorItem *) &stuff[1];
for (count = ((client->req_len << 2) - sizeof(xStoreColorsReq)) / sizeof(xColorItem); --count >= 0;)
for (count = LengthRestB(stuff) / sizeof(xColorItem); --count >= 0;)
SwapColorItem(pItem++);
return ((*ProcVector[X_StoreColors]) (client));
}

View File

@ -32,7 +32,6 @@
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
#include "mi/mi_priv.h"
#include "os/bug_priv.h"
#include "inputstr.h"
#include "scrnintstr.h"

View File

@ -1014,9 +1014,9 @@ FreeWindowResources(WindowPtr pWin)
if (wInputShape(pWin))
RegionDestroy(wInputShape(pWin));
if (pWin->borderIsPixel == FALSE)
dixDestroyPixmap(pWin->border.pixmap, 0);
(*pScreen->DestroyPixmap) (pWin->border.pixmap);
if (pWin->backgroundState == BackgroundPixmap)
dixDestroyPixmap(pWin->background.pixmap, 0);
(*pScreen->DestroyPixmap) (pWin->background.pixmap);
DeleteAllWindowProperties(pWin);
/* We SHOULD check for an error value here XXX */
@ -1195,7 +1195,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
borderRelative = TRUE;
if (pixID == None) {
if (pWin->backgroundState == BackgroundPixmap)
dixDestroyPixmap(pWin->background.pixmap, 0);
(*pScreen->DestroyPixmap) (pWin->background.pixmap);
if (!pWin->parent)
SetRootWindowBackground(pWin, pScreen, &index2);
else {
@ -1210,7 +1210,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
goto PatchUp;
}
if (pWin->backgroundState == BackgroundPixmap)
dixDestroyPixmap(pWin->background.pixmap, 0);
(*pScreen->DestroyPixmap) (pWin->background.pixmap);
if (!pWin->parent)
SetRootWindowBackground(pWin, pScreen, &index2);
else
@ -1229,7 +1229,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
goto PatchUp;
}
if (pWin->backgroundState == BackgroundPixmap)
dixDestroyPixmap(pWin->background.pixmap, 0);
(*pScreen->DestroyPixmap) (pWin->background.pixmap);
pWin->backgroundState = BackgroundPixmap;
pWin->background.pixmap = pPixmap;
pPixmap->refcnt++;
@ -1245,7 +1245,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
if (pWin->backgroundState == ParentRelative)
borderRelative = TRUE;
if (pWin->backgroundState == BackgroundPixmap)
dixDestroyPixmap(pWin->background.pixmap, 0);
(*pScreen->DestroyPixmap) (pWin->background.pixmap);
pWin->backgroundState = BackgroundPixel;
pWin->background.pixel = (CARD32) *pVlist;
/* background pixel overrides background pixmap,
@ -1264,7 +1264,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
}
if (pWin->parent->borderIsPixel == TRUE) {
if (pWin->borderIsPixel == FALSE)
dixDestroyPixmap(pWin->border.pixmap, 0);
(*pScreen->DestroyPixmap) (pWin->border.pixmap);
pWin->border = pWin->parent->border;
pWin->borderIsPixel = TRUE;
index2 = CWBorderPixel;
@ -1283,7 +1283,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
goto PatchUp;
}
if (pWin->borderIsPixel == FALSE)
dixDestroyPixmap(pWin->border.pixmap, 0);
(*pScreen->DestroyPixmap) (pWin->border.pixmap);
pWin->borderIsPixel = FALSE;
pWin->border.pixmap = pPixmap;
pPixmap->refcnt++;
@ -1296,7 +1296,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
break;
case CWBorderPixel:
if (pWin->borderIsPixel == FALSE)
dixDestroyPixmap(pWin->border.pixmap, 0);
(*pScreen->DestroyPixmap) (pWin->border.pixmap);
pWin->borderIsPixel = TRUE;
pWin->border.pixel = (CARD32) *pVlist;
/* border pixel overrides border pixmap,

View File

@ -600,7 +600,7 @@ are: REQUEST, REQUEST_SIZE_MATCH, REQUEST_AT_LEAST_SIZE,
REQUEST_FIXED_SIZE, LEGAL_NEW_RESOURCE, and
VALIDATE_DRAWABLE_AND_GC. Useful byte swapping macros can be found
in Xserver/include/dix.h: WriteReplyToClient and WriteSwappedDataToClient; and
in Xserver/include/misc.h: bswap_64, bswap_32, bswap_16, LengthRestS,
in Xserver/include/misc.h: bswap_64, bswap_32, bswap_16, LengthRestB, LengthRestS,
LengthRestL, SwapRestS, SwapRestL, swapl, swaps, cpswapl, and cpswaps.</para>
</section>
</section>
@ -859,7 +859,7 @@ Similarly, the X server or an extension may need to wait for some timeout.
Early X releases implemented this functionality using block and wakeup handlers,
but this has been rewritten to use a general timer facilty, and the
internal screen saver facilities reimplemented to use Timers.
These functions are TimerInit, TimerForce, TimerSet, TimerCancel,
These functions are TimerInit, TimerForce, TimerSet, TimerCheck, TimerCancel,
and TimerFree, as defined in Xserver/include/os.h. A callback function will be called
when the timer fires, along with the current time, and a user provided argument.
<blockquote><programlisting>
@ -892,6 +892,8 @@ for the timer entry.
Bool TimerForce(OsTimerPtr /* pTimer */)
void TimerCheck(void);
void TimerCancel(OsTimerPtr /* pTimer */)
void TimerFree(OsTimerPtr /* pTimer */)
@ -902,6 +904,7 @@ TimerInit frees any existing timer entries. TimerForce forces a call to the time
callback function and returns true if the timer entry existed, else it returns false and
does not call the callback function. TimerCancel will cancel the specified timer.
TimerFree calls TimerCancel and frees the specified timer.
Calling TimerCheck will force the server to see if any timer callbacks should be called.
</para>
</section>
</section>
@ -3054,14 +3057,6 @@ must deallocate the PixmapRec and all attached devPrivate blocks.
If successful, it returns TRUE.
See Xserver/fb/fbpixmap.c for the sample server implementation.</para>
<para>
Consumers should never ever call that proc directly, but call dixDestroyPixmap() instead.
</para>
<para>
If it's ever wrapped (by an extension), the wrapping handler must be written
in a way that it can always be called, even when the private structures are in
an half-initialized state (error pathes), so no extra unwrapping magic necessary.
</para>
<para>
<blockquote><programlisting>
Bool
@ -5045,6 +5040,7 @@ mi and fb implementations.</para>
<row><entry><function>StoreColors</function></entry><entry><literal>ddx</literal></entry><entry><para>Screen</para></entry></row>
<row><entry><function>Subtract</function></entry><entry><literal>mi</literal></entry><entry><para>Screen</para></entry></row>
<row><entry><function>TimerCancel</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
<row><entry><function>TimerCheck</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
<row><entry><function>TimerForce</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
<row><entry><function>TimerFree</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
<row><entry><function>TimerInit</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>

View File

@ -244,7 +244,7 @@ proc_dri3_pixmap_from_buffer(ClientPtr client)
pixmap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (rc != Success) {
dixDestroyPixmap(pixmap, 0);
(*drawable->pScreen->DestroyPixmap) (pixmap);
return rc;
}
if (!AddResource(stuff->pixmap, X11_RESTYPE_PIXMAP, (void *) pixmap))
@ -508,7 +508,7 @@ proc_dri3_pixmap_from_buffers(ClientPtr client)
pixmap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (rc != Success) {
dixDestroyPixmap(pixmap, 0);
(*screen->DestroyPixmap) (pixmap);
return rc;
}
if (!AddResource(stuff->pixmap, X11_RESTYPE_PIXMAP, (void *) pixmap))

View File

@ -96,9 +96,10 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
pExaPixmap->fb_size = pExaPixmap->fb_pitch * h;
if (pExaPixmap->fb_pitch > 131071) {
// don't need to protect from calling our own (wrapped) DestroyPixmap
// handler, because it can deal with half-initialized state
dixDestroyPixmap(pPixmap, 0);
swap(pExaScr, pScreen, DestroyPixmap);
if (pScreen->DestroyPixmap)
pScreen->DestroyPixmap(pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
return NULL;
}
@ -108,9 +109,10 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
pScreen, pPixmap);
if (pExaPixmap->pDamage == NULL) {
// don't need to protect from calling our own (wrapped) DestroyPixmap
// handler, because it can deal with half-initialized state
dixDestroyPixmap(pPixmap, 0);
swap(pExaScr, pScreen, DestroyPixmap);
if (pScreen->DestroyPixmap)
pScreen->DestroyPixmap(pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
return NULL;
}
@ -216,8 +218,6 @@ exaDestroyPixmap_classic(PixmapPtr pPixmap)
if (pPixmap->refcnt == 1) {
ExaPixmapPriv(pPixmap);
if (!pExaPixmap) // we're called on an error path
goto out;
exaDestroyPixmap(pPixmap);
@ -235,10 +235,9 @@ exaDestroyPixmap_classic(PixmapPtr pPixmap)
RegionUninit(&pExaPixmap->validFB);
}
out:
// restore original (screen driver's) DestroyPixmap() handler and call it
swap(pExaScr, pScreen, DestroyPixmap);
dixDestroyPixmap(pPixmap, 0);
if (pScreen->DestroyPixmap)
ret = pScreen->DestroyPixmap(pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
return ret;

View File

@ -98,9 +98,10 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
}
if (!pExaPixmap->driverPriv) {
// don't need to protect from calling our own (wrapped) DestroyPixmap
// handler, because it can deal with half-initialized state
dixDestroyPixmap(pPixmap, 0);
swap(pExaScr, pScreen, DestroyPixmap);
if (pScreen->DestroyPixmap)
pScreen->DestroyPixmap(pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
return NULL;
}
@ -195,8 +196,6 @@ exaDestroyPixmap_driver(PixmapPtr pPixmap)
if (pPixmap->refcnt == 1) {
ExaPixmapPriv(pPixmap);
if (!pExaPixmap) // we're called on an error path
goto out;
exaDestroyPixmap(pPixmap);
@ -205,10 +204,9 @@ exaDestroyPixmap_driver(PixmapPtr pPixmap)
pExaPixmap->driverPriv = NULL;
}
out:
// restore original (screen driver's) DestroyPixmap() handler and call it
swap(pExaScr, pScreen, DestroyPixmap);
dixDestroyPixmap(pPixmap, 0);
if (pScreen->DestroyPixmap)
ret = pScreen->DestroyPixmap(pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
return ret;

View File

@ -194,7 +194,7 @@ exaRealizeGlyphCaches(ScreenPtr pScreen, unsigned int format)
CPComponentAlpha, &component_alpha, serverClient,
&error);
dixDestroyPixmap(pPixmap, 0); /* picture holds a refcount */
(*pScreen->DestroyPixmap) (pPixmap); /* picture holds a refcount */
if (!pPicture)
return FALSE;
@ -728,7 +728,7 @@ exaGlyphs(CARD8 op,
{
PictFormatPtr argbFormat;
dixDestroyPixmap(pMaskPixmap, 0);
(*pScreen->DestroyPixmap) (pMaskPixmap);
if (!pMask)
return;
@ -751,7 +751,7 @@ exaGlyphs(CARD8 op,
pMask = CreatePicture(0, &pMaskPixmap->drawable, maskFormat, 0, 0,
serverClient, &error);
if (!pMask) {
dixDestroyPixmap(pMaskPixmap, 0);
(*pScreen->DestroyPixmap) (pMaskPixmap);
return;
}
}
@ -832,6 +832,6 @@ exaGlyphs(CARD8 op,
xSrc + x - first_xOff,
ySrc + y - first_yOff, 0, 0, x, y, width, height);
FreePicture((void *) pMask, (XID) 0);
dixDestroyPixmap(pMaskPixmap, 0);
(*pScreen->DestroyPixmap) (pMaskPixmap);
}
}

View File

@ -249,8 +249,6 @@ exaDestroyPixmap_mixed(PixmapPtr pPixmap)
if (pPixmap->refcnt == 1) {
ExaPixmapPriv(pPixmap);
if (!pExaPixmap)
goto out; // we're called on an error path
exaDestroyPixmap(pPixmap);
@ -268,10 +266,9 @@ exaDestroyPixmap_mixed(PixmapPtr pPixmap)
}
}
out:
// restore original (screen driver's) DestroyPixmap() handler and call it
swap(pExaScr, pScreen, DestroyPixmap);
dixDestroyPixmap(pPixmap, 0);
if (pScreen->DestroyPixmap)
ret = pScreen->DestroyPixmap(pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
return ret;

View File

@ -614,7 +614,7 @@ ExaOffscreenDefragment(ScreenPtr pScreen)
pDstPix->drawable.depth = 0;
pDstPix->drawable.bitsPerPixel = 0;
dixDestroyPixmap(pDstPix, 0);
(*pScreen->DestroyPixmap) (pDstPix);
if (area->state == ExaOffscreenAvail && area->size > largest_size)
return area;

View File

@ -1082,7 +1082,7 @@ exaCreateAlphaPicture(ScreenPtr pScreen,
return 0;
pGC = GetScratchGC(pPixmap->drawable.depth, pScreen);
if (!pGC) {
dixDestroyPixmap(pPixmap, 0);
(*pScreen->DestroyPixmap) (pPixmap);
return 0;
}
ValidateGC(&pPixmap->drawable, pGC);
@ -1095,7 +1095,7 @@ exaCreateAlphaPicture(ScreenPtr pScreen,
FreeScratchGC(pGC);
pPicture = CreatePicture(0, &pPixmap->drawable, pPictFormat,
0, 0, serverClient, &error);
dixDestroyPixmap(pPixmap, 0);
(*pScreen->DestroyPixmap) (pPixmap);
return pPicture;
}

View File

@ -30,10 +30,6 @@
#include <dix-config.h>
#include <X11/X.h>
#include "dix/colormap_priv.h"
#include "mi/mi_priv.h"
#include "fb.h"
#include "micmap.h"

View File

@ -83,7 +83,7 @@ fbOverlayCloseScreen(ScreenPtr pScreen)
int i;
for (i = 0; i < pScrPriv->nlayers; i++) {
dixDestroyPixmap(pScrPriv->layer[i].u.run.pixmap, 0);
(*pScreen->DestroyPixmap) (pScrPriv->layer[i].u.run.pixmap);
RegionUninit(&pScrPriv->layer[i].u.run.region);
}
return TRUE;

View File

@ -178,6 +178,24 @@ glamor_glyph_add(struct glamor_glyph_atlas *atlas, DrawablePtr glyph_draw)
return TRUE;
}
static const glamor_facet glamor_facet_composite_glyphs_es300 = {
.name = "composite_glyphs",
.version = 130,
.fs_extensions = ("#extension GL_EXT_blend_func_extended : enable\n"),
.vs_vars = ("in vec4 primitive;\n"
"in vec2 source;\n"
"out vec2 glyph_pos;\n"),
.vs_exec = (" vec2 pos = primitive.zw * vec2(gl_VertexID&1, (gl_VertexID&2)>>1);\n"
GLAMOR_POS(gl_Position, (primitive.xy + pos))
" glyph_pos = (source + pos) * ATLAS_DIM_INV;\n"),
.fs_vars = ("in vec2 glyph_pos;\n"
"out vec4 color0;\n"
"out vec4 color1;\n"),
.fs_exec = (" vec4 mask = texture(atlas, glyph_pos);\n"),
.source_name = "source",
.locations = glamor_program_location_atlas,
};
static const glamor_facet glamor_facet_composite_glyphs_130 = {
.name = "composite_glyphs",
.version = 130,
@ -436,7 +454,7 @@ glamor_composite_glyphs(CARD8 op,
glyphs_queued = 0;
}
if (glyph_atlas->atlas) {
dixDestroyPixmap(glyph_atlas->atlas, 0);
(*screen->DestroyPixmap)(glyph_atlas->atlas);
glyph_atlas->atlas = NULL;
}
}
@ -454,7 +472,9 @@ glamor_composite_glyphs(CARD8 op,
if (glamor_glsl_has_ints(glamor_priv))
prog = glamor_setup_program_render(op, src, glyph_pict, dst,
glyphs_program,
&glamor_facet_composite_glyphs_130,
glamor_priv->is_gles ?
&glamor_facet_composite_glyphs_es300 :
&glamor_facet_composite_glyphs_130,
glamor_priv->glyph_defines);
else
prog = glamor_setup_program_render(op, src, glyph_pict, dst,
@ -571,7 +591,8 @@ glamor_free_glyph_atlas(struct glamor_glyph_atlas *atlas)
{
if (!atlas)
return;
dixDestroyPixmap(atlas->atlas, 0);
if (atlas->atlas)
(*atlas->atlas->drawable.pScreen->DestroyPixmap)(atlas->atlas);
free (atlas);
}

View File

@ -346,7 +346,7 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok)
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Failed to make %dx%dx%dbpp pixmap from GBM bo\n",
width, height, pixmap->drawable.bitsPerPixel);
dixDestroyPixmap(exported, 0);
screen->DestroyPixmap(exported);
gbm_bo_destroy(bo);
return FALSE;
}
@ -367,7 +367,7 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok)
/* Swap the devKind into the original pixmap, reflecting the bo's stride */
screen->ModifyPixmapHeader(pixmap, 0, 0, 0, 0, exported->devKind, NULL);
dixDestroyPixmap(exported, 0);
screen->DestroyPixmap(exported);
return TRUE;
}
@ -632,7 +632,7 @@ glamor_pixmap_from_fds(ScreenPtr screen,
error:
if (ret == FALSE) {
dixDestroyPixmap(pixmap, 0);
screen->DestroyPixmap(pixmap);
return NULL;
}
return pixmap;
@ -654,7 +654,7 @@ glamor_pixmap_from_fd(ScreenPtr screen,
stride, depth, bpp);
if (ret == FALSE) {
dixDestroyPixmap(pixmap, 0);
screen->DestroyPixmap(pixmap);
return NULL;
}
return pixmap;
@ -1218,6 +1218,8 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd)
"dmabuf_capable");
else if (strstr((const char *)renderer, "Intel"))
glamor_egl->dmabuf_capable = TRUE;
else if (strstr((const char *)renderer, "zink"))
glamor_egl->dmabuf_capable = TRUE;
else
glamor_egl->dmabuf_capable = FALSE;
}

View File

@ -1391,7 +1391,7 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId,
err = XaceHookResourceAccess(client, glxDrawableId, X11_RESTYPE_PIXMAP,
pPixmap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (err != Success) {
dixDestroyPixmap(pPixmap, 0);
(*pGlxScreen->pScreen->DestroyPixmap) (pPixmap);
return err;
}

View File

@ -805,7 +805,7 @@ glxDRILeaveVT(ScrnInfoPtr scrn)
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(xf86ScrnToScreen(scrn));
LogMessageVerb(X_INFO, -1, "AIGLX: Suspending AIGLX clients for VT switch\n");
LogMessageVerbSigSafe(X_INFO, -1, "AIGLX: Suspending AIGLX clients for VT switch\n");
glxSuspendClients();

View File

@ -128,13 +128,10 @@ __glXSendReply(ClientPtr client, const void *data, size_t elements,
.retval = retval,
};
/* It is faster on almost always every architecture to just copy the 8
* bytes, even when not necessary, than check to see of the value of
* elements requires it. Copying the data when not needed will do no
* harm.
*/
(void) memcpy(&reply.pad3, data, 8);
/* Single element goes in reply padding; don't leak uninitialized data. */
if (elements == 1) {
(void) memcpy(&reply.pad3, data, element_size);
}
WriteToClient(client, sizeof(xGLXSingleReply), &reply);
if (reply_ints != 0) {
@ -176,13 +173,10 @@ __glXSendReplySwap(ClientPtr client, const void *data, size_t elements,
.retval = bswap_32(retval),
};
/* It is faster on almost always every architecture to just copy the 8
* bytes, even when not necessary, than check to see of the value of
* elements requires it. Copying the data when not needed will do no
* harm.
*/
(void) memcpy(&reply.pad3, data, 8);
/* Single element goes in reply padding; don't leak uninitialized data. */
if (elements == 1) {
(void) memcpy(&reply.pad3, data, element_size);
}
WriteToClient(client, sizeof(xGLXSingleReply), &reply);
if (reply_ints != 0) {

View File

@ -105,7 +105,7 @@ __glGetMap_size(GLenum target, GLenum query)
}
break;
}
return -1;
return 0;
}
GLint
@ -164,7 +164,7 @@ __glGetPixelMap_size(GLenum map)
query = GL_PIXEL_MAP_A_TO_A_SIZE;
break;
default:
return -1;
return 0;
}
glGetIntegerv(query, &size);
return size;

View File

@ -42,8 +42,6 @@
#include "dix/dix_priv.h"
Bool noGlxExtension = FALSE;
ExtensionEntry *GlxExtensionEntry;
int GlxErrorBase = 0;
static CallbackListRec vndInitCallbackList;
@ -198,7 +196,7 @@ GLXClientCallback(CallbackListPtr *list, void *closure, void *data)
static void
GLXReset(ExtensionEntry *extEntry)
{
// LogMessageVerb(X_INFO, 1, "GLX: GLXReset\n");
// xf86Msg(X_INFO, "GLX: GLXReset\n");
GlxVendorExtensionReset(extEntry);
GlxDispatchReset();

View File

@ -1655,7 +1655,7 @@ ephyr_glamor_create_screen_resources(ScreenPtr pScreen)
* Thus, delete the current screen pixmap, and put a fresh one in.
*/
old_screen_pixmap = pScreen->GetScreenPixmap(pScreen);
dixDestroyPixmap(old_screen_pixmap, 0);
pScreen->DestroyPixmap(old_screen_pixmap);
screen_pixmap = pScreen->CreatePixmap(pScreen,
pScreen->width,

View File

@ -801,7 +801,8 @@ vfbCloseScreen(ScreenPtr pScreen)
/*
* fb overwrites miCloseScreen, so do this here
*/
dixDestroyPixmap(pScreen->devPrivate, 0);
if (pScreen->devPrivate)
(*pScreen->DestroyPixmap) (pScreen->devPrivate);
pScreen->devPrivate = NULL;
return pScreen->CloseScreen(pScreen);

View File

@ -126,7 +126,13 @@ extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn,
EntityProc leave,
void *private);
#else
#define xf86VGAarbiterInit() do {} while (0)
#define xf86VGAarbiterFini() do {} while (0)
#define xf86VGAarbiterLock(x) do {} while (0)
#define xf86VGAarbiterUnlock(x) do {} while (0)
#define xf86VGAarbiterScrnInit(x) do {} while (0)
#define xf86VGAarbiterDeviceDecodes() do {} while (0)
#define xf86VGAarbiterWrapFunctions() do {} while (0)
#endif
/* xf86Bus.c */
@ -248,6 +254,12 @@ extern _X_EXPORT void
xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
_X_ATTRIBUTE_PRINTF(3, 4);
extern _X_EXPORT void
xf86MsgVerb(MessageType type, int verb, const char *format, ...)
_X_ATTRIBUTE_PRINTF(3, 4);
extern _X_EXPORT void
xf86Msg(MessageType type, const char *format, ...)
_X_ATTRIBUTE_PRINTF(2, 3);
extern _X_EXPORT void
xf86ErrorFVerb(int verb, const char *format, ...)
_X_ATTRIBUTE_PRINTF(2, 3);
extern _X_EXPORT void
@ -394,8 +406,4 @@ extern _X_EXPORT ScreenPtr xf86ScrnToScreen(ScrnInfoPtr pScrn);
extern _X_EXPORT void
xf86UpdateDesktopDimensions(void);
/* only for backwards (source) compatibility */
#define xf86MsgVerb LogMessageVerb
#define xf86Msg(type, ...) LogMessageVerb(type, 1, __VA_ARGS__)
#endif /* _XF86_H */

View File

@ -34,7 +34,7 @@
#endif
#include "xf86.h"
#include "xf86Parser_priv.h"
#include "xf86Parser.h"
#include "xf86tokens.h"
#include "xf86Config.h"
#include "xf86MatchDrivers.h"
@ -160,7 +160,7 @@ xf86AddMatchedDriver(XF86MatchedDrivers *md, const char *driver)
md->nmatches++;
}
else {
LogMessageVerb(X_WARNING, 1, "Too many drivers registered, can't add %s\n", driver);
xf86Msg(X_WARNING, "Too many drivers registered, can't add %s\n", driver);
}
}
@ -178,7 +178,7 @@ xf86AutoConfig(void)
ret = CONFIG_OK; /* OK so far */
}
else {
LogMessageVerb(X_ERROR, 1, "Couldn't allocate Config record.\n");
xf86Msg(X_ERROR, "Couldn't allocate Config record.\n");
return FALSE;
}
@ -205,14 +205,14 @@ xf86AutoConfig(void)
free(md.matches[i]);
}
LogMessageVerb(X_DEFAULT, 0,
xf86MsgVerb(X_DEFAULT, 0,
"Using default built-in configuration (%d lines)\n",
builtinLines);
LogMessageVerb(X_DEFAULT, 3, "--- Start of built-in configuration ---\n");
xf86MsgVerb(X_DEFAULT, 3, "--- Start of built-in configuration ---\n");
for (cp = builtinConfig; *cp; cp++)
xf86ErrorFVerb(3, "\t%s", *cp);
LogMessageVerb(X_DEFAULT, 3, "--- End of built-in configuration ---\n");
xf86MsgVerb(X_DEFAULT, 3, "--- End of built-in configuration ---\n");
xf86initConfigFiles();
xf86setBuiltinConfig(builtinConfig);
@ -220,7 +220,7 @@ xf86AutoConfig(void)
FreeConfig();
if (ret != CONFIG_OK)
LogMessageVerb(X_ERROR, 1, "Error parsing the built-in default configuration.\n");
xf86Msg(X_ERROR, "Error parsing the built-in default configuration.\n");
return ret == CONFIG_OK;
}
@ -253,12 +253,12 @@ listPossibleVideoDrivers(XF86MatchedDrivers *md)
}
if (iret < 0) {
LogMessageVerb(X_WARNING, 1,
"could not get frame buffer identifier from %s\n",
xf86SolarisFbDev);
xf86Msg(X_WARNING,
"could not get frame buffer identifier from %s\n",
xf86SolarisFbDev);
}
else {
LogMessageVerb(X_PROBED, 1, "console driver: %s\n", visid.name);
xf86Msg(X_PROBED, "console driver: %s\n", visid.name);
/* Special case from before the general case was set */
if (strcmp(visid.name, "NVDAnvda") == 0) {
@ -392,7 +392,7 @@ autoConfigDevice(GDevPtr preconf_device)
/* get all possible video drivers and count them */
listPossibleVideoDrivers(&md);
for (i = 0; i < md.nmatches; i++) {
LogMessageVerb(X_DEFAULT, 1, "Matched %s as autoconfigured driver %d\n",
xf86Msg(X_DEFAULT, "Matched %s as autoconfigured driver %d\n",
md.matches[i], i);
}
@ -441,7 +441,7 @@ autoConfigDevice(GDevPtr preconf_device)
}
}
LogMessageVerb(X_DEFAULT, 1, "Assigned the driver to the xf86ConfigLayout\n");
xf86Msg(X_DEFAULT, "Assigned the driver to the xf86ConfigLayout\n");
return ptr;
}

View File

@ -50,7 +50,7 @@
#include "xf86_OSproc.h"
#ifdef XSERVER_LIBPCIACCESS
#include "xf86VGAarbiter_priv.h"
#include "xf86VGAarbiter.h"
#endif
/* Entity data */
EntityPtr *xf86Entities = NULL; /* Bus slots claimed by drivers */
@ -99,7 +99,7 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only)
}
#endif
if (!foundScreen && (drv->Probe != NULL)) {
LogMessageVerb(X_WARNING, 1, "Falling back to old probe method for %s\n",
xf86Msg(X_WARNING, "Falling back to old probe method for %s\n",
drv->driverName);
foundScreen = (*drv->Probe) (drv, (detect_only) ? PROBE_DETECT
: PROBE_DEFAULT);
@ -184,7 +184,7 @@ xf86BusConfig(void)
/* If nothing was detected, return now */
if (xf86NumScreens == 0) {
LogMessageVerb(X_ERROR, 1, "No devices detected.\n");
xf86Msg(X_ERROR, "No devices detected.\n");
return FALSE;
}
@ -208,9 +208,9 @@ xf86BusConfig(void)
xf86Screens[i]->confScreen = layout->screen;
else {
/* No match found */
LogMessageVerb(X_ERROR, 1,
"Screen %d deleted because of no matching config section.\n",
i);
xf86Msg(X_ERROR,
"Screen %d deleted because of no matching config section.\n",
i);
xf86DeleteScreen(xf86Screens[i--]);
}
}
@ -224,8 +224,8 @@ xf86BusConfig(void)
/* If no screens left, return now. */
if (xf86NumScreens == 0) {
LogMessageVerb(X_ERROR, 1,
"Device(s) detected, but none match those in the config file.\n");
xf86Msg(X_ERROR,
"Device(s) detected, but none match those in the config file.\n");
return FALSE;
}

View File

@ -54,7 +54,7 @@
#include "xf86.h"
#include "xf86Modes.h"
#include "xf86Parser_priv.h"
#include "xf86Parser.h"
#include "xf86tokens.h"
#include "xf86Config.h"
#include "xf86Priv.h"
@ -65,7 +65,6 @@
#include "xf86pciBus.h"
#include "xf86Xinput.h"
#include "loaderProcs.h"
#include "xf86Xinput_priv.h"
#include "xkbsrv.h"
#include "picture.h"
@ -196,8 +195,8 @@ xf86ValidateFontPath(char *path)
if (!S_ISDIR(stat_buf.st_mode))
flag = -1;
if (flag != 0) {
LogMessageVerb(X_WARNING, 1, "The directory \"%s\" does not exist.\n",
dir_elem);
xf86Msg(X_WARNING, "The directory \"%s\" does not exist.\n",
dir_elem);
xf86ErrorF("\tEntry deleted from font path.\n");
free(dir_elem);
continue;
@ -210,9 +209,9 @@ xf86ValidateFontPath(char *path)
flag = -1;
free(p1);
if (flag != 0) {
LogMessageVerb(X_WARNING, 1,
"`fonts.dir' not found (or not valid) in \"%s\".\n",
dir_elem);
xf86Msg(X_WARNING,
"`fonts.dir' not found (or not valid) in \"%s\".\n",
dir_elem);
xf86ErrorF("\tEntry deleted from font path.\n");
xf86ErrorF("\t(Run 'mkfontdir' on \"%s\").\n", dir_elem);
free(dir_elem);
@ -270,7 +269,7 @@ xf86ModulelistFromConfig(void ***optlist)
* ModulePath
*/
if (xf86configptr == NULL) {
LogMessageVerb(X_ERROR, 1, "Cannot access global config data structure\n");
xf86Msg(X_ERROR, "Cannot access global config data structure\n");
return NULL;
}
@ -280,9 +279,9 @@ xf86ModulelistFromConfig(void ***optlist)
*/
modp = xf86configptr->conf_modules->mod_disable_lst;
while (modp) {
LogMessageVerb(X_WARNING, 1,
"\"%s\" will not be loaded unless you've specified it to be loaded elsewhere.\n",
modp->load_name);
xf86Msg(X_WARNING,
"\"%s\" will not be loaded unless you've specified it to be loaded elsewhere.\n",
modp->load_name);
modp = (XF86LoadPtr) modp->list.next;
}
/*
@ -293,18 +292,18 @@ xf86ModulelistFromConfig(void ***optlist)
*/
for (i = 0; ModuleDefaults[i].name != NULL; i++) {
if (ModuleDefaults[i].toLoad == FALSE) {
LogMessageVerb(X_WARNING, 1,
"\"%s\" is not to be loaded by default. Skipping.\n",
ModuleDefaults[i].name);
xf86Msg(X_WARNING,
"\"%s\" is not to be loaded by default. Skipping.\n",
ModuleDefaults[i].name);
continue;
}
found = FALSE;
modp = xf86configptr->conf_modules->mod_load_lst;
while (modp) {
if (strcmp(modp->load_name, ModuleDefaults[i].name) == 0) {
LogMessageVerb(X_INFO, 1,
"\"%s\" will be loaded. This was enabled by default and also specified in the config file.\n",
ModuleDefaults[i].name);
xf86Msg(X_INFO,
"\"%s\" will be loaded. This was enabled by default and also specified in the config file.\n",
ModuleDefaults[i].name);
found = TRUE;
break;
}
@ -314,9 +313,9 @@ xf86ModulelistFromConfig(void ***optlist)
modp = xf86configptr->conf_modules->mod_disable_lst;
while (modp) {
if (strcmp(modp->load_name, ModuleDefaults[i].name) == 0) {
LogMessageVerb(X_INFO, 1,
"\"%s\" will be loaded even though the default is to disable it.\n",
ModuleDefaults[i].name);
xf86Msg(X_INFO,
"\"%s\" will be loaded even though the default is to disable it.\n",
ModuleDefaults[i].name);
found = TRUE;
break;
}
@ -329,8 +328,8 @@ xf86ModulelistFromConfig(void ***optlist)
xf86addNewLoadDirective(ptr, ModuleDefaults[i].name,
XF86_LOAD_MODULE,
ModuleDefaults[i].load_opt);
LogMessageVerb(X_INFO, 1, "\"%s\" will be loaded by default.\n",
ModuleDefaults[i].name);
xf86Msg(X_INFO, "\"%s\" will be loaded by default.\n",
ModuleDefaults[i].name);
}
}
}
@ -402,7 +401,7 @@ xf86DriverlistFromConfig(void)
* ModulePath
*/
if (xf86configptr == NULL) {
LogMessageVerb(X_ERROR, 1, "Cannot access global config data structure\n");
xf86Msg(X_ERROR, "Cannot access global config data structure\n");
return NULL;
}
@ -479,7 +478,7 @@ xf86InputDriverlistFromConfig(void)
* ModulePath
*/
if (xf86configptr == NULL) {
LogMessageVerb(X_ERROR, 1, "Cannot access global config data structure\n");
xf86Msg(X_ERROR, "Cannot access global config data structure\n");
return NULL;
}
@ -583,7 +582,7 @@ configFiles(XF86ConfFilesPtr fileconf)
/* copy last entry */
*(temp_path++) = '\t';
strcpy(temp_path, start);
LogMessageVerb(pathFrom, 1, "FontPath set to:\n%s\n", log_buf);
xf86Msg(pathFrom, "FontPath set to:\n%s\n", log_buf);
free(log_buf);
/* ModulePath */
@ -595,12 +594,12 @@ configFiles(XF86ConfFilesPtr fileconf)
}
}
LogMessageVerb(xf86ModPathFrom, 1, "ModulePath set to \"%s\"\n", xf86ModulePath);
xf86Msg(xf86ModPathFrom, "ModulePath set to \"%s\"\n", xf86ModulePath);
if (!xf86xkbdirFlag && fileconf && fileconf->file_xkbdir) {
XkbBaseDirectory = fileconf->file_xkbdir;
LogMessageVerb(X_CONFIG, 1, "XKB base directory set to \"%s\"\n",
XkbBaseDirectory);
xf86Msg(X_CONFIG, "XKB base directory set to \"%s\"\n",
XkbBaseDirectory);
}
#if 0
/* LogFile */
@ -750,12 +749,12 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
xf86GetOptValBool(FlagOptions, FLAG_IGNORE_ABI, &xf86Info.ignoreABI);
if (xf86Info.ignoreABI) {
LogMessageVerb(X_CONFIG, 1, "Ignoring ABI Version\n");
xf86Msg(X_CONFIG, "Ignoring ABI Version\n");
}
xf86GetOptValBool(FlagOptions, FLAG_ALLOW_BYTE_SWAPPED_CLIENTS, &AllowByteSwappedClients);
if (AllowByteSwappedClients) {
LogMessageVerb(X_CONFIG, 1, "Allowing byte-swapped clients\n");
xf86Msg(X_CONFIG, "Allowing byte-swapped clients\n");
}
if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_DEVICES)) {
@ -766,8 +765,8 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
else {
from = X_DEFAULT;
}
LogMessageVerb(from, 1, "%sutomatically adding devices\n",
xf86Info.autoAddDevices ? "A" : "Not a");
xf86Msg(from, "%sutomatically adding devices\n",
xf86Info.autoAddDevices ? "A" : "Not a");
if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ENABLE_DEVICES)) {
xf86GetOptValBool(FlagOptions, FLAG_AUTO_ENABLE_DEVICES,
@ -777,8 +776,8 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
else {
from = X_DEFAULT;
}
LogMessageVerb(from, 1, "%sutomatically enabling devices\n",
xf86Info.autoEnableDevices ? "A" : "Not a");
xf86Msg(from, "%sutomatically enabling devices\n",
xf86Info.autoEnableDevices ? "A" : "Not a");
if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_GPU)) {
xf86GetOptValBool(FlagOptions, FLAG_AUTO_ADD_GPU,
@ -788,8 +787,8 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
else {
from = X_DEFAULT;
}
LogMessageVerb(from, 1, "%sutomatically adding GPU devices\n",
xf86Info.autoAddGPU ? "A" : "Not a");
xf86Msg(from, "%sutomatically adding GPU devices\n",
xf86Info.autoAddGPU ? "A" : "Not a");
if (xf86AutoBindGPUDisabled) {
xf86Info.autoBindGPU = FALSE;
@ -803,8 +802,8 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
else {
from = X_DEFAULT;
}
LogMessageVerb(from, 1, "%sutomatically binding GPU devices\n",
xf86Info.autoBindGPU ? "A" : "Not a");
xf86Msg(from, "%sutomatically binding GPU devices\n",
xf86Info.autoBindGPU ? "A" : "Not a");
/*
* Set things up based on the config file information. Some of these
@ -827,16 +826,16 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
{
if ((s = xf86GetOptValString(FlagOptions, FLAG_LOG))) {
if (!xf86NameCmp(s, "flush")) {
LogMessageVerb(X_CONFIG, 1, "Flushing logfile enabled\n");
xf86Msg(X_CONFIG, "Flushing logfile enabled\n");
LogSetParameter(XLOG_FLUSH, TRUE);
}
else if (!xf86NameCmp(s, "sync")) {
LogMessageVerb(X_CONFIG, 1, "Syncing logfile enabled\n");
xf86Msg(X_CONFIG, "Syncing logfile enabled\n");
LogSetParameter(XLOG_FLUSH, TRUE);
LogSetParameter(XLOG_SYNC, TRUE);
}
else {
LogMessageVerb(X_WARNING, 1, "Unknown Log option\n");
xf86Msg(X_WARNING, "Unknown Log option\n");
}
}
}
@ -846,9 +845,9 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
int policy = PictureParseCmapPolicy(s);
if (policy == PictureCmapPolicyInvalid)
LogMessageVerb(X_WARNING, 1, "Unknown colormap policy \"%s\"\n", s);
xf86Msg(X_WARNING, "Unknown colormap policy \"%s\"\n", s);
else {
LogMessageVerb(X_CONFIG, 1, "Render colormap policy set to %s\n", s);
xf86Msg(X_CONFIG, "Render colormap policy set to %s\n", s);
PictureCmapPolicy = policy;
}
}
@ -868,7 +867,7 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
xf86Info.glxVisuals = XF86_GlxVisualsAll;
}
else {
LogMessageVerb(X_WARNING, 1, "Unknown GlxVisuals option\n");
xf86Msg(X_WARNING, "Unknown GlxVisuals option\n");
}
}
@ -949,7 +948,7 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
from = X_CONFIG;
}
if (!noPanoramiXExtension)
LogMessageVerb(from, 1, "Xinerama: enabled\n");
xf86Msg(from, "Xinerama: enabled\n");
#endif /* XINERAMA */
#ifdef DRI2
@ -973,7 +972,7 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
LimitClients = i;
}
}
LogMessageVerb(from, 1, "Max clients allowed: %i, resource mask: 0x%x\n",
xf86Msg(from, "Max clients allowed: %i, resource mask: 0x%x\n",
LimitClients, RESOURCE_ID_MASK);
}
@ -1082,7 +1081,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
confInput = xf86findInput(xf86PointerName,
xf86configptr->conf_input_lst);
if (!confInput) {
LogMessageVerb(X_ERROR, 1, "No InputDevice section called \"%s\"\n",
xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n",
xf86PointerName);
return FALSE;
}
@ -1169,7 +1168,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
if (!foundPointer && xf86Info.forceInputDevices) {
/* This shouldn't happen. */
LogMessageVerb(X_ERROR, 1, "Cannot locate a core pointer device.\n");
xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n");
xf86DeleteInput(Pointer, 0);
return FALSE;
}
@ -1181,7 +1180,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
confInput = xf86findInput(xf86KeyboardName,
xf86configptr->conf_input_lst);
if (!confInput) {
LogMessageVerb(X_ERROR, 1, "No InputDevice section called \"%s\"\n",
xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n",
xf86KeyboardName);
return FALSE;
}
@ -1265,27 +1264,27 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
if (!foundKeyboard && xf86Info.forceInputDevices) {
/* This shouldn't happen. */
LogMessageVerb(X_ERROR, 1, "Cannot locate a core keyboard device.\n");
xf86Msg(X_ERROR, "Cannot locate a core keyboard device.\n");
xf86DeleteInput(Keyboard, 0);
return FALSE;
}
if (pointerMsg) {
if (implicitLayout)
LogMessageVerb(X_DEFAULT, 1, "No Layout section. Using the %s.\n",
xf86Msg(X_DEFAULT, "No Layout section. Using the %s.\n",
pointerMsg);
else
LogMessageVerb(X_DEFAULT, 1, "The core pointer device wasn't specified "
xf86Msg(X_DEFAULT, "The core pointer device wasn't specified "
"explicitly in the layout.\n"
"\tUsing the %s.\n", pointerMsg);
}
if (keyboardMsg) {
if (implicitLayout)
LogMessageVerb(X_DEFAULT, 1, "No Layout section. Using the %s.\n",
xf86Msg(X_DEFAULT, "No Layout section. Using the %s.\n",
keyboardMsg);
else
LogMessageVerb(X_DEFAULT, 1, "The core keyboard device wasn't specified "
xf86Msg(X_DEFAULT, "The core keyboard device wasn't specified "
"explicitly in the layout.\n"
"\tUsing the %s.\n", keyboardMsg);
}
@ -1301,15 +1300,15 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
#else
config_backend = "wscons";
#endif
LogMessageVerb(X_INFO, 1, "The server relies on %s to provide the list of "
"input devices.\n\tIf no devices become available, "
"reconfigure %s or disable AutoAddDevices.\n",
config_backend, config_backend);
xf86Msg(X_INFO, "The server relies on %s to provide the list of "
"input devices.\n\tIf no devices become available, "
"reconfigure %s or disable AutoAddDevices.\n",
config_backend, config_backend);
#else
LogMessageVerb(X_WARNING, 1, "Hotplugging requested but the server was "
"compiled without a config backend. "
"No input devices were configured, the server "
"will start without any input devices.\n");
xf86Msg(X_WARNING, "Hotplugging requested but the server was "
"compiled without a config backend. "
"No input devices were configured, the server "
"will start without any input devices.\n");
#endif
}
@ -1406,13 +1405,13 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
}
if (xf86LayoutName != NULL) {
if ((l = xf86findLayout(xf86LayoutName, conf_layout)) == NULL) {
LogMessageVerb(X_ERROR, 1, "No ServerLayout section called \"%s\"\n",
xf86LayoutName);
xf86Msg(X_ERROR, "No ServerLayout section called \"%s\"\n",
xf86LayoutName);
return FALSE;
}
conf_layout = l;
}
LogMessageVerb(from, 1, "ServerLayout \"%s\"\n", conf_layout->lay_identifier);
xf86Msg(from, "ServerLayout \"%s\"\n", conf_layout->lay_identifier);
adjp = conf_layout->lay_adjacency_lst;
/*
@ -1532,8 +1531,8 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
}
if (slp[i].where != PosObsolete
&& slp[i].where != PosAbsolute && !slp[i].refscreen) {
LogMessageVerb(X_ERROR, 1, "Screen %s doesn't exist: deleting placement\n",
slp[i].refname);
xf86Msg(X_ERROR, "Screen %s doesn't exist: deleting placement\n",
slp[i].refname);
slp[i].where = PosAbsolute;
slp[i].x = 0;
slp[i].y = 0;
@ -1613,8 +1612,8 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen,
from = X_CONFIG;
if (xf86ScreenName != NULL) {
if ((s = xf86findScreen(xf86ScreenName, conf_screen)) == NULL) {
LogMessageVerb(X_ERROR, 1, "No Screen section called \"%s\"\n",
xf86ScreenName);
xf86Msg(X_ERROR, "No Screen section called \"%s\"\n",
xf86ScreenName);
return FALSE;
}
conf_screen = s;
@ -1658,12 +1657,12 @@ configXvAdaptor(confXvAdaptorPtr adaptor, XF86ConfVideoAdaptorPtr conf_adaptor)
int count = 0;
XF86ConfVideoPortPtr conf_port;
LogMessageVerb(X_CONFIG, 1, "| |-->VideoAdaptor \"%s\"\n",
conf_adaptor->va_identifier);
xf86Msg(X_CONFIG, "| |-->VideoAdaptor \"%s\"\n",
conf_adaptor->va_identifier);
adaptor->identifier = conf_adaptor->va_identifier;
adaptor->options = conf_adaptor->va_option_lst;
if (conf_adaptor->va_busid || conf_adaptor->va_driver) {
LogMessageVerb(X_CONFIG, 1, "| | Unsupported device type, skipping entry\n");
xf86Msg(X_CONFIG, "| | Unsupported device type, skipping entry\n");
return FALSE;
}
@ -1704,11 +1703,11 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
memset(&local_conf_screen, 0, sizeof(local_conf_screen));
conf_screen = &local_conf_screen;
conf_screen->scrn_identifier = "Default Screen Section";
LogMessageVerb(X_DEFAULT, 1, "No screen section available. Using defaults.\n");
xf86Msg(X_DEFAULT, "No screen section available. Using defaults.\n");
}
LogMessageVerb(from, 1, "|-->Screen \"%s\" (%d)\n", conf_screen->scrn_identifier,
scrnum);
xf86Msg(from, "|-->Screen \"%s\" (%d)\n", conf_screen->scrn_identifier,
scrnum);
/*
* now we fill in the elements of the screen
*/
@ -1738,8 +1737,8 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
screenp->device = XNFcallocarray(1, sizeof(GDevRec));
if ((!conf_screen->scrn_device) && (xf86configptr->conf_device_lst)) {
FIND_SUITABLE (XF86ConfDevicePtr, xf86configptr->conf_device_lst, conf_screen->scrn_device);
LogMessageVerb(X_DEFAULT, 1, "No device specified for screen \"%s\".\n"
"\tUsing the first device section listed.\n", screenp->id);
xf86Msg(X_DEFAULT, "No device specified for screen \"%s\".\n"
"\tUsing the first device section listed.\n", screenp->id);
}
if (configDevice(screenp->device, conf_screen->scrn_device, TRUE, FALSE)) {
screenp->device->myScreenSection = screenp;
@ -1846,8 +1845,8 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
}
if (defaultMonitor) {
LogMessageVerb(X_DEFAULT, 1, "No monitor specified for screen \"%s\".\n"
"\tUsing a default monitor configuration.\n", screenp->id);
xf86Msg(X_DEFAULT, "No monitor specified for screen \"%s\".\n"
"\tUsing a default monitor configuration.\n", screenp->id);
}
return TRUE;
}
@ -1878,7 +1877,7 @@ configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor)
float badgamma = 0.0;
double maxPixClock;
LogMessageVerb(X_CONFIG, 1, "| |-->Monitor \"%s\"\n", conf_monitor->mon_identifier);
xf86Msg(X_CONFIG, "| |-->Monitor \"%s\"\n", conf_monitor->mon_identifier);
monitorp->id = conf_monitor->mon_identifier;
monitorp->vendor = conf_monitor->mon_vendor;
monitorp->model = conf_monitor->mon_modelname;
@ -2098,14 +2097,14 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active, Bool g
if (active) {
if (gpu)
LogMessageVerb(X_CONFIG, 1, "| |-->GPUDevice \"%s\"\n",
conf_device->dev_identifier);
xf86Msg(X_CONFIG, "| |-->GPUDevice \"%s\"\n",
conf_device->dev_identifier);
else
LogMessageVerb(X_CONFIG, 1, "| |-->Device \"%s\"\n",
conf_device->dev_identifier);
xf86Msg(X_CONFIG, "| |-->Device \"%s\"\n",
conf_device->dev_identifier);
} else
LogMessageVerb(X_CONFIG, 1, "|-->Inactive Device \"%s\"\n",
conf_device->dev_identifier);
xf86Msg(X_CONFIG, "|-->Inactive Device \"%s\"\n",
conf_device->dev_identifier);
devicep->identifier = conf_device->dev_identifier;
devicep->vendor = conf_device->dev_vendor;
@ -2199,17 +2198,17 @@ configExtensions(XF86ConfExtensionsPtr conf_ext)
enable = !enable;
}
else {
LogMessageVerb(X_WARNING, 1, "Ignoring unrecognized value \"%s\"\n", val);
xf86Msg(X_WARNING, "Ignoring unrecognized value \"%s\"\n", val);
free(n);
continue;
}
if (EnableDisableExtension(name, enable)) {
LogMessageVerb(X_CONFIG, 1, "Extension \"%s\" is %s\n",
xf86Msg(X_CONFIG, "Extension \"%s\" is %s\n",
name, enable ? "enabled" : "disabled");
}
else {
LogMessageVerb(X_WARNING, 1, "Ignoring unrecognized extension \"%s\"\n",
xf86Msg(X_WARNING, "Ignoring unrecognized extension \"%s\"\n",
name);
}
free(n);
@ -2220,7 +2219,7 @@ configExtensions(XF86ConfExtensionsPtr conf_ext)
static Bool
configInput(InputInfoPtr inputp, XF86ConfInputPtr conf_input, MessageType from)
{
LogMessageVerb(from, 1, "|-->Input Device \"%s\"\n", conf_input->inp_identifier);
xf86Msg(from, "|-->Input Device \"%s\"\n", conf_input->inp_identifier);
inputp->name = conf_input->inp_identifier;
inputp->driver = conf_input->inp_driver;
inputp->options = conf_input->inp_option_lst;
@ -2286,12 +2285,12 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout)
InputInfoPtr *current;
if (!warned) {
LogMessageVerb(X_WARNING, 1, "Hotplugging is on, devices using "
xf86Msg(X_WARNING, "Hotplugging is on, devices using "
"drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.\n");
warned = TRUE;
}
LogMessageVerb(X_WARNING, 1, "Disabling %s\n", (*dev)->name);
xf86Msg(X_WARNING, "Disabling %s\n", (*dev)->name);
current = dev;
free(*dev);
@ -2347,27 +2346,27 @@ xf86HandleConfigFile(Bool autoconfig)
dirname = xf86openConfigDirFiles(dirsearch, xf86ConfigDir, PROJECTROOT);
filename = xf86openConfigFile(filesearch, xf86ConfigFile, PROJECTROOT);
if (filename) {
LogMessageVerb(filefrom, 0, "Using config file: \"%s\"\n", filename);
xf86MsgVerb(filefrom, 0, "Using config file: \"%s\"\n", filename);
xf86ConfigFile = XNFstrdup(filename);
}
else {
if (xf86ConfigFile)
LogMessageVerb(X_ERROR, 1, "Unable to locate/open config file: \"%s\"\n",
xf86Msg(X_ERROR, "Unable to locate/open config file: \"%s\"\n",
xf86ConfigFile);
}
if (dirname) {
LogMessageVerb(dirfrom, 0, "Using config directory: \"%s\"\n",
xf86MsgVerb(dirfrom, 0, "Using config directory: \"%s\"\n",
dirname);
xf86ConfigDir = XNFstrdup(dirname);
}
else {
if (xf86ConfigDir)
LogMessageVerb(X_ERROR, 1,
"Unable to locate/open config directory: \"%s\"\n",
xf86ConfigDir);
xf86Msg(X_ERROR,
"Unable to locate/open config directory: \"%s\"\n",
xf86ConfigDir);
}
if (sysdirname)
LogMessageVerb(X_DEFAULT, 0, "Using system config directory \"%s\"\n",
xf86MsgVerb(X_DEFAULT, 0, "Using system config directory \"%s\"\n",
sysdirname);
if (!filename && !dirname && !sysdirname)
return CONFIG_NOFILE;
@ -2378,7 +2377,7 @@ xf86HandleConfigFile(Bool autoconfig)
}
if ((xf86configptr = xf86readConfigFile()) == NULL) {
LogMessageVerb(X_ERROR, 1, "Problem parsing the config file\n");
xf86Msg(X_ERROR, "Problem parsing the config file\n");
return CONFIG_PARSE_ERROR;
}
xf86closeConfigFile();
@ -2400,14 +2399,14 @@ xf86HandleConfigFile(Bool autoconfig)
XF86ConfScreenPtr screen;
if (xf86ScreenName == NULL) {
LogMessageVerb(X_DEFAULT, 1,
"No Layout section. Using the first Screen section.\n");
xf86Msg(X_DEFAULT,
"No Layout section. Using the first Screen section.\n");
}
FIND_SUITABLE (XF86ConfScreenPtr, xf86configptr->conf_screen_lst, screen);
if (!configImpliedLayout(&xf86ConfigLayout,
screen,
xf86configptr)) {
LogMessageVerb(X_ERROR, 1, "Unable to determine the screen layout\n");
xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
return CONFIG_PARSE_ERROR;
}
implicit_layout = TRUE;
@ -2421,13 +2420,13 @@ xf86HandleConfigFile(Bool autoconfig)
dfltlayout =
xf86SetStrOption(optlist, "defaultserverlayout", NULL);
if (!configLayout(&xf86ConfigLayout, layout, dfltlayout)) {
LogMessageVerb(X_ERROR, 1, "Unable to determine the screen layout\n");
xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
return CONFIG_PARSE_ERROR;
}
}
else {
if (!configLayout(&xf86ConfigLayout, layout, NULL)) {
LogMessageVerb(X_ERROR, 1, "Unable to determine the screen layout\n");
xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
return CONFIG_PARSE_ERROR;
}
}
@ -2445,8 +2444,8 @@ xf86HandleConfigFile(Bool autoconfig)
}
if (scanptr) {
if (strncmp(scanptr, "PCI:", 4) != 0) {
LogMessageVerb(X_WARNING, 1, "Bus types other than PCI not yet isolable.\n"
"\tIgnoring IsolateDevice option.\n");
xf86Msg(X_WARNING, "Bus types other than PCI not yet isolable.\n"
"\tIgnoring IsolateDevice option.\n");
}
else
xf86PciIsolateDevice(scanptr);

View File

@ -38,7 +38,7 @@
#include "xf86Priv.h"
#define IN_XSERVER
#include "Configint.h"
#include "xf86DDC_priv.h"
#include "xf86DDC.h"
#include "xf86pciBus.h"
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
#include "xf86Bus.h"
@ -46,7 +46,6 @@
#endif
#include "misc.h"
#include "loaderProcs.h"
#include "xf86Parser_priv.h"
typedef struct _DevToConfig {
GDevRec GDev;
@ -696,8 +695,8 @@ DoConfigure(void)
home, addslash);
if (xf86writeConfigFile(filename, xf86config) == 0) {
LogMessageVerb(X_ERROR, 1, "Unable to write config file: \"%s\": %s\n",
filename, strerror(errno));
xf86Msg(X_ERROR, "Unable to write config file: \"%s\": %s\n",
filename, strerror(errno));
goto bail;
}
@ -802,8 +801,8 @@ DoConfigure(void)
}
if (xf86writeConfigFile(filename, xf86config) == 0) {
LogMessageVerb(X_ERROR, 1, "Unable to write config file: \"%s\": %s\n",
filename, strerror(errno));
xf86Msg(X_ERROR, "Unable to write config file: \"%s\": %s\n",
filename, strerror(errno));
goto bail;
}

View File

@ -588,9 +588,9 @@ xf86InitOrigins(void)
if (screen->refscreen != NULL &&
screen->refscreen->screennum >= xf86NumScreens) {
screensLeft &= ~(1 << i);
LogMessageVerb(X_WARNING, 1,
"Not including screen \"%s\" in origins calculation.\n",
screen->screen->id);
xf86Msg(X_WARNING,
"Not including screen \"%s\" in origins calculation.\n",
screen->screen->id);
continue;
}

View File

@ -370,7 +370,7 @@ xf86SetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr devRet)
if (oldPix->drawable.id)
FreeResource(oldPix->drawable.id, X11_RESTYPE_NONE);
else
dixDestroyPixmap(oldPix, 0);
(*pScreen->DestroyPixmap) (oldPix);
}
free(pScreenPriv->current);
pScreenPriv->current = NULL;
@ -432,7 +432,7 @@ xf86SetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr devRet)
if (oldPix->drawable.id)
FreeResource(oldPix->drawable.id, X11_RESTYPE_NONE);
else
dixDestroyPixmap(oldPix, 0);
(*pScreen->DestroyPixmap) (oldPix);
}
free(pScreenPriv->current);
pScreenPriv->current = NULL;

View File

@ -44,7 +44,7 @@
#include "dpmsproc.h"
#endif
#ifdef XSERVER_LIBPCIACCESS
#include "xf86VGAarbiter_priv.h"
#include "xf86VGAarbiter.h"
#endif
#ifdef DPMSExtension

View File

@ -77,7 +77,7 @@
#endif
#include "inputstr.h"
#include "xf86Xinput_priv.h"
#include "xf86Xinput.h"
#include "mipointer.h"
#include "xkbsrv.h"
#include "xkbstr.h"
@ -163,7 +163,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
switch (action) {
case ACTION_TERMINATE:
if (!xf86Info.dontZap) {
LogMessageVerb(X_INFO, 1, "Server zapped. Shutting down.\n");
xf86Msg(X_INFO, "Server zapped. Shutting down.\n");
GiveUp(0);
}
break;

View File

@ -51,11 +51,6 @@
#include "vidmodestr.h"
#endif
Bool noXFree86VidModeExtension = FALSE;
Bool noXFree86DGAExtension = FALSE;
Bool noXFree86DRIExtension = FALSE;
Bool noDRI2Extension = FALSE;
/*
* DDX-specific extensions.
*/

View File

@ -57,11 +57,10 @@
#include "xf86_OSlib.h"
#include "micmap.h"
#include "xf86DDC.h"
#include "xf86Xinput_priv.h"
#include "xf86Xinput.h"
#include "xf86InPriv.h"
#include "xf86Config.h"
#include "mivalidate.h"
#include "xf86Module_priv.h"
/* For xf86GetClocks */
#if defined(CSRG_BASED) || defined(__GNU__)
@ -638,7 +637,7 @@ void
xf86PrintDepthBpp(ScrnInfoPtr scrp)
{
xf86DrvMsg(scrp->scrnIndex, scrp->depthFrom, "Depth %d, ", scrp->depth);
LogMessageVerb(scrp->bitsPerPixelFrom, 1, "framebuffer bpp %d\n", scrp->bitsPerPixel);
xf86Msg(scrp->bitsPerPixelFrom, "framebuffer bpp %d\n", scrp->bitsPerPixel);
}
/*
@ -1095,6 +1094,28 @@ xf86IDrvMsg(InputInfoPtr dev, MessageType type, const char *format, ...)
va_end(ap);
}
/* Print non-driver messages with verbose level specified directly */
void
xf86MsgVerb(MessageType type, int verb, const char *format, ...)
{
va_list ap;
va_start(ap, format);
LogVMessageVerb(type, verb, format, ap);
va_end(ap);
}
/* Print non-driver messages with verbose level of 1 (default) */
void
xf86Msg(MessageType type, const char *format, ...)
{
va_list ap;
va_start(ap, format);
LogVMessageVerb(type, 1, format, ap);
va_end(ap);
}
/* Just like ErrorF, but with the verbose level checked */
void
xf86ErrorFVerb(int verb, const char *format, ...)
@ -1244,7 +1265,7 @@ xf86PrintChipsets(const char *drvname, const char *drvmsg, SymTabPtr chips)
int len, i;
len = 6 + strlen(drvname) + 2 + strlen(drvmsg) + 2;
LogMessageVerb(X_INFO, 1, "%s: %s:", drvname, drvmsg);
xf86Msg(X_INFO, "%s: %s:", drvname, drvmsg);
for (i = 0; chips[i].name != NULL; i++) {
if (i != 0) {
xf86ErrorF(",");
@ -1698,7 +1719,7 @@ xf86IsUnblank(int mode)
case SCREEN_SAVER_CYCLE:
return FALSE;
default:
LogMessageVerb(X_WARNING, 0, "Unexpected save screen mode: %d\n", mode);
xf86MsgVerb(X_WARNING, 0, "Unexpected save screen mode: %d\n", mode);
return TRUE;
}
}

View File

@ -64,10 +64,8 @@
#include "windowstr.h"
#include "scrnintstr.h"
#include "systemd-logind.h"
#include "xf86VGAarbiter_priv.h"
#include "loaderProcs.h"
#include "xf86Module_priv.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86Config.h"
@ -309,7 +307,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
t = time(NULL);
ct = ctime(&t);
LogMessageVerb(xf86LogFileFrom, 0, "Log file: \"%s\", Time: %s",
xf86MsgVerb(xf86LogFileFrom, 0, "Log file: \"%s\", Time: %s",
xf86LogFile, ct);
}
@ -319,7 +317,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
case CONFIG_OK:
break;
case CONFIG_PARSE_ERROR:
LogMessageVerb(X_ERROR, 1, "Error parsing the config file\n");
xf86Msg(X_ERROR, "Error parsing the config file\n");
return;
case CONFIG_NOFILE:
autoconfig = TRUE;
@ -351,7 +349,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
if (autoconfig) {
if (!xf86AutoConfig()) {
LogMessageVerb(X_ERROR, 1, "Auto configuration failed\n");
xf86Msg(X_ERROR, "Auto configuration failed\n");
return;
}
}
@ -374,7 +372,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
configured_device = xf86ConfigLayout.screens->screen->device;
if ((!configured_device) || (!configured_device->driver)) {
if (!autoConfigDevice(configured_device)) {
LogMessageVerb(X_ERROR, 1, "Automatic driver configuration failed\n");
xf86Msg(X_ERROR, "Automatic driver configuration failed\n");
return;
}
}
@ -404,7 +402,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
*/
if (xf86NumDrivers == 0) {
LogMessageVerb(X_ERROR, 1, "No drivers available.\n");
xf86Msg(X_ERROR, "No drivers available.\n");
return;
}
@ -502,8 +500,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
*/
if (xf86NumScreens == 0) {
LogMessageVerb(X_ERROR, 1,
"Screen(s) found, but none have a usable configuration.\n");
xf86Msg(X_ERROR,
"Screen(s) found, but none have a usable configuration.\n");
return;
}
@ -580,7 +578,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
if (xf86OSPMClose)
xf86OSPMClose();
if ((xf86OSPMClose = xf86OSPMOpen()) != NULL)
LogMessageVerb(X_INFO, 3, "APM registered successfully\n");
xf86MsgVerb(X_INFO, 3, "APM registered successfully\n");
/* Make sure full I/O access is enabled */
if (xorgHWAccess)
@ -858,12 +856,12 @@ ddxGiveUp(enum ExitCode error)
void
OsVendorFatalError(const char *f, va_list args)
{
ErrorF("\nPlease consult the " XVENDORNAME " support \n\t at "
__VENDORDWEBSUPPORT__ "\n for help. \n");
ErrorFSigSafe("\nPlease consult the " XVENDORNAME " support \n\t at "
__VENDORDWEBSUPPORT__ "\n for help. \n");
if (xf86LogFile && xf86LogFileWasOpened)
ErrorF("Please also check the log file at \"%s\" for additional "
"information.\n", xf86LogFile);
ErrorF("\n");
ErrorFSigSafe("Please also check the log file at \"%s\" for additional "
"information.\n", xf86LogFile);
ErrorFSigSafe("\n");
}
void

View File

@ -151,13 +151,13 @@ typedef struct {
extern _X_EXPORT void *LoadSubModule(void *, const char *, const char **,
const char **, void *,
const XF86ModReqInfo *, int *, int *);
extern _X_EXPORT void UnloadSubModule(void *);
extern _X_EXPORT void UnloadModule(void *);
extern _X_EXPORT void *LoaderSymbol(const char *);
extern _X_EXPORT void *LoaderSymbolFromModule(void *, const char *);
extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int);
/* deprecated, only kept for backwards compat w/ proprietary NVidia driver */
extern _X_EXPORT Bool LoaderShouldIgnoreABI(void) _X_DEPRECATED;
extern _X_EXPORT int LoaderGetABIVersion(const char *abiclass) _X_DEPRECATED;
extern _X_EXPORT Bool LoaderShouldIgnoreABI(void);
extern _X_EXPORT int LoaderGetABIVersion(const char *abiclass);
typedef void *(*ModuleSetupProc) (void *, void *, int *, int *);
typedef void (*ModuleTearDownProc) (void *);

View File

@ -1,22 +0,0 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XORG_XF86MODULE_PRIV_H
#define _XORG_XF86MODULE_PRIV_H
/*
* unload a previously loaded module
*
* @param mod the module to unload
*/
void UnloadModule(ModuleDescPtr mod);
/*
* unload a previously loaded sun-module
*
* @param mod the sub-module to unload
*/
void UnloadSubModule(ModuleDescPtr mod);
#endif /* _XORG_XF86MODULE_PRIV_H */

View File

@ -32,7 +32,7 @@
#include <X11/X.h>
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86Xinput_priv.h"
#include "xf86Xinput.h"
#include "xf86_OSproc.h"
int (*xf86PMGetEventFromOs) (int fd, pmEvent * events, int num) = NULL;
@ -208,7 +208,7 @@ xf86HandlePMEvents(int fd, void *data)
const char *str = NULL;
int verb = eventName(events[i], &str);
LogMessageVerb(X_INFO, verb, "PM Event received: %s\n", str);
xf86MsgVerb(X_INFO, verb, "PM Event received: %s\n", str);
DoApmEvent(events[i], FALSE);
switch (xf86PMConfirmEventToOs(fd, events[i])) {
case PM_WAIT:

View File

@ -30,7 +30,7 @@
#include "xorg-config.h"
#include "xf86VGAarbiter_priv.h"
#include "xf86VGAarbiter.h"
#include "xf86VGAarbiterPriv.h"
#include "xf86Bus.h"
#include "xf86Priv.h"
@ -71,8 +71,8 @@ xf86VGAarbiterInit(void)
{
if (pci_device_vgaarb_init() != 0) {
vga_no_arb = 1;
LogMessageVerb(X_WARNING, 1,
"VGA arbiter: cannot open kernel arbiter, no multi-card support\n");
xf86Msg(X_WARNING,
"VGA arbiter: cannot open kernel arbiter, no multi-card support\n");
}
}
@ -167,9 +167,8 @@ xf86VGAarbiterWrapFunctions(void)
if (vga_count < 2 || !xf86Screens)
return FALSE;
LogMessageVerb(X_INFO, 1,
"Found %d VGA devices: arbiter wrapping enabled\n",
vga_count);
xf86Msg(X_INFO, "Found %d VGA devices: arbiter wrapping enabled\n",
vga_count);
for (i = 0; i < xf86NumScreens; i++) {
pScreen = xf86Screens[i]->pScreen;

View File

@ -30,6 +30,14 @@
#include "misc.h"
#include "xf86.h"
/* Functions */
extern void xf86VGAarbiterInit(void);
extern void xf86VGAarbiterFini(void);
void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn);
extern Bool xf86VGAarbiterWrapFunctions(void);
extern void xf86VGAarbiterLock(ScrnInfoPtr pScrn);
extern void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn);
/* allow a driver to remove itself from arbiter - really should be
* done in the kernel though */
extern _X_EXPORT void xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn, int rsrc);

View File

@ -1,32 +0,0 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XSERVER_XF86VGAARBITERPRIV_H
#define _XSERVER_XF86VGAARBITERPRIV_H
#include <X11/Xdefs.h>
#include "xf86VGAarbiter.h"
#ifdef XSERVER_LIBPCIACCESS
void xf86VGAarbiterInit(void);
void xf86VGAarbiterFini(void);
void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn);
Bool xf86VGAarbiterWrapFunctions(void);
void xf86VGAarbiterLock(ScrnInfoPtr pScrn);
void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn);
#else /* XSERVER_LIBPCIACCESS */
static inline void xf86VGAarbiterInit() {}
static inline void xf86VGAarbiterFini() {}
static inline void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn) {}
static inline void xf86VGAarbiterWrapFunctions(void) { return FALSE; }
static inline void xf86VGAarbiterLock(ScrnInfoPtr pScrn) {}
static inline void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn) {}
#endif /* XSERVER_LIBPCIACCESS */
#endif /* _XSERVER_XF86VGAARBITERPRIV_H */

View File

@ -64,7 +64,7 @@
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86Config.h"
#include "xf86Xinput_priv.h"
#include "xf86Xinput.h"
#include "XIstubs.h"
#include "xf86Optrec.h"
#include "mipointer.h"
@ -76,7 +76,6 @@
#include "eventstr.h"
#include "inpututils.h"
#include "optionstr.h"
#include "xf86Module_priv.h"
#ifdef HAVE_FNMATCH_H
#include <fnmatch.h>
@ -110,12 +109,12 @@
#include "xkbsrv.h"
/* Valuator verification macro */
#define XI_VERIFY_VALUATORS(num_valuators) \
if (num_valuators > MAX_VALUATORS) { \
LogMessageVerb(X_ERROR, 1, "%s: num_valuator %d is greater than MAX_VALUATORS\n", \
__FUNCTION__, num_valuators); \
return; \
}
#define XI_VERIFY_VALUATORS(num_valuators) \
if (num_valuators > MAX_VALUATORS) { \
xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" \
" MAX_VALUATORS\n", __FUNCTION__, num_valuators); \
return; \
}
static int
xf86InputDevicePostInit(DeviceIntPtr dev);
@ -149,8 +148,8 @@ ProcessVelocityConfiguration(DeviceIntPtr pDev, const char *devname, void *list,
/* common settings (available via device properties) */
tempf = xf86SetRealOption(list, "ConstantDeceleration", 1.0);
if (tempf != 1.0) {
LogMessageVerb(X_CONFIG, 1, "%s: (accel) constant deceleration by %.1f\n",
devname, tempf);
xf86Msg(X_CONFIG, "%s: (accel) constant deceleration by %.1f\n",
devname, tempf);
prop = XIGetKnownProperty(ACCEL_PROP_CONSTANT_DECELERATION);
XIChangeDeviceProperty(pDev, prop, float_prop, 32,
PropModeReplace, 1, &tempf, FALSE);
@ -158,8 +157,8 @@ ProcessVelocityConfiguration(DeviceIntPtr pDev, const char *devname, void *list,
tempf = xf86SetRealOption(list, "AdaptiveDeceleration", 1.0);
if (tempf > 1.0) {
LogMessageVerb(X_CONFIG, 1, "%s: (accel) adaptive deceleration by %.1f\n",
devname, tempf);
xf86Msg(X_CONFIG, "%s: (accel) adaptive deceleration by %.1f\n",
devname, tempf);
prop = XIGetKnownProperty(ACCEL_PROP_ADAPTIVE_DECELERATION);
XIChangeDeviceProperty(pDev, prop, float_prop, 32,
PropModeReplace, 1, &tempf, FALSE);
@ -172,11 +171,12 @@ ProcessVelocityConfiguration(DeviceIntPtr pDev, const char *devname, void *list,
prop = XIGetKnownProperty(ACCEL_PROP_PROFILE_NUMBER);
if (XIChangeDeviceProperty(pDev, prop, XA_INTEGER, 32,
PropModeReplace, 1, &tempi, FALSE) == Success) {
LogMessageVerb(X_CONFIG, 1, "%s: (accel) acceleration profile %i\n", devname, tempi);
xf86Msg(X_CONFIG, "%s: (accel) acceleration profile %i\n", devname,
tempi);
}
else {
LogMessageVerb(X_CONFIG, 1, "%s: (accel) acceleration profile %i is unknown\n",
devname, tempi);
xf86Msg(X_CONFIG, "%s: (accel) acceleration profile %i is unknown\n",
devname, tempi);
}
/* set scaling */
@ -204,8 +204,8 @@ ProcessVelocityConfiguration(DeviceIntPtr pDev, const char *devname, void *list,
tempf = xf86SetRealOption(list, "VelocityRelDiff", -1);
if (tempf >= 0) {
LogMessageVerb(X_CONFIG, 1, "%s: (accel) max rel. velocity difference: %.1f%%\n",
devname, tempf * 100.0);
xf86Msg(X_CONFIG, "%s: (accel) max rel. velocity difference: %.1f%%\n",
devname, tempf * 100.0);
s->max_rel_diff = tempf;
}
@ -251,18 +251,18 @@ ApplyAccelerationSettings(DeviceIntPtr dev)
}
if (InitPointerAccelerationScheme(dev, scheme)) {
LogMessageVerb(X_CONFIG, 1, "%s: (accel) selected scheme %s/%i\n",
pInfo->name, schemeStr, scheme);
xf86Msg(X_CONFIG, "%s: (accel) selected scheme %s/%i\n",
pInfo->name, schemeStr, scheme);
}
else {
LogMessageVerb(X_CONFIG, 1, "%s: (accel) could not init scheme %s\n",
pInfo->name, schemeStr);
xf86Msg(X_CONFIG, "%s: (accel) could not init scheme %s\n",
pInfo->name, schemeStr);
scheme = dev->valuator->accelScheme.number;
}
}
else {
LogMessageVerb(X_CONFIG, 1, "%s: (accel) keeping acceleration scheme %i\n",
pInfo->name, scheme);
xf86Msg(X_CONFIG, "%s: (accel) keeping acceleration scheme %i\n",
pInfo->name, scheme);
}
free(schemeStr);
@ -291,11 +291,11 @@ ApplyAccelerationSettings(DeviceIntPtr dev)
if (i >= 0)
dev->ptrfeed->ctrl.threshold = i;
LogMessageVerb(X_CONFIG, 1, "%s: (accel) acceleration factor: %.3f\n",
pInfo->name, ((float) dev->ptrfeed->ctrl.num) /
((float) dev->ptrfeed->ctrl.den));
LogMessageVerb(X_CONFIG, 1, "%s: (accel) acceleration threshold: %i\n",
pInfo->name, dev->ptrfeed->ctrl.threshold);
xf86Msg(X_CONFIG, "%s: (accel) acceleration factor: %.3f\n",
pInfo->name, ((float) dev->ptrfeed->ctrl.num) /
((float) dev->ptrfeed->ctrl.den));
xf86Msg(X_CONFIG, "%s: (accel) acceleration threshold: %i\n",
pInfo->name, dev->ptrfeed->ctrl.threshold);
}
}
@ -318,9 +318,9 @@ ApplyTransformationMatrix(DeviceIntPtr dev)
&matrix[2], &matrix[3], &matrix[4], &matrix[5], &matrix[6],
&matrix[7], &matrix[8]);
if (rc != 9) {
LogMessageVerb(X_ERROR,1,
"%s: invalid format for transformation matrix. Ignoring configuration.\n",
pInfo->name);
xf86Msg(X_ERROR,
"%s: invalid format for transformation matrix. Ignoring configuration.\n",
pInfo->name);
return;
}
@ -347,11 +347,11 @@ ApplyAutoRepeat(DeviceIntPtr dev)
return;
if (sscanf(repeatStr, "%ld %ld", &delay, &rate) != 2) {
LogMessageVerb(X_ERROR, 1, "\"%s\" is not a valid AutoRepeat value\n", repeatStr);
xf86Msg(X_ERROR, "\"%s\" is not a valid AutoRepeat value\n", repeatStr);
return;
}
LogMessageVerb(X_CONFIG, 1, "AutoRepeat: %ld %ld\n", delay, rate);
xf86Msg(X_CONFIG, "AutoRepeat: %ld %ld\n", delay, rate);
xkbi->desc->ctrls->repeat_delay = delay;
xkbi->desc->ctrls->repeat_interval = 1000 / rate;
}
@ -372,11 +372,11 @@ xf86ProcessCommonOptions(InputInfoPtr pInfo, XF86OptionPtr list)
!xf86SetBoolOption(list, "SendCoreEvents", 1) ||
!xf86SetBoolOption(list, "CorePointer", 1) ||
!xf86SetBoolOption(list, "CoreKeyboard", 1)) {
LogMessageVerb(X_CONFIG, 1, "%s: doesn't report core events\n", pInfo->name);
xf86Msg(X_CONFIG, "%s: doesn't report core events\n", pInfo->name);
}
else {
pInfo->flags |= XI86_ALWAYS_CORE;
LogMessageVerb(X_CONFIG, 1, "%s: always reports core events\n", pInfo->name);
xf86Msg(X_CONFIG, "%s: always reports core events\n", pInfo->name);
}
}
@ -398,7 +398,7 @@ xf86ActivateDevice(InputInfoPtr pInfo)
dev = AddInputDevice(serverClient, pInfo->device_control, TRUE);
if (dev == NULL) {
LogMessageVerb(X_ERROR, 1, "Too many input devices. Ignoring %s\n", pInfo->name);
xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n", pInfo->name);
pInfo->dev = NULL;
return NULL;
}
@ -415,9 +415,9 @@ xf86ActivateDevice(InputInfoPtr pInfo)
dev->config_info = xf86SetStrOption(pInfo->options, "config_info", NULL);
if (serverGeneration == 1)
LogMessageVerb(X_INFO, 1,
"XINPUT: Adding extended input device \"%s\" (type: %s, id %d)\n",
pInfo->name, pInfo->type_name, dev->id);
xf86Msg(X_INFO,
"XINPUT: Adding extended input device \"%s\" (type: %s, id %d)\n",
pInfo->name, pInfo->type_name, dev->id);
return dev;
}
@ -724,16 +724,16 @@ MergeInputClasses(const InputInfoPtr idev, const InputAttributes * attrs)
free((void *) idev->driver);
idev->driver = Xstrdup(cl->driver);
if (!idev->driver) {
LogMessageVerb(X_ERROR, 1, "Failed to allocate memory while merging "
"InputClass configuration");
xf86Msg(X_ERROR, "Failed to allocate memory while merging "
"InputClass configuration");
return BadAlloc;
}
classopts = xf86ReplaceStrOption(classopts, "driver", idev->driver);
}
/* Apply options to device with InputClass settings preferred. */
LogMessageVerb(X_CONFIG, 1, "%s: Applying InputClass \"%s\"\n",
idev->name, cl->identifier);
xf86Msg(X_CONFIG, "%s: Applying InputClass \"%s\"\n",
idev->name, cl->identifier);
idev->options = xf86optionListMerge(idev->options, classopts);
}
@ -761,8 +761,8 @@ IgnoreInputClass(const InputInfoPtr idev, const InputAttributes * attrs)
}
if (ignore)
LogMessageVerb(X_CONFIG, 1, "%s: Ignoring device from InputClass \"%s\"\n",
idev->name, ignore_class);
xf86Msg(X_CONFIG, "%s: Ignoring device from InputClass \"%s\"\n",
idev->name, ignore_class);
return ignore;
}
@ -914,10 +914,10 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
drv = xf86LoadInputDriver(pInfo->driver);
if (!drv) {
LogMessageVerb(X_ERROR, 1, "No input driver matching `%s'\n", pInfo->driver);
xf86Msg(X_ERROR, "No input driver matching `%s'\n", pInfo->driver);
if (strlen(FALLBACK_INPUT_DRIVER) > 0) {
LogMessageVerb(X_INFO, 1, "Falling back to input driver `%s'\n",
xf86Msg(X_INFO, "Falling back to input driver `%s'\n",
FALLBACK_INPUT_DRIVER);
drv = xf86LoadInputDriver(FALLBACK_INPUT_DRIVER);
if (drv) {
@ -931,13 +931,13 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
}
}
LogMessageVerb(X_INFO, 1, "Using input driver '%s' for '%s'\n", drv->driverName,
xf86Msg(X_INFO, "Using input driver '%s' for '%s'\n", drv->driverName,
pInfo->name);
if (!drv->PreInit) {
LogMessageVerb(X_ERROR, 1,
"Input driver `%s' has no PreInit function (ignoring)\n",
drv->driverName);
xf86Msg(X_ERROR,
"Input driver `%s' has no PreInit function (ignoring)\n",
drv->driverName);
rval = BadImplementation;
goto unwind;
}
@ -975,7 +975,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
input_unlock();
if (rval != Success) {
LogMessageVerb(X_ERROR, 1, "PreInit returned %d for \"%s\"\n", rval, pInfo->name);
xf86Msg(X_ERROR, "PreInit returned %d for \"%s\"\n", rval, pInfo->name);
goto unwind;
}
@ -986,14 +986,14 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
rval = ActivateDevice(dev, TRUE);
if (rval != Success) {
LogMessageVerb(X_ERROR, 1, "Couldn't init device \"%s\"\n", pInfo->name);
xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
RemoveDevice(dev, TRUE);
goto unwind;
}
rval = xf86InputDevicePostInit(dev);
if (rval != Success) {
LogMessageVerb(X_ERROR, 1, "Couldn't post-init device \"%s\"\n", pInfo->name);
xf86Msg(X_ERROR, "Couldn't post-init device \"%s\"\n", pInfo->name);
RemoveDevice(dev, TRUE);
goto unwind;
}
@ -1003,7 +1003,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
input_lock();
EnableDevice(dev, TRUE);
if (!dev->enabled) {
LogMessageVerb(X_ERROR, 1, "Couldn't init device \"%s\"\n", pInfo->name);
xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
RemoveDevice(dev, TRUE);
rval = BadMatch;
input_unlock();
@ -1108,14 +1108,15 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
}
if (!pInfo->name) {
LogMessageVerb(X_INFO, 1, "No identifier specified, ignoring this device.\n");
xf86Msg(X_INFO, "No identifier specified, ignoring this device.\n");
rval = BadRequest;
goto unwind;
}
if (!pInfo->driver) {
LogMessageVerb(X_INFO, 1, "No input driver specified, ignoring this device.\n");
LogMessageVerb(X_INFO, 1, "This device may have been added with another device file.\n");
xf86Msg(X_INFO, "No input driver specified, ignoring this device.\n");
xf86Msg(X_INFO,
"This device may have been added with another device file.\n");
rval = BadRequest;
goto unwind;
}
@ -1128,7 +1129,7 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
unwind:
if (is_auto && !xf86Info.autoAddDevices)
LogMessageVerb(X_INFO, 1, "AutoAddDevices is off - not adding device.\n");
xf86Msg(X_INFO, "AutoAddDevices is off - not adding device.\n");
xf86DeleteInput(pInfo, 0);
return rval;
}

View File

@ -114,6 +114,9 @@ struct _InputInfoRec {
InputAttributes *attrs;
};
/* xf86Globals.c */
extern InputInfoPtr xf86InputDevs;
/* xf86Xinput.c */
extern _X_EXPORT void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
int first_valuator, int num_valuators,
@ -187,6 +190,10 @@ extern _X_EXPORT void xf86DisableDevice(DeviceIntPtr dev, Bool panic);
extern _X_EXPORT void xf86EnableDevice(DeviceIntPtr dev);
extern _X_EXPORT void xf86InputEnableVTProbe(void);
/* not exported */
int xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL is_auto);
InputInfoPtr xf86AllocateInput(void);
/* xf86Helper.c */
extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, void *module,
int flags);

View File

@ -1,15 +0,0 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XSERVER__XF86XINPUT_H
#define _XSERVER__XF86XINPUT_H
#include "xf86Xinput.h"
extern InputInfoPtr xf86InputDevs;
int xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL is_auto);
InputInfoPtr xf86AllocateInput(void);
#endif /* _XSERVER__XF86XINPUT_H */

View File

@ -47,7 +47,7 @@
#include "xf86_OSproc.h"
#include "xf86str.h"
#include "micmap.h"
#include "xf86RandR12_priv.h"
#include "xf86RandR12.h"
#include "xf86Crtc.h"
#ifdef XFreeXDGA

View File

@ -133,8 +133,8 @@ xf86PciProbe(void)
primaryBus.id.pci = info;
}
else {
LogMessageVerb(X_NOTICE, 1,
"More than one possible primary device found\n");
xf86Msg(X_NOTICE,
"More than one possible primary device found\n");
primaryBus.type ^= (BusType) (-1);
}
}
@ -154,10 +154,10 @@ xf86PciProbe(void)
if (xf86IsPrimaryPci(info))
prim = "*";
LogMessageVerb(X_PROBED, 1, "PCI:%s(%u@%u:%u:%u) %04x:%04x:%04x:%04x ", prim,
info->bus, info->domain, info->dev, info->func,
info->vendor_id, info->device_id,
info->subvendor_id, info->subdevice_id);
xf86Msg(X_PROBED, "PCI:%s(%u@%u:%u:%u) %04x:%04x:%04x:%04x ", prim,
info->bus, info->domain, info->dev, info->func,
info->vendor_id, info->device_id,
info->subvendor_id, info->subdevice_id);
xf86ErrorF("rev %d", info->revision);
@ -825,11 +825,11 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
devList[j]->screen == instances[i].screen) {
if (devBus)
LogMessageVerb(X_WARNING, 0,
"%s: More than one matching Device section for "
"instances\n\t(BusID: %s) found: %s\n",
driverName, devList[j]->busID,
devList[j]->identifier);
xf86MsgVerb(X_WARNING, 0,
"%s: More than one matching Device section for "
"instances\n\t(BusID: %s) found: %s\n",
driverName, devList[j]->busID,
devList[j]->identifier);
else
devBus = devList[j];
}
@ -840,12 +840,13 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
* only assign to it to the primary device.
*/
if (xf86IsPrimaryPci(pPci)) {
LogMessageVerb(X_PROBED, 1, "Assigning device section with no busID to primary device\n");
xf86Msg(X_PROBED, "Assigning device section with no busID"
" to primary device\n");
if (dev || devBus)
LogMessageVerb(X_WARNING, 0,
"%s: More than one matching Device section "
"found: %s\n", driverName,
devList[j]->identifier);
xf86MsgVerb(X_WARNING, 0,
"%s: More than one matching Device section "
"found: %s\n", driverName,
devList[j]->identifier);
else
dev = devList[j];
}
@ -855,10 +856,10 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
dev = devBus; /* busID preferred */
if (!dev) {
if (xf86CheckPciSlot(pPci) && pciDeviceHasBars(pPci)) {
LogMessageVerb(X_WARNING, 0, "%s: No matching Device section "
"for instance (BusID PCI:%u@%u:%u:%u) found\n",
driverName, pPci->bus, pPci->domain, pPci->dev,
pPci->func);
xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section "
"for instance (BusID PCI:%u@%u:%u:%u) found\n",
driverName, pPci->bus, pPci->domain, pPci->dev,
pPci->func);
}
}
else {
@ -887,10 +888,10 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
if (c->token == -1) {
instances[i].claimed = FALSE;
numClaimedInstances--;
LogMessageVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
"section \"%s\" isn't valid for this driver\n",
driverName, instances[i].dev->chipset,
instances[i].dev->identifier);
xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
"section \"%s\" isn't valid for this driver\n",
driverName, instances[i].dev->chipset,
instances[i].dev->identifier);
}
else {
instances[i].chip = c->token;
@ -900,17 +901,17 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
break;
}
if (id->numChipset >= 0) {
LogMessageVerb(X_CONFIG, 1, "Chipset override: %s\n",
instances[i].dev->chipset);
xf86Msg(X_CONFIG, "Chipset override: %s\n",
instances[i].dev->chipset);
from = X_CONFIG;
}
else {
instances[i].claimed = FALSE;
numClaimedInstances--;
LogMessageVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
"section \"%s\" isn't a valid PCI chipset\n",
driverName, instances[i].dev->chipset,
instances[i].dev->identifier);
xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
"section \"%s\" isn't a valid PCI chipset\n",
driverName, instances[i].dev->chipset,
instances[i].dev->identifier);
}
}
}
@ -922,15 +923,16 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
if (id->numChipset == -1) {
instances[i].claimed = FALSE;
numClaimedInstances--;
LogMessageVerb(X_WARNING, 0, "%s: ChipID 0x%04X in Device "
"section \"%s\" isn't valid for this driver\n",
driverName, instances[i].dev->chipID,
instances[i].dev->identifier);
xf86MsgVerb(X_WARNING, 0, "%s: ChipID 0x%04X in Device "
"section \"%s\" isn't valid for this driver\n",
driverName, instances[i].dev->chipID,
instances[i].dev->identifier);
}
else {
instances[i].chip = id->numChipset;
LogMessageVerb(X_CONFIG, 1, "ChipID override: 0x%04X\n",
instances[i].dev->chipID);
xf86Msg(X_CONFIG, "ChipID override: 0x%04X\n",
instances[i].dev->chipID);
from = X_CONFIG;
}
}
@ -947,7 +949,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
if (c->token == instances[i].chip)
break;
}
LogMessageVerb(from, 1, "Chipset %s found\n", c->name);
xf86Msg(from, "Chipset %s found\n", c->name);
}
}
@ -1308,9 +1310,9 @@ xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip,
if (!idsdir)
return;
LogMessageVerb(X_INFO, 1,
"Scanning %s directory for additional PCI ID's supported by the drivers\n",
PCI_TXT_IDS_PATH);
xf86Msg(X_INFO,
"Scanning %s directory for additional PCI ID's supported by the drivers\n",
PCI_TXT_IDS_PATH);
direntry = readdir(idsdir);
/* Read the directory */
while (direntry) {
@ -1326,8 +1328,8 @@ xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip,
PCI_TXT_IDS_PATH, direntry->d_name);
fp = fopen(path_name, "r");
if (fp == NULL) {
LogMessageVerb(X_ERROR, 1, "Could not open %s for reading. Exiting.\n",
path_name);
xf86Msg(X_ERROR, "Could not open %s for reading. Exiting.\n",
path_name);
goto end;
}
/* Read the file */
@ -1361,8 +1363,8 @@ xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip,
(char *) malloc(sizeof(char) *
strlen(direntry->d_name) - 3);
if (!tmpMatch) {
LogMessageVerb(X_ERROR, 1,
"Could not allocate space for the module name. Exiting.\n");
xf86Msg(X_ERROR,
"Could not allocate space for the module name. Exiting.\n");
goto end;
}
/* hack off the .ids suffix. This should guard
@ -1378,8 +1380,8 @@ xf86MatchDriverFromFiles(uint16_t match_vendor, uint16_t match_chip,
}
}
xf86AddMatchedDriver(md, tmpMatch);
LogMessageVerb(X_INFO, 1, "Matched %s from file name %s\n",
tmpMatch, direntry->d_name);
xf86Msg(X_INFO, "Matched %s from file name %s\n",
tmpMatch, direntry->d_name);
free(tmpMatch);
}
}

View File

@ -233,9 +233,9 @@ xf86OutputClassDriverList(int index, XF86MatchedDrivers *md)
if (OutputClassMatches(cl, &xf86_platform_devices[index])) {
char *path = xf86_platform_odev_attributes(index)->path;
LogMessageVerb(X_INFO, 1, "Applying OutputClass \"%s\" to %s\n",
cl->identifier, path);
LogMessageVerb(X_NONE, 1, "\tloading driver: %s\n", cl->driver);
xf86Msg(X_INFO, "Applying OutputClass \"%s\" to %s\n",
cl->identifier, path);
xf86Msg(X_NONE, "\tloading driver: %s\n", cl->driver);
xf86AddMatchedDriver(md, cl->driver);
}
@ -283,7 +283,7 @@ void xf86PlatformScanPciDev(void)
if (!xf86scanpci())
return;
LogMessageVerb(X_CONFIG, 1, "Scanning the platform PCI devices\n");
xf86Msg(X_CONFIG, "Scanning the platform PCI devices\n");
for (i = 0; i < xf86_num_platform_devices; i++) {
char *busid = xf86_platform_odev_attributes(i)->busid;
@ -327,8 +327,8 @@ xf86platformProbe(void)
XNFasprintf(&path, "%s,%s", cl->modulepath,
path ? path : xf86ModulePath);
free(old_path);
LogMessageVerb(X_CONFIG, 1, "OutputClass \"%s\" ModulePath extended to \"%s\"\n",
cl->identifier, path);
xf86Msg(X_CONFIG, "OutputClass \"%s\" ModulePath extended to \"%s\"\n",
cl->identifier, path);
LoaderSetPath(path);
}
}
@ -344,8 +344,8 @@ xf86platformProbe(void)
continue;
if (xf86CheckBoolOption(cl->option_lst, "PrimaryGPU", FALSE)) {
LogMessageVerb(X_CONFIG, 1, "OutputClass \"%s\" setting %s as PrimaryGPU\n",
cl->identifier, dev->attribs->path);
xf86Msg(X_CONFIG, "OutputClass \"%s\" setting %s as PrimaryGPU\n",
cl->identifier, dev->attribs->path);
primaryBus.type = BUS_PLATFORM;
primaryBus.id.plat = dev;
return 0;
@ -395,8 +395,8 @@ xf86MergeOutputClassOptions(int entityIndex, void **options)
}
break;
default:
LogMessageVerb(X_DEBUG, 1, "xf86MergeOutputClassOptions unsupported bus type %d\n",
entity->bus.type);
xf86Msg(X_DEBUG, "xf86MergeOutputClassOptions unsupported bus type %d\n",
entity->bus.type);
}
if (!dev)
@ -406,8 +406,8 @@ xf86MergeOutputClassOptions(int entityIndex, void **options)
if (!OutputClassMatches(cl, dev) || !cl->option_lst)
continue;
LogMessageVerb(X_INFO, 1, "Applying OutputClass \"%s\" options to %s\n",
cl->identifier, dev->attribs->path);
xf86Msg(X_INFO, "Applying OutputClass \"%s\" options to %s\n",
cl->identifier, dev->attribs->path);
classopts = xf86optionListDup(cl->option_lst);
*options = xf86optionListMerge(*options, classopts);
@ -653,8 +653,8 @@ xf86PlatformFindHotplugDriver(int dev_index)
}
/* Return the first driver from the match list */
LogMessageVerb(X_INFO, 1, "matching hotplug-driver is %s\n",
hp_driver ? hp_driver : "none");
xf86Msg(X_INFO, "matching hotplug-driver is %s\n",
hp_driver ? hp_driver : "none");
return hp_driver;
}
@ -811,13 +811,13 @@ void xf86platformPrimary(void)
{
/* use the first platform device as a fallback */
if (primaryBus.type == BUS_NONE) {
LogMessageVerb(X_INFO, 1, "no primary bus or device found\n");
xf86Msg(X_INFO, "no primary bus or device found\n");
if (xf86_num_platform_devices > 0) {
primaryBus.id.plat = &xf86_platform_devices[0];
primaryBus.type = BUS_PLATFORM;
LogMessageVerb(X_NONE, 1, "\tfalling back to %s\n", primaryBus.id.plat->attribs->syspath);
xf86Msg(X_NONE, "\tfalling back to %s\n", primaryBus.id.plat->attribs->syspath);
}
}
}

View File

@ -224,7 +224,7 @@ xf86SbusProbe(void)
break;
}
LogMessageVerb(X_PROBED, 1, "SBUS:(0x%08x) %s", psdp->node.node, psdp->descr);
xf86Msg(X_PROBED, "SBUS:(0x%08x) %s", psdp->node.node, psdp->descr);
promPath = sparcPromNode2Pathname(&psdp->node);
if (promPath) {
xf86ErrorF(" at %s", promPath);
@ -232,7 +232,7 @@ xf86SbusProbe(void)
}
}
else
LogMessageVerb(X_PROBED, 1, "SBUS: %s", psdp->descr);
xf86Msg(X_PROBED, "SBUS: %s", psdp->descr);
xf86ErrorF("\n");
}
if (useProm)
@ -464,11 +464,11 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
if (devList[j]->busID && *devList[j]->busID) {
if (xf86CompareSbusBusString(devList[j]->busID, psdp->fbNum)) {
if (devBus)
LogMessageVerb(X_WARNING, 0,
"%s: More than one matching Device section for "
"instance (BusID: %s) found: %s\n",
driverName, devList[j]->identifier,
devList[j]->busID);
xf86MsgVerb(X_WARNING, 0,
"%s: More than one matching Device section for "
"instance (BusID: %s) found: %s\n",
driverName, devList[j]->identifier,
devList[j]->busID);
else
devBus = devList[j];
}
@ -476,34 +476,34 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
else {
if (!dev && !devBus) {
if (promPath)
LogMessageVerb(X_PROBED, 1,
"Assigning device section with no busID to SBUS:%s\n",
promPath);
xf86Msg(X_PROBED,
"Assigning device section with no busID to SBUS:%s\n",
promPath);
else
LogMessageVerb(X_PROBED, 1,
"Assigning device section with no busID to SBUS:fb%d\n",
psdp->fbNum);
xf86Msg(X_PROBED,
"Assigning device section with no busID to SBUS:fb%d\n",
psdp->fbNum);
dev = devList[j];
}
else
LogMessageVerb(X_WARNING, 0,
"%s: More than one matching Device section "
"found: %s\n", driverName,
devList[j]->identifier);
xf86MsgVerb(X_WARNING, 0,
"%s: More than one matching Device section "
"found: %s\n", driverName,
devList[j]->identifier);
}
}
if (devBus)
dev = devBus; /* busID preferred */
if (!dev && psdp->fd != -2) {
if (promPath) {
LogMessageVerb(X_WARNING, 0, "%s: No matching Device section "
"for instance (BusID SBUS:%s) found\n",
driverName, promPath);
xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section "
"for instance (BusID SBUS:%s) found\n",
driverName, promPath);
}
else
LogMessageVerb(X_WARNING, 0, "%s: No matching Device section "
"for instance (BusID SBUS:fb%d) found\n",
driverName, psdp->fbNum);
xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section "
"for instance (BusID SBUS:fb%d) found\n",
driverName, psdp->fbNum);
}
else if (dev) {
numClaimedInstances++;

View File

@ -104,4 +104,8 @@ extern _X_EXPORT char *sparcPromNode2Pathname(sbusPromNodePtr pnode);
extern _X_EXPORT int sparcPromPathname2Node(const char *pathName);
extern _X_EXPORT char *sparcDriverName(void);
extern Bool xf86SbusConfigure(void *busData, sbusDevicePtr sBus);
extern void xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus,
GDevRec * GDev);
#endif /* _XF86_SBUSBUS_H */

View File

@ -1,16 +0,0 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
* Copyright © 2000 Jakub Jelinek (jakub@redhat.com)
*/
#ifndef _XSERVER_XF86_SBUSBUS_H
#define _XSERVER_XF86_SBUSBUS_H
#include <X11/Xdefs.h>
#include "xf86sbusBus.h"
Bool xf86SbusConfigure(void *busData, sbusDevicePtr sBus);
void xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus, GDevRec* GDev);
#endif /* _XSERVER_XF86_SBUSBUS_H */

View File

@ -32,7 +32,7 @@
#include "xf86.h"
#include "xf86_OSproc.h"
#define _PARSE_EDID_
#include "xf86DDC_priv.h"
#include "xf86DDC.h"
#include <string.h>
static void get_vendor_section(Uchar *, struct vendor *);
@ -89,8 +89,8 @@ handle_edid_quirks(xf86MonPtr m)
xf86ForEachDetailedBlock(m, find_max_detailed_clock, &clock);
if (clock && (ranges->max_clock * 1e6 < clock)) {
LogMessageVerb(X_WARNING, 1, "EDID timing clock %.2f exceeds claimed max "
"%dMHz, fixing\n", clock / 1.0e6, ranges->max_clock);
xf86Msg(X_WARNING, "EDID timing clock %.2f exceeds claimed max "
"%dMHz, fixing\n", clock / 1.0e6, ranges->max_clock);
ranges->max_clock = (clock + 999999) / 1e6;
}
}
@ -159,8 +159,8 @@ encode_aspect_ratio(xf86MonPtr m)
m->features.vsize = (p.real_vsize + 5) / 10;
}
LogMessageVerb(X_INFO, 1, "Quirked EDID physical size to %dx%d cm\n",
m->features.hsize, m->features.vsize);
xf86Msg(X_INFO, "Quirked EDID physical size to %dx%d cm\n",
m->features.hsize, m->features.vsize);
}
}

View File

@ -34,7 +34,7 @@
#include "misc.h"
#include "xf86.h"
#include "xf86_OSproc.h"
#include "xf86DDC_priv.h"
#include "xf86DDC.h"
#include "edid.h"
#define EDID_WIDTH 16

View File

@ -56,4 +56,46 @@ FindDMTMode(int hsize, int vsize, int refresh, Bool rb);
extern _X_EXPORT const DisplayModeRec DMTModes[];
/*
* Quirks to work around broken EDID data from various monitors.
*/
typedef enum {
DDC_QUIRK_NONE = 0,
/* First detailed mode is bogus, prefer largest mode at 60hz */
DDC_QUIRK_PREFER_LARGE_60 = 1 << 0,
/* 135MHz clock is too high, drop a bit */
DDC_QUIRK_135_CLOCK_TOO_HIGH = 1 << 1,
/* Prefer the largest mode at 75 Hz */
DDC_QUIRK_PREFER_LARGE_75 = 1 << 2,
/* Convert detailed timing's horizontal from units of cm to mm */
DDC_QUIRK_DETAILED_H_IN_CM = 1 << 3,
/* Convert detailed timing's vertical from units of cm to mm */
DDC_QUIRK_DETAILED_V_IN_CM = 1 << 4,
/* Detailed timing descriptors have bogus size values, so just take the
* maximum size and use that.
*/
DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE = 1 << 5,
/* Monitor forgot to set the first detailed is preferred bit. */
DDC_QUIRK_FIRST_DETAILED_PREFERRED = 1 << 6,
/* use +hsync +vsync for detailed mode */
DDC_QUIRK_DETAILED_SYNC_PP = 1 << 7,
/* Force single-link DVI bandwidth limit */
DDC_QUIRK_DVI_SINGLE_LINK = 1 << 8,
} ddc_quirk_t;
typedef void (*handle_detailed_fn) (struct detailed_monitor_section *, void *);
void xf86ForEachDetailedBlock(xf86MonPtr mon, handle_detailed_fn, void *data);
ddc_quirk_t xf86DDCDetectQuirks(int scrnIndex, xf86MonPtr DDC, Bool verbose);
void xf86DetTimingApplyQuirks(struct detailed_monitor_section *det_mon,
ddc_quirk_t quirks, int hsize, int vsize);
typedef void (*handle_video_fn) (struct cea_video_block *, void *);
void xf86ForEachVideoBlock(xf86MonPtr, handle_video_fn, void *);
struct cea_data_block *xf86MonitorFindHDMIBlock(xf86MonPtr mon);
#endif

View File

@ -1,53 +0,0 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
* Copyright © 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
*/
#ifndef _XSERVER_XF86_DDC_PRIV_H
#define _XSERVER_XF86_DDC_PRIV_H
#include "xf86DDC.h"
/*
* Quirks to work around broken EDID data from various monitors.
*/
typedef enum {
DDC_QUIRK_NONE = 0,
/* First detailed mode is bogus, prefer largest mode at 60hz */
DDC_QUIRK_PREFER_LARGE_60 = 1 << 0,
/* 135MHz clock is too high, drop a bit */
DDC_QUIRK_135_CLOCK_TOO_HIGH = 1 << 1,
/* Prefer the largest mode at 75 Hz */
DDC_QUIRK_PREFER_LARGE_75 = 1 << 2,
/* Convert detailed timing's horizontal from units of cm to mm */
DDC_QUIRK_DETAILED_H_IN_CM = 1 << 3,
/* Convert detailed timing's vertical from units of cm to mm */
DDC_QUIRK_DETAILED_V_IN_CM = 1 << 4,
/* Detailed timing descriptors have bogus size values, so just take the
* maximum size and use that.
*/
DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE = 1 << 5,
/* Monitor forgot to set the first detailed is preferred bit. */
DDC_QUIRK_FIRST_DETAILED_PREFERRED = 1 << 6,
/* use +hsync +vsync for detailed mode */
DDC_QUIRK_DETAILED_SYNC_PP = 1 << 7,
/* Force single-link DVI bandwidth limit */
DDC_QUIRK_DVI_SINGLE_LINK = 1 << 8,
} ddc_quirk_t;
typedef void (*handle_detailed_fn) (struct detailed_monitor_section *, void *);
void xf86ForEachDetailedBlock(xf86MonPtr mon, handle_detailed_fn, void *data);
ddc_quirk_t xf86DDCDetectQuirks(int scrnIndex, xf86MonPtr DDC, Bool verbose);
void xf86DetTimingApplyQuirks(struct detailed_monitor_section *det_mon,
ddc_quirk_t quirks, int hsize, int vsize);
typedef void (*handle_video_fn) (struct cea_video_block *, void *);
void xf86ForEachVideoBlock(xf86MonPtr, handle_video_fn, void *);
struct cea_data_block *xf86MonitorFindHDMIBlock(xf86MonPtr mon);
#endif /* _XSERVER_XF86_DDC_PRIV_H */

View File

@ -5630,6 +5630,17 @@ strongly encouraged to improve the consistency of driver behaviour.
</blockquote></para></blockquote>
<blockquote><para>
<programlisting>
xf86MsgVerb(MessageType type, int verb, const char *format, ...);
</programlisting>
<blockquote><para>
Like <function>xf86Msg()</function>, but with the verbosity level given
explicitly.
</para>
</blockquote></para></blockquote>
<blockquote><para>
<programlisting>
xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...);

View File

@ -64,7 +64,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <X11/dri/xf86driproto.h>
#include "swaprep.h"
#include "xf86str.h"
#include "dri_priv.h"
#include "dri.h"
#include "sarea.h"
#include "dristruct.h"
#include "mi.h"

View File

@ -195,6 +195,8 @@ extern _X_EXPORT Bool DRIScreenInit(ScreenPtr pScreen,
extern _X_EXPORT void DRICloseScreen(ScreenPtr pScreen);
extern Bool DRIExtensionInit(void);
extern _X_EXPORT void DRIReset(void);
extern _X_EXPORT Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen,

View File

@ -1,12 +0,0 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XSERVER_DRI_PRIV_H
#define _XSERVER_DRI_PRIV_H
#include "dri.h"
extern Bool DRIExtensionInit(void);
#endif /* _XSERVER_DRI_PRIV_H */

View File

@ -57,7 +57,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <X11/dri/xf86driproto.h>
#include "swaprep.h"
#include "xf86str.h"
#include "dri_priv.h"
#include "dri.h"
#include "sarea.h"
#include "dristruct.h"
#include "xf86drm.h"

View File

@ -45,7 +45,7 @@
#include "scrnintstr.h"
#include "windowstr.h"
#include "dixstruct.h"
#include "dri2_priv.h"
#include "dri2.h"
#include "dri2int.h"
#include "damage.h"
#include "xf86.h"
@ -436,8 +436,8 @@ DRI2DrawableGone(void *p, XID id)
}
if (pPriv->prime_secondary_pixmap) {
dixDestroyPixmap(pPriv->prime_secondary_pixmap->primary_pixmap, 0);
dixDestroyPixmap(pPriv->prime_secondary_pixmap, 0);
(*pPriv->prime_secondary_pixmap->primary_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_secondary_pixmap->primary_pixmap);
(*pPriv->prime_secondary_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_secondary_pixmap);
}
if (pPriv->buffers != NULL) {
@ -449,7 +449,7 @@ DRI2DrawableGone(void *p, XID id)
if (pPriv->redirectpixmap) {
(*pDraw->pScreen->ReplaceScanoutPixmap)(pDraw, pPriv->redirectpixmap, FALSE);
dixDestroyPixmap(pPriv->redirectpixmap, 0);
(*pDraw->pScreen->DestroyPixmap)(pPriv->redirectpixmap);
}
dri2WakeAll(CLIENT_SIGNAL_ANY, pPriv, WAKE_SWAP);
@ -847,7 +847,7 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
ret = (*primary->ReplaceScanoutPixmap)(pDraw, mpix, TRUE);
if (ret == FALSE) {
dixDestroyPixmap(mpix, 0);
(*primary->DestroyPixmap)(mpix);
return NULL;
}
pPriv->redirectpixmap = mpix;
@ -856,7 +856,7 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
}
} else if (pPriv->redirectpixmap) {
(*primary->ReplaceScanoutPixmap)(pDraw, pPriv->redirectpixmap, FALSE);
dixDestroyPixmap(pPriv->redirectpixmap, 0);
(*primary->DestroyPixmap)(pPriv->redirectpixmap);
pPriv->redirectpixmap = NULL;
}
}
@ -869,8 +869,8 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
return &pPriv->prime_secondary_pixmap->drawable;
else {
PixmapUnshareSecondaryPixmap(pPriv->prime_secondary_pixmap);
dixDestroyPixmap(pPriv->prime_secondary_pixmap->primary_pixmap, 0);
dixDestroyPixmap(pPriv->prime_secondary_pixmap, 0);
(*pPriv->prime_secondary_pixmap->primary_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_secondary_pixmap->primary_pixmap);
(*secondary->DestroyPixmap)(pPriv->prime_secondary_pixmap);
pPriv->prime_secondary_pixmap = NULL;
}
}

View File

@ -46,6 +46,9 @@ typedef struct {
void *driverPrivate;
} DRI2BufferRec, *DRI2BufferPtr;
extern CARD8 dri2_major; /* version of DRI2 supported by DDX */
extern CARD8 dri2_minor;
typedef DRI2BufferRec DRI2Buffer2Rec, *DRI2Buffer2Ptr;
typedef void (*DRI2SwapEventPtr) (ClientPtr client, void *data, int type,
CARD64 ust, CARD64 msc, CARD32 sbc);

View File

@ -1,13 +0,0 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#ifndef _XSERVER_DRI2_PRIV_H_
#define _XSERVER_DRI2_PRIV_H_
#include "dri2.h"
extern CARD8 dri2_major; /* version of DRI2 supported by DDX */
extern CARD8 dri2_minor;
#endif /* _XSERVER_DRI2_PRIV_H_ */

View File

@ -46,7 +46,7 @@
#include "pixmapstr.h"
#include "extnsionst.h"
#include "xfixes.h"
#include "dri2_priv.h"
#include "dri2.h"
#include "dri2int.h"
#include "protocol-versions.h"

View File

@ -126,9 +126,9 @@ notify_sync_finished(ClientPtr ptr, void *closure)
already shut down and the descriptor is closed.
*/
if (write(fd, &response, response.header.length) != response.header.length) {
LogMessageVerb(X_ERROR, 0,
"inputtest: Failed to write sync response: %s\n",
strerror(errno));
LogMessageVerbSigSafe(X_ERROR, 0,
"inputtest: Failed to write sync response: %s\n",
strerror(errno));
}
input_unlock();
return TRUE;

Some files were not shown because too many files have changed in this diff Show More