Compare commits

...

363 Commits

Author SHA1 Message Date
Alan Coopersmith 9a6aec9bf6 dix-config.h: add HAVE_SOCKLEN_T definition
Needed to build with IPv6 disabled using gcc 14 on some platforms to avoid:

In file included from /usr/X11/include/X11/Xtrans/transport.c:67,
                 from xstrans.c:17:
/usr/X11/include/X11/Xtrans/Xtranssock.c: In function ‘_XSERVTransSocketOpen’:
/usr/X11/include/X11/Xtrans/Xtranssock.c:467:28: error: passing argument 5
 of ‘getsockopt’ from incompatible pointer type [-Wincompatible-pointer-types]
  467 |             (char *) &val, &len) == 0 && val < 64 * 1024)
      |                            ^~~~
      |                            |
      |                            size_t * {aka long unsigned int *}

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1736>
2024-10-31 16:24:41 +01:00
Matthieu Herrb 07a0acd246 xkb: Fix buffer overflow in _XkbSetCompatMap()
The _XkbSetCompatMap() function attempts to resize the `sym_interpret`
buffer.

However, It didn't update its size properly. It updated `num_si` only,
without updating `size_si`.

This may lead to local privilege escalation if the server is run as root
or remote code execution (e.g. x11 over ssh).

CVE-2024-9632, ZDI-CAN-24756

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1733>
2024-10-31 16:24:41 +01:00
Alan Coopersmith 7cc0695cf7 modesetting: avoid memory leak when ms_present_check_unflip() returns FALSE
Found by Oracle Parfait 13.3 static analyzer:
   Memory leak [memory-leak]:
      Memory leak of pointer event allocated with calloc(1, 16)
        at line 470 of hw/xfree86/drivers/modesetting/present.c in
	function 'ms_present_unflip'.
          event allocated at line 431 with calloc(1, 16)
          event leaks when ms_present_check_unflip(...) == 0 at line 438
              and i >= config->num_crtc at line 445

Fixes: 13c7d53df ("modesetting: Implement page flipping support for Present.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1730>
2024-10-31 16:24:41 +01:00
Alan Coopersmith 8fa1ac2b50 dix: limit checks to MAX_VALUATORS when generating Xi events
Previously, it was looping through sizeof(ev->valuators.mask) * 8
valuators, where valuators.mask is defined as an array of
(MAX_VALUATORS + 7) / 8 entries.  Since MAX_VALUATORS is defined as 36,
this made it actually loop through 40 entries.  The last 4 bits in this
array should never be set, so we should never access memory outside the
bounds of the arrays defined to be exactly MAX_VALUATORS in length, but
we can make the static analyzer happier and not waste time checking bits
that should never be set.

Found by Oracle Parfait 13.3 static analyzer:

   Read outside array bounds [read-outside-array-bounds]:
      In array dereference of ev->valuators.data[i] with index i
      Array size is 36 elements (of 8 bytes each), index >= 0 and index <= 39
        at line 741 of dix/eventconvert.c in function 'eventToDeviceEvent'.

   Read outside array bounds [read-outside-array-bounds]:
      In array dereference of ev->valuators.data[i] with index i
      Array size is 36 elements (of 8 bytes each), index >= 0 and index <= 39
        at line 808 of dix/eventconvert.c in function 'eventToRawEvent'.

   Read outside array bounds [read-outside-array-bounds]:
      In array dereference of ev->valuators.data_raw[i] with index i
      Array size is 36 elements (of 8 bytes each), index >= 0 and index <= 39
        at line 809 of dix/eventconvert.c in function 'eventToRawEvent'.

Fixes: b2ba77bac ("dix: add EventToXI2 and GetXI2Type.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1730>
2024-10-31 16:24:41 +01:00
Alan Coopersmith 49a8d866ed dix: fix button offset when generating DeviceButtonStateNotify events
Found by Oracle Parfait 13.3 static analyzer:
   Buffer Overflow in STD C function [buffer-overflow-call-stdc]:
      Buffer overflow in call to memcpy. Buffer &bev->buttons[4] of
       size 24 is written at an offset of 28
      Array size is 28 bytes, index is 32
        at line 743 of dix/enterleave.c in function
	 'DeliverStateNotifyEvent'.

Fixes: a85f0d6b9 ("Xi: fix use of button->down - bitflags instead of int arrays.")
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1730>
2024-10-31 16:24:41 +01:00
Alan Coopersmith 49bdf60143 render: avoid NULL pointer dereference if PictureFindVisual returns NULL
Found by Oracle Parfait 13.3:
   Null pointer dereference [null-pointer-deref]:
      Read from null pointer pVisual
        at line 257 of dix/colormap.c in function 'CreateColormap'.
          Null pointer introduced at line 412 of render/picture.c in
	   function 'PictureFindVisual'.
          Constant 'NULL' passed into function CreateColormap, argument
	   pVisual, from call at line 431 in function
	   'PictureInitIndexedFormat'.
          Function PictureFindVisual may return constant 'NULL' at
	   line 412, called at line 429.

Fixes: d4a101d4e ("Integration of DAMAGE-XFIXES branch to trunk")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1730>
2024-10-31 16:24:41 +01:00
Alan Coopersmith 284ad8e473 Xi: avoid NULL pointer dereference if GetXTestDevice returns NULL
The comments in that function say "This only happens if master is a
slave device. don't do that" but static analysis doesn't respect that.

Found by Oracle Parfait 13.3:
   Null pointer dereference [null-pointer-deref]:
      Read from null pointer XTestptr
        at line 274 of Xi/xichangehierarchy.c in function 'remove_master'.
          Null pointer introduced at line 691 of Xext/xtest.c in function
	   'GetXTestDevice'.
          Function GetXTestDevice may return constant 'NULL' at line 691,
	   called at line 273 of Xi/xichangehierarchy.c in function
	   'remove_master'.
   Null pointer dereference [null-pointer-deref]:
      Read from null pointer XTestkeybd
        at line 279 of Xi/xichangehierarchy.c in function 'remove_master'.
          Null pointer introduced at line 691 of Xext/xtest.c in function
	   'GetXTestDevice'.
          Function GetXTestDevice may return constant 'NULL' at line 691,
	   called at line 278 of Xi/xichangehierarchy.c in function
	   'remove_master'.

Fixes: 0814f511d ("input: store the master device's ID in the devPrivate for XTest devices.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1730>
2024-10-31 16:24:41 +01:00
Alan Coopersmith 1d7b5e2957 xfree86: avoid memory leak on realloc failure
Found by Oracle Parfait 13.3 static analyzer:
   Memory leak [memory-leak]:
      Memory leak of pointer optname allocated with asprintf(&optname,
      "\"%s\"", p->name)
        at line 326 of hw/xfree86/common/xf86Configure.c in function
	'configureDeviceSection'.
          optname allocated at line 309 with asprintf(&optname, "\"%s\"",
	  p->name)

Fixes: code inherited from XFree86
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1730>
2024-10-31 16:24:41 +01:00
Tj a1c43931d4 xfree86: fbdevhw: fix pci detection on recent Linux
Linux kernel v6.9 has changed the symlink to point to the parent device. This
breaks fbdev_open() detection logic. Change it to use the subsystem symlink
instead which will remain stable.

Kernel v6.8:

[    14.067] (II) fbdev_open() sysfs_path=/sys/class/graphics/fb0
[    14.067] (II) fbdev_open() buf=../../devices/platform/vesa-framebuffer.0/graphics/fb0

Kernel v6.9:

[    15.609] (II) fbdev_open() sysfs_path=/sys/class/graphics/fb0
[    15.609] (II) fbdev_open() buf=../../devices/pci0000:00/0000:00:01.0/vesa-framebuffer.0/graphics/fb0

Originally found in automated Debian ISO QA testing [0] and confirmed in Linux [1].

Tested on kernels v6.9.7 and v6.8.12

[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1075713
[1] https://lore.kernel.org/lkml/lLyvPFC_APGHNfyGNHRpQy5izBikkaTPOpHooZIT3fFAoJPquSI31ZMueA99XTdr8ysir3X7O7IMdc6za-0m79vr_claeparHhoRouVgHOI=@proton.me/

Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1714
Signed-off-by: Tj <tj.iam.tj@proton.me>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1612>
2024-10-31 16:24:41 +01:00
Enrico Weigelt, metux IT consult eb9aa7a5d2 xwin: fix memleak on freeing pixmaps
Xwin's DestroyPixmap proc just free()s the PixmapRec directly, w/o catering
for devPrivate's, so leaving a memleak. The correct DIX function for this
is FreePixmap().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1710>
2024-10-31 15:44:46 +01:00
Olivier Fourdan dfd1da4bbc os: Fix NULL pointer dereference
RemoveHost() can be called from DisableLocalHost() with a NULL client,
but doesn't actually check whether the given client pointer is valid on
error and assigns the error value unconditionally, leading to a possible
NULL pointer dereference and a crash of the Xserver.

To avoid the issue, simply check whether the client pointer is not NULL
prior to assign the errorValue.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1752
See-also: https://bugzilla.redhat.com/2313799
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1701>
2024-10-31 15:44:45 +01:00
Matthieu Herrb ef6b615aa8 Return NULL in *cmdname if the client argv or argv[0] is NULL
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/995>
2024-10-31 15:43:35 +01:00
Matthieu Herrb 609f506d3d Don't crash if the client argv or argv[0] is NULL.
Report from  bauerm at pestilenz dot org.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/995>
2024-10-31 15:43:34 +01:00
Enrico Weigelt, metux IT consult 702b1687fd Xnest XCB version 24.2.0.0
2nd release this year:

* added syslog support
* xfree86: fixed DRI crash bug (#1053, #1534)
* bunch of little cleanups and fixes
* by default only builds Xnest DDX (others still can be enabled via options)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-19 15:23:56 +02:00
Enrico Weigelt, metux IT consult 23040f3814 meson.build: change project name to xnest
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-19 15:17:54 +02:00
Enrico Weigelt, metux IT consult 8eb6c1f173 meson_options: disable all DDX'es but Xnest
This branch is specifically for just Xnest only, so disable anything else
per default. The others still can be enabled via meson options.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-19 15:17:48 +02:00
Enrico Weigelt, metux IT consult d84bca91ec 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-09-19 15:04:37 +02:00
Doug Brown 4898415c6b 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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 9747ade9b1 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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 13fcc8f4c5 (!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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 31bc28a36e 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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 1c31902425 ci: always build with drivers 2024-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult c0de503adb ci: freebsd: fix missing xcb-aux and xcb-util-wm
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 00e23cb0d6 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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 70a25209ac 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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 9d1937cd79 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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 5c96b80a8d (!1695) dix: unexport Ones()
It's not used by any module/driver, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult bbdef9336f (!1694) xvmc: unexport XvMCFindXvImage()
It's not needed by any driver, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 7bbdd50103 (!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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult c88abea2fe (!1692) Xext: xvmc: drop unused XvMCScreenInitProc
This pointer field isn't used anywhere, neither in Xorg nor in drivers.
No need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 57d6c2477a (!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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 76ad971c52 (!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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult d49410d599 (!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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 8dbd909d7b (!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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 91b6453087 (!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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 52de3c7fd2 (!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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 8ca763453a (!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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 488a97463f (!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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 0c306f780f (!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-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult d2575b30dd (!1689) pseudoramix: replace PseudoramiXTrace() and PseudoramiXDebug() by LogMessageVerb()
Since we're only going through macros (that are calling these), this extra wrapper
function isn't needed at all - using LogMessageVerb() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-19 15:03:01 +02:00
Enrico Weigelt, metux IT consult 2e74b2fde6 (!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-09-19 15:02:54 +02:00
Enrico Weigelt, metux IT consult 69bdc2c247 (!1688) os: log: add syslog support
Add support for logging to syslog.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 2d5c8090a8 (!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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 7bd3006818 (!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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult e063db8204 (!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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 86ba735482 (!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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 497e981348 (!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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 421eeec9c5 (!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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 4cd73b26c0 (!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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 54632e9049 (!1680) os: log: drop unnecessary ifdef's
The #ifdef's for log prefix defines aren't needed, so drop them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult ac503cca59 (!1679) xfre86: drop xf86Msg() in favor of LogMessageVerb()
This function is doing the same like LogMessageVerb(), so no need to keep
around a duplicate implementation. Leaving it as a macro, until all callers,
also in drivers, have been migrated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult af06dd35d7 (!1679) xfree86: drop xf86MsgVerb() in favor of LogMessageVerb()
This function is doing the same like LogMessageVerb(), so no need to keep
around a duplicate implementation. Leaving it as a macro, until all callers,
also in drivers, have been migrated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 691228d130 (!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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult f7fdaf814b (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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 77f7e06508 (submit/extDevReason) xkb: drop unused variable extDevReason
fix warning on unused variable:

> ../xkb/xkb.c:3576:18: warning: variable 'extDevReason' set but not used [-Wunused-but-set-variable]
>     unsigned int extDevReason;
                 ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult ea563c714f (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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 556c8726ae (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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 3bd44734a4 (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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 913d6081e5 (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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult ba7d036718 (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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 3993de5346 (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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult b7c59f2dac (submit/fix-char-signedness) xkb: xkbInit: fix char signess mismatch
On NetBSD gives warning:

../xkb/xkbInit.c: In function ‘XkbProcessArguments’:
../xkb/xkbInit.c:778:57: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  778 |             if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
      |                                                         ^
../xkb/xkbInit.c:782:61: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  782 |                 if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
      |                                                             ^
../xkb/xkbInit.c:792:61: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  792 |                 if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
      |                                                             ^
../xkb/xkbInit.c:799:61: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  799 |                 if (((i + 1) < argc) && (isdigit(argv[i + 1][0]))) {
      |                                                             ^
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult b5ebbb2e3f (submit/fix-char-signedness) xkb: xkbtext: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../xkb/xkbtext.c:32:
../xkb/xkbtext.c: In function ‘XkbAtomText’:
../xkb/xkbtext.c:94:44: warning: array subscript has type ‘char’ [-Wchar-subscripts]
   94 |             if ((tmp == rtrn) && (!isalpha(*tmp)))
      |                                            ^
../xkb/xkbtext.c:96:31: warning: array subscript has type ‘char’ [-Wchar-subscripts]
   96 |             else if (!isalnum(*tmp))
      |                               ^
../xkb/xkbtext.c: In function ‘XkbIMWhichStateMaskText’:
../xkb/xkbtext.c:470:43: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  470 |                 buf[len + 9] = toupper(buf[len + 9]);
      |                                           ^
../xkb/xkbtext.c: In function ‘XkbControlsMaskText’:
../xkb/xkbtext.c:532:43: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  532 |                 buf[len + 3] = toupper(buf[len + 3]);
      |                                           ^
../xkb/xkbtext.c: In function ‘XkbStringText’:
../xkb/xkbtext.c:563:22: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  563 |         if (!isprint(*in)) {
      |                      ^
../xkb/xkbtext.c:584:21: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  584 |         if (isprint(*in))
      |                     ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 0e054c32e3 (submit/fix-char-signedness) os: utils: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../include/misc.h:174,
                 from ../os/utils.c:75:
../os/utils.c: In function ‘VerifyDisplayName’:
../os/utils.c:624:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  624 |         if (!isdigit(d[i])) {
      |                       ^
../os/utils.c: In function ‘ProcessCommandLine’:
../os/utils.c:942:44: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  942 |             if ((i + 1 < argc) && (isdigit(*argv[i + 1])))
      |                                            ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 63ceada731 (submit/fix-char-signedness) os: access: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../include/misc.h:174,
                 from ../os/access.c:96:
../os/access.c: In function ‘ResetHosts’:
../os/access.c:981:49: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  981 |                 lhostname[i] = tolower(ohostname[i]);
      |                                                 ^
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 87f2e80b05 (submit/fix-char-signedness) xfree86: parser: scan: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../hw/xfree86/parser/scan.c:58:
../hw/xfree86/parser/scan.c: In function ‘xf86getToken’:
../hw/xfree86/parser/scan.c:343:50: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  343 |         else if ((c == ',') && !isalpha(configBuf[configPos])) {
      |                                                  ^
../hw/xfree86/parser/scan.c:346:50: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  346 |         else if ((c == '-') && !isalpha(configBuf[configPos])) {
      |                                                  ^
../hw/xfree86/parser/scan.c: In function ‘xf86nameCompare’:
../hw/xfree86/parser/scan.c:1031:19: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1031 |     c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                   ^
../hw/xfree86/parser/scan.c:1031:34: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1031 |     c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                                  ^
../hw/xfree86/parser/scan.c:1032:19: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1032 |     c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                   ^
../hw/xfree86/parser/scan.c:1032:34: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1032 |     c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                                  ^
../hw/xfree86/parser/scan.c:1042:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1042 |         c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                       ^
../hw/xfree86/parser/scan.c:1042:38: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1042 |         c1 = (isupper(*s1) ? tolower(*s1) : *s1);
      |                                      ^
../hw/xfree86/parser/scan.c:1043:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1043 |         c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                       ^
../hw/xfree86/parser/scan.c:1043:38: warning: array subscript has type ‘char’ [-Wchar-subscripts]
 1043 |         c2 = (isupper(*s2) ? tolower(*s2) : *s2);
      |                                      ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 3086ed6d31 (submit/fix-char-signedness) xfree86: common: xf86Configure: fix char signess mismatch
On NetBSD gives warning:

../hw/xfree86/common/xf86Configure.c: In function ‘xf86AddBusDeviceToConfigure’:
../hw/xfree86/common/xf86Configure.c:125:50: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  125 |     for (j = 0; (lower_driver[j] = tolower(driver[j])); j++);
      |                                                  ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult de5ec979d5 (submit/fix-char-signedness) xfree86: common: xf86pciBus: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../hw/xfree86/common/xf86pciBus.c:35:
../hw/xfree86/common/xf86pciBus.c: In function ‘xf86ParsePciBusString’:
../hw/xfree86/common/xf86pciBus.c:286:27: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  286 |             if (!isdigit(d[i])) {
      |                           ^
../hw/xfree86/common/xf86pciBus.c:293:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  293 |         if (!isdigit(p[i])) {
      |                       ^
../hw/xfree86/common/xf86pciBus.c:307:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  307 |         if (!isdigit(p[i])) {
      |                       ^
../hw/xfree86/common/xf86pciBus.c:320:23: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  320 |         if (!isdigit(p[i])) {
      |                       ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult edd4887cd3 (submit/fix-char-signedness) xfree86: common: xf86Option: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../hw/xfree86/common/xf86Option.c:39:
../hw/xfree86/common/xf86Option.c: In function ‘xf86NormalizeName’:
../hw/xfree86/common/xf86Option.c:915:25: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  915 |             if (isupper(*p))
      |                         ^
../hw/xfree86/common/xf86Option.c:916:32: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  916 |                 *q++ = tolower(*p);
      |                                ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 65e814aaa1 (submit/fix-char-signedness) xfree86: common: xf86Bus: fix char signess mismatch
On NetBSD gives warning:

In file included from /usr/include/ctype.h:100,
                 from ../hw/xfree86/common/xf86Bus.c:36:
../hw/xfree86/common/xf86Bus.c: In function ‘StringToBusType’:
../hw/xfree86/common/xf86Bus.c:270:22: warning: array subscript has type ‘char’ [-Wchar-subscripts]
  270 |     if (isdigit(busID[0])) {
      |                      ^

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 8fa7192799 (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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 9032c194aa (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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 796c65001a (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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 2594a99829 (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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult a4e29e4f79 (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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 7e614e8c39 (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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult 0260e13073 (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-09-18 17:23:12 +02:00
Enrico Weigelt, metux IT consult f4edaa6b64 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 7bcf65ea20 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult fae7389ba4 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 9e32358192 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 5743bd368a (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult dabc766bba (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult fb4422efe1 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult baf84073d1 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult cd3c6401bf (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 360cfb39bf (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 15054e4424 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 5546ca2c96 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 1068d6031e (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 1201a6ed88 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult e21bc4c697 (submit/bsd-defines v2) 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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult af72e10c8b (submit/bsd-defines v2) xfree86: os-support: move CONSOLE_X_TV_ON/OFF to i386_video.c
These are only used in i386_video.c, so move them there.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult c17f250d70 (submit/bsd-defines v2) xfree86: os-support: move CONSOLE_X_MODE_ON/OFF to bsd_init.c
These are only used in bsd_init.c, so move them there.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 491ba2669a (submit/bsd-defines v2) xfree86: os-support: move CONSOLE_X_BELL into bsd_bell.c
This define is only used inside bsd_bell.c, so move it there.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 82a1cac173 (submit/bsd-defines v2) xfree86: os-support: drop unused CONSOLE_GET_* defines
These don't seem to be used anywhere, so we can drop them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult ea8fda84b6 (submit/bsd-defines v2) xfree86. os-support: drop obsolete XMODE_* defines
These only had been used by xf86-video-chips, but meanwhile this
defines them on it's own, so we can drop them from here now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 31c8867db4 (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H
The symbol controls whether to include dix-config.h, and it's always set,
thus we don't need it (and dozens of ifdef's) anymore.

This commit only removes them from our own source files, where we can
guarantee that dix-config.h is present - leaving the (potentially exported)
headers untouched.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult a3349f3e31 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 0c27d5b102 (!1279) os: don't include client.h anymore
There's no need to include client.h anymore. But still leaving it, in case
some external consumer relying on it's presence.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult b17cc82252 (!1279) os: unexport client id retrieval functions
These aren't used by any (known) external modules, thus no need to export them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult be5a9820d9 (!1279) os: unexport DetermineClientPid() and DetermineClientCmd()
These aren't used by any drivers/modules, so no need to export them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult d14d63360b (!1279) os: split off internal definitions from client.h
The client.h file is part of the public module API, but it also contains
definitions that aren't useful for being used in modules. Splitting them
out into their own client_priv.h file, which isn't part of the API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 82521f4698 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 2dc806da2c (!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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult eb6ebd9b46 (!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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult dde546672e (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 450b08c6f1 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 221803bcc9 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 5f863835e7 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult a7ce225546 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult b34802c7a2 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult a13d6c36bf (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult b1690c9c65 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult f12740ee41 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 66f6f49263 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult d69250ac86 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 39300cc0bc (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 53bc46fd2a (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 32fcffa4bb (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult f232ee9042 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 1d620bdaaf (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 4a20614fcb (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 09a934fc59 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult b3790a0c26 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult b27071b35f (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult eb452fcecc (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 5564d7585c (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 90984e4c9a (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 65e1b52484 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult ba80b2a91c (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 00176a7433 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 88489e86b2 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult 2909832ac8 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult b8d22a1306 (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-09-18 17:23:11 +02:00
Enrico Weigelt, metux IT consult baae5b19a6 (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 00bedc4bbb (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult e7291758ac (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult e7797e713f (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 8837a855bc (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 43e988011f (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 49927ddf82 (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 52bb626cd7 (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 89941e666d (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult bb2713ce15 (submit/cleanup-damageext) damage: minor code formatting cleanups
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult b25cc0e8d4 (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult c4d9bd6b2a (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult fc3b95012e (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 94cf7bb153 (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 3ab8f10b65 (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult fc82a71e35 (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 652c4c4f2d (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 439d6977c3 (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 8780c16441 (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult bd00472bcb (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 8be5b12eb5 (submit/xquartz-unused-code) xquartz: drop unused code
These code pieces have been commented out since their introduction back
almost two decades ago, so probably no need for them anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult e4be1e71fe (submit/clean-modsetting-1) xfree86: modesetting: merge FreeRec() into FreeScreen()
No need to have one function doing nothing more than calling another one
with the same prototype.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult da9bcd9a07 (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 806f613d18 (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult a5c42ba050 (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 2e847c7b23 (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult b487d2d77f (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 05b748440f (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult e6b2a9a9ac (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 5bc3bc20d8 (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult fe845676cc (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 9046580fdd (submit/drop-SWAPREQ_PROC) swapreq.h: drop SWAPREQ_PROC
This macro doesn't do anything more than just making the function declarations
a few bytes smaller, but this makes the code harder to read (eg. when just
grepping through the code base).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 016b2f3b9f (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult bad606c251 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 7f629ec502 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult b1f5a743ea (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 51173435b6 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 97c4d66252 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult c9cc516cf7 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult c266f3ca83 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 99f02145f0 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 074b8223d5 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult b545728853 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult be4be0900c (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult df57469f2a (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 683f76224a (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 047b7584f9 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 6992fbad67 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 44926e6d5f (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult cdd6a62f3f (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult dc2818ac84 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 80f4475682 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 3f2cad47a8 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 26fb8455f7 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult fd96a57294 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult e89a55acc5 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult f2ffdfed3d (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult e5a3b8a385 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult c12a7656fa (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 938db6decc (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 2c8620a4ee (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 57d8528ce5 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 8f42faa697 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult f1f73d4553 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 517756ecc1 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 111fd04bf1 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 504834d877 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult cef72a14b2 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 0d76ed8b2c (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult d405ceb9a7 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 44fb38fdb2 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult a29aa98030 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 6a6f04bbe0 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 1aca289cb5 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult f30407135e (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 9ed079ed2e (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 7b0fb2d50b (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 5d0f661588 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 21b38c2772 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 9768618ad0 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 8ebcbb5d92 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 4ebeaa025d (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult e187ea816a (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 2b7f53a0bf (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 31e693ca2c (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 0402e58cf3 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult f3520016b2 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 983a233d9c (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 69ddd7624f (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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 15547148aa (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 37362c5d1a (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult b8985433a3 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 02d16aa845 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 3e0e188960 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult e6ade4f97d (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 35dff2b784 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 8886fbcf43 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 9d9e09620f (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 070a9b2318 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult e88d76fb69 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 3a054fccd1 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult f714b17888 (!1654) Xnest: replace XConnectionNumber() by xcb_get_file_descriptor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult b782711066 (!1654) Xnest: replace XReparentWindow() by xcb_reparent_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 30badb7b83 (!1654) Xnest: drop using XLoadQueryFont()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 6b97b55995 (!1654) Xnest: replace XTextWidth[16]() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 5bc713bb86 (!1654) Xnest: load fonts via xcb
FIXME: support xf86bigfont extension
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult d66f67ba69 (!1654) Xnest: replace XQueryBestSize() by xcb_query_best_size()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult d402eb18f5 (!1654) Xnest: replace X(Un)InstallColormap() by xcb_(un)install_colormap()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 1dc7ced6a4 (!1654) Xnest: drop obsolete XGetVisualInfo() call and reundant colormaps
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult db48b04c90 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 87324c84b3 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult d8cff051d8 (!1654) Xnest: fetch visuals from XCB setup data instead of Xlib
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult f78287f7b2 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult cc43e55005 (!1654) Xnest: replace XParseGeometry() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 7f72f7bb31 (!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-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 89b5b9bf83 (!1654) Xnest: collect upstream window geometry in one xRectangle struct
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:10 +02:00
Enrico Weigelt, metux IT consult 1f54e50281 (!1654) Xnest: replace XGetKeyboardControl() by xcb_get_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 0606dce445 (!1654) Xnest: replace XGetPointerMapping() by xcb_get_pointer_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 02a49d5c73 (!1654) Xnest: replace XGetPointerControl() by xcb_get_pointer_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult bfbc6752aa (!1654) Xnest: replace XGetModifierMapping() by xcb_get_modifier_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult c830d73bf5 (!1654) Xnest: fetch keyboard mapping via xcb
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 3a1aa6efe5 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 76e23c3705 (!1654) Xnest: use xcb for retrieving keymap controls
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 65ce2b1c65 (!1654) Xnest: replace XSelectInput() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 5e7c5d7432 (!1654) Xnest: replace XSetStandardProperties() by xcb functions
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 2ca292bcdd (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult c0272962ce (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult b38bd025d3 (!1654) Xnest: Pixmap: replace XGetImage() by xcb_get_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 2d3a61945c (!1654) Xnest: GC: replace XGetImage() by xcb_get_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 082db756c8 (!1654) Xnest: replace XDestroyWindow() by xnest_destroy_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult d4a593dde4 (!1654) Xnest: replace XCreatePixmapFromBitmapData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 0a52553260 (!1654) Xnest: replace XCreateBitmapFromData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult c9f03fccc6 (!1654) Xnest: replace XDefineCursor() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 9b9b7cbfc6 (!1654) Xnest: replace xnestRecolorCursor() by xcb_recolor_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult ef2121b126 (!1654) Xnest: replace XFreeCursor() by xcb_free_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 650acbf38e (!1654) Xnest: replace XStoreColors() by xcb_store_colors()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult b28bcffd55 (!1654) Xnest: replace XQueryColors() by xcb_query_colors()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 6e435c5de2 (!1654) Xnest: replace XSetWindowColormap() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult b64fce9391 (!1654) Xnest: replace XSetWMColormapWindows() by xcb_icccm_set_wm_colormap_windows_checked()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 63bd3e1128 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 46db902717 (!1654) Xnest: GC: set stipple filling via xcb_change_gc
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 643c9354a5 (!1654) Xnest: replace XSetClipMask() by xcb_change_gc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 0bd5a4774c (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult fa03432688 (!1654) Xnest: replace XSetDashes() by xnest_set_dashes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 622d216aa1 (!1654) Xnest: replace XChangeGC() by xcb_change_gc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult f2760a2a3e (!1654) Xnest: replace XChangeKeyboardControl() by xcb_change_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 4677bb6dfd (!1654) Xnest: replace XChangePointerControl() by xcb_change_pointer_control
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 48d27a4db5 (!1654) Xnest: replace XChangeWindowAttributes() by xcb_aux_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult b92a738cd9 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 502dcb55fc (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult d3dc6c32a6 (!1654) Xnest: replace XFillRectangles() by xcb_poly_fill_rectangle()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult d93e9a8641 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult e7d539fdf8 (!1654) Xnest: replace XFillArcs() by xcb_poly_fill_arc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult e5950ac008 (!1654) Xnest: replace XFillPolygon() by xcb_fill_poly()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 66a7f718d2 (!1654) Xnest: replace XCopyPlane() by xcb_copy_plane()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 9ccba989a8 (!1654) Xnest: replace XCopyArea() by xcb_copy_area()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 634d14aae5 (!1654) Xnest: replace XDrawArcs() by xcb_poly_arc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult ea8f0b3324 (!1654) Xnest: replace XDrawRectangles() by xcb_poly_rectangle()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult cddedeab01 (!1654) Xnest: replace XDrawSegments() by xcb_poly_segment()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult c151a5e9ed (!1654) Xnest: replace XDrawLines() by xcb_poly_line()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult b510e2cf75 (!1654) Xnest: replace XDrawPoints() by xcb_poly_point()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 389e3eca37 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult fad7540c75 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult d191d06820 (!1654) Xnest: use xcb_put_image() for PutImage requests
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 573e9fd044 (!1654) Xnest: use xcb_put_image() for creating cursors
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult f563877363 (!1654) Xnest: replace XCreatePixmapCursor() by xcb_create_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 0eb425be18 (!1654) Xnest: replace XConfigureWindow() calls by xcb_configure_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult fbc61db6cf (!1654) Xnest: use xcb for creating / destroying pixmaps
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 62cb6492ff (!1654) Xnest: replace XBell() by xcb_bell()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult edb34c8cc5 (!1654) Xnest: use xcb for (un)mapping windows
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 3f8ef629ff (!1654) Xnest: replace XCreateWindow() by use xcb_create_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult c6866f8f85 (!1654) Xnest: fetch root visual ID from screen data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 8205a253c4 (!1654) Xnest: fetch keycode min/max from setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult cc6d94c528 (!1654) Xnest: fetch image metrics from xcb connection setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 90d7ee7d0f (!1654) Xnest: fetch default screen's root window from screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 0b0ffeaeb2 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult b910f4b83f (!1654) Xnest: fetch default colormap from xcb screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult b57a566849 (!1654) Xnest: fetch root window depth from screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult e395112ffe (!1654) Xnest: fetch display size from xcb setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult c4c696a1ef (!1654) Xnest: fetch BlackPixel and WhitePixel from xcb setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 3818fab928 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult fe43e9ca60 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 6dc5526552 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult a346e1998e (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult dcc0169c8a (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 86cccef9bc (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult b8240ab3e1 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 9754a9d6db (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult d85d6e7dfb (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult cdc18a6013 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 44f947b9cb (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult eb0baa881c (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult fd889145a0 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 41f9f33660 (!1596) Xext: geext: drop unused variable extEntry
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult ca62578352 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 4c42242339 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 1946545f86 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult e105ec7009 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 14304a851a (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 3ac32208f6 (!1601) Xext: xres: sort includes
Bring #include's into some logical order.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 5743c16b3b (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult fe804dfc1c (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 67bf0944d3 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult e9340013c3 (!1359) dix: unexport non-public functions from dixgrabs.h and document prototypes
* unexport functions from dixgrab.h, that aren't used by any driver/module.
* add paremeter names to prototypes
* add doxygen-style documentation for all the prototypes

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 1f3179ac9d (!1359) dix: CreateGrab() rename "type" parameter to "eventType"
Make it clear what exactly this parameter is for.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult a33003a2c4 (!1359) dix: make FreeGrab() NULL tolerant
Allow NULL parameters to be passed to FreeGrab(), so callers don't all
need to check on their own anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 4f337a2760 (!1359) dix: make CopyGrab() static
This function is only called once in the same source file, no external callers
at all. So, it doesn't need to be visible outside that file, and we can allow
the compiler to do whatever fancy optimizations it might wanna do.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult cd0b9ff4e9 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 8e87055bb5 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult a51225ea61 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 00363c8840 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 7d6464e029 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult e8b6bd4731 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 630b3144b8 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 5d115439ca (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 3763bcab18 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 16e4bcb019 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 50df7ed4a6 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 82667ad3ae (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 4510b21b76 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult ac22cf2d45 (!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-09-18 17:23:09 +02:00
Enrico Weigelt, metux IT consult 754dbbb73a (!1683) os: replace LogVWrite() by LogVMessageVerb()
It's just a wrapper around LogVMessageVerb() and no external module
using it, so can easily be optimized-away.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:08 +02:00
Enrico Weigelt, metux IT consult f59440d82f (!1683) os: replace LogWrite() by LogMessageVerb()
It's nothing but a wrapper, doing the same as LogMessageVerb(X_NONE, ...),
and no external module / driver needs it, so can be easily optimized away.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:08 +02:00
Enrico Weigelt, metux IT consult c92d7037db (!1685) os: log: use localtime_r() on mingw builds
MingW also provides localtime_r(), but needs _POSIX_THREAD_SAFE_FUNCTIONS
symbol before including anything, in order for the prototype being defined.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:08 +02:00
Enrico Weigelt, metux IT consult e305638cc9 (!1684) os.h: drop unnecessary guard on stdlib.h include
It's a standard C header, that's always present, so no extra guard needed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:08 +02:00
Enrico Weigelt, metux IT consult c2e0309612 (!1686) os: drop redefining getpid() on mingw32
mingw32 does does have getpid() function, so conditionally redefining
it to _getpid() isn't necessary.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:08 +02:00
Enrico Weigelt, metux IT consult a4d09ecc82 (!1687) xfree86: unexport xf86SetVerbosity() and xf86SetLogVerbosity()
These aren't used by any modules/drivers, so no need to keep them exported.
Also drop the return value, which isn't used by any caller.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-18 17:23:08 +02:00
Enrico Weigelt, metux IT consult 9f0395bfe9 (!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-09-18 17:23:08 +02:00
656 changed files with 6542 additions and 7981 deletions

View File

@ -21,10 +21,10 @@ variables:
REPO_URL_XORGPROTO: 'https://gitlab.freedesktop.org/xorg/proto/xorgproto.git' REPO_URL_XORGPROTO: 'https://gitlab.freedesktop.org/xorg/proto/xorgproto.git'
XORG_DEBIAN_VERSION: 'bullseye-slim' XORG_DEBIAN_VERSION: 'bullseye-slim'
XORG_DEBIAN_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh' 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_VERSION: '14.0'
XORG_FREEBSD_EXEC: '' XORG_FREEBSD_EXEC: ''
XORG_FREEBSD_TAG: '2024-06-10.0' XORG_FREEBSD_TAG: '2024-09-10-fix-freebsd-xcb'
include: include:
- project: 'freedesktop/ci-templates' - project: 'freedesktop/ci-templates'
@ -109,7 +109,7 @@ stages:
FDO_DISTRIBUTION_TAG: '$XORG_FREEBSD_TAG' FDO_DISTRIBUTION_TAG: '$XORG_FREEBSD_TAG'
FDO_DISTRIBUTION_VERSION: '$XORG_FREEBSD_VERSION' FDO_DISTRIBUTION_VERSION: '$XORG_FREEBSD_VERSION'
FDO_DISTRIBUTION_EXEC: '' 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: debian-bullseye:
extends: extends:
@ -152,7 +152,7 @@ freebsd-image:
- $MESON_BUILDDIR/meson-logs/ - $MESON_BUILDDIR/meson-logs/
- $MESON_BUILDDIR/test/piglit-results/ - $MESON_BUILDDIR/test/piglit-results/
variables: 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_COMPILERCHECK: content
CCACHE_DIR: /cache/xserver/cache CCACHE_DIR: /cache/xserver/cache
LC_ALL: C.UTF-8 LC_ALL: C.UTF-8
@ -191,14 +191,14 @@ mingw-cross-build:
script: script:
- .gitlab-ci/meson-build.sh --run-install - .gitlab-ci/meson-build.sh --run-install
variables: 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: freebsd:
stage: build-and-test stage: build-and-test
extends: extends:
- .xorg-image@freebsd - .xorg-image@freebsd
variables: 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: script:
# running of of disk space without this # running of of disk space without this
# needed until https://gitlab.freedesktop.org/freedesktop/ci-templates/-/issues/67 is fixed # needed until https://gitlab.freedesktop.org/freedesktop/ci-templates/-/issues/67 is fixed
@ -222,41 +222,119 @@ meson-dist:
when: always when: always
paths: paths:
- $MESON_BUILDDIR/meson-logs/ - $MESON_BUILDDIR/meson-logs/
- $MESON_BUILDDIR/xserver-*/$MESON_BUILDDIR/meson-logs/ - $MESON_BUILDDIR/xlibre-xnest-*/$MESON_BUILDDIR/meson-logs/
script: script:
- .gitlab-ci/meson-build.sh --run-dist - .gitlab-ci/meson-build.sh --run-dist
- mkdir xserver-tarball - mkdir xserver-tarball
- tar xf $MESON_BUILDDIR/meson-dist/xserver-*.tar.xz -C xserver-tarball --strip-components=1 - tar xf $MESON_BUILDDIR/meson-dist/xlibre-xnest-*.tar.xz -C xserver-tarball --strip-components=1
- .gitlab-ci/meson-build.sh -C xserver-tarball --skip-test --skip-dist --run-install - .gitlab-ci/meson-build.sh -C xserver-tarball --skip-test --skip-dist --run-install
variables: variables:
MESON_DIST_ARGS: --no-tests MESON_DIST_ARGS: --no-tests
DESTDIR: xserver-tarball/install/ DESTDIR: xserver-tarball/install/
xf86-driver-build-test: .xf86-driver-build-test:
extends: extends:
- .xorg-image@debian - .xorg-image@debian
- .ci-run-policy - .ci-run-policy
stage: drivers stage: drivers
parallel: parallel:
matrix: matrix:
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-elographics
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-evdev - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-evdev
SHA: xf86-input-evdev-2.10.6 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 - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput
SHA: xf86-input-libinput-1.4.0 SHA: xf86-input-libinput-1.4.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-mouse - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-mouse
SHA: xf86-input-mouse-1.9.5 SHA: xf86-input-mouse-1.9.5
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics
SHA: xf86-input-synaptics-1.9.2 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 - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu
SHA: xf86-video-amdgpu-23.0.0 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 - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ati
SHA: xf86-video-ati-22.0.0 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 - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-qxl
SHA: master 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 - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vesa
SHA: xf86-video-vesa-2.6.0 SHA: xf86-video-vesa-2.6.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vmware - REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vmware
SHA: xf86-video-vmware-13.4.0 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: script:
# Install the server first # Install the server first
- .gitlab-ci/meson-build.sh --skip-test --run-install - .gitlab-ci/meson-build.sh --skip-test --run-install
@ -277,13 +355,6 @@ xf86-driver-build-test:
GIT_DEPTH: 1 GIT_DEPTH: 1
MESON_ARGS: -Dprefix=/usr/ MESON_ARGS: -Dprefix=/usr/
MESON_EXTRA_ARGS: -Dxwayland=false -Dxnest=false -Dxvfb=false -Dxquartz=false -Ddocs=false 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 # Verify that commit messages are as expected

View File

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

View File

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

View File

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

View File

@ -23,27 +23,24 @@
* Author: Peter Hutterer, University of South Australia, NICTA * Author: Peter Hutterer, University of South Australia, NICTA
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "windowstr.h"
#include <X11/extensions/ge.h> #include <X11/extensions/ge.h>
#include "windowstr.h"
#include "miext/extinit_priv.h"
#include "geint.h" #include "geint.h"
#include "geext.h" #include "geext.h"
#include "protocol-versions.h" #include "protocol-versions.h"
#include "extinit_priv.h"
Bool noGEExtension = FALSE;
DevPrivateKeyRec GEClientPrivateKeyRec; DevPrivateKeyRec GEClientPrivateKeyRec;
GEExtension GEExtensions[MAXEXTENSIONS]; 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 */ /* Forward declarations */
static void SGEGenericEvent(xEvent *from, xEvent *to); static void SGEGenericEvent(xEvent *from, xEvent *to);
@ -89,11 +86,6 @@ ProcGEQueryVersion(ClientPtr client)
return Success; return Success;
} }
static int (*ProcGEVector[GENumberRequests]) (ClientPtr) = {
/* Version 1.0 */
ProcGEQueryVersion,
};
/************************************************************/ /************************************************************/
/* swapped request handlers */ /* swapped request handlers */
/************************************************************/ /************************************************************/
@ -101,19 +93,12 @@ static int _X_COLD
SProcGEQueryVersion(ClientPtr client) SProcGEQueryVersion(ClientPtr client)
{ {
REQUEST(xGEQueryVersionReq); REQUEST(xGEQueryVersionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGEQueryVersionReq); REQUEST_SIZE_MATCH(xGEQueryVersionReq);
swaps(&stuff->majorVersion); swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion); swaps(&stuff->minorVersion);
return (*ProcGEVector[stuff->ReqType]) (client); return SProcGEQueryVersion(client);
} }
static int (*SProcGEVector[GENumberRequests]) (ClientPtr) = {
/* Version 1.0 */
SProcGEQueryVersion
};
/************************************************************/ /************************************************************/
/* callbacks */ /* callbacks */
/************************************************************/ /************************************************************/
@ -122,32 +107,29 @@ static int (*SProcGEVector[GENumberRequests]) (ClientPtr) = {
static int static int
ProcGEDispatch(ClientPtr client) ProcGEDispatch(ClientPtr client)
{ {
GEClientInfoPtr pGEClient = GEGetClient(client); REQUEST(xReq);
REQUEST(xGEReq); switch (stuff->data) {
case X_GEQueryVersion:
if (pGEClient->major_version >= ARRAY_SIZE(version_requests)) return ProcGEQueryVersion(client);
default:
return BadRequest; return BadRequest;
if (stuff->ReqType > version_requests[pGEClient->major_version]) }
return BadRequest;
return (ProcGEVector[stuff->ReqType]) (client);
} }
/* dispatch swapped requests */ /* dispatch swapped requests */
static int _X_COLD static int _X_COLD
SProcGEDispatch(ClientPtr client) SProcGEDispatch(ClientPtr client)
{ {
GEClientInfoPtr pGEClient = GEGetClient(client); REQUEST(xReq);
swaps(&stuff->length);
REQUEST(xGEReq); switch (stuff->data) {
case X_GEQueryVersion:
if (pGEClient->major_version >= ARRAY_SIZE(version_requests)) return SProcGEQueryVersion(client);
default:
return BadRequest; return BadRequest;
if (stuff->ReqType > version_requests[pGEClient->major_version]) }
return BadRequest;
return (*SProcGEVector[stuff->ReqType]) (client);
} }
/* Reset extension. Called on server shutdown. */ /* Reset extension. Called on server shutdown. */
@ -186,24 +168,16 @@ SGEGenericEvent(xEvent *from, xEvent *to)
void void
GEExtensionInit(void) GEExtensionInit(void)
{ {
ExtensionEntry *extEntry;
if (!dixRegisterPrivateKey if (!dixRegisterPrivateKey
(&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec))) (&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec)))
FatalError("GEExtensionInit: GE private request failed.\n"); FatalError("GEExtensionInit: GE private request failed.\n");
if ((extEntry = AddExtension(GE_NAME, if (!AddExtension(GE_NAME, 0, GENumberErrors, ProcGEDispatch, SProcGEDispatch,
0, GENumberErrors, GEResetProc, StandardMinorOpcode))
ProcGEDispatch, SProcGEDispatch,
GEResetProc, StandardMinorOpcode)) != 0) {
memset(GEExtensions, 0, sizeof(GEExtensions));
EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent;
}
else {
FatalError("GEInit: AddExtensions failed.\n"); FatalError("GEInit: AddExtensions failed.\n");
}
memset(GEExtensions, 0, sizeof(GEExtensions));
EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent;
} }
/************************************************************/ /************************************************************/

View File

@ -1,6 +1,4 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <stdlib.h> #include <stdlib.h>
#include "misc.h" #include "misc.h"

View File

@ -23,9 +23,7 @@ dealings in this Software without prior written authorization from Digital
Equipment Corporation. Equipment Corporation.
******************************************************************/ ******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <X11/X.h> #include <X11/X.h>
@ -34,6 +32,7 @@ Equipment Corporation.
#include <X11/extensions/panoramiXproto.h> #include <X11/extensions/panoramiXproto.h>
#include "dix/dix_priv.h" #include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
#include "misc.h" #include "misc.h"
#include "cursor.h" #include "cursor.h"
@ -57,7 +56,6 @@ Equipment Corporation.
#ifdef COMPOSITE #ifdef COMPOSITE
#include "compint.h" #include "compint.h"
#endif #endif
#include "extinit_priv.h"
#include "protocol-versions.h" #include "protocol-versions.h"
#ifdef GLXPROXY #ifdef GLXPROXY
@ -65,6 +63,9 @@ extern VisualPtr glxMatchVisual(ScreenPtr pScreen,
VisualPtr pVisual, ScreenPtr pMatchScreen); VisualPtr pVisual, ScreenPtr pMatchScreen);
#endif #endif
/* Xinerama is disabled by default unless enabled via +xinerama */
Bool noPanoramiXExtension = TRUE;
/* /*
* PanoramiX data declarations * PanoramiX data declarations
*/ */

View File

@ -23,9 +23,7 @@ dealings in this Software without prior written authorization from Digital
Equipment Corporation. Equipment Corporation.
******************************************************************/ ******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <X11/X.h> #include <X11/X.h>
@ -47,22 +45,10 @@ Equipment Corporation.
#include "globals.h" #include "globals.h"
#include "panoramiXh.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 static int _X_COLD
SProcPanoramiXGetState(ClientPtr client) SProcPanoramiXGetState(ClientPtr client)
{ {
REQUEST(xPanoramiXGetStateReq); REQUEST(xPanoramiXGetStateReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
swapl(&stuff->window); swapl(&stuff->window);
return ProcPanoramiXGetState(client); return ProcPanoramiXGetState(client);
@ -72,8 +58,6 @@ static int _X_COLD
SProcPanoramiXGetScreenCount(ClientPtr client) SProcPanoramiXGetScreenCount(ClientPtr client)
{ {
REQUEST(xPanoramiXGetScreenCountReq); REQUEST(xPanoramiXGetScreenCountReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
swapl(&stuff->window); swapl(&stuff->window);
return ProcPanoramiXGetScreenCount(client); return ProcPanoramiXGetScreenCount(client);
@ -83,41 +67,19 @@ static int _X_COLD
SProcPanoramiXGetScreenSize(ClientPtr client) SProcPanoramiXGetScreenSize(ClientPtr client)
{ {
REQUEST(xPanoramiXGetScreenSizeReq); REQUEST(xPanoramiXGetScreenSizeReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
swapl(&stuff->window); swapl(&stuff->window);
swapl(&stuff->screen); swapl(&stuff->screen);
return ProcPanoramiXGetScreenSize(client); 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 int _X_COLD
SProcPanoramiXDispatch(ClientPtr client) SProcPanoramiXDispatch(ClientPtr client)
{ {
REQUEST(xReq); REQUEST(xReq);
switch (stuff->data) { switch (stuff->data) {
case X_PanoramiXQueryVersion: case X_PanoramiXQueryVersion:
return SProcPanoramiXQueryVersion(client); return ProcPanoramiXQueryVersion(client);
case X_PanoramiXGetState: case X_PanoramiXGetState:
return SProcPanoramiXGetState(client); return SProcPanoramiXGetState(client);
case X_PanoramiXGetScreenCount: case X_PanoramiXGetScreenCount:
@ -125,9 +87,9 @@ SProcPanoramiXDispatch(ClientPtr client)
case X_PanoramiXGetScreenSize: case X_PanoramiXGetScreenSize:
return SProcPanoramiXGetScreenSize(client); return SProcPanoramiXGetScreenSize(client);
case X_XineramaIsActive: case X_XineramaIsActive:
return SProcXineramaIsActive(client); return ProcXineramaIsActive(client);
case X_XineramaQueryScreens: case X_XineramaQueryScreens:
return SProcXineramaQueryScreens(client); return ProcXineramaQueryScreens(client);
} }
return BadRequest; return BadRequest;
} }

View File

@ -25,15 +25,14 @@ Equipment Corporation.
/* Massively rewritten by Mark Vojkovich <markv@valinux.com> */ /* Massively rewritten by Mark Vojkovich <markv@valinux.com> */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xproto.h> #include <X11/Xproto.h>
#include "dix/dix_priv.h" #include "dix/dix_priv.h"
#include "os/osdep.h"
#include "windowstr.h" #include "windowstr.h"
#include "dixfontstr.h" #include "dixfontstr.h"

View File

@ -26,9 +26,7 @@ in this Software without prior written authorization from the X Consortium.
* Author: Keith Packard, MIT X Consortium * Author: Keith Packard, MIT X Consortium
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <X11/X.h> #include <X11/X.h>
@ -38,6 +36,8 @@ in this Software without prior written authorization from the X Consortium.
#include "dix/colormap_priv.h" #include "dix/colormap_priv.h"
#include "dix/cursor_priv.h" #include "dix/cursor_priv.h"
#include "dix/dix_priv.h" #include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
#include "os/osdep.h"
#include "os/screensaver.h" #include "os/screensaver.h"
#include "misc.h" #include "misc.h"
@ -53,16 +53,21 @@ in this Software without prior written authorization from the X Consortium.
#include "colormapst.h" #include "colormapst.h"
#include "xace.h" #include "xace.h"
#include "inputstr.h" #include "inputstr.h"
#ifdef PANORAMIX #ifdef XINERAMA
#include "panoramiX.h" #include "panoramiX.h"
#include "panoramiXsrv.h" #include "panoramiXsrv.h"
#endif #endif /* XINERAMA */
#ifdef DPMSExtension #ifdef DPMSExtension
#include <X11/extensions/dpmsconst.h> #include <X11/extensions/dpmsconst.h>
#include "dpmsproc.h" #include "dpmsproc.h"
#endif #endif
#include "protocol-versions.h" #include "protocol-versions.h"
#include "extinit_priv.h"
Bool noScreenSaverExtension = FALSE;
// temporary workaround for win32/mingw32 name clash
// see: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355
#undef CreateWindow
static int ScreenSaverEventBase = 0; static int ScreenSaverEventBase = 0;
@ -585,9 +590,9 @@ ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force)
ret = TRUE; ret = TRUE;
} }
#ifdef PANORAMIX #ifdef XINERAMA
if (noPanoramiXExtension || !pScreen->myNum) if (noPanoramiXExtension || !pScreen->myNum)
#endif #endif /* XINERAMA */
SendScreenSaverNotify(pScreen, state, force); SendScreenSaverNotify(pScreen, state, force);
return ret; return ret;
} }
@ -598,7 +603,6 @@ ProcScreenSaverQueryVersion(ClientPtr client)
xScreenSaverQueryVersionReply rep = { xScreenSaverQueryVersionReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
.length = 0,
.majorVersion = SERVER_SAVER_MAJOR_VERSION, .majorVersion = SERVER_SAVER_MAJOR_VERSION,
.minorVersion = SERVER_SAVER_MINOR_VERSION .minorVersion = SERVER_SAVER_MINOR_VERSION
}; };
@ -607,7 +611,8 @@ ProcScreenSaverQueryVersion(ClientPtr client)
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
} }
WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), &rep); WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), &rep);
return Success; return Success;
@ -617,7 +622,6 @@ static int
ProcScreenSaverQueryInfo(ClientPtr client) ProcScreenSaverQueryInfo(ClientPtr client)
{ {
REQUEST(xScreenSaverQueryInfoReq); REQUEST(xScreenSaverQueryInfoReq);
xScreenSaverQueryInfoReply rep;
int rc; int rc;
ScreenSaverStuffPtr pSaver; ScreenSaverStuffPtr pSaver;
DrawablePtr pDraw; DrawablePtr pDraw;
@ -639,30 +643,24 @@ ProcScreenSaverQueryInfo(ClientPtr client)
UpdateCurrentTime(); UpdateCurrentTime();
lastInput = GetTimeInMillis() - LastEventTime(XIAllDevices).milliseconds; lastInput = GetTimeInMillis() - LastEventTime(XIAllDevices).milliseconds;
rep = (xScreenSaverQueryInfoReply) { xScreenSaverQueryInfoReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
.length = 0,
.window = pSaver->wid .window = pSaver->wid
}; };
if (screenIsSaved != SCREEN_SAVER_OFF) { if (screenIsSaved != SCREEN_SAVER_OFF) {
rep.state = ScreenSaverOn; rep.state = ScreenSaverOn;
if (ScreenSaverTime) if (ScreenSaverTime)
rep.tilOrSince = lastInput - ScreenSaverTime; rep.tilOrSince = lastInput - ScreenSaverTime;
else
rep.tilOrSince = 0;
} }
else { else {
if (ScreenSaverTime) { if (ScreenSaverTime) {
rep.state = ScreenSaverOff; rep.state = ScreenSaverOff;
if (ScreenSaverTime < lastInput) if (ScreenSaverTime >= lastInput)
rep.tilOrSince = 0;
else
rep.tilOrSince = ScreenSaverTime - lastInput; rep.tilOrSince = ScreenSaverTime - lastInput;
} }
else { else {
rep.state = ScreenSaverDisabled; rep.state = ScreenSaverDisabled;
rep.tilOrSince = 0;
} }
} }
rep.idle = lastInput; rep.idle = lastInput;
@ -675,7 +673,6 @@ ProcScreenSaverQueryInfo(ClientPtr client)
rep.kind = ScreenSaverInternal; rep.kind = ScreenSaverInternal;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.window); swapl(&rep.window);
swapl(&rep.tilOrSince); swapl(&rep.tilOrSince);
swapl(&rep.idle); swapl(&rep.idle);
@ -708,9 +705,8 @@ ProcScreenSaverSelectInput(ClientPtr client)
} }
static int static int
ScreenSaverSetAttributes(ClientPtr client) ScreenSaverSetAttributes(ClientPtr client, xScreenSaverSetAttributesReq *stuff)
{ {
REQUEST(xScreenSaverSetAttributesReq);
DrawablePtr pDraw; DrawablePtr pDraw;
WindowPtr pParent; WindowPtr pParent;
ScreenPtr pScreen; ScreenPtr pScreen;
@ -733,7 +729,6 @@ ScreenSaverSetAttributes(ClientPtr client)
Colormap cmap; Colormap cmap;
ColormapPtr pCmap; ColormapPtr pCmap;
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
DixGetAttrAccess); DixGetAttrAccess);
if (ret != Success) if (ret != Success)
@ -745,7 +740,7 @@ ScreenSaverSetAttributes(ClientPtr client)
if (ret != Success) if (ret != Success)
return ret; return ret;
len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq)); len = client->req_len - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
if (Ones(stuff->mask) != len) if (Ones(stuff->mask) != len)
return BadLength; return BadLength;
if (!stuff->width || !stuff->height) { if (!stuff->width || !stuff->height) {
@ -1050,16 +1045,13 @@ ScreenSaverSetAttributes(ClientPtr client)
} }
static int static int
ScreenSaverUnsetAttributes(ClientPtr client) ScreenSaverUnsetAttributes(ClientPtr client, Drawable drawable)
{ {
REQUEST(xScreenSaverSetAttributesReq);
DrawablePtr pDraw; DrawablePtr pDraw;
ScreenSaverScreenPrivatePtr pPriv; ScreenSaverScreenPrivatePtr pPriv;
int rc; int rc;
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq); rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixGetAttrAccess);
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
DixGetAttrAccess);
if (rc != Success) if (rc != Success)
return rc; return rc;
pPriv = GetScreenPrivate(pDraw->pScreen); pPriv = GetScreenPrivate(pDraw->pScreen);
@ -1075,9 +1067,11 @@ ScreenSaverUnsetAttributes(ClientPtr client)
static int static int
ProcScreenSaverSetAttributes(ClientPtr client) ProcScreenSaverSetAttributes(ClientPtr client)
{ {
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
REQUEST(xScreenSaverSetAttributesReq); REQUEST(xScreenSaverSetAttributesReq);
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
#ifdef XINERAMA
if (!noPanoramiXExtension) {
PanoramiXRes *draw; PanoramiXRes *draw;
PanoramiXRes *backPix = NULL; PanoramiXRes *backPix = NULL;
PanoramiXRes *bordPix = NULL; PanoramiXRes *bordPix = NULL;
@ -1086,15 +1080,13 @@ ProcScreenSaverSetAttributes(ClientPtr client)
int pback_offset = 0, pbord_offset = 0, cmap_offset = 0; int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
XID orig_visual, tmp; XID orig_visual, tmp;
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
status = dixLookupResourceByClass((void **) &draw, stuff->drawable, status = dixLookupResourceByClass((void **) &draw, stuff->drawable,
XRC_DRAWABLE, client, DixWriteAccess); XRC_DRAWABLE, client, DixWriteAccess);
if (status != Success) if (status != Success)
return (status == BadValue) ? BadDrawable : status; return (status == BadValue) ? BadDrawable : status;
len = len =
stuff->length - client->req_len -
bytes_to_int32(sizeof(xScreenSaverSetAttributesReq)); bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
if (Ones(stuff->mask) != len) if (Ones(stuff->mask) != len)
return BadLength; return BadLength;
@ -1149,26 +1141,27 @@ ProcScreenSaverSetAttributes(ClientPtr client)
if (orig_visual != CopyFromParent) if (orig_visual != CopyFromParent)
stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual); stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual);
status = ScreenSaverSetAttributes(client); status = ScreenSaverSetAttributes(client, stuff);
} }
return status; return status;
} }
#endif #endif /* XINERAMA */
return ScreenSaverSetAttributes(client); return ScreenSaverSetAttributes(client, stuff);
} }
static int static int
ProcScreenSaverUnsetAttributes(ClientPtr client) ProcScreenSaverUnsetAttributes(ClientPtr client)
{ {
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
REQUEST(xScreenSaverUnsetAttributesReq); REQUEST(xScreenSaverUnsetAttributesReq);
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
#ifdef XINERAMA
if (!noPanoramiXExtension) {
PanoramiXRes *draw; PanoramiXRes *draw;
int rc, i; int rc, i;
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable, rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
XRC_DRAWABLE, client, DixWriteAccess); XRC_DRAWABLE, client, DixWriteAccess);
@ -1176,15 +1169,14 @@ ProcScreenSaverUnsetAttributes(ClientPtr client)
return (rc == BadValue) ? BadDrawable : rc; return (rc == BadValue) ? BadDrawable : rc;
for (i = PanoramiXNumScreens - 1; i > 0; i--) { for (i = PanoramiXNumScreens - 1; i > 0; i--) {
stuff->drawable = draw->info[i].id; ScreenSaverUnsetAttributes(client, draw->info[i].id);
ScreenSaverUnsetAttributes(client);
} }
stuff->drawable = draw->info[0].id; stuff->drawable = draw->info[0].id;
} }
#endif #endif /* XINERAMA */
return ScreenSaverUnsetAttributes(client); return ScreenSaverUnsetAttributes(client, stuff->drawable);
} }
static int static int
@ -1252,37 +1244,32 @@ ProcScreenSaverSuspend(ClientPtr client)
return Success; return Success;
} }
static int (*NormalVector[]) (ClientPtr /* client */ ) = {
ProcScreenSaverQueryVersion,
ProcScreenSaverQueryInfo,
ProcScreenSaverSelectInput,
ProcScreenSaverSetAttributes,
ProcScreenSaverUnsetAttributes, ProcScreenSaverSuspend,};
static int static int
ProcScreenSaverDispatch(ClientPtr client) ProcScreenSaverDispatch(ClientPtr client)
{ {
REQUEST(xReq); REQUEST(xReq);
switch (stuff->data) {
if (stuff->data < ARRAY_SIZE(NormalVector)) case X_ScreenSaverQueryVersion:
return (*NormalVector[stuff->data]) (client); 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; return BadRequest;
} }
static int _X_COLD
SProcScreenSaverQueryVersion(ClientPtr client)
{
REQUEST(xScreenSaverQueryVersionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
return ProcScreenSaverQueryVersion(client);
} }
static int _X_COLD static int _X_COLD
SProcScreenSaverQueryInfo(ClientPtr client) SProcScreenSaverQueryInfo(ClientPtr client)
{ {
REQUEST(xScreenSaverQueryInfoReq); REQUEST(xScreenSaverQueryInfoReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq); REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
swapl(&stuff->drawable); swapl(&stuff->drawable);
return ProcScreenSaverQueryInfo(client); return ProcScreenSaverQueryInfo(client);
@ -1292,7 +1279,6 @@ static int _X_COLD
SProcScreenSaverSelectInput(ClientPtr client) SProcScreenSaverSelectInput(ClientPtr client)
{ {
REQUEST(xScreenSaverSelectInputReq); REQUEST(xScreenSaverSelectInputReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq); REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
swapl(&stuff->drawable); swapl(&stuff->drawable);
swapl(&stuff->eventMask); swapl(&stuff->eventMask);
@ -1303,7 +1289,6 @@ static int _X_COLD
SProcScreenSaverSetAttributes(ClientPtr client) SProcScreenSaverSetAttributes(ClientPtr client)
{ {
REQUEST(xScreenSaverSetAttributesReq); REQUEST(xScreenSaverSetAttributesReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq); REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
swapl(&stuff->drawable); swapl(&stuff->drawable);
swaps(&stuff->x); swaps(&stuff->x);
@ -1321,7 +1306,6 @@ static int _X_COLD
SProcScreenSaverUnsetAttributes(ClientPtr client) SProcScreenSaverUnsetAttributes(ClientPtr client)
{ {
REQUEST(xScreenSaverUnsetAttributesReq); REQUEST(xScreenSaverUnsetAttributesReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq); REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
swapl(&stuff->drawable); swapl(&stuff->drawable);
return ProcScreenSaverUnsetAttributes(client); return ProcScreenSaverUnsetAttributes(client);
@ -1331,29 +1315,32 @@ static int _X_COLD
SProcScreenSaverSuspend(ClientPtr client) SProcScreenSaverSuspend(ClientPtr client)
{ {
REQUEST(xScreenSaverSuspendReq); REQUEST(xScreenSaverSuspendReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverSuspendReq); REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
swapl(&stuff->suspend); swapl(&stuff->suspend);
return ProcScreenSaverSuspend(client); return ProcScreenSaverSuspend(client);
} }
static int (*SwappedVector[]) (ClientPtr /* client */ ) = {
SProcScreenSaverQueryVersion,
SProcScreenSaverQueryInfo,
SProcScreenSaverSelectInput,
SProcScreenSaverSetAttributes,
SProcScreenSaverUnsetAttributes, SProcScreenSaverSuspend,};
static int _X_COLD static int _X_COLD
SProcScreenSaverDispatch(ClientPtr client) SProcScreenSaverDispatch(ClientPtr client)
{ {
REQUEST(xReq); REQUEST(xReq);
switch (stuff->data) {
if (stuff->data < ARRAY_SIZE(NormalVector)) case X_ScreenSaverQueryVersion:
return (*SwappedVector[stuff->data]) (client); 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; return BadRequest;
} }
}
void void
ScreenSaverExtensionInit(void) ScreenSaverExtensionInit(void)

View File

@ -24,9 +24,7 @@ in this Software without prior written authorization from The Open Group.
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/Xmd.h> #include <X11/Xmd.h>
#include <X11/extensions/securproto.h> #include <X11/extensions/securproto.h>
@ -34,9 +32,10 @@ in this Software without prior written authorization from The Open Group.
#include "dix/dix_priv.h" #include "dix/dix_priv.h"
#include "dix/registry_priv.h" #include "dix/registry_priv.h"
#include "include/extinit_priv.h" #include "miext/extinit_priv.h"
#include "os/audit.h" #include "os/audit.h"
#include "os/auth.h" #include "os/auth.h"
#include "os/osdep.h"
#include "scrnintstr.h" #include "scrnintstr.h"
#include "inputstr.h" #include "inputstr.h"
@ -46,9 +45,10 @@ in this Software without prior written authorization from The Open Group.
#include "privates.h" #include "privates.h"
#include "xacestr.h" #include "xacestr.h"
#include "securitysrv.h" #include "securitysrv.h"
#include "extinit.h"
#include "protocol-versions.h" #include "protocol-versions.h"
Bool noSecurityExtension = FALSE;
/* Extension stuff */ /* Extension stuff */
static int SecurityErrorBase; /* first Security error number */ static int SecurityErrorBase; /* first Security error number */
static int SecurityEventBase; /* first Security event number */ static int SecurityEventBase; /* first Security event number */
@ -613,8 +613,6 @@ static int _X_COLD
SProcSecurityQueryVersion(ClientPtr client) SProcSecurityQueryVersion(ClientPtr client)
{ {
REQUEST(xSecurityQueryVersionReq); REQUEST(xSecurityQueryVersionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSecurityQueryVersionReq); REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
swaps(&stuff->majorVersion); swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion); swaps(&stuff->minorVersion);
@ -628,8 +626,6 @@ SProcSecurityGenerateAuthorization(ClientPtr client)
CARD32 *values; CARD32 *values;
unsigned long nvalues; unsigned long nvalues;
int values_offset; int values_offset;
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq); REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
swaps(&stuff->nbytesAuthProto); swaps(&stuff->nbytesAuthProto);
swaps(&stuff->nbytesAuthData); swaps(&stuff->nbytesAuthData);
@ -637,10 +633,10 @@ SProcSecurityGenerateAuthorization(ClientPtr client)
values_offset = bytes_to_int32(stuff->nbytesAuthProto) + values_offset = bytes_to_int32(stuff->nbytesAuthProto) +
bytes_to_int32(stuff->nbytesAuthData); bytes_to_int32(stuff->nbytesAuthData);
if (values_offset > if (values_offset >
stuff->length - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq)) client->req_len - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
return BadLength; return BadLength;
values = (CARD32 *) (&stuff[1]) + values_offset; values = (CARD32 *) (&stuff[1]) + values_offset;
nvalues = (((CARD32 *) stuff) + stuff->length) - values; nvalues = (((CARD32 *) stuff) + client->req_len) - values;
SwapLongs(values, nvalues); SwapLongs(values, nvalues);
return ProcSecurityGenerateAuthorization(client); return ProcSecurityGenerateAuthorization(client);
} /* SProcSecurityGenerateAuthorization */ } /* SProcSecurityGenerateAuthorization */
@ -649,8 +645,6 @@ static int _X_COLD
SProcSecurityRevokeAuthorization(ClientPtr client) SProcSecurityRevokeAuthorization(ClientPtr client)
{ {
REQUEST(xSecurityRevokeAuthorizationReq); REQUEST(xSecurityRevokeAuthorizationReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq); REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
swapl(&stuff->authId); swapl(&stuff->authId);
return ProcSecurityRevokeAuthorization(client); return ProcSecurityRevokeAuthorization(client);

View File

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

View File

@ -28,9 +28,7 @@ in this Software without prior written authorization from The Open Group.
#define SHM #define SHM
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/ipc.h> #include <sys/ipc.h>
@ -45,8 +43,10 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xfuncproto.h> #include <X11/Xfuncproto.h>
#include "dix/dix_priv.h" #include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
#include "os/auth.h" #include "os/auth.h"
#include "os/busfault.h" #include "os/busfault.h"
#include "os/log_priv.h"
#include "os/osdep.h" #include "os/osdep.h"
#include "misc.h" #include "misc.h"
@ -61,7 +61,6 @@ in this Software without prior written authorization from The Open Group.
#include "servermd.h" #include "servermd.h"
#include "shmint.h" #include "shmint.h"
#include "xace.h" #include "xace.h"
#include "extinit_priv.h"
#include "protocol-versions.h" #include "protocol-versions.h"
/* Needed for Solaris cross-zone shared memory extension */ /* Needed for Solaris cross-zone shared memory extension */
@ -91,10 +90,10 @@ in this Software without prior written authorization from The Open Group.
#define SHMPERM_MODE(p) p->mode #define SHMPERM_MODE(p) p->mode
#endif #endif
#ifdef PANORAMIX #ifdef XINERAMA
#include "panoramiX.h" #include "panoramiX.h"
#include "panoramiXsrv.h" #include "panoramiXsrv.h"
#endif #endif /* XINERAMA */
typedef struct _ShmScrPrivateRec { typedef struct _ShmScrPrivateRec {
CloseScreenProcPtr CloseScreen; CloseScreenProcPtr CloseScreen;
@ -109,6 +108,9 @@ static void SShmCompletionEvent(xShmCompletionEvent *from,
xShmCompletionEvent *to); xShmCompletionEvent *to);
static Bool ShmDestroyPixmap(PixmapPtr pPixmap); static Bool ShmDestroyPixmap(PixmapPtr pPixmap);
static int ShmCreatePixmap(ClientPtr client, xShmCreatePixmapReq *stuff);
Bool noMITShmExtension = FALSE;
static unsigned char ShmReqCode; static unsigned char ShmReqCode;
int ShmCompletionCode; int ShmCompletionCode;
@ -156,7 +158,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; static Bool badSysCall = FALSE;
@ -372,12 +374,15 @@ shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly)
static int static int
ProcShmAttach(ClientPtr client) ProcShmAttach(ClientPtr client)
{ {
REQUEST(xShmAttachReq);
REQUEST_SIZE_MATCH(xShmAttachReq);
if (!client->local)
return BadRequest;
SHMSTAT_TYPE buf; SHMSTAT_TYPE buf;
ShmDescPtr shmdesc; ShmDescPtr shmdesc;
REQUEST(xShmAttachReq);
REQUEST_SIZE_MATCH(xShmAttachReq);
LEGAL_NEW_RESOURCE(stuff->shmseg, client); LEGAL_NEW_RESOURCE(stuff->shmseg, client);
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) { if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
client->errorValue = stuff->readOnly; client->errorValue = stuff->readOnly;
@ -454,11 +459,14 @@ ShmDetachSegment(void *value, /* must conform to DeleteType */
static int static int
ProcShmDetach(ClientPtr client) ProcShmDetach(ClientPtr client)
{ {
REQUEST(xShmDetachReq);
REQUEST_SIZE_MATCH(xShmDetachReq);
if (!client->local)
return BadRequest;
ShmDescPtr shmdesc; ShmDescPtr shmdesc;
REQUEST(xShmDetachReq);
REQUEST_SIZE_MATCH(xShmDetachReq);
VERIFY_SHMSEG(stuff->shmseg, shmdesc, client); VERIFY_SHMSEG(stuff->shmseg, shmdesc, client);
FreeResource(stuff->shmseg, X11_RESTYPE_NONE); FreeResource(stuff->shmseg, X11_RESTYPE_NONE);
return Success; return Success;
@ -515,16 +523,13 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
} }
static int static int
ProcShmPutImage(ClientPtr client) ShmPutImage(ClientPtr client, xShmPutImageReq *stuff)
{ {
GCPtr pGC; GCPtr pGC;
DrawablePtr pDraw; DrawablePtr pDraw;
long length; long length;
ShmDescPtr shmdesc; ShmDescPtr shmdesc;
REQUEST(xShmPutImageReq);
REQUEST_SIZE_MATCH(xShmPutImageReq);
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client); VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse)) if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
@ -614,7 +619,7 @@ ProcShmPutImage(ClientPtr client)
} }
static int static int
ProcShmGetImage(ClientPtr client) ShmGetImage(ClientPtr client, xShmGetImageReq *stuff)
{ {
DrawablePtr pDraw; DrawablePtr pDraw;
long lenPer = 0, length; long lenPer = 0, length;
@ -625,9 +630,6 @@ ProcShmGetImage(ClientPtr client)
RegionPtr pVisibleRegion = NULL; RegionPtr pVisibleRegion = NULL;
int rc; int rc;
REQUEST(xShmGetImageReq);
REQUEST_SIZE_MATCH(xShmGetImageReq);
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) { if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
client->errorValue = stuff->format; client->errorValue = stuff->format;
return BadValue; return BadValue;
@ -732,16 +734,22 @@ ProcShmGetImage(ClientPtr client)
return Success; return Success;
} }
#ifdef PANORAMIX
static int 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; int j, result, orig_x, orig_y;
PanoramiXRes *draw, *gc; PanoramiXRes *draw, *gc;
Bool sendEvent, isRoot; Bool sendEvent, isRoot;
REQUEST(xShmPutImageReq); if (noPanoramiXExtension)
REQUEST_SIZE_MATCH(xShmPutImageReq); return ShmPutImage(client, stuff);
result = dixLookupResourceByClass((void **) &draw, stuff->drawable, result = dixLookupResourceByClass((void **) &draw, stuff->drawable,
XRC_DRAWABLE, client, DixWriteAccess); XRC_DRAWABLE, client, DixWriteAccess);
@ -768,16 +776,26 @@ ProcPanoramiXShmPutImage(ClientPtr client)
stuff->dstX = orig_x - screenInfo.screens[j]->x; stuff->dstX = orig_x - screenInfo.screens[j]->x;
stuff->dstY = orig_y - screenInfo.screens[j]->y; stuff->dstY = orig_y - screenInfo.screens[j]->y;
} }
result = ProcShmPutImage(client); result = ShmPutImage(client, stuff);
if (result != Success) if (result != Success)
break; break;
} }
return result; return result;
#else
return ShmPutImage(client, stuff);
#endif /* XINERAMA */
} }
static int static int
ProcPanoramiXShmGetImage(ClientPtr client) ProcShmGetImage(ClientPtr client)
{ {
REQUEST(xShmGetImageReq);
REQUEST_SIZE_MATCH(xShmGetImageReq);
if (!client->local)
return BadRequest;
#ifdef XINERAMA
PanoramiXRes *draw; PanoramiXRes *draw;
DrawablePtr *drawables; DrawablePtr *drawables;
DrawablePtr pDraw; DrawablePtr pDraw;
@ -788,9 +806,8 @@ ProcPanoramiXShmGetImage(ClientPtr client)
long lenPer = 0, length, widthBytesLine; long lenPer = 0, length, widthBytesLine;
Bool isRoot; Bool isRoot;
REQUEST(xShmGetImageReq); if (noPanoramiXExtension)
return ShmGetImage(client, stuff);
REQUEST_SIZE_MATCH(xShmGetImageReq);
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) { if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
client->errorValue = stuff->format; client->errorValue = stuff->format;
@ -803,7 +820,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
return (rc == BadValue) ? BadDrawable : rc; return (rc == BadValue) ? BadDrawable : rc;
if (draw->type == XRT_PIXMAP) if (draw->type == XRT_PIXMAP)
return ProcShmGetImage(client); return ShmGetImage(client, stuff);
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReadAccess); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReadAccess);
if (rc != Success) if (rc != Success)
@ -914,24 +931,34 @@ ProcPanoramiXShmGetImage(ClientPtr client)
WriteToClient(client, sizeof(xShmGetImageReply), &xgi); WriteToClient(client, sizeof(xShmGetImageReply), &xgi);
return Success; return Success;
#else
return ShmGetImage(client, stuff);
#endif /* XINERAMA */
} }
static int 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; ScreenPtr pScreen = NULL;
PixmapPtr pMap = NULL; PixmapPtr pMap = NULL;
DrawablePtr pDraw; DrawablePtr pDraw;
DepthPtr pDepth; DepthPtr pDepth;
int i, j, result, rc; int i, j, result, rc;
ShmDescPtr shmdesc; ShmDescPtr shmdesc;
REQUEST(xShmCreatePixmapReq);
unsigned int width, height, depth; unsigned int width, height, depth;
unsigned long size; unsigned long size;
PanoramiXRes *newPix; PanoramiXRes *newPix;
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
client->errorValue = stuff->pid; client->errorValue = stuff->pid;
if (!sharedPixmaps) if (!sharedPixmaps)
return BadImplementation; return BadImplementation;
@ -1027,8 +1054,10 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
AddResource(stuff->pid, XRT_PIXMAP, newPix); AddResource(stuff->pid, XRT_PIXMAP, newPix);
return result; return result;
#else
return ShmCreatePixmap(client, stuff);
#endif /* XINERAMA */
} }
#endif
static PixmapPtr static PixmapPtr
fbShmCreatePixmap(ScreenPtr pScreen, fbShmCreatePixmap(ScreenPtr pScreen,
@ -1051,7 +1080,7 @@ fbShmCreatePixmap(ScreenPtr pScreen,
} }
static int static int
ProcShmCreatePixmap(ClientPtr client) ShmCreatePixmap(ClientPtr client, xShmCreatePixmapReq *stuff)
{ {
PixmapPtr pMap; PixmapPtr pMap;
DrawablePtr pDraw; DrawablePtr pDraw;
@ -1059,12 +1088,9 @@ ProcShmCreatePixmap(ClientPtr client)
int i, rc; int i, rc;
ShmDescPtr shmdesc; ShmDescPtr shmdesc;
ShmScrPrivateRec *screen_priv; ShmScrPrivateRec *screen_priv;
REQUEST(xShmCreatePixmapReq);
unsigned int width, height, depth; unsigned int width, height, depth;
unsigned long size; unsigned long size;
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
client->errorValue = stuff->pid; client->errorValue = stuff->pid;
if (!sharedPixmaps) if (!sharedPixmaps)
return BadImplementation; return BadImplementation;
@ -1146,19 +1172,24 @@ ShmBusfaultNotify(void *context)
static int static int
ProcShmAttachFd(ClientPtr client) ProcShmAttachFd(ClientPtr client)
{ {
REQUEST(xShmAttachFdReq);
REQUEST_SIZE_MATCH(xShmAttachFdReq);
if (!client->local)
return BadRequest;
int fd; int fd;
ShmDescPtr shmdesc; ShmDescPtr shmdesc;
REQUEST(xShmAttachFdReq);
struct stat statb; struct stat statb;
SetReqFds(client, 1);
REQUEST_SIZE_MATCH(xShmAttachFdReq);
LEGAL_NEW_RESOURCE(stuff->shmseg, client); LEGAL_NEW_RESOURCE(stuff->shmseg, client);
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) { if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
client->errorValue = stuff->readOnly; client->errorValue = stuff->readOnly;
return BadValue; return BadValue;
} }
fd = ReadFdFromClient(client); fd = client->recv_fd_list[0];
client->recv_fd_list[0] = -1;
if (fd < 0) if (fd < 0)
return BadMatch; return BadMatch;
@ -1261,9 +1292,14 @@ shm_tmpfile(void)
static int static int
ProcShmCreateSegment(ClientPtr client) ProcShmCreateSegment(ClientPtr client)
{ {
REQUEST(xShmCreateSegmentReq);
REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
if (!client->local)
return BadRequest;
int fd; int fd;
ShmDescPtr shmdesc; ShmDescPtr shmdesc;
REQUEST(xShmCreateSegmentReq);
xShmCreateSegmentReply rep = { xShmCreateSegmentReply rep = {
.type = X_Reply, .type = X_Reply,
.nfd = 1, .nfd = 1,
@ -1271,7 +1307,6 @@ ProcShmCreateSegment(ClientPtr client)
.length = 0, .length = 0,
}; };
REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
LEGAL_NEW_RESOURCE(stuff->shmseg, client); LEGAL_NEW_RESOURCE(stuff->shmseg, client);
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) { if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
client->errorValue = stuff->readOnly; client->errorValue = stuff->readOnly;
@ -1336,34 +1371,18 @@ ProcShmDispatch(ClientPtr client)
{ {
REQUEST(xReq); REQUEST(xReq);
if (stuff->data == X_ShmQueryVersion)
return ProcShmQueryVersion(client);
if (!client->local)
return BadRequest;
switch (stuff->data) { switch (stuff->data) {
case X_ShmQueryVersion:
return ProcShmQueryVersion(client);
case X_ShmAttach: case X_ShmAttach:
return ProcShmAttach(client); return ProcShmAttach(client);
case X_ShmDetach: case X_ShmDetach:
return ProcShmDetach(client); return ProcShmDetach(client);
case X_ShmPutImage: case X_ShmPutImage:
#ifdef PANORAMIX
if (!noPanoramiXExtension)
return ProcPanoramiXShmPutImage(client);
#endif
return ProcShmPutImage(client); return ProcShmPutImage(client);
case X_ShmGetImage: case X_ShmGetImage:
#ifdef PANORAMIX
if (!noPanoramiXExtension)
return ProcPanoramiXShmGetImage(client);
#endif
return ProcShmGetImage(client); return ProcShmGetImage(client);
case X_ShmCreatePixmap: case X_ShmCreatePixmap:
#ifdef PANORAMIX
if (!noPanoramiXExtension)
return ProcPanoramiXShmCreatePixmap(client);
#endif
return ProcShmCreatePixmap(client); return ProcShmCreatePixmap(client);
#ifdef SHM_FD_PASSING #ifdef SHM_FD_PASSING
case X_ShmAttachFd: case X_ShmAttachFd:
@ -1388,20 +1407,10 @@ SShmCompletionEvent(xShmCompletionEvent * from, xShmCompletionEvent * to)
cpswapl(from->offset, to->offset); cpswapl(from->offset, to->offset);
} }
static int _X_COLD
SProcShmQueryVersion(ClientPtr client)
{
REQUEST(xShmQueryVersionReq);
swaps(&stuff->length);
return ProcShmQueryVersion(client);
}
static int _X_COLD static int _X_COLD
SProcShmAttach(ClientPtr client) SProcShmAttach(ClientPtr client)
{ {
REQUEST(xShmAttachReq); REQUEST(xShmAttachReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmAttachReq); REQUEST_SIZE_MATCH(xShmAttachReq);
swapl(&stuff->shmseg); swapl(&stuff->shmseg);
swapl(&stuff->shmid); swapl(&stuff->shmid);
@ -1412,7 +1421,6 @@ static int _X_COLD
SProcShmDetach(ClientPtr client) SProcShmDetach(ClientPtr client)
{ {
REQUEST(xShmDetachReq); REQUEST(xShmDetachReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmDetachReq); REQUEST_SIZE_MATCH(xShmDetachReq);
swapl(&stuff->shmseg); swapl(&stuff->shmseg);
return ProcShmDetach(client); return ProcShmDetach(client);
@ -1422,7 +1430,6 @@ static int _X_COLD
SProcShmPutImage(ClientPtr client) SProcShmPutImage(ClientPtr client)
{ {
REQUEST(xShmPutImageReq); REQUEST(xShmPutImageReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmPutImageReq); REQUEST_SIZE_MATCH(xShmPutImageReq);
swapl(&stuff->drawable); swapl(&stuff->drawable);
swapl(&stuff->gc); swapl(&stuff->gc);
@ -1443,7 +1450,6 @@ static int _X_COLD
SProcShmGetImage(ClientPtr client) SProcShmGetImage(ClientPtr client)
{ {
REQUEST(xShmGetImageReq); REQUEST(xShmGetImageReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmGetImageReq); REQUEST_SIZE_MATCH(xShmGetImageReq);
swapl(&stuff->drawable); swapl(&stuff->drawable);
swaps(&stuff->x); swaps(&stuff->x);
@ -1460,7 +1466,6 @@ static int _X_COLD
SProcShmCreatePixmap(ClientPtr client) SProcShmCreatePixmap(ClientPtr client)
{ {
REQUEST(xShmCreatePixmapReq); REQUEST(xShmCreatePixmapReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmCreatePixmapReq); REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
swapl(&stuff->pid); swapl(&stuff->pid);
swapl(&stuff->drawable); swapl(&stuff->drawable);
@ -1476,8 +1481,6 @@ static int _X_COLD
SProcShmAttachFd(ClientPtr client) SProcShmAttachFd(ClientPtr client)
{ {
REQUEST(xShmAttachFdReq); REQUEST(xShmAttachFdReq);
SetReqFds(client, 1);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmAttachFdReq); REQUEST_SIZE_MATCH(xShmAttachFdReq);
swapl(&stuff->shmseg); swapl(&stuff->shmseg);
return ProcShmAttachFd(client); return ProcShmAttachFd(client);
@ -1487,7 +1490,6 @@ static int _X_COLD
SProcShmCreateSegment(ClientPtr client) SProcShmCreateSegment(ClientPtr client)
{ {
REQUEST(xShmCreateSegmentReq); REQUEST(xShmCreateSegmentReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmCreateSegmentReq); REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
swapl(&stuff->shmseg); swapl(&stuff->shmseg);
swapl(&stuff->size); swapl(&stuff->size);
@ -1500,13 +1502,9 @@ SProcShmDispatch(ClientPtr client)
{ {
REQUEST(xReq); REQUEST(xReq);
if (stuff->data == X_ShmQueryVersion)
return SProcShmQueryVersion(client);
if (!client->local)
return BadRequest;
switch (stuff->data) { switch (stuff->data) {
case X_ShmQueryVersion:
return ProcShmQueryVersion(client);
case X_ShmAttach: case X_ShmAttach:
return SProcShmAttach(client); return SProcShmAttach(client);
case X_ShmDetach: case X_ShmDetach:

View File

@ -27,9 +27,7 @@ in this Software without prior written authorization from The Open Group.
/* dixsleep.c - implement millisecond timeouts for X clients */ /* dixsleep.c - implement millisecond timeouts for X clients */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "sleepuntil.h" #include "sleepuntil.h"
#include <X11/X.h> #include <X11/X.h>

View File

@ -49,9 +49,7 @@ PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
@ -61,6 +59,8 @@ PERFORMANCE OF THIS SOFTWARE.
#include <X11/extensions/syncproto.h> #include <X11/extensions/syncproto.h>
#include "dix/dix_priv.h" #include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
#include "os/osdep.h"
#include "scrnintstr.h" #include "scrnintstr.h"
#include "os.h" #include "os.h"
@ -78,8 +78,6 @@ PERFORMANCE OF THIS SOFTWARE.
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#include "extinit_priv.h"
/* /*
* Local Global Variables * Local Global Variables
*/ */
@ -2152,31 +2150,10 @@ ProcSyncDispatch(ClientPtr client)
* Boring Swapping stuff ... * 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 static int _X_COLD
SProcSyncCreateCounter(ClientPtr client) SProcSyncCreateCounter(ClientPtr client)
{ {
REQUEST(xSyncCreateCounterReq); REQUEST(xSyncCreateCounterReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncCreateCounterReq); REQUEST_SIZE_MATCH(xSyncCreateCounterReq);
swapl(&stuff->cid); swapl(&stuff->cid);
swapl(&stuff->initial_value_lo); swapl(&stuff->initial_value_lo);
@ -2189,7 +2166,6 @@ static int _X_COLD
SProcSyncSetCounter(ClientPtr client) SProcSyncSetCounter(ClientPtr client)
{ {
REQUEST(xSyncSetCounterReq); REQUEST(xSyncSetCounterReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncSetCounterReq); REQUEST_SIZE_MATCH(xSyncSetCounterReq);
swapl(&stuff->cid); swapl(&stuff->cid);
swapl(&stuff->value_lo); swapl(&stuff->value_lo);
@ -2202,7 +2178,6 @@ static int _X_COLD
SProcSyncChangeCounter(ClientPtr client) SProcSyncChangeCounter(ClientPtr client)
{ {
REQUEST(xSyncChangeCounterReq); REQUEST(xSyncChangeCounterReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncChangeCounterReq); REQUEST_SIZE_MATCH(xSyncChangeCounterReq);
swapl(&stuff->cid); swapl(&stuff->cid);
swapl(&stuff->value_lo); swapl(&stuff->value_lo);
@ -2215,7 +2190,6 @@ static int _X_COLD
SProcSyncQueryCounter(ClientPtr client) SProcSyncQueryCounter(ClientPtr client)
{ {
REQUEST(xSyncQueryCounterReq); REQUEST(xSyncQueryCounterReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncQueryCounterReq); REQUEST_SIZE_MATCH(xSyncQueryCounterReq);
swapl(&stuff->counter); swapl(&stuff->counter);
@ -2226,7 +2200,6 @@ static int _X_COLD
SProcSyncDestroyCounter(ClientPtr client) SProcSyncDestroyCounter(ClientPtr client)
{ {
REQUEST(xSyncDestroyCounterReq); REQUEST(xSyncDestroyCounterReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncDestroyCounterReq); REQUEST_SIZE_MATCH(xSyncDestroyCounterReq);
swapl(&stuff->counter); swapl(&stuff->counter);
@ -2237,7 +2210,6 @@ static int _X_COLD
SProcSyncAwait(ClientPtr client) SProcSyncAwait(ClientPtr client)
{ {
REQUEST(xSyncAwaitReq); REQUEST(xSyncAwaitReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSyncAwaitReq); REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
SwapRestL(stuff); SwapRestL(stuff);
@ -2248,7 +2220,6 @@ static int _X_COLD
SProcSyncCreateAlarm(ClientPtr client) SProcSyncCreateAlarm(ClientPtr client)
{ {
REQUEST(xSyncCreateAlarmReq); REQUEST(xSyncCreateAlarmReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq); REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
swapl(&stuff->id); swapl(&stuff->id);
swapl(&stuff->valueMask); swapl(&stuff->valueMask);
@ -2261,7 +2232,6 @@ static int _X_COLD
SProcSyncChangeAlarm(ClientPtr client) SProcSyncChangeAlarm(ClientPtr client)
{ {
REQUEST(xSyncChangeAlarmReq); REQUEST(xSyncChangeAlarmReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq); REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
swapl(&stuff->alarm); swapl(&stuff->alarm);
swapl(&stuff->valueMask); swapl(&stuff->valueMask);
@ -2273,7 +2243,6 @@ static int _X_COLD
SProcSyncQueryAlarm(ClientPtr client) SProcSyncQueryAlarm(ClientPtr client)
{ {
REQUEST(xSyncQueryAlarmReq); REQUEST(xSyncQueryAlarmReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncQueryAlarmReq); REQUEST_SIZE_MATCH(xSyncQueryAlarmReq);
swapl(&stuff->alarm); swapl(&stuff->alarm);
@ -2284,7 +2253,6 @@ static int _X_COLD
SProcSyncDestroyAlarm(ClientPtr client) SProcSyncDestroyAlarm(ClientPtr client)
{ {
REQUEST(xSyncDestroyAlarmReq); REQUEST(xSyncDestroyAlarmReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq); REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq);
swapl(&stuff->alarm); swapl(&stuff->alarm);
@ -2295,7 +2263,6 @@ static int _X_COLD
SProcSyncSetPriority(ClientPtr client) SProcSyncSetPriority(ClientPtr client)
{ {
REQUEST(xSyncSetPriorityReq); REQUEST(xSyncSetPriorityReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncSetPriorityReq); REQUEST_SIZE_MATCH(xSyncSetPriorityReq);
swapl(&stuff->id); swapl(&stuff->id);
swapl(&stuff->priority); swapl(&stuff->priority);
@ -2307,7 +2274,6 @@ static int _X_COLD
SProcSyncGetPriority(ClientPtr client) SProcSyncGetPriority(ClientPtr client)
{ {
REQUEST(xSyncGetPriorityReq); REQUEST(xSyncGetPriorityReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncGetPriorityReq); REQUEST_SIZE_MATCH(xSyncGetPriorityReq);
swapl(&stuff->id); swapl(&stuff->id);
@ -2318,7 +2284,6 @@ static int _X_COLD
SProcSyncCreateFence(ClientPtr client) SProcSyncCreateFence(ClientPtr client)
{ {
REQUEST(xSyncCreateFenceReq); REQUEST(xSyncCreateFenceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncCreateFenceReq); REQUEST_SIZE_MATCH(xSyncCreateFenceReq);
swapl(&stuff->d); swapl(&stuff->d);
swapl(&stuff->fid); swapl(&stuff->fid);
@ -2330,7 +2295,6 @@ static int _X_COLD
SProcSyncTriggerFence(ClientPtr client) SProcSyncTriggerFence(ClientPtr client)
{ {
REQUEST(xSyncTriggerFenceReq); REQUEST(xSyncTriggerFenceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncTriggerFenceReq); REQUEST_SIZE_MATCH(xSyncTriggerFenceReq);
swapl(&stuff->fid); swapl(&stuff->fid);
@ -2341,7 +2305,6 @@ static int _X_COLD
SProcSyncResetFence(ClientPtr client) SProcSyncResetFence(ClientPtr client)
{ {
REQUEST(xSyncResetFenceReq); REQUEST(xSyncResetFenceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncResetFenceReq); REQUEST_SIZE_MATCH(xSyncResetFenceReq);
swapl(&stuff->fid); swapl(&stuff->fid);
@ -2352,7 +2315,6 @@ static int _X_COLD
SProcSyncDestroyFence(ClientPtr client) SProcSyncDestroyFence(ClientPtr client)
{ {
REQUEST(xSyncDestroyFenceReq); REQUEST(xSyncDestroyFenceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncDestroyFenceReq); REQUEST_SIZE_MATCH(xSyncDestroyFenceReq);
swapl(&stuff->fid); swapl(&stuff->fid);
@ -2363,7 +2325,6 @@ static int _X_COLD
SProcSyncQueryFence(ClientPtr client) SProcSyncQueryFence(ClientPtr client)
{ {
REQUEST(xSyncQueryFenceReq); REQUEST(xSyncQueryFenceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSyncQueryFenceReq); REQUEST_SIZE_MATCH(xSyncQueryFenceReq);
swapl(&stuff->fid); swapl(&stuff->fid);
@ -2374,7 +2335,6 @@ static int _X_COLD
SProcSyncAwaitFence(ClientPtr client) SProcSyncAwaitFence(ClientPtr client)
{ {
REQUEST(xSyncAwaitFenceReq); REQUEST(xSyncAwaitFenceReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq); REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq);
SwapRestL(stuff); SwapRestL(stuff);
@ -2388,9 +2348,9 @@ SProcSyncDispatch(ClientPtr client)
switch (stuff->data) { switch (stuff->data) {
case X_SyncInitialize: case X_SyncInitialize:
return SProcSyncInitialize(client); return ProcSyncInitialize(client);
case X_SyncListSystemCounters: case X_SyncListSystemCounters:
return SProcSyncListSystemCounters(client); return ProcSyncListSystemCounters(client);
case X_SyncCreateCounter: case X_SyncCreateCounter:
return SProcSyncCreateCounter(client); return SProcSyncCreateCounter(client);
case X_SyncSetCounter: case X_SyncSetCounter:

File diff suppressed because it is too large Load Diff

View File

@ -17,9 +17,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
********************************************************/ ********************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <stdarg.h> #include <stdarg.h>
#include "scrnintstr.h" #include "scrnintstr.h"
@ -280,3 +278,15 @@ XaceIsLocal(ClientPtr client)
{ {
return ClientIsLocal(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_MAJOR_VERSION 2
#define XACE_MINOR_VERSION 0 #define XACE_MINOR_VERSION 0
#include "dix/selection_priv.h"
#include "extnsionst.h" #include "extnsionst.h"
#include "pixmap.h" #include "pixmap.h"
#include "region.h" #include "region.h"
#include "window.h" #include "window.h"
#include "property.h" #include "property.h"
#include "selection.h"
/* Default window background */ /* Default window background */
#define XaceBackgroundNoneState(w) ((w)->forcedBG ? BackgroundPixel : None) #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]; extern CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
/* Entry point for hook functions. Called by Xserver. /* 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 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 */ /* determine whether any callbacks are present for the XACE hook */
int XaceHookIsSet(int 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 XaceHookAuthAvail(ClientPtr client, XID authId);
int XaceHookKeyAvail(xEventPtr ev, DeviceIntPtr dev, int count); int XaceHookKeyAvail(xEventPtr ev, DeviceIntPtr dev, int count);
/* Register / unregister a callback for a given hook. */
/* 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)
/* XTrans wrappers for use by security modules /* 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 #ifndef _XACESTR_H
#define _XACESTR_H #define _XACESTR_H
#include "dix/selection_priv.h"
#include "dix.h" #include "dix.h"
#include "resource.h" #include "resource.h"
#include "extnsionst.h" #include "extnsionst.h"
#include "window.h" #include "window.h"
#include "input.h" #include "input.h"
#include "property.h" #include "property.h"
#include "selection.h"
#include "xace.h" #include "xace.h"
/* XACE_CORE_DISPATCH */ /* XACE_CORE_DISPATCH */

View File

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

View File

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

View File

@ -2,33 +2,30 @@
Copyright (c) 2002 XFree86 Inc Copyright (c) 2002 XFree86 Inc
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xproto.h> #include <X11/Xproto.h>
#include <assert.h> #include <X11/extensions/XResproto.h>
#include "dix/registry_priv.h" #include "dix/registry_priv.h"
#include "miext/extinit_priv.h"
#include "os/client_priv.h"
#include "misc.h" #include "misc.h"
#include "os.h" #include "os.h"
#include "dixstruct.h" #include "dixstruct.h"
#include "extnsionst.h" #include "extnsionst.h"
#include "swaprep.h" #include "swaprep.h"
#include <X11/extensions/XResproto.h>
#include "pixmapstr.h" #include "pixmapstr.h"
#include "windowstr.h" #include "windowstr.h"
#include "gcstruct.h" #include "gcstruct.h"
#include "extinit_priv.h"
#include "protocol-versions.h" #include "protocol-versions.h"
#include "client.h"
#include "list.h" #include "list.h"
#include "misc.h" #include "misc.h"
#include <string.h>
#include "hashtable.h" #include "hashtable.h"
#include "picturestr.h" #include "picturestr.h"
@ -36,6 +33,8 @@
#include "compint.h" #include "compint.h"
#endif #endif
Bool noResExtension = FALSE;
/** @brief Holds fragments of responses for ConstructClientIds. /** @brief Holds fragments of responses for ConstructClientIds.
* *
* note: there is no consideration for data alignment */ * note: there is no consideration for data alignment */
@ -113,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. /** @brief Frees a list of fragments. Does not free() root node.
@param frags The head of the list of fragments @param frags The head of the list of fragments
@ -195,16 +179,15 @@ DestroyConstructResourceBytesCtx(ConstructResourceBytesCtx *ctx)
static int static int
ProcXResQueryVersion(ClientPtr client) ProcXResQueryVersion(ClientPtr client)
{ {
REQUEST_SIZE_MATCH(xXResQueryVersionReq);
xXResQueryVersionReply rep = { xXResQueryVersionReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
.length = 0,
.server_major = SERVER_XRES_MAJOR_VERSION, .server_major = SERVER_XRES_MAJOR_VERSION,
.server_minor = SERVER_XRES_MINOR_VERSION .server_minor = SERVER_XRES_MINOR_VERSION
}; };
REQUEST_SIZE_MATCH(xXResQueryVersionReq);
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -218,16 +201,12 @@ ProcXResQueryVersion(ClientPtr client)
static int static int
ProcXResQueryClients(ClientPtr client) ProcXResQueryClients(ClientPtr client)
{ {
/* REQUEST(xXResQueryClientsReq); */ int i, num_clients = 0;
xXResQueryClientsReply rep;
int *current_clients;
int i, num_clients;
REQUEST_SIZE_MATCH(xXResQueryClientsReq); REQUEST_SIZE_MATCH(xXResQueryClientsReq);
current_clients = xallocarray(currentMaxClients, sizeof(int)); int current_clients[currentMaxClients];
num_clients = 0;
for (i = 0; i < currentMaxClients; i++) { for (i = 0; i < currentMaxClients; i++) {
if (clients[i]) { if (clients[i]) {
current_clients[num_clients] = i; current_clients[num_clients] = i;
@ -235,7 +214,7 @@ ProcXResQueryClients(ClientPtr client)
} }
} }
rep = (xXResQueryClientsReply) { xXResQueryClientsReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
.length = bytes_to_int32(num_clients * sz_xXResClient), .length = bytes_to_int32(num_clients * sz_xXResClient),
@ -248,22 +227,21 @@ ProcXResQueryClients(ClientPtr client)
} }
WriteToClient(client, sizeof(xXResQueryClientsReply), &rep); WriteToClient(client, sizeof(xXResQueryClientsReply), &rep);
if (num_clients) { xXResClient scratch[num_clients];
xXResClient scratch;
if (num_clients) {
for (i = 0; i < num_clients; i++) { for (i = 0; i < num_clients; i++) {
scratch.resource_base = clients[current_clients[i]]->clientAsMask; scratch[i].resource_base = clients[current_clients[i]]->clientAsMask;
scratch.resource_mask = RESOURCE_ID_MASK; scratch[i].resource_mask = RESOURCE_ID_MASK;
if (client->swapped) { if (client->swapped) {
swapl(&scratch.resource_base); swapl(&scratch[i].resource_base);
swapl(&scratch.resource_mask); swapl(&scratch[i].resource_mask);
} }
WriteToClient(client, sz_xXResClient, &scratch);
} }
} }
free(current_clients); WriteToClient(client, sizeof(scratch), scratch);
return Success; return Success;
} }
@ -298,12 +276,10 @@ static int
ProcXResQueryClientResources(ClientPtr client) ProcXResQueryClientResources(ClientPtr client)
{ {
REQUEST(xXResQueryClientResourcesReq); REQUEST(xXResQueryClientResourcesReq);
xXResQueryClientResourcesReply rep;
int i, clientID, num_types;
int *counts;
REQUEST_SIZE_MATCH(xXResQueryClientResourcesReq); REQUEST_SIZE_MATCH(xXResQueryClientResourcesReq);
int i, clientID, num_types = 0;
clientID = CLIENT_ID(stuff->xid); clientID = CLIENT_ID(stuff->xid);
if ((clientID >= currentMaxClients) || !clients[clientID]) { if ((clientID >= currentMaxClients) || !clients[clientID]) {
@ -311,18 +287,21 @@ ProcXResQueryClientResources(ClientPtr client)
return BadValue; return BadValue;
} }
counts = calloc(lastResourceType + 1, sizeof(int)); int counts[lastResourceType + 1];
memset(counts, 0, sizeof(counts));
FindAllClientResources(clients[clientID], ResFindAllRes, counts); FindAllClientResources(clients[clientID], ResFindAllRes, counts);
num_types = 0; int cnt[lastResourceType + 1];
for (i = 0; i <= lastResourceType; i++) { for (i = 0; i <= lastResourceType; i++) {
if (counts[i]) if (counts[i]) {
cnt[num_types] = counts[i];
num_types++; num_types++;
} }
}
rep = (xXResQueryClientResourcesReply) { xXResQueryClientResourcesReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
.length = bytes_to_int32(num_types * sz_xXResType), .length = bytes_to_int32(num_types * sz_xXResType),
@ -334,28 +313,20 @@ ProcXResQueryClientResources(ClientPtr client)
swapl(&rep.num_types); swapl(&rep.num_types);
} }
WriteToClient(client, sizeof(xXResQueryClientResourcesReply), &rep); xXResType scratch[num_types];
if (num_types) { for (i = 0; i < num_types; i++) {
xXResType scratch; 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) { if (client->swapped) {
swapl(&scratch.resource_type); swapl(&scratch[i].resource_type);
swapl(&scratch.count); swapl(&scratch[i].count);
}
WriteToClient(client, sz_xXResType, &scratch);
} }
} }
free(counts); WriteToClient(client, sizeof(xXResQueryClientResourcesReply), &rep);
WriteToClient(client, sizeof(scratch), scratch);
return Success; return Success;
} }
@ -374,12 +345,11 @@ static int
ProcXResQueryClientPixmapBytes(ClientPtr client) ProcXResQueryClientPixmapBytes(ClientPtr client)
{ {
REQUEST(xXResQueryClientPixmapBytesReq); REQUEST(xXResQueryClientPixmapBytesReq);
xXResQueryClientPixmapBytesReply rep;
int clientID;
unsigned long bytes;
REQUEST_SIZE_MATCH(xXResQueryClientPixmapBytesReq); REQUEST_SIZE_MATCH(xXResQueryClientPixmapBytesReq);
int clientID;
unsigned long bytes = 0;
clientID = CLIENT_ID(stuff->xid); clientID = CLIENT_ID(stuff->xid);
if ((clientID >= currentMaxClients) || !clients[clientID]) { if ((clientID >= currentMaxClients) || !clients[clientID]) {
@ -387,20 +357,15 @@ ProcXResQueryClientPixmapBytes(ClientPtr client)
return BadValue; return BadValue;
} }
bytes = 0;
FindAllClientResources(clients[clientID], ResFindResourcePixmaps, FindAllClientResources(clients[clientID], ResFindResourcePixmaps,
(void *) (&bytes)); (void *) (&bytes));
rep = (xXResQueryClientPixmapBytesReply) { xXResQueryClientPixmapBytesReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
.length = 0,
.bytes = bytes, .bytes = bytes,
#ifdef _XSERVER64 #ifdef _XSERVER64
.bytes_overflow = bytes >> 32 .bytes_overflow = bytes >> 32
#else
.bytes_overflow = 0
#endif #endif
}; };
if (client->swapped) { if (client->swapped) {
@ -459,9 +424,10 @@ static Bool
ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask, ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
ConstructClientIdCtx *ctx) ConstructClientIdCtx *ctx)
{ {
xXResClientIdValue rep; xXResClientIdValue rep = {
.spec.client = client->clientAsMask,
};
rep.spec.client = client->clientAsMask;
if (client->swapped) { if (client->swapped) {
swapl (&rep.spec.client); swapl (&rep.spec.client);
} }
@ -473,7 +439,6 @@ ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
} }
rep.spec.mask = X_XResClientXIDMask; rep.spec.mask = X_XResClientXIDMask;
rep.length = 0;
if (sendClient->swapped) { if (sendClient->swapped) {
swapl (&rep.spec.mask); swapl (&rep.spec.mask);
/* swapl (&rep.length, n); - not required for rep.length = 0 */ /* swapl (&rep.length, n); - not required for rep.length = 0 */
@ -502,9 +467,6 @@ ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
if (sendClient->swapped) { if (sendClient->swapped) {
swapl (&rep.spec.mask); swapl (&rep.spec.mask);
swapl (&rep.length); swapl (&rep.length);
}
if (sendClient->swapped) {
swapl (value); swapl (value);
} }
memcpy(ptr, &rep, sizeof(rep)); memcpy(ptr, &rep, sizeof(rep));
@ -587,6 +549,19 @@ ProcXResQueryClientIds (ClientPtr client)
rc = ConstructClientIds(client, stuff->numSpecs, specs, &ctx); rc = ConstructClientIds(client, stuff->numSpecs, specs, &ctx);
if (rc == Success) { if (rc == Success) {
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 = { xXResQueryClientIdsReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
@ -594,8 +569,6 @@ ProcXResQueryClientIds (ClientPtr client)
.numIds = ctx.numIds .numIds = ctx.numIds
}; };
assert((ctx.resultBytes & 3) == 0);
if (client->swapped) { if (client->swapped) {
swaps (&rep.sequenceNumber); swaps (&rep.sequenceNumber);
swapl (&rep.length); swapl (&rep.length);
@ -603,9 +576,11 @@ ProcXResQueryClientIds (ClientPtr client)
} }
WriteToClient(client, sizeof(rep), &rep); WriteToClient(client, sizeof(rep), &rep);
WriteFragmentsToClient(client, &ctx.response); WriteToClient(client, ctx.resultBytes, buf);
free(buf);
} }
out:
DestroyConstructClientIdCtx(&ctx); DestroyConstructClientIdCtx(&ctx);
return rc; return rc;
@ -952,11 +927,11 @@ static int
ProcXResQueryResourceBytes (ClientPtr client) ProcXResQueryResourceBytes (ClientPtr client)
{ {
REQUEST(xXResQueryResourceBytesReq); REQUEST(xXResQueryResourceBytesReq);
REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
int rc; int rc;
ConstructResourceBytesCtx ctx; ConstructResourceBytesCtx ctx;
REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
if (stuff->numSpecs > UINT32_MAX / sizeof(ctx.specs[0])) if (stuff->numSpecs > UINT32_MAX / sizeof(ctx.specs[0]))
return BadLength; return BadLength;
REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq, REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq,
@ -987,10 +962,24 @@ ProcXResQueryResourceBytes (ClientPtr client)
SwapXResQueryResourceBytes(&ctx.response); SwapXResQueryResourceBytes(&ctx.response);
} }
WriteToClient(client, sizeof(rep), &rep); char *buf = calloc(1, ctx.resultBytes);
WriteFragmentsToClient(client, &ctx.response); 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);
WriteToClient(client, ctx.resultBytes, buf);
free(buf);
}
out:
DestroyConstructResourceBytesCtx(&ctx); DestroyConstructResourceBytesCtx(&ctx);
return rc; return rc;
@ -1080,7 +1069,6 @@ static int _X_COLD
SProcResDispatch (ClientPtr client) SProcResDispatch (ClientPtr client)
{ {
REQUEST(xReq); REQUEST(xReq);
swaps(&stuff->length);
switch (stuff->data) { switch (stuff->data) {
case X_XResQueryVersion: case X_XResQueryVersion:

View File

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

View File

@ -22,9 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* All rights reserved. * All rights reserved.
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <errno.h> #include <errno.h>
#include <sys/socket.h> #include <sys/socket.h>
@ -35,15 +33,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <X11/Xfuncproto.h> #include <X11/Xfuncproto.h>
#include "dix/registry_priv.h" #include "dix/registry_priv.h"
#include "dix/selection_priv.h"
#include "os/client_priv.h"
#include "selection.h"
#include "inputstr.h" #include "inputstr.h"
#include "scrnintstr.h" #include "scrnintstr.h"
#include "windowstr.h" #include "windowstr.h"
#include "propertyst.h" #include "propertyst.h"
#include "extnsionst.h" #include "extnsionst.h"
#include "xacestr.h" #include "xacestr.h"
#include "client.h"
#define _XSELINUX_NEED_FLASK_MAP #define _XSELINUX_NEED_FLASK_MAP
#include "xselinuxint.h" #include "xselinuxint.h"

View File

@ -17,9 +17,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
********************************************************/ ********************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <selinux/label.h> #include <selinux/label.h>

View File

@ -26,9 +26,7 @@
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xproto.h> #include <X11/Xproto.h>
@ -40,6 +38,7 @@
#include "dix/input_priv.h" #include "dix/input_priv.h"
#include "dix/dix_priv.h" #include "dix/dix_priv.h"
#include "dix/exevents_priv.h" #include "dix/exevents_priv.h"
#include "miext/extinit_priv.h"
#include "os/osdep.h" #include "os/osdep.h"
#include "misc.h" #include "misc.h"
@ -59,7 +58,8 @@
#include "xserver-properties.h" #include "xserver-properties.h"
#include "eventstr.h" #include "eventstr.h"
#include "inpututils.h" #include "inpututils.h"
#include "extinit_priv.h"
Bool noTestExtensions = FALSE;
/* XTest events are sent during request processing and may be interrupted by /* 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 * a SIGIO. We need a separate event list to avoid events overwriting each
@ -79,10 +79,10 @@ static InternalEvent *xtest_evlist;
*/ */
DeviceIntPtr xtestpointer, xtestkeyboard; DeviceIntPtr xtestpointer, xtestkeyboard;
#ifdef PANORAMIX #ifdef XINERAMA
#include "panoramiX.h" #include "panoramiX.h"
#include "panoramiXsrv.h" #include "panoramiXsrv.h"
#endif #endif /* XINERAMA */
static int XTestSwapFakeInput(ClientPtr /* client */ , static int XTestSwapFakeInput(ClientPtr /* client */ ,
xReq * /* req */ xReq * /* req */
@ -198,7 +198,7 @@ ProcXTestFakeInput(ClientPtr client)
int flags = 0; int flags = 0;
int need_ptr_update = 1; int need_ptr_update = 1;
nev = (stuff->length << 2) - sizeof(xReq); nev = (client->req_len << 2) - sizeof(xReq);
if ((nev % sizeof(xEvent)) || !nev) if ((nev % sizeof(xEvent)) || !nev)
return BadLength; return BadLength;
nev /= sizeof(xEvent); nev /= sizeof(xEvent);
@ -374,7 +374,6 @@ ProcXTestFakeInput(ClientPtr client)
/* swap the request back so we can simply re-execute it */ /* swap the request back so we can simply re-execute it */
if (client->swapped) { if (client->swapped) {
(void) XTestSwapFakeInput(client, (xReq *) stuff); (void) XTestSwapFakeInput(client, (xReq *) stuff);
swaps(&stuff->length);
} }
ResetCurrentRequest(client); ResetCurrentRequest(client);
client->sequence--; client->sequence--;
@ -488,8 +487,6 @@ static int _X_COLD
SProcXTestGetVersion(ClientPtr client) SProcXTestGetVersion(ClientPtr client)
{ {
REQUEST(xXTestGetVersionReq); REQUEST(xXTestGetVersionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXTestGetVersionReq); REQUEST_SIZE_MATCH(xXTestGetVersionReq);
swaps(&stuff->minorVersion); swaps(&stuff->minorVersion);
return ProcXTestGetVersion(client); return ProcXTestGetVersion(client);
@ -499,8 +496,6 @@ static int _X_COLD
SProcXTestCompareCursor(ClientPtr client) SProcXTestCompareCursor(ClientPtr client)
{ {
REQUEST(xXTestCompareCursorReq); REQUEST(xXTestCompareCursorReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXTestCompareCursorReq); REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
swapl(&stuff->window); swapl(&stuff->window);
swapl(&stuff->cursor); swapl(&stuff->cursor);
@ -515,7 +510,7 @@ XTestSwapFakeInput(ClientPtr client, xReq * req)
xEvent sev; xEvent sev;
EventSwapPtr proc; 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++) { for (ev = (xEvent *) &req[1]; --nev >= 0; ev++) {
int evtype = ev->u.u.type & 0177; int evtype = ev->u.u.type & 0177;
/* Swap event */ /* Swap event */
@ -538,23 +533,12 @@ SProcXTestFakeInput(ClientPtr client)
REQUEST(xReq); REQUEST(xReq);
swaps(&stuff->length);
n = XTestSwapFakeInput(client, stuff); n = XTestSwapFakeInput(client, stuff);
if (n != Success) if (n != Success)
return n; return n;
return ProcXTestFakeInput(client); 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 static int _X_COLD
SProcXTestDispatch(ClientPtr client) SProcXTestDispatch(ClientPtr client)
{ {
@ -567,7 +551,7 @@ SProcXTestDispatch(ClientPtr client)
case X_XTestFakeInput: case X_XTestFakeInput:
return SProcXTestFakeInput(client); return SProcXTestFakeInput(client);
case X_XTestGrabControl: case X_XTestGrabControl:
return SProcXTestGrabControl(client); return ProcXTestGrabControl(client);
default: default:
return BadRequest; return BadRequest;
} }

View File

@ -21,9 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE. SOFTWARE.
******************************************************************/ ******************************************************************/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <string.h> #include <string.h>
@ -50,12 +48,12 @@ SOFTWARE.
#include "xvdisp.h" #include "xvdisp.h"
#ifdef PANORAMIX #ifdef XINERAMA
#include "panoramiX.h" #include "panoramiX.h"
#include "panoramiXsrv.h" #include "panoramiXsrv.h"
unsigned long XvXRTPort; unsigned long XvXRTPort;
#endif #endif /* XINERAMA */
static int static int
SWriteQueryExtensionReply(ClientPtr client, xvQueryExtensionReply * rep) SWriteQueryExtensionReply(ClientPtr client, xvQueryExtensionReply * rep)
@ -323,7 +321,6 @@ ProcXvQueryAdaptors(ClientPtr client)
{ {
xvFormat format; xvFormat format;
xvAdaptorInfo ainfo; xvAdaptorInfo ainfo;
xvQueryAdaptorsReply rep;
int totalSize, na, nf, rc; int totalSize, na, nf, rc;
int nameSize; int nameSize;
XvAdaptorPtr pa; XvAdaptorPtr pa;
@ -339,27 +336,20 @@ ProcXvQueryAdaptors(ClientPtr client)
if (rc != Success) if (rc != Success)
return rc; return rc;
xvQueryAdaptorsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
};
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
XvGetScreenKey()); XvGetScreenKey());
if (!pxvs) { if (!pxvs) {
rep = (xvQueryAdaptorsReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.num_adaptors = 0
};
_WriteQueryAdaptorsReply(client, &rep); _WriteQueryAdaptorsReply(client, &rep);
return Success; return Success;
} }
rep = (xvQueryAdaptorsReply) { rep.num_adaptors = pxvs->nAdaptors;
.type = X_Reply,
.sequenceNumber = client->sequence,
.num_adaptors = pxvs->nAdaptors
};
/* CALCULATE THE TOTAL SIZE OF THE REPLY IN BYTES */ /* CALCULATE THE TOTAL SIZE OF THE REPLY IN BYTES */
@ -413,7 +403,6 @@ static int
ProcXvQueryEncodings(ClientPtr client) ProcXvQueryEncodings(ClientPtr client)
{ {
xvEncodingInfo einfo; xvEncodingInfo einfo;
xvQueryEncodingsReply rep;
int totalSize; int totalSize;
int nameSize; int nameSize;
XvPortPtr pPort; XvPortPtr pPort;
@ -425,12 +414,6 @@ ProcXvQueryEncodings(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); 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 */ /* FOR EACH ENCODING ADD UP THE BYTES FOR ENCODING NAMES */
ne = pPort->pAdaptor->nEncodings; ne = pPort->pAdaptor->nEncodings;
@ -441,7 +424,12 @@ ProcXvQueryEncodings(ClientPtr client)
pe++; 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); _WriteQueryEncodingsReply(client, &rep);
@ -463,7 +451,7 @@ ProcXvQueryEncodings(ClientPtr client)
} }
static int static int
ProcXvPutVideo(ClientPtr client) SingleXvPutVideo(ClientPtr client)
{ {
DrawablePtr pDraw; DrawablePtr pDraw;
XvPortPtr pPort; XvPortPtr pPort;
@ -492,8 +480,20 @@ ProcXvPutVideo(ClientPtr client)
stuff->drw_w, stuff->drw_h); stuff->drw_w, stuff->drw_h);
} }
static int XineramaXvPutVideo(ClientPtr client);
static int 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; DrawablePtr pDraw;
XvPortPtr pPort; XvPortPtr pPort;
@ -522,6 +522,18 @@ ProcXvPutStill(ClientPtr client)
stuff->drw_w, stuff->drw_h); 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 static int
ProcXvGetVideo(ClientPtr client) ProcXvGetVideo(ClientPtr client)
{ {
@ -617,7 +629,6 @@ ProcXvGrabPort(ClientPtr client)
{ {
int result, status; int result, status;
XvPortPtr pPort; XvPortPtr pPort;
xvGrabPortReply rep;
REQUEST(xvGrabPortReq); REQUEST(xvGrabPortReq);
REQUEST_SIZE_MATCH(xvGrabPortReq); REQUEST_SIZE_MATCH(xvGrabPortReq);
@ -629,10 +640,9 @@ ProcXvGrabPort(ClientPtr client)
if (status != Success) { if (status != Success) {
return status; return status;
} }
rep = (xvGrabPortReply) { xvGrabPortReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
.length = 0,
.result = result .result = result
}; };
@ -655,7 +665,7 @@ ProcXvUngrabPort(ClientPtr client)
} }
static int static int
ProcXvStopVideo(ClientPtr client) SingleXvStopVideo(ClientPtr client)
{ {
int ret; int ret;
DrawablePtr pDraw; DrawablePtr pDraw;
@ -673,8 +683,20 @@ ProcXvStopVideo(ClientPtr client)
return XvdiStopVideo(client, pPort, pDraw); return XvdiStopVideo(client, pPort, pDraw);
} }
static int XineramaXvStopVideo(ClientPtr client);
static int 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; int status;
XvPortPtr pPort; XvPortPtr pPort;
@ -700,13 +722,24 @@ ProcXvSetPortAttribute(ClientPtr client)
return status; 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 static int
ProcXvGetPortAttribute(ClientPtr client) ProcXvGetPortAttribute(ClientPtr client)
{ {
INT32 value; INT32 value;
int status; int status;
XvPortPtr pPort; XvPortPtr pPort;
xvGetPortAttributeReply rep;
REQUEST(xvGetPortAttributeReq); REQUEST(xvGetPortAttributeReq);
REQUEST_SIZE_MATCH(xvGetPortAttributeReq); REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
@ -724,10 +757,9 @@ ProcXvGetPortAttribute(ClientPtr client)
return status; return status;
} }
rep = (xvGetPortAttributeReply) { xvGetPortAttributeReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
.length = 0,
.value = value .value = value
}; };
@ -741,7 +773,6 @@ ProcXvQueryBestSize(ClientPtr client)
{ {
unsigned int actual_width, actual_height; unsigned int actual_width, actual_height;
XvPortPtr pPort; XvPortPtr pPort;
xvQueryBestSizeReply rep;
REQUEST(xvQueryBestSizeReq); REQUEST(xvQueryBestSizeReq);
REQUEST_SIZE_MATCH(xvQueryBestSizeReq); REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
@ -753,10 +784,9 @@ ProcXvQueryBestSize(ClientPtr client)
stuff->drw_w, stuff->drw_h, stuff->drw_w, stuff->drw_h,
&actual_width, &actual_height); &actual_width, &actual_height);
rep = (xvQueryBestSizeReply) { xvQueryBestSizeReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
.length = 0,
.actual_width = actual_width, .actual_width = actual_width,
.actual_height = actual_height .actual_height = actual_height
}; };
@ -772,7 +802,6 @@ ProcXvQueryPortAttributes(ClientPtr client)
int size, i; int size, i;
XvPortPtr pPort; XvPortPtr pPort;
XvAttributePtr pAtt; XvAttributePtr pAtt;
xvQueryPortAttributesReply rep;
xvAttributeInfo Info; xvAttributeInfo Info;
REQUEST(xvQueryPortAttributesReq); REQUEST(xvQueryPortAttributesReq);
@ -780,11 +809,10 @@ ProcXvQueryPortAttributes(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess);
rep = (xvQueryPortAttributesReply) { xvQueryPortAttributesReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
.num_attributes = pPort->pAdaptor->nAttributes, .num_attributes = pPort->pAdaptor->nAttributes,
.text_size = 0
}; };
for (i = 0, pAtt = pPort->pAdaptor->pAttributes; for (i = 0, pAtt = pPort->pAdaptor->pAttributes;
@ -815,7 +843,7 @@ ProcXvQueryPortAttributes(ClientPtr client)
} }
static int static int
ProcXvPutImage(ClientPtr client) SingleXvPutImage(ClientPtr client)
{ {
DrawablePtr pDraw; DrawablePtr pDraw;
XvPortPtr pPort; XvPortPtr pPort;
@ -871,10 +899,23 @@ ProcXvPutImage(ClientPtr client)
stuff->width, stuff->height); 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 #ifdef MITSHM
static int static int
ProcXvShmPutImage(ClientPtr client) SingleXvShmPutImage(ClientPtr client)
{ {
ShmDescPtr shmdesc; ShmDescPtr shmdesc;
DrawablePtr pDraw; DrawablePtr pDraw;
@ -947,13 +988,24 @@ ProcXvShmPutImage(ClientPtr client)
return status; return status;
} }
#else /* !MITSHM */
static int XineramaXvShmPutImage(ClientPtr client);
#endif /* MITSHM */
static int static int
ProcXvShmPutImage(ClientPtr client) ProcXvShmPutImage(ClientPtr client)
{ {
return BadImplementation; #ifdef MITSHM
} #ifdef XINERAMA
if (xvUseXinerama)
return XineramaXvShmPutImage(client);
#endif #endif
return SingleXvShmPutImage(client);
#else
return BadImplementation;
#endif
}
#ifdef XvMCExtension #ifdef XvMCExtension
#include "xvmcext.h" #include "xvmcext.h"
@ -1031,7 +1083,6 @@ ProcXvListImageFormats(ClientPtr client)
XvPortPtr pPort; XvPortPtr pPort;
XvImagePtr pImage; XvImagePtr pImage;
int i; int i;
xvListImageFormatsReply rep;
xvImageFormatInfo info; xvImageFormatInfo info;
REQUEST(xvListImageFormatsReq); REQUEST(xvListImageFormatsReq);
@ -1040,7 +1091,7 @@ ProcXvListImageFormats(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
rep = (xvListImageFormatsReply) { xvListImageFormatsReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence, .sequenceNumber = client->sequence,
.num_formats = pPort->pAdaptor->nImages, .num_formats = pPort->pAdaptor->nImages,
@ -1081,26 +1132,6 @@ ProcXvListImageFormats(ClientPtr client)
return Success; 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 int
ProcXvDispatch(ClientPtr client) ProcXvDispatch(ClientPtr client)
{ {
@ -1108,32 +1139,61 @@ ProcXvDispatch(ClientPtr client)
UpdateCurrentTime(); UpdateCurrentTime();
if (stuff->data >= xvNumRequests) { 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 BadRequest;
} }
return XvProcVector[stuff->data] (client);
} }
/* Swapped Procs */ /* 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 static int _X_COLD
SProcXvQueryAdaptors(ClientPtr client) SProcXvQueryAdaptors(ClientPtr client)
{ {
REQUEST(xvQueryAdaptorsReq); REQUEST(xvQueryAdaptorsReq);
REQUEST_SIZE_MATCH(xvQueryAdaptorsReq); REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
swaps(&stuff->length);
swapl(&stuff->window); swapl(&stuff->window);
return XvProcVector[xv_QueryAdaptors] (client); return ProcXvQueryAdaptors(client);
} }
static int _X_COLD static int _X_COLD
@ -1141,9 +1201,8 @@ SProcXvQueryEncodings(ClientPtr client)
{ {
REQUEST(xvQueryEncodingsReq); REQUEST(xvQueryEncodingsReq);
REQUEST_SIZE_MATCH(xvQueryEncodingsReq); REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
return XvProcVector[xv_QueryEncodings] (client); return ProcXvQueryEncodings(client);
} }
static int _X_COLD static int _X_COLD
@ -1151,10 +1210,9 @@ SProcXvGrabPort(ClientPtr client)
{ {
REQUEST(xvGrabPortReq); REQUEST(xvGrabPortReq);
REQUEST_SIZE_MATCH(xvGrabPortReq); REQUEST_SIZE_MATCH(xvGrabPortReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
swapl(&stuff->time); swapl(&stuff->time);
return XvProcVector[xv_GrabPort] (client); return ProcXvGrabPort(client);
} }
static int _X_COLD static int _X_COLD
@ -1162,10 +1220,9 @@ SProcXvUngrabPort(ClientPtr client)
{ {
REQUEST(xvUngrabPortReq); REQUEST(xvUngrabPortReq);
REQUEST_SIZE_MATCH(xvUngrabPortReq); REQUEST_SIZE_MATCH(xvUngrabPortReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
swapl(&stuff->time); swapl(&stuff->time);
return XvProcVector[xv_UngrabPort] (client); return ProcXvUngrabPort(client);
} }
static int _X_COLD static int _X_COLD
@ -1173,7 +1230,6 @@ SProcXvPutVideo(ClientPtr client)
{ {
REQUEST(xvPutVideoReq); REQUEST(xvPutVideoReq);
REQUEST_SIZE_MATCH(xvPutVideoReq); REQUEST_SIZE_MATCH(xvPutVideoReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
swapl(&stuff->drawable); swapl(&stuff->drawable);
swapl(&stuff->gc); swapl(&stuff->gc);
@ -1185,7 +1241,7 @@ SProcXvPutVideo(ClientPtr client)
swaps(&stuff->drw_y); swaps(&stuff->drw_y);
swaps(&stuff->drw_w); swaps(&stuff->drw_w);
swaps(&stuff->drw_h); swaps(&stuff->drw_h);
return XvProcVector[xv_PutVideo] (client); return ProcXvPutVideo(client);
} }
static int _X_COLD static int _X_COLD
@ -1193,7 +1249,6 @@ SProcXvPutStill(ClientPtr client)
{ {
REQUEST(xvPutStillReq); REQUEST(xvPutStillReq);
REQUEST_SIZE_MATCH(xvPutStillReq); REQUEST_SIZE_MATCH(xvPutStillReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
swapl(&stuff->drawable); swapl(&stuff->drawable);
swapl(&stuff->gc); swapl(&stuff->gc);
@ -1205,7 +1260,7 @@ SProcXvPutStill(ClientPtr client)
swaps(&stuff->drw_y); swaps(&stuff->drw_y);
swaps(&stuff->drw_w); swaps(&stuff->drw_w);
swaps(&stuff->drw_h); swaps(&stuff->drw_h);
return XvProcVector[xv_PutStill] (client); return ProcXvPutStill(client);
} }
static int _X_COLD static int _X_COLD
@ -1213,7 +1268,6 @@ SProcXvGetVideo(ClientPtr client)
{ {
REQUEST(xvGetVideoReq); REQUEST(xvGetVideoReq);
REQUEST_SIZE_MATCH(xvGetVideoReq); REQUEST_SIZE_MATCH(xvGetVideoReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
swapl(&stuff->drawable); swapl(&stuff->drawable);
swapl(&stuff->gc); swapl(&stuff->gc);
@ -1225,7 +1279,7 @@ SProcXvGetVideo(ClientPtr client)
swaps(&stuff->drw_y); swaps(&stuff->drw_y);
swaps(&stuff->drw_w); swaps(&stuff->drw_w);
swaps(&stuff->drw_h); swaps(&stuff->drw_h);
return XvProcVector[xv_GetVideo] (client); return ProcXvGetVideo(client);
} }
static int _X_COLD static int _X_COLD
@ -1233,7 +1287,6 @@ SProcXvGetStill(ClientPtr client)
{ {
REQUEST(xvGetStillReq); REQUEST(xvGetStillReq);
REQUEST_SIZE_MATCH(xvGetStillReq); REQUEST_SIZE_MATCH(xvGetStillReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
swapl(&stuff->drawable); swapl(&stuff->drawable);
swapl(&stuff->gc); swapl(&stuff->gc);
@ -1245,7 +1298,7 @@ SProcXvGetStill(ClientPtr client)
swaps(&stuff->drw_y); swaps(&stuff->drw_y);
swaps(&stuff->drw_w); swaps(&stuff->drw_w);
swaps(&stuff->drw_h); swaps(&stuff->drw_h);
return XvProcVector[xv_GetStill] (client); return ProcXvGetStill(client);
} }
static int _X_COLD static int _X_COLD
@ -1253,7 +1306,6 @@ SProcXvPutImage(ClientPtr client)
{ {
REQUEST(xvPutImageReq); REQUEST(xvPutImageReq);
REQUEST_AT_LEAST_SIZE(xvPutImageReq); REQUEST_AT_LEAST_SIZE(xvPutImageReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
swapl(&stuff->drawable); swapl(&stuff->drawable);
swapl(&stuff->gc); swapl(&stuff->gc);
@ -1268,7 +1320,7 @@ SProcXvPutImage(ClientPtr client)
swaps(&stuff->drw_h); swaps(&stuff->drw_h);
swaps(&stuff->width); swaps(&stuff->width);
swaps(&stuff->height); swaps(&stuff->height);
return XvProcVector[xv_PutImage] (client); return ProcXvPutImage(client);
} }
#ifdef MITSHM #ifdef MITSHM
@ -1277,7 +1329,6 @@ SProcXvShmPutImage(ClientPtr client)
{ {
REQUEST(xvShmPutImageReq); REQUEST(xvShmPutImageReq);
REQUEST_SIZE_MATCH(xvShmPutImageReq); REQUEST_SIZE_MATCH(xvShmPutImageReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
swapl(&stuff->drawable); swapl(&stuff->drawable);
swapl(&stuff->gc); swapl(&stuff->gc);
@ -1294,7 +1345,7 @@ SProcXvShmPutImage(ClientPtr client)
swaps(&stuff->drw_h); swaps(&stuff->drw_h);
swaps(&stuff->width); swaps(&stuff->width);
swaps(&stuff->height); swaps(&stuff->height);
return XvProcVector[xv_ShmPutImage] (client); return ProcXvShmPutImage(client);
} }
#else /* MITSHM */ #else /* MITSHM */
#define SProcXvShmPutImage ProcXvShmPutImage #define SProcXvShmPutImage ProcXvShmPutImage
@ -1305,9 +1356,8 @@ SProcXvSelectVideoNotify(ClientPtr client)
{ {
REQUEST(xvSelectVideoNotifyReq); REQUEST(xvSelectVideoNotifyReq);
REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq); REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
swaps(&stuff->length);
swapl(&stuff->drawable); swapl(&stuff->drawable);
return XvProcVector[xv_SelectVideoNotify] (client); return ProcXvSelectVideoNotify(client);
} }
static int _X_COLD static int _X_COLD
@ -1315,9 +1365,8 @@ SProcXvSelectPortNotify(ClientPtr client)
{ {
REQUEST(xvSelectPortNotifyReq); REQUEST(xvSelectPortNotifyReq);
REQUEST_SIZE_MATCH(xvSelectPortNotifyReq); REQUEST_SIZE_MATCH(xvSelectPortNotifyReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
return XvProcVector[xv_SelectPortNotify] (client); return ProcXvSelectPortNotify(client);
} }
static int _X_COLD static int _X_COLD
@ -1325,10 +1374,9 @@ SProcXvStopVideo(ClientPtr client)
{ {
REQUEST(xvStopVideoReq); REQUEST(xvStopVideoReq);
REQUEST_SIZE_MATCH(xvStopVideoReq); REQUEST_SIZE_MATCH(xvStopVideoReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
swapl(&stuff->drawable); swapl(&stuff->drawable);
return XvProcVector[xv_StopVideo] (client); return ProcXvStopVideo(client);
} }
static int _X_COLD static int _X_COLD
@ -1336,11 +1384,10 @@ SProcXvSetPortAttribute(ClientPtr client)
{ {
REQUEST(xvSetPortAttributeReq); REQUEST(xvSetPortAttributeReq);
REQUEST_SIZE_MATCH(xvSetPortAttributeReq); REQUEST_SIZE_MATCH(xvSetPortAttributeReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
swapl(&stuff->attribute); swapl(&stuff->attribute);
swapl(&stuff->value); swapl(&stuff->value);
return XvProcVector[xv_SetPortAttribute] (client); return ProcXvSetPortAttribute(client);
} }
static int _X_COLD static int _X_COLD
@ -1348,10 +1395,9 @@ SProcXvGetPortAttribute(ClientPtr client)
{ {
REQUEST(xvGetPortAttributeReq); REQUEST(xvGetPortAttributeReq);
REQUEST_SIZE_MATCH(xvGetPortAttributeReq); REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
swapl(&stuff->attribute); swapl(&stuff->attribute);
return XvProcVector[xv_GetPortAttribute] (client); return ProcXvGetPortAttribute(client);
} }
static int _X_COLD static int _X_COLD
@ -1359,13 +1405,12 @@ SProcXvQueryBestSize(ClientPtr client)
{ {
REQUEST(xvQueryBestSizeReq); REQUEST(xvQueryBestSizeReq);
REQUEST_SIZE_MATCH(xvQueryBestSizeReq); REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
swaps(&stuff->vid_w); swaps(&stuff->vid_w);
swaps(&stuff->vid_h); swaps(&stuff->vid_h);
swaps(&stuff->drw_w); swaps(&stuff->drw_w);
swaps(&stuff->drw_h); swaps(&stuff->drw_h);
return XvProcVector[xv_QueryBestSize] (client); return ProcXvQueryBestSize(client);
} }
static int _X_COLD static int _X_COLD
@ -1373,9 +1418,8 @@ SProcXvQueryPortAttributes(ClientPtr client)
{ {
REQUEST(xvQueryPortAttributesReq); REQUEST(xvQueryPortAttributesReq);
REQUEST_SIZE_MATCH(xvQueryPortAttributesReq); REQUEST_SIZE_MATCH(xvQueryPortAttributesReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
return XvProcVector[xv_QueryPortAttributes] (client); return ProcXvQueryPortAttributes(client);
} }
static int _X_COLD static int _X_COLD
@ -1383,12 +1427,11 @@ SProcXvQueryImageAttributes(ClientPtr client)
{ {
REQUEST(xvQueryImageAttributesReq); REQUEST(xvQueryImageAttributesReq);
REQUEST_SIZE_MATCH(xvQueryImageAttributesReq); REQUEST_SIZE_MATCH(xvQueryImageAttributesReq);
swaps(&stuff->length);
swapl(&stuff->port); swapl(&stuff->port);
swapl(&stuff->id); swapl(&stuff->id);
swaps(&stuff->width); swaps(&stuff->width);
swaps(&stuff->height); swaps(&stuff->height);
return XvProcVector[xv_QueryImageAttributes] (client); return ProcXvQueryImageAttributes(client);
} }
static int _X_COLD static int _X_COLD
@ -1396,31 +1439,10 @@ SProcXvListImageFormats(ClientPtr client)
{ {
REQUEST(xvListImageFormatsReq); REQUEST(xvListImageFormatsReq);
REQUEST_SIZE_MATCH(xvListImageFormatsReq); REQUEST_SIZE_MATCH(xvListImageFormatsReq);
swaps(&stuff->length);
swapl(&stuff->port); 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 int _X_COLD
SProcXvDispatch(ClientPtr client) SProcXvDispatch(ClientPtr client)
{ {
@ -1428,14 +1450,53 @@ SProcXvDispatch(ClientPtr client)
UpdateCurrentTime(); UpdateCurrentTime();
if (stuff->data >= xvNumRequests) { 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 BadRequest;
} }
return SXvProcVector[stuff->data] (client);
} }
#ifdef PANORAMIX #ifdef XINERAMA
static int static int
XineramaXvStopVideo(ClientPtr client) XineramaXvStopVideo(ClientPtr client)
{ {
@ -1459,7 +1520,7 @@ XineramaXvStopVideo(ClientPtr client)
if (port->info[i].id) { if (port->info[i].id) {
stuff->drawable = draw->info[i].id; stuff->drawable = draw->info[i].id;
stuff->port = port->info[i].id; stuff->port = port->info[i].id;
result = ProcXvStopVideo(client); result = SingleXvStopVideo(client);
} }
} }
@ -1483,7 +1544,7 @@ XineramaXvSetPortAttribute(ClientPtr client)
FOR_NSCREENS_BACKWARD(i) { FOR_NSCREENS_BACKWARD(i) {
if (port->info[i].id) { if (port->info[i].id) {
stuff->port = port->info[i].id; stuff->port = port->info[i].id;
result = ProcXvSetPortAttribute(client); result = SingleXvSetPortAttribute(client);
} }
} }
return result; return result;
@ -1536,14 +1597,14 @@ XineramaXvShmPutImage(ClientPtr client)
} }
stuff->send_event = (send_event && !i) ? 1 : 0; stuff->send_event = (send_event && !i) ? 1 : 0;
result = ProcXvShmPutImage(client); result = SingleXvShmPutImage(client);
} }
} }
return result; return result;
} }
#else #else
#define XineramaXvShmPutImage ProcXvShmPutImage #define XineramaXvShmPutImage ProcXvShmPutImage
#endif #endif /* MITSHM */
static int static int
XineramaXvPutImage(ClientPtr client) XineramaXvPutImage(ClientPtr client)
@ -1587,7 +1648,7 @@ XineramaXvPutImage(ClientPtr client)
stuff->drw_y -= screenInfo.screens[i]->y; stuff->drw_y -= screenInfo.screens[i]->y;
} }
result = ProcXvPutImage(client); result = SingleXvPutImage(client);
} }
} }
return result; return result;
@ -1635,7 +1696,7 @@ XineramaXvPutVideo(ClientPtr client)
stuff->drw_y -= screenInfo.screens[i]->y; stuff->drw_y -= screenInfo.screens[i]->y;
} }
result = ProcXvPutVideo(client); result = SingleXvPutVideo(client);
} }
} }
return result; return result;
@ -1683,7 +1744,7 @@ XineramaXvPutStill(ClientPtr client)
stuff->drw_y -= screenInfo.screens[i]->y; stuff->drw_y -= screenInfo.screens[i]->y;
} }
result = ProcXvPutStill(client); result = SingleXvPutStill(client);
} }
} }
return result; return result;
@ -1790,25 +1851,6 @@ XineramifyXv(void)
} }
} }
/* munge the dispatch vector */ xvUseXinerama = 1;
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
} }
#endif /* XINERAMA */

View File

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

View File

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

View File

@ -22,15 +22,6 @@
#define _XvBadPort (XvBadPort+XvErrorBase) #define _XvBadPort (XvBadPort+XvErrorBase)
typedef struct {
int version, revision;
int nAdaptors;
XvAdaptorPtr pAdaptors;
DestroyWindowProcPtr DestroyWindow;
DestroyPixmapProcPtr DestroyPixmap;
CloseScreenProcPtr CloseScreen;
} XvScreenRec, *XvScreenPtr;
typedef struct _XvPortNotifyRec { typedef struct _XvPortNotifyRec {
struct _XvPortNotifyRec *next; struct _XvPortNotifyRec *next;
ClientPtr client; ClientPtr client;
@ -88,4 +79,6 @@ int XvdiMatchPort(XvPortPtr pPort, DrawablePtr pDraw);
int XvdiGrabPort(ClientPtr client, XvPortPtr pPort, Time ctime, int *p_result); int XvdiGrabPort(ClientPtr client, XvPortPtr pPort, Time ctime, int *p_result);
int XvdiUngrabPort(ClientPtr client, XvPortPtr pPort, Time ctime); int XvdiUngrabPort(ClientPtr client, XvPortPtr pPort, Time ctime);
XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id);
#endif /* _XORG_XVDIX_PRIV_H */ #endif /* _XORG_XVDIX_PRIV_H */

View File

@ -73,9 +73,7 @@ SOFTWARE.
** **
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <string.h> #include <string.h>
#include <X11/X.h> #include <X11/X.h>
@ -83,6 +81,7 @@ SOFTWARE.
#include <X11/extensions/Xv.h> #include <X11/extensions/Xv.h>
#include <X11/extensions/Xvproto.h> #include <X11/extensions/Xvproto.h>
#include "miext/extinit_priv.h"
#include "Xext/xvdix_priv.h" #include "Xext/xvdix_priv.h"
#include "misc.h" #include "misc.h"
@ -92,16 +91,15 @@ SOFTWARE.
#include "pixmapstr.h" #include "pixmapstr.h"
#include "gcstruct.h" #include "gcstruct.h"
#include "extnsionst.h" #include "extnsionst.h"
#include "extinit_priv.h"
#include "dixstruct.h" #include "dixstruct.h"
#include "resource.h" #include "resource.h"
#include "opaque.h" #include "opaque.h"
#include "input.h" #include "input.h"
#ifdef PANORAMIX #ifdef XINERAMA
#include "panoramiX.h" #include "panoramiX.h"
#include "panoramiXsrv.h" #include "panoramiXsrv.h"
#endif #endif /* XINERAMA */
#include "xvdisp.h" #include "xvdisp.h"
#define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = ((XvScreenPtr) \ #define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = ((XvScreenPtr) \
@ -130,6 +128,8 @@ int XvReqCode;
static int XvEventBase; static int XvEventBase;
int XvErrorBase; int XvErrorBase;
int xvUseXinerama = 0;
RESTYPE XvRTPort; RESTYPE XvRTPort;
static RESTYPE XvRTEncoding; static RESTYPE XvRTEncoding;
static RESTYPE XvRTGrab; static RESTYPE XvRTGrab;
@ -176,9 +176,9 @@ XvExtensionInit(void)
ErrorF("XvExtensionInit: Unable to allocate resource types\n"); ErrorF("XvExtensionInit: Unable to allocate resource types\n");
return; return;
} }
#ifdef PANORAMIX #ifdef XINERAMA
XineramaRegisterConnectionBlockCallback(XineramifyXv); XineramaRegisterConnectionBlockCallback(XineramifyXv);
#endif #endif /* XINERAMA */
XvScreenGeneration = serverGeneration; XvScreenGeneration = serverGeneration;
} }
@ -269,9 +269,9 @@ XvScreenInit(ScreenPtr pScreen)
ErrorF("XvScreenInit: Unable to allocate resource types\n"); ErrorF("XvScreenInit: Unable to allocate resource types\n");
return BadAlloc; return BadAlloc;
} }
#ifdef PANORAMIX #ifdef XINERAMA
XineramaRegisterConnectionBlockCallback(XineramifyXv); XineramaRegisterConnectionBlockCallback(XineramifyXv);
#endif #endif /* XINERAMA */
XvScreenGeneration = serverGeneration; XvScreenGeneration = serverGeneration;
} }
@ -325,7 +325,7 @@ XvCloseScreen(ScreenPtr pScreen)
static void static void
XvResetProc(ExtensionEntry * extEntry) XvResetProc(ExtensionEntry * extEntry)
{ {
XvResetProcVector(); xvUseXinerama = 0;
} }
DevPrivateKey DevPrivateKey

View File

@ -1,12 +1,15 @@
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <string.h> #include <string.h>
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xfuncproto.h>
#include <X11/Xproto.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 "Xext/xvdix_priv.h"
#include "misc.h" #include "misc.h"
@ -15,14 +18,8 @@
#include "resource.h" #include "resource.h"
#include "scrnintstr.h" #include "scrnintstr.h"
#include "extnsionst.h" #include "extnsionst.h"
#include "extinit_priv.h"
#include "servermd.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 "xvmcext.h"
#include "protocol-versions.h"
#ifdef HAS_XVMCSHM #ifdef HAS_XVMCSHM
#include <sys/ipc.h> #include <sys/ipc.h>
@ -30,6 +27,9 @@
#include <sys/shm.h> #include <sys/shm.h>
#endif /* HAS_XVMCSHM */ #endif /* HAS_XVMCSHM */
#define SERVER_XVMC_MAJOR_VERSION 1
#define SERVER_XVMC_MINOR_VERSION 1
#define DR_CLIENT_DRIVER_NAME_SIZE 48 #define DR_CLIENT_DRIVER_NAME_SIZE 48
#define DR_BUSID_SIZE 48 #define DR_BUSID_SIZE 48
@ -45,8 +45,6 @@ static RESTYPE XvMCRTContext;
static RESTYPE XvMCRTSurface; static RESTYPE XvMCRTSurface;
static RESTYPE XvMCRTSubpicture; static RESTYPE XvMCRTSubpicture;
int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr) = NULL;
typedef struct { typedef struct {
int num_adaptors; int num_adaptors;
XvMCAdaptorPtr adaptors; XvMCAdaptorPtr adaptors;

View File

@ -84,13 +84,9 @@ typedef struct {
XvMCDestroySubpictureProcPtr DestroySubpicture; XvMCDestroySubpictureProcPtr DestroySubpicture;
} XvMCAdaptorRec, *XvMCAdaptorPtr; } XvMCAdaptorRec, *XvMCAdaptorPtr;
extern int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr);
extern _X_EXPORT int XvMCScreenInit(ScreenPtr pScreen, extern _X_EXPORT int XvMCScreenInit(ScreenPtr pScreen,
int num, XvMCAdaptorPtr adapt); int num, XvMCAdaptorPtr adapt);
extern _X_EXPORT XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id);
extern _X_EXPORT int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, const char *name, extern _X_EXPORT int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, const char *name,
const char *busID, int major, int minor, const char *busID, int major, int minor,
int patchLevel); int patchLevel);

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
@ -74,7 +72,6 @@ int _X_COLD
SProcXAllowDeviceEvents(ClientPtr client) SProcXAllowDeviceEvents(ClientPtr client)
{ {
REQUEST(xAllowDeviceEventsReq); REQUEST(xAllowDeviceEventsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq); REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
swapl(&stuff->time); swapl(&stuff->time);
return (ProcXAllowDeviceEvents(client)); return (ProcXAllowDeviceEvents(client));

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> /* control constants */ #include <X11/extensions/XIproto.h> /* control constants */
@ -78,7 +76,6 @@ SProcXChangeDeviceControl(ClientPtr client)
xDeviceCtl *ctl; xDeviceCtl *ctl;
REQUEST(xChangeDeviceControlReq); REQUEST(xChangeDeviceControlReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl)); REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
swaps(&stuff->control); swaps(&stuff->control);
ctl = (xDeviceCtl *) &stuff[1]; ctl = (xDeviceCtl *) &stuff[1];
@ -118,7 +115,7 @@ ProcXChangeDeviceControl(ClientPtr client)
REQUEST(xChangeDeviceControlReq); REQUEST(xChangeDeviceControlReq);
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl)); 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); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success) if (ret != Success)
goto out; goto out;

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
@ -75,7 +73,6 @@ int _X_COLD
SProcXChangeFeedbackControl(ClientPtr client) SProcXChangeFeedbackControl(ClientPtr client)
{ {
REQUEST(xChangeFeedbackControlReq); REQUEST(xChangeFeedbackControlReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq); REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
swapl(&stuff->mask); swapl(&stuff->mask);
return (ProcXChangeFeedbackControl(client)); return (ProcXChangeFeedbackControl(client));
@ -438,7 +435,7 @@ ProcXChangeFeedbackControl(ClientPtr client)
REQUEST(xChangeFeedbackControlReq); REQUEST(xChangeFeedbackControlReq);
REQUEST_AT_LEAST_SIZE(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); rc = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (rc != Success) if (rc != Success)
return rc; return rc;

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
@ -71,23 +69,6 @@ SOFTWARE.
* This procedure changes the keyboard device. * 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 int
ProcXChangeKeyboardDevice(ClientPtr client) ProcXChangeKeyboardDevice(ClientPtr client)
{ {

View File

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

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -77,7 +75,6 @@ SProcXChangeDeviceKeyMapping(ClientPtr client)
unsigned int count; unsigned int count;
REQUEST(xChangeDeviceKeyMappingReq); REQUEST(xChangeDeviceKeyMappingReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq); REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
count = stuff->keyCodes * stuff->keySymsPerKeyCode; count = stuff->keyCodes * stuff->keySymsPerKeyCode;
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32)); REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
@ -108,7 +105,7 @@ ProcXChangeDeviceKeyMapping(ClientPtr client)
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
if (ret != Success) if (ret != Success)
return ret; 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, ret = ChangeKeyMapping(client, dev, len, DeviceMappingNotify,
stuff->firstKeyCode, stuff->keyCodes, stuff->firstKeyCode, stuff->keyCodes,

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -77,7 +75,6 @@ int _X_COLD
SProcXChangeDeviceDontPropagateList(ClientPtr client) SProcXChangeDeviceDontPropagateList(ClientPtr client)
{ {
REQUEST(xChangeDeviceDontPropagateListReq); REQUEST(xChangeDeviceDontPropagateListReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq); REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
swapl(&stuff->window); swapl(&stuff->window);
swaps(&stuff->count); swaps(&stuff->count);
@ -104,7 +101,7 @@ ProcXChangeDeviceDontPropagateList(ClientPtr client)
REQUEST(xChangeDeviceDontPropagateListReq); REQUEST(xChangeDeviceDontPropagateListReq);
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq); REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
if (stuff->length != if (client->req_len !=
bytes_to_int32(sizeof(xChangeDeviceDontPropagateListReq)) + bytes_to_int32(sizeof(xChangeDeviceDontPropagateListReq)) +
stuff->count) stuff->count)
return BadLength; return BadLength;

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
@ -67,22 +65,6 @@ SOFTWARE.
#include "chgptr.h" #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. * 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 #ifndef CHGPTR_H
#define CHGPTR_H 1 #define CHGPTR_H 1
int SProcXChangePointerDevice(ClientPtr /* client */
);
int ProcXChangePointerDevice(ClientPtr /* client */ int ProcXChangePointerDevice(ClientPtr /* client */
); );

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */ #include "windowstr.h" /* window structure */
@ -64,21 +62,6 @@ SOFTWARE.
#include "closedev.h" #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 * 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 #ifndef CLOSEDEV_H
#define CLOSEDEV_H 1 #define CLOSEDEV_H 1
int SProcXCloseDevice(ClientPtr /* client */
);
int ProcXCloseDevice(ClientPtr /* client */ int ProcXCloseDevice(ClientPtr /* client */
); );

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
@ -61,21 +59,6 @@ SOFTWARE.
#include "devbell.h" #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. * 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 #ifndef DEVBELL_H
#define DEVBELL_H 1 #define DEVBELL_H 1
int SProcXDeviceBell(ClientPtr /* client */
);
int ProcXDeviceBell(ClientPtr /* client */ int ProcXDeviceBell(ClientPtr /* client */
); );

View File

@ -78,9 +78,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "dix/cursor_priv.h" #include "dix/cursor_priv.h"
@ -93,9 +91,11 @@ SOFTWARE.
#include <X11/extensions/XKBproto.h> #include <X11/extensions/XKBproto.h>
#include "dix/dix_priv.h" #include "dix/dix_priv.h"
#include "dix/dixgrabs_priv.h"
#include "dix/eventconvert.h" #include "dix/eventconvert.h"
#include "dix/exevents_priv.h" #include "dix/exevents_priv.h"
#include "dix/input_priv.h" #include "dix/input_priv.h"
#include "os/log_priv.h"
#include "inputstr.h" #include "inputstr.h"
#include "windowstr.h" #include "windowstr.h"
@ -105,7 +105,6 @@ SOFTWARE.
#include "exglobals.h" #include "exglobals.h"
#include "eventstr.h" #include "eventstr.h"
#include "dixevents.h" /* DeliverFocusedEvent */ #include "dixevents.h" /* DeliverFocusedEvent */
#include "dixgrabs.h" /* CreateGrab() */
#include "scrnintstr.h" #include "scrnintstr.h"
#include "listdev.h" /* for CopySwapXXXClass */ #include "listdev.h" /* for CopySwapXXXClass */
#include "xace.h" #include "xace.h"

View File

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

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
@ -61,20 +59,6 @@ SOFTWARE.
#include "getbmap.h" #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. * 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 #ifndef GETBMAP_H
#define GETBMAP_H 1 #define GETBMAP_H 1
int SProcXGetDeviceButtonMapping(ClientPtr /* client */
);
int ProcXGetDeviceButtonMapping(ClientPtr /* client */ int ProcXGetDeviceButtonMapping(ClientPtr /* client */
); );

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
@ -72,7 +70,6 @@ int _X_COLD
SProcXGetDeviceControl(ClientPtr client) SProcXGetDeviceControl(ClientPtr client)
{ {
REQUEST(xGetDeviceControlReq); REQUEST(xGetDeviceControlReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceControlReq); REQUEST_SIZE_MATCH(xGetDeviceControlReq);
swaps(&stuff->control); swaps(&stuff->control);
return (ProcXGetDeviceControl(client)); return (ProcXGetDeviceControl(client));

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
@ -61,21 +59,6 @@ SOFTWARE.
#include "getfctl.h" #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. * 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 #ifndef GETFCTL_H
#define GETFCTL_H 1 #define GETFCTL_H 1
int SProcXGetFeedbackControl(ClientPtr /* client */
);
int ProcXGetFeedbackControl(ClientPtr /* client */ int ProcXGetFeedbackControl(ClientPtr /* client */
); );

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "windowstr.h" /* focus struct */ #include "windowstr.h" /* focus struct */
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
@ -62,20 +60,6 @@ SOFTWARE.
#include "getfocus.h" #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. * 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 #ifndef GETFOCUS_H
#define GETFOCUS_H 1 #define GETFOCUS_H 1
int SProcXGetDeviceFocus(ClientPtr /* client */
);
int ProcXGetDeviceFocus(ClientPtr /* client */ int ProcXGetDeviceFocus(ClientPtr /* client */
); );

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
@ -64,21 +62,6 @@ SOFTWARE.
#include "getkmap.h" #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. * 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 #ifndef GETKMAP_H
#define GETKMAP_H 1 #define GETKMAP_H 1
int SProcXGetDeviceKeyMapping(ClientPtr /* client */
);
int ProcXGetDeviceKeyMapping(ClientPtr /* client */ int ProcXGetDeviceKeyMapping(ClientPtr /* client */
); );

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
@ -61,21 +59,6 @@ SOFTWARE.
#include "getmmap.h" #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. * 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 #ifndef GETMMAP_H
#define GETMMAP_H 1 #define GETMMAP_H 1
int SProcXGetDeviceModifierMapping(ClientPtr /* client */
);
int ProcXGetDeviceModifierMapping(ClientPtr /* client */ int ProcXGetDeviceModifierMapping(ClientPtr /* client */
); );

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -78,7 +76,6 @@ int _X_COLD
SProcXGetDeviceDontPropagateList(ClientPtr client) SProcXGetDeviceDontPropagateList(ClientPtr client)
{ {
REQUEST(xGetDeviceDontPropagateListReq); REQUEST(xGetDeviceDontPropagateListReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq); REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
swapl(&stuff->window); swapl(&stuff->window);
return (ProcXGetDeviceDontPropagateList(client)); return (ProcXGetDeviceDontPropagateList(client));

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -76,7 +74,6 @@ int _X_COLD
SProcXGetSelectedExtensionEvents(ClientPtr client) SProcXGetSelectedExtensionEvents(ClientPtr client)
{ {
REQUEST(xGetSelectedExtensionEventsReq); REQUEST(xGetSelectedExtensionEventsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq); REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
swapl(&stuff->window); swapl(&stuff->window);
return (ProcXGetSelectedExtensionEvents(client)); return (ProcXGetSelectedExtensionEvents(client));

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
@ -74,7 +72,6 @@ int _X_COLD
SProcXGetExtensionVersion(ClientPtr client) SProcXGetExtensionVersion(ClientPtr client)
{ {
REQUEST(xGetExtensionVersionReq); REQUEST(xGetExtensionVersionReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq); REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
swaps(&stuff->nbytes); swaps(&stuff->nbytes);
return (ProcXGetExtensionVersion(client)); return (ProcXGetExtensionVersion(client));
@ -94,7 +91,7 @@ ProcXGetExtensionVersion(ClientPtr client)
REQUEST(xGetExtensionVersionReq); REQUEST(xGetExtensionVersionReq);
REQUEST_AT_LEAST_SIZE(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)) stuff->nbytes))
return BadLength; return BadLength;

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -78,13 +76,13 @@ int _X_COLD
SProcXGrabDevice(ClientPtr client) SProcXGrabDevice(ClientPtr client)
{ {
REQUEST(xGrabDeviceReq); REQUEST(xGrabDeviceReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq); REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
swapl(&stuff->grabWindow); swapl(&stuff->grabWindow);
swapl(&stuff->time); swapl(&stuff->time);
swaps(&stuff->event_count); swaps(&stuff->event_count);
if (stuff->length != if (client->req_len !=
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count) bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
return BadLength; return BadLength;
@ -111,7 +109,7 @@ ProcXGrabDevice(ClientPtr client)
REQUEST(xGrabDeviceReq); REQUEST(xGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq); REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
if (stuff->length != if (client->req_len !=
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count) bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
return BadLength; return BadLength;

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -76,7 +74,6 @@ int _X_COLD
SProcXGrabDeviceButton(ClientPtr client) SProcXGrabDeviceButton(ClientPtr client)
{ {
REQUEST(xGrabDeviceButtonReq); REQUEST(xGrabDeviceButtonReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq); REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
swapl(&stuff->grabWindow); swapl(&stuff->grabWindow);
swaps(&stuff->modifiers); swaps(&stuff->modifiers);
@ -108,7 +105,7 @@ ProcXGrabDeviceButton(ClientPtr client)
REQUEST(xGrabDeviceButtonReq); REQUEST(xGrabDeviceButtonReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq); REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
if (stuff->length != if (client->req_len !=
bytes_to_int32(sizeof(xGrabDeviceButtonReq)) + stuff->event_count) bytes_to_int32(sizeof(xGrabDeviceButtonReq)) + stuff->event_count)
return BadLength; return BadLength;

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -76,7 +74,6 @@ int _X_COLD
SProcXGrabDeviceKey(ClientPtr client) SProcXGrabDeviceKey(ClientPtr client)
{ {
REQUEST(xGrabDeviceKeyReq); REQUEST(xGrabDeviceKeyReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq); REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
swapl(&stuff->grabWindow); swapl(&stuff->grabWindow);
swaps(&stuff->modifiers); swaps(&stuff->modifiers);
@ -106,7 +103,7 @@ ProcXGrabDeviceKey(ClientPtr client)
REQUEST(xGrabDeviceKeyReq); REQUEST(xGrabDeviceKeyReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq); REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
if (stuff->length != if (client->req_len !=
bytes_to_int32(sizeof(xGrabDeviceKeyReq)) + stuff->event_count) bytes_to_int32(sizeof(xGrabDeviceKeyReq)) + stuff->event_count)
return BadLength; return BadLength;

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -73,7 +71,6 @@ int _X_COLD
SProcXGetDeviceMotionEvents(ClientPtr client) SProcXGetDeviceMotionEvents(ClientPtr client)
{ {
REQUEST(xGetDeviceMotionEventsReq); REQUEST(xGetDeviceMotionEventsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq); REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
swapl(&stuff->start); swapl(&stuff->start);
swapl(&stuff->stop); swapl(&stuff->stop);

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/X.h> /* for inputstr.h */ #include <X11/X.h> /* for inputstr.h */
#include <X11/Xproto.h> /* Request macro */ #include <X11/Xproto.h> /* Request macro */
@ -70,20 +68,6 @@ SOFTWARE.
#include "xkbstr.h" #include "xkbstr.h"
#include "listdev.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 * 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 */ #define VPC 20 /* Max # valuators per chunk */
int SProcXListInputDevices(ClientPtr /* client */
);
int ProcXListInputDevices(ClientPtr /* client */ int ProcXListInputDevices(ClientPtr /* client */
); );

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
@ -66,21 +64,6 @@ SOFTWARE.
extern CARD8 event_base[]; 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. * 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 #ifndef OPENDEV_H
#define OPENDEV_H 1 #define OPENDEV_H 1
int SProcXOpenDevice(ClientPtr /* client */
);
int ProcXOpenDevice(ClientPtr /* client */ int ProcXOpenDevice(ClientPtr /* client */
); );

View File

@ -32,9 +32,7 @@ from The Open Group.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -49,20 +47,6 @@ from The Open Group.
#include "xkbstr.h" #include "xkbstr.h"
#include "queryst.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. * 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 #ifndef QUERYST_H
#define QUERYST_H 1 #define QUERYST_H 1
int SProcXQueryDeviceState(ClientPtr /* client */
);
int ProcXQueryDeviceState(ClientPtr /* client */ int ProcXQueryDeviceState(ClientPtr /* client */
); );

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XI2.h> #include <X11/extensions/XI2.h>
@ -123,7 +121,6 @@ int _X_COLD
SProcXSelectExtensionEvent(ClientPtr client) SProcXSelectExtensionEvent(ClientPtr client)
{ {
REQUEST(xSelectExtensionEventReq); REQUEST(xSelectExtensionEventReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq); REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
swapl(&stuff->window); swapl(&stuff->window);
swaps(&stuff->count); swaps(&stuff->count);
@ -150,7 +147,7 @@ ProcXSelectExtensionEvent(ClientPtr client)
REQUEST(xSelectExtensionEventReq); REQUEST(xSelectExtensionEventReq);
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq); REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
if (stuff->length != if (client->req_len !=
bytes_to_int32(sizeof(xSelectExtensionEventReq)) + stuff->count) bytes_to_int32(sizeof(xSelectExtensionEventReq)) + stuff->count)
return BadLength; return BadLength;

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -84,12 +82,11 @@ SProcXSendExtensionEvent(ClientPtr client)
EventSwapPtr proc; EventSwapPtr proc;
REQUEST(xSendExtensionEventReq); REQUEST(xSendExtensionEventReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq); REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
swapl(&stuff->destination); swapl(&stuff->destination);
swaps(&stuff->count); swaps(&stuff->count);
if (stuff->length != if (client->req_len !=
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count + bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
bytes_to_int32(stuff->num_events * sizeof(xEvent))) bytes_to_int32(stuff->num_events * sizeof(xEvent)))
return BadLength; return BadLength;
@ -135,7 +132,7 @@ ProcXSendExtensionEvent(ClientPtr client)
REQUEST(xSendExtensionEventReq); REQUEST(xSendExtensionEventReq);
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq); REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
if (stuff->length != if (client->req_len !=
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count + bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
(stuff->num_events * bytes_to_int32(sizeof(xEvent)))) (stuff->num_events * bytes_to_int32(sizeof(xEvent))))
return BadLength; return BadLength;

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -64,20 +62,6 @@ SOFTWARE.
#include "exglobals.h" #include "exglobals.h"
#include "setbmap.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. * This procedure lists the input devices available to the server.
@ -94,7 +78,7 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
REQUEST(xSetDeviceButtonMappingReq); REQUEST(xSetDeviceButtonMappingReq);
REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq); REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq);
if (stuff->length != if (client->req_len !=
bytes_to_int32(sizeof(xSetDeviceButtonMappingReq) + stuff->map_length)) bytes_to_int32(sizeof(xSetDeviceButtonMappingReq) + stuff->map_length))
return BadLength; return BadLength;

View File

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

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -64,20 +62,6 @@ SOFTWARE.
#include "exglobals.h" #include "exglobals.h"
#include "setdval.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. * This procedure sets the value of valuators on an extension input device.
@ -102,7 +86,7 @@ ProcXSetDeviceValuators(ClientPtr client)
.status = Success .status = Success
}; };
if (stuff->length != bytes_to_int32(sizeof(xSetDeviceValuatorsReq)) + if (client->req_len != bytes_to_int32(sizeof(xSetDeviceValuatorsReq)) +
stuff->num_valuators) stuff->num_valuators)
return BadLength; return BadLength;

View File

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

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -76,7 +74,6 @@ int _X_COLD
SProcXSetDeviceFocus(ClientPtr client) SProcXSetDeviceFocus(ClientPtr client)
{ {
REQUEST(xSetDeviceFocusReq); REQUEST(xSetDeviceFocusReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSetDeviceFocusReq); REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
swapl(&stuff->focus); swapl(&stuff->focus);
swapl(&stuff->time); swapl(&stuff->time);

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XI2.h> #include <X11/extensions/XI2.h>
@ -65,21 +63,6 @@ SOFTWARE.
#include "exglobals.h" #include "exglobals.h"
#include "setmmap.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. * Set the device Modifier mapping.
@ -96,7 +79,7 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
REQUEST(xSetDeviceModifierMappingReq); REQUEST(xSetDeviceModifierMappingReq);
REQUEST_AT_LEAST_SIZE(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)) (stuff->numKeyPerModifier << 1))
return BadLength; return BadLength;

View File

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

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
@ -64,20 +62,6 @@ SOFTWARE.
#include "exglobals.h" #include "exglobals.h"
#include "setmode.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. * 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 #ifndef SETMODE_H
#define SETMODE_H 1 #define SETMODE_H 1
int SProcXSetDeviceMode(ClientPtr /* client */
);
int ProcXSetDeviceMode(ClientPtr /* client */ int ProcXSetDeviceMode(ClientPtr /* client */
); );

View File

@ -54,9 +54,7 @@ SOFTWARE.
* Xnest could do the same thing. * Xnest could do the same thing.
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xproto.h> #include <X11/Xproto.h>

View File

@ -50,9 +50,7 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */ #include "windowstr.h" /* window structure */
@ -71,7 +69,6 @@ int _X_COLD
SProcXUngrabDevice(ClientPtr client) SProcXUngrabDevice(ClientPtr client)
{ {
REQUEST(xUngrabDeviceReq); REQUEST(xUngrabDeviceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceReq); REQUEST_SIZE_MATCH(xUngrabDeviceReq);
swapl(&stuff->time); swapl(&stuff->time);
return (ProcXUngrabDevice(client)); return (ProcXUngrabDevice(client));

View File

@ -50,19 +50,17 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
#include "dix/dix_priv.h" #include "dix/dix_priv.h"
#include "dix/dixgrabs_priv.h"
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */ #include "windowstr.h" /* window structure */
#include "exglobals.h" #include "exglobals.h"
#include "dixgrabs.h"
#include "ungrdevb.h" #include "ungrdevb.h"
#define AllModifiersMask ( \ #define AllModifiersMask ( \
@ -79,7 +77,6 @@ int _X_COLD
SProcXUngrabDeviceButton(ClientPtr client) SProcXUngrabDeviceButton(ClientPtr client)
{ {
REQUEST(xUngrabDeviceButtonReq); REQUEST(xUngrabDeviceButtonReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq); REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
swapl(&stuff->grabWindow); swapl(&stuff->grabWindow);
swaps(&stuff->modifiers); swaps(&stuff->modifiers);

View File

@ -50,19 +50,17 @@ SOFTWARE.
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h> #include <X11/extensions/XIproto.h>
#include "dix/dix_priv.h" #include "dix/dix_priv.h"
#include "dix/dixgrabs_priv.h"
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */ #include "windowstr.h" /* window structure */
#include "exglobals.h" #include "exglobals.h"
#include "dixgrabs.h"
#include "xkbsrv.h" #include "xkbsrv.h"
#include "xkbstr.h" #include "xkbstr.h"
#include "ungrdevk.h" #include "ungrdevk.h"
@ -81,7 +79,6 @@ int _X_COLD
SProcXUngrabDeviceKey(ClientPtr client) SProcXUngrabDeviceKey(ClientPtr client)
{ {
REQUEST(xUngrabDeviceKeyReq); REQUEST(xUngrabDeviceKeyReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq); REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
swapl(&stuff->grabWindow); swapl(&stuff->grabWindow);
swaps(&stuff->modifiers); swaps(&stuff->modifiers);

View File

@ -29,9 +29,7 @@
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI2.h> #include <X11/extensions/XI2.h>
#include <X11/extensions/XI2proto.h> #include <X11/extensions/XI2proto.h>
@ -53,10 +51,9 @@ SProcXIAllowEvents(ClientPtr client)
REQUEST(xXIAllowEventsReq); REQUEST(xXIAllowEventsReq);
REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq); REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq);
swaps(&stuff->length);
swaps(&stuff->deviceid); swaps(&stuff->deviceid);
swapl(&stuff->time); swapl(&stuff->time);
if (stuff->length > 3) { if (client->req_len > 3) {
xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq *) stuff; xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq *) stuff;
REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq); REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq);

View File

@ -41,9 +41,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "dix/cursor_priv.h" #include "dix/cursor_priv.h"
#include "dix/dix_priv.h" #include "dix/dix_priv.h"
@ -844,7 +842,6 @@ SProcXIBarrierReleasePointer(ClientPtr client)
REQUEST(xXIBarrierReleasePointerReq); REQUEST(xXIBarrierReleasePointerReq);
int i; int i;
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXIBarrierReleasePointerReq); REQUEST_AT_LEAST_SIZE(xXIBarrierReleasePointerReq);
swapl(&stuff->num_barriers); swapl(&stuff->num_barriers);

View File

@ -29,9 +29,7 @@
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/X.h> /* for inputstr.h */ #include <X11/X.h> /* for inputstr.h */
#include <X11/Xproto.h> /* Request macro */ #include <X11/Xproto.h> /* Request macro */
@ -61,7 +59,6 @@ SProcXIChangeCursor(ClientPtr client)
{ {
REQUEST(xXIChangeCursorReq); REQUEST(xXIChangeCursorReq);
REQUEST_SIZE_MATCH(xXIChangeCursorReq); REQUEST_SIZE_MATCH(xXIChangeCursorReq);
swaps(&stuff->length);
swapl(&stuff->win); swapl(&stuff->win);
swapl(&stuff->cursor); swapl(&stuff->cursor);
swaps(&stuff->deviceid); swaps(&stuff->deviceid);

View File

@ -30,9 +30,7 @@
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/X.h> /* for inputstr.h */ #include <X11/X.h> /* for inputstr.h */
#include <X11/Xproto.h> /* Request macro */ #include <X11/Xproto.h> /* Request macro */
@ -130,14 +128,6 @@ XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
* *
*/ */
int _X_COLD
SProcXIChangeHierarchy(ClientPtr client)
{
REQUEST(xXIChangeHierarchyReq);
swaps(&stuff->length);
return (ProcXIChangeHierarchy(client));
}
static int static int
add_master(ClientPtr client, xXIAddMasterInfo * c, int flags[MAXDEVICES]) add_master(ClientPtr client, xXIAddMasterInfo * c, int flags[MAXDEVICES])
{ {
@ -273,11 +263,13 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
goto unwind; goto unwind;
XTestptr = GetXTestDevice(ptr); XTestptr = GetXTestDevice(ptr);
BUG_RETURN_VAL(XTestptr == NULL, BadDevice);
rc = dixLookupDevice(&XTestptr, XTestptr->id, client, DixDestroyAccess); rc = dixLookupDevice(&XTestptr, XTestptr->id, client, DixDestroyAccess);
if (rc != Success) if (rc != Success)
goto unwind; goto unwind;
XTestkeybd = GetXTestDevice(keybd); XTestkeybd = GetXTestDevice(keybd);
BUG_RETURN_VAL(XTestkeybd == NULL, BadDevice);
rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client, DixDestroyAccess); rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client, DixDestroyAccess);
if (rc != Success) if (rc != Success)
goto unwind; goto unwind;

View File

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

View File

@ -23,9 +23,7 @@
* Author: Peter Hutterer, University of South Australia, NICTA * Author: Peter Hutterer, University of South Australia, NICTA
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/X.h> /* for inputstr.h */ #include <X11/X.h> /* for inputstr.h */
#include <X11/Xproto.h> /* Request macro */ #include <X11/Xproto.h> /* Request macro */
@ -38,7 +36,6 @@
#include "windowstr.h" /* window structure */ #include "windowstr.h" /* window structure */
#include "scrnintstr.h" /* screen structure */ #include "scrnintstr.h" /* screen structure */
#include "extnsionst.h" #include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "exevents.h" #include "exevents.h"
#include "exglobals.h" #include "exglobals.h"
#include "xigetclientpointer.h" #include "xigetclientpointer.h"
@ -54,7 +51,6 @@ SProcXIGetClientPointer(ClientPtr client)
REQUEST(xXIGetClientPointerReq); REQUEST(xXIGetClientPointerReq);
REQUEST_SIZE_MATCH(xXIGetClientPointerReq); REQUEST_SIZE_MATCH(xXIGetClientPointerReq);
swaps(&stuff->length);
swapl(&stuff->win); swapl(&stuff->win);
return ProcXIGetClientPointer(client); return ProcXIGetClientPointer(client);
} }

View File

@ -29,9 +29,7 @@
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI2.h> #include <X11/extensions/XI2.h>
#include <X11/extensions/XI2proto.h> #include <X11/extensions/XI2proto.h>
@ -55,7 +53,6 @@ SProcXIGrabDevice(ClientPtr client)
*/ */
REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq);
swaps(&stuff->length);
swaps(&stuff->deviceid); swaps(&stuff->deviceid);
swapl(&stuff->grab_window); swapl(&stuff->grab_window);
swapl(&stuff->cursor); swapl(&stuff->cursor);
@ -140,7 +137,6 @@ SProcXIUngrabDevice(ClientPtr client)
REQUEST(xXIUngrabDeviceReq); REQUEST(xXIUngrabDeviceReq);
REQUEST_SIZE_MATCH(xXIUngrabDeviceReq); REQUEST_SIZE_MATCH(xXIUngrabDeviceReq);
swaps(&stuff->length);
swaps(&stuff->deviceid); swaps(&stuff->deviceid);
swapl(&stuff->time); swapl(&stuff->time);

View File

@ -29,14 +29,13 @@
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/extensions/XI2.h> #include <X11/extensions/XI2.h>
#include <X11/extensions/XI2proto.h> #include <X11/extensions/XI2proto.h>
#include "dix/dix_priv.h" #include "dix/dix_priv.h"
#include "dix/dixgrabs_priv.h"
#include "dix/exevents_priv.h" #include "dix/exevents_priv.h"
#include "inputstr.h" /* DeviceIntPtr */ #include "inputstr.h" /* DeviceIntPtr */
@ -44,7 +43,6 @@
#include "swaprep.h" #include "swaprep.h"
#include "exglobals.h" /* BadDevice */ #include "exglobals.h" /* BadDevice */
#include "xipassivegrab.h" #include "xipassivegrab.h"
#include "dixgrabs.h"
#include "misc.h" #include "misc.h"
#include "inpututils.h" #include "inpututils.h"
@ -57,7 +55,6 @@ SProcXIPassiveGrabDevice(ClientPtr client)
REQUEST(xXIPassiveGrabDeviceReq); REQUEST(xXIPassiveGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
swaps(&stuff->length);
swaps(&stuff->deviceid); swaps(&stuff->deviceid);
swapl(&stuff->grab_window); swapl(&stuff->grab_window);
swapl(&stuff->cursor); swapl(&stuff->cursor);
@ -282,7 +279,6 @@ SProcXIPassiveUngrabDevice(ClientPtr client)
REQUEST(xXIPassiveUngrabDeviceReq); REQUEST(xXIPassiveUngrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq);
swaps(&stuff->length);
swapl(&stuff->grab_window); swapl(&stuff->grab_window);
swaps(&stuff->deviceid); swaps(&stuff->deviceid);
swapl(&stuff->detail); swapl(&stuff->detail);

View File

@ -25,9 +25,7 @@
/* This code is a modified version of randr/rrproperty.c */ /* This code is a modified version of randr/rrproperty.c */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <X11/extensions/XI.h> #include <X11/extensions/XI.h>
@ -1015,23 +1013,12 @@ ProcXGetDeviceProperty(ClientPtr client)
return Success; return Success;
} }
int _X_COLD
SProcXListDeviceProperties(ClientPtr client)
{
REQUEST(xListDevicePropertiesReq);
REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
swaps(&stuff->length);
return (ProcXListDeviceProperties(client));
}
int _X_COLD int _X_COLD
SProcXChangeDeviceProperty(ClientPtr client) SProcXChangeDeviceProperty(ClientPtr client)
{ {
REQUEST(xChangeDevicePropertyReq); REQUEST(xChangeDevicePropertyReq);
REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq); REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
swaps(&stuff->length);
swapl(&stuff->property); swapl(&stuff->property);
swapl(&stuff->type); swapl(&stuff->type);
swapl(&stuff->nUnits); swapl(&stuff->nUnits);
@ -1044,7 +1031,6 @@ SProcXDeleteDeviceProperty(ClientPtr client)
REQUEST(xDeleteDevicePropertyReq); REQUEST(xDeleteDevicePropertyReq);
REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq); REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
swaps(&stuff->length);
swapl(&stuff->property); swapl(&stuff->property);
return (ProcXDeleteDeviceProperty(client)); return (ProcXDeleteDeviceProperty(client));
} }
@ -1055,7 +1041,6 @@ SProcXGetDeviceProperty(ClientPtr client)
REQUEST(xGetDevicePropertyReq); REQUEST(xGetDevicePropertyReq);
REQUEST_SIZE_MATCH(xGetDevicePropertyReq); REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
swaps(&stuff->length);
swapl(&stuff->property); swapl(&stuff->property);
swapl(&stuff->type); swapl(&stuff->type);
swapl(&stuff->longOffset); swapl(&stuff->longOffset);
@ -1263,7 +1248,6 @@ SProcXIListProperties(ClientPtr client)
REQUEST(xXIListPropertiesReq); REQUEST(xXIListPropertiesReq);
REQUEST_SIZE_MATCH(xXIListPropertiesReq); REQUEST_SIZE_MATCH(xXIListPropertiesReq);
swaps(&stuff->length);
swaps(&stuff->deviceid); swaps(&stuff->deviceid);
return (ProcXIListProperties(client)); return (ProcXIListProperties(client));
} }
@ -1274,7 +1258,6 @@ SProcXIChangeProperty(ClientPtr client)
REQUEST(xXIChangePropertyReq); REQUEST(xXIChangePropertyReq);
REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq); REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
swaps(&stuff->length);
swaps(&stuff->deviceid); swaps(&stuff->deviceid);
swapl(&stuff->property); swapl(&stuff->property);
swapl(&stuff->type); swapl(&stuff->type);
@ -1288,7 +1271,6 @@ SProcXIDeleteProperty(ClientPtr client)
REQUEST(xXIDeletePropertyReq); REQUEST(xXIDeletePropertyReq);
REQUEST_SIZE_MATCH(xXIDeletePropertyReq); REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
swaps(&stuff->length);
swaps(&stuff->deviceid); swaps(&stuff->deviceid);
swapl(&stuff->property); swapl(&stuff->property);
return (ProcXIDeleteProperty(client)); return (ProcXIDeleteProperty(client));
@ -1300,7 +1282,6 @@ SProcXIGetProperty(ClientPtr client)
REQUEST(xXIGetPropertyReq); REQUEST(xXIGetPropertyReq);
REQUEST_SIZE_MATCH(xXIGetPropertyReq); REQUEST_SIZE_MATCH(xXIGetPropertyReq);
swaps(&stuff->length);
swaps(&stuff->deviceid); swaps(&stuff->deviceid);
swapl(&stuff->property); swapl(&stuff->property);
swapl(&stuff->type); swapl(&stuff->type);

View File

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

View File

@ -28,9 +28,7 @@
* @file Protocol handling for the XIQueryDevice request/reply. * @file Protocol handling for the XIQueryDevice request/reply.
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
@ -60,7 +58,6 @@ SProcXIQueryDevice(ClientPtr client)
REQUEST(xXIQueryDeviceReq); REQUEST(xXIQueryDeviceReq);
REQUEST_SIZE_MATCH(xXIQueryDeviceReq); REQUEST_SIZE_MATCH(xXIQueryDeviceReq);
swaps(&stuff->length);
swaps(&stuff->deviceid); swaps(&stuff->deviceid);
return ProcXIQueryDevice(client); return ProcXIQueryDevice(client);

View File

@ -29,9 +29,7 @@
* *
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include <X11/X.h> /* for inputstr.h */ #include <X11/X.h> /* for inputstr.h */
#include <X11/Xproto.h> /* Request macro */ #include <X11/Xproto.h> /* Request macro */
@ -50,9 +48,9 @@
#include "scrnintstr.h" #include "scrnintstr.h"
#include "xkbsrv.h" #include "xkbsrv.h"
#ifdef PANORAMIX #ifdef XINERAMA
#include "panoramiXsrv.h" #include "panoramiXsrv.h"
#endif #endif /* XINERAMA */
#include "inpututils.h" #include "inpututils.h"
#include "xiquerypointer.h" #include "xiquerypointer.h"
@ -69,7 +67,6 @@ SProcXIQueryPointer(ClientPtr client)
REQUEST(xXIQueryPointerReq); REQUEST(xXIQueryPointerReq);
REQUEST_SIZE_MATCH(xXIQueryPointerReq); REQUEST_SIZE_MATCH(xXIQueryPointerReq);
swaps(&stuff->length);
swaps(&stuff->deviceid); swaps(&stuff->deviceid);
swapl(&stuff->win); swapl(&stuff->win);
return (ProcXIQueryPointer(client)); return (ProcXIQueryPointer(client));
@ -186,7 +183,7 @@ ProcXIQueryPointer(ClientPtr client)
rep.win_y = 0; rep.win_y = 0;
} }
#ifdef PANORAMIX #ifdef XINERAMA
if (!noPanoramiXExtension) { if (!noPanoramiXExtension) {
rep.root_x += double_to_fp1616(screenInfo.screens[0]->x); rep.root_x += double_to_fp1616(screenInfo.screens[0]->x);
rep.root_y += double_to_fp1616(screenInfo.screens[0]->y); rep.root_y += double_to_fp1616(screenInfo.screens[0]->y);
@ -195,7 +192,7 @@ ProcXIQueryPointer(ClientPtr client)
rep.win_y += double_to_fp1616(screenInfo.screens[0]->y); rep.win_y += double_to_fp1616(screenInfo.screens[0]->y);
} }
} }
#endif #endif /* XINERAMA */
WriteReplyToClient(client, sizeof(xXIQueryPointerReply), &rep); WriteReplyToClient(client, sizeof(xXIQueryPointerReply), &rep);
if (buttons) if (buttons)

View File

@ -29,9 +29,7 @@
* Protocol handling for the XIQueryVersion request/reply. * Protocol handling for the XIQueryVersion request/reply.
*/ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h> #include <dix-config.h>
#endif
#include "inputstr.h" #include "inputstr.h"
@ -135,7 +133,6 @@ int _X_COLD
SProcXIQueryVersion(ClientPtr client) SProcXIQueryVersion(ClientPtr client)
{ {
REQUEST(xXIQueryVersionReq); REQUEST(xXIQueryVersionReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXIQueryVersionReq); REQUEST_AT_LEAST_SIZE(xXIQueryVersionReq);
swaps(&stuff->major_version); swaps(&stuff->major_version);
swaps(&stuff->minor_version); swaps(&stuff->minor_version);

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