Compare commits

...

379 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 41f4b5188e WIP: use pixmap lifecycle api 2024-10-31 19:30:54 +01:00
Enrico Weigelt, metux IT consult 28255c291c dix: new API for pixmap lifecycle management
In order to get away from wrapping ScreenRec proc vectors, it's necessary to
some API for pixmap consumers, which they can use for creating or destroying
them, so they don't need to call the ScreenProc vectory directly anymore.

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

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

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

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

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:54 +01:00
Enrico Weigelt, metux IT consult 28b528c4a6 ci: always build with drivers 2024-10-31 19:30:54 +01:00
Enrico Weigelt, metux IT consult 1b55d469e6 ci: freebsd: fix missing xcb-aux and xcb-util-wm
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:54 +01:00
Enrico Weigelt, metux IT consult 3dee0b77ff bsd: drop PCCONS support
The old PCCONS driver only seems to be used on minimal install disks and
cannot coexist with newer ones, so there's probably no practical use case for
supporting it in Xorg anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:54 +01:00
Enrico Weigelt, metux IT consult 0d45b0745c os: replace GenerateRandomData() by custom arc4random_buf() on platforms that missing it
arc4random_buf() is a pretty standard libc function on Unix'oid platforms,
but not all our targets have it, thus we need a fallback there. Currently we
have GenerateRandomData(), which either just wraps arc4random_buf() or provides
some fallback implementation.

For those cases it's easier to just implement missing functions directly
instead of having custom wrapper functions. So, drop GenerateRandomData()
in favor of arc4random_buf() and provide fallback implementation for where
it is missing.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:54 +01:00
Enrico Weigelt, metux IT consult e411536c40 WIP: reorder includes
(submit/cursor-api) dix: drop superfluous XineramaGetCursorScreen()

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

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:54 +01:00
Enrico Weigelt, metux IT consult 714c7d321e (!1700) meson: drop defining BIGREQS
This symbol isn't used for decades, so no need to define it at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:54 +01:00
Enrico Weigelt, metux IT consult ba56e16eca (!1693) xvmc: move over protocol version defines into xvmc.c
These are exclusively used in one source file, so no need to keep them
in a global header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult cc3721d6a8 (!1691) os: log: replace VErrorF() by LogVMessageVerb()
Since LogVMessageVerb() is now signal safe, we can use this one instead.
Leaving VErrorF() macro for backwards compat with drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult 3aa1b17d89 (!1691) xwin: drop duplicate OsVendorVErrorF()
It really doesn't seem to be necessary to protect a LogVMessageVerb()
call by extra mutex on windows only, while obviously not needed on
any other platform.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult c8719848b0 (!1691) os: log: replace VErrorFSigSafe() by VErrorF()
Since VErrorF() is now signal safe, we can use this one instead.
Leaving VErrorFSigSafe() macro for backwards compat with drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult 147dd9fa10 (!1691) os: log: replace ErrorFSigSafe() by ErrorF()
Since ErrorF() is now signal safe, we can use this one instead.
Leaving ErrorFSigSafe() macro for backwards compat with drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult 330b84e0f6 (!1691) os: log: replace LogMessageVerbSigSafe() by LogMessageVerb()
Since LogMessageVerb() is now signal safe, we can use this one instead.
Leaving LogMessageVerbSigSafe() macro for backwards compat with drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult dfe69ccbf8 (!1691) os: log: make LogVMessageVerb() signal safe
We already have our own signal safe vnsprintf() implementation, which is used
for formatting log messages while being in a signal handler, there's no need
to have two separate implementations of all the logging functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult 07233835c7 (!1691) os: log: consolidate log formatting functions
Simplify log formatting functions and remove redundancies, e.g.:

* common function for line termination
* copy prefix directly instead of *printf'ing it
* now just exactly one LogSWrite() call per message
  (good for other log targets like syslog)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult ea31f33260 (!1691) os: log: drop unused variables
Drop some unneeded variabes, whose values can be computed at compile-time.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult a8bd9af192 (!1690) pseudoramiX: fix warning from unused REQUEST() macro calls
In the SProc*()s, lots of REQUEST() macro calls aren't needed and causing
warnings on unused variables:

    ../pseudoramiX/pseudoramiX.c: In function ‘SProcPseudoramiXQueryVersion’:
    ../include/dix.h:66:12: warning: unused variable ‘stuff’ [-Wunused-variable]
       66 |     type * stuff = (type *)client->requestBuffer;
          |            ^~~~~
    ../pseudoramiX/pseudoramiX.c:408:5: note: in expansion of macro ‘REQUEST’
      408 |     REQUEST(xPanoramiXQueryVersionReq);
          |     ^~~~~~~
    ../pseudoramiX/pseudoramiX.c: In function ‘SProcPseudoramiXGetState’:
    ../include/dix.h:66:12: warning: unused variable ‘stuff’ [-Wunused-variable]
       66 |     type * stuff = (type *)client->requestBuffer;
          |            ^~~~~
    ../pseudoramiX/pseudoramiX.c:419:5: note: in expansion of macro ‘REQUEST’
      419 |     REQUEST(xPanoramiXGetStateReq);
          |     ^~~~~~~
    ../pseudoramiX/pseudoramiX.c: In function ‘SProcPseudoramiXGetScreenCount’:
    ../include/dix.h:66:12: warning: unused variable ‘stuff’ [-Wunused-variable]
       66 |     type * stuff = (type *)client->requestBuffer;
          |            ^~~~~
    ../pseudoramiX/pseudoramiX.c:430:5: note: in expansion of macro ‘REQUEST’
      430 |     REQUEST(xPanoramiXGetScreenCountReq);
          |     ^~~~~~~
    ../pseudoramiX/pseudoramiX.c: In function ‘SProcPseudoramiXGetScreenSize’:
    ../include/dix.h:66:12: warning: unused variable ‘stuff’ [-Wunused-variable]
       66 |     type * stuff = (type *)client->requestBuffer;
          |            ^~~~~
    ../pseudoramiX/pseudoramiX.c:441:5: note: in expansion of macro ‘REQUEST’
      441 |     REQUEST(xPanoramiXGetScreenSizeReq);
          |     ^~~~~~~
    ../pseudoramiX/pseudoramiX.c: In function ‘SProcPseudoramiXIsActive’:
    ../include/dix.h:66:12: warning: unused variable ‘stuff’ [-Wunused-variable]
       66 |     type * stuff = (type *)client->requestBuffer;
          |            ^~~~~
    ../pseudoramiX/pseudoramiX.c:452:5: note: in expansion of macro ‘REQUEST’
      452 |     REQUEST(xXineramaIsActiveReq);
          |     ^~~~~~~
    ../pseudoramiX/pseudoramiX.c: In function ‘SProcPseudoramiXQueryScreens’:
    ../include/dix.h:66:12: warning: unused variable ‘stuff’ [-Wunused-variable]
       66 |     type * stuff = (type *)client->requestBuffer;
          |            ^~~~~
    ../pseudoramiX/pseudoramiX.c:463:5: note: in expansion of macro ‘REQUEST’
      463 |     REQUEST(xXineramaQueryScreensReq);
          |     ^~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult c351520563 (!1688) xfree86: man: add -syslogverbse flag
Document the newly added -syslogverbose command line flag.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult 310382b7b4 (!1688) os: log: add syslog support
Add support for logging to syslog.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult 293387c6ae (!1688) os: helper for parsing an counting-flag or value-flag option
Parses an option that may either be used for setting an integer value or
given one or multiple times (without argument) to increase an value

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult 91c56be06f (!1688) meson.build: move writing conf_data into tail of main meson file
This allows us to do further probing in the included meson files:
Individual subdirectories (eg. DDXes, extensions, OS layer, ...)
can now probe things that are only relevant to them - no need to fill
the already too fat includes/meson.build with even more things.

Preparation for upcoming commits that'll make us of that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult d6bf5283d3 (!1688) os: log: drop obsolete LogSetParameter()
The variables that can be set via this function are all now being
accessed directly. Not callers left, so drop it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult b3318232f0 (!1688) os: directly set log file sync flag, instead of using LogSetParameter()
No need for extra call to some demuxer function for nothing but setting a
simple bool variable. Setting the sync flag really is nothing more than just
writing some value into a variable, so it's trivial to just to do that, instead
of having an unncessarily complex "universal setter" for that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult 6342e90baf (!1688) os: directly set log file verbosity level, instead of using LogSetParameter()
No need for extra call to some demuxer function for nothing but setting a
simple int variable. Setting verbosity level really is nothing more than just
writing some value into a variable, so it's trivial to just to do that, instead
of having an unncessarily complex "universal setter" for that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult 9f5a7f16de (!1688) os: directly set console verbosity level, instead of using LogSetParameter()
No need for extra call to some demuxer function for nothing but setting a
simple int variable. Setting verbosity level really is nothing more than just
writing some value into a variable, so it's trivial to just to do that, instead
of having an unncessarily complex "universal setter" for that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult b5fd486485 (!1688) os: unexport internal logging functions
Lots of logging functions, especially init and teardown aren't called
by any drivers/modules, so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:19 +01:00
Enrico Weigelt, metux IT consult 5350bbea54 (!1678) os: move AbortServer() to os/utils.c
This function doesn't much to do with logging, except for being
called once by FatalError(). It's better placed in utils.c

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:52 +01:00
Enrico Weigelt, metux IT consult 5dfbfd951c (submit/rename-panoramix-sym) rename old symbol PANORAMIX to XINERAMA
PANORAMIX was the original working title of the extension, before it became
official standard. Just nobody cared about fixing the symbols to the official
naming.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 5b21152f77 (submit/drop-cygwin) drop remains of cygwin support
Cygwin support doesn't seem to be used anymore, so it can be dropped.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 96da907625 (submit/xnest-gcrec) fix name clash on 'GC' between Xlib and Xserver
Both xlib as well as the Xserver use the same identifier "GC" for
different types. While on xlib it's just the numerical ID of a GC,
the xserver defines a struct for it by the same name. This is this
ugly and needs ridiculous hacks for Xserver code that needs xlib.

Easy to solve by just renaming the GC typedef to GCRec (consistent
with how we're naming other structs) and replacing GC* by GCPtr.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult a695561e92 (submit/bsd-defines) xfree86: os-support: move including machine/sysarch.h out of public header
The only consumer seems to be one BSD specific file, the few drivers using
the *_iopl seem to include it on their own. Thus, no need to keep it in
public headers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult cb6173b2a7 (submit/unexport-ddx-callbacks) os: rename ddx.h to ddx_priv.h
Make it clear that stuff from this file really isn't supposed to be used
by dynamically loaded modules like drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 1abe6d2c9b (submit/unexport-ddx-callbacks) os: unexport ddx callbacks
The DDX callbacks (where core/DIX calls into DDX) aren't supposed to be
called by drivers directly, so unexport them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 03d7b449a3 (submit/cmdline-funcs) os: unexport command line args handling functions
These functions shouldn't be called by drivers or extensions, thus
shouldn't be exported. Also moving it to separate header, so the
already huge ones aren't cluttered with even more things.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 14521d72a6 (submit/xkb-errmacro) xkb: move _XkbErrCode3() and _XkbErrCode4()
These are only used inside xkb.c, nowhere else, so no need to
keep them in public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 16b68b874f (submit/xkb-devkey) xkb: drop xkbDevicePrivateKey define
It's only used exactly once, where we can easily write &xkbDevicePrivateKeyRec.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult b88f2a5f35 (submit/move-systemd-logind.h) move systemd-logind.h to hw/xfree86/os-support/linux
systemd is linux specific and the actual implementation is under the
os-support layer of xfree86 ddx. Thus no need to keep it in global
include directory, putting it onto the linux specific os-support instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult bc284e45f4 (submit/bsd-DEV_MEM) xfree86: os-support: bsd: consolidate duplicate defines
Consolidate defines duplicated across several sources into one header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 9ca9af05c7 (submit/bsd-DEV_MEM) xfree86: os-support: unexport DEV_MEM defines
DEV_MEM define isn't used by any drivers, and BSD seems to be the only
platform using /dev/pmem instead of /dev/mem - as well as the DEV_MEM
define from xf86_OSlib.h (Linux uses the symbol, but defines on its own)

Therefore, just define it where actually used and drop it from the global
xf86OSlib.h file.

Note that /dev/pmem refers to physical memory, not to be mixed up with
Linux's persistent memory subsys, which uses /dev/pmem[N] device nodes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 232487da4a (submit/hotplug.h) config: unexport config_pre_init()
This function isn't used by any drivers/modules, so no need to export it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 296a7b4709 (submit/hotplug.h) include: move out private definitions from hotplug.h
Public server module API shouldn't be clobbered with private definitions,
thus move them out to private header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 05ba419aba (submit/hotplug.h) xfree86: common: make _xf86_get_platform_device_attrib() a real function
Doing so that struct OdevAttributes doesn't need to be exposed to
drivers anymore. It really doesn't seem to be a hot path, so not
inlining anymore shouldn't have any practical performance impact.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult c79c45670b (submit/cleanup-api-xfree86) xfree86: sdksyms.sh: add more headers
Add some headers that are still needed by drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult ff7cccc641 (submit/cleanup-api-xfree86) xfree86: move private definitions out of dri.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 6e009cca75 (submit/cleanup-api-xfree86) xfree86: move private definitions out of dri2.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 82a4ffc38a (submit/cleanup-api-xfree86) xfree86: ddc: move private definitions from xf86DDC.h to xf86DDC_priv.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult bc0fda9686 (submit/cleanup-api-xfree86) xfree86: parser: move private defs from xf86Parser.h to xf86Parser_priv.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult aa778d6db0 (submit/cleanup-api-xfree86) xfree86: modes: move private definitions out of from xf86RandR12.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 211039da66 (submit/cleanup-api-xfree86) xfree86: common: move private defs out of xf86VGAarbiter.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 74548dc3e4 (submit/cleanup-api-xfree86) xfree86: common: move private defs from xf86Xinput.h to xf86Xinput_priv.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 129f8b7223 (submit/cleanup-api-xfree86) xfree86: int10: move private defs out of xf86int10.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult ff1ff1cf2a (submit/cleanup-api-xfree86) xfree86: common: move private defs out of xf86sbusBus.h
public server module API headers shouldn't be clobbered with non-exported
definitions, so move them out to private header file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 45e67b5aee (submit/xf86-parser v2) xfree86: parser: rename IOBASE for fixing name conflict
Resolve conflicts with OS headers definining IOBASE by renaming the
IOBASE enum value to XF86_TOKEN_IOBASE.

This way, don't need the special #undef hack anymore.
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult ef8123ea2d (submit/xf86-parser v2) xfree86: parser: rename STRING for fixing name conflict
Resolve name conflict with Sun's <sys/kbd.h> by renaming STRING enum
value to XF86_TOKEN_STRING.

This way, don't need the special #undef hack anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 90c76f5cdd (submit/xf86-parser v2) xfree86: parser: drop obsolete token enum values
These have been forgotten on some major cleanup back almost two decades ago.
(Daniel dropped a lot of dead code, which already had been removed earlier
but merged back accidentially).

Didn't look further back on where exactly they had become obsolete - being
unused for decades should be enough justification for dropping.

Fixes: 81913a1291
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult dc375a8235 (submit/split-input.h) include: move private definitions out of input.h
It's not good having the public server api headers clobbered with private
definitions, so cleaning them up.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult e4ff18e185 (submit/meson-sdk.pc) meson.build: fix missing dependencies in xorg-server.pc
xorg-server.pc missed a few dependencies, so consumers might not
get them and break build.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult a13d83bba1 (!1578) os: fix link failure on Illumos
On SunOS, the BSD socket API as well as hostname lookups isn't
implemented in libc, but separate libraries. We need to link them
explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult b9a540ccdd (!1578) os: fix FTBS on Illumos due missing symbols
Several feature defines need to be set before including system headers,
otherwise build breaks:

> /usr/include/X11/Xtrans/Xtranssock.c: In function '_XSERVTransSocketRead':
> /usr/include/X11/Xtrans/Xtranssock.c:2161:14: error: 'struct msghdr' has no member named 'msg_control'
>  2161 |             .msg_control = cmsgbuf.buf,
>       |              ^~~~~~~~~~~
> /usr/include/X11/Xtrans/Xtranssock.c:2162:14: error: 'struct msghdr' has no member named 'msg_controllen'
>  2162 |             .msg_controllen = CMSG_LEN(MAX_FDS * sizeof(int))
>       |              ^~~~~~~~~~~~~~
>
> ../os/access.c:339:14: error: implicit declaration of function 'asprintf'; did you mean 'Xasprintf'? [-Werror=implicit-function-declaration]
>   339 |     length = asprintf(addr, "%s%c%s", type, delimiter, value);
>       |              ^~~~~~~~
>       |              Xasprintf

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult e0f2ea7f9e (submit/selection.h) dix: rename selection.h to selection_priv.h
rename it in order to reflects it's private nature (not exported).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult c7eb19dc5e (submit/selection.h) dix: unexport selection functions
No driver needs them, so no reason to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult afd42aeb6d (submit/selection.h) dix: don't install selection.h anymore
This file isn't included by any driver - not even indirectly, and hard
to imagine any driver ever needs it, so no need to keep it installed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 2480d3daa2 (submit/xfuncproto) fix mising includes of <X11/Xfuncproto.h>
Several places using _X_ATTRIBUTE_PRINTF macro from X11/Xfuncproto.h
but missing to include it, so it depends on other headers whether it's
included by mere accident, which quickly causes trouble if include order
changes. Cleaning that up by adding explicit include statements.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 98ea640463 (submit/miext-extinit) Xext: geext: move out noGEExtension to corresponding extension
The OS abstraction isn't really the right place for those flags,
they are're probably better off in their corresponding extensions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 4f67c03755 (submit/miext-extinit) xfree86: vidmode: unexport noXFree86VidModeExtension and move into extension
This isn't needed by any external module, so no need to export it.
And those flags are better off in the corresponding extension,
instead of the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult cd38849000 (submit/miext-extinit) xfree86: dga: unexport noXFree86DGAExtension and move into extension
This isn't needed by any external module, so no need to export it.
And those flags are better off in the corresponding extension,
instead of the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 36e5b503cc (submit/miext-extinit) xfree86: dri2: unexport noXFree86DRI2Extension and move into extension
This isn't needed by any external module, so no need to export it.
And those flags are better off in the corresponding extension,
instead of the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult e0e0c17a2f (submit/miext-extinit) xfree86: dri: unexport noXFree86DRIExtension and move into extension
This isn't needed by any external module, so no need to export it.
And those flags are better off in the corresponding extension,
instead of the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 42a9ff83ff (submit/miext-extinit) miext: move over extinit_priv.h from include
Since most of the extension init logic (and on/off switches for them)
is driven from miext, this seems the appropriate place for the header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:50 +01:00
Enrico Weigelt, metux IT consult 617ab33150 (submit/miext-extinit) treewide: clean up remaining consumers of extinit.h
Several sources including it without need. For consistency, those who still
need someting from there should include exitinit_priv.h (which also pulls
in extinit.h)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:24:19 +01:00
Enrico Weigelt, metux IT consult d9252f1feb (submit/miext-extinit) composite: move noCompositeExtension into the extension code
This flag is better off in the extension code instead of the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:24:19 +01:00
Enrico Weigelt, metux IT consult debdf47622 (submit/miext-extinit) Xext: selinux: unexport noSELinuxExtension
It's not needed by any driver/module, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:24:19 +01:00
Enrico Weigelt, metux IT consult 19e3dc9a62 (submit/miext-extinit) Xext: shape: unexport noXFixesExtension
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:24:19 +01:00
Enrico Weigelt, metux IT consult 1de8c60ebb (submit/miext-extinit) Xext: xf86bigfont: unexport noXFree86BigfontExtension
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:24:19 +01:00
Enrico Weigelt, metux IT consult a894d2b8e5 (submit/miext-extinit) Xext: security: unexport noSecurityExtension
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:24:19 +01:00
Enrico Weigelt, metux IT consult 67efc6adff (submit/miext-extinit) Xext: shm: unexport noMITShmExtension
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:24:19 +01:00
Enrico Weigelt, metux IT consult 4d8aee5d9c (submit/miext-extinit) Xext: saver: unexport noScreenSaverExtension
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:24:18 +01:00
Enrico Weigelt, metux IT consult 317e85c6bd (submit/miext-extinit) present: unexport present_extension_init()
It's not called by drivers/modules, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 12f251c7f4 (submit/miext-extinit) Xext: shape: unexport noShapeExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult b7cf382bf4 (submit/miext-extinit) res: unexport noResExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 866097a1c0 (submit/miext-extinit) render: unexport noRenderExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 5e03e2f1e7 (submit/miext-extinit) randr: unexport noRRExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 9d9f412d3e (submit/miext-extinit) panoramix: move noPanoramiXExtension field into extension.
This field is better of in the corresponding extension,
than in the OS layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 2684210337 (submit/miext-extinit) xtest: unexport noTestExtensions field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 96668e2327 (submit/miext-extinit) glx: unexport noGlxExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult ff51adee62 (submit/miext-extinit) dpms: unexport noDPMSExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 75b86bab2f (submit/miext-extinit) dbe: unexport noDbeExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 1478b294d7 (submit/miext-extinit) damageext: unexport noDamageExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 540ec72c93 (submit/netbsd-pccons) netbsd: disable pccons support
On NetBSD, pccons is (almost) dead: only remaining port is arc,
but only on some specific kernel, which is unlikely to be used
for running X.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult bdd1a8a07b (submit/xext-saver) Xext: saver: consolidate (non-)xinerama versions
We can make it a bit simpler by doing the request header
checking only once.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 3e85663edc (submit/xext-saver) Xext: saver: use explicit switch/case for dispatching
It's more robust / easier understandable programming style to use explicit
switch statements, case'ing on the constants defined in the protocol header,
instead of implicitly via a some opaque call table. It's also done this
way in the other extensions, so making the code a bit more consistent.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult e3b15f49a6 (submit/xext-saver) Xext: saver: skip unneeded zero init and zero-swapping
When using struct initializers, all fields not set explicitly are zero.
Also no need to swap fields that are known to be zero.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult ca99eb8ccf (submit/xext-saver) Xext: saver: fix missing swap in QueryVersion reply
The `majorVersion` and `minorVersion` fields are CARD16, thus need to be swapped.
OTOH, the lengths field is zero anyways, so no need to swap it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 129ac36794 (submit/cleanup-damageext) damage: hand in request struct into doDamageCreate() and PanoramiXDamageCreate()
Saves us a little bit of duplicate request checking.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 981443fbc3 (submit/cleanup-damageext) damage: simplify dispatcher
These dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 463e916b7a (submit/cleanup-damageext) damage: don't block requests when version not requested yet
The original intention was negotiating versions before any further requests
can be processed, so requests that might become incompatible in future versions
still can be dispatched correctly. But practically that's never been the case:
there's just one major version, and it's unlikely that a new *major* version
(that might be incompatible with the current one, using same request codes for
different things) will come in the forseeable future.

So this extra logic isn't practically needed and just complicates dispatching.
Dropping it clears the road for further simplification of the dispatcher.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult abaf4dfc5a (submit/cleanup-damageext) damage: untwist Xinerma handling
The diffenciation between Xinerama and single screen version is by tweaking
call vectors unncessarily complicated: it the only reason why these are
needed in the first place. Finally, it's just about one function, so it's
much easier just branching off in ProcDamageCreate() in case of Xinerama
is enabled.

This also clears the road for further simplification of the dispatcher.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult e7de2379da (submit/cleanup-damageext) damage: minor code formatting cleanups
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 7905c5312b (submit/cleanup-shm-dispatch) Xext: shm: move client local check into procs
Move extra complexity out of the dispatch functions, so they're
really just switch/case statements calling the actual handler procs.
Preparation for further steps.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 067cd07a90 (submit/cleanup-shm-dispatch) Xext: shm: simplify dispatcher
These dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 012d1c0ccd (submit/cleanup-xv-dispatch) Xext: xv: simplify dispatcher
These dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult eda3da370e (submit/cleanup-xv-dispatch) Xext: xv: untwist Xinerama handling
The current way of switching between Xinerama and single-screen handlers
is quite complicated and needs call vector tables that are changed on
the fly, which in turn makes dispatching more complicated.

Reworking this into a simple and straight code flow, where individual request
procs just look at a flag to decide whether to call the Xinerama or single
screen version.

This isn't just much easier to understand (and debug), but also removes the need
or the call vectors, thus allowing further simplification of the dispatcher.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult 04b074ba1f (submit/cleanup-xv-dispatch) Xext: xv: use static struct initialization on declaration
A little bit of code simplification by using static initialization
of struct right at the point of declaration. Also dropping a few now
unneccessary zero assignments.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult c219a8a82d (submit/cleanup-vidmode-dispatch) Xext: vidmode: simplify reply struct initialization
Coherently moving all reply struct decls and assignments into static
initialization right at declaration, just before it is getting byte-
swapped and sent out. Zero-assignments can be dropped here, since the
compiler automatically initializes all other fields to zero.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 67151f5eec (submit/cleanup-vidmode-dispatch) Xext: vidmode: tidy up multi-version request control flow, part 3
Some requests using different structs dependending on which protocol version
(v1 vs. v2) had been selected. That's is handled by coverting v1 structs into v2,
before proceeding with the actual handling.

The code flow of this is very complex and hard to understand. Cleaning this up
in several smaller steps, that are easier to digest.

This part moves the request payload structs (or pointers to them) into the
per-version branches. Within each branch following our usual scheme for
extension request handlers (eg. using the REQUEST*() macros and having a
pointer named `stuff` to the current request struct)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult e93bf5ef7b (submit/cleanup-vidmode-dispatch) Xext: vidmode: tidy up multi-version request control flow, part 2
Some requests using different structs dependending on which protocol version
(v1 vs. v2) had been selected. That's is handled by coverting v1 structs into v2,
before proceeding with the actual handling.

The code flow of this is very complex and hard to understand. Cleaning this up
in several smaller steps, that are easier to digest.

This part is splitting the huge request handlers into upper and lower half,
where the upper is doing the version check and converting v1 requests into v2,
while the lower one is doing the actual request processing, operating on the
struct pointer passed in from the upper one, instead of the client struct's
request buffer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 243b28c6f1 (submit/cleanup-vidmode-dispatch) Xext: vidmode: tidy up multi-version request control flow, part 1
Some requests using different structs dependending on which protocol version
(v1 vs. v2) had been selected. That's is handled by coverting v1 structs into v2,
before proceeding with the actual handling.

The code flow of this is very complex and hard to understand. Cleaning this up
in several smaller steps, that are easier to digest.

This moving the request size check into the if-version-X branches, to make it
some bit easier to undertand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 4c0b262c6c (submit/cleanup-vidmode-dispatch) Xext: vidmode: simplify dispatcher
These dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 223b3be7c8 (submit/modset-fix-vrr-hook) xace: export XaceRegisterCallback() and XaceDeleteCallback()
Allow drivers to use Xace as a clean way for retrieving property updates.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 31f8cb28a7 (submit/vrr-driver-api) modesetting: use new VRR mode signaling DDX/driver API
Instead of highjacking core request handlers, use the recently introduced
DDX/driver API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 1f8e29cde9 (submit/vrr-driver-api) dix: add generic Xinerama capable VRR infrastructure
We don't have a standard protocol for enabling VRR yet, but some time ago an
ad-hoc had been made in the amdgpu driver (later also copied to modsetting),
which works by client setting the _VARIABLE_REFRESH window property.

The way it's currently done - driver is highjacking the X_ChangeProperty and
X_DeleteProperty request handlers - is pretty fragile, and is also a violation
of layers: drivers never should be twisted with core protocol details. (And in
the future, this should be done by some suitable extension).

Another problem is Xinerama: when it's enabled, this only works on the first
screen - the others won't ever see this signal, no matter on which one(s) the
Window is physically placed (for the wire protocol, all windows are on screen 0,
unless the client explicitly creates them on another one)

This commit adds a generic Screen proc for telling the DDX, whether the VRR mode
shall be changed (for now, it's only DISABLED and ENABLED). Drivers can hook into
here in order to receive this signal, w/o having to highjack any core request
handlers. Catching the property change is now entirely done in the DIX.

The (non-standard) status qou of (ab)using window properties is kept, but it's
now also easy to add a new signaling mechanism, in case a standard is agreed on.

Yet a quite naive implementation (eg. not acting on moving windows between screens),
but enough to fix the most pressing problems supporting extra screens in general,
as well as stopping the highjacking of core request handlers by drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 5489ce72e3 (submit/recv-fds) os: read file descriptors into client struct at once
Instead of having the request handler ask for fd's one by one, just read them
all into a little array in ClientRec struct. And also automatically clean up
after request had been handled.

Request handlers need to set the entries to -1 if they shouldn't be closed
automatically.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult a8a02e6fde (submit/xrandr-swap-fix) randr: fix wrong call to RRGetScreenResources() in swapped case
ProcRRGetScreenResources() vs. RRGetScreenResourcesCurrent() have different
semantics - this also must be followed in byte-swapped case.

Fixes: fc70839431 - Add server support for RRGetScreenResourcesCurrent
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult afbbff1a27 (submit/xnest-config.h) Xnest: drop obsolete xnest-config.h
This file became pretty no-op, just including dix-config.h.
So we can remove it now and include dix-config.h directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 290df575c2 (submit/xnest-config.h) mi: drop special include hack for Xnest
Now that Xnest is taking care of disbling unsupported extensions itself,
no more need for the special hack in here. Including xnest-config.h also
isn't needed anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult b2faddac65 (submit/xnest-config.h) Xnest: no need to include xkb-config.h
Xnest doesn't need anything from xkb-config.h, so no need to include it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult ee8464e398 (submit/xnest-config.h) Xnest: simplify disabling unsupported extension
Instead of strange #undef hacks in various places, just go the straight
route and set the corresponding no*Extension flags on server startup.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 6430a7c742 (!1639) xfree86: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 7ac7ecc36b (!1639) Xi: drop now obsolete swap procs
Lots of SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 7406cefe16 (!1639) Xext: xv: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult ba089c08e7 (!1639) Xext: xtest: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 1380ff948b (!1639) Xext: xcmisc: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 3c59499646 (!1639) Xext: vidmode: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 6695bc3cad (!1639) Xext: sync: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 1a408811ea (!1639) Xext: shm: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 5436891674 (!1639) Xext: shape: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult a4e24daa3a (!1639) Xext: saver: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 1958dacf09 (!1639) Xext: panoramiX: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult cf949d7157 (!1639) Xext: dpms: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 8efecbe44a (!1639) randr: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 7eea0903d6 (!1639) dbe: drop now obsolete swap procs
Several SProc's have become no-ops, just calling the actual Proc's,
so we can get rid of them entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 90bfe3bd04 (!1639) dix: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Also dropping now obsolete SProcNoOperation().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult fa136ffff5 (!1639) xwin: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 8ea93005ab (!1639) xwayland: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult faaf450cd9 (!1639) xquartz: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult dffd384134 (!1639) xfree86: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult 7acd6a7376 (!1639) Xi: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult c738cd4ebf (!1639) Xext: xv: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult bf73c46c84 (!1639) Xext: xtest: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 5ac4553760 (!1639) Xext: selinux: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 457db36d1a (!1639) Xext: xres: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 0b7076cb53 (!1639) Xext: xf86bigfont: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 8e3af682ff (!1639) Xext: xcmisc: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 6b229882be (!1639) Xext: vidmode: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 88e07ad658 (!1639) Xext: sync: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 0134ef6c61 (!1639) Xext: shm: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 1dd41a4b2c (!1639) Xext: shape: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 9fef7e1e89 (!1639) Xext: security: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 7718fb38a0 (!1639) Xext: saver: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 9cd58c44ce (!1639) Xext: panoramiX: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult a19433f538 (!1639) Xext: dpms: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 7422d8e551 (!1639) Xext: bigreq: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 5826f9e1ed (!1639) dri3: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 02f9e46d68 (!1639) damage: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 507cff82e1 (!1639) randr: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 3c749cfe0b (!1639) render: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult ac701e21fe (!1639) present: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 4e177e40e5 (!1639) pseudoramiX: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 7ecdd37c86 (!1639) record: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult e8989fc14e (!1639) dbe: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 9475292f37 (!1639) composite: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 43f9bf943e (!1639) xfixes: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 72b94b9160 (!1639) xkb: drop swapping request length fields
The request struct's length fields aren't used anymore - we have the
client->req_len field instead, which also is bigreq-compatible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult f2e1fc28ed (!1639) Xext: xtest: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 6f13431fba (!1639) Xext: vidmode: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 08bad2cd44 (!1639) Xext: shape: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult ebd0eec072 (!1639) Xext: security: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 9a27f4b014 (!1639) Xext: saver: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 6ae5fd62c3 (!1639) xquartz: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 2ef5751bf8 (!1639) xkb: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult a1ea8145e9 (!1639) randr: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 1967f01586 (!1639) Xi: fix length checking with bigreq
The authorative source of the request frame size is client->req_len,
especially with big requests larger than 2^18 bytes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult f4dc4f7e58 (submit/fix-1741-window-depth) dix: don't refuse creating windows with different color depths and w/o border
XServer refuses the create windows with different color depth than the parent's,
just in the special case that neither border pixmap nor border pixel is given,
even if the screen supports it. (that's also one of the reasons why Xnest fails
to run with different color depths than the default one)

it really doesn't make sense to deny this, while it's allowed when having a
border color or pixmap set.

Fixes: ded6147b - R6.6 is the Xorg base-line
Closes:https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1644
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 83989edfd1 (!1665) glx: DoQueryContext(): use core's swapping macros
No need to have duplicated byte swapping macros in GLX for things that
the core alreay provides. Using core's macros is actually even easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult a434e0f307 (!1665) glx: DoQueryContext(): drop duplicate write path
We now have two copies of the same write path in both swapped and
non-swapped branch. One is enough.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 16b7e77a76 (!1665) glx: DoQueryContext(): determine reply length from buffer size
The reply length (in units as well as bytes) can safely be determined
at compile time, by using sizeof() operator. No need for unnecessarily
complicated shifting bits back and forth.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 8cd4316e15 (!1665) glx: DoQueryContext(): explicitly use reply buf type defined by spec
The spec defines the reply as array of "CARD32", not "int". The latter
just accidentially has the same type (for now :o), but it's *semantically*
incorrect. Using CARD32 instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult deddf75270 (!1665) glx: DoQueryContext(): use fixed size array instead of variable length
Our array here really is fixed, but it's size is determined by a variable
(that's assigned a fix values), unncessarily making it a VLA (even making
it const doesn't change that), so giving false alarms when compiling w/
-Wvla or -Werror=vla.

Replacing the variable by #define trivially fixes this.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 6cc0b62f2b (!1665) glx: use sizeof() for reply struct
The reply struct's size can safely be determined by the sizeof()
operator, so no need for using an extra define here. Making the code
easier to read and also open the door for future convenience macros
that might determine the buffer size on their own.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 20937f7d95 (!1665) glx: assign at declaration
Assigning structs at declaration is quicker to read/understand. No need
to support ancient compilers that couldn't do that, anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult e27eb8826b (!1654) Xnest: use xcb_window_t instead of Window
Since we're now using xcb for upstream X11 connection, it's cleaner to
use it's type for the window IDs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult cec5b8e984 (!1654) Xnest: dont link Xlib anymore
Now that we completely ported from Xlib to XCB, we can finally stop
importing Xlib :)

FIN.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 8550911777 (!1654) Xnest: use XCB for upstream connection
Now that no Xlib operations (besides opening and closing connection)
aren't used anymore, we can move over the last pieces and use XCB
instead of Xlib for connecting the upstream Xserver.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult bd24052c4b (!1654) Xnest: use XCB for event loop
Now that no X11 calls are being done via Xlib anymore, we're free to
also move over event receiving, leaving Xlib pretty much unused.

Also need to add a simple event queue mechanism, because we've go a
screen operation (see xnestBitBlitHelper) that needs to collect up
certain events for it's return value.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult a58732874e (!1654) Xnest: drop xnestWindowExposures micro-optimization
xnestWindowExposures() is a micro-optimization for the specific case that
a newly created window receives exposure events (from our upstream server)
inside the region we're already exposing on our own (miWindowExposures()):
it peeks the Xlib event queue for all expose events, checks whether their
areas are inside our exposure region and requeue's those that aren't.

Unfortunately, this depends on Xlib's internal queue mechamism, thus standing
in the way of moving to XCB (which doesn't have that).

Removing this doens't seem to make any practical difference, even with
demanding applications like GIMP. The only cost is potentially having some
initial window content painted twice, *if* the application really draws
something complicated right after creating the window.

*If* there'll really be a demand for such an optimization some day, it can
be reimplemented without any message queue: just redirecting all expose events
into recording them in a region, which is flushed out later. But for now,
there really doesn't seem to be any practical need for that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult a6731426f1 (!1654) Xnest: replace XConnectionNumber() by xcb_get_file_descriptor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult ee85cdf541 (!1654) Xnest: replace XReparentWindow() by xcb_reparent_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult f7d5d8e7e8 (!1654) Xnest: drop using XLoadQueryFont()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 8239af59e6 (!1654) Xnest: replace XTextWidth[16]() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 6be00ab072 (!1654) Xnest: load fonts via xcb
FIXME: support xf86bigfont extension
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult fcd79d90ee (!1654) Xnest: replace XQueryBestSize() by xcb_query_best_size()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 71b34fef4d (!1654) Xnest: replace X(Un)InstallColormap() by xcb_(un)install_colormap()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 852493ddeb (!1654) Xnest: drop obsolete XGetVisualInfo() call and reundant colormaps
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult f75166bd64 (!1654) Xnest: use new lookup table for visuals and cmaps mappings
Use the visuals lookup table introduced by previous commit for
looking up local vs upstream visuals and their colormaps.
Replacing the the old Xlib visuals table.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult d6298df576 (!1654) Xnest: screen: record visuals and cmaps in separate table
Record the associations between host's and our visuals as well their
corresponding cmaps in a global table, which's used later for lookups.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 47e352dbe8 (!1654) Xnest: fetch visuals from XCB setup data instead of Xlib
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult a38fc83799 (!1654) Xnest: screen move assigment between depths and visual assignment to own function
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 25e854979c (!1654) Xnest: replace XParseGeometry() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 5bd0415613 (!1654) Xnest: replace XGetWindowAttributes() by xcb_get_geometry()
Use xcb function instead of Xlib, and also spare one additional
(unused) request.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 0775a1dcb2 (!1654) Xnest: collect upstream window geometry in one xRectangle struct
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 2c283076f2 (!1654) Xnest: replace XGetKeyboardControl() by xcb_get_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 240d827a6e (!1654) Xnest: replace XGetPointerMapping() by xcb_get_pointer_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult ce7e99afb5 (!1654) Xnest: replace XGetPointerControl() by xcb_get_pointer_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 08dcfe0270 (!1654) Xnest: replace XGetModifierMapping() by xcb_get_modifier_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult e83a87abc1 (!1654) Xnest: fetch keyboard mapping via xcb
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult a1bc0c7bf9 (!1654) Xnest: add own copy of fixed xcb_xkb_get_kbd_by_name()
This is a temporary measure, until xcbproto / libxcb is fixed:
keep an own copy of the fixed xcb_xkb_get_kbd_by_name(), renamed
as xcb_xkb_get_kbd_by_name_1().

Once xcbproto/libxcb is fixed (and new xcb release is out), this
commit can be reverted.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult bd232f422d (!1654) Xnest: use xcb for retrieving keymap controls
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 27ff310dca (!1654) Xnest: replace XSelectInput() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult df5c389d51 (!1654) Xnest: replace XSetStandardProperties() by xcb functions
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 9996aa209b (!1654) Xnest: fetch supported pixmap formats from xcb setup data
There's even no need to keep our own copies, since we can ask XCB's
copy any time.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult faa298057b (!1654) Xnest: fetch allowed screen depths from xcb screen info
There's even no need to keep our own copies, since we can ask XCB's
copy any time.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 4ff6ba467d (!1654) Xnest: Pixmap: replace XGetImage() by xcb_get_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 3d3f1f379c (!1654) Xnest: GC: replace XGetImage() by xcb_get_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 8eebda19b7 (!1654) Xnest: replace XDestroyWindow() by xnest_destroy_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult df1d34d842 (!1654) Xnest: replace XCreatePixmapFromBitmapData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 3866d8ab1a (!1654) Xnest: replace XCreateBitmapFromData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 058009071d (!1654) Xnest: replace XDefineCursor() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 3494f77e88 (!1654) Xnest: replace xnestRecolorCursor() by xcb_recolor_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 71bfa9921c (!1654) Xnest: replace XFreeCursor() by xcb_free_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult dc9c2baa31 (!1654) Xnest: replace XStoreColors() by xcb_store_colors()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult b23f4a462e (!1654) Xnest: replace XQueryColors() by xcb_query_colors()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult b6a40db227 (!1654) Xnest: replace XSetWindowColormap() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 1149396433 (!1654) Xnest: replace XSetWMColormapWindows() by xcb_icccm_set_wm_colormap_windows_checked()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult fdf0e3c796 (!1654) Xnest: use XIDs directly, instead of Xlib's GC
Now that no Xlib drawing functions used anymore, we can finally switch over
to using GC XID's directly, instead of Xlib's GC struct.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 5f77500855 (!1654) Xnest: GC: set stipple filling via xcb_change_gc
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 70e0b2a4ed (!1654) Xnest: replace XSetClipMask() by xcb_change_gc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult bf93860c1f (!1654) Xnest: replace XSetClipRectangles() by xnset_set_clip_rectangles()
Use XCB for setting clip rectangles.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult a1f0758f82 (!1654) Xnest: replace XSetDashes() by xnest_set_dashes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 874269e799 (!1654) Xnest: replace XChangeGC() by xcb_change_gc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult a26c988cd8 (!1654) Xnest: replace XChangeKeyboardControl() by xcb_change_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 4f56b78e28 (!1654) Xnest: replace XChangePointerControl() by xcb_change_pointer_control
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult af487307bb (!1654) Xnest: replace XChangeWindowAttributes() by xcb_aux_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 148fa05151 (!1654) Xnest: replace XDrawImageString() by xcb_image_text_8()
Replace XDrawImageString() by xcb_image_text_8(), as well as their 16-bit
counterparts.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 442d175f91 (!1654) Xnest: replace XDrawString[8|16]() by xcb_poly_text_[8|16]()
Replace XDrawString8() by xcb_poly_text_8(), as well as XDrawString16()
by xcb_poly_text_16(). Some care needs to be taken to prepend the xTextElt
header before sending the request out.

GC operation handlers don't need to care about poly-strings or length
above 254, as this is already handled by their caller, doPolyText().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult de1868ca70 (!1654) Xnest: replace XFillRectangles() by xcb_poly_fill_rectangle()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult f0c74168ce (!1654) Xnest: directly pass ClearArea request to upstream server
Instead of going through mi machinery, just pass the ClearArea
request to the upstream window.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 416fb5c313 (!1654) Xnest: replace XFillArcs() by xcb_poly_fill_arc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult aad501642e (!1654) Xnest: replace XFillPolygon() by xcb_fill_poly()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 2bb3eef947 (!1654) Xnest: replace XCopyPlane() by xcb_copy_plane()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 7263daf926 (!1654) Xnest: replace XCopyArea() by xcb_copy_area()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 4927e959c5 (!1654) Xnest: replace XDrawArcs() by xcb_poly_arc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult fdff26ef6d (!1654) Xnest: replace XDrawRectangles() by xcb_poly_rectangle()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult d09bfc7e27 (!1654) Xnest: replace XDrawSegments() by xcb_poly_segment()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult c77806e947 (!1654) Xnest: replace XDrawLines() by xcb_poly_line()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 0758704baf (!1654) Xnest: replace XDrawPoints() by xcb_poly_point()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 33ba666abb (!1654) Xnest: replace XCreateColormap() / XFreeColormap() by xcb
Use xcb_create_colormap() and XFreeColormap() instead of XCreateColormap()
and XFreeColormap().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult c23342c832 (!1654) Xnest: use xcb instead of XShapeCombineRegion() and XShapeCombineMask()
Using xcb_shape_rectangles() and xcb_shape_mask() instead of Xlib's
XShapeCombineRegion() and XShapeCombineMask().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 574b76b010 (!1654) Xnest: use xcb_put_image() for PutImage requests
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 0bf9f77287 (!1654) Xnest: use xcb_put_image() for creating cursors
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult afc3300bcf (!1654) Xnest: replace XCreatePixmapCursor() by xcb_create_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult bb8c1f573d (!1654) Xnest: replace XConfigureWindow() calls by xcb_configure_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 4f6248c5d3 (!1654) Xnest: use xcb for creating / destroying pixmaps
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 875dcc23cf (!1654) Xnest: replace XBell() by xcb_bell()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult a8e7fb8997 (!1654) Xnest: use xcb for (un)mapping windows
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult b4d8881a9c (!1654) Xnest: replace XCreateWindow() by use xcb_create_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 7b73be4249 (!1654) Xnest: fetch root visual ID from screen data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult b0e93ea5c4 (!1654) Xnest: fetch keycode min/max from setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult c3cec1adca (!1654) Xnest: fetch image metrics from xcb connection setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 168a8851f6 (!1654) Xnest: fetch default screen's root window from screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 2bc46832fb (!1654) Xnest: add helper for retrieving GC XID on upstream connection
Upcoming patches will need to retieve GC's XIDs on the upstream connection.
Moving this out into separate .c file, in order to not creating more
dependencies on Xlib headers, which we wanna get rid of.

For now, looking at the Xlib GC structure, attached to our DDX GCs.
When all users of the Xlib GC have gone (ie. moved all consumers to xcb),
we'll create the GC via xcb directly, thus replacing the Xlib GC struct
by XID - the interface of this helper will remain the same.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 36f6eb3e2d (!1654) Xnest: fetch default colormap from xcb screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 3e2a1c6d7f (!1654) Xnest: fetch root window depth from screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 272a294870 (!1654) Xnest: fetch display size from xcb setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult fcacca5cf2 (!1654) Xnest: fetch BlackPixel and WhitePixel from xcb setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult e2d6b6323a (!1654) Xnest: fetch xcb setup data
Fetching the setup data from xcb instead of Xlib, storing in our own struct,
holding all information needed for one particular upstream connection.
For now, there's only one, but future multi-upstream implementation will
change this to an array (and storing pointers to particular upstream in
various places).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult f19bff246b (!1654) Xnest: use XCB_EVENT_MASK_* defines
Use xcb's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult faf48c047d (!1654) Xnest: use XCB*_NONE instead of None
Use xcb's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 32795fcd5e (!1654) Xnest: use XCB_BACK_PIXMAP_* defines
Use xcb's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 584636a8f0 (!1654) xnest: replace ExposureMask by XCB_EVENT_MASK_EXPOSURE
Use xcb's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 58d0ec2028 (!1654) Xnest: replace NotUseful by XCB_BACKING_STORE_NOT_USEFUL
Use xcb's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult ed4d212de1 (!1654) Xnest: use XCB_CONFIG_WINDOW_* defines instead of CW*
Use xcb's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 1b238f722b (!1654) Xnest: use XCB_CW_* defines instead of CW*
Use XCB's defines instead of Xlib's ones.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 5dd5329b53 (!1654) Xnest: add xcb and x11-xcb as dependency
In order to transition to XCB, we need to link xcb, but temporarily
also x11-xcb.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 26b20fcb6c (!1614) xfixes: use stack allocation and static init for reply structs
Canonicalize all reply structures onto stack allocation and static
initialization, like already done in most other extension. So make
the code easier to understand and allow further simplifications by
subsequent commits. Also gaining a little bit efficiency by skipping
some heap allocations.

Dynamically sized buffers (where the upper bound isn't known), are
still allocated on heap.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult a6322fe25b (!1614) xfixes: simplify dispatcher
The dispatcher functions are much more complex than they're usually are
(just switch/case statement). Bring them in line with the standard scheme
used in the Xserver, so further steps become easier.

It's also much cleaner to use the defines from proto headers instead of
raw numbers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult cde42e5566 (!1614) xfixes: untwist Xinerama handling
The current way of switching between Xinerama and single-screen handlers
is quite complicated and needs call vector tables that are changed on
the fly, which in turn makes dispatching more complicated.

Reworking this into a simple and straight code flow, where individual request
procs just look at a flag to decide whether to call the Xinerama or single
screen version.

This isn't just much easier to understand (and debug), but also removes the need
or the call vectors, thus allowing further simplification of the dispatcher.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 0f3f7083fd (!1596) Xext: geext: simplify dispatcher
Most of the complexity here isn't needed at all. It can be really trivial,
since we just have one operation anyways.

It's also much cleaner to use the defines from proto headers instead of
raw numbers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 7267cc1a93 (!1596) Xext: geext: drop unused variable extEntry
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 87f79a8214 (!1601) Xext: xres: ProcXResQueryClientIds() collect reply in one buffer
In order to allow simplifying the reply send path, collect the reply
fragments into one buffer, instead of arbitrary number of WriteToClient()
calls. This also makes it much easier for potentially new purely packet-based
transports which (eg. binder) that would need their own stream parsing logic.

This xres function is an exceptionally hard case, since payload is constructed
step by step, and it's size only known when finished. The current way of the
fragment handling still has lots of room for improvement (eg. using very small
number of allocations), but leaving this for later exercise.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 6f1367bb79 (!1601) Xext: xres: ProcXResQueryClientResources() simplify payload write out
Collect the few bits in a local array, so one WriteToClient() call is
sufficient. That's also easing further simplifications in upcoming commits.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult b5fd75a860 (!1601) Xext: xres: ProcXResQueryClientResources(): put temporary int array on stack
Simplify allocaton by putting the small temporary int array onto stack.
This also allows further simplifications by upcoming commits.

The upper bound is determined by the number of resource types registered
in the server - this can only be increased by writing new extensions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 7b888a5550 (!1601) Xext: xres: ProcXResQueryClients() simplify payload write out
Collect the few bits in a local array, so one WriteToClient() call is
sufficient. That's also easing further simplifications in upcoming commits.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult e3756e71db (!1601) Xext: xres: ProcXResQueryClients() put temporary int array on stack
Simplify allocaton by putting the small temporary int array onto stack.
This also allows further simplifications by upcoming commits.

Note: there's an upper bound by compile time defines (theoretically, can
be increased by special cmdline args, that virtually nobody ever using).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 12cac7856d (!1601) Xext: xres: sort includes
Bring #include's into some logical order.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 2ae56e0238 (!1601) Xext: xres: use static initialization
* use static initialization where applicable
* drop unneeded setting of zero values

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 4138b08f8e (!1598) Xext: shape: clean up Xinerama dispatch
Simplify the dispatching by moving the branching between Xinerama
vs. single screen into the actual request handlers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult f4a80ab4a5 (!1600) Xext: xf86bigfont: drop unncessary zero assignments
When using static struct initialization, fields not explicitly
stated are automatically zero.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 8484b48786 (!1670) dix: drop remains of ancient code generator
This script used to generated xproto header as well as a piece of source
for initializing the builtin atoms in the Xserver (MakePredeclaredAtoms()).

At least with R6.6 baseline it didn't seem to be used anymore, and - at least
since the modularization - it's completely broken and useless.

Since we now have a new generator, running directly in the build process,
this ancient script can be dropped.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult bf76a30fad (!1670) dix: generate MakePredeclaredAtoms() from BuiltInAtoms file
This function probably been (half?) auto generated somewhere back in the
dark ages (there're still remains of the former generator, which doesn't
work anymore, and hasn't been updated for ages). It's been added to SCM
with R6.6 baseline - and from that on manually maintained.

Adding a little generator to create source from "BuiltInAtoms" file,
directly in the build process.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult b9132f2fb5 (!1675) ci: enable xv and xvmc
Needed for the xf86-video-intel driver, so we should build-test it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 89c7add14a (!1677) os: drop obsolete LogHdrMessage()
This function isn't used anywhere, so no need to keep it around.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult adafcf28b9 (!1681) xfree86: common: use LogMessageVerb() instead of xf86Msg()
Both are doing same job, so no need to keep using an duplicated implementation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult a2033ba4ba (!1681) xfree86: fbdevhw: use LogMessageVerb() instead of xf86Msg()
Both are doing same job, so no need to keep using an duplicated implementation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult fe9a118da4 (!1681) xfree86: os-support: use LogMessageVerb() instead of xf86Msg()
Both are doing same job, so no need to keep using an duplicated implementation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:52 +01:00
Enrico Weigelt, metux IT consult 1fd0c3082d (!1681) xfree86: i2c: use LogMessageVerb() instead of xf86Msg()
Both are doing same job, so no need to keep using an duplicated implementation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult c44aa6a6f1 (!1681) glx: use LogMessageVerb() instead of xf86Msg()
Both are doing same job, so no need to keep using an duplicated implementation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 9e2035343f (!1681) xfree86: use LogMessageVerb() instead of xf86MsgVerb()
Both are doing same job, so no need to keep using an duplicated implementation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult a61a5e0eb7 (!1682) os: log: consolidate OS specific fsync() call into helper
Instead of having lots of #ifdef's, consolidating the conditionally
compiled fsync() call into a tiny inline helper.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 3a6bcb854e (!1682) os: log: drop now meaningless XLOG_FLUSH option
Since we're not indirectly writing via FILE anymore, this option has
become meaningless: it meant flushing out our in-process buffer to
the kernel, but we're now doing direct write() calls anyways.

xf86 still accepts the "flush" config file flag for backwards compatibility,
but it hasn't any practical meaning anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 0ef6e47819 (!1682) os: log via fd instead of FILE
Instead of maintaining both the logfile fd, as well as ANSI FILE pointer,
simplify it to just a fd.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult e31436c4f7 (!1696) ci: build more drivers
Increase driver build test coverage by adding more drivers.
Only left out those which won't compile on Linux (yet).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult a13afbc77c (!1703) miext: rootless: fix unused variables
Compiling w/ -Werror (which our CI does) breaks compile due a buch of
unused variables.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 2cae6b5d7d (!1703) mi: miexpose: fit FTBS w/ rootless helper
FTBS when rootless subsys enabled:

> ../mi/miexpose.c: In function ‘miPaintWindow’:
> ../mi/miexpose.c:411:15: error: unused variable ‘orig_pWin’ [-Werror=unused-variable]
>   411 |     WindowPtr orig_pWin = pWin;
>       |               ^~~~~~~~~
> cc1: all warnings being treated as errors

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 09bb70272f (!1714) glamor: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 1e258b6f3d (!1714) exa: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 749bf16c09 (!1714) damage: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 1a11903d97 (!1714) Xext: xv: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 5739035208 (!1714) Xext: shm: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 1238507f30 (!1714) dix: add per-screen pixmap destructor mechanism
Right now, extension specific pixmap destruction procedures are implemented
by wrapping the ScreenRec's DestroyPixmap() proc pointer: the extensions are
storing the original pointer in their private data and putting in their own one.
On each call, their proc restores the original one, calls it, and switches back
again. When multiple extensions doing so, they're forming a kind of daisy chain.
(the same is done for lots of other procs)

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

It's even getting worse: the proc also has to do ref counting, and only destroy
the pixmap if refconter reaching zero - that's all done in the individual screen
drivers. Therefore, all extensions must check for refcnt == 1, in order to know
when to really act.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult b4c3a2ddd5 (!1714) dri3: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 2a4bca3028 (!1714) render: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 26c26146df (!1714) xvmc: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult ae9ae3c16b (!1714) xv: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult d2c08c4cc2 (!1714) xfixes: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult cb75dab63b (!1714) Xext: shm: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

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

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

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 4d24ece1c3 (!1714) rootless: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window position notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 2ffc5f1523 (!1714) dbe: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window position notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 7a91790f2e (!1714) composite: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window position notify hook instead.

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

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

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 1c8dc9e329 (!1714) mi: overlay: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 527a0325d5 (!1714) xwayland: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 4d9a8ca3c3 (!1714) xfree86: dri: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult c2652c3111 (!1714) xfree86: xv: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult d347c75983 (!1714) kdrive: xv: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult a9eb1e0a5a (!1714) rootless: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 5341be053e (!1714) composite: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult e314e6a88a (!1714) xv: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult cc5846a4f6 (!1714) damage: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 133970a44e (!1714) render: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult c4a9d03edc (!1714) present: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

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

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

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 1bcb842bb7 (!1705) xwin: drop wrapping on ScreenRec->ModifyPixmapHeader()
Instead of complicated wrapping, just call fbModifyPixmapHeader() directly.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult f1e3e7a893 (!1705) xwin: drop wrapping on ScreenRec->MoveWindow()
Instead of complicated wrapping, just call fbMoveWindow() directly.

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

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 3ade5bac24 (!1705) xwin: drop wrapping on ScreenRec->UnrealizeWindow()
Instead of complicated wrapping, just call fbUnrealizeWindow() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:51 +01:00
Enrico Weigelt, metux IT consult 147b9e0266 (!1705) xwin: drop wrapping on ScreenRec->RealizeWindow()
Instead of complicated wrapping, just call fbRealizeWindow() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 4a0454cc77 (!1705) xwin: drop wrapping on ScreenRec->SetShape()
Instead of complicated wrapping, just call fbSetShape() directly.

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

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

The winFinishScreenInitFB() can also be made static now.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 1aadc6025e (!1705) xwin: glx: drop glxWinRealizeWindow()
It does nothing more than just calling the original/wrapped function,
so we don't need that at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult c11c7b365c (!1705) xwin: drop wrapping on ScreenRec->ChangeWindowAttributes()
Instead of complicated wrapping, just call fbCreateWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 092e37a0fd (!1705) xwin: drop wrapping on ScreenRec->CreateWindow()
Instead of complicated wrapping, just call fbCreateWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 42842897df (!1705) xwin: drop wrapping on ScreenRec->PositionWindow()
Instead of complicated wrapping, just call fbPositionWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 675a766304 (!1705) xwin: drop wrapping on ScreenRec->DestroyWindow()
Instead of complicated wrapping, just call fbDestroyWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult f8954d43e7 (!1675) Revert "xv: unexport XvScreenRec and XvScreenPtr"
This reverts commit 58a2fb8b6f.

Needed by xf86-video-intel driver. Didn't get noticed, because we don't
have this driver in our CI yet.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult bf3bbdd094 (!1711) dix: add in-code docs for dixDestroyPixmap()
Give some more explaination for the dixDestroyPixmap() function.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 22a614a05c (!1711) exa: simplify CreatePixmap()/DestroyPixmap() handlers error pathes
Instead of complex wrap/unwrap trickery in the error path, just protect
the DestroyPixmap() handlers from half-initialized state.

This not just makes the code flow simpler and easier to understand, but
also clears the road for decoupling the extension specific pixmap destructor
logic from the ScreenRec proc vectors (*1).

*1) see: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1755

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 53e81d6c35 (!1711) glx: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 71eb1555a3 (!1711) xwayland: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 6b9d78068b (!1711) xfree86: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 0dec901bcb (!1711) vfb: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult e0b61b2c72 (!1711) kdrive: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult bb2bd1a1bd (!1711) xnest: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 4321eddb47 (!1711) render: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 014f90abd1 (!1711) randr: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 6fce564b6a (!1711) mi: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult f38c15ce51 (!1711) miext: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult d15dcee378 (!1711) glamor: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 65bb650ed4 (!1711) fb: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult aea4b4c256 (!1711) exa: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 1c70309a9c (!1711) dri3: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult b0caf55922 (!1711) dbe: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 283e3ec0bc (!1711) composite: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 241061e0f1 (!1711) dix: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult c6a7fd6b49 (!1711) Xext: shm: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 178e5e2497 (!1711) Xext: saver: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:50 +01:00
Enrico Weigelt, metux IT consult 52e8e49def (!1711) document that ScreenRec->DestroyPixmap() shouldn't be called directly
Direct calls to ScreenRec->DestroyPixmap() is fragile and blocks cleaning up
the wrapping jungle, so use the proper dix function instead.

While this function originally wasn't made for that purpose (and so we have an
useless parameter here, and the naming isn't entirely correct), it's the best
effort we have right now, without breaking existing API: it's already exported
since long time, so drivers can be easily converted and still work with both
new and older Xserver ABI versions.

Retrospectively, this already should have been done 20 years ago.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:49 +01:00
Enrico Weigelt, metux IT consult e271e6261d (!1709) dix: make dixDestroyPixmap() NULL-proof
Make dixDestroyPixmap() check for NULL pointer, so callers don't need to
do it anymore. Returning TRUE on NULL pointer - but most callers won't
even look at the retval anyways.

Together with subsequent commits, which will make use of that function,
instead of calling raw ScreenRec->DestroyPixmap vectors, this gives us some
more freedom for architectural changes, eg. get rid of the extremely
complicated and fragile wrapping chains.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:49 +01:00
Enrico Weigelt, metux IT consult e5d7ce8ea8 (!1709) treewide: NULL-protect ScreenRec->DestroyPixmap() calls
Right now, we're assuming that even when deep nesting involved, the proc
vector is always set to a valid function. One the one hand it requires
extra dummy procs in some cases, OTOH it's making upcoming refactoring
of the code flow unnecessarily complex.

The big plot (of subsequent commits) is splitting out the extension's
(and possibly subsystem's) special logic out of the wrapping chain and
let them be executed independently from the DDX/drivers - when applicable
even only when the pixmap is really destroyed (not just unref'ed).
(At some later point, it might even become be actually a valid situation
that DestroyPixmap vector really being NULL.)

See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754
See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1755

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:49 +01:00
492 changed files with 7146 additions and 7781 deletions

View File

@ -21,10 +21,10 @@ variables:
REPO_URL_XORGPROTO: 'https://gitlab.freedesktop.org/xorg/proto/xorgproto.git'
XORG_DEBIAN_VERSION: 'bullseye-slim'
XORG_DEBIAN_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh'
XORG_DEBIAN_TAG: '2024-09-09-meson-backport'
XORG_DEBIAN_TAG: '2024-09-13-xvmc'
XORG_FREEBSD_VERSION: '14.0'
XORG_FREEBSD_EXEC: ''
XORG_FREEBSD_TAG: '2024-06-10.0'
XORG_FREEBSD_TAG: '2024-09-10-fix-freebsd-xcb'
include:
- project: 'freedesktop/ci-templates'
@ -109,7 +109,7 @@ stages:
FDO_DISTRIBUTION_TAG: '$XORG_FREEBSD_TAG'
FDO_DISTRIBUTION_VERSION: '$XORG_FREEBSD_VERSION'
FDO_DISTRIBUTION_EXEC: ''
FDO_DISTRIBUTION_PACKAGES: 'git gcc pkgconf autoconf automake libtool xorg-macros xorgproto bash meson ninja pixman xtrans libXau libXdmcp libXfont2 libxkbfile libxcvt libpciaccess font-util libepoll-shim'
FDO_DISTRIBUTION_PACKAGES: 'git gcc pkgconf autoconf automake libtool xorg-macros xorgproto bash meson ninja pixman xtrans libXau libXdmcp libXfont2 libxkbfile libxcvt libpciaccess font-util libepoll-shim libxvmc xcb-util xcb-util-wm'
debian-bullseye:
extends:
@ -152,7 +152,7 @@ freebsd-image:
- $MESON_BUILDDIR/meson-logs/
- $MESON_BUILDDIR/test/piglit-results/
variables:
MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true
MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true -Dxv=true -Dxvmc=true
CCACHE_COMPILERCHECK: content
CCACHE_DIR: /cache/xserver/cache
LC_ALL: C.UTF-8
@ -191,14 +191,14 @@ mingw-cross-build:
script:
- .gitlab-ci/meson-build.sh --run-install
variables:
MESON_ARGS: --cross-file=.gitlab-ci/cross-i686-w64-mingw32.txt -Dglx=false -Dlisten_tcp=true
MESON_ARGS: --cross-file=.gitlab-ci/cross-i686-w64-mingw32.txt -Dglx=false -Dlisten_tcp=true -Dxvmc=true -Dxv=true
freebsd:
stage: build-and-test
extends:
- .xorg-image@freebsd
variables:
MESON_ARGS: -Dglx=false -Dglamor=false -Dudev=false -Dudev_kms=false
MESON_ARGS: -Dglx=false -Dglamor=false -Dudev=false -Dudev_kms=false -Dxvmc=true -Dxv=true
script:
# running of of disk space without this
# needed until https://gitlab.freedesktop.org/freedesktop/ci-templates/-/issues/67 is fixed
@ -239,24 +239,102 @@ xf86-driver-build-test:
stage: drivers
parallel:
matrix:
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-elographics
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-evdev
SHA: xf86-input-evdev-2.10.6
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-joystick
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput
SHA: xf86-input-libinput-1.4.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-mouse
SHA: xf86-input-mouse-1.9.5
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics
SHA: xf86-input-synaptics-1.9.2
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-vmmouse
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-void
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu
SHA: xf86-video-amdgpu-23.0.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-apm
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ark
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-armsoc
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ast
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ati
SHA: xf86-video-ati-22.0.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-chips
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-cirrus
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-dummy
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-i128
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-i740
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-mach64
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-neomagic
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nested
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nouveau
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-qxl
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-r128
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-rendition
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-s3virge
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-savage
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-siliconmotion
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sis
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sisusb
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suncg14
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suncg3
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suncg6
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sunffb
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sunleo
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suntcx
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-tdfx
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-trident
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-v4l
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vbox
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vesa
SHA: xf86-video-vesa-2.6.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vmware
SHA: xf86-video-vmware-13.4.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-voodoo
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-xgi
SHA: master
script:
# Install the server first
- .gitlab-ci/meson-build.sh --skip-test --run-install
@ -277,13 +355,6 @@ xf86-driver-build-test:
GIT_DEPTH: 1
MESON_ARGS: -Dprefix=/usr/
MESON_EXTRA_ARGS: -Dxwayland=false -Dxnest=false -Dxvfb=false -Dxquartz=false -Ddocs=false
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
*dix_paths
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
*xorg_paths
#
# Verify that commit messages are as expected

View File

@ -65,6 +65,7 @@ apt-get install -y \
libx11-xcb-dev \
libxau-dev \
libxaw7-dev \
libxcb-dri2-0-dev \
libxcb-glx0-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
@ -96,6 +97,7 @@ apt-get install -y \
libxt-dev \
libxtst-dev \
libxv-dev \
libxvmc-dev \
libz-mingw-w64-dev \
linux-libc-dev/bullseye-backports \
mesa-common-dev \

View File

@ -33,13 +33,13 @@ from The Open Group.
#include <X11/extensions/bigreqsproto.h>
#include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include "opaque.h"
#include "extinit_priv.h"
static int
ProcBigReqDispatch(ClientPtr client)
@ -47,9 +47,6 @@ ProcBigReqDispatch(ClientPtr client)
REQUEST(xBigReqEnableReq);
xBigReqEnableReply rep;
if (client->swapped) {
swaps(&stuff->length);
}
if (stuff->brReqType != X_BigReqEnable)
return BadRequest;
REQUEST_SIZE_MATCH(xBigReqEnableReq);

View File

@ -30,7 +30,9 @@ Equipment Corporation.
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/extensions/dpmsproto.h>
#include "miext/extinit_priv.h"
#include "os/screensaver.h"
#include "misc.h"
@ -38,13 +40,13 @@ Equipment Corporation.
#include "dixstruct.h"
#include "extnsionst.h"
#include "opaque.h"
#include <X11/extensions/dpmsproto.h>
#include "dpmsproc.h"
#include "extinit_priv.h"
#include "scrnintstr.h"
#include "windowstr.h"
#include "protocol-versions.h"
Bool noDPMSExtension = FALSE;
CARD16 DPMSPowerLevel = 0;
Bool DPMSDisabledSwitch = FALSE;
CARD32 DPMSStandbyTime = -1;
@ -493,42 +495,16 @@ static int _X_COLD
SProcDPMSGetVersion(ClientPtr client)
{
REQUEST(xDPMSGetVersionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion);
return ProcDPMSGetVersion(client);
}
static int _X_COLD
SProcDPMSCapable(ClientPtr client)
{
REQUEST(xDPMSCapableReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSCapableReq);
return ProcDPMSCapable(client);
}
static int _X_COLD
SProcDPMSGetTimeouts(ClientPtr client)
{
REQUEST(xDPMSGetTimeoutsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
return ProcDPMSGetTimeouts(client);
}
static int _X_COLD
SProcDPMSSetTimeouts(ClientPtr client)
{
REQUEST(xDPMSSetTimeoutsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
swaps(&stuff->standby);
@ -537,34 +513,10 @@ SProcDPMSSetTimeouts(ClientPtr client)
return ProcDPMSSetTimeouts(client);
}
static int _X_COLD
SProcDPMSEnable(ClientPtr client)
{
REQUEST(xDPMSEnableReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSEnableReq);
return ProcDPMSEnable(client);
}
static int _X_COLD
SProcDPMSDisable(ClientPtr client)
{
REQUEST(xDPMSDisableReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSDisableReq);
return ProcDPMSDisable(client);
}
static int _X_COLD
SProcDPMSForceLevel(ClientPtr client)
{
REQUEST(xDPMSForceLevelReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
swaps(&stuff->level);
@ -572,22 +524,10 @@ SProcDPMSForceLevel(ClientPtr client)
return ProcDPMSForceLevel(client);
}
static int _X_COLD
SProcDPMSInfo(ClientPtr client)
{
REQUEST(xDPMSInfoReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSInfoReq);
return ProcDPMSInfo(client);
}
static int _X_COLD
SProcDPMSSelectInput(ClientPtr client)
{
REQUEST(xDPMSSelectInputReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDPMSSelectInputReq);
swapl(&stuff->eventMask);
return ProcDPMSSelectInput(client);
@ -603,19 +543,19 @@ SProcDPMSDispatch(ClientPtr client)
case X_DPMSGetVersion:
return SProcDPMSGetVersion(client);
case X_DPMSCapable:
return SProcDPMSCapable(client);
return ProcDPMSCapable(client);
case X_DPMSGetTimeouts:
return SProcDPMSGetTimeouts(client);
return ProcDPMSGetTimeouts(client);
case X_DPMSSetTimeouts:
return SProcDPMSSetTimeouts(client);
case X_DPMSEnable:
return SProcDPMSEnable(client);
return ProcDPMSEnable(client);
case X_DPMSDisable:
return SProcDPMSDisable(client);
return ProcDPMSDisable(client);
case X_DPMSForceLevel:
return SProcDPMSForceLevel(client);
case X_DPMSInfo:
return SProcDPMSInfo(client);
return ProcDPMSInfo(client);
case X_DPMSSelectInput:
return SProcDPMSSelectInput(client);
default:

View File

@ -24,24 +24,23 @@
*/
#include <dix-config.h>
#include "windowstr.h"
#include <X11/extensions/ge.h>
#include "windowstr.h"
#include "miext/extinit_priv.h"
#include "geint.h"
#include "geext.h"
#include "protocol-versions.h"
#include "extinit_priv.h"
Bool noGEExtension = FALSE;
DevPrivateKeyRec GEClientPrivateKeyRec;
GEExtension GEExtensions[MAXEXTENSIONS];
/* Major available requests */
static const int version_requests[] = {
X_GEQueryVersion, /* before client sends QueryVersion */
X_GEQueryVersion, /* must be set to last request in version 1 */
};
/* Forward declarations */
static void SGEGenericEvent(xEvent *from, xEvent *to);
@ -87,11 +86,6 @@ ProcGEQueryVersion(ClientPtr client)
return Success;
}
static int (*ProcGEVector[GENumberRequests]) (ClientPtr) = {
/* Version 1.0 */
ProcGEQueryVersion,
};
/************************************************************/
/* swapped request handlers */
/************************************************************/
@ -99,19 +93,12 @@ static int _X_COLD
SProcGEQueryVersion(ClientPtr client)
{
REQUEST(xGEQueryVersionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGEQueryVersionReq);
swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion);
return (*ProcGEVector[stuff->ReqType]) (client);
return SProcGEQueryVersion(client);
}
static int (*SProcGEVector[GENumberRequests]) (ClientPtr) = {
/* Version 1.0 */
SProcGEQueryVersion
};
/************************************************************/
/* callbacks */
/************************************************************/
@ -120,32 +107,29 @@ static int (*SProcGEVector[GENumberRequests]) (ClientPtr) = {
static int
ProcGEDispatch(ClientPtr client)
{
GEClientInfoPtr pGEClient = GEGetClient(client);
REQUEST(xReq);
REQUEST(xGEReq);
if (pGEClient->major_version >= ARRAY_SIZE(version_requests))
switch (stuff->data) {
case X_GEQueryVersion:
return ProcGEQueryVersion(client);
default:
return BadRequest;
if (stuff->ReqType > version_requests[pGEClient->major_version])
return BadRequest;
return (ProcGEVector[stuff->ReqType]) (client);
}
}
/* dispatch swapped requests */
static int _X_COLD
SProcGEDispatch(ClientPtr client)
{
GEClientInfoPtr pGEClient = GEGetClient(client);
REQUEST(xReq);
swaps(&stuff->length);
REQUEST(xGEReq);
if (pGEClient->major_version >= ARRAY_SIZE(version_requests))
switch (stuff->data) {
case X_GEQueryVersion:
return SProcGEQueryVersion(client);
default:
return BadRequest;
if (stuff->ReqType > version_requests[pGEClient->major_version])
return BadRequest;
return (*SProcGEVector[stuff->ReqType]) (client);
}
}
/* Reset extension. Called on server shutdown. */
@ -184,24 +168,16 @@ SGEGenericEvent(xEvent *from, xEvent *to)
void
GEExtensionInit(void)
{
ExtensionEntry *extEntry;
if (!dixRegisterPrivateKey
(&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec)))
FatalError("GEExtensionInit: GE private request failed.\n");
if ((extEntry = AddExtension(GE_NAME,
0, GENumberErrors,
ProcGEDispatch, SProcGEDispatch,
GEResetProc, StandardMinorOpcode)) != 0) {
memset(GEExtensions, 0, sizeof(GEExtensions));
EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent;
}
else {
if (!AddExtension(GE_NAME, 0, GENumberErrors, ProcGEDispatch, SProcGEDispatch,
GEResetProc, StandardMinorOpcode))
FatalError("GEInit: AddExtensions failed.\n");
}
memset(GEExtensions, 0, sizeof(GEExtensions));
EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent;
}
/************************************************************/

View File

@ -32,6 +32,7 @@ Equipment Corporation.
#include <X11/extensions/panoramiXproto.h>
#include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
#include "misc.h"
#include "cursor.h"
@ -55,7 +56,6 @@ Equipment Corporation.
#ifdef COMPOSITE
#include "compint.h"
#endif
#include "extinit_priv.h"
#include "protocol-versions.h"
#ifdef GLXPROXY
@ -63,6 +63,9 @@ 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

@ -45,22 +45,10 @@ Equipment Corporation.
#include "globals.h"
#include "panoramiXh.h"
static int _X_COLD
SProcPanoramiXQueryVersion(ClientPtr client)
{
REQUEST(xPanoramiXQueryVersionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
return ProcPanoramiXQueryVersion(client);
}
static int _X_COLD
SProcPanoramiXGetState(ClientPtr client)
{
REQUEST(xPanoramiXGetStateReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
swapl(&stuff->window);
return ProcPanoramiXGetState(client);
@ -70,8 +58,6 @@ static int _X_COLD
SProcPanoramiXGetScreenCount(ClientPtr client)
{
REQUEST(xPanoramiXGetScreenCountReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
swapl(&stuff->window);
return ProcPanoramiXGetScreenCount(client);
@ -81,41 +67,19 @@ static int _X_COLD
SProcPanoramiXGetScreenSize(ClientPtr client)
{
REQUEST(xPanoramiXGetScreenSizeReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
swapl(&stuff->window);
swapl(&stuff->screen);
return ProcPanoramiXGetScreenSize(client);
}
static int _X_COLD
SProcXineramaIsActive(ClientPtr client)
{
REQUEST(xXineramaIsActiveReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
return ProcXineramaIsActive(client);
}
static int _X_COLD
SProcXineramaQueryScreens(ClientPtr client)
{
REQUEST(xXineramaQueryScreensReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
return ProcXineramaQueryScreens(client);
}
int _X_COLD
SProcPanoramiXDispatch(ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data) {
case X_PanoramiXQueryVersion:
return SProcPanoramiXQueryVersion(client);
return ProcPanoramiXQueryVersion(client);
case X_PanoramiXGetState:
return SProcPanoramiXGetState(client);
case X_PanoramiXGetScreenCount:
@ -123,9 +87,9 @@ SProcPanoramiXDispatch(ClientPtr client)
case X_PanoramiXGetScreenSize:
return SProcPanoramiXGetScreenSize(client);
case X_XineramaIsActive:
return SProcXineramaIsActive(client);
return ProcXineramaIsActive(client);
case X_XineramaQueryScreens:
return SProcXineramaQueryScreens(client);
return ProcXineramaQueryScreens(client);
}
return BadRequest;
}

View File

@ -36,6 +36,8 @@ in this Software without prior written authorization from the X Consortium.
#include "dix/colormap_priv.h"
#include "dix/cursor_priv.h"
#include "dix/dix_priv.h"
#include "include/dix_pixmap.h"
#include "miext/extinit_priv.h"
#include "os/osdep.h"
#include "os/screensaver.h"
@ -52,21 +54,22 @@ in this Software without prior written authorization from the X Consortium.
#include "colormapst.h"
#include "xace.h"
#include "inputstr.h"
#ifdef PANORAMIX
#ifdef XINERAMA
#include "panoramiX.h"
#include "panoramiXsrv.h"
#endif
#endif /* XINERAMA */
#ifdef DPMSExtension
#include <X11/extensions/dpmsconst.h>
#include "dpmsproc.h"
#endif
#include "protocol-versions.h"
#include "extinit_priv.h"
// temporary workaround for win32/mingw32 name clash
// 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);
@ -275,13 +278,10 @@ setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask)
static void
FreeAttrs(ScreenSaverAttrPtr pAttr)
{
PixmapPtr pPixmap;
CursorPtr pCursor;
if ((pPixmap = pAttr->pBackgroundPixmap) != 0)
(*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
if ((pPixmap = pAttr->pBorderPixmap) != 0)
(*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
dixPixmapPut(pAttr->pBackgroundPixmap);
dixPixmapPut(pAttr->pBorderPixmap);
if ((pCursor = pAttr->pCursor) != 0)
FreeCursor(pCursor, (Cursor) 0);
}
@ -588,9 +588,9 @@ ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force)
ret = TRUE;
}
#ifdef PANORAMIX
#ifdef XINERAMA
if (noPanoramiXExtension || !pScreen->myNum)
#endif
#endif /* XINERAMA */
SendScreenSaverNotify(pScreen, state, force);
return ret;
}
@ -601,7 +601,6 @@ ProcScreenSaverQueryVersion(ClientPtr client)
xScreenSaverQueryVersionReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.majorVersion = SERVER_SAVER_MAJOR_VERSION,
.minorVersion = SERVER_SAVER_MINOR_VERSION
};
@ -610,7 +609,8 @@ ProcScreenSaverQueryVersion(ClientPtr client)
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), &rep);
return Success;
@ -620,7 +620,6 @@ static int
ProcScreenSaverQueryInfo(ClientPtr client)
{
REQUEST(xScreenSaverQueryInfoReq);
xScreenSaverQueryInfoReply rep;
int rc;
ScreenSaverStuffPtr pSaver;
DrawablePtr pDraw;
@ -642,30 +641,24 @@ ProcScreenSaverQueryInfo(ClientPtr client)
UpdateCurrentTime();
lastInput = GetTimeInMillis() - LastEventTime(XIAllDevices).milliseconds;
rep = (xScreenSaverQueryInfoReply) {
xScreenSaverQueryInfoReply rep = {
.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)
rep.tilOrSince = 0;
else
if (ScreenSaverTime >= lastInput)
rep.tilOrSince = ScreenSaverTime - lastInput;
}
else {
rep.state = ScreenSaverDisabled;
rep.tilOrSince = 0;
}
}
rep.idle = lastInput;
@ -678,7 +671,6 @@ ProcScreenSaverQueryInfo(ClientPtr client)
rep.kind = ScreenSaverInternal;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.window);
swapl(&rep.tilOrSince);
swapl(&rep.idle);
@ -711,9 +703,8 @@ ProcScreenSaverSelectInput(ClientPtr client)
}
static int
ScreenSaverSetAttributes(ClientPtr client)
ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
{
REQUEST(xScreenSaverSetAttributesReq);
DrawablePtr pDraw;
WindowPtr pParent;
ScreenPtr pScreen;
@ -736,7 +727,6 @@ ScreenSaverSetAttributes(ClientPtr client)
Colormap cmap;
ColormapPtr pCmap;
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
DixGetAttrAccess);
if (ret != Success)
@ -748,7 +738,7 @@ ScreenSaverSetAttributes(ClientPtr client)
if (ret != Success)
return ret;
len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
len = client->req_len - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
if (Ones(stuff->mask) != len)
return BadLength;
if (!stuff->width || !stuff->height) {
@ -1053,16 +1043,13 @@ ScreenSaverSetAttributes(ClientPtr client)
}
static int
ScreenSaverUnsetAttributes(ClientPtr client)
ScreenSaverUnsetAttributes(ClientPtr client, Drawable drawable)
{
REQUEST(xScreenSaverSetAttributesReq);
DrawablePtr pDraw;
ScreenSaverScreenPrivatePtr pPriv;
int rc;
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
DixGetAttrAccess);
rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixGetAttrAccess);
if (rc != Success)
return rc;
pPriv = GetScreenPrivate(pDraw->pScreen);
@ -1078,9 +1065,11 @@ ScreenSaverUnsetAttributes(ClientPtr client)
static int
ProcScreenSaverSetAttributes(ClientPtr client)
{
#ifdef PANORAMIX
REQUEST(xScreenSaverSetAttributesReq);
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
#ifdef XINERAMA
if (!noPanoramiXExtension) {
REQUEST(xScreenSaverSetAttributesReq);
PanoramiXRes *draw;
PanoramiXRes *backPix = NULL;
PanoramiXRes *bordPix = NULL;
@ -1089,15 +1078,13 @@ ProcScreenSaverSetAttributes(ClientPtr client)
int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
XID orig_visual, tmp;
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
status = dixLookupResourceByClass((void **) &draw, stuff->drawable,
XRC_DRAWABLE, client, DixWriteAccess);
if (status != Success)
return (status == BadValue) ? BadDrawable : status;
len =
stuff->length -
client->req_len -
bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
if (Ones(stuff->mask) != len)
return BadLength;
@ -1152,26 +1139,27 @@ ProcScreenSaverSetAttributes(ClientPtr client)
if (orig_visual != CopyFromParent)
stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual);
status = ScreenSaverSetAttributes(client);
status = ScreenSaverSetAttributes(client, stuff);
}
return status;
}
#endif
#endif /* XINERAMA */
return ScreenSaverSetAttributes(client);
return ScreenSaverSetAttributes(client, stuff);
}
static int
ProcScreenSaverUnsetAttributes(ClientPtr client)
{
#ifdef PANORAMIX
REQUEST(xScreenSaverUnsetAttributesReq);
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
#ifdef XINERAMA
if (!noPanoramiXExtension) {
REQUEST(xScreenSaverUnsetAttributesReq);
PanoramiXRes *draw;
int rc, i;
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
XRC_DRAWABLE, client, DixWriteAccess);
@ -1179,15 +1167,14 @@ ProcScreenSaverUnsetAttributes(ClientPtr client)
return (rc == BadValue) ? BadDrawable : rc;
for (i = PanoramiXNumScreens - 1; i > 0; i--) {
stuff->drawable = draw->info[i].id;
ScreenSaverUnsetAttributes(client);
ScreenSaverUnsetAttributes(client, draw->info[i].id);
}
stuff->drawable = draw->info[0].id;
}
#endif
#endif /* XINERAMA */
return ScreenSaverUnsetAttributes(client);
return ScreenSaverUnsetAttributes(client, stuff->drawable);
}
static int
@ -1255,37 +1242,32 @@ ProcScreenSaverSuspend(ClientPtr client)
return Success;
}
static int (*NormalVector[]) (ClientPtr /* client */ ) = {
ProcScreenSaverQueryVersion,
ProcScreenSaverQueryInfo,
ProcScreenSaverSelectInput,
ProcScreenSaverSetAttributes,
ProcScreenSaverUnsetAttributes, ProcScreenSaverSuspend,};
static int
ProcScreenSaverDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data < ARRAY_SIZE(NormalVector))
return (*NormalVector[stuff->data]) (client);
return BadRequest;
}
static int _X_COLD
SProcScreenSaverQueryVersion(ClientPtr client)
{
REQUEST(xScreenSaverQueryVersionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
return ProcScreenSaverQueryVersion(client);
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;
}
}
static int _X_COLD
SProcScreenSaverQueryInfo(ClientPtr client)
{
REQUEST(xScreenSaverQueryInfoReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
swapl(&stuff->drawable);
return ProcScreenSaverQueryInfo(client);
@ -1295,7 +1277,6 @@ static int _X_COLD
SProcScreenSaverSelectInput(ClientPtr client)
{
REQUEST(xScreenSaverSelectInputReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
swapl(&stuff->drawable);
swapl(&stuff->eventMask);
@ -1306,7 +1287,6 @@ static int _X_COLD
SProcScreenSaverSetAttributes(ClientPtr client)
{
REQUEST(xScreenSaverSetAttributesReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
swapl(&stuff->drawable);
swaps(&stuff->x);
@ -1324,7 +1304,6 @@ static int _X_COLD
SProcScreenSaverUnsetAttributes(ClientPtr client)
{
REQUEST(xScreenSaverUnsetAttributesReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
swapl(&stuff->drawable);
return ProcScreenSaverUnsetAttributes(client);
@ -1334,28 +1313,31 @@ static int _X_COLD
SProcScreenSaverSuspend(ClientPtr client)
{
REQUEST(xScreenSaverSuspendReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
swapl(&stuff->suspend);
return ProcScreenSaverSuspend(client);
}
static int (*SwappedVector[]) (ClientPtr /* client */ ) = {
SProcScreenSaverQueryVersion,
SProcScreenSaverQueryInfo,
SProcScreenSaverSelectInput,
SProcScreenSaverSetAttributes,
SProcScreenSaverUnsetAttributes, SProcScreenSaverSuspend,};
static int _X_COLD
SProcScreenSaverDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data < ARRAY_SIZE(NormalVector))
return (*SwappedVector[stuff->data]) (client);
return BadRequest;
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;
}
}
void

View File

@ -32,7 +32,7 @@ in this Software without prior written authorization from The Open Group.
#include "dix/dix_priv.h"
#include "dix/registry_priv.h"
#include "include/extinit_priv.h"
#include "miext/extinit_priv.h"
#include "os/audit.h"
#include "os/auth.h"
#include "os/osdep.h"
@ -45,9 +45,10 @@ in this Software without prior written authorization from The Open Group.
#include "privates.h"
#include "xacestr.h"
#include "securitysrv.h"
#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 */
@ -612,8 +613,6 @@ static int _X_COLD
SProcSecurityQueryVersion(ClientPtr client)
{
REQUEST(xSecurityQueryVersionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion);
@ -627,8 +626,6 @@ SProcSecurityGenerateAuthorization(ClientPtr client)
CARD32 *values;
unsigned long nvalues;
int values_offset;
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
swaps(&stuff->nbytesAuthProto);
swaps(&stuff->nbytesAuthData);
@ -636,10 +633,10 @@ SProcSecurityGenerateAuthorization(ClientPtr client)
values_offset = bytes_to_int32(stuff->nbytesAuthProto) +
bytes_to_int32(stuff->nbytesAuthData);
if (values_offset >
stuff->length - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
client->req_len - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
return BadLength;
values = (CARD32 *) (&stuff[1]) + values_offset;
nvalues = (((CARD32 *) stuff) + stuff->length) - values;
nvalues = (((CARD32 *) stuff) + client->req_len) - values;
SwapLongs(values, nvalues);
return ProcSecurityGenerateAuthorization(client);
} /* SProcSecurityGenerateAuthorization */
@ -648,8 +645,6 @@ static int _X_COLD
SProcSecurityRevokeAuthorization(ClientPtr client)
{
REQUEST(xSecurityRevokeAuthorizationReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
swapl(&stuff->authId);
return ProcSecurityRevokeAuthorization(client);

View File

@ -33,6 +33,7 @@ in this Software without prior written authorization from The Open Group.
#include "dix/dix_priv.h"
#include "dix/gc_priv.h"
#include "miext/extinit_priv.h"
#include "misc.h"
#include "os.h"
@ -45,7 +46,6 @@ in this Software without prior written authorization from The Open Group.
#include "opaque.h"
#include "regionstr.h"
#include "gcstruct.h"
#include "extinit_priv.h"
#include "protocol-versions.h"
typedef RegionPtr (*CreateDftPtr) (WindowPtr /* pWin */
@ -65,10 +65,12 @@ static void SShapeNotifyEvent(xShapeNotifyEvent * /* from */ ,
* externally by the Xfixes extension and are now defined in window.h
*/
#ifdef PANORAMIX
#ifdef XINERAMA
#include "panoramiX.h"
#include "panoramiXsrv.h"
#endif
#endif /* XINERAMA */
Bool noShapeExtension = FALSE;
static int ShapeEventBase = 0;
static RESTYPE ClientType, ShapeEventType; /* resource types for event masks */
@ -225,24 +227,16 @@ ProcShapeQueryVersion(ClientPtr client)
return Success;
}
/*****************
* ProcShapeRectangles
*
*****************/
static int
ProcShapeRectangles(ClientPtr client)
ShapeRectangles(ClientPtr client, xShapeRectanglesReq *stuff)
{
WindowPtr pWin;
REQUEST(xShapeRectanglesReq);
xRectangle *prects;
int nrects, ctype, rc;
RegionPtr srcRgn;
RegionPtr *destRgn;
CreateDftPtr createDefault;
REQUEST_AT_LEAST_SIZE(xShapeRectanglesReq);
UpdateCurrentTime();
rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
if (rc != Success)
@ -266,7 +260,7 @@ ProcShapeRectangles(ClientPtr client)
client->errorValue = stuff->ordering;
return BadValue;
}
nrects = ((stuff->length << 2) - sizeof(xShapeRectanglesReq));
nrects = ((client->req_len << 2) - sizeof(xShapeRectanglesReq));
if (nrects & 4)
return BadLength;
nrects >>= 3;
@ -297,16 +291,19 @@ ProcShapeRectangles(ClientPtr client)
stuff->xOff, stuff->yOff, createDefault);
}
#ifdef PANORAMIX
static int
ProcPanoramiXShapeRectangles(ClientPtr client)
ProcShapeRectangles(ClientPtr client)
{
REQUEST(xShapeRectanglesReq);
REQUEST_AT_LEAST_SIZE(xShapeRectanglesReq);
#ifdef XINERAMA
if (noPanoramiXExtension)
return ShapeRectangles(client, stuff);
PanoramiXRes *win;
int j, result;
REQUEST_AT_LEAST_SIZE(xShapeRectanglesReq);
result = dixLookupResourceByType((void **) &win, stuff->dest, XRT_WINDOW,
client, DixWriteAccess);
if (result != Success)
@ -314,32 +311,27 @@ ProcPanoramiXShapeRectangles(ClientPtr client)
FOR_NSCREENS(j) {
stuff->dest = win->info[j].id;
result = ProcShapeRectangles(client);
result = ShapeRectangles(client, stuff);
if (result != Success)
break;
}
return result;
}
#else
return ShapeRectangles(client);
#endif
/**************
* ProcShapeMask
**************/
}
static int
ProcShapeMask(ClientPtr client)
ShapeMask(ClientPtr client, xShapeMaskReq *stuff)
{
WindowPtr pWin;
ScreenPtr pScreen;
REQUEST(xShapeMaskReq);
RegionPtr srcRgn;
RegionPtr *destRgn;
PixmapPtr pPixmap;
CreateDftPtr createDefault;
int rc;
REQUEST_SIZE_MATCH(xShapeMaskReq);
UpdateCurrentTime();
rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
if (rc != Success)
@ -395,16 +387,19 @@ ProcShapeMask(ClientPtr client)
stuff->xOff, stuff->yOff, createDefault);
}
#ifdef PANORAMIX
static int
ProcPanoramiXShapeMask(ClientPtr client)
ProcShapeMask(ClientPtr client)
{
REQUEST(xShapeMaskReq);
REQUEST_SIZE_MATCH(xShapeMaskReq);
#ifdef XINERAMA
if (noPanoramiXExtension)
return ShapeMask(client, stuff);
PanoramiXRes *win, *pmap;
int j, result;
REQUEST_SIZE_MATCH(xShapeMaskReq);
result = dixLookupResourceByType((void **) &win, stuff->dest, XRT_WINDOW,
client, DixWriteAccess);
if (result != Success)
@ -423,24 +418,20 @@ ProcPanoramiXShapeMask(ClientPtr client)
stuff->dest = win->info[j].id;
if (pmap)
stuff->src = pmap->info[j].id;
result = ProcShapeMask(client);
result = ShapeMask(client, stuff);
if (result != Success)
break;
}
return result;
}
#else
return ShapeMask(client, stuff);
#endif
/************
* ProcShapeCombine
************/
}
static int
ProcShapeCombine(ClientPtr client)
ShapeCombine(ClientPtr client, xShapeCombineReq *stuff)
{
WindowPtr pSrcWin, pDestWin;
REQUEST(xShapeCombineReq);
RegionPtr srcRgn;
RegionPtr *destRgn;
CreateDftPtr createDefault;
@ -448,7 +439,6 @@ ProcShapeCombine(ClientPtr client)
RegionPtr tmp;
int rc;
REQUEST_SIZE_MATCH(xShapeCombineReq);
UpdateCurrentTime();
rc = dixLookupWindow(&pDestWin, stuff->dest, client, DixSetAttrAccess);
if (rc != Success)
@ -523,16 +513,19 @@ ProcShapeCombine(ClientPtr client)
stuff->xOff, stuff->yOff, createDefault);
}
#ifdef PANORAMIX
static int
ProcPanoramiXShapeCombine(ClientPtr client)
ProcShapeCombine(ClientPtr client)
{
REQUEST(xShapeCombineReq);
REQUEST_AT_LEAST_SIZE(xShapeCombineReq);
#ifdef XINERAMA
if (noPanoramiXExtension)
return ShapeCombine(client, stuff);
PanoramiXRes *win, *win2;
int j, result;
REQUEST_AT_LEAST_SIZE(xShapeCombineReq);
result = dixLookupResourceByType((void **) &win, stuff->dest, XRT_WINDOW,
client, DixWriteAccess);
if (result != Success)
@ -546,28 +539,23 @@ ProcPanoramiXShapeCombine(ClientPtr client)
FOR_NSCREENS(j) {
stuff->dest = win->info[j].id;
stuff->src = win2->info[j].id;
result = ProcShapeCombine(client);
result = ShapeCombine(client, stuff);
if (result != Success)
break;
}
return result;
}
#else
return ShapeCombine(client, stuff);
#endif
/*************
* ProcShapeOffset
*************/
}
static int
ProcShapeOffset(ClientPtr client)
ShapeOffset(ClientPtr client, xShapeOffsetReq *stuff)
{
WindowPtr pWin;
REQUEST(xShapeOffsetReq);
RegionPtr srcRgn;
int rc;
REQUEST_SIZE_MATCH(xShapeOffsetReq);
UpdateCurrentTime();
rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
if (rc != Success)
@ -594,15 +582,18 @@ ProcShapeOffset(ClientPtr client)
return Success;
}
#ifdef PANORAMIX
static int
ProcPanoramiXShapeOffset(ClientPtr client)
ProcShapeOffset(ClientPtr client)
{
REQUEST(xShapeOffsetReq);
REQUEST_AT_LEAST_SIZE(xShapeOffsetReq);
#ifdef XINERAMA
PanoramiXRes *win;
int j, result;
REQUEST_AT_LEAST_SIZE(xShapeOffsetReq);
if (noPanoramiXExtension)
return ShapeOffset(client, stuff);
result = dixLookupResourceByType((void **) &win, stuff->dest, XRT_WINDOW,
client, DixWriteAccess);
@ -611,13 +602,15 @@ ProcPanoramiXShapeOffset(ClientPtr client)
FOR_NSCREENS(j) {
stuff->dest = win->info[j].id;
result = ProcShapeOffset(client);
result = ShapeOffset(client, stuff);
if (result != Success)
break;
}
return result;
}
#else
return ShapeOffset(client, stuff);
#endif
}
static int
ProcShapeQueryExtents(ClientPtr client)
@ -1035,33 +1028,13 @@ ProcShapeDispatch(ClientPtr client)
case X_ShapeQueryVersion:
return ProcShapeQueryVersion(client);
case X_ShapeRectangles:
#ifdef PANORAMIX
if (!noPanoramiXExtension)
return ProcPanoramiXShapeRectangles(client);
else
#endif
return ProcShapeRectangles(client);
return ProcShapeRectangles(client);
case X_ShapeMask:
#ifdef PANORAMIX
if (!noPanoramiXExtension)
return ProcPanoramiXShapeMask(client);
else
#endif
return ProcShapeMask(client);
return ProcShapeMask(client);
case X_ShapeCombine:
#ifdef PANORAMIX
if (!noPanoramiXExtension)
return ProcPanoramiXShapeCombine(client);
else
#endif
return ProcShapeCombine(client);
return ProcShapeCombine(client);
case X_ShapeOffset:
#ifdef PANORAMIX
if (!noPanoramiXExtension)
return ProcPanoramiXShapeOffset(client);
else
#endif
return ProcShapeOffset(client);
return ProcShapeOffset(client);
case X_ShapeQueryExtents:
return ProcShapeQueryExtents(client);
case X_ShapeSelectInput:
@ -1090,21 +1063,10 @@ SShapeNotifyEvent(xShapeNotifyEvent * from, xShapeNotifyEvent * to)
to->shaped = from->shaped;
}
static int _X_COLD
SProcShapeQueryVersion(ClientPtr client)
{
REQUEST(xShapeQueryVersionReq);
swaps(&stuff->length);
return ProcShapeQueryVersion(client);
}
static int _X_COLD
SProcShapeRectangles(ClientPtr client)
{
REQUEST(xShapeRectanglesReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xShapeRectanglesReq);
swapl(&stuff->dest);
swaps(&stuff->xOff);
@ -1117,8 +1079,6 @@ static int _X_COLD
SProcShapeMask(ClientPtr client)
{
REQUEST(xShapeMaskReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShapeMaskReq);
swapl(&stuff->dest);
swaps(&stuff->xOff);
@ -1131,8 +1091,6 @@ static int _X_COLD
SProcShapeCombine(ClientPtr client)
{
REQUEST(xShapeCombineReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShapeCombineReq);
swapl(&stuff->dest);
swaps(&stuff->xOff);
@ -1145,8 +1103,6 @@ static int _X_COLD
SProcShapeOffset(ClientPtr client)
{
REQUEST(xShapeOffsetReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShapeOffsetReq);
swapl(&stuff->dest);
swaps(&stuff->xOff);
@ -1158,8 +1114,6 @@ static int _X_COLD
SProcShapeQueryExtents(ClientPtr client)
{
REQUEST(xShapeQueryExtentsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShapeQueryExtentsReq);
swapl(&stuff->window);
return ProcShapeQueryExtents(client);
@ -1169,8 +1123,6 @@ static int _X_COLD
SProcShapeSelectInput(ClientPtr client)
{
REQUEST(xShapeSelectInputReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShapeSelectInputReq);
swapl(&stuff->window);
return ProcShapeSelectInput(client);
@ -1180,8 +1132,6 @@ static int _X_COLD
SProcShapeInputSelected(ClientPtr client)
{
REQUEST(xShapeInputSelectedReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShapeInputSelectedReq);
swapl(&stuff->window);
return ProcShapeInputSelected(client);
@ -1191,7 +1141,6 @@ static int _X_COLD
SProcShapeGetRectangles(ClientPtr client)
{
REQUEST(xShapeGetRectanglesReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
swapl(&stuff->window);
return ProcShapeGetRectangles(client);
@ -1203,7 +1152,7 @@ SProcShapeDispatch(ClientPtr client)
REQUEST(xReq);
switch (stuff->data) {
case X_ShapeQueryVersion:
return SProcShapeQueryVersion(client);
return ProcShapeQueryVersion(client);
case X_ShapeRectangles:
return SProcShapeRectangles(client);
case X_ShapeMask:

View File

@ -43,8 +43,11 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xfuncproto.h>
#include "dix/dix_priv.h"
#include "include/dix_pixmap.h"
#include "miext/extinit_priv.h"
#include "os/auth.h"
#include "os/busfault.h"
#include "os/log_priv.h"
#include "os/osdep.h"
#include "misc.h"
@ -59,7 +62,6 @@ in this Software without prior written authorization from The Open Group.
#include "servermd.h"
#include "shmint.h"
#include "xace.h"
#include "extinit_priv.h"
#include "protocol-versions.h"
/* Needed for Solaris cross-zone shared memory extension */
@ -89,15 +91,13 @@ in this Software without prior written authorization from The Open Group.
#define SHMPERM_MODE(p) p->mode
#endif
#ifdef PANORAMIX
#ifdef XINERAMA
#include "panoramiX.h"
#include "panoramiXsrv.h"
#endif
#endif /* XINERAMA */
typedef struct _ShmScrPrivateRec {
CloseScreenProcPtr CloseScreen;
ShmFuncsPtr shmFuncs;
DestroyPixmapProcPtr destroyPixmap;
} ShmScrPrivateRec;
static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS);
@ -106,7 +106,9 @@ static void ShmResetProc(ExtensionEntry *extEntry);
static void SShmCompletionEvent(xShmCompletionEvent *from,
xShmCompletionEvent *to);
static Bool ShmDestroyPixmap(PixmapPtr pPixmap);
static int ShmCreatePixmap(ClientPtr client, xShmCreatePixmapReq *stuff);
Bool noMITShmExtension = FALSE;
static unsigned char ShmReqCode;
int ShmCompletionCode;
@ -154,7 +156,7 @@ static ShmFuncs fbFuncs = { fbShmCreatePixmap, NULL };
} \
}
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__)
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
static Bool badSysCall = FALSE;
@ -192,15 +194,13 @@ CheckForShmSyscall(void)
#endif
static Bool
ShmCloseScreen(ScreenPtr pScreen)
static void
ShmScreenClose(ScreenPtr pScreen, void *arg)
{
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
pScreen->CloseScreen = screen_priv->CloseScreen;
dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, NULL);
free(screen_priv);
return (*pScreen->CloseScreen) (pScreen);
}
static ShmScrPrivateRec *
@ -210,9 +210,8 @@ ShmInitScreenPriv(ScreenPtr pScreen)
if (!screen_priv) {
screen_priv = calloc(1, sizeof(ShmScrPrivateRec));
screen_priv->CloseScreen = pScreen->CloseScreen;
dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, screen_priv);
pScreen->CloseScreen = ShmCloseScreen;
dixScreenHookClose(pScreen, ShmScreenClose, NULL);
}
return screen_priv;
}
@ -244,27 +243,6 @@ ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs)
ShmInitScreenPriv(pScreen)->shmFuncs = funcs;
}
static Bool
ShmDestroyPixmap(PixmapPtr pPixmap)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
void *shmdesc = NULL;
Bool ret;
if (pPixmap->refcnt == 1)
shmdesc = dixLookupPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey);
pScreen->DestroyPixmap = screen_priv->destroyPixmap;
ret = (*pScreen->DestroyPixmap) (pPixmap);
screen_priv->destroyPixmap = pScreen->DestroyPixmap;
pScreen->DestroyPixmap = ShmDestroyPixmap;
if (shmdesc)
ShmDetachSegment(shmdesc, 0);
return ret;
}
void
ShmRegisterFbFuncs(ScreenPtr pScreen)
@ -370,12 +348,15 @@ shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly)
static int
ProcShmAttach(ClientPtr client)
{
REQUEST(xShmAttachReq);
REQUEST_SIZE_MATCH(xShmAttachReq);
if (!client->local)
return BadRequest;
SHMSTAT_TYPE buf;
ShmDescPtr shmdesc;
REQUEST(xShmAttachReq);
REQUEST_SIZE_MATCH(xShmAttachReq);
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
client->errorValue = stuff->readOnly;
@ -433,6 +414,9 @@ ShmDetachSegment(void *value, /* must conform to DeleteType */
ShmDescPtr shmdesc = (ShmDescPtr) value;
ShmDescPtr *prev;
if (!shmdesc)
return Success;
if (--shmdesc->refcnt)
return TRUE;
#if SHM_FD_PASSING
@ -452,11 +436,14 @@ ShmDetachSegment(void *value, /* must conform to DeleteType */
static int
ProcShmDetach(ClientPtr client)
{
REQUEST(xShmDetachReq);
REQUEST_SIZE_MATCH(xShmDetachReq);
if (!client->local)
return BadRequest;
ShmDescPtr shmdesc;
REQUEST(xShmDetachReq);
REQUEST_SIZE_MATCH(xShmDetachReq);
VERIFY_SHMSEG(stuff->shmseg, shmdesc, client);
FreeResource(stuff->shmseg, X11_RESTYPE_NONE);
return Success;
@ -490,8 +477,8 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
if (!putGC)
return;
pPixmap = (*dst->pScreen->CreatePixmap) (dst->pScreen, sw, sh, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
pPixmap = dixPixmapCreate(dst->pScreen, sw, sh, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
if (!pPixmap) {
FreeScratchGC(putGC);
return;
@ -508,21 +495,18 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
else
(void) (*pGC->ops->CopyArea) (&pPixmap->drawable, dst, pGC, 0, 0,
sw, sh, dx, dy);
(*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
dixPixmapPut(pPixmap);
}
}
static int
ProcShmPutImage(ClientPtr client)
ShmPutImage(ClientPtr client, xShmPutImageReq *stuff)
{
GCPtr pGC;
DrawablePtr pDraw;
long length;
ShmDescPtr shmdesc;
REQUEST(xShmPutImageReq);
REQUEST_SIZE_MATCH(xShmPutImageReq);
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
@ -612,7 +596,7 @@ ProcShmPutImage(ClientPtr client)
}
static int
ProcShmGetImage(ClientPtr client)
ShmGetImage(ClientPtr client, xShmGetImageReq *stuff)
{
DrawablePtr pDraw;
long lenPer = 0, length;
@ -623,9 +607,6 @@ ProcShmGetImage(ClientPtr client)
RegionPtr pVisibleRegion = NULL;
int rc;
REQUEST(xShmGetImageReq);
REQUEST_SIZE_MATCH(xShmGetImageReq);
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
client->errorValue = stuff->format;
return BadValue;
@ -730,16 +711,22 @@ ProcShmGetImage(ClientPtr client)
return Success;
}
#ifdef PANORAMIX
static int
ProcPanoramiXShmPutImage(ClientPtr client)
ProcShmPutImage(ClientPtr client)
{
REQUEST(xShmPutImageReq);
REQUEST_SIZE_MATCH(xShmPutImageReq);
if (!client->local)
return BadRequest;
#ifdef XINERAMA
int j, result, orig_x, orig_y;
PanoramiXRes *draw, *gc;
Bool sendEvent, isRoot;
REQUEST(xShmPutImageReq);
REQUEST_SIZE_MATCH(xShmPutImageReq);
if (noPanoramiXExtension)
return ShmPutImage(client, stuff);
result = dixLookupResourceByClass((void **) &draw, stuff->drawable,
XRC_DRAWABLE, client, DixWriteAccess);
@ -766,16 +753,26 @@ ProcPanoramiXShmPutImage(ClientPtr client)
stuff->dstX = orig_x - screenInfo.screens[j]->x;
stuff->dstY = orig_y - screenInfo.screens[j]->y;
}
result = ProcShmPutImage(client);
result = ShmPutImage(client, stuff);
if (result != Success)
break;
}
return result;
#else
return ShmPutImage(client, stuff);
#endif /* XINERAMA */
}
static int
ProcPanoramiXShmGetImage(ClientPtr client)
ProcShmGetImage(ClientPtr client)
{
REQUEST(xShmGetImageReq);
REQUEST_SIZE_MATCH(xShmGetImageReq);
if (!client->local)
return BadRequest;
#ifdef XINERAMA
PanoramiXRes *draw;
DrawablePtr *drawables;
DrawablePtr pDraw;
@ -786,9 +783,8 @@ ProcPanoramiXShmGetImage(ClientPtr client)
long lenPer = 0, length, widthBytesLine;
Bool isRoot;
REQUEST(xShmGetImageReq);
REQUEST_SIZE_MATCH(xShmGetImageReq);
if (noPanoramiXExtension)
return ShmGetImage(client, stuff);
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
client->errorValue = stuff->format;
@ -801,7 +797,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
return (rc == BadValue) ? BadDrawable : rc;
if (draw->type == XRT_PIXMAP)
return ProcShmGetImage(client);
return ShmGetImage(client, stuff);
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReadAccess);
if (rc != Success)
@ -912,24 +908,34 @@ ProcPanoramiXShmGetImage(ClientPtr client)
WriteToClient(client, sizeof(xShmGetImageReply), &xgi);
return Success;
#else
return ShmGetImage(client, stuff);
#endif /* XINERAMA */
}
static int
ProcPanoramiXShmCreatePixmap(ClientPtr client)
ProcShmCreatePixmap(ClientPtr client)
{
REQUEST(xShmCreatePixmapReq);
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
if (!client->local)
return BadRequest;
#ifdef XINERAMA
if (noPanoramiXExtension)
return ShmCreatePixmap(client, stuff);
ScreenPtr pScreen = NULL;
PixmapPtr pMap = NULL;
DrawablePtr pDraw;
DepthPtr pDepth;
int i, j, result, rc;
ShmDescPtr shmdesc;
REQUEST(xShmCreatePixmapReq);
unsigned int width, height, depth;
unsigned long size;
PanoramiXRes *newPix;
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
client->errorValue = stuff->pid;
if (!sharedPixmaps)
return BadImplementation;
@ -998,7 +1004,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
result = XaceHookResourceAccess(client, stuff->pid,
X11_RESTYPE_PIXMAP, pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (result != Success) {
pDraw->pScreen->DestroyPixmap(pMap);
dixPixmapPut(pMap);
break;
}
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);
@ -1025,16 +1031,16 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
AddResource(stuff->pid, XRT_PIXMAP, newPix);
return result;
#else
return ShmCreatePixmap(client, stuff);
#endif /* XINERAMA */
}
#endif
static PixmapPtr
fbShmCreatePixmap(ScreenPtr pScreen,
int width, int height, int depth, char *addr)
{
PixmapPtr pPixmap;
pPixmap = (*pScreen->CreatePixmap) (pScreen, 0, 0, pScreen->rootDepth, 0);
PixmapPtr pPixmap = dixPixmapCreate(pScreen, 0, 0, pScreen->rootDepth, 0);
if (!pPixmap)
return NullPixmap;
@ -1042,14 +1048,14 @@ fbShmCreatePixmap(ScreenPtr pScreen,
BitsPerPixel(depth),
PixmapBytePad(width, depth),
(void *) addr)) {
(*pScreen->DestroyPixmap) (pPixmap);
dixPixmapPut(pPixmap);
return NullPixmap;
}
return pPixmap;
}
static int
ProcShmCreatePixmap(ClientPtr client)
ShmCreatePixmap(ClientPtr client, xShmCreatePixmapReq *stuff)
{
PixmapPtr pMap;
DrawablePtr pDraw;
@ -1057,12 +1063,9 @@ ProcShmCreatePixmap(ClientPtr client)
int i, rc;
ShmDescPtr shmdesc;
ShmScrPrivateRec *screen_priv;
REQUEST(xShmCreatePixmapReq);
unsigned int width, height, depth;
unsigned long size;
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
client->errorValue = stuff->pid;
if (!sharedPixmaps)
return BadImplementation;
@ -1113,7 +1116,7 @@ ProcShmCreatePixmap(ClientPtr client)
rc = XaceHookResourceAccess(client, stuff->pid, X11_RESTYPE_PIXMAP,
pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (rc != Success) {
pDraw->pScreen->DestroyPixmap(pMap);
dixPixmapPut(pMap);
return rc;
}
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);
@ -1144,19 +1147,24 @@ ShmBusfaultNotify(void *context)
static int
ProcShmAttachFd(ClientPtr client)
{
REQUEST(xShmAttachFdReq);
REQUEST_SIZE_MATCH(xShmAttachFdReq);
if (!client->local)
return BadRequest;
int fd;
ShmDescPtr shmdesc;
REQUEST(xShmAttachFdReq);
struct stat statb;
SetReqFds(client, 1);
REQUEST_SIZE_MATCH(xShmAttachFdReq);
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
client->errorValue = stuff->readOnly;
return BadValue;
}
fd = ReadFdFromClient(client);
fd = client->recv_fd_list[0];
client->recv_fd_list[0] = -1;
if (fd < 0)
return BadMatch;
@ -1259,9 +1267,14 @@ shm_tmpfile(void)
static int
ProcShmCreateSegment(ClientPtr client)
{
REQUEST(xShmCreateSegmentReq);
REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
if (!client->local)
return BadRequest;
int fd;
ShmDescPtr shmdesc;
REQUEST(xShmCreateSegmentReq);
xShmCreateSegmentReply rep = {
.type = X_Reply,
.nfd = 1,
@ -1269,7 +1282,6 @@ ProcShmCreateSegment(ClientPtr client)
.length = 0,
};
REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
client->errorValue = stuff->readOnly;
@ -1334,34 +1346,18 @@ ProcShmDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data == X_ShmQueryVersion)
return ProcShmQueryVersion(client);
if (!client->local)
return BadRequest;
switch (stuff->data) {
case X_ShmQueryVersion:
return ProcShmQueryVersion(client);
case X_ShmAttach:
return ProcShmAttach(client);
case X_ShmDetach:
return ProcShmDetach(client);
case X_ShmPutImage:
#ifdef PANORAMIX
if (!noPanoramiXExtension)
return ProcPanoramiXShmPutImage(client);
#endif
return ProcShmPutImage(client);
case X_ShmGetImage:
#ifdef PANORAMIX
if (!noPanoramiXExtension)
return ProcPanoramiXShmGetImage(client);
#endif
return ProcShmGetImage(client);
case X_ShmCreatePixmap:
#ifdef PANORAMIX
if (!noPanoramiXExtension)
return ProcPanoramiXShmCreatePixmap(client);
#endif
return ProcShmCreatePixmap(client);
#ifdef SHM_FD_PASSING
case X_ShmAttachFd:
@ -1386,20 +1382,10 @@ SShmCompletionEvent(xShmCompletionEvent * from, xShmCompletionEvent * to)
cpswapl(from->offset, to->offset);
}
static int _X_COLD
SProcShmQueryVersion(ClientPtr client)
{
REQUEST(xShmQueryVersionReq);
swaps(&stuff->length);
return ProcShmQueryVersion(client);
}
static int _X_COLD
SProcShmAttach(ClientPtr client)
{
REQUEST(xShmAttachReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmAttachReq);
swapl(&stuff->shmseg);
swapl(&stuff->shmid);
@ -1410,7 +1396,6 @@ static int _X_COLD
SProcShmDetach(ClientPtr client)
{
REQUEST(xShmDetachReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmDetachReq);
swapl(&stuff->shmseg);
return ProcShmDetach(client);
@ -1420,7 +1405,6 @@ static int _X_COLD
SProcShmPutImage(ClientPtr client)
{
REQUEST(xShmPutImageReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmPutImageReq);
swapl(&stuff->drawable);
swapl(&stuff->gc);
@ -1441,7 +1425,6 @@ static int _X_COLD
SProcShmGetImage(ClientPtr client)
{
REQUEST(xShmGetImageReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmGetImageReq);
swapl(&stuff->drawable);
swaps(&stuff->x);
@ -1458,7 +1441,6 @@ static int _X_COLD
SProcShmCreatePixmap(ClientPtr client)
{
REQUEST(xShmCreatePixmapReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
swapl(&stuff->pid);
swapl(&stuff->drawable);
@ -1474,8 +1456,6 @@ static int _X_COLD
SProcShmAttachFd(ClientPtr client)
{
REQUEST(xShmAttachFdReq);
SetReqFds(client, 1);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmAttachFdReq);
swapl(&stuff->shmseg);
return ProcShmAttachFd(client);
@ -1485,7 +1465,6 @@ static int _X_COLD
SProcShmCreateSegment(ClientPtr client)
{
REQUEST(xShmCreateSegmentReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
swapl(&stuff->shmseg);
swapl(&stuff->size);
@ -1498,13 +1477,9 @@ SProcShmDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data == X_ShmQueryVersion)
return SProcShmQueryVersion(client);
if (!client->local)
return BadRequest;
switch (stuff->data) {
case X_ShmQueryVersion:
return ProcShmQueryVersion(client);
case X_ShmAttach:
return SProcShmAttach(client);
case X_ShmDetach:
@ -1526,6 +1501,14 @@ SProcShmDispatch(ClientPtr client)
}
}
static void ShmPixmapDestroy(ScreenPtr pScreen, PixmapPtr pPixmap, void *arg)
{
ShmDetachSegment(
dixLookupPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey),
0);
dixSetPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey, NULL);
}
void
ShmExtensionInit(void)
{
@ -1554,13 +1537,8 @@ ShmExtensionInit(void)
sharedPixmaps = xFalse;
}
if (sharedPixmaps)
for (i = 0; i < screenInfo.numScreens; i++) {
ShmScrPrivateRec *screen_priv =
ShmGetScreenPriv(screenInfo.screens[i]);
screen_priv->destroyPixmap =
screenInfo.screens[i]->DestroyPixmap;
screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
}
for (i = 0; i < screenInfo.numScreens; i++)
dixScreenHookPixmapDestroy(screenInfo.screens[i], ShmPixmapDestroy, NULL);
}
ShmSegType = CreateNewResourceType(ShmDetachSegment, "ShmSeg");
if (ShmSegType &&

View File

@ -59,6 +59,7 @@ PERFORMANCE OF THIS SOFTWARE.
#include <X11/extensions/syncproto.h>
#include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
#include "os/osdep.h"
#include "scrnintstr.h"
@ -77,8 +78,6 @@ PERFORMANCE OF THIS SOFTWARE.
#include <sys/time.h>
#endif
#include "extinit_priv.h"
/*
* Local Global Variables
*/
@ -2151,31 +2150,10 @@ ProcSyncDispatch(ClientPtr client)
* Boring Swapping stuff ...
*/
static int _X_COLD
SProcSyncInitialize(ClientPtr client)
{
REQUEST(xSyncInitializeReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncInitializeReq);
return ProcSyncInitialize(client);
}
static int _X_COLD
SProcSyncListSystemCounters(ClientPtr client)
{
REQUEST(xSyncListSystemCountersReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncListSystemCountersReq);
return ProcSyncListSystemCounters(client);
}
static int _X_COLD
SProcSyncCreateCounter(ClientPtr client)
{
REQUEST(xSyncCreateCounterReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncCreateCounterReq);
swapl(&stuff->cid);
swapl(&stuff->initial_value_lo);
@ -2188,7 +2166,6 @@ static int _X_COLD
SProcSyncSetCounter(ClientPtr client)
{
REQUEST(xSyncSetCounterReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncSetCounterReq);
swapl(&stuff->cid);
swapl(&stuff->value_lo);
@ -2201,7 +2178,6 @@ static int _X_COLD
SProcSyncChangeCounter(ClientPtr client)
{
REQUEST(xSyncChangeCounterReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncChangeCounterReq);
swapl(&stuff->cid);
swapl(&stuff->value_lo);
@ -2214,7 +2190,6 @@ static int _X_COLD
SProcSyncQueryCounter(ClientPtr client)
{
REQUEST(xSyncQueryCounterReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncQueryCounterReq);
swapl(&stuff->counter);
@ -2225,7 +2200,6 @@ static int _X_COLD
SProcSyncDestroyCounter(ClientPtr client)
{
REQUEST(xSyncDestroyCounterReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncDestroyCounterReq);
swapl(&stuff->counter);
@ -2236,7 +2210,6 @@ static int _X_COLD
SProcSyncAwait(ClientPtr client)
{
REQUEST(xSyncAwaitReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
SwapRestL(stuff);
@ -2247,7 +2220,6 @@ static int _X_COLD
SProcSyncCreateAlarm(ClientPtr client)
{
REQUEST(xSyncCreateAlarmReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
swapl(&stuff->id);
swapl(&stuff->valueMask);
@ -2260,7 +2232,6 @@ static int _X_COLD
SProcSyncChangeAlarm(ClientPtr client)
{
REQUEST(xSyncChangeAlarmReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
swapl(&stuff->alarm);
swapl(&stuff->valueMask);
@ -2272,7 +2243,6 @@ static int _X_COLD
SProcSyncQueryAlarm(ClientPtr client)
{
REQUEST(xSyncQueryAlarmReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncQueryAlarmReq);
swapl(&stuff->alarm);
@ -2283,7 +2253,6 @@ static int _X_COLD
SProcSyncDestroyAlarm(ClientPtr client)
{
REQUEST(xSyncDestroyAlarmReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq);
swapl(&stuff->alarm);
@ -2294,7 +2263,6 @@ static int _X_COLD
SProcSyncSetPriority(ClientPtr client)
{
REQUEST(xSyncSetPriorityReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncSetPriorityReq);
swapl(&stuff->id);
swapl(&stuff->priority);
@ -2306,7 +2274,6 @@ static int _X_COLD
SProcSyncGetPriority(ClientPtr client)
{
REQUEST(xSyncGetPriorityReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncGetPriorityReq);
swapl(&stuff->id);
@ -2317,7 +2284,6 @@ static int _X_COLD
SProcSyncCreateFence(ClientPtr client)
{
REQUEST(xSyncCreateFenceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncCreateFenceReq);
swapl(&stuff->d);
swapl(&stuff->fid);
@ -2329,7 +2295,6 @@ static int _X_COLD
SProcSyncTriggerFence(ClientPtr client)
{
REQUEST(xSyncTriggerFenceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncTriggerFenceReq);
swapl(&stuff->fid);
@ -2340,7 +2305,6 @@ static int _X_COLD
SProcSyncResetFence(ClientPtr client)
{
REQUEST(xSyncResetFenceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncResetFenceReq);
swapl(&stuff->fid);
@ -2351,7 +2315,6 @@ static int _X_COLD
SProcSyncDestroyFence(ClientPtr client)
{
REQUEST(xSyncDestroyFenceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncDestroyFenceReq);
swapl(&stuff->fid);
@ -2362,7 +2325,6 @@ static int _X_COLD
SProcSyncQueryFence(ClientPtr client)
{
REQUEST(xSyncQueryFenceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncQueryFenceReq);
swapl(&stuff->fid);
@ -2373,7 +2335,6 @@ static int _X_COLD
SProcSyncAwaitFence(ClientPtr client)
{
REQUEST(xSyncAwaitFenceReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq);
SwapRestL(stuff);
@ -2387,9 +2348,9 @@ SProcSyncDispatch(ClientPtr client)
switch (stuff->data) {
case X_SyncInitialize:
return SProcSyncInitialize(client);
return ProcSyncInitialize(client);
case X_SyncListSystemCounters:
return SProcSyncListSystemCounters(client);
return ProcSyncListSystemCounters(client);
case X_SyncCreateCounter:
return SProcSyncCreateCounter(client);
case X_SyncSetCounter:

File diff suppressed because it is too large Load Diff

View File

@ -278,3 +278,15 @@ XaceIsLocal(ClientPtr client)
{
return ClientIsLocal(client);
}
Bool
XaceRegisterCallback(int hook, CallbackProcPtr callback, void *data)
{
return AddCallback(XaceHooks+(hook), callback, data);
}
Bool
XaceDeleteCallback(int hook, CallbackProcPtr callback, void *data)
{
return DeleteCallback(XaceHooks+(hook), callback, data);
}

View File

@ -25,12 +25,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define XACE_MAJOR_VERSION 2
#define XACE_MINOR_VERSION 0
#include "dix/selection_priv.h"
#include "extnsionst.h"
#include "pixmap.h"
#include "region.h"
#include "window.h"
#include "property.h"
#include "selection.h"
/* Default window background */
#define XaceBackgroundNoneState(w) ((w)->forcedBG ? BackgroundPixel : None)
@ -58,11 +59,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
extern CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
/* Entry point for hook functions. Called by Xserver.
* Required by libdbe and libextmod
* Required by several modules
*/
/* needs to be exported for in-tree modsetting driver, but not part
of public API for external modules */
_X_EXPORT int XaceHook(int hook, ... /* appropriate args for hook */);
_X_EXPORT Bool XaceRegisterCallback(int hook, CallbackProcPtr callback, void *data);
_X_EXPORT Bool XaceDeleteCallback(int hook, CallbackProcPtr callback, void *data);
/* determine whether any callbacks are present for the XACE hook */
int XaceHookIsSet(int hook);
@ -96,16 +97,7 @@ int XaceHookScreensaverAccess(ClientPtr client, ScreenPtr screen, Mask access_mo
int XaceHookAuthAvail(ClientPtr client, XID authId);
int XaceHookKeyAvail(xEventPtr ev, DeviceIntPtr dev, int count);
/* Register a callback for a given hook.
*/
#define XaceRegisterCallback(hook,callback,data) \
AddCallback(XaceHooks+(hook), callback, data)
/* Unregister an existing callback for a given hook.
*/
#define XaceDeleteCallback(hook,callback,data) \
DeleteCallback(XaceHooks+(hook), callback, data)
/* Register / unregister a callback for a given hook. */
/* XTrans wrappers for use by security modules
*/

View File

@ -20,13 +20,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef _XACESTR_H
#define _XACESTR_H
#include "dix/selection_priv.h"
#include "dix.h"
#include "resource.h"
#include "extnsionst.h"
#include "window.h"
#include "input.h"
#include "property.h"
#include "selection.h"
#include "xace.h"
/* XACE_CORE_DISPATCH */

View File

@ -28,17 +28,18 @@ from The Open Group.
#include <dix-config.h>
#include <stdint.h>
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/extensions/xcmiscproto.h>
#include "miext/extinit_priv.h"
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include "swaprep.h"
#include <X11/extensions/xcmiscproto.h>
#include "extinit_priv.h"
#include <stdint.h>
static int
ProcXCMiscGetVersion(ClientPtr client)
@ -144,30 +145,18 @@ static int _X_COLD
SProcXCMiscGetVersion(ClientPtr client)
{
REQUEST(xXCMiscGetVersionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion);
return ProcXCMiscGetVersion(client);
}
static int _X_COLD
SProcXCMiscGetXIDRange(ClientPtr client)
{
REQUEST(xReq);
swaps(&stuff->length);
return ProcXCMiscGetXIDRange(client);
}
static int _X_COLD
SProcXCMiscGetXIDList(ClientPtr client)
{
REQUEST(xXCMiscGetXIDListReq);
REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
swaps(&stuff->length);
swapl(&stuff->count);
return ProcXCMiscGetXIDList(client);
}
@ -180,7 +169,7 @@ SProcXCMiscDispatch(ClientPtr client)
case X_XCMiscGetVersion:
return SProcXCMiscGetVersion(client);
case X_XCMiscGetXIDRange:
return SProcXCMiscGetXIDRange(client);
return ProcXCMiscGetXIDRange(client);
case X_XCMiscGetXIDList:
return SProcXCMiscGetXIDList(client);
default:

View File

@ -41,10 +41,6 @@
#ifdef SVR4
#include <sys/sysmacros.h>
#endif
#if defined(__CYGWIN__)
#include <sys/param.h>
#include <sys/sysmacros.h>
#endif
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/stat.h>
@ -58,17 +54,20 @@
#include <X11/Xproto.h>
#include <X11/extensions/xf86bigfproto.h>
#include "miext/extinit_priv.h"
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
#include "gcstruct.h"
#include "dixfontstr.h"
#include "extnsionst.h"
#include "extinit.h"
#include "protocol-versions.h"
#include "xf86bigfontsrv.h"
Bool noXFree86BigfontExtension = FALSE;
static void XF86BigfontResetProc(ExtensionEntry *extEntry );
#ifdef MITSHM
@ -85,7 +84,7 @@ static unsigned int pagesize;
static Bool badSysCall = FALSE;
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__)
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
static void
SigSysHandler(int signo)
@ -264,13 +263,11 @@ XF86BigfontResetProc(ExtensionEntry * extEntry)
static int
ProcXF86BigfontQueryVersion(ClientPtr client)
{
xXF86BigfontQueryVersionReply reply;
REQUEST_SIZE_MATCH(xXF86BigfontQueryVersionReq);
reply = (xXF86BigfontQueryVersionReply) {
xXF86BigfontQueryVersionReply reply = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION,
.minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION,
.uid = geteuid(),
@ -279,9 +276,6 @@ ProcXF86BigfontQueryVersion(ClientPtr client)
.signature = signature,
.capabilities = (client->local && !client->swapped)
? XF86Bigfont_CAP_LocalShm : 0
#else
.signature = 0,
.capabilities = 0
#endif
};
if (client->swapped) {
@ -652,8 +646,6 @@ static int _X_COLD
SProcXF86BigfontQueryVersion(ClientPtr client)
{
REQUEST(xXF86BigfontQueryVersionReq);
swaps(&stuff->length);
return ProcXF86BigfontQueryVersion(client);
}
@ -661,8 +653,6 @@ static int _X_COLD
SProcXF86BigfontQueryFont(ClientPtr client)
{
REQUEST(xXF86BigfontQueryFontReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
swapl(&stuff->id);
return ProcXF86BigfontQueryFont(client);
@ -714,7 +704,7 @@ XFree86BigfontExtensionInit(void)
FontShmdescIndex = xfont2_allocate_font_private_index();
#if !defined(CSRG_BASED) && !defined(__CYGWIN__)
#if !defined(CSRG_BASED)
pagesize = SHMLBA;
#else
#ifdef _SC_PAGESIZE

View File

@ -13,6 +13,7 @@
#include "dix/registry_priv.h"
#include "os/client_priv.h"
#include "miext/extinit_priv.h"
#include "misc.h"
#include "os.h"
@ -22,11 +23,9 @@
#include "pixmapstr.h"
#include "windowstr.h"
#include "gcstruct.h"
#include "extinit_priv.h"
#include "protocol-versions.h"
#include "list.h"
#include "misc.h"
#include <string.h>
#include "hashtable.h"
#include "picturestr.h"
@ -34,6 +33,8 @@
#include "compint.h"
#endif
Bool noResExtension = FALSE;
/** @brief Holds fragments of responses for ConstructClientIds.
*
* note: there is no consideration for data alignment */
@ -111,21 +112,6 @@ AddFragment(struct xorg_list *frags, int bytes)
}
}
/** @brief Sends all fragments in the list to the client. Does not
free anything.
@param client The client to send the fragments to
@param frags The head of the list of fragments
*/
static void
WriteFragmentsToClient(ClientPtr client, struct xorg_list *frags)
{
FragmentList *it;
xorg_list_for_each_entry(it, frags, l) {
WriteToClient(client, it->bytes, (char*) it + sizeof(*it));
}
}
/** @brief Frees a list of fragments. Does not free() root node.
@param frags The head of the list of fragments
@ -193,16 +179,15 @@ DestroyConstructResourceBytesCtx(ConstructResourceBytesCtx *ctx)
static int
ProcXResQueryVersion(ClientPtr client)
{
REQUEST_SIZE_MATCH(xXResQueryVersionReq);
xXResQueryVersionReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.server_major = SERVER_XRES_MAJOR_VERSION,
.server_minor = SERVER_XRES_MINOR_VERSION
};
REQUEST_SIZE_MATCH(xXResQueryVersionReq);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@ -216,16 +201,12 @@ ProcXResQueryVersion(ClientPtr client)
static int
ProcXResQueryClients(ClientPtr client)
{
/* REQUEST(xXResQueryClientsReq); */
xXResQueryClientsReply rep;
int *current_clients;
int i, num_clients;
int i, num_clients = 0;
REQUEST_SIZE_MATCH(xXResQueryClientsReq);
current_clients = xallocarray(currentMaxClients, sizeof(int));
int current_clients[currentMaxClients];
num_clients = 0;
for (i = 0; i < currentMaxClients; i++) {
if (clients[i]) {
current_clients[num_clients] = i;
@ -233,7 +214,7 @@ ProcXResQueryClients(ClientPtr client)
}
}
rep = (xXResQueryClientsReply) {
xXResQueryClientsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(num_clients * sz_xXResClient),
@ -246,22 +227,21 @@ ProcXResQueryClients(ClientPtr client)
}
WriteToClient(client, sizeof(xXResQueryClientsReply), &rep);
if (num_clients) {
xXResClient scratch;
xXResClient scratch[num_clients];
if (num_clients) {
for (i = 0; i < num_clients; i++) {
scratch.resource_base = clients[current_clients[i]]->clientAsMask;
scratch.resource_mask = RESOURCE_ID_MASK;
scratch[i].resource_base = clients[current_clients[i]]->clientAsMask;
scratch[i].resource_mask = RESOURCE_ID_MASK;
if (client->swapped) {
swapl(&scratch.resource_base);
swapl(&scratch.resource_mask);
swapl(&scratch[i].resource_base);
swapl(&scratch[i].resource_mask);
}
WriteToClient(client, sz_xXResClient, &scratch);
}
}
free(current_clients);
WriteToClient(client, sizeof(scratch), scratch);
return Success;
}
@ -296,12 +276,10 @@ static int
ProcXResQueryClientResources(ClientPtr client)
{
REQUEST(xXResQueryClientResourcesReq);
xXResQueryClientResourcesReply rep;
int i, clientID, num_types;
int *counts;
REQUEST_SIZE_MATCH(xXResQueryClientResourcesReq);
int i, clientID, num_types = 0;
clientID = CLIENT_ID(stuff->xid);
if ((clientID >= currentMaxClients) || !clients[clientID]) {
@ -309,18 +287,21 @@ ProcXResQueryClientResources(ClientPtr client)
return BadValue;
}
counts = calloc(lastResourceType + 1, sizeof(int));
int counts[lastResourceType + 1];
memset(counts, 0, sizeof(counts));
FindAllClientResources(clients[clientID], ResFindAllRes, counts);
num_types = 0;
int cnt[lastResourceType + 1];
for (i = 0; i <= lastResourceType; i++) {
if (counts[i])
if (counts[i]) {
cnt[num_types] = counts[i];
num_types++;
}
}
rep = (xXResQueryClientResourcesReply) {
xXResQueryClientResourcesReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(num_types * sz_xXResType),
@ -332,28 +313,20 @@ ProcXResQueryClientResources(ClientPtr client)
swapl(&rep.num_types);
}
WriteToClient(client, sizeof(xXResQueryClientResourcesReply), &rep);
xXResType scratch[num_types];
if (num_types) {
xXResType scratch;
for (i = 0; i < num_types; i++) {
scratch[i].resource_type = resourceTypeAtom(i + 1);
scratch[i].count = cnt[i];
for (i = 0; i < lastResourceType; i++) {
if (!counts[i])
continue;
scratch.resource_type = resourceTypeAtom(i + 1);
scratch.count = counts[i];
if (client->swapped) {
swapl(&scratch.resource_type);
swapl(&scratch.count);
}
WriteToClient(client, sz_xXResType, &scratch);
if (client->swapped) {
swapl(&scratch[i].resource_type);
swapl(&scratch[i].count);
}
}
free(counts);
WriteToClient(client, sizeof(xXResQueryClientResourcesReply), &rep);
WriteToClient(client, sizeof(scratch), scratch);
return Success;
}
@ -372,12 +345,11 @@ static int
ProcXResQueryClientPixmapBytes(ClientPtr client)
{
REQUEST(xXResQueryClientPixmapBytesReq);
xXResQueryClientPixmapBytesReply rep;
int clientID;
unsigned long bytes;
REQUEST_SIZE_MATCH(xXResQueryClientPixmapBytesReq);
int clientID;
unsigned long bytes = 0;
clientID = CLIENT_ID(stuff->xid);
if ((clientID >= currentMaxClients) || !clients[clientID]) {
@ -385,20 +357,15 @@ ProcXResQueryClientPixmapBytes(ClientPtr client)
return BadValue;
}
bytes = 0;
FindAllClientResources(clients[clientID], ResFindResourcePixmaps,
(void *) (&bytes));
rep = (xXResQueryClientPixmapBytesReply) {
xXResQueryClientPixmapBytesReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.bytes = bytes,
#ifdef _XSERVER64
.bytes_overflow = bytes >> 32
#else
.bytes_overflow = 0
#endif
};
if (client->swapped) {
@ -457,9 +424,10 @@ static Bool
ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
ConstructClientIdCtx *ctx)
{
xXResClientIdValue rep;
xXResClientIdValue rep = {
.spec.client = client->clientAsMask,
};
rep.spec.client = client->clientAsMask;
if (client->swapped) {
swapl (&rep.spec.client);
}
@ -471,7 +439,6 @@ ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
}
rep.spec.mask = X_XResClientXIDMask;
rep.length = 0;
if (sendClient->swapped) {
swapl (&rep.spec.mask);
/* swapl (&rep.length, n); - not required for rep.length = 0 */
@ -500,9 +467,6 @@ ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
if (sendClient->swapped) {
swapl (&rep.spec.mask);
swapl (&rep.length);
}
if (sendClient->swapped) {
swapl (value);
}
memcpy(ptr, &rep, sizeof(rep));
@ -585,15 +549,26 @@ ProcXResQueryClientIds (ClientPtr client)
rc = ConstructClientIds(client, stuff->numSpecs, specs, &ctx);
if (rc == Success) {
xXResQueryClientIdsReply rep = {
char *buf = calloc(1, ctx.resultBytes);
if (!buf) {
rc = BadAlloc;
goto out;
}
char *walk = buf;
FragmentList *it;
xorg_list_for_each_entry(it, &ctx.response, l) {
memcpy(walk, FRAGMENT_DATA(it), it->bytes);
walk += it->bytes;
}
xXResQueryClientIdsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(ctx.resultBytes),
.numIds = ctx.numIds
};
assert((ctx.resultBytes & 3) == 0);
if (client->swapped) {
swaps (&rep.sequenceNumber);
swapl (&rep.length);
@ -601,9 +576,11 @@ ProcXResQueryClientIds (ClientPtr client)
}
WriteToClient(client, sizeof(rep), &rep);
WriteFragmentsToClient(client, &ctx.response);
WriteToClient(client, ctx.resultBytes, buf);
free(buf);
}
out:
DestroyConstructClientIdCtx(&ctx);
return rc;
@ -950,11 +927,11 @@ static int
ProcXResQueryResourceBytes (ClientPtr client)
{
REQUEST(xXResQueryResourceBytesReq);
REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
int rc;
ConstructResourceBytesCtx ctx;
REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
if (stuff->numSpecs > UINT32_MAX / sizeof(ctx.specs[0]))
return BadLength;
REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq,
@ -985,10 +962,24 @@ ProcXResQueryResourceBytes (ClientPtr client)
SwapXResQueryResourceBytes(&ctx.response);
}
char *buf = calloc(1, ctx.resultBytes);
if (!buf) {
rc = BadAlloc;
goto out;
}
char *walk = buf;
FragmentList *it;
xorg_list_for_each_entry(it, &ctx.response, l) {
memcpy(walk, FRAGMENT_DATA(it), it->bytes);
walk += it->bytes;
}
WriteToClient(client, sizeof(rep), &rep);
WriteFragmentsToClient(client, &ctx.response);
WriteToClient(client, ctx.resultBytes, buf);
free(buf);
}
out:
DestroyConstructResourceBytesCtx(&ctx);
return rc;
@ -1078,7 +1069,6 @@ static int _X_COLD
SProcResDispatch (ClientPtr client)
{
REQUEST(xReq);
swaps(&stuff->length);
switch (stuff->data) {
case X_XResQueryVersion:

View File

@ -21,13 +21,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "dix/dix_priv.h"
#include "dix/property_priv.h"
#include "dix/selection_priv.h"
#include "miext/extinit_priv.h"
#include "selection.h"
#include "inputstr.h"
#include "windowstr.h"
#include "propertyst.h"
#include "extnsionst.h"
#include "extinit_priv.h"
#include "xselinuxint.h"
#define CTX_DEV offsetof(SELinuxSubjectRec, dev_create_sid)
@ -625,8 +625,6 @@ SProcSELinuxDispatch(ClientPtr client)
{
REQUEST(xReq);
swaps(&stuff->length);
switch (stuff->data) {
case X_SELinuxQueryVersion:
return SProcSELinuxQueryVersion(client);

View File

@ -33,9 +33,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <X11/Xfuncproto.h>
#include "dix/registry_priv.h"
#include "dix/selection_priv.h"
#include "os/client_priv.h"
#include "selection.h"
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"

View File

@ -38,6 +38,7 @@
#include "dix/input_priv.h"
#include "dix/dix_priv.h"
#include "dix/exevents_priv.h"
#include "miext/extinit_priv.h"
#include "os/osdep.h"
#include "misc.h"
@ -57,7 +58,8 @@
#include "xserver-properties.h"
#include "eventstr.h"
#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
@ -77,10 +79,10 @@ static InternalEvent *xtest_evlist;
*/
DeviceIntPtr xtestpointer, xtestkeyboard;
#ifdef PANORAMIX
#ifdef XINERAMA
#include "panoramiX.h"
#include "panoramiXsrv.h"
#endif
#endif /* XINERAMA */
static int XTestSwapFakeInput(ClientPtr /* client */ ,
xReq * /* req */
@ -196,7 +198,7 @@ ProcXTestFakeInput(ClientPtr client)
int flags = 0;
int need_ptr_update = 1;
nev = (stuff->length << 2) - sizeof(xReq);
nev = (client->req_len << 2) - sizeof(xReq);
if ((nev % sizeof(xEvent)) || !nev)
return BadLength;
nev /= sizeof(xEvent);
@ -372,7 +374,6 @@ ProcXTestFakeInput(ClientPtr client)
/* swap the request back so we can simply re-execute it */
if (client->swapped) {
(void) XTestSwapFakeInput(client, (xReq *) stuff);
swaps(&stuff->length);
}
ResetCurrentRequest(client);
client->sequence--;
@ -486,8 +487,6 @@ static int _X_COLD
SProcXTestGetVersion(ClientPtr client)
{
REQUEST(xXTestGetVersionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
swaps(&stuff->minorVersion);
return ProcXTestGetVersion(client);
@ -497,8 +496,6 @@ static int _X_COLD
SProcXTestCompareCursor(ClientPtr client)
{
REQUEST(xXTestCompareCursorReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
swapl(&stuff->window);
swapl(&stuff->cursor);
@ -513,7 +510,7 @@ XTestSwapFakeInput(ClientPtr client, xReq * req)
xEvent sev;
EventSwapPtr proc;
nev = ((req->length << 2) - sizeof(xReq)) / sizeof(xEvent);
nev = ((client->req_len << 2) - sizeof(xReq)) / sizeof(xEvent);
for (ev = (xEvent *) &req[1]; --nev >= 0; ev++) {
int evtype = ev->u.u.type & 0177;
/* Swap event */
@ -536,23 +533,12 @@ SProcXTestFakeInput(ClientPtr client)
REQUEST(xReq);
swaps(&stuff->length);
n = XTestSwapFakeInput(client, stuff);
if (n != Success)
return n;
return ProcXTestFakeInput(client);
}
static int _X_COLD
SProcXTestGrabControl(ClientPtr client)
{
REQUEST(xXTestGrabControlReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXTestGrabControlReq);
return ProcXTestGrabControl(client);
}
static int _X_COLD
SProcXTestDispatch(ClientPtr client)
{
@ -565,7 +551,7 @@ SProcXTestDispatch(ClientPtr client)
case X_XTestFakeInput:
return SProcXTestFakeInput(client);
case X_XTestGrabControl:
return SProcXTestGrabControl(client);
return ProcXTestGrabControl(client);
default:
return BadRequest;
}

View File

@ -48,12 +48,12 @@ SOFTWARE.
#include "xvdisp.h"
#ifdef PANORAMIX
#ifdef XINERAMA
#include "panoramiX.h"
#include "panoramiXsrv.h"
unsigned long XvXRTPort;
#endif
#endif /* XINERAMA */
static int
SWriteQueryExtensionReply(ClientPtr client, xvQueryExtensionReply * rep)
@ -321,7 +321,6 @@ ProcXvQueryAdaptors(ClientPtr client)
{
xvFormat format;
xvAdaptorInfo ainfo;
xvQueryAdaptorsReply rep;
int totalSize, na, nf, rc;
int nameSize;
XvAdaptorPtr pa;
@ -337,27 +336,20 @@ ProcXvQueryAdaptors(ClientPtr client)
if (rc != Success)
return rc;
xvQueryAdaptorsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
};
pScreen = pWin->drawable.pScreen;
pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
XvGetScreenKey());
if (!pxvs) {
rep = (xvQueryAdaptorsReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.num_adaptors = 0
};
_WriteQueryAdaptorsReply(client, &rep);
return Success;
}
rep = (xvQueryAdaptorsReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.num_adaptors = pxvs->nAdaptors
};
rep.num_adaptors = pxvs->nAdaptors;
/* CALCULATE THE TOTAL SIZE OF THE REPLY IN BYTES */
@ -411,7 +403,6 @@ static int
ProcXvQueryEncodings(ClientPtr client)
{
xvEncodingInfo einfo;
xvQueryEncodingsReply rep;
int totalSize;
int nameSize;
XvPortPtr pPort;
@ -423,12 +414,6 @@ ProcXvQueryEncodings(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
rep = (xvQueryEncodingsReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.num_encodings = pPort->pAdaptor->nEncodings
};
/* FOR EACH ENCODING ADD UP THE BYTES FOR ENCODING NAMES */
ne = pPort->pAdaptor->nEncodings;
@ -439,7 +424,12 @@ ProcXvQueryEncodings(ClientPtr client)
pe++;
}
rep.length = bytes_to_int32(totalSize);
xvQueryEncodingsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.num_encodings = pPort->pAdaptor->nEncodings,
.length = bytes_to_int32(totalSize),
};
_WriteQueryEncodingsReply(client, &rep);
@ -461,7 +451,7 @@ ProcXvQueryEncodings(ClientPtr client)
}
static int
ProcXvPutVideo(ClientPtr client)
SingleXvPutVideo(ClientPtr client)
{
DrawablePtr pDraw;
XvPortPtr pPort;
@ -490,8 +480,20 @@ ProcXvPutVideo(ClientPtr client)
stuff->drw_w, stuff->drw_h);
}
static int XineramaXvPutVideo(ClientPtr client);
static int
ProcXvPutStill(ClientPtr client)
ProcXvPutVideo(ClientPtr client)
{
#ifdef XINERAMA
if (xvUseXinerama)
return XineramaXvPutVideo(client);
#endif
return SingleXvPutVideo(client);
}
static int
SingleXvPutStill(ClientPtr client)
{
DrawablePtr pDraw;
XvPortPtr pPort;
@ -520,6 +522,18 @@ ProcXvPutStill(ClientPtr client)
stuff->drw_w, stuff->drw_h);
}
static int XineramaXvPutStill(ClientPtr client);
static int
ProcXvPutStill(ClientPtr client)
{
#ifdef XINERAMA
if (xvUseXinerama)
return XineramaXvPutStill(client);
#endif
return SingleXvPutStill(client);
}
static int
ProcXvGetVideo(ClientPtr client)
{
@ -615,7 +629,6 @@ ProcXvGrabPort(ClientPtr client)
{
int result, status;
XvPortPtr pPort;
xvGrabPortReply rep;
REQUEST(xvGrabPortReq);
REQUEST_SIZE_MATCH(xvGrabPortReq);
@ -627,10 +640,9 @@ ProcXvGrabPort(ClientPtr client)
if (status != Success) {
return status;
}
rep = (xvGrabPortReply) {
xvGrabPortReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.result = result
};
@ -653,7 +665,7 @@ ProcXvUngrabPort(ClientPtr client)
}
static int
ProcXvStopVideo(ClientPtr client)
SingleXvStopVideo(ClientPtr client)
{
int ret;
DrawablePtr pDraw;
@ -671,8 +683,20 @@ ProcXvStopVideo(ClientPtr client)
return XvdiStopVideo(client, pPort, pDraw);
}
static int XineramaXvStopVideo(ClientPtr client);
static int
ProcXvSetPortAttribute(ClientPtr client)
ProcXvStopVideo(ClientPtr client)
{
#ifdef XINERAMA
if (xvUseXinerama)
return XineramaXvStopVideo(client);
#endif
return SingleXvStopVideo(client);
}
static int
SingleXvSetPortAttribute(ClientPtr client)
{
int status;
XvPortPtr pPort;
@ -698,13 +722,24 @@ ProcXvSetPortAttribute(ClientPtr client)
return status;
}
static int XineramaXvSetPortAttribute(ClientPtr client);
static int
ProcXvSetPortAttribute(ClientPtr client)
{
#ifdef XINERAMA
if (xvUseXinerama)
return XineramaXvSetPortAttribute(client);
#endif
return SingleXvSetPortAttribute(client);
}
static int
ProcXvGetPortAttribute(ClientPtr client)
{
INT32 value;
int status;
XvPortPtr pPort;
xvGetPortAttributeReply rep;
REQUEST(xvGetPortAttributeReq);
REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
@ -722,10 +757,9 @@ ProcXvGetPortAttribute(ClientPtr client)
return status;
}
rep = (xvGetPortAttributeReply) {
xvGetPortAttributeReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.value = value
};
@ -739,7 +773,6 @@ ProcXvQueryBestSize(ClientPtr client)
{
unsigned int actual_width, actual_height;
XvPortPtr pPort;
xvQueryBestSizeReply rep;
REQUEST(xvQueryBestSizeReq);
REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
@ -751,10 +784,9 @@ ProcXvQueryBestSize(ClientPtr client)
stuff->drw_w, stuff->drw_h,
&actual_width, &actual_height);
rep = (xvQueryBestSizeReply) {
xvQueryBestSizeReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.actual_width = actual_width,
.actual_height = actual_height
};
@ -770,7 +802,6 @@ ProcXvQueryPortAttributes(ClientPtr client)
int size, i;
XvPortPtr pPort;
XvAttributePtr pAtt;
xvQueryPortAttributesReply rep;
xvAttributeInfo Info;
REQUEST(xvQueryPortAttributesReq);
@ -778,11 +809,10 @@ ProcXvQueryPortAttributes(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess);
rep = (xvQueryPortAttributesReply) {
xvQueryPortAttributesReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.num_attributes = pPort->pAdaptor->nAttributes,
.text_size = 0
};
for (i = 0, pAtt = pPort->pAdaptor->pAttributes;
@ -813,7 +843,7 @@ ProcXvQueryPortAttributes(ClientPtr client)
}
static int
ProcXvPutImage(ClientPtr client)
SingleXvPutImage(ClientPtr client)
{
DrawablePtr pDraw;
XvPortPtr pPort;
@ -869,10 +899,23 @@ ProcXvPutImage(ClientPtr client)
stuff->width, stuff->height);
}
static int
XineramaXvPutImage(ClientPtr client);
static int
ProcXvPutImage(ClientPtr client)
{
#ifdef XINERAMA
if (xvUseXinerama)
return XineramaXvPutImage(client);
#endif
return SingleXvPutImage(client);
}
#ifdef MITSHM
static int
ProcXvShmPutImage(ClientPtr client)
SingleXvShmPutImage(ClientPtr client)
{
ShmDescPtr shmdesc;
DrawablePtr pDraw;
@ -945,13 +988,24 @@ ProcXvShmPutImage(ClientPtr client)
return status;
}
#else /* !MITSHM */
static int XineramaXvShmPutImage(ClientPtr client);
#endif /* MITSHM */
static int
ProcXvShmPutImage(ClientPtr client)
{
return BadImplementation;
}
#ifdef MITSHM
#ifdef XINERAMA
if (xvUseXinerama)
return XineramaXvShmPutImage(client);
#endif
return SingleXvShmPutImage(client);
#else
return BadImplementation;
#endif
}
#ifdef XvMCExtension
#include "xvmcext.h"
@ -1029,7 +1083,6 @@ ProcXvListImageFormats(ClientPtr client)
XvPortPtr pPort;
XvImagePtr pImage;
int i;
xvListImageFormatsReply rep;
xvImageFormatInfo info;
REQUEST(xvListImageFormatsReq);
@ -1038,7 +1091,7 @@ ProcXvListImageFormats(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
rep = (xvListImageFormatsReply) {
xvListImageFormatsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.num_formats = pPort->pAdaptor->nImages,
@ -1079,26 +1132,6 @@ ProcXvListImageFormats(ClientPtr client)
return Success;
}
static int (*XvProcVector[xvNumRequests]) (ClientPtr) = {
ProcXvQueryExtension,
ProcXvQueryAdaptors,
ProcXvQueryEncodings,
ProcXvGrabPort,
ProcXvUngrabPort,
ProcXvPutVideo,
ProcXvPutStill,
ProcXvGetVideo,
ProcXvGetStill,
ProcXvStopVideo,
ProcXvSelectVideoNotify,
ProcXvSelectPortNotify,
ProcXvQueryBestSize,
ProcXvSetPortAttribute,
ProcXvGetPortAttribute,
ProcXvQueryPortAttributes,
ProcXvListImageFormats,
ProcXvQueryImageAttributes, ProcXvPutImage, ProcXvShmPutImage,};
int
ProcXvDispatch(ClientPtr client)
{
@ -1106,32 +1139,61 @@ ProcXvDispatch(ClientPtr client)
UpdateCurrentTime();
if (stuff->data >= xvNumRequests) {
return BadRequest;
switch (stuff->data) {
case xv_QueryExtension:
return ProcXvQueryExtension(client);
case xv_QueryAdaptors:
return ProcXvQueryAdaptors(client);
case xv_QueryEncodings:
return ProcXvQueryEncodings(client);
case xv_GrabPort:
return ProcXvGrabPort(client);
case xv_UngrabPort:
return ProcXvUngrabPort(client);
case xv_PutVideo:
return ProcXvPutVideo(client);
case xv_PutStill:
return ProcXvPutStill(client);
case xv_GetVideo:
return ProcXvGetVideo(client);
case xv_GetStill:
return ProcXvGetStill(client);
case xv_StopVideo:
return ProcXvStopVideo(client);
case xv_SelectVideoNotify:
return ProcXvSelectVideoNotify(client);
case xv_SelectPortNotify:
return ProcXvSelectPortNotify(client);
case xv_QueryBestSize:
return ProcXvQueryBestSize(client);
case xv_SetPortAttribute:
return ProcXvSetPortAttribute(client);
case xv_GetPortAttribute:
return ProcXvGetPortAttribute(client);
case xv_QueryPortAttributes:
return ProcXvQueryPortAttributes(client);
case xv_ListImageFormats:
return ProcXvListImageFormats(client);
case xv_QueryImageAttributes:
return ProcXvQueryImageAttributes(client);
case xv_PutImage:
return ProcXvPutImage(client);
case xv_ShmPutImage:
return ProcXvShmPutImage(client);
default:
return BadRequest;
}
return XvProcVector[stuff->data] (client);
}
/* Swapped Procs */
static int _X_COLD
SProcXvQueryExtension(ClientPtr client)
{
REQUEST(xvQueryExtensionReq);
REQUEST_SIZE_MATCH(xvQueryExtensionReq);
swaps(&stuff->length);
return XvProcVector[xv_QueryExtension] (client);
}
static int _X_COLD
SProcXvQueryAdaptors(ClientPtr client)
{
REQUEST(xvQueryAdaptorsReq);
REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
swaps(&stuff->length);
swapl(&stuff->window);
return XvProcVector[xv_QueryAdaptors] (client);
return ProcXvQueryAdaptors(client);
}
static int _X_COLD
@ -1139,9 +1201,8 @@ SProcXvQueryEncodings(ClientPtr client)
{
REQUEST(xvQueryEncodingsReq);
REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
swaps(&stuff->length);
swapl(&stuff->port);
return XvProcVector[xv_QueryEncodings] (client);
return ProcXvQueryEncodings(client);
}
static int _X_COLD
@ -1149,10 +1210,9 @@ SProcXvGrabPort(ClientPtr client)
{
REQUEST(xvGrabPortReq);
REQUEST_SIZE_MATCH(xvGrabPortReq);
swaps(&stuff->length);
swapl(&stuff->port);
swapl(&stuff->time);
return XvProcVector[xv_GrabPort] (client);
return ProcXvGrabPort(client);
}
static int _X_COLD
@ -1160,10 +1220,9 @@ SProcXvUngrabPort(ClientPtr client)
{
REQUEST(xvUngrabPortReq);
REQUEST_SIZE_MATCH(xvUngrabPortReq);
swaps(&stuff->length);
swapl(&stuff->port);
swapl(&stuff->time);
return XvProcVector[xv_UngrabPort] (client);
return ProcXvUngrabPort(client);
}
static int _X_COLD
@ -1171,7 +1230,6 @@ SProcXvPutVideo(ClientPtr client)
{
REQUEST(xvPutVideoReq);
REQUEST_SIZE_MATCH(xvPutVideoReq);
swaps(&stuff->length);
swapl(&stuff->port);
swapl(&stuff->drawable);
swapl(&stuff->gc);
@ -1183,7 +1241,7 @@ SProcXvPutVideo(ClientPtr client)
swaps(&stuff->drw_y);
swaps(&stuff->drw_w);
swaps(&stuff->drw_h);
return XvProcVector[xv_PutVideo] (client);
return ProcXvPutVideo(client);
}
static int _X_COLD
@ -1191,7 +1249,6 @@ SProcXvPutStill(ClientPtr client)
{
REQUEST(xvPutStillReq);
REQUEST_SIZE_MATCH(xvPutStillReq);
swaps(&stuff->length);
swapl(&stuff->port);
swapl(&stuff->drawable);
swapl(&stuff->gc);
@ -1203,7 +1260,7 @@ SProcXvPutStill(ClientPtr client)
swaps(&stuff->drw_y);
swaps(&stuff->drw_w);
swaps(&stuff->drw_h);
return XvProcVector[xv_PutStill] (client);
return ProcXvPutStill(client);
}
static int _X_COLD
@ -1211,7 +1268,6 @@ SProcXvGetVideo(ClientPtr client)
{
REQUEST(xvGetVideoReq);
REQUEST_SIZE_MATCH(xvGetVideoReq);
swaps(&stuff->length);
swapl(&stuff->port);
swapl(&stuff->drawable);
swapl(&stuff->gc);
@ -1223,7 +1279,7 @@ SProcXvGetVideo(ClientPtr client)
swaps(&stuff->drw_y);
swaps(&stuff->drw_w);
swaps(&stuff->drw_h);
return XvProcVector[xv_GetVideo] (client);
return ProcXvGetVideo(client);
}
static int _X_COLD
@ -1231,7 +1287,6 @@ SProcXvGetStill(ClientPtr client)
{
REQUEST(xvGetStillReq);
REQUEST_SIZE_MATCH(xvGetStillReq);
swaps(&stuff->length);
swapl(&stuff->port);
swapl(&stuff->drawable);
swapl(&stuff->gc);
@ -1243,7 +1298,7 @@ SProcXvGetStill(ClientPtr client)
swaps(&stuff->drw_y);
swaps(&stuff->drw_w);
swaps(&stuff->drw_h);
return XvProcVector[xv_GetStill] (client);
return ProcXvGetStill(client);
}
static int _X_COLD
@ -1251,7 +1306,6 @@ SProcXvPutImage(ClientPtr client)
{
REQUEST(xvPutImageReq);
REQUEST_AT_LEAST_SIZE(xvPutImageReq);
swaps(&stuff->length);
swapl(&stuff->port);
swapl(&stuff->drawable);
swapl(&stuff->gc);
@ -1266,7 +1320,7 @@ SProcXvPutImage(ClientPtr client)
swaps(&stuff->drw_h);
swaps(&stuff->width);
swaps(&stuff->height);
return XvProcVector[xv_PutImage] (client);
return ProcXvPutImage(client);
}
#ifdef MITSHM
@ -1275,7 +1329,6 @@ SProcXvShmPutImage(ClientPtr client)
{
REQUEST(xvShmPutImageReq);
REQUEST_SIZE_MATCH(xvShmPutImageReq);
swaps(&stuff->length);
swapl(&stuff->port);
swapl(&stuff->drawable);
swapl(&stuff->gc);
@ -1292,7 +1345,7 @@ SProcXvShmPutImage(ClientPtr client)
swaps(&stuff->drw_h);
swaps(&stuff->width);
swaps(&stuff->height);
return XvProcVector[xv_ShmPutImage] (client);
return ProcXvShmPutImage(client);
}
#else /* MITSHM */
#define SProcXvShmPutImage ProcXvShmPutImage
@ -1303,9 +1356,8 @@ SProcXvSelectVideoNotify(ClientPtr client)
{
REQUEST(xvSelectVideoNotifyReq);
REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
swaps(&stuff->length);
swapl(&stuff->drawable);
return XvProcVector[xv_SelectVideoNotify] (client);
return ProcXvSelectVideoNotify(client);
}
static int _X_COLD
@ -1313,9 +1365,8 @@ SProcXvSelectPortNotify(ClientPtr client)
{
REQUEST(xvSelectPortNotifyReq);
REQUEST_SIZE_MATCH(xvSelectPortNotifyReq);
swaps(&stuff->length);
swapl(&stuff->port);
return XvProcVector[xv_SelectPortNotify] (client);
return ProcXvSelectPortNotify(client);
}
static int _X_COLD
@ -1323,10 +1374,9 @@ SProcXvStopVideo(ClientPtr client)
{
REQUEST(xvStopVideoReq);
REQUEST_SIZE_MATCH(xvStopVideoReq);
swaps(&stuff->length);
swapl(&stuff->port);
swapl(&stuff->drawable);
return XvProcVector[xv_StopVideo] (client);
return ProcXvStopVideo(client);
}
static int _X_COLD
@ -1334,11 +1384,10 @@ SProcXvSetPortAttribute(ClientPtr client)
{
REQUEST(xvSetPortAttributeReq);
REQUEST_SIZE_MATCH(xvSetPortAttributeReq);
swaps(&stuff->length);
swapl(&stuff->port);
swapl(&stuff->attribute);
swapl(&stuff->value);
return XvProcVector[xv_SetPortAttribute] (client);
return ProcXvSetPortAttribute(client);
}
static int _X_COLD
@ -1346,10 +1395,9 @@ SProcXvGetPortAttribute(ClientPtr client)
{
REQUEST(xvGetPortAttributeReq);
REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
swaps(&stuff->length);
swapl(&stuff->port);
swapl(&stuff->attribute);
return XvProcVector[xv_GetPortAttribute] (client);
return ProcXvGetPortAttribute(client);
}
static int _X_COLD
@ -1357,13 +1405,12 @@ SProcXvQueryBestSize(ClientPtr client)
{
REQUEST(xvQueryBestSizeReq);
REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
swaps(&stuff->length);
swapl(&stuff->port);
swaps(&stuff->vid_w);
swaps(&stuff->vid_h);
swaps(&stuff->drw_w);
swaps(&stuff->drw_h);
return XvProcVector[xv_QueryBestSize] (client);
return ProcXvQueryBestSize(client);
}
static int _X_COLD
@ -1371,9 +1418,8 @@ SProcXvQueryPortAttributes(ClientPtr client)
{
REQUEST(xvQueryPortAttributesReq);
REQUEST_SIZE_MATCH(xvQueryPortAttributesReq);
swaps(&stuff->length);
swapl(&stuff->port);
return XvProcVector[xv_QueryPortAttributes] (client);
return ProcXvQueryPortAttributes(client);
}
static int _X_COLD
@ -1381,12 +1427,11 @@ SProcXvQueryImageAttributes(ClientPtr client)
{
REQUEST(xvQueryImageAttributesReq);
REQUEST_SIZE_MATCH(xvQueryImageAttributesReq);
swaps(&stuff->length);
swapl(&stuff->port);
swapl(&stuff->id);
swaps(&stuff->width);
swaps(&stuff->height);
return XvProcVector[xv_QueryImageAttributes] (client);
return ProcXvQueryImageAttributes(client);
}
static int _X_COLD
@ -1394,31 +1439,10 @@ SProcXvListImageFormats(ClientPtr client)
{
REQUEST(xvListImageFormatsReq);
REQUEST_SIZE_MATCH(xvListImageFormatsReq);
swaps(&stuff->length);
swapl(&stuff->port);
return XvProcVector[xv_ListImageFormats] (client);
return ProcXvListImageFormats(client);
}
static int (*SXvProcVector[xvNumRequests]) (ClientPtr) = {
SProcXvQueryExtension,
SProcXvQueryAdaptors,
SProcXvQueryEncodings,
SProcXvGrabPort,
SProcXvUngrabPort,
SProcXvPutVideo,
SProcXvPutStill,
SProcXvGetVideo,
SProcXvGetStill,
SProcXvStopVideo,
SProcXvSelectVideoNotify,
SProcXvSelectPortNotify,
SProcXvQueryBestSize,
SProcXvSetPortAttribute,
SProcXvGetPortAttribute,
SProcXvQueryPortAttributes,
SProcXvListImageFormats,
SProcXvQueryImageAttributes, SProcXvPutImage, SProcXvShmPutImage,};
int _X_COLD
SProcXvDispatch(ClientPtr client)
{
@ -1426,14 +1450,53 @@ SProcXvDispatch(ClientPtr client)
UpdateCurrentTime();
if (stuff->data >= xvNumRequests) {
return BadRequest;
switch (stuff->data) {
case xv_QueryExtension:
return ProcXvQueryExtension(client);
case xv_QueryAdaptors:
return SProcXvQueryAdaptors(client);
case xv_QueryEncodings:
return SProcXvQueryEncodings(client);
case xv_GrabPort:
return SProcXvGrabPort(client);
case xv_UngrabPort:
return SProcXvUngrabPort(client);
case xv_PutVideo:
return SProcXvPutVideo(client);
case xv_PutStill:
return SProcXvPutStill(client);
case xv_GetVideo:
return SProcXvGetVideo(client);
case xv_GetStill:
return SProcXvGetStill(client);
case xv_StopVideo:
return SProcXvStopVideo(client);
case xv_SelectVideoNotify:
return SProcXvSelectVideoNotify(client);
case xv_SelectPortNotify:
return SProcXvSelectPortNotify(client);
case xv_QueryBestSize:
return SProcXvQueryBestSize(client);
case xv_SetPortAttribute:
return SProcXvSetPortAttribute(client);
case xv_GetPortAttribute:
return SProcXvGetPortAttribute(client);
case xv_QueryPortAttributes:
return SProcXvQueryPortAttributes(client);
case xv_ListImageFormats:
return SProcXvListImageFormats(client);
case xv_QueryImageAttributes:
return SProcXvQueryImageAttributes(client);
case xv_PutImage:
return SProcXvPutImage(client);
case xv_ShmPutImage:
return SProcXvShmPutImage(client);
default:
return BadRequest;
}
return SXvProcVector[stuff->data] (client);
}
#ifdef PANORAMIX
#ifdef XINERAMA
static int
XineramaXvStopVideo(ClientPtr client)
{
@ -1457,7 +1520,7 @@ XineramaXvStopVideo(ClientPtr client)
if (port->info[i].id) {
stuff->drawable = draw->info[i].id;
stuff->port = port->info[i].id;
result = ProcXvStopVideo(client);
result = SingleXvStopVideo(client);
}
}
@ -1481,7 +1544,7 @@ XineramaXvSetPortAttribute(ClientPtr client)
FOR_NSCREENS_BACKWARD(i) {
if (port->info[i].id) {
stuff->port = port->info[i].id;
result = ProcXvSetPortAttribute(client);
result = SingleXvSetPortAttribute(client);
}
}
return result;
@ -1534,14 +1597,14 @@ XineramaXvShmPutImage(ClientPtr client)
}
stuff->send_event = (send_event && !i) ? 1 : 0;
result = ProcXvShmPutImage(client);
result = SingleXvShmPutImage(client);
}
}
return result;
}
#else
#define XineramaXvShmPutImage ProcXvShmPutImage
#endif
#endif /* MITSHM */
static int
XineramaXvPutImage(ClientPtr client)
@ -1585,7 +1648,7 @@ XineramaXvPutImage(ClientPtr client)
stuff->drw_y -= screenInfo.screens[i]->y;
}
result = ProcXvPutImage(client);
result = SingleXvPutImage(client);
}
}
return result;
@ -1633,7 +1696,7 @@ XineramaXvPutVideo(ClientPtr client)
stuff->drw_y -= screenInfo.screens[i]->y;
}
result = ProcXvPutVideo(client);
result = SingleXvPutVideo(client);
}
}
return result;
@ -1681,7 +1744,7 @@ XineramaXvPutStill(ClientPtr client)
stuff->drw_y -= screenInfo.screens[i]->y;
}
result = ProcXvPutStill(client);
result = SingleXvPutStill(client);
}
}
return result;
@ -1788,25 +1851,6 @@ XineramifyXv(void)
}
}
/* munge the dispatch vector */
XvProcVector[xv_PutVideo] = XineramaXvPutVideo;
XvProcVector[xv_PutStill] = XineramaXvPutStill;
XvProcVector[xv_StopVideo] = XineramaXvStopVideo;
XvProcVector[xv_SetPortAttribute] = XineramaXvSetPortAttribute;
XvProcVector[xv_PutImage] = XineramaXvPutImage;
XvProcVector[xv_ShmPutImage] = XineramaXvShmPutImage;
}
#endif /* PANORAMIX */
void
XvResetProcVector(void)
{
#ifdef PANORAMIX
XvProcVector[xv_PutVideo] = ProcXvPutVideo;
XvProcVector[xv_PutStill] = ProcXvPutStill;
XvProcVector[xv_StopVideo] = ProcXvStopVideo;
XvProcVector[xv_SetPortAttribute] = ProcXvSetPortAttribute;
XvProcVector[xv_PutImage] = ProcXvPutImage;
XvProcVector[xv_ShmPutImage] = ProcXvShmPutImage;
#endif
xvUseXinerama = 1;
}
#endif /* XINERAMA */

View File

@ -1,2 +1,2 @@
extern void XineramifyXv(void);
extern void XvResetProcVector(void);
extern int xvUseXinerama;

View File

@ -169,6 +169,12 @@ typedef struct _XvPortRec {
DevUnion devPriv;
} XvPortRec, *XvPortPtr;
typedef struct {
int version, revision;
int nAdaptors;
XvAdaptorPtr pAdaptors;
} XvScreenRec, *XvScreenPtr;
extern _X_EXPORT int XvScreenInit(ScreenPtr);
extern _X_EXPORT DevPrivateKey XvGetScreenKey(void);
extern _X_EXPORT unsigned long XvGetRTPort(void);

View File

@ -22,15 +22,6 @@
#define _XvBadPort (XvBadPort+XvErrorBase)
typedef struct {
int version, revision;
int nAdaptors;
XvAdaptorPtr pAdaptors;
DestroyWindowProcPtr DestroyWindow;
DestroyPixmapProcPtr DestroyPixmap;
CloseScreenProcPtr CloseScreen;
} XvScreenRec, *XvScreenPtr;
typedef struct _XvPortNotifyRec {
struct _XvPortNotifyRec *next;
ClientPtr client;

View File

@ -81,6 +81,7 @@ SOFTWARE.
#include <X11/extensions/Xv.h>
#include <X11/extensions/Xvproto.h>
#include "miext/extinit_priv.h"
#include "Xext/xvdix_priv.h"
#include "misc.h"
@ -90,16 +91,15 @@ SOFTWARE.
#include "pixmapstr.h"
#include "gcstruct.h"
#include "extnsionst.h"
#include "extinit_priv.h"
#include "dixstruct.h"
#include "resource.h"
#include "opaque.h"
#include "input.h"
#ifdef PANORAMIX
#ifdef XINERAMA
#include "panoramiX.h"
#include "panoramiXsrv.h"
#endif
#endif /* XINERAMA */
#include "xvdisp.h"
#define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = ((XvScreenPtr) \
@ -128,6 +128,8 @@ int XvReqCode;
static int XvEventBase;
int XvErrorBase;
int xvUseXinerama = 0;
RESTYPE XvRTPort;
static RESTYPE XvRTEncoding;
static RESTYPE XvRTGrab;
@ -141,9 +143,7 @@ static void WriteSwappedVideoNotifyEvent(xvEvent *, xvEvent *);
static void WriteSwappedPortNotifyEvent(xvEvent *, xvEvent *);
static Bool CreateResourceTypes(void);
static Bool XvCloseScreen(ScreenPtr);
static Bool XvDestroyPixmap(PixmapPtr);
static Bool XvDestroyWindow(WindowPtr);
static void XvScreenClose(ScreenPtr, void *arg);
static void XvResetProc(ExtensionEntry *);
static int XvdiDestroyGrab(void *, XID);
static int XvdiDestroyEncoding(void *, XID);
@ -152,6 +152,7 @@ static int XvdiDestroyPortNotify(void *, XID);
static int XvdiDestroyVideoNotifyList(void *, XID);
static int XvdiDestroyPort(void *, XID);
static int XvdiSendVideoNotify(XvPortPtr, DrawablePtr, int);
static void XvStopAdaptors(DrawablePtr pDrawable);
/*
** XvExtensionInit
@ -174,9 +175,9 @@ XvExtensionInit(void)
ErrorF("XvExtensionInit: Unable to allocate resource types\n");
return;
}
#ifdef PANORAMIX
#ifdef XINERAMA
XineramaRegisterConnectionBlockCallback(XineramifyXv);
#endif
#endif /* XINERAMA */
XvScreenGeneration = serverGeneration;
}
@ -257,6 +258,16 @@ CreateResourceTypes(void)
}
static void XvWindowDestroy(ScreenPtr pScreen, WindowPtr pWin, void *arg)
{
XvStopAdaptors(&pWin->drawable);
}
static void XvPixmapDestroy(ScreenPtr pScreen, PixmapPtr pPixmap, void *arg)
{
XvStopAdaptors(&pPixmap->drawable);
}
int
XvScreenInit(ScreenPtr pScreen)
{
@ -267,9 +278,9 @@ XvScreenInit(ScreenPtr pScreen)
ErrorF("XvScreenInit: Unable to allocate resource types\n");
return BadAlloc;
}
#ifdef PANORAMIX
#ifdef XINERAMA
XineramaRegisterConnectionBlockCallback(XineramifyXv);
#endif
#endif /* XINERAMA */
XvScreenGeneration = serverGeneration;
}
@ -290,40 +301,32 @@ XvScreenInit(ScreenPtr pScreen)
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, pxvs);
pxvs->DestroyPixmap = pScreen->DestroyPixmap;
pxvs->DestroyWindow = pScreen->DestroyWindow;
pxvs->CloseScreen = pScreen->CloseScreen;
pScreen->DestroyPixmap = XvDestroyPixmap;
pScreen->DestroyWindow = XvDestroyWindow;
pScreen->CloseScreen = XvCloseScreen;
dixScreenHookWindowDestroy(pScreen, XvWindowDestroy, NULL);
dixScreenHookClose(pScreen, XvScreenClose, NULL);
dixScreenHookPixmapDestroy(pScreen, XvPixmapDestroy, NULL);
return Success;
}
static Bool
XvCloseScreen(ScreenPtr pScreen)
static void XvScreenClose(ScreenPtr pScreen, void *arg)
{
XvScreenPtr pxvs;
pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvScreenKey);
pScreen->DestroyPixmap = pxvs->DestroyPixmap;
pScreen->DestroyWindow = pxvs->DestroyWindow;
pScreen->CloseScreen = pxvs->CloseScreen;
dixScreenUnhookWindowDestroy(pScreen, XvWindowDestroy, NULL);
dixScreenUnhookClose(pScreen, XvScreenClose, NULL);
dixScreenUnhookPixmapDestroy(pScreen, XvPixmapDestroy, NULL);
free(pxvs);
dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL);
return (*pScreen->CloseScreen) (pScreen);
}
static void
XvResetProc(ExtensionEntry * extEntry)
{
XvResetProcVector();
xvUseXinerama = 0;
}
DevPrivateKey
@ -367,39 +370,6 @@ XvStopAdaptors(DrawablePtr pDrawable)
}
}
static Bool
XvDestroyPixmap(PixmapPtr pPix)
{
ScreenPtr pScreen = pPix->drawable.pScreen;
Bool status;
if (pPix->refcnt == 1)
XvStopAdaptors(&pPix->drawable);
SCREEN_PROLOGUE(pScreen, DestroyPixmap);
status = (*pScreen->DestroyPixmap) (pPix);
SCREEN_EPILOGUE(pScreen, DestroyPixmap, XvDestroyPixmap);
return status;
}
static Bool
XvDestroyWindow(WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
Bool status;
XvStopAdaptors(&pWin->drawable);
SCREEN_PROLOGUE(pScreen, DestroyWindow);
status = (*pScreen->DestroyWindow) (pWin);
SCREEN_EPILOGUE(pScreen, DestroyWindow, XvDestroyWindow);
return status;
}
static int
XvdiDestroyPort(void *pPort, XID id)
{

View File

@ -3,8 +3,13 @@
#include <string.h>
#include <X11/X.h>
#include <X11/Xfuncproto.h>
#include <X11/Xproto.h>
#include <X11/extensions/XvMC.h>
#include <X11/extensions/Xvproto.h>
#include <X11/extensions/XvMCproto.h>
#include "miext/extinit_priv.h"
#include "Xext/xvdix_priv.h"
#include "misc.h"
@ -13,14 +18,8 @@
#include "resource.h"
#include "scrnintstr.h"
#include "extnsionst.h"
#include "extinit_priv.h"
#include "servermd.h"
#include <X11/Xfuncproto.h>
#include <X11/extensions/XvMC.h>
#include <X11/extensions/Xvproto.h>
#include <X11/extensions/XvMCproto.h>
#include "xvmcext.h"
#include "protocol-versions.h"
#ifdef HAS_XVMCSHM
#include <sys/ipc.h>
@ -28,6 +27,9 @@
#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
@ -46,7 +48,6 @@ static RESTYPE XvMCRTSubpicture;
typedef struct {
int num_adaptors;
XvMCAdaptorPtr adaptors;
CloseScreenProcPtr CloseScreen;
char clientDriverName[DR_CLIENT_DRIVER_NAME_SIZE];
char busID[DR_BUSID_SIZE];
int major;
@ -731,16 +732,12 @@ XvMCExtensionInit(void)
extEntry->errorBase + XvMCBadSubpicture);
}
static Bool
XvMCCloseScreen(ScreenPtr pScreen)
static void XvMCScreenClose(ScreenPtr pScreen, void *arg)
{
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen);
pScreen->CloseScreen = pScreenPriv->CloseScreen;
free(pScreenPriv);
return (*pScreen->CloseScreen) (pScreen);
dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, NULL);
dixScreenUnhookClose(pScreen, XvMCScreenClose, NULL);
}
int
@ -756,8 +753,7 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, pScreenPriv);
pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = XvMCCloseScreen;
dixScreenHookClose(pScreen, XvMCScreenClose, NULL);
pScreenPriv->num_adaptors = num;
pScreenPriv->adaptors = pAdapt;

View File

@ -72,7 +72,6 @@ int _X_COLD
SProcXAllowDeviceEvents(ClientPtr client)
{
REQUEST(xAllowDeviceEventsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
swapl(&stuff->time);
return (ProcXAllowDeviceEvents(client));

View File

@ -76,7 +76,6 @@ SProcXChangeDeviceControl(ClientPtr client)
xDeviceCtl *ctl;
REQUEST(xChangeDeviceControlReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
swaps(&stuff->control);
ctl = (xDeviceCtl *) &stuff[1];
@ -116,7 +115,7 @@ ProcXChangeDeviceControl(ClientPtr client)
REQUEST(xChangeDeviceControlReq);
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
len = stuff->length - bytes_to_int32(sizeof(xChangeDeviceControlReq));
len = client->req_len - bytes_to_int32(sizeof(xChangeDeviceControlReq));
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success)
goto out;

View File

@ -73,7 +73,6 @@ int _X_COLD
SProcXChangeFeedbackControl(ClientPtr client)
{
REQUEST(xChangeFeedbackControlReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
swapl(&stuff->mask);
return (ProcXChangeFeedbackControl(client));
@ -436,7 +435,7 @@ ProcXChangeFeedbackControl(ClientPtr client)
REQUEST(xChangeFeedbackControlReq);
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
len = stuff->length - bytes_to_int32(sizeof(xChangeFeedbackControlReq));
len = client->req_len - bytes_to_int32(sizeof(xChangeFeedbackControlReq));
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (rc != Success)
return rc;

View File

@ -69,23 +69,6 @@ SOFTWARE.
* This procedure changes the keyboard device.
*
*/
int _X_COLD
SProcXChangeKeyboardDevice(ClientPtr client)
{
REQUEST(xChangeKeyboardDeviceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
return (ProcXChangeKeyboardDevice(client));
}
/***********************************************************************
*
* This procedure is invoked to swap the request bytes if the server and
* client have a different byte order.
*
*/
int
ProcXChangeKeyboardDevice(ClientPtr client)
{

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CHGKBD_H
#define CHGKBD_H 1
int SProcXChangeKeyboardDevice(ClientPtr /* client */
);
int ProcXChangeKeyboardDevice(ClientPtr /* client */
);

View File

@ -75,7 +75,6 @@ SProcXChangeDeviceKeyMapping(ClientPtr client)
unsigned int count;
REQUEST(xChangeDeviceKeyMappingReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
@ -106,7 +105,7 @@ ProcXChangeDeviceKeyMapping(ClientPtr client)
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success)
return ret;
len = stuff->length - bytes_to_int32(sizeof(xChangeDeviceKeyMappingReq));
len = client->req_len - bytes_to_int32(sizeof(xChangeDeviceKeyMappingReq));
ret = ChangeKeyMapping(client, dev, len, DeviceMappingNotify,
stuff->firstKeyCode, stuff->keyCodes,

View File

@ -75,7 +75,6 @@ int _X_COLD
SProcXChangeDeviceDontPropagateList(ClientPtr client)
{
REQUEST(xChangeDeviceDontPropagateListReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
swapl(&stuff->window);
swaps(&stuff->count);
@ -102,7 +101,7 @@ ProcXChangeDeviceDontPropagateList(ClientPtr client)
REQUEST(xChangeDeviceDontPropagateListReq);
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
if (stuff->length !=
if (client->req_len !=
bytes_to_int32(sizeof(xChangeDeviceDontPropagateListReq)) +
stuff->count)
return BadLength;

View File

@ -65,22 +65,6 @@ SOFTWARE.
#include "chgptr.h"
/***********************************************************************
*
* This procedure is invoked to swap the request bytes if the server and
* client have a different byte order.
*
*/
int _X_COLD
SProcXChangePointerDevice(ClientPtr client)
{
REQUEST(xChangePointerDeviceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
return (ProcXChangePointerDevice(client));
}
/***********************************************************************
*
* This procedure changes the device used as the X pointer.

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CHGPTR_H
#define CHGPTR_H 1
int SProcXChangePointerDevice(ClientPtr /* client */
);
int ProcXChangePointerDevice(ClientPtr /* client */
);

View File

@ -62,21 +62,6 @@ SOFTWARE.
#include "closedev.h"
/***********************************************************************
*
* This procedure closes an input device.
*
*/
int _X_COLD
SProcXCloseDevice(ClientPtr client)
{
REQUEST(xCloseDeviceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCloseDeviceReq);
return (ProcXCloseDevice(client));
}
/***********************************************************************
*
* Clear out event selections and passive grabs from a window for the

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CLOSEDEV_H
#define CLOSEDEV_H 1
int SProcXCloseDevice(ClientPtr /* client */
);
int ProcXCloseDevice(ClientPtr /* client */
);

View File

@ -59,21 +59,6 @@ SOFTWARE.
#include "devbell.h"
/***********************************************************************
*
* This procedure is invoked to swap the request bytes if the server and
* client have a different byte order.
*
*/
int _X_COLD
SProcXDeviceBell(ClientPtr client)
{
REQUEST(xDeviceBellReq);
swaps(&stuff->length);
return (ProcXDeviceBell(client));
}
/***********************************************************************
*
* This procedure rings a bell on an extension device.

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef DEVBELL_H
#define DEVBELL_H 1
int SProcXDeviceBell(ClientPtr /* client */
);
int ProcXDeviceBell(ClientPtr /* client */
);

View File

@ -95,6 +95,7 @@ SOFTWARE.
#include "dix/eventconvert.h"
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
#include "os/log_priv.h"
#include "inputstr.h"
#include "windowstr.h"

View File

@ -60,13 +60,13 @@ SOFTWARE.
#include "dix/dix_priv.h"
#include "dix/exevents_priv.h"
#include "miext/extinit_priv.h"
#include "inputstr.h"
#include "gcstruct.h" /* pointer for extnsionst.h */
#include "extnsionst.h" /* extension entry */
#include "geext.h" /* extension interfaces for ge */
#include "dixevents.h"
#include "extinit_priv.h"
#include "exglobals.h"
#include "swaprep.h"
#include "privates.h"
@ -252,19 +252,19 @@ static int (*ProcIVector[]) (ClientPtr) = {
/* For swapped clients */
static int (*SProcIVector[]) (ClientPtr) = {
NULL, /* 0 */
NULL, /* 0 */
SProcXGetExtensionVersion, /* 1 */
SProcXListInputDevices, /* 2 */
SProcXOpenDevice, /* 3 */
SProcXCloseDevice, /* 4 */
SProcXSetDeviceMode, /* 5 */
ProcXListInputDevices, /* 2 */
ProcXOpenDevice, /* 3 */
ProcXCloseDevice, /* 4 */
ProcXSetDeviceMode, /* 5 */
SProcXSelectExtensionEvent, /* 6 */
SProcXGetSelectedExtensionEvents, /* 7 */
SProcXChangeDeviceDontPropagateList, /* 8 */
SProcXGetDeviceDontPropagateList, /* 9 */
SProcXGetDeviceMotionEvents, /* 10 */
SProcXChangeKeyboardDevice, /* 11 */
SProcXChangePointerDevice, /* 12 */
ProcXChangeKeyboardDevice, /* 11 */
ProcXChangePointerDevice, /* 12 */
SProcXGrabDevice, /* 13 */
SProcXUngrabDevice, /* 14 */
SProcXGrabDeviceKey, /* 15 */
@ -272,30 +272,30 @@ static int (*SProcIVector[]) (ClientPtr) = {
SProcXGrabDeviceButton, /* 17 */
SProcXUngrabDeviceButton, /* 18 */
SProcXAllowDeviceEvents, /* 19 */
SProcXGetDeviceFocus, /* 20 */
ProcXGetDeviceFocus, /* 20 */
SProcXSetDeviceFocus, /* 21 */
SProcXGetFeedbackControl, /* 22 */
ProcXGetFeedbackControl, /* 22 */
SProcXChangeFeedbackControl, /* 23 */
SProcXGetDeviceKeyMapping, /* 24 */
ProcXGetDeviceKeyMapping, /* 24 */
SProcXChangeDeviceKeyMapping, /* 25 */
SProcXGetDeviceModifierMapping, /* 26 */
SProcXSetDeviceModifierMapping, /* 27 */
SProcXGetDeviceButtonMapping, /* 28 */
SProcXSetDeviceButtonMapping, /* 29 */
SProcXQueryDeviceState, /* 30 */
ProcXGetDeviceModifierMapping, /* 26 */
ProcXSetDeviceModifierMapping, /* 27 */
ProcXGetDeviceButtonMapping, /* 28 */
ProcXSetDeviceButtonMapping, /* 29 */
ProcXQueryDeviceState, /* 30 */
SProcXSendExtensionEvent, /* 31 */
SProcXDeviceBell, /* 32 */
SProcXSetDeviceValuators, /* 33 */
ProcXDeviceBell, /* 32 */
ProcXSetDeviceValuators, /* 33 */
SProcXGetDeviceControl, /* 34 */
SProcXChangeDeviceControl, /* 35 */
SProcXListDeviceProperties, /* 36 */
ProcXListDeviceProperties, /* 36 */
SProcXChangeDeviceProperty, /* 37 */
SProcXDeleteDeviceProperty, /* 38 */
SProcXGetDeviceProperty, /* 39 */
SProcXIQueryPointer, /* 40 */
SProcXIWarpPointer, /* 41 */
SProcXIChangeCursor, /* 42 */
SProcXIChangeHierarchy, /* 43 */
ProcXIChangeHierarchy, /* 43 */
SProcXISetClientPointer, /* 44 */
SProcXIGetClientPointer, /* 45 */
SProcXISelectEvents, /* 46 */

View File

@ -59,20 +59,6 @@ SOFTWARE.
#include "getbmap.h"
/***********************************************************************
*
* This procedure gets the button mapping for the specified device.
*
*/
int _X_COLD
SProcXGetDeviceButtonMapping(ClientPtr client)
{
REQUEST(xGetDeviceButtonMappingReq);
swaps(&stuff->length);
return (ProcXGetDeviceButtonMapping(client));
}
/***********************************************************************
*
* This procedure gets the button mapping for the specified device.

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETBMAP_H
#define GETBMAP_H 1
int SProcXGetDeviceButtonMapping(ClientPtr /* client */
);
int ProcXGetDeviceButtonMapping(ClientPtr /* client */
);

View File

@ -70,7 +70,6 @@ int _X_COLD
SProcXGetDeviceControl(ClientPtr client)
{
REQUEST(xGetDeviceControlReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
swaps(&stuff->control);
return (ProcXGetDeviceControl(client));

View File

@ -59,21 +59,6 @@ SOFTWARE.
#include "getfctl.h"
/***********************************************************************
*
* This procedure gets the control attributes for an extension device,
* for clients on machines with a different byte ordering than the server.
*
*/
int _X_COLD
SProcXGetFeedbackControl(ClientPtr client)
{
REQUEST(xGetFeedbackControlReq);
swaps(&stuff->length);
return (ProcXGetFeedbackControl(client));
}
/***********************************************************************
*
* This procedure copies KbdFeedbackClass data, swapping if necessary.

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETFCTL_H
#define GETFCTL_H 1
int SProcXGetFeedbackControl(ClientPtr /* client */
);
int ProcXGetFeedbackControl(ClientPtr /* client */
);

View File

@ -60,20 +60,6 @@ SOFTWARE.
#include "getfocus.h"
/***********************************************************************
*
* This procedure gets the focus for a device.
*
*/
int _X_COLD
SProcXGetDeviceFocus(ClientPtr client)
{
REQUEST(xGetDeviceFocusReq);
swaps(&stuff->length);
return (ProcXGetDeviceFocus(client));
}
/***********************************************************************
*
* This procedure gets the focus for a device.

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETFOCUS_H
#define GETFOCUS_H 1
int SProcXGetDeviceFocus(ClientPtr /* client */
);
int ProcXGetDeviceFocus(ClientPtr /* client */
);

View File

@ -62,21 +62,6 @@ SOFTWARE.
#include "getkmap.h"
/***********************************************************************
*
* This procedure gets the key mapping for an extension device,
* for clients on machines with a different byte ordering than the server.
*
*/
int _X_COLD
SProcXGetDeviceKeyMapping(ClientPtr client)
{
REQUEST(xGetDeviceKeyMappingReq);
swaps(&stuff->length);
return (ProcXGetDeviceKeyMapping(client));
}
/***********************************************************************
*
* Get the device key mapping.

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETKMAP_H
#define GETKMAP_H 1
int SProcXGetDeviceKeyMapping(ClientPtr /* client */
);
int ProcXGetDeviceKeyMapping(ClientPtr /* client */
);

View File

@ -59,21 +59,6 @@ SOFTWARE.
#include "getmmap.h"
/***********************************************************************
*
* This procedure gets the modifier mapping for an extension device,
* for clients on machines with a different byte ordering than the server.
*
*/
int _X_COLD
SProcXGetDeviceModifierMapping(ClientPtr client)
{
REQUEST(xGetDeviceModifierMappingReq);
swaps(&stuff->length);
return (ProcXGetDeviceModifierMapping(client));
}
/***********************************************************************
*
* Get the device Modifier mapping.

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETMMAP_H
#define GETMMAP_H 1
int SProcXGetDeviceModifierMapping(ClientPtr /* client */
);
int ProcXGetDeviceModifierMapping(ClientPtr /* client */
);

View File

@ -76,7 +76,6 @@ int _X_COLD
SProcXGetDeviceDontPropagateList(ClientPtr client)
{
REQUEST(xGetDeviceDontPropagateListReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
swapl(&stuff->window);
return (ProcXGetDeviceDontPropagateList(client));

View File

@ -74,7 +74,6 @@ int _X_COLD
SProcXGetSelectedExtensionEvents(ClientPtr client)
{
REQUEST(xGetSelectedExtensionEventsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
swapl(&stuff->window);
return (ProcXGetSelectedExtensionEvents(client));

View File

@ -72,7 +72,6 @@ int _X_COLD
SProcXGetExtensionVersion(ClientPtr client)
{
REQUEST(xGetExtensionVersionReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
swaps(&stuff->nbytes);
return (ProcXGetExtensionVersion(client));
@ -92,7 +91,7 @@ ProcXGetExtensionVersion(ClientPtr client)
REQUEST(xGetExtensionVersionReq);
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
if (stuff->length != bytes_to_int32(sizeof(xGetExtensionVersionReq) +
if (client->req_len != bytes_to_int32(sizeof(xGetExtensionVersionReq) +
stuff->nbytes))
return BadLength;

View File

@ -76,13 +76,13 @@ int _X_COLD
SProcXGrabDevice(ClientPtr client)
{
REQUEST(xGrabDeviceReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
swapl(&stuff->grabWindow);
swapl(&stuff->time);
swaps(&stuff->event_count);
if (stuff->length !=
if (client->req_len !=
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
return BadLength;
@ -109,7 +109,7 @@ ProcXGrabDevice(ClientPtr client)
REQUEST(xGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
if (stuff->length !=
if (client->req_len !=
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
return BadLength;

View File

@ -74,7 +74,6 @@ int _X_COLD
SProcXGrabDeviceButton(ClientPtr client)
{
REQUEST(xGrabDeviceButtonReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
swapl(&stuff->grabWindow);
swaps(&stuff->modifiers);
@ -106,7 +105,7 @@ ProcXGrabDeviceButton(ClientPtr client)
REQUEST(xGrabDeviceButtonReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
if (stuff->length !=
if (client->req_len !=
bytes_to_int32(sizeof(xGrabDeviceButtonReq)) + stuff->event_count)
return BadLength;

View File

@ -74,7 +74,6 @@ int _X_COLD
SProcXGrabDeviceKey(ClientPtr client)
{
REQUEST(xGrabDeviceKeyReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
swapl(&stuff->grabWindow);
swaps(&stuff->modifiers);
@ -104,7 +103,7 @@ ProcXGrabDeviceKey(ClientPtr client)
REQUEST(xGrabDeviceKeyReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
if (stuff->length !=
if (client->req_len !=
bytes_to_int32(sizeof(xGrabDeviceKeyReq)) + stuff->event_count)
return BadLength;

View File

@ -71,7 +71,6 @@ int _X_COLD
SProcXGetDeviceMotionEvents(ClientPtr client)
{
REQUEST(xGetDeviceMotionEventsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
swapl(&stuff->start);
swapl(&stuff->stop);

View File

@ -68,20 +68,6 @@ SOFTWARE.
#include "xkbstr.h"
#include "listdev.h"
/***********************************************************************
*
* This procedure lists the input devices available to the server.
*
*/
int _X_COLD
SProcXListInputDevices(ClientPtr client)
{
REQUEST(xListInputDevicesReq);
swaps(&stuff->length);
return (ProcXListInputDevices(client));
}
/***********************************************************************
*
* This procedure calculates the size of the information to be returned

View File

@ -32,9 +32,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define VPC 20 /* Max # valuators per chunk */
int SProcXListInputDevices(ClientPtr /* client */
);
int ProcXListInputDevices(ClientPtr /* client */
);

View File

@ -64,21 +64,6 @@ SOFTWARE.
extern CARD8 event_base[];
/***********************************************************************
*
* This procedure swaps the request if the server and client have different
* byte orderings.
*
*/
int _X_COLD
SProcXOpenDevice(ClientPtr client)
{
REQUEST(xOpenDeviceReq);
swaps(&stuff->length);
return (ProcXOpenDevice(client));
}
/***********************************************************************
*
* This procedure causes the server to open an input device.

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef OPENDEV_H
#define OPENDEV_H 1
int SProcXOpenDevice(ClientPtr /* client */
);
int ProcXOpenDevice(ClientPtr /* client */
);

View File

@ -47,20 +47,6 @@ from The Open Group.
#include "xkbstr.h"
#include "queryst.h"
/***********************************************************************
*
* This procedure allows a client to query the state of a device.
*
*/
int _X_COLD
SProcXQueryDeviceState(ClientPtr client)
{
REQUEST(xQueryDeviceStateReq);
swaps(&stuff->length);
return (ProcXQueryDeviceState(client));
}
/***********************************************************************
*
* This procedure allows frozen events to be routed.

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef QUERYST_H
#define QUERYST_H 1
int SProcXQueryDeviceState(ClientPtr /* client */
);
int ProcXQueryDeviceState(ClientPtr /* client */
);

View File

@ -121,7 +121,6 @@ int _X_COLD
SProcXSelectExtensionEvent(ClientPtr client)
{
REQUEST(xSelectExtensionEventReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
swapl(&stuff->window);
swaps(&stuff->count);
@ -148,7 +147,7 @@ ProcXSelectExtensionEvent(ClientPtr client)
REQUEST(xSelectExtensionEventReq);
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
if (stuff->length !=
if (client->req_len !=
bytes_to_int32(sizeof(xSelectExtensionEventReq)) + stuff->count)
return BadLength;

View File

@ -82,12 +82,11 @@ SProcXSendExtensionEvent(ClientPtr client)
EventSwapPtr proc;
REQUEST(xSendExtensionEventReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
swapl(&stuff->destination);
swaps(&stuff->count);
if (stuff->length !=
if (client->req_len !=
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
bytes_to_int32(stuff->num_events * sizeof(xEvent)))
return BadLength;
@ -133,7 +132,7 @@ ProcXSendExtensionEvent(ClientPtr client)
REQUEST(xSendExtensionEventReq);
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
if (stuff->length !=
if (client->req_len !=
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
(stuff->num_events * bytes_to_int32(sizeof(xEvent))))
return BadLength;

View File

@ -62,20 +62,6 @@ SOFTWARE.
#include "exglobals.h"
#include "setbmap.h"
/***********************************************************************
*
* This procedure changes the button mapping.
*
*/
int _X_COLD
SProcXSetDeviceButtonMapping(ClientPtr client)
{
REQUEST(xSetDeviceButtonMappingReq);
swaps(&stuff->length);
return (ProcXSetDeviceButtonMapping(client));
}
/***********************************************************************
*
* This procedure lists the input devices available to the server.
@ -92,7 +78,7 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
REQUEST(xSetDeviceButtonMappingReq);
REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq);
if (stuff->length !=
if (client->req_len !=
bytes_to_int32(sizeof(xSetDeviceButtonMappingReq) + stuff->map_length))
return BadLength;

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef SETBMAP_H
#define SETBMAP_H 1
int SProcXSetDeviceButtonMapping(ClientPtr /* client */
);
int ProcXSetDeviceButtonMapping(ClientPtr /* client */
);

View File

@ -62,20 +62,6 @@ SOFTWARE.
#include "exglobals.h"
#include "setdval.h"
/***********************************************************************
*
* Handle a request from a client with a different byte order.
*
*/
int _X_COLD
SProcXSetDeviceValuators(ClientPtr client)
{
REQUEST(xSetDeviceValuatorsReq);
swaps(&stuff->length);
return (ProcXSetDeviceValuators(client));
}
/***********************************************************************
*
* This procedure sets the value of valuators on an extension input device.
@ -100,7 +86,7 @@ ProcXSetDeviceValuators(ClientPtr client)
.status = Success
};
if (stuff->length != bytes_to_int32(sizeof(xSetDeviceValuatorsReq)) +
if (client->req_len != bytes_to_int32(sizeof(xSetDeviceValuatorsReq)) +
stuff->num_valuators)
return BadLength;

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef SETDVAL_H
#define SETDVAL_H 1
int SProcXSetDeviceValuators(ClientPtr /* client */
);
int ProcXSetDeviceValuators(ClientPtr /* client */
);

View File

@ -74,7 +74,6 @@ int _X_COLD
SProcXSetDeviceFocus(ClientPtr client)
{
REQUEST(xSetDeviceFocusReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
swapl(&stuff->focus);
swapl(&stuff->time);

View File

@ -63,21 +63,6 @@ SOFTWARE.
#include "exglobals.h"
#include "setmmap.h"
/***********************************************************************
*
* This procedure sets the modifier mapping for an extension device,
* for clients on machines with a different byte ordering than the server.
*
*/
int _X_COLD
SProcXSetDeviceModifierMapping(ClientPtr client)
{
REQUEST(xSetDeviceModifierMappingReq);
swaps(&stuff->length);
return (ProcXSetDeviceModifierMapping(client));
}
/***********************************************************************
*
* Set the device Modifier mapping.
@ -94,7 +79,7 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
REQUEST(xSetDeviceModifierMappingReq);
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
if (stuff->length != bytes_to_int32(sizeof(xSetDeviceModifierMappingReq)) +
if (client->req_len != bytes_to_int32(sizeof(xSetDeviceModifierMappingReq)) +
(stuff->numKeyPerModifier << 1))
return BadLength;

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef SETMMAP_H
#define SETMMAP_H 1
int SProcXSetDeviceModifierMapping(ClientPtr /* client */
);
int ProcXSetDeviceModifierMapping(ClientPtr /* client */
);

View File

@ -62,20 +62,6 @@ SOFTWARE.
#include "exglobals.h"
#include "setmode.h"
/***********************************************************************
*
* Handle a request from a client with a different byte order.
*
*/
int _X_COLD
SProcXSetDeviceMode(ClientPtr client)
{
REQUEST(xSetDeviceModeReq);
swaps(&stuff->length);
return (ProcXSetDeviceMode(client));
}
/***********************************************************************
*
* This procedure sets the mode of a device.

View File

@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef SETMODE_H
#define SETMODE_H 1
int SProcXSetDeviceMode(ClientPtr /* client */
);
int ProcXSetDeviceMode(ClientPtr /* client */
);

View File

@ -69,7 +69,6 @@ int _X_COLD
SProcXUngrabDevice(ClientPtr client)
{
REQUEST(xUngrabDeviceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
swapl(&stuff->time);
return (ProcXUngrabDevice(client));

View File

@ -77,7 +77,6 @@ int _X_COLD
SProcXUngrabDeviceButton(ClientPtr client)
{
REQUEST(xUngrabDeviceButtonReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
swapl(&stuff->grabWindow);
swaps(&stuff->modifiers);

View File

@ -79,7 +79,6 @@ int _X_COLD
SProcXUngrabDeviceKey(ClientPtr client)
{
REQUEST(xUngrabDeviceKeyReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
swapl(&stuff->grabWindow);
swaps(&stuff->modifiers);

View File

@ -51,10 +51,9 @@ SProcXIAllowEvents(ClientPtr client)
REQUEST(xXIAllowEventsReq);
REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq);
swaps(&stuff->length);
swaps(&stuff->deviceid);
swapl(&stuff->time);
if (stuff->length > 3) {
if (client->req_len > 3) {
xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq *) stuff;
REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq);

View File

@ -842,7 +842,6 @@ SProcXIBarrierReleasePointer(ClientPtr client)
REQUEST(xXIBarrierReleasePointerReq);
int i;
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXIBarrierReleasePointerReq);
swapl(&stuff->num_barriers);

View File

@ -59,7 +59,6 @@ SProcXIChangeCursor(ClientPtr client)
{
REQUEST(xXIChangeCursorReq);
REQUEST_SIZE_MATCH(xXIChangeCursorReq);
swaps(&stuff->length);
swapl(&stuff->win);
swapl(&stuff->cursor);
swaps(&stuff->deviceid);

View File

@ -128,14 +128,6 @@ XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
*
*/
int _X_COLD
SProcXIChangeHierarchy(ClientPtr client)
{
REQUEST(xXIChangeHierarchyReq);
swaps(&stuff->length);
return (ProcXIChangeHierarchy(client));
}
static int
add_master(ClientPtr client, xXIAddMasterInfo * c, int flags[MAXDEVICES])
{

View File

@ -36,7 +36,6 @@
#ifndef CHDEVHIER_H
#define CHDEVHIER_H 1
int SProcXIChangeHierarchy(ClientPtr /* client */ );
int ProcXIChangeHierarchy(ClientPtr /* client */ );
void XISendDeviceHierarchyEvent(int flags[MAXDEVICES]);

View File

@ -36,7 +36,6 @@
#include "windowstr.h" /* window structure */
#include "scrnintstr.h" /* screen structure */
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "exevents.h"
#include "exglobals.h"
#include "xigetclientpointer.h"
@ -52,7 +51,6 @@ SProcXIGetClientPointer(ClientPtr client)
REQUEST(xXIGetClientPointerReq);
REQUEST_SIZE_MATCH(xXIGetClientPointerReq);
swaps(&stuff->length);
swapl(&stuff->win);
return ProcXIGetClientPointer(client);
}

View File

@ -53,7 +53,6 @@ SProcXIGrabDevice(ClientPtr client)
*/
REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq);
swaps(&stuff->length);
swaps(&stuff->deviceid);
swapl(&stuff->grab_window);
swapl(&stuff->cursor);
@ -138,7 +137,6 @@ SProcXIUngrabDevice(ClientPtr client)
REQUEST(xXIUngrabDeviceReq);
REQUEST_SIZE_MATCH(xXIUngrabDeviceReq);
swaps(&stuff->length);
swaps(&stuff->deviceid);
swapl(&stuff->time);

View File

@ -55,7 +55,6 @@ SProcXIPassiveGrabDevice(ClientPtr client)
REQUEST(xXIPassiveGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
swaps(&stuff->length);
swaps(&stuff->deviceid);
swapl(&stuff->grab_window);
swapl(&stuff->cursor);
@ -280,7 +279,6 @@ SProcXIPassiveUngrabDevice(ClientPtr client)
REQUEST(xXIPassiveUngrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq);
swaps(&stuff->length);
swapl(&stuff->grab_window);
swaps(&stuff->deviceid);
swapl(&stuff->detail);

View File

@ -1013,23 +1013,12 @@ ProcXGetDeviceProperty(ClientPtr client)
return Success;
}
int _X_COLD
SProcXListDeviceProperties(ClientPtr client)
{
REQUEST(xListDevicePropertiesReq);
REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
swaps(&stuff->length);
return (ProcXListDeviceProperties(client));
}
int _X_COLD
SProcXChangeDeviceProperty(ClientPtr client)
{
REQUEST(xChangeDevicePropertyReq);
REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
swaps(&stuff->length);
swapl(&stuff->property);
swapl(&stuff->type);
swapl(&stuff->nUnits);
@ -1042,7 +1031,6 @@ SProcXDeleteDeviceProperty(ClientPtr client)
REQUEST(xDeleteDevicePropertyReq);
REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
swaps(&stuff->length);
swapl(&stuff->property);
return (ProcXDeleteDeviceProperty(client));
}
@ -1053,7 +1041,6 @@ SProcXGetDeviceProperty(ClientPtr client)
REQUEST(xGetDevicePropertyReq);
REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
swaps(&stuff->length);
swapl(&stuff->property);
swapl(&stuff->type);
swapl(&stuff->longOffset);
@ -1261,7 +1248,6 @@ SProcXIListProperties(ClientPtr client)
REQUEST(xXIListPropertiesReq);
REQUEST_SIZE_MATCH(xXIListPropertiesReq);
swaps(&stuff->length);
swaps(&stuff->deviceid);
return (ProcXIListProperties(client));
}
@ -1272,7 +1258,6 @@ SProcXIChangeProperty(ClientPtr client)
REQUEST(xXIChangePropertyReq);
REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
swaps(&stuff->length);
swaps(&stuff->deviceid);
swapl(&stuff->property);
swapl(&stuff->type);
@ -1286,7 +1271,6 @@ SProcXIDeleteProperty(ClientPtr client)
REQUEST(xXIDeletePropertyReq);
REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
swaps(&stuff->length);
swaps(&stuff->deviceid);
swapl(&stuff->property);
return (ProcXIDeleteProperty(client));
@ -1298,7 +1282,6 @@ SProcXIGetProperty(ClientPtr client)
REQUEST(xXIGetPropertyReq);
REQUEST_SIZE_MATCH(xXIGetPropertyReq);
swaps(&stuff->length);
swaps(&stuff->deviceid);
swapl(&stuff->property);
swapl(&stuff->type);

View File

@ -36,7 +36,6 @@ int ProcXDeleteDeviceProperty(ClientPtr client);
int ProcXGetDeviceProperty(ClientPtr client);
/* request swapping */
int SProcXListDeviceProperties(ClientPtr client);
int SProcXChangeDeviceProperty(ClientPtr client);
int SProcXDeleteDeviceProperty(ClientPtr client);
int SProcXGetDeviceProperty(ClientPtr client);

View File

@ -58,7 +58,6 @@ SProcXIQueryDevice(ClientPtr client)
REQUEST(xXIQueryDeviceReq);
REQUEST_SIZE_MATCH(xXIQueryDeviceReq);
swaps(&stuff->length);
swaps(&stuff->deviceid);
return ProcXIQueryDevice(client);

View File

@ -48,9 +48,9 @@
#include "scrnintstr.h"
#include "xkbsrv.h"
#ifdef PANORAMIX
#ifdef XINERAMA
#include "panoramiXsrv.h"
#endif
#endif /* XINERAMA */
#include "inpututils.h"
#include "xiquerypointer.h"
@ -67,7 +67,6 @@ SProcXIQueryPointer(ClientPtr client)
REQUEST(xXIQueryPointerReq);
REQUEST_SIZE_MATCH(xXIQueryPointerReq);
swaps(&stuff->length);
swaps(&stuff->deviceid);
swapl(&stuff->win);
return (ProcXIQueryPointer(client));
@ -184,7 +183,7 @@ ProcXIQueryPointer(ClientPtr client)
rep.win_y = 0;
}
#ifdef PANORAMIX
#ifdef XINERAMA
if (!noPanoramiXExtension) {
rep.root_x += double_to_fp1616(screenInfo.screens[0]->x);
rep.root_y += double_to_fp1616(screenInfo.screens[0]->y);
@ -193,7 +192,7 @@ ProcXIQueryPointer(ClientPtr client)
rep.win_y += double_to_fp1616(screenInfo.screens[0]->y);
}
}
#endif
#endif /* XINERAMA */
WriteReplyToClient(client, sizeof(xXIQueryPointerReply), &rep);
if (buttons)

View File

@ -133,7 +133,6 @@ int _X_COLD
SProcXIQueryVersion(ClientPtr client)
{
REQUEST(xXIQueryVersionReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXIQueryVersionReq);
swaps(&stuff->major_version);
swaps(&stuff->minor_version);

View File

@ -120,12 +120,11 @@ SProcXISelectEvents(ClientPtr client)
xXIEventMask *evmask;
REQUEST(xXISelectEventsReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXISelectEventsReq);
swapl(&stuff->win);
swaps(&stuff->num_masks);
len = stuff->length - bytes_to_int32(sizeof(xXISelectEventsReq));
len = client->req_len - bytes_to_int32(sizeof(xXISelectEventsReq));
evmask = (xXIEventMask *) &stuff[1];
for (i = 0; i < stuff->num_masks; i++) {
if (len < bytes_to_int32(sizeof(xXIEventMask)))
@ -172,7 +171,7 @@ ProcXISelectEvents(ClientPtr client)
while (num_masks--) {
len += sizeof(xXIEventMask) + evmask->mask_len * 4;
if (bytes_to_int32(len) > stuff->length)
if (bytes_to_int32(len) > client->req_len)
return BadLength;
if (evmask->deviceid != XIAllDevices &&
@ -298,7 +297,7 @@ ProcXISelectEvents(ClientPtr client)
evmask++;
}
if (bytes_to_int32(len) != stuff->length)
if (bytes_to_int32(len) != client->req_len)
return BadLength;
/* Set masks on window */
@ -331,7 +330,6 @@ int _X_COLD
SProcXIGetSelectedEvents(ClientPtr client)
{
REQUEST(xXIGetSelectedEventsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
swapl(&stuff->win);

View File

@ -53,7 +53,6 @@ SProcXISetClientPointer(ClientPtr client)
REQUEST(xXISetClientPointerReq);
REQUEST_SIZE_MATCH(xXISetClientPointerReq);
swaps(&stuff->length);
swapl(&stuff->win);
swaps(&stuff->deviceid);
return (ProcXISetClientPointer(client));

View File

@ -46,7 +46,6 @@ SProcXISetFocus(ClientPtr client)
REQUEST(xXISetFocusReq);
REQUEST_AT_LEAST_SIZE(xXISetFocusReq);
swaps(&stuff->length);
swaps(&stuff->deviceid);
swapl(&stuff->focus);
swapl(&stuff->time);
@ -60,7 +59,6 @@ SProcXIGetFocus(ClientPtr client)
REQUEST(xXIGetFocusReq);
REQUEST_AT_LEAST_SIZE(xXIGetFocusReq);
swaps(&stuff->length);
swaps(&stuff->deviceid);
return ProcXIGetFocus(client);

View File

@ -60,7 +60,6 @@ SProcXIWarpPointer(ClientPtr client)
REQUEST(xXIWarpPointerReq);
REQUEST_SIZE_MATCH(xXIWarpPointerReq);
swaps(&stuff->length);
swapl(&stuff->src_win);
swapl(&stuff->dst_win);
swapl(&stuff->src_x);

View File

@ -43,6 +43,8 @@
#include <dix-config.h>
#include "include/dix_pixmap.h"
#include "compint.h"
static Bool
@ -308,7 +310,7 @@ compFreeClientWindow(WindowPtr pWin, XID id)
if (pPixmap) {
compRestoreWindow(pWin, pPixmap);
(*pScreen->DestroyPixmap) (pPixmap);
dixPixmapPut(pPixmap);
}
}
@ -532,8 +534,8 @@ compNewPixmap(WindowPtr pWin, int x, int y, int w, int h)
WindowPtr pParent = pWin->parent;
PixmapPtr pPixmap;
pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth,
CREATE_PIXMAP_USAGE_BACKING_PIXMAP);
pPixmap = dixPixmapCreate(pScreen, w, h, pWin->drawable.depth,
CREATE_PIXMAP_USAGE_BACKING_PIXMAP);
if (!pPixmap)
return 0;

View File

@ -43,10 +43,13 @@
#include <dix-config.h>
#include "miext/extinit_priv.h"
#include "compint.h"
#include "xace.h"
#include "protocol-versions.h"
#include "extinit_priv.h"
Bool noCompositeExtension = FALSE;
static CARD8 CompositeReqCode;
static DevPrivateKeyRec CompositeClientPrivateKeyRec;
@ -378,8 +381,6 @@ static int _X_COLD
SProcCompositeQueryVersion(ClientPtr client)
{
REQUEST(xCompositeQueryVersionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeQueryVersionReq);
swapl(&stuff->majorVersion);
swapl(&stuff->minorVersion);
@ -390,8 +391,6 @@ static int _X_COLD
SProcCompositeRedirectWindow(ClientPtr client)
{
REQUEST(xCompositeRedirectWindowReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq);
swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
@ -401,8 +400,6 @@ static int _X_COLD
SProcCompositeRedirectSubwindows(ClientPtr client)
{
REQUEST(xCompositeRedirectSubwindowsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq);
swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
@ -412,8 +409,6 @@ static int _X_COLD
SProcCompositeUnredirectWindow(ClientPtr client)
{
REQUEST(xCompositeUnredirectWindowReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeUnredirectWindowReq);
swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
@ -423,8 +418,6 @@ static int _X_COLD
SProcCompositeUnredirectSubwindows(ClientPtr client)
{
REQUEST(xCompositeUnredirectSubwindowsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeUnredirectSubwindowsReq);
swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
@ -434,8 +427,6 @@ static int _X_COLD
SProcCompositeCreateRegionFromBorderClip(ClientPtr client)
{
REQUEST(xCompositeCreateRegionFromBorderClipReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeCreateRegionFromBorderClipReq);
swapl(&stuff->region);
swapl(&stuff->window);
@ -446,8 +437,6 @@ static int _X_COLD
SProcCompositeNameWindowPixmap(ClientPtr client)
{
REQUEST(xCompositeNameWindowPixmapReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq);
swapl(&stuff->window);
swapl(&stuff->pixmap);
@ -458,8 +447,6 @@ static int _X_COLD
SProcCompositeGetOverlayWindow(ClientPtr client)
{
REQUEST(xCompositeGetOverlayWindowReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq);
swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
@ -469,8 +456,6 @@ static int _X_COLD
SProcCompositeReleaseOverlayWindow(ClientPtr client)
{
REQUEST(xCompositeReleaseOverlayWindowReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq);
swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
@ -587,7 +572,7 @@ CompositeExtensionInit(void)
noCompositeExtension = FALSE;
}
#ifdef PANORAMIX
#ifdef XINERAMA
#include "panoramiXsrv.h"
int (*PanoramiXSaveCompositeVector[CompositeNumberRequests]) (ClientPtr);
@ -940,4 +925,4 @@ PanoramiXCompositeReset(void)
ProcCompositeVector[i] = PanoramiXSaveCompositeVector[i];
}
#endif
#endif /* XINERAMA */

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