Compare commits

...

248 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult c002b468a5 xwin: drop wrapping on ScreenRec->CloseScreen()
Instead of complicated wrapping, just call fbCloseScreen() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:26:47 +01:00
Enrico Weigelt, metux IT consult b5555c768c (!1785) doc: drop removed PaintWindowBackground() and PaintWindowBorder()
These have been removed 1.5 decades ago.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:19:33 +01:00
Enrico Weigelt, metux IT consult 0b66320b0a HACK 4: freebsd 2025-02-13 14:09:48 +01:00
Enrico Weigelt, metux IT consult 07136784f0 (nomerge) use incubator branch of xf86-video-intel
This queue still depends on some fixes in intel driver that haven't
been merged yet.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:48 +01:00
Enrico Weigelt, metux IT consult ca5c59282d 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>
2025-02-13 14:09:48 +01:00
Doug Brown 9bfdd642f2 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
2025-02-13 14:09:48 +01:00
Enrico Weigelt, metux IT consult 646a9ae840 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>
2025-02-13 14:09:48 +01:00
Enrico Weigelt, metux IT consult b2b0f689f3 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>
2025-02-13 14:09:48 +01:00
Enrico Weigelt, metux IT consult f6d9a1328a ci: always build with drivers 2025-02-13 14:09:48 +01:00
Enrico Weigelt, metux IT consult 464d90f51f ci: freebsd: fix missing xcb-aux and xcb-util-wm
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:48 +01:00
Enrico Weigelt, metux IT consult f089a051dd 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>
2025-02-13 14:09:48 +01:00
Enrico Weigelt, metux IT consult ba9987084d 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>
2025-02-13 14:09:48 +01:00
Enrico Weigelt, metux IT consult 35f3bc35d0 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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult ca1fd624d1 (!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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 08c40176b7 (!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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult fd3e71d43f (!1688) os: log: add syslog support
Add support for logging to syslog.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult bf4ad69fd0 (!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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 1e65f1f277 (!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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 3a870c4966 (!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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult d23b7a1afc (!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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult b49c721cca (!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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 1c752c1e89 (!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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 224ff30b03 (!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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult e447bd5ac2 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult a57215e493 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 77190f5f49 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 2e832c5610 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult ca455bb576 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult a2a7a73602 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult a4931305d4 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 6796d0b0aa (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult b295da292a (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 424aab0a49 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 729e261776 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 4f6e399b16 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 260fb36531 (!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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 7ea2bde1fc (!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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult bfb18f9dd9 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 68b7da3903 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 90139fff55 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult f5904e298b (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 54a40fe3f6 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 5c69562bd2 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 64645c3651 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult fa67c90419 (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>
2025-02-13 14:09:47 +01:00
Enrico Weigelt, metux IT consult 54a13393a1 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 3fbb7f2292 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 9eb6c9f3f9 FIXME (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 079a8c6145 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult ae8fab563b (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 9a79e41344 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 658461ebe6 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 7f7c3c8845 FIXME (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult a16a2954b4 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult e8448cdae9 FIXME (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 5fa1c5fa21 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult de6d1f6808 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 955a1ce385 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 160c640bff (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 741b019769 (submit/cleanup-damageext) damage: minor code formatting cleanups
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult e8f8b605c7 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 13ebe52348 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult f540e39e11 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult fb042961a9 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult d9f8e7a321 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult ab0cb5ded1 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult fb074d7f1e (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 4a864fa091 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 2a7a0ab44e (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 94dcb32f7a (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 955f8683c9 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 495fd2bbb4 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 9cd7989eb2 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 33a042b6f8 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 907d04d0dd (!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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult d9098a8e46 (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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 562943f1bb (!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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 7c57c2d89f (!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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 075b9ae6c1 (!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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult af4bdb6d3e (!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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult d6e8e7f70f (!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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 967267d60a (!1654) Xnest: replace XConnectionNumber() by xcb_get_file_descriptor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult d7cbe9613e (!1654) Xnest: replace XReparentWindow() by xcb_reparent_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 3537231d57 (!1654) Xnest: drop using XLoadQueryFont()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult edde433640 (!1654) Xnest: replace XTextWidth[16]() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult d146d1f8de (!1654) Xnest: load fonts via xcb
FIXME: support xf86bigfont extension
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 0973fc8410 (!1654) Xnest: replace XQueryBestSize() by xcb_query_best_size()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 45b4877ff3 (!1654) Xnest: replace X(Un)InstallColormap() by xcb_(un)install_colormap()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 61d3a56302 (!1654) Xnest: drop obsolete XGetVisualInfo() call and reundant colormaps
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 3be5207c67 (!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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult dd87de6cc8 (!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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult bf757a5164 (!1654) Xnest: fetch visuals from XCB setup data instead of Xlib
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 848e12874d (!1654) Xnest: screen move assigment between depths and visual assignment to own function
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 61b2983863 (!1654) Xnest: replace XParseGeometry() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult ce484e3c30 (!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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 66c727ab79 (!1654) Xnest: collect upstream window geometry in one xRectangle struct
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 806bbae1e1 (!1654) Xnest: replace XGetKeyboardControl() by xcb_get_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 3efc02f4ff (!1654) Xnest: replace XGetPointerMapping() by xcb_get_pointer_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 54ce887c51 (!1654) Xnest: replace XGetPointerControl() by xcb_get_pointer_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult bdf4a745bf (!1654) Xnest: replace XGetModifierMapping() by xcb_get_modifier_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 67db87e4c1 (!1654) Xnest: fetch keyboard mapping via xcb
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 682a4805e0 (!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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 78b6f4be97 (!1654) Xnest: use xcb for retrieving keymap controls
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 432deaeb46 (!1654) Xnest: replace XSelectInput() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 69bb48b07e (!1654) Xnest: replace XSetStandardProperties() by xcb functions
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult af64b96e88 (!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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult 4f4463477c (!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>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult e61460e469 (!1654) Xnest: Pixmap: replace XGetImage() by xcb_get_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult a43e009f5d (!1654) Xnest: GC: replace XGetImage() by xcb_get_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult a4313db46b (!1654) Xnest: replace XDestroyWindow() by xnest_destroy_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:46 +01:00
Enrico Weigelt, metux IT consult a1377e4b3c (!1654) Xnest: replace XCreatePixmapFromBitmapData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult c74a77f619 (!1654) Xnest: replace XCreateBitmapFromData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 13de55b44a (!1654) Xnest: replace XDefineCursor() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult b7857feca4 (!1654) Xnest: replace xnestRecolorCursor() by xcb_recolor_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult c8a1cc71db (!1654) Xnest: replace XFreeCursor() by xcb_free_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult c8f90647be (!1654) Xnest: replace XStoreColors() by xcb_store_colors()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 7c2b54d9fd (!1654) Xnest: replace XQueryColors() by xcb_query_colors()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 7108b36006 (!1654) Xnest: replace XSetWindowColormap() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 73c8b74b99 (!1654) Xnest: replace XSetWMColormapWindows() by xcb_icccm_set_wm_colormap_windows_checked()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult df20e9e2b4 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 9781db08d2 (!1654) Xnest: GC: set stipple filling via xcb_change_gc
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 9a4d45d29a (!1654) Xnest: replace XSetClipMask() by xcb_change_gc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult fb03311900 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult b591ea4fe6 (!1654) Xnest: replace XSetDashes() by xnest_set_dashes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult a9dc4124ee (!1654) Xnest: replace XChangeGC() by xcb_change_gc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 991f131014 (!1654) Xnest: replace XChangeKeyboardControl() by xcb_change_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult e9773e6746 (!1654) Xnest: replace XChangePointerControl() by xcb_change_pointer_control
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult df324c6150 (!1654) Xnest: replace XChangeWindowAttributes() by xcb_aux_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 0f20702684 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult e65b9a3618 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult db9c571da2 (!1654) Xnest: replace XFillRectangles() by xcb_poly_fill_rectangle()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 9e657bf0fc (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult e9e52dda3e (!1654) Xnest: replace XFillArcs() by xcb_poly_fill_arc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 144a1f01fd (!1654) Xnest: replace XFillPolygon() by xcb_fill_poly()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult eb3f6505e1 (!1654) Xnest: replace XCopyPlane() by xcb_copy_plane()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 897020f338 (!1654) Xnest: replace XCopyArea() by xcb_copy_area()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 5c4e17cf74 (!1654) Xnest: replace XDrawArcs() by xcb_poly_arc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 6c301f468b (!1654) Xnest: replace XDrawRectangles() by xcb_poly_rectangle()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 50159397bd (!1654) Xnest: replace XDrawSegments() by xcb_poly_segment()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 17686bf085 (!1654) Xnest: replace XDrawLines() by xcb_poly_line()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 78f10a9a9c (!1654) Xnest: replace XDrawPoints() by xcb_poly_point()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult dd703f91cb (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 947f258415 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 874bd3e8c3 (!1654) Xnest: use xcb_put_image() for PutImage requests
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 9a9113b61d (!1654) Xnest: use xcb_put_image() for creating cursors
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 11931842cf (!1654) Xnest: replace XCreatePixmapCursor() by xcb_create_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult a969ed51cf (!1654) Xnest: replace XConfigureWindow() calls by xcb_configure_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 9637417df7 (!1654) Xnest: use xcb for creating / destroying pixmaps
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult d1dd76233f (!1654) Xnest: replace XBell() by xcb_bell()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 2dfef51805 (!1654) Xnest: use xcb for (un)mapping windows
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 19505cf492 (!1654) Xnest: replace XCreateWindow() by use xcb_create_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult e3d3b07232 (!1654) Xnest: fetch root visual ID from screen data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult f3d4fdfc67 (!1654) Xnest: fetch keycode min/max from setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult f4fa2a78e2 (!1654) Xnest: fetch image metrics from xcb connection setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult ab5fdbb9b4 (!1654) Xnest: fetch default screen's root window from screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult f10f055bf8 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult e4b1fab4c8 (!1654) Xnest: fetch default colormap from xcb screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 45b1a0001d (!1654) Xnest: fetch root window depth from screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 39ca976eb8 (!1654) Xnest: fetch display size from xcb setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 5ad2a00ac7 (!1654) Xnest: fetch BlackPixel and WhitePixel from xcb setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult dfe5f1a749 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult cc1a05c5af (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 1f999dc94e (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 1ae32c0fa8 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 5cbd74a178 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult dd094c8270 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 47fcb6798a (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 1f3a8f42ef (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 2504bff578 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult b29ffcd79c (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 4426951b20 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 742f398e23 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 9868a2ca5b (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult a809fc7d82 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult a186427921 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 43418c8930 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 032200f1de (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 8ddabaa8f1 (!1601) Xext: xres: sort includes
Bring #include's into some logical order.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 289fe01302 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 936efc2359 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult dbbdb2cbb6 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 15052889b9 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult c6fb4baea9 (!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>
2025-02-13 14:09:45 +01:00
Enrico Weigelt, metux IT consult 3d4c4d4e86 (!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>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult d5f6ff80b0 (!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>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult cbb5d8aa79 (!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>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult dd04d3fe5c (!1714) glamor: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult c248346e78 (!1714) exa: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 987f37270b (!1714) damage: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 2f7c911730 (!1714) Xext: xv: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 5ec097d808 (!1714) Xext: shm: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.

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

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

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

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 1ecd80dc59 (!1714) dri3: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 2070c4b596 (!1714) render: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult c9680408a2 (!1714) xvmc: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 7ee9f4e397 (!1714) xv: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult ff29e0294e (!1714) xfixes: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 6b6dd29921 (!1714) Xext: shm: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

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

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

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 33abdc49cf (!1714) rootless: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window position notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult e5f5bb62f3 (!1714) dbe: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window position notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult a801164bf5 (!1714) composite: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window position notify hook instead.

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

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

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 08e8e1af35 FIXME (!1714) FIXME !!! mi: overlay: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult b3f592b481 (!1714) xwayland: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult d4deaac6e1 (!1714) xfree86: dri: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult dd10f37777 (!1714) xfree86: xv: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 26ce5c0eaa (!1714) kdrive: xv: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult c302f4bee4 (!1714) rootless: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult af38f95dc5 (!1714) composite: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 95f8fe39e0 (!1714) xv: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult e539a4e333 (!1714) damage: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 5101d9ce63 (!1714) render: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 539902e8b0 (!1714) present: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

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

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

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult c1c6045ca1 (!1705) xwin: drop wrapping on ScreenRec->ModifyPixmapHeader()
Instead of complicated wrapping, just call fbModifyPixmapHeader() directly.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 539bea0360 (!1705) xwin: drop wrapping on ScreenRec->MoveWindow()
Instead of complicated wrapping, just call fbMoveWindow() directly.

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

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 2c42e1eee9 (!1705) xwin: drop wrapping on ScreenRec->UnrealizeWindow()
Instead of complicated wrapping, just call fbUnrealizeWindow() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 1603cf9df3 (!1705) xwin: drop wrapping on ScreenRec->RealizeWindow()
Instead of complicated wrapping, just call fbRealizeWindow() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult f7e2c1030d (!1705) xwin: drop wrapping on ScreenRec->SetShape()
Instead of complicated wrapping, just call fbSetShape() directly.

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

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

The winFinishScreenInitFB() can also be made static now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 1ded56e9e6 (!1705) xwin: glx: drop glxWinUnrealizeWindow()
It does nothing more than just calling the original/wrapped function,
so we don't need that at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 9d02bc2f3f (!1705) xwin: glx: drop glxWinRealizeWindow()
It does nothing more than just calling the original/wrapped function,
so we don't need that at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 8f6f536324 (!1705) xwin: drop wrapping on ScreenRec->ChangeWindowAttributes()
Instead of complicated wrapping, just call fbCreateWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 5b0fe6cfe8 (!1705) xwin: drop wrapping on ScreenRec->CreateWindow()
Instead of complicated wrapping, just call fbCreateWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 1caa65d8bc (!1705) xwin: drop wrapping on ScreenRec->PositionWindow()
Instead of complicated wrapping, just call fbPositionWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 0f723a691b (!1705) xwin: drop wrapping on ScreenRec->DestroyWindow()
Instead of complicated wrapping, just call fbDestroyWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult e5f89d0f14 .github: workflow for building Xservers and some drivers
Add a github workflow that builds the Xservers on Linux and also
runs build-test of several common drivers against xorg sdk.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:44 +01:00
Enrico Weigelt, metux IT consult 15ceff0167 (!1787) mi: (re)export and document miPointerInitialize()
Xrdp project request exporting this function again, because (unlike the
usual xf86-video-* drivers) they need their own custom cursor handling:
RDP is designed to draw cursors on client side.

Also documenting what the function does.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:43 +01:00
Enrico Weigelt, metux IT consult 881184d664 (!1788) xfree86: doc: update docs on XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:14 +01:00
Enrico Weigelt, metux IT consult 44d38c9e8e (!1788) xfree86: inputtest: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:10 +01:00
Enrico Weigelt, metux IT consult 74ba2b1af5 (!1788) xfree86: modsetting: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:05 +01:00
Enrico Weigelt, metux IT consult 43b20e2369 (!1788) xfree86: exa: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:09:01 +01:00
Enrico Weigelt, metux IT consult cfdc7b7caa (!1788) xfree86: fbdevhw: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:08:56 +01:00
Enrico Weigelt, metux IT consult f365b8f211 (!1788) xfree86: xf86int10module: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:08:51 +01:00
Enrico Weigelt, metux IT consult 03967f3242 (!1788) xfree86: xfbmodule: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:08:46 +01:00
Enrico Weigelt, metux IT consult f8cec9cd77 (!1788) xfree86: vgaHWmodule: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:08:42 +01:00
Enrico Weigelt, metux IT consult 14aa275b97 (!1788) xfree86: shmodule: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:08:38 +01:00
Enrico Weigelt, metux IT consult 2eb9c61fb0 (!1788) xfree86: sfbmodule: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:08:33 +01:00
Enrico Weigelt, metux IT consult b48b09b950 (!1788) xfree86: glxmodule: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:08:29 +01:00
Enrico Weigelt, metux IT consult fac6868a87 (!1788) xfree86: fbmodule: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:08:24 +01:00
Enrico Weigelt, metux IT consult 7f805bf1a6 (!1788) glamor: use explicit field initializers for XF86ModuleData
Even though the order of these fields shouldn't change anytime
soon, it's still better programming style to name'em explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:08:20 +01:00
Enrico Weigelt, metux IT consult 0fd6315f74 (!1788) xfree86: xf86configure: use NULL instead of 0
Zero pointers should be initialized w/ NULL instead of raw 0.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-13 14:08:13 +01:00
308 changed files with 5624 additions and 4379 deletions

34
.github/scripts/compile-drivers.sh vendored Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
set -e
. .github/scripts/util.sh
export PKG_CONFIG_PATH="/usr/local/lib/x86_64-linux-gnu/pkgconfig/:$PKG_CONFIG_PATH"
export ACLOCAL_PATH="/usr/share/aclocal:/usr/local/share/aclocal"
export XORG_DRV_GIT=https://gitlab.freedesktop.org/xorg/driver
export XMTX_DRV_GIT=https://gitlab.freedesktop.org/metux/
mkdir -p $DRV_BUILD_DIR
cd $DRV_BUILD_DIR
# FIXME: add more drivers
build_drv_ac xf86-input-elographics $XORG_DRV_GIT/xf86-input-elographics xf86-input-elographics-1.4.4
build_drv_ac xf86-input-evdev $XORG_DRV_GIT/xf86-input-evdev xf86-input-evdev-2.10.6
build_drv_ac xf86-input-libinput $XORG_DRV_GIT/xf86-input-libinput xf86-input-libinput-1.4.0
build_drv_ac xf86-input-mouse $XORG_DRV_GIT/xf86-input-mouse master
build_drv_ac xf86-input-synaptics $XORG_DRV_GIT/xf86-input-synaptics xf86-input-synaptics-1.10.0
build_drv_ac xf86-video-amdgpu $XORG_DRV_GIT/xf86-video-amdgpu xf86-video-amdgpu-23.0.0
build_drv_ac xf86-video-armsoc $XORG_DRV_GIT/xf86-video-armsoc 1.4.1
build_drv_ac xf86-video-ati $XORG_DRV_GIT/xf86-video-ati xf86-video-ati-22.0.0
build_drv_ac xf86-video-intel $XMTX_DRV_GIT/xf86-video-intel.git incubate # upstream broken against current Xserver
build_drv_ac xf86-video-nouveau $XORG_DRV_GIT/xf86-video-nouveau xf86-video-nouveau-1.0.18
build_drv_ac xf86-video-omap $XORG_DRV_GIT/xf86-video-omap master
build_drv_ac xf86-video-qxl $XORG_DRV_GIT/xf86-video-qxl master
build_drv_ac xf86-video-r128 $XORG_DRV_GIT/xf86-video-r128 master
build_drv_ac xf86-video-vesa $XORG_DRV_GIT/xf86-video-vesa xf86-video-vesa-2.6.0
build_drv_ac xf86-video-vmware $XORG_DRV_GIT/xf86-video-vmware xf86-video-vmware-13.4.0
# doesn't compile on Linux
# build_drv_ac xf86-input-keyboard $XORG_DRV_GIT/xf86-input-keyboard master

6
.github/scripts/conf.sh vendored Normal file
View File

@ -0,0 +1,6 @@
export X11_PREFIX=/home/runner/x11
export PATH="$X11_PREFIX/bin:$PATH"
export PKG_CONFIG_PATH="$X11_PREFIX/lib/x86_64-linux-gnu/pkgconfig:$X11_PREFIX/lib/pkgconfig:$X11_PREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
export FDO_CI_CONCURRENT=`nproc`
export X11_BUILD_DIR=/home/runner/build-deps
export DRV_BUILD_DIR=/home/runner/build-drivers

27
.github/scripts/install-prereq.sh vendored Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
set -e
. .github/scripts/util.sh
mkdir -p $X11_BUILD_DIR
cd $X11_BUILD_DIR
build_meson rendercheck https://gitlab.freedesktop.org/xorg/test/rendercheck rendercheck-1.6
build_meson drm https://gitlab.freedesktop.org/mesa/drm libdrm-2.4.121 \
-Domap=enabled
build_meson libxcvt https://gitlab.freedesktop.org/xorg/lib/libxcvt libxcvt-0.1.0
build_ac xorgproto https://gitlab.freedesktop.org/xorg/proto/xorgproto xorgproto-2024.1
build_meson wayland https://gitlab.freedesktop.org/wayland/wayland 1.21.0 \
-Dtests=false -Ddocumentation=false -Ddtd_validation=false
build_meson wayland-protocols https://gitlab.freedesktop.org/wayland/wayland-protocols 1.38
build_meson libdecor https://gitlab.freedesktop.org/libdecor/libdecor 0.1.1 \
-D{demo,install_demo}=false
build_meson libei https://gitlab.freedesktop.org/libinput/libei 1.0.0 \
-Dtests=disabled -Ddocumentation=[] -Dliboeffis=enabled
build_ac_xts xts https://gitlab.freedesktop.org/xorg/test/xts master # dbbfa96c036e596346147081cbceda136e7c86c1
clone_source piglit https://gitlab.freedesktop.org/mesa/piglit main # 265896c86f90cb72e8f218ba6a3617fca8b9a1e3
echo '[xts]' > piglit/piglit.conf
echo "path=$X11_BUILD_DIR/xts" >> piglit/piglit.conf

104
.github/scripts/ubuntu/install-pkg.sh vendored Executable file
View File

@ -0,0 +1,104 @@
#!/bin/bash
set -e
# Packages which are needed by this script, but not for the xserver build
EPHEMERAL="
libexpat-dev
libgles2-mesa-dev
libxkbcommon-dev
x11-utils
x11-xserver-utils
xauth
xvfb
"
apt-get update
# mingw-w64-tools \
# gcc-mingw-w64-i686 \
# libz-mingw-w64-dev \
apt-get install -y \
$EPHEMERAL \
autoconf \
automake \
build-essential \
ca-certificates \
libaudit-dev \
libbsd-dev \
libcairo2-dev \
libdbus-1-dev \
libdrm-dev \
libegl1-mesa-dev \
libepoxy-dev \
libevdev2 \
libexpat1 \
libffi-dev \
libgbm-dev \
libgcrypt-dev \
libgl1-mesa-dev \
libgles2 \
libglx-mesa0 \
libinput10 \
libinput-dev \
libnvidia-egl-wayland-dev \
libpciaccess-dev \
libpixman-1-dev \
libselinux1-dev \
libspice-protocol-dev \
libsystemd-dev \
libudev-dev \
libunwind-dev \
libx11-dev \
libx11-xcb-dev \
libxau-dev \
libxcb-glx0-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-randr0-dev \
libxcb-render-util0-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-shm0-dev \
libxcb-util0-dev \
libxcb-xf86dri0-dev \
libxcb-xkb-dev \
libxcb-xv0-dev \
libxcb1-dev \
libxdmcp-dev \
libxext-dev \
libxfixes-dev \
libxfont-dev \
libxi-dev \
libxinerama-dev \
libxkbcommon0 \
libxkbfile-dev \
libxmu-dev \
libxmuu-dev \
libxpm-dev \
libxrender-dev \
libxres-dev \
libxshmfence-dev \
libxt-dev \
libxtst-dev \
libxv-dev \
mesa-common-dev \
meson \
nettle-dev \
libpango1.0-dev \
pkg-config \
x11-xkb-utils \
xfonts-utils \
xkb-data \
xtrans-dev \
xutils-dev \
libxaw7-dev \
python3-mako \
# python3-attr \
# python3-jinja2 \
# python3-numpy \
# python3-six \
# weston \

161
.github/scripts/ubuntu/remove-unused-pkg.sh vendored Executable file
View File

@ -0,0 +1,161 @@
#!/bin/bash
apt-mark auto \
7zip \
7zip-rar \
acl \
ant \
apache2 \
apache2-bin \
aria2 \
azure-cli \
brotli \
buildah \
chrony \
cifs-utils \
clang-format-16 \
clang-format-17 \
clang-format-18 \
clang-tidy-16 \
clang-tidy-17 \
clang-tidy-18 \
cloud-init \
dbus \
dotnet-sdk-8.0 \
eatmydata \
efibootmgr \
firefox \
fonts-noto-color-emoji \
gfortran \
gfortran-12 \
gfortran-13 \
gfortran-14 \
google-chrome-stable \
google-cloud-cli \
haveged \
keyutils \
kubectl \
libeatmydata1 \
libgmp-dev \
liblz4-dev \
libmysqlclient-dev \
libpq-dev \
libsqlite3-dev \
libssl-dev \
libtss2-esys-3.0.2-0t64 \
libtss2-mu-4.0.1-0t64 \
libtss2-rc0t64 \
libwrap0 \
libyaml-dev \
lsscsi \
lz4 \
mediainfo \
mercurial \
microsoft-edge-stable \
mysql-client \
mysql-server \
ncurses-base \
ncurses-bin \
ncurses-term \
nginx \
nvme-cli \
packages-microsoft-prod \
php-pear \
php8.3 \
php8.3-amqp \
php8.3-apcu \
php8.3-bcmath \
php8.3-bz2 \
php8.3-cgi \
php8.3-cli \
php8.3-common \
php8.3-curl \
php8.3-dba \
php8.3-dev \
php8.3-enchant \
php8.3-fpm \
php8.3-gd \
php8.3-gmp \
php8.3-igbinary \
php8.3-imagick \
php8.3-imap \
php8.3-interbase \
php8.3-intl \
php8.3-ldap \
php8.3-mbstring \
php8.3-memcache \
php8.3-memcached \
php8.3-mongodb \
php8.3-mysql \
php8.3-odbc \
php8.3-opcache \
php8.3-pcov \
php8.3-pgsql \
php8.3-phpdbg \
php8.3-pspell \
php8.3-readline \
php8.3-redis \
php8.3-snmp \
php8.3-soap \
php8.3-sqlite3 \
php8.3-sybase \
php8.3-tidy \
php8.3-xdebug \
php8.3-xml \
php8.3-xsl \
php8.3-yaml \
php8.3-zip \
php8.3-zmq \
pigz \
podman \
pollinate \
postgresql-16 \
powershell \
python-babel-localedata \
python3-babel \
python3-dev \
python3-jinja2 \
python3-json-pointer \
python3-jsonpatch \
python3-jsonschema \
python3-markupsafe \
python3-parted \
python3-pyrsistent \
python3-serial \
python3-six \
python3-tz \
python3-venv \
rpm \
ruby-full \
session-manager-plugin \
shellcheck \
shim-signed \
skopeo \
snap \
snmp \
software-properties-common \
sphinxsearch \
sqlite3 \
swig \
sysstat \
systemd-coredump \
temurin-11-jdk \
temurin-17-jdk \
temurin-21-jdk \
temurin-8-jdk \
texinfo \
tk \
tree \
tzdata \
ubuntu-server \
ubuntu-standard \
unzip \
upx-ucl \
util-linux \
walinuxagent \
xvfb \
xz-utils \
zip \
zsync
apt-get autoremove -y

90
.github/scripts/util.sh vendored Normal file
View File

@ -0,0 +1,90 @@
. .github/scripts/conf.sh
clone_source() {
local pkgname="$1"
local url="$2"
local ref="$3"
if [ ! -f $pkgname/.git/config ]; then
echo "need to clone $pkgname"
git clone $url $pkgname --branch=$ref --depth 1
else
echo "already cloned $pkgname"
fi
}
build_meson() {
local pkgname="$1"
local url="$2"
local ref="$3"
shift
shift
shift
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
echo "package $pkgname already built"
else
clone_source "$pkgname" "$url" "$ref"
(
cd $pkgname
meson "$@" build -Dprefix=$X11_PREFIX
ninja -j${FDO_CI_CONCURRENT:-4} -C build install
)
touch $X11_PREFIX/$pkgname.DONE
fi
}
build_ac() {
local pkgname="$1"
local url="$2"
local ref="$3"
shift
shift
shift
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
echo "package $pkgname already built"
else
clone_source "$pkgname" "$url" "$ref"
(
cd $pkgname
./autogen.sh --prefix=$X11_PREFIX
make -j${FDO_CI_CONCURRENT:-4} install
)
touch $X11_PREFIX/$pkgname.DONE
fi
}
build_drv_ac() {
local pkgname="$1"
local url="$2"
local ref="$3"
shift
shift
shift
clone_source "$pkgname" "$url" "$ref"
(
cd $pkgname
./autogen.sh # --prefix=$X11_PREFIX
make -j${FDO_CI_CONCURRENT:-4} # install
)
}
build_ac_xts() {
local pkgname="$1"
local url="$2"
local ref="$3"
shift
shift
shift
if [ -f $X11_PREFIX/$pkgname.DONE ]; then
echo "package $pkgname already built"
else
clone_source "$pkgname" "$url" "$ref"
(
cd $pkgname
CFLAGS=-fcommon ./autogen.sh --prefix=$X11_PREFIX
xvfb-run make -j${FDO_CI_CONCURRENT:-4} install
)
touch $X11_PREFIX/$pkgname.DONE
fi
}

118
.github/workflows/build-xserver.yml vendored Normal file
View File

@ -0,0 +1,118 @@
name: Build X servers
env:
MESON_BUILDDIR: "build"
X11_PREFIX: /home/runner/x11
X11_BUILD_DIR: /home/runner/build-deps
on:
push:
jobs:
xserver-build-ubuntu:
env:
MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=false -Dxcsecurity=true -Dxwayland=true -Dxorg=true -Dxvfb=true -Dxnest=true
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: prepare build environment
run: |
export MACHINE=`gcc -dumpmachine`
echo "PKG_CONFIG_PATH=$X11_PREFIX/share/pkgconfig:$X11_PREFIX/lib/$MACHINE/pkgconfig:$X11_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV"
sudo chown root /bin/tar && sudo chmod u+s /bin/tar
- name: apt cache
uses: actions/cache@v4
with:
path: /var/cache/apt
key: apt-cache-${{ hashFiles('.github/scripts/ubuntu/install-pkg.sh') }}
restore-keys: apt-cache-
- name: pkg install
run: sudo .github/scripts/ubuntu/install-pkg.sh
- name: X11 prereq cache
uses: actions/cache@v4
with:
path: |
${{ env.X11_PREFIX }}
${{ env.X11_BUILD_DIR }}/xts
${{ env.X11_BUILD_DIR }}/piglit
key: ${{ runner.os }}-x11-deps-${{ hashFiles('.github/scripts/install-prereq.sh') }}
restore-keys: ${{ runner.os }}-x11-deps-
- name: generic prereq
run: sudo .github/scripts/install-prereq.sh
- name: build
run: .gitlab-ci/meson-build.sh
- name: tests (may fail)
continue-on-error: true
run: meson test -C "${{ env.MESON_BUILDDIR }}" --print-errorlogs || true
env:
XTEST_DIR: ${{ env.X11_BUILD_DIR }}/xts
PIGLIT_DIR: ${{ env.X11_BUILD_DIR }}/piglit
- name: archive build logs
uses: actions/upload-artifact@v4
with:
name: build-logs
path: |
build/meson-logs/*
- name: ddx build check
run: .gitlab-ci/check-ddx-build.sh
- name: manpage check
run: .gitlab-ci/manpages-check
drivers-build-ubuntu:
env:
MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=false -Dwerror=false -Dxcsecurity=false -Dxwayland=false -Dxorg=true -Dxvfb=false -Dxnest=false
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: prepare build environment
run: |
export MACHINE=`gcc -dumpmachine`
echo "PKG_CONFIG_PATH=$X11_PREFIX/share/pkgconfig:$X11_PREFIX/lib/$MACHINE/pkgconfig:$X11_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV"
sudo chown root /bin/tar && sudo chmod u+s /bin/tar
- name: apt cache
uses: actions/cache@v4
with:
path: /var/cache/apt
key: apt-cache-${{ hashFiles('.github/scripts/ubuntu/install-pkg.sh') }}
restore-keys: apt-cache-
- name: pkg install
run: sudo .github/scripts/ubuntu/install-pkg.sh
- name: X11 prereq cache
uses: actions/cache@v4
with:
path: |
${{ env.X11_PREFIX }}
${{ env.X11_BUILD_DIR }}/xts
${{ env.X11_BUILD_DIR }}/piglit
key: ${{ runner.os }}-x11-deps-${{ hashFiles('.github/scripts/install-prereq.sh') }}
restore-keys: ${{ runner.os }}-x11-deps-
- name: generic prereq
run: sudo .github/scripts/install-prereq.sh
- name: build xserver sdk
run: |
echo -n > .meson_environment
echo "export MESON_BUILDDIR=$MESON_BUILDDIR" >> .meson_environment
echo "export PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> .meson_environment
.gitlab-ci/meson-build.sh --skip-test
sudo meson install --no-rebuild -C "$MESON_BUILDDIR"
sudo mkdir -p /usr/local/lib/$MACHINE/xorg/modules # /home/runner/x11/lib/xorg/modules
sudo chown -R runner /usr/local/lib/$MACHINE/xorg/modules # /home/runner/x11/lib/xorg/modules
- name: compile drivers
run: .github/scripts/compile-drivers.sh

View File

@ -21,10 +21,10 @@ variables:
REPO_URL_XORGPROTO: 'https://gitlab.freedesktop.org/xorg/proto/xorgproto.git'
XORG_DEBIAN_VERSION: 'bullseye-slim'
XORG_DEBIAN_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh'
XORG_DEBIAN_TAG: '2025-02-10-intel'
XORG_FREEBSD_VERSION: '14.0'
XORG_DEBIAN_TAG: '2025-02-12-xvmc'
XORG_FREEBSD_VERSION: '14.1'
XORG_FREEBSD_EXEC: ''
XORG_FREEBSD_TAG: '2024-06-10.0'
XORG_FREEBSD_TAG: '2024-06-10.0-1'
include:
- project: 'freedesktop/ci-templates'
@ -109,7 +109,7 @@ stages:
FDO_DISTRIBUTION_TAG: '$XORG_FREEBSD_TAG'
FDO_DISTRIBUTION_VERSION: '$XORG_FREEBSD_VERSION'
FDO_DISTRIBUTION_EXEC: ''
FDO_DISTRIBUTION_PACKAGES: 'git gcc pkgconf autoconf automake libtool xorg-macros xorgproto bash meson ninja pixman xtrans libXau libXdmcp libXfont2 libxkbfile libxcvt libpciaccess font-util libepoll-shim'
FDO_DISTRIBUTION_PACKAGES: 'git gcc pkgconf autoconf automake libtool xorg-macros xorgproto bash meson ninja pixman xtrans libXau libXdmcp libXfont2 libxkbfile libxcvt libpciaccess font-util libepoll-shim libxvmc xcb-util xcb-util-wm'
debian-bullseye:
extends:
@ -152,7 +152,7 @@ freebsd-image:
- $MESON_BUILDDIR/meson-logs/
- $MESON_BUILDDIR/test/piglit-results/
variables:
MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true
MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true -Dxv=true -Dxvmc=true
CCACHE_COMPILERCHECK: content
CCACHE_DIR: /cache/xserver/cache
LC_ALL: C.UTF-8
@ -202,14 +202,14 @@ mingw-cross-build:
script:
- .gitlab-ci/meson-build.sh --run-install
variables:
MESON_ARGS: --cross-file=.gitlab-ci/cross-i686-w64-mingw32.txt -Dglx=false -Dlisten_tcp=true
MESON_ARGS: --cross-file=.gitlab-ci/cross-i686-w64-mingw32.txt -Dglx=false -Dlisten_tcp=true -Dxvmc=true -Dxv=true
freebsd:
stage: build-and-test
extends:
- .xorg-image@freebsd
variables:
MESON_ARGS: -Dglx=false -Dglamor=false -Dudev=false -Dudev_kms=false
MESON_ARGS: -Dglx=false -Dglamor=false -Dudev=false -Dudev_kms=false -Dxvmc=true -Dxv=true
script:
# running of of disk space without this
# needed until https://gitlab.freedesktop.org/freedesktop/ci-templates/-/issues/67 is fixed
@ -218,6 +218,8 @@ freebsd:
- /app/vmctl start
- set +e
- scp -r $PWD "vm:"
# need to install extra packages, as long as image cant be rebuilt
- /app/vmctl exec "pkg update && pkg add libxvmc xcb-util xcb-util-wm"
# need to install newer xorgproto
- /app/vmctl exec "cd $CI_PROJECT_NAME/dep.xorgproto && ./autogen.sh --prefix=/usr && make && make install"
- /app/vmctl exec "cd $CI_PROJECT_NAME && PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\" MESON_ARGS=\"$MESON_ARGS\" MESON_BUILDDIR=\"$MESON_BUILDDIR\" .gitlab-ci/meson-build.sh --skip-test" && touch .success
@ -250,26 +252,104 @@ xf86-driver-build-test:
stage: drivers
parallel:
matrix:
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-elographics
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-evdev
SHA: xf86-input-evdev-2.10.6
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-joystick
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput
SHA: xf86-input-libinput-1.4.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-mouse
SHA: xf86-input-mouse-1.9.5
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics
SHA: xf86-input-synaptics-1.9.2
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-vmmouse
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-void
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu
SHA: xf86-video-amdgpu-23.0.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-apm
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ark
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-armsoc
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ast
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ati
SHA: xf86-video-ati-22.0.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel
SHA: e6a4c4740c15ace9dd79dc7c18955f2eb413a6a5 # no release yet
- 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/metux/xf86-video-intel
SHA: incubate # temporary
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-mach64
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-neomagic
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nested
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nouveau
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-qxl
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-r128
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-rendition
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-s3virge
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-savage
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-siliconmotion
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sis
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sisusb
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suncg14
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suncg3
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suncg6
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sunffb
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sunleo
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suntcx
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-tdfx
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-trident
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-v4l
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vbox
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vesa
SHA: xf86-video-vesa-2.6.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vmware
SHA: xf86-video-vmware-13.4.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-voodoo
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-xgi
SHA: master
script:
# Install the server first
- .gitlab-ci/meson-build.sh --skip-test --run-install
@ -290,13 +370,6 @@ xf86-driver-build-test:
GIT_DEPTH: 1
MESON_ARGS: -Dprefix=/usr/
MESON_EXTRA_ARGS: -Dxwayland=false -Dxnest=false -Dxvfb=false -Dxquartz=false -Ddocs=false
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
*dix_paths
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
*xorg_paths
#
# Verify that commit messages are as expected

View File

@ -33,13 +33,13 @@ from The Open Group.
#include <X11/extensions/bigreqsproto.h>
#include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include "opaque.h"
#include "extinit_priv.h"
static int
ProcBigReqDispatch(ClientPtr client)

View File

@ -30,7 +30,9 @@ Equipment Corporation.
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/extensions/dpmsproto.h>
#include "miext/extinit_priv.h"
#include "os/screensaver.h"
#include "misc.h"
@ -38,9 +40,7 @@ Equipment Corporation.
#include "dixstruct.h"
#include "extnsionst.h"
#include "opaque.h"
#include <X11/extensions/dpmsproto.h>
#include "dpmsproc.h"
#include "extinit_priv.h"
#include "scrnintstr.h"
#include "windowstr.h"
#include "protocol-versions.h"

View File

@ -24,13 +24,16 @@
*/
#include <dix-config.h>
#include "windowstr.h"
#include <X11/extensions/ge.h>
#include "windowstr.h"
#include "miext/extinit_priv.h"
#include "geint.h"
#include "geext.h"
#include "protocol-versions.h"
#include "extinit_priv.h"
Bool noGEExtension = FALSE;

View File

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

View File

@ -36,6 +36,7 @@ in this Software without prior written authorization from the X Consortium.
#include "dix/colormap_priv.h"
#include "dix/cursor_priv.h"
#include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
#include "os/osdep.h"
#include "os/screensaver.h"
@ -61,7 +62,6 @@ in this Software without prior written authorization from the X Consortium.
#include "dpmsproc.h"
#endif
#include "protocol-versions.h"
#include "extinit_priv.h"
// temporary workaround for win32/mingw32 name clash
// see: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1355

View File

@ -32,7 +32,7 @@ in this Software without prior written authorization from The Open Group.
#include "dix/dix_priv.h"
#include "dix/registry_priv.h"
#include "include/extinit_priv.h"
#include "miext/extinit_priv.h"
#include "os/audit.h"
#include "os/auth.h"
#include "os/osdep.h"
@ -45,7 +45,6 @@ in this Software without prior written authorization from The Open Group.
#include "privates.h"
#include "xacestr.h"
#include "securitysrv.h"
#include "extinit.h"
#include "protocol-versions.h"
Bool noSecurityExtension = FALSE;

View File

@ -33,6 +33,7 @@ in this Software without prior written authorization from The Open Group.
#include "dix/dix_priv.h"
#include "dix/gc_priv.h"
#include "miext/extinit_priv.h"
#include "misc.h"
#include "os.h"
@ -45,7 +46,6 @@ in this Software without prior written authorization from The Open Group.
#include "opaque.h"
#include "regionstr.h"
#include "gcstruct.h"
#include "extinit_priv.h"
#include "protocol-versions.h"
Bool noShapeExtension = FALSE;

View File

@ -43,8 +43,10 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xfuncproto.h>
#include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
#include "os/auth.h"
#include "os/busfault.h"
#include "os/log_priv.h"
#include "os/osdep.h"
#include "misc.h"
@ -59,7 +61,6 @@ in this Software without prior written authorization from The Open Group.
#include "servermd.h"
#include "shmint.h"
#include "xace.h"
#include "extinit_priv.h"
#include "protocol-versions.h"
/* Needed for Solaris cross-zone shared memory extension */
@ -95,9 +96,7 @@ in this Software without prior written authorization from The Open Group.
#endif /* XINERAMA */
typedef struct _ShmScrPrivateRec {
CloseScreenProcPtr CloseScreen;
ShmFuncsPtr shmFuncs;
DestroyPixmapProcPtr destroyPixmap;
} ShmScrPrivateRec;
Bool noMITShmExtension = FALSE;
@ -108,7 +107,7 @@ static void ShmResetProc(ExtensionEntry *extEntry);
static void SShmCompletionEvent(xShmCompletionEvent *from,
xShmCompletionEvent *to);
static Bool ShmDestroyPixmap(PixmapPtr pPixmap);
static int ShmCreatePixmap(ClientPtr client, xShmCreatePixmapReq *stuff);
static unsigned char ShmReqCode;
int ShmCompletionCode;
@ -156,7 +155,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;
@ -194,15 +193,13 @@ CheckForShmSyscall(void)
#endif
static Bool
ShmCloseScreen(ScreenPtr pScreen)
static void
ShmScreenClose(ScreenPtr pScreen, void *arg)
{
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
pScreen->CloseScreen = screen_priv->CloseScreen;
dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, NULL);
free(screen_priv);
return (*pScreen->CloseScreen) (pScreen);
}
static ShmScrPrivateRec *
@ -212,9 +209,8 @@ ShmInitScreenPriv(ScreenPtr pScreen)
if (!screen_priv) {
screen_priv = calloc(1, sizeof(ShmScrPrivateRec));
screen_priv->CloseScreen = pScreen->CloseScreen;
dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, screen_priv);
pScreen->CloseScreen = ShmCloseScreen;
dixScreenHookClose(pScreen, ShmScreenClose, NULL);
}
return screen_priv;
}
@ -246,28 +242,6 @@ ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs)
ShmInitScreenPriv(pScreen)->shmFuncs = funcs;
}
static Bool
ShmDestroyPixmap(PixmapPtr pPixmap)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
void *shmdesc = NULL;
Bool ret = TRUE;
if (pPixmap->refcnt == 1)
shmdesc = dixLookupPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey);
pScreen->DestroyPixmap = screen_priv->destroyPixmap;
if (pScreen->DestroyPixmap)
ret = pScreen->DestroyPixmap(pPixmap);
screen_priv->destroyPixmap = pScreen->DestroyPixmap;
pScreen->DestroyPixmap = ShmDestroyPixmap;
if (shmdesc)
ShmDetachSegment(shmdesc, 0);
return ret;
}
void
ShmRegisterFbFuncs(ScreenPtr pScreen)
@ -373,12 +347,15 @@ shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly)
static int
ProcShmAttach(ClientPtr client)
{
REQUEST(xShmAttachReq);
REQUEST_SIZE_MATCH(xShmAttachReq);
if (!client->local)
return BadRequest;
SHMSTAT_TYPE buf;
ShmDescPtr shmdesc;
REQUEST(xShmAttachReq);
REQUEST_SIZE_MATCH(xShmAttachReq);
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
client->errorValue = stuff->readOnly;
@ -436,6 +413,9 @@ ShmDetachSegment(void *value, /* must conform to DeleteType */
ShmDescPtr shmdesc = (ShmDescPtr) value;
ShmDescPtr *prev;
if (!shmdesc)
return Success;
if (--shmdesc->refcnt)
return TRUE;
#if SHM_FD_PASSING
@ -455,11 +435,14 @@ ShmDetachSegment(void *value, /* must conform to DeleteType */
static int
ProcShmDetach(ClientPtr client)
{
REQUEST(xShmDetachReq);
REQUEST_SIZE_MATCH(xShmDetachReq);
if (!client->local)
return BadRequest;
ShmDescPtr shmdesc;
REQUEST(xShmDetachReq);
REQUEST_SIZE_MATCH(xShmDetachReq);
VERIFY_SHMSEG(stuff->shmseg, shmdesc, client);
FreeResource(stuff->shmseg, X11_RESTYPE_NONE);
return Success;
@ -516,16 +499,13 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
}
static int
ProcShmPutImage(ClientPtr client)
ShmPutImage(ClientPtr client, xShmPutImageReq *stuff)
{
GCPtr pGC;
DrawablePtr pDraw;
long length;
ShmDescPtr shmdesc;
REQUEST(xShmPutImageReq);
REQUEST_SIZE_MATCH(xShmPutImageReq);
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
@ -615,7 +595,7 @@ ProcShmPutImage(ClientPtr client)
}
static int
ProcShmGetImage(ClientPtr client)
ShmGetImage(ClientPtr client, xShmGetImageReq *stuff)
{
DrawablePtr pDraw;
long lenPer = 0, length;
@ -626,9 +606,6 @@ ProcShmGetImage(ClientPtr client)
RegionPtr pVisibleRegion = NULL;
int rc;
REQUEST(xShmGetImageReq);
REQUEST_SIZE_MATCH(xShmGetImageReq);
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
client->errorValue = stuff->format;
return BadValue;
@ -733,16 +710,22 @@ ProcShmGetImage(ClientPtr client)
return Success;
}
#ifdef XINERAMA
static int
ProcPanoramiXShmPutImage(ClientPtr client)
ProcShmPutImage(ClientPtr client)
{
REQUEST(xShmPutImageReq);
REQUEST_SIZE_MATCH(xShmPutImageReq);
if (!client->local)
return BadRequest;
#ifdef XINERAMA
int j, result, orig_x, orig_y;
PanoramiXRes *draw, *gc;
Bool sendEvent, isRoot;
REQUEST(xShmPutImageReq);
REQUEST_SIZE_MATCH(xShmPutImageReq);
if (noPanoramiXExtension)
return ShmPutImage(client, stuff);
result = dixLookupResourceByClass((void **) &draw, stuff->drawable,
XRC_DRAWABLE, client, DixWriteAccess);
@ -769,16 +752,26 @@ ProcPanoramiXShmPutImage(ClientPtr client)
stuff->dstX = orig_x - screenInfo.screens[j]->x;
stuff->dstY = orig_y - screenInfo.screens[j]->y;
}
result = ProcShmPutImage(client);
result = ShmPutImage(client, stuff);
if (result != Success)
break;
}
return result;
#else
return ShmPutImage(client, stuff);
#endif /* XINERAMA */
}
static int
ProcPanoramiXShmGetImage(ClientPtr client)
ProcShmGetImage(ClientPtr client)
{
REQUEST(xShmGetImageReq);
REQUEST_SIZE_MATCH(xShmGetImageReq);
if (!client->local)
return BadRequest;
#ifdef XINERAMA
PanoramiXRes *draw;
DrawablePtr *drawables;
DrawablePtr pDraw;
@ -789,9 +782,8 @@ ProcPanoramiXShmGetImage(ClientPtr client)
long lenPer = 0, length, widthBytesLine;
Bool isRoot;
REQUEST(xShmGetImageReq);
REQUEST_SIZE_MATCH(xShmGetImageReq);
if (noPanoramiXExtension)
return ShmGetImage(client, stuff);
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
client->errorValue = stuff->format;
@ -804,7 +796,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
return (rc == BadValue) ? BadDrawable : rc;
if (draw->type == XRT_PIXMAP)
return ProcShmGetImage(client);
return ShmGetImage(client, stuff);
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReadAccess);
if (rc != Success)
@ -915,24 +907,34 @@ ProcPanoramiXShmGetImage(ClientPtr client)
WriteToClient(client, sizeof(xShmGetImageReply), &xgi);
return Success;
#else
return ShmGetImage(client, stuff);
#endif /* XINERAMA */
}
static int
ProcPanoramiXShmCreatePixmap(ClientPtr client)
ProcShmCreatePixmap(ClientPtr client)
{
REQUEST(xShmCreatePixmapReq);
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
if (!client->local)
return BadRequest;
#ifdef XINERAMA
if (noPanoramiXExtension)
return ShmCreatePixmap(client, stuff);
ScreenPtr pScreen = NULL;
PixmapPtr pMap = NULL;
DrawablePtr pDraw;
DepthPtr pDepth;
int i, j, result, rc;
ShmDescPtr shmdesc;
REQUEST(xShmCreatePixmapReq);
unsigned int width, height, depth;
unsigned long size;
PanoramiXRes *newPix;
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
client->errorValue = stuff->pid;
if (!sharedPixmaps)
return BadImplementation;
@ -1028,8 +1030,10 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
AddResource(stuff->pid, XRT_PIXMAP, newPix);
return result;
}
#else
return ShmCreatePixmap(client, stuff);
#endif /* XINERAMA */
}
static PixmapPtr
fbShmCreatePixmap(ScreenPtr pScreen,
@ -1052,7 +1056,7 @@ fbShmCreatePixmap(ScreenPtr pScreen,
}
static int
ProcShmCreatePixmap(ClientPtr client)
ShmCreatePixmap(ClientPtr client, xShmCreatePixmapReq *stuff)
{
PixmapPtr pMap;
DrawablePtr pDraw;
@ -1060,12 +1064,9 @@ ProcShmCreatePixmap(ClientPtr client)
int i, rc;
ShmDescPtr shmdesc;
ShmScrPrivateRec *screen_priv;
REQUEST(xShmCreatePixmapReq);
unsigned int width, height, depth;
unsigned long size;
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
client->errorValue = stuff->pid;
if (!sharedPixmaps)
return BadImplementation;
@ -1147,13 +1148,17 @@ ShmBusfaultNotify(void *context)
static int
ProcShmAttachFd(ClientPtr client)
{
REQUEST(xShmAttachFdReq);
REQUEST_SIZE_MATCH(xShmAttachFdReq);
if (!client->local)
return BadRequest;
int fd;
ShmDescPtr shmdesc;
REQUEST(xShmAttachFdReq);
struct stat statb;
SetReqFds(client, 1);
REQUEST_SIZE_MATCH(xShmAttachFdReq);
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
client->errorValue = stuff->readOnly;
@ -1262,9 +1267,14 @@ shm_tmpfile(void)
static int
ProcShmCreateSegment(ClientPtr client)
{
REQUEST(xShmCreateSegmentReq);
REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
if (!client->local)
return BadRequest;
int fd;
ShmDescPtr shmdesc;
REQUEST(xShmCreateSegmentReq);
xShmCreateSegmentReply rep = {
.type = X_Reply,
.nfd = 1,
@ -1272,7 +1282,6 @@ ProcShmCreateSegment(ClientPtr client)
.length = 0,
};
REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
client->errorValue = stuff->readOnly;
@ -1337,34 +1346,18 @@ ProcShmDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data == X_ShmQueryVersion)
return ProcShmQueryVersion(client);
if (!client->local)
return BadRequest;
switch (stuff->data) {
case X_ShmQueryVersion:
return ProcShmQueryVersion(client);
case X_ShmAttach:
return ProcShmAttach(client);
case X_ShmDetach:
return ProcShmDetach(client);
case X_ShmPutImage:
#ifdef XINERAMA
if (!noPanoramiXExtension)
return ProcPanoramiXShmPutImage(client);
#endif /* XINERAMA */
return ProcShmPutImage(client);
case X_ShmGetImage:
#ifdef XINERAMA
if (!noPanoramiXExtension)
return ProcPanoramiXShmGetImage(client);
#endif /* XINERAMA */
return ProcShmGetImage(client);
case X_ShmCreatePixmap:
#ifdef XINERAMA
if (!noPanoramiXExtension)
return ProcPanoramiXShmCreatePixmap(client);
#endif /* XINERAMA */
return ProcShmCreatePixmap(client);
#ifdef SHM_FD_PASSING
case X_ShmAttachFd:
@ -1485,13 +1478,9 @@ SProcShmDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data == X_ShmQueryVersion)
return ProcShmQueryVersion(client);
if (!client->local)
return BadRequest;
switch (stuff->data) {
case X_ShmQueryVersion:
return ProcShmQueryVersion(client);
case X_ShmAttach:
return SProcShmAttach(client);
case X_ShmDetach:
@ -1513,6 +1502,14 @@ SProcShmDispatch(ClientPtr client)
}
}
static void ShmPixmapDestroy(ScreenPtr pScreen, PixmapPtr pPixmap, void *arg)
{
ShmDetachSegment(
dixLookupPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey),
0);
dixSetPrivate(&pPixmap->devPrivates, shmPixmapPrivateKey, NULL);
}
void
ShmExtensionInit(void)
{
@ -1541,13 +1538,8 @@ ShmExtensionInit(void)
sharedPixmaps = xFalse;
}
if (sharedPixmaps)
for (i = 0; i < screenInfo.numScreens; i++) {
ShmScrPrivateRec *screen_priv =
ShmGetScreenPriv(screenInfo.screens[i]);
screen_priv->destroyPixmap =
screenInfo.screens[i]->DestroyPixmap;
screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
}
for (i = 0; i < screenInfo.numScreens; i++)
dixScreenHookPixmapDestroy(screenInfo.screens[i], ShmPixmapDestroy, NULL);
}
ShmSegType = CreateNewResourceType(ShmDetachSegment, "ShmSeg");
if (ShmSegType &&

View File

@ -59,6 +59,7 @@ PERFORMANCE OF THIS SOFTWARE.
#include <X11/extensions/syncproto.h>
#include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
#include "os/osdep.h"
#include "scrnintstr.h"
@ -77,8 +78,6 @@ PERFORMANCE OF THIS SOFTWARE.
#include <sys/time.h>
#endif
#include "extinit_priv.h"
/*
* Local Global Variables
*/

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

@ -28,17 +28,18 @@ from The Open Group.
#include <dix-config.h>
#include <stdint.h>
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/extensions/xcmiscproto.h>
#include "miext/extinit_priv.h"
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include "swaprep.h"
#include <X11/extensions/xcmiscproto.h>
#include "extinit_priv.h"
#include <stdint.h>
static int
ProcXCMiscGetVersion(ClientPtr client)

View File

@ -41,10 +41,6 @@
#ifdef SVR4
#include <sys/sysmacros.h>
#endif
#if defined(__CYGWIN__)
#include <sys/param.h>
#include <sys/sysmacros.h>
#endif
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/stat.h>
@ -58,13 +54,14 @@
#include <X11/Xproto.h>
#include <X11/extensions/xf86bigfproto.h>
#include "miext/extinit_priv.h"
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
#include "gcstruct.h"
#include "dixfontstr.h"
#include "extnsionst.h"
#include "extinit.h"
#include "protocol-versions.h"
#include "xf86bigfontsrv.h"
@ -87,7 +84,7 @@ static unsigned int pagesize;
static Bool badSysCall = FALSE;
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__)
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
static void
SigSysHandler(int signo)
@ -266,13 +263,11 @@ XF86BigfontResetProc(ExtensionEntry * extEntry)
static int
ProcXF86BigfontQueryVersion(ClientPtr client)
{
xXF86BigfontQueryVersionReply reply;
REQUEST_SIZE_MATCH(xXF86BigfontQueryVersionReq);
reply = (xXF86BigfontQueryVersionReply) {
xXF86BigfontQueryVersionReply reply = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION,
.minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION,
.uid = geteuid(),
@ -281,9 +276,6 @@ ProcXF86BigfontQueryVersion(ClientPtr client)
.signature = signature,
.capabilities = (client->local && !client->swapped)
? XF86Bigfont_CAP_LocalShm : 0
#else
.signature = 0,
.capabilities = 0
#endif
};
if (client->swapped) {
@ -712,7 +704,7 @@ XFree86BigfontExtensionInit(void)
FontShmdescIndex = xfont2_allocate_font_private_index();
#if !defined(CSRG_BASED) && !defined(__CYGWIN__)
#if !defined(CSRG_BASED)
pagesize = SHMLBA;
#else
#ifdef _SC_PAGESIZE

View File

@ -13,6 +13,7 @@
#include "dix/registry_priv.h"
#include "os/client_priv.h"
#include "miext/extinit_priv.h"
#include "misc.h"
#include "os.h"
@ -22,11 +23,9 @@
#include "pixmapstr.h"
#include "windowstr.h"
#include "gcstruct.h"
#include "extinit_priv.h"
#include "protocol-versions.h"
#include "list.h"
#include "misc.h"
#include <string.h>
#include "hashtable.h"
#include "picturestr.h"
@ -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.
@param frags The head of the list of fragments
@ -195,16 +179,15 @@ DestroyConstructResourceBytesCtx(ConstructResourceBytesCtx *ctx)
static int
ProcXResQueryVersion(ClientPtr client)
{
REQUEST_SIZE_MATCH(xXResQueryVersionReq);
xXResQueryVersionReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.server_major = SERVER_XRES_MAJOR_VERSION,
.server_minor = SERVER_XRES_MINOR_VERSION
};
REQUEST_SIZE_MATCH(xXResQueryVersionReq);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@ -218,16 +201,12 @@ ProcXResQueryVersion(ClientPtr client)
static int
ProcXResQueryClients(ClientPtr client)
{
/* REQUEST(xXResQueryClientsReq); */
xXResQueryClientsReply rep;
int *current_clients;
int i, num_clients;
int i, num_clients = 0;
REQUEST_SIZE_MATCH(xXResQueryClientsReq);
current_clients = xallocarray(currentMaxClients, sizeof(int));
int current_clients[currentMaxClients];
num_clients = 0;
for (i = 0; i < currentMaxClients; i++) {
if (clients[i]) {
current_clients[num_clients] = i;
@ -235,7 +214,7 @@ ProcXResQueryClients(ClientPtr client)
}
}
rep = (xXResQueryClientsReply) {
xXResQueryClientsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(num_clients * sz_xXResClient),
@ -248,22 +227,21 @@ ProcXResQueryClients(ClientPtr client)
}
WriteToClient(client, sizeof(xXResQueryClientsReply), &rep);
if (num_clients) {
xXResClient scratch;
xXResClient scratch[num_clients];
if (num_clients) {
for (i = 0; i < num_clients; i++) {
scratch.resource_base = clients[current_clients[i]]->clientAsMask;
scratch.resource_mask = RESOURCE_ID_MASK;
scratch[i].resource_base = clients[current_clients[i]]->clientAsMask;
scratch[i].resource_mask = RESOURCE_ID_MASK;
if (client->swapped) {
swapl(&scratch.resource_base);
swapl(&scratch.resource_mask);
swapl(&scratch[i].resource_base);
swapl(&scratch[i].resource_mask);
}
WriteToClient(client, sz_xXResClient, &scratch);
}
}
free(current_clients);
WriteToClient(client, sizeof(scratch), scratch);
return Success;
}
@ -298,12 +276,10 @@ static int
ProcXResQueryClientResources(ClientPtr client)
{
REQUEST(xXResQueryClientResourcesReq);
xXResQueryClientResourcesReply rep;
int i, clientID, num_types;
int *counts;
REQUEST_SIZE_MATCH(xXResQueryClientResourcesReq);
int i, clientID, num_types = 0;
clientID = CLIENT_ID(stuff->xid);
if ((clientID >= currentMaxClients) || !clients[clientID]) {
@ -311,18 +287,21 @@ ProcXResQueryClientResources(ClientPtr client)
return BadValue;
}
counts = calloc(lastResourceType + 1, sizeof(int));
int counts[lastResourceType + 1];
memset(counts, 0, sizeof(counts));
FindAllClientResources(clients[clientID], ResFindAllRes, counts);
num_types = 0;
int cnt[lastResourceType + 1];
for (i = 0; i <= lastResourceType; i++) {
if (counts[i])
if (counts[i]) {
cnt[num_types] = counts[i];
num_types++;
}
}
rep = (xXResQueryClientResourcesReply) {
xXResQueryClientResourcesReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(num_types * sz_xXResType),
@ -334,28 +313,20 @@ ProcXResQueryClientResources(ClientPtr client)
swapl(&rep.num_types);
}
WriteToClient(client, sizeof(xXResQueryClientResourcesReply), &rep);
xXResType scratch[num_types];
if (num_types) {
xXResType scratch;
for (i = 0; i < lastResourceType; i++) {
if (!counts[i])
continue;
scratch.resource_type = resourceTypeAtom(i + 1);
scratch.count = counts[i];
for (i = 0; i < num_types; i++) {
scratch[i].resource_type = resourceTypeAtom(i + 1);
scratch[i].count = cnt[i];
if (client->swapped) {
swapl(&scratch.resource_type);
swapl(&scratch.count);
}
WriteToClient(client, sz_xXResType, &scratch);
swapl(&scratch[i].resource_type);
swapl(&scratch[i].count);
}
}
free(counts);
WriteToClient(client, sizeof(xXResQueryClientResourcesReply), &rep);
WriteToClient(client, sizeof(scratch), scratch);
return Success;
}
@ -374,12 +345,11 @@ static int
ProcXResQueryClientPixmapBytes(ClientPtr client)
{
REQUEST(xXResQueryClientPixmapBytesReq);
xXResQueryClientPixmapBytesReply rep;
int clientID;
unsigned long bytes;
REQUEST_SIZE_MATCH(xXResQueryClientPixmapBytesReq);
int clientID;
unsigned long bytes = 0;
clientID = CLIENT_ID(stuff->xid);
if ((clientID >= currentMaxClients) || !clients[clientID]) {
@ -387,20 +357,15 @@ ProcXResQueryClientPixmapBytes(ClientPtr client)
return BadValue;
}
bytes = 0;
FindAllClientResources(clients[clientID], ResFindResourcePixmaps,
(void *) (&bytes));
rep = (xXResQueryClientPixmapBytesReply) {
xXResQueryClientPixmapBytesReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.bytes = bytes,
#ifdef _XSERVER64
.bytes_overflow = bytes >> 32
#else
.bytes_overflow = 0
#endif
};
if (client->swapped) {
@ -459,9 +424,10 @@ static Bool
ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
ConstructClientIdCtx *ctx)
{
xXResClientIdValue rep;
xXResClientIdValue rep = {
.spec.client = client->clientAsMask,
};
rep.spec.client = client->clientAsMask;
if (client->swapped) {
swapl (&rep.spec.client);
}
@ -473,7 +439,6 @@ ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
}
rep.spec.mask = X_XResClientXIDMask;
rep.length = 0;
if (sendClient->swapped) {
swapl (&rep.spec.mask);
/* swapl (&rep.length, n); - not required for rep.length = 0 */
@ -502,9 +467,6 @@ ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
if (sendClient->swapped) {
swapl (&rep.spec.mask);
swapl (&rep.length);
}
if (sendClient->swapped) {
swapl (value);
}
memcpy(ptr, &rep, sizeof(rep));
@ -587,6 +549,19 @@ ProcXResQueryClientIds (ClientPtr client)
rc = ConstructClientIds(client, stuff->numSpecs, specs, &ctx);
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 = {
.type = X_Reply,
.sequenceNumber = client->sequence,
@ -594,8 +569,6 @@ ProcXResQueryClientIds (ClientPtr client)
.numIds = ctx.numIds
};
assert((ctx.resultBytes & 3) == 0);
if (client->swapped) {
swaps (&rep.sequenceNumber);
swapl (&rep.length);
@ -603,9 +576,11 @@ ProcXResQueryClientIds (ClientPtr client)
}
WriteToClient(client, sizeof(rep), &rep);
WriteFragmentsToClient(client, &ctx.response);
WriteToClient(client, ctx.resultBytes, buf);
free(buf);
}
out:
DestroyConstructClientIdCtx(&ctx);
return rc;
@ -952,11 +927,11 @@ static int
ProcXResQueryResourceBytes (ClientPtr client)
{
REQUEST(xXResQueryResourceBytesReq);
REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
int rc;
ConstructResourceBytesCtx ctx;
REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
if (stuff->numSpecs > UINT32_MAX / sizeof(ctx.specs[0]))
return BadLength;
REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq,
@ -987,10 +962,24 @@ ProcXResQueryResourceBytes (ClientPtr client)
SwapXResQueryResourceBytes(&ctx.response);
}
WriteToClient(client, sizeof(rep), &rep);
WriteFragmentsToClient(client, &ctx.response);
char *buf = calloc(1, ctx.resultBytes);
if (!buf) {
rc = BadAlloc;
goto out;
}
char *walk = buf;
FragmentList *it;
xorg_list_for_each_entry(it, &ctx.response, l) {
memcpy(walk, FRAGMENT_DATA(it), it->bytes);
walk += it->bytes;
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, ctx.resultBytes, buf);
free(buf);
}
out:
DestroyConstructResourceBytesCtx(&ctx);
return rc;

View File

@ -21,13 +21,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "dix/dix_priv.h"
#include "dix/property_priv.h"
#include "dix/selection_priv.h"
#include "miext/extinit_priv.h"
#include "selection.h"
#include "inputstr.h"
#include "windowstr.h"
#include "propertyst.h"
#include "extnsionst.h"
#include "extinit_priv.h"
#include "xselinuxint.h"
#define CTX_DEV offsetof(SELinuxSubjectRec, dev_create_sid)

View File

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

View File

@ -40,6 +40,7 @@
#include "dix/exevents_priv.h"
#include "mi/mi_priv.h"
#include "mi/mipointer_priv.h"
#include "miext/extinit_priv.h"
#include "os/osdep.h"
#include "misc.h"
@ -58,7 +59,6 @@
#include "xserver-properties.h"
#include "eventstr.h"
#include "inpututils.h"
#include "extinit_priv.h"
Bool noTestExtensions = FALSE;

View File

@ -321,7 +321,6 @@ ProcXvQueryAdaptors(ClientPtr client)
{
xvFormat format;
xvAdaptorInfo ainfo;
xvQueryAdaptorsReply rep;
int totalSize, na, nf, rc;
int nameSize;
XvAdaptorPtr pa;
@ -337,27 +336,20 @@ ProcXvQueryAdaptors(ClientPtr client)
if (rc != Success)
return rc;
xvQueryAdaptorsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
};
pScreen = pWin->drawable.pScreen;
pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
XvGetScreenKey());
if (!pxvs) {
rep = (xvQueryAdaptorsReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.num_adaptors = 0
};
_WriteQueryAdaptorsReply(client, &rep);
return Success;
}
rep = (xvQueryAdaptorsReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.num_adaptors = pxvs->nAdaptors
};
rep.num_adaptors = pxvs->nAdaptors;
/* CALCULATE THE TOTAL SIZE OF THE REPLY IN BYTES */
@ -411,7 +403,6 @@ static int
ProcXvQueryEncodings(ClientPtr client)
{
xvEncodingInfo einfo;
xvQueryEncodingsReply rep;
int totalSize;
int nameSize;
XvPortPtr pPort;
@ -423,12 +414,6 @@ ProcXvQueryEncodings(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
rep = (xvQueryEncodingsReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.num_encodings = pPort->pAdaptor->nEncodings
};
/* FOR EACH ENCODING ADD UP THE BYTES FOR ENCODING NAMES */
ne = pPort->pAdaptor->nEncodings;
@ -439,7 +424,12 @@ ProcXvQueryEncodings(ClientPtr client)
pe++;
}
rep.length = bytes_to_int32(totalSize);
xvQueryEncodingsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.num_encodings = pPort->pAdaptor->nEncodings,
.length = bytes_to_int32(totalSize),
};
_WriteQueryEncodingsReply(client, &rep);
@ -461,7 +451,7 @@ ProcXvQueryEncodings(ClientPtr client)
}
static int
ProcXvPutVideo(ClientPtr client)
SingleXvPutVideo(ClientPtr client)
{
DrawablePtr pDraw;
XvPortPtr pPort;
@ -490,8 +480,20 @@ ProcXvPutVideo(ClientPtr client)
stuff->drw_w, stuff->drw_h);
}
static int XineramaXvPutVideo(ClientPtr client);
static int
ProcXvPutStill(ClientPtr client)
ProcXvPutVideo(ClientPtr client)
{
#ifdef XINERAMA
if (xvUseXinerama)
return XineramaXvPutVideo(client);
#endif
return SingleXvPutVideo(client);
}
static int
SingleXvPutStill(ClientPtr client)
{
DrawablePtr pDraw;
XvPortPtr pPort;
@ -520,6 +522,18 @@ ProcXvPutStill(ClientPtr client)
stuff->drw_w, stuff->drw_h);
}
static int XineramaXvPutStill(ClientPtr client);
static int
ProcXvPutStill(ClientPtr client)
{
#ifdef XINERAMA
if (xvUseXinerama)
return XineramaXvPutStill(client);
#endif
return SingleXvPutStill(client);
}
static int
ProcXvGetVideo(ClientPtr client)
{
@ -615,7 +629,6 @@ ProcXvGrabPort(ClientPtr client)
{
int result, status;
XvPortPtr pPort;
xvGrabPortReply rep;
REQUEST(xvGrabPortReq);
REQUEST_SIZE_MATCH(xvGrabPortReq);
@ -627,10 +640,9 @@ ProcXvGrabPort(ClientPtr client)
if (status != Success) {
return status;
}
rep = (xvGrabPortReply) {
xvGrabPortReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.result = result
};
@ -653,7 +665,7 @@ ProcXvUngrabPort(ClientPtr client)
}
static int
ProcXvStopVideo(ClientPtr client)
SingleXvStopVideo(ClientPtr client)
{
int ret;
DrawablePtr pDraw;
@ -671,8 +683,20 @@ ProcXvStopVideo(ClientPtr client)
return XvdiStopVideo(client, pPort, pDraw);
}
static int XineramaXvStopVideo(ClientPtr client);
static int
ProcXvSetPortAttribute(ClientPtr client)
ProcXvStopVideo(ClientPtr client)
{
#ifdef XINERAMA
if (xvUseXinerama)
return XineramaXvStopVideo(client);
#endif
return SingleXvStopVideo(client);
}
static int
SingleXvSetPortAttribute(ClientPtr client)
{
int status;
XvPortPtr pPort;
@ -698,13 +722,24 @@ ProcXvSetPortAttribute(ClientPtr client)
return status;
}
static int XineramaXvSetPortAttribute(ClientPtr client);
static int
ProcXvSetPortAttribute(ClientPtr client)
{
#ifdef XINERAMA
if (xvUseXinerama)
return XineramaXvSetPortAttribute(client);
#endif
return SingleXvSetPortAttribute(client);
}
static int
ProcXvGetPortAttribute(ClientPtr client)
{
INT32 value;
int status;
XvPortPtr pPort;
xvGetPortAttributeReply rep;
REQUEST(xvGetPortAttributeReq);
REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
@ -722,10 +757,9 @@ ProcXvGetPortAttribute(ClientPtr client)
return status;
}
rep = (xvGetPortAttributeReply) {
xvGetPortAttributeReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.value = value
};
@ -739,7 +773,6 @@ ProcXvQueryBestSize(ClientPtr client)
{
unsigned int actual_width, actual_height;
XvPortPtr pPort;
xvQueryBestSizeReply rep;
REQUEST(xvQueryBestSizeReq);
REQUEST_SIZE_MATCH(xvQueryBestSizeReq);
@ -751,10 +784,9 @@ ProcXvQueryBestSize(ClientPtr client)
stuff->drw_w, stuff->drw_h,
&actual_width, &actual_height);
rep = (xvQueryBestSizeReply) {
xvQueryBestSizeReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.actual_width = actual_width,
.actual_height = actual_height
};
@ -770,7 +802,6 @@ ProcXvQueryPortAttributes(ClientPtr client)
int size, i;
XvPortPtr pPort;
XvAttributePtr pAtt;
xvQueryPortAttributesReply rep;
xvAttributeInfo Info;
REQUEST(xvQueryPortAttributesReq);
@ -778,11 +809,10 @@ ProcXvQueryPortAttributes(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixGetAttrAccess);
rep = (xvQueryPortAttributesReply) {
xvQueryPortAttributesReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.num_attributes = pPort->pAdaptor->nAttributes,
.text_size = 0
};
for (i = 0, pAtt = pPort->pAdaptor->pAttributes;
@ -813,7 +843,7 @@ ProcXvQueryPortAttributes(ClientPtr client)
}
static int
ProcXvPutImage(ClientPtr client)
SingleXvPutImage(ClientPtr client)
{
DrawablePtr pDraw;
XvPortPtr pPort;
@ -869,10 +899,23 @@ ProcXvPutImage(ClientPtr client)
stuff->width, stuff->height);
}
static int
XineramaXvPutImage(ClientPtr client);
static int
ProcXvPutImage(ClientPtr client)
{
#ifdef XINERAMA
if (xvUseXinerama)
return XineramaXvPutImage(client);
#endif
return SingleXvPutImage(client);
}
#ifdef MITSHM
static int
ProcXvShmPutImage(ClientPtr client)
SingleXvShmPutImage(ClientPtr client)
{
ShmDescPtr shmdesc;
DrawablePtr pDraw;
@ -945,13 +988,24 @@ ProcXvShmPutImage(ClientPtr client)
return status;
}
#else /* !MITSHM */
static int XineramaXvShmPutImage(ClientPtr client);
#endif /* MITSHM */
static int
ProcXvShmPutImage(ClientPtr client)
{
return BadImplementation;
}
#ifdef MITSHM
#ifdef XINERAMA
if (xvUseXinerama)
return XineramaXvShmPutImage(client);
#endif
return SingleXvShmPutImage(client);
#else
return BadImplementation;
#endif
}
#ifdef XvMCExtension
#include "xvmcext.h"
@ -1029,7 +1083,6 @@ ProcXvListImageFormats(ClientPtr client)
XvPortPtr pPort;
XvImagePtr pImage;
int i;
xvListImageFormatsReply rep;
xvImageFormatInfo info;
REQUEST(xvListImageFormatsReq);
@ -1038,7 +1091,7 @@ ProcXvListImageFormats(ClientPtr client)
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
rep = (xvListImageFormatsReply) {
xvListImageFormatsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.num_formats = pPort->pAdaptor->nImages,
@ -1079,26 +1132,6 @@ ProcXvListImageFormats(ClientPtr client)
return Success;
}
static int (*XvProcVector[xvNumRequests]) (ClientPtr) = {
ProcXvQueryExtension,
ProcXvQueryAdaptors,
ProcXvQueryEncodings,
ProcXvGrabPort,
ProcXvUngrabPort,
ProcXvPutVideo,
ProcXvPutStill,
ProcXvGetVideo,
ProcXvGetStill,
ProcXvStopVideo,
ProcXvSelectVideoNotify,
ProcXvSelectPortNotify,
ProcXvQueryBestSize,
ProcXvSetPortAttribute,
ProcXvGetPortAttribute,
ProcXvQueryPortAttributes,
ProcXvListImageFormats,
ProcXvQueryImageAttributes, ProcXvPutImage, ProcXvShmPutImage,};
int
ProcXvDispatch(ClientPtr client)
{
@ -1106,11 +1139,50 @@ ProcXvDispatch(ClientPtr client)
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 XvProcVector[stuff->data] (client);
}
/* Swapped Procs */
@ -1121,7 +1193,7 @@ SProcXvQueryAdaptors(ClientPtr client)
REQUEST(xvQueryAdaptorsReq);
REQUEST_SIZE_MATCH(xvQueryAdaptorsReq);
swapl(&stuff->window);
return XvProcVector[xv_QueryAdaptors] (client);
return ProcXvQueryAdaptors(client);
}
static int _X_COLD
@ -1130,7 +1202,7 @@ SProcXvQueryEncodings(ClientPtr client)
REQUEST(xvQueryEncodingsReq);
REQUEST_SIZE_MATCH(xvQueryEncodingsReq);
swapl(&stuff->port);
return XvProcVector[xv_QueryEncodings] (client);
return ProcXvQueryEncodings(client);
}
static int _X_COLD
@ -1140,7 +1212,7 @@ SProcXvGrabPort(ClientPtr client)
REQUEST_SIZE_MATCH(xvGrabPortReq);
swapl(&stuff->port);
swapl(&stuff->time);
return XvProcVector[xv_GrabPort] (client);
return ProcXvGrabPort(client);
}
static int _X_COLD
@ -1150,7 +1222,7 @@ SProcXvUngrabPort(ClientPtr client)
REQUEST_SIZE_MATCH(xvUngrabPortReq);
swapl(&stuff->port);
swapl(&stuff->time);
return XvProcVector[xv_UngrabPort] (client);
return ProcXvUngrabPort(client);
}
static int _X_COLD
@ -1169,7 +1241,7 @@ SProcXvPutVideo(ClientPtr client)
swaps(&stuff->drw_y);
swaps(&stuff->drw_w);
swaps(&stuff->drw_h);
return XvProcVector[xv_PutVideo] (client);
return ProcXvPutVideo(client);
}
static int _X_COLD
@ -1188,7 +1260,7 @@ SProcXvPutStill(ClientPtr client)
swaps(&stuff->drw_y);
swaps(&stuff->drw_w);
swaps(&stuff->drw_h);
return XvProcVector[xv_PutStill] (client);
return ProcXvPutStill(client);
}
static int _X_COLD
@ -1207,7 +1279,7 @@ SProcXvGetVideo(ClientPtr client)
swaps(&stuff->drw_y);
swaps(&stuff->drw_w);
swaps(&stuff->drw_h);
return XvProcVector[xv_GetVideo] (client);
return ProcXvGetVideo(client);
}
static int _X_COLD
@ -1226,7 +1298,7 @@ SProcXvGetStill(ClientPtr client)
swaps(&stuff->drw_y);
swaps(&stuff->drw_w);
swaps(&stuff->drw_h);
return XvProcVector[xv_GetStill] (client);
return ProcXvGetStill(client);
}
static int _X_COLD
@ -1248,7 +1320,7 @@ SProcXvPutImage(ClientPtr client)
swaps(&stuff->drw_h);
swaps(&stuff->width);
swaps(&stuff->height);
return XvProcVector[xv_PutImage] (client);
return ProcXvPutImage(client);
}
#ifdef MITSHM
@ -1273,7 +1345,7 @@ SProcXvShmPutImage(ClientPtr client)
swaps(&stuff->drw_h);
swaps(&stuff->width);
swaps(&stuff->height);
return XvProcVector[xv_ShmPutImage] (client);
return ProcXvShmPutImage(client);
}
#else /* MITSHM */
#define SProcXvShmPutImage ProcXvShmPutImage
@ -1285,7 +1357,7 @@ SProcXvSelectVideoNotify(ClientPtr client)
REQUEST(xvSelectVideoNotifyReq);
REQUEST_SIZE_MATCH(xvSelectVideoNotifyReq);
swapl(&stuff->drawable);
return XvProcVector[xv_SelectVideoNotify] (client);
return ProcXvSelectVideoNotify(client);
}
static int _X_COLD
@ -1294,7 +1366,7 @@ SProcXvSelectPortNotify(ClientPtr client)
REQUEST(xvSelectPortNotifyReq);
REQUEST_SIZE_MATCH(xvSelectPortNotifyReq);
swapl(&stuff->port);
return XvProcVector[xv_SelectPortNotify] (client);
return ProcXvSelectPortNotify(client);
}
static int _X_COLD
@ -1304,7 +1376,7 @@ SProcXvStopVideo(ClientPtr client)
REQUEST_SIZE_MATCH(xvStopVideoReq);
swapl(&stuff->port);
swapl(&stuff->drawable);
return XvProcVector[xv_StopVideo] (client);
return ProcXvStopVideo(client);
}
static int _X_COLD
@ -1315,7 +1387,7 @@ SProcXvSetPortAttribute(ClientPtr client)
swapl(&stuff->port);
swapl(&stuff->attribute);
swapl(&stuff->value);
return XvProcVector[xv_SetPortAttribute] (client);
return ProcXvSetPortAttribute(client);
}
static int _X_COLD
@ -1325,7 +1397,7 @@ SProcXvGetPortAttribute(ClientPtr client)
REQUEST_SIZE_MATCH(xvGetPortAttributeReq);
swapl(&stuff->port);
swapl(&stuff->attribute);
return XvProcVector[xv_GetPortAttribute] (client);
return ProcXvGetPortAttribute(client);
}
static int _X_COLD
@ -1338,7 +1410,7 @@ SProcXvQueryBestSize(ClientPtr client)
swaps(&stuff->vid_h);
swaps(&stuff->drw_w);
swaps(&stuff->drw_h);
return XvProcVector[xv_QueryBestSize] (client);
return ProcXvQueryBestSize(client);
}
static int _X_COLD
@ -1347,7 +1419,7 @@ SProcXvQueryPortAttributes(ClientPtr client)
REQUEST(xvQueryPortAttributesReq);
REQUEST_SIZE_MATCH(xvQueryPortAttributesReq);
swapl(&stuff->port);
return XvProcVector[xv_QueryPortAttributes] (client);
return ProcXvQueryPortAttributes(client);
}
static int _X_COLD
@ -1359,7 +1431,7 @@ SProcXvQueryImageAttributes(ClientPtr client)
swapl(&stuff->id);
swaps(&stuff->width);
swaps(&stuff->height);
return XvProcVector[xv_QueryImageAttributes] (client);
return ProcXvQueryImageAttributes(client);
}
static int _X_COLD
@ -1368,29 +1440,9 @@ SProcXvListImageFormats(ClientPtr client)
REQUEST(xvListImageFormatsReq);
REQUEST_SIZE_MATCH(xvListImageFormatsReq);
swapl(&stuff->port);
return XvProcVector[xv_ListImageFormats] (client);
return ProcXvListImageFormats(client);
}
static int (*SXvProcVector[xvNumRequests]) (ClientPtr) = {
ProcXvQueryExtension,
SProcXvQueryAdaptors,
SProcXvQueryEncodings,
SProcXvGrabPort,
SProcXvUngrabPort,
SProcXvPutVideo,
SProcXvPutStill,
SProcXvGetVideo,
SProcXvGetStill,
SProcXvStopVideo,
SProcXvSelectVideoNotify,
SProcXvSelectPortNotify,
SProcXvQueryBestSize,
SProcXvSetPortAttribute,
SProcXvGetPortAttribute,
SProcXvQueryPortAttributes,
SProcXvListImageFormats,
SProcXvQueryImageAttributes, SProcXvPutImage, SProcXvShmPutImage,};
int _X_COLD
SProcXvDispatch(ClientPtr client)
{
@ -1398,11 +1450,50 @@ SProcXvDispatch(ClientPtr client)
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 SXvProcVector[stuff->data] (client);
}
#ifdef XINERAMA
@ -1429,7 +1520,7 @@ XineramaXvStopVideo(ClientPtr client)
if (port->info[i].id) {
stuff->drawable = draw->info[i].id;
stuff->port = port->info[i].id;
result = ProcXvStopVideo(client);
result = SingleXvStopVideo(client);
}
}
@ -1453,7 +1544,7 @@ XineramaXvSetPortAttribute(ClientPtr client)
FOR_NSCREENS_BACKWARD(i) {
if (port->info[i].id) {
stuff->port = port->info[i].id;
result = ProcXvSetPortAttribute(client);
result = SingleXvSetPortAttribute(client);
}
}
return result;
@ -1506,7 +1597,7 @@ XineramaXvShmPutImage(ClientPtr client)
}
stuff->send_event = (send_event && !i) ? 1 : 0;
result = ProcXvShmPutImage(client);
result = SingleXvShmPutImage(client);
}
}
return result;
@ -1557,7 +1648,7 @@ XineramaXvPutImage(ClientPtr client)
stuff->drw_y -= screenInfo.screens[i]->y;
}
result = ProcXvPutImage(client);
result = SingleXvPutImage(client);
}
}
return result;
@ -1605,7 +1696,7 @@ XineramaXvPutVideo(ClientPtr client)
stuff->drw_y -= screenInfo.screens[i]->y;
}
result = ProcXvPutVideo(client);
result = SingleXvPutVideo(client);
}
}
return result;
@ -1653,7 +1744,7 @@ XineramaXvPutStill(ClientPtr client)
stuff->drw_y -= screenInfo.screens[i]->y;
}
result = ProcXvPutStill(client);
result = SingleXvPutStill(client);
}
}
return result;
@ -1760,25 +1851,6 @@ XineramifyXv(void)
}
}
/* munge the dispatch vector */
XvProcVector[xv_PutVideo] = XineramaXvPutVideo;
XvProcVector[xv_PutStill] = XineramaXvPutStill;
XvProcVector[xv_StopVideo] = XineramaXvStopVideo;
XvProcVector[xv_SetPortAttribute] = XineramaXvSetPortAttribute;
XvProcVector[xv_PutImage] = XineramaXvPutImage;
XvProcVector[xv_ShmPutImage] = XineramaXvShmPutImage;
xvUseXinerama = 1;
}
#endif /* XINERAMA */
void
XvResetProcVector(void)
{
#ifdef XINERAMA
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 /* XINERAMA */
}

View File

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

View File

@ -173,9 +173,6 @@ typedef struct {
int version, revision;
int nAdaptors;
XvAdaptorPtr pAdaptors;
DestroyWindowProcPtr DestroyWindow;
DestroyPixmapProcPtr DestroyPixmap;
CloseScreenProcPtr CloseScreen;
} XvScreenRec, *XvScreenPtr;
extern _X_EXPORT int XvScreenInit(ScreenPtr);

View File

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

View File

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

View File

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

View File

@ -60,13 +60,13 @@ SOFTWARE.
#include "dix/dix_priv.h"
#include "dix/exevents_priv.h"
#include "miext/extinit_priv.h"
#include "inputstr.h"
#include "gcstruct.h" /* pointer for extnsionst.h */
#include "extnsionst.h" /* extension entry */
#include "geext.h" /* extension interfaces for ge */
#include "dixevents.h"
#include "extinit_priv.h"
#include "exglobals.h"
#include "swaprep.h"
#include "privates.h"

View File

@ -36,7 +36,6 @@
#include "windowstr.h" /* window structure */
#include "scrnintstr.h" /* screen structure */
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "exevents.h"
#include "exglobals.h"
#include "xigetclientpointer.h"

View File

@ -43,10 +43,11 @@
#include <dix-config.h>
#include "miext/extinit_priv.h"
#include "compint.h"
#include "xace.h"
#include "protocol-versions.h"
#include "extinit_priv.h"
static CARD8 CompositeReqCode;
static DevPrivateKeyRec CompositeClientPrivateKeyRec;

View File

@ -76,12 +76,13 @@ compCloseScreen(ScreenPtr pScreen)
pScreen->ClipNotify = cs->ClipNotify;
pScreen->UnrealizeWindow = cs->UnrealizeWindow;
pScreen->RealizeWindow = cs->RealizeWindow;
pScreen->DestroyWindow = cs->DestroyWindow;
pScreen->CreateWindow = cs->CreateWindow;
pScreen->CopyWindow = cs->CopyWindow;
pScreen->PositionWindow = cs->PositionWindow;
pScreen->SourceValidate = cs->SourceValidate;
dixScreenUnhookWindowDestroy(pScreen, compWindowDestroy, NULL);
dixScreenUnhookWindowPosition(pScreen, compWindowPosition, NULL);
free(cs);
dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
ret = (*pScreen->CloseScreen) (pScreen);
@ -368,8 +369,8 @@ compScreenInit(ScreenPtr pScreen)
if (!disableBackingStore)
pScreen->backingStoreSupport = WhenMapped;
cs->PositionWindow = pScreen->PositionWindow;
pScreen->PositionWindow = compPositionWindow;
dixScreenHookWindowDestroy(pScreen, compWindowDestroy, NULL);
dixScreenHookWindowPosition(pScreen, compWindowPosition, NULL);
cs->CopyWindow = pScreen->CopyWindow;
pScreen->CopyWindow = compCopyWindow;
@ -377,9 +378,6 @@ compScreenInit(ScreenPtr pScreen)
cs->CreateWindow = pScreen->CreateWindow;
pScreen->CreateWindow = compCreateWindow;
cs->DestroyWindow = pScreen->DestroyWindow;
pScreen->DestroyWindow = compDestroyWindow;
cs->RealizeWindow = pScreen->RealizeWindow;
pScreen->RealizeWindow = compRealizeWindow;

View File

@ -125,10 +125,8 @@ typedef struct _CompImplicitRedirectException {
} CompImplicitRedirectException;
typedef struct _CompScreen {
PositionWindowProcPtr PositionWindow;
CopyWindowProcPtr CopyWindow;
CreateWindowProcPtr CreateWindow;
DestroyWindowProcPtr DestroyWindow;
RealizeWindowProcPtr RealizeWindow;
UnrealizeWindowProcPtr UnrealizeWindow;
ClipNotifyProcPtr ClipNotify;
@ -280,8 +278,7 @@ void
Bool
compCheckRedirect(WindowPtr pWin);
Bool
compPositionWindow(WindowPtr pWin, int x, int y);
void compWindowPosition(ScreenPtr pScreen, WindowPtr pWin, void *arg, int32_t x, int32_t y);
Bool
compRealizeWindow(WindowPtr pWin);
@ -309,8 +306,7 @@ void
Bool
compCreateWindow(WindowPtr pWin);
Bool
compDestroyWindow(WindowPtr pWin);
void compWindowDestroy(ScreenPtr pScreen, WindowPtr pWin, void *arg);
void
compSetRedirectBorderClip(WindowPtr pWin, RegionPtr pRegion);

View File

@ -224,14 +224,8 @@ updateOverlayWindow(ScreenPtr pScreen)
return Success;
}
Bool
compPositionWindow(WindowPtr pWin, int x, int y)
void compWindowPosition(ScreenPtr pScreen, WindowPtr pWin, void *arg, int32_t x, int32_t y)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
CompScreenPtr cs = GetCompScreen(pScreen);
Bool ret = TRUE;
pScreen->PositionWindow = cs->PositionWindow;
/*
* "Shouldn't need this as all possible places should be wrapped
*
@ -255,14 +249,8 @@ compPositionWindow(WindowPtr pWin, int x, int y)
}
}
if (!(*pScreen->PositionWindow) (pWin, x, y))
ret = FALSE;
cs->PositionWindow = pScreen->PositionWindow;
pScreen->PositionWindow = compPositionWindow;
compCheckTree(pWin->drawable.pScreen);
if (updateOverlayWindow(pScreen) != Success)
ret = FALSE;
return ret;
updateOverlayWindow(pScreen);
}
Bool
@ -596,16 +584,12 @@ compCreateWindow(WindowPtr pWin)
return ret;
}
Bool
compDestroyWindow(WindowPtr pWin)
void compWindowDestroy(ScreenPtr pScreen, WindowPtr pWin, void *arg)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
CompScreenPtr cs = GetCompScreen(pScreen);
CompWindowPtr cw;
CompSubwindowsPtr csw;
Bool ret;
pScreen->DestroyWindow = cs->DestroyWindow;
while ((cw = GetCompWindow(pWin)))
FreeResource(cw->clients->id, X11_RESTYPE_NONE);
while ((csw = GetCompSubwindows(pWin)))
@ -617,16 +601,12 @@ compDestroyWindow(WindowPtr pWin)
compSetParentPixmap(pWin);
dixDestroyPixmap(pPixmap, 0);
}
ret = (*pScreen->DestroyWindow) (pWin);
cs->DestroyWindow = pScreen->DestroyWindow;
pScreen->DestroyWindow = compDestroyWindow;
/* Did we just destroy the overlay window? */
if (pWin == cs->pOverlayWin)
cs->pOverlayWin = NULL;
/* compCheckTree (pWin->drawable.pScreen); can't check -- tree isn't good*/
return ret;
}
void

View File

@ -32,7 +32,8 @@
#include "os.h"
#include "inputstr.h"
#include "config-backends.h"
#include "systemd-logind.h"
#include "../hw/xfree86/os-support/linux/systemd-logind.h"
void
config_pre_init(void)

View File

@ -28,6 +28,8 @@
#include <dbus/dbus.h>
#include <sys/select.h>
#include "os/log_priv.h"
#include "dix.h"
#include "os.h"

View File

@ -36,7 +36,8 @@
#include "config-backends.h"
#include "os.h"
#include "globals.h"
#include "systemd-logind.h"
#include "../hw/xfree86/os-support/linux/systemd-logind.h"
#ifdef HAVE_SYS_SYSMACROS_H
#include <sys/sysmacros.h>

View File

@ -24,11 +24,11 @@
#include <dix-config.h>
#include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
#include "damageextint.h"
#include "damagestr.h"
#include "protocol-versions.h"
#include "extinit_priv.h"
#include "dixstruct_priv.h"
#ifdef XINERAMA
@ -41,7 +41,9 @@ typedef struct {
} PanoramiXDamageRes;
static RESTYPE XRT_DAMAGE;
static int (*PanoramiXSaveDamageCreate) (ClientPtr);
static int damageUseXinerama = 0;
static int PanoramiXDamageCreate(ClientPtr client, xDamageCreateReq *stuff);
#endif /* XINERAMA */
@ -95,13 +97,12 @@ DamageExtNotify(DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)
{
ClientPtr pClient = pDamageExt->pClient;
DrawablePtr pDrawable = pDamageExt->pDrawable;
xDamageNotifyEvent ev;
int i, x, y, w, h;
damageGetGeometry(pDrawable, &x, &y, &w, &h);
UpdateCurrentTimeIf();
ev = (xDamageNotifyEvent) {
xDamageNotifyEvent ev = {
.type = DamageEventBase + XDamageNotify,
.level = pDamageExt->level,
.drawable = pDamageExt->drawable,
@ -183,7 +184,6 @@ ProcDamageQueryVersion(ClientPtr client)
xDamageQueryVersionReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0
};
REQUEST(xDamageQueryVersionReq);
@ -258,14 +258,12 @@ DamageExtCreate(DrawablePtr pDrawable, DamageReportLevel level,
}
static DamageExtPtr
doDamageCreate(ClientPtr client, int *rc)
doDamageCreate(ClientPtr client, int *rc, xDamageCreateReq *stuff)
{
DrawablePtr pDrawable;
DamageExtPtr pDamageExt;
DamageReportLevel level;
REQUEST(xDamageCreateReq);
*rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
DixGetAttrAccess | DixReadAccess);
if (*rc != Success)
@ -304,8 +302,14 @@ ProcDamageCreate(ClientPtr client)
int rc;
REQUEST(xDamageCreateReq);
REQUEST_SIZE_MATCH(xDamageCreateReq);
#ifdef XINERAMA
if (damageUseXinerama)
return PanoramiXDamageCreate(client, stuff);
#endif
LEGAL_NEW_RESOURCE(stuff->damage, client);
doDamageCreate(client, &rc);
doDamageCreate(client, &rc, stuff);
return rc;
}
@ -461,33 +465,26 @@ ProcDamageAdd(ClientPtr client)
return Success;
}
/* Major version controls available requests */
static const int version_requests[] = {
X_DamageQueryVersion, /* before client sends QueryVersion */
X_DamageAdd, /* Version 1 */
};
static int (*ProcDamageVector[XDamageNumberRequests]) (ClientPtr) = {
/*************** Version 1 ******************/
ProcDamageQueryVersion,
ProcDamageCreate,
ProcDamageDestroy,
ProcDamageSubtract,
/*************** Version 1.1 ****************/
ProcDamageAdd,
};
static int
ProcDamageDispatch(ClientPtr client)
{
REQUEST(xDamageReq);
DamageClientPtr pDamageClient = GetDamageClient(client);
if (pDamageClient->major_version >= ARRAY_SIZE(version_requests))
REQUEST(xReq);
switch (stuff->data) {
/* version 1 */
case X_DamageQueryVersion:
return ProcDamageQueryVersion(client);
case X_DamageCreate:
return ProcDamageCreate(client);
case X_DamageDestroy:
return ProcDamageDestroy(client);
case X_DamageSubtract:
return ProcDamageSubtract(client);
/* version 1.1 */
case X_DamageAdd:
return ProcDamageAdd(client);
default:
return BadRequest;
if (stuff->damageReqType > version_requests[pDamageClient->major_version])
return BadRequest;
return (*ProcDamageVector[stuff->damageReqType]) (client);
}
}
static int _X_COLD
@ -497,7 +494,7 @@ SProcDamageQueryVersion(ClientPtr client)
REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
swapl(&stuff->majorVersion);
swapl(&stuff->minorVersion);
return (*ProcDamageVector[stuff->damageReqType]) (client);
return ProcDamageQueryVersion(client);
}
static int _X_COLD
@ -507,7 +504,7 @@ SProcDamageCreate(ClientPtr client)
REQUEST_SIZE_MATCH(xDamageCreateReq);
swapl(&stuff->damage);
swapl(&stuff->drawable);
return (*ProcDamageVector[stuff->damageReqType]) (client);
return ProcDamageCreate(client);
}
static int _X_COLD
@ -516,7 +513,7 @@ SProcDamageDestroy(ClientPtr client)
REQUEST(xDamageDestroyReq);
REQUEST_SIZE_MATCH(xDamageDestroyReq);
swapl(&stuff->damage);
return (*ProcDamageVector[stuff->damageReqType]) (client);
return ProcDamageDestroy(client);
}
static int _X_COLD
@ -527,7 +524,7 @@ SProcDamageSubtract(ClientPtr client)
swapl(&stuff->damage);
swapl(&stuff->repair);
swapl(&stuff->parts);
return (*ProcDamageVector[stuff->damageReqType]) (client);
return ProcDamageSubtract(client);
}
static int _X_COLD
@ -537,30 +534,29 @@ SProcDamageAdd(ClientPtr client)
REQUEST_SIZE_MATCH(xDamageSubtractReq);
swapl(&stuff->drawable);
swapl(&stuff->region);
return (*ProcDamageVector[stuff->damageReqType]) (client);
return ProcDamageAdd(client);
}
static int (*SProcDamageVector[XDamageNumberRequests]) (ClientPtr) = {
/*************** Version 1 ******************/
SProcDamageQueryVersion,
SProcDamageCreate,
SProcDamageDestroy,
SProcDamageSubtract,
/*************** Version 1.1 ****************/
SProcDamageAdd,
};
static int _X_COLD
SProcDamageDispatch(ClientPtr client)
{
REQUEST(xDamageReq);
DamageClientPtr pDamageClient = GetDamageClient(client);
if (pDamageClient->major_version >= ARRAY_SIZE(version_requests))
REQUEST(xReq);
switch (stuff->data) {
/* version 1 */
case X_DamageQueryVersion:
return SProcDamageQueryVersion(client);
case X_DamageCreate:
return SProcDamageCreate(client);
case X_DamageDestroy:
return SProcDamageDestroy(client);
case X_DamageSubtract:
return SProcDamageSubtract(client);
/* version 1.1 */
case X_DamageAdd:
return SProcDamageAdd(client);
default:
return BadRequest;
if (stuff->damageReqType > version_requests[pDamageClient->major_version])
return BadRequest;
return (*SProcDamageVector[stuff->damageReqType]) (client);
}
}
static int
@ -629,15 +625,12 @@ PanoramiXDamageExtDestroy(DamagePtr pDamage, void *closure)
}
static int
PanoramiXDamageCreate(ClientPtr client)
PanoramiXDamageCreate(ClientPtr client, xDamageCreateReq *stuff)
{
PanoramiXDamageRes *damage;
PanoramiXRes *draw;
int i, rc;
REQUEST(xDamageCreateReq);
REQUEST_SIZE_MATCH(xDamageCreateReq);
LEGAL_NEW_RESOURCE(stuff->damage, client);
rc = dixLookupResourceByClass((void **)&draw, stuff->drawable, XRC_DRAWABLE,
client, DixGetAttrAccess | DixReadAccess);
@ -650,7 +643,7 @@ PanoramiXDamageCreate(ClientPtr client)
if (!AddResource(stuff->damage, XRT_DAMAGE, damage))
return BadAlloc;
damage->ext = doDamageCreate(client, &rc);
damage->ext = doDamageCreate(client, &rc, stuff);
if (rc == Success && draw->type == XRT_WINDOW) {
FOR_NSCREENS_FORWARD(i) {
DrawablePtr pDrawable;
@ -705,14 +698,13 @@ PanoramiXDamageInit(void)
if (!XRT_DAMAGE)
FatalError("Couldn't Xineramify Damage extension\n");
PanoramiXSaveDamageCreate = ProcDamageVector[X_DamageCreate];
ProcDamageVector[X_DamageCreate] = PanoramiXDamageCreate;
damageUseXinerama = 1;
}
void
PanoramiXDamageReset(void)
{
ProcDamageVector[X_DamageCreate] = PanoramiXSaveDamageCreate;
damageUseXinerama = 0;
}
#endif /* XINERAMA */

View File

@ -29,13 +29,15 @@
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/extensions/damageproto.h>
#include "dix/selection_priv.h"
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include <X11/extensions/damageproto.h>
#include "windowstr.h"
#include "selection.h"
#include "scrnintstr.h"
#include "damage.h"
#include "xfixes.h"

101
dbe/dbe.c
View File

@ -40,10 +40,10 @@
#include <X11/Xproto.h>
#include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
#include "scrnintstr.h"
#include "extnsionst.h"
#include "extinit_priv.h"
#include "gcstruct.h"
#include "dixstruct.h"
#include "dbestruct.h"
@ -81,12 +81,6 @@ DbeStubScreen(DbeScreenPrivPtr pDbeScreenPriv, int *nStubbedScreens)
/* Stub DIX. */
pDbeScreenPriv->SetupBackgroundPainter = NULL;
/* Do not unwrap PositionWindow nor DestroyWindow. If the DDX
* initialization function failed, we assume that it did not wrap
* PositionWindow. Also, DestroyWindow is only wrapped if the DDX
* initialization function succeeded.
*/
/* Stub DDX. */
pDbeScreenPriv->GetVisualInfo = NULL;
pDbeScreenPriv->AllocBackBufferName = NULL;
@ -1201,7 +1195,9 @@ DbeWindowPrivDelete(void *pDbeWinPriv, XID id)
return Success;
} /* DbeWindowPrivDelete() */
static void miDbeWindowDestroy(ScreenPtr pScreen, WindowPtr pWin, void *closure);
/******************************************************************************
*
* DBE DIX Procedure: DbeResetProc
@ -1225,55 +1221,30 @@ DbeResetProc(ExtensionEntry * extEntry)
pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
if (pDbeScreenPriv) {
/* Unwrap DestroyWindow, which was wrapped in DbeExtensionInit(). */
pScreen->DestroyWindow = pDbeScreenPriv->DestroyWindow;
pScreen->PositionWindow = pDbeScreenPriv->PositionWindow;
dixScreenUnhookWindowDestroy(pScreen, miDbeWindowDestroy, NULL);
dixScreenUnhookWindowPosition(pScreen, miDbeWindowPosition, NULL);
free(pDbeScreenPriv);
}
}
} /* DbeResetProc() */
/******************************************************************************
*
* DBE DIX Procedure: DbeDestroyWindow
*
* Description:
*
* This is the wrapper for pScreen->DestroyWindow.
* This function frees buffer resources for a window before it is
* destroyed.
*
*****************************************************************************/
}
static Bool
DbeDestroyWindow(WindowPtr pWin)
{
DbeScreenPrivPtr pDbeScreenPriv;
DbeWindowPrivPtr pDbeWindowPriv;
ScreenPtr pScreen;
Bool ret;
/*
**************************************************************************
** 1. Unwrap the member routine.
**************************************************************************
/**
* @brief window destroy callback
*
* Called by DIX when window is being destroyed.
*
*/
pScreen = pWin->drawable.pScreen;
pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
pScreen->DestroyWindow = pDbeScreenPriv->DestroyWindow;
static void miDbeWindowDestroy(ScreenPtr pScreen, WindowPtr pWin, void *closure)
{
/*
**************************************************************************
** 2. Do any work necessary before the member routine is called.
**
** Call the window priv delete function for all buffer IDs associated
** with this window.
**************************************************************************
*/
if ((pDbeWindowPriv = DBE_WINDOW_PRIV(pWin))) {
while (pDbeWindowPriv) {
DbeWindowPrivPtr pDbeWindowPriv;
while ((pDbeWindowPriv = DBE_WINDOW_PRIV(pWin))) {
/* *DbeWinPrivDelete() will free the window private and set it to
* NULL if there are no more buffer IDs associated with this
* window.
@ -1281,38 +1252,8 @@ DbeDestroyWindow(WindowPtr pWin)
FreeResource(pDbeWindowPriv->IDs[0], X11_RESTYPE_NONE);
pDbeWindowPriv = DBE_WINDOW_PRIV(pWin);
}
}
}
/*
**************************************************************************
** 3. Call the member routine, saving its result if necessary.
**************************************************************************
*/
ret = (*pScreen->DestroyWindow) (pWin);
/*
**************************************************************************
** 4. Rewrap the member routine, restoring the wrapper value first in case
** the wrapper (or something that it wrapped) change this value.
**************************************************************************
*/
pDbeScreenPriv->DestroyWindow = pScreen->DestroyWindow;
pScreen->DestroyWindow = DbeDestroyWindow;
/*
**************************************************************************
** 5. Do any work necessary after the member routine has been called.
**
** In this case we do not need to do anything.
**************************************************************************
*/
return ret;
} /* DbeDestroyWindow() */
/******************************************************************************
*
* DBE DIX Procedure: DbeExtensionInit
@ -1395,12 +1336,10 @@ DbeExtensionInit(void)
pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
if (ddxInitSuccess) {
/* Wrap DestroyWindow. The DDX initialization function
* already wrapped PositionWindow for us.
/* Hook in our window destructor. The DDX initialization function
* already added WindowPosition hook for us.
*/
pDbeScreenPriv->DestroyWindow = pScreen->DestroyWindow;
pScreen->DestroyWindow = DbeDestroyWindow;
dixScreenHookWindowDestroy(pScreen, miDbeWindowDestroy, NULL);
}
else {
/* DDX initialization failed. Stub the screen. */

View File

@ -169,13 +169,6 @@ typedef struct _DbeWindowPrivRec {
*/
typedef struct _DbeScreenPrivRec {
/* Wrapped functions
* It is the responsibility of the DDX layer to wrap PositionWindow().
* DbeExtensionInit wraps DestroyWindow().
*/
PositionWindowProcPtr PositionWindow;
DestroyWindowProcPtr DestroyWindow;
/* Per-screen DIX routines */
Bool (*SetupBackgroundPainter) (WindowPtr /*pWin */ ,
GCPtr /*pGC */

View File

@ -375,14 +375,13 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
* the resources associated with a DBE buffer ID. There are 5 ways that
* miDbeWinPrivDelete() can be called by FreeResource(). They are:
*
* - A DBE window is destroyed, in which case the DbeDestroyWindow()
* wrapper is invoked. The wrapper calls FreeResource() for all DBE
* buffer IDs.
* - A DBE window is destroyed, in which case the DbeWindowDestroy()
* callback is invoked. It calls FreeResource() for all DBE buffer IDs.
*
* - miDbeAllocBackBufferName() calls FreeResource() to clean up resources
* after a buffer allocation failure.
*
* - The PositionWindow wrapper, miDbePositionWindow(), calls
* - The WindowPosition hook, miDbeWindowPosition(), calls
* FreeResource() when it fails to create buffers of the new size.
* FreeResource() is called for all DBE buffer IDs.
*
@ -432,22 +431,20 @@ miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId)
if (pDbeWindowPriv->pBackBuffer)
dixDestroyPixmap(pDbeWindowPriv->pBackBuffer, 0);
} /* miDbeWinPrivDelete() */
/******************************************************************************
*
* DBE MI Procedure: miDbePositionWindow
* DBE MI Procedure: miDbeWindowPosition
*
* Description:
*
* This function was cloned from miMbxPositionWindow() in mimultibuf.c.
* This function was cloned from miMbxWindowPosition() in mimultibuf.c.
* This function resizes the buffer when the window is resized.
*
*****************************************************************************/
static Bool
miDbePositionWindow(WindowPtr pWin, int x, int y)
void miDbeWindowPosition(ScreenPtr pScreen, WindowPtr pWin, void *arg, int32_t x, int32_t y)
{
ScreenPtr pScreen;
DbeScreenPrivPtr pDbeScreenPriv;
DbeWindowPrivPtr pDbeWindowPriv;
int width, height;
@ -460,43 +457,9 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
Bool clear;
GCPtr pGC;
xRectangle clearRect;
Bool ret;
/*
**************************************************************************
** 1. Unwrap the member routine.
**************************************************************************
*/
pScreen = pWin->drawable.pScreen;
pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
pScreen->PositionWindow = pDbeScreenPriv->PositionWindow;
/*
**************************************************************************
** 2. Do any work necessary before the member routine is called.
**
** In this case we do not need to do anything.
**************************************************************************
*/
/*
**************************************************************************
** 3. Call the member routine, saving its result if necessary.
**************************************************************************
*/
ret = (*pScreen->PositionWindow) (pWin, x, y);
/*
**************************************************************************
** 4. Rewrap the member routine, restoring the wrapper value first in case
** the wrapper (or something that it wrapped) change this value.
**************************************************************************
*/
pDbeScreenPriv->PositionWindow = pScreen->PositionWindow;
pScreen->PositionWindow = miDbePositionWindow;
/*
**************************************************************************
@ -504,14 +467,12 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
**************************************************************************
*/
if (!(pDbeWindowPriv = DBE_WINDOW_PRIV(pWin))) {
return ret;
}
if (!(pDbeWindowPriv = DBE_WINDOW_PRIV(pWin)))
return;
if (pDbeWindowPriv->width == pWin->drawable.width &&
pDbeWindowPriv->height == pWin->drawable.height) {
return ret;
}
pDbeWindowPriv->height == pWin->drawable.height)
return;
width = pWin->drawable.width;
height = pWin->drawable.height;
@ -595,7 +556,7 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
}
FreeScratchGC(pGC);
return FALSE;
return;
}
else {
@ -645,11 +606,8 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
FreeScratchGC(pGC);
}
}
return ret;
} /* miDbePositionWindow() */
/******************************************************************************
*
* DBE MI Procedure: miDbeInit
@ -664,8 +622,7 @@ Bool
miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv)
{
/* Wrap functions. */
pDbeScreenPriv->PositionWindow = pScreen->PositionWindow;
pScreen->PositionWindow = miDbePositionWindow;
dixScreenUnhookWindowPosition(pScreen, miDbeWindowPosition, NULL);
/* Initialize the per-screen DBE function pointers. */
pDbeScreenPriv->GetVisualInfo = miDbeGetVisualInfo;

View File

@ -53,4 +53,6 @@ extern DevPrivateKeyRec dbeWindowPrivKeyRec;
extern RESTYPE dbeDrawableResType;
extern RESTYPE dbeWindowPrivResType;
void miDbeWindowPosition(ScreenPtr pScreen, WindowPtr pWin, void *arg, int32_t x, int32_t y);
#endif /* MIDBE_H */

View File

@ -99,7 +99,7 @@ typedef struct _LFclosure {
typedef struct _PTclosure {
ClientPtr client;
DrawablePtr pDraw;
GC *pGC;
GCPtr pGC;
unsigned char *pElt;
unsigned char *endReq;
unsigned char *data;
@ -115,7 +115,7 @@ typedef struct _PTclosure {
typedef struct _ITclosure {
ClientPtr client;
DrawablePtr pDraw;
GC *pGC;
GCPtr pGC;
BYTE nChars;
unsigned char *data;
int xorg;

View File

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

View File

@ -110,7 +110,9 @@ Equipment Corporation.
#include "dix/gc_priv.h"
#include "dix/registry_priv.h"
#include "dix/screenint_priv.h"
#include "dix/selection_priv.h"
#include "include/resource.h"
#include "miext/extinit_priv.h"
#include "os/auth.h"
#include "os/client_priv.h"
#include "os/ddx_priv.h"
@ -120,7 +122,6 @@ Equipment Corporation.
#include "windowstr.h"
#include "dixfontstr.h"
#include "gcstruct.h"
#include "selection.h"
#include "colormapst.h"
#include "cursorstr.h"
#include "scrnintstr.h"
@ -1462,6 +1463,8 @@ int
dixDestroyPixmap(void *value, XID pid)
{
PixmapPtr pPixmap = (PixmapPtr) value;
if (pPixmap && pPixmap->refcnt == 1)
dixScreenRaisePixmapDestroy(pPixmap);
if (pPixmap && pPixmap->drawable.pScreen && pPixmap->drawable.pScreen->DestroyPixmap)
return pPixmap->drawable.pScreen->DestroyPixmap(pPixmap);
return TRUE;
@ -1558,7 +1561,7 @@ int
ProcCreateGC(ClientPtr client)
{
int error, rc;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
unsigned len;
@ -1575,7 +1578,7 @@ ProcCreateGC(ClientPtr client)
len = client->req_len - bytes_to_int32(sizeof(xCreateGCReq));
if (len != Ones(stuff->mask))
return BadLength;
pGC = (GC *) CreateGC(pDraw, stuff->mask, (XID *) &stuff[1], &error,
pGC = (GCPtr) CreateGC(pDraw, stuff->mask, (XID *) &stuff[1], &error,
stuff->gc, client);
if (error != Success)
return error;
@ -1587,7 +1590,7 @@ ProcCreateGC(ClientPtr client)
int
ProcChangeGC(ClientPtr client)
{
GC *pGC;
GCPtr pGC;
int result;
unsigned len;
@ -1608,8 +1611,8 @@ ProcChangeGC(ClientPtr client)
int
ProcCopyGC(ClientPtr client)
{
GC *dstGC;
GC *pGC;
GCPtr dstGC;
GCPtr pGC;
int result;
REQUEST(xCopyGCReq);
@ -1633,7 +1636,7 @@ ProcCopyGC(ClientPtr client)
int
ProcSetDashes(ClientPtr client)
{
GC *pGC;
GCPtr pGC;
int result;
REQUEST(xSetDashesReq);
@ -1659,7 +1662,7 @@ int
ProcSetClipRectangles(ClientPtr client)
{
int nr, result;
GC *pGC;
GCPtr pGC;
REQUEST(xSetClipRectanglesReq);
@ -1684,7 +1687,7 @@ ProcSetClipRectangles(ClientPtr client)
int
ProcFreeGC(ClientPtr client)
{
GC *pGC;
GCPtr pGC;
int rc;
REQUEST(xResourceReq);
@ -1774,7 +1777,7 @@ ProcCopyArea(ClientPtr client)
{
DrawablePtr pDst;
DrawablePtr pSrc;
GC *pGC;
GCPtr pGC;
REQUEST(xCopyAreaReq);
RegionPtr pRgn;
@ -1812,7 +1815,7 @@ int
ProcCopyPlane(ClientPtr client)
{
DrawablePtr psrcDraw, pdstDraw;
GC *pGC;
GCPtr pGC;
REQUEST(xCopyPlaneReq);
RegionPtr pRgn;
@ -1858,7 +1861,7 @@ int
ProcPolyPoint(ClientPtr client)
{
int npoint;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xPolyPointReq);
@ -1881,7 +1884,7 @@ int
ProcPolyLine(ClientPtr client)
{
int npoint;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xPolyLineReq);
@ -1904,7 +1907,7 @@ int
ProcPolySegment(ClientPtr client)
{
int nsegs;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xPolySegmentReq);
@ -1924,7 +1927,7 @@ int
ProcPolyRectangle(ClientPtr client)
{
int nrects;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xPolyRectangleReq);
@ -1945,7 +1948,7 @@ int
ProcPolyArc(ClientPtr client)
{
int narcs;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xPolyArcReq);
@ -1965,7 +1968,7 @@ int
ProcFillPoly(ClientPtr client)
{
int things;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xFillPolyReq);
@ -1995,7 +1998,7 @@ int
ProcPolyFillRectangle(ClientPtr client)
{
int things;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xPolyFillRectangleReq);
@ -2017,7 +2020,7 @@ int
ProcPolyFillArc(ClientPtr client)
{
int narcs;
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
REQUEST(xPolyFillArcReq);
@ -2090,7 +2093,7 @@ ReformatImage(char *base, int nbytes, int bpp, int order)
int
ProcPutImage(ClientPtr client)
{
GC *pGC;
GCPtr pGC;
DrawablePtr pDraw;
long length; /* length of scanline server padded */
long lengthProto; /* length of scanline protocol padded */
@ -2361,7 +2364,7 @@ ProcPolyText(ClientPtr client)
REQUEST(xPolyTextReq);
DrawablePtr pDraw;
GC *pGC;
GCPtr pGC;
REQUEST_AT_LEAST_SIZE(xPolyTextReq);
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
@ -2385,7 +2388,7 @@ ProcImageText8(ClientPtr client)
{
int err;
DrawablePtr pDraw;
GC *pGC;
GCPtr pGC;
REQUEST(xImageTextReq);
@ -2411,7 +2414,7 @@ ProcImageText16(ClientPtr client)
{
int err;
DrawablePtr pDraw;
GC *pGC;
GCPtr pGC;
REQUEST(xImageTextReq);

View File

@ -253,4 +253,68 @@ extern Bool explicit_display;
extern Bool disableBackingStore;
extern Bool enableBackingStore;
/*
* @brief call screen's window destructors
* @see dixScreenHookWindowDestroy
* @param pWin the window thats being destroyed
* @result the ScreenRec's DestroyWindow() return value
*
* Call the pluggable window destructors that extensions might have registered on
* the screen, and finally call ScreenRec's DestroyWindow proc.
*
* Should only be called by DIX itself.
*/
int dixScreenRaiseWindowDestroy(WindowPtr pWin);
/*
* @brief call screen's window position notification hooks
* @see dixScreenHookWindowPosition
* @param pWin the window to notify on
*
* Call the pluggable window position hooks that extensions might have registered on
* the screen, and finally call ScreenRec's PositionWindow proc.
*
* Should only be called by DIX itself.
*/
void dixScreenRaiseWindowPosition(WindowPtr pWin, uint32_t x, uint32_t y);
/*
* @brief call screen's close hooks
* @see dixScreenHookClose
* @param pScreen the screen being closed
*
* Call the pluggable screen close hooks that extensions might have registered on
* the screen, and finally call ScreenRec's CloseScreen proc.
*
* Should only be called by DIX itself.
*/
void dixScreenRaiseClose(ScreenPtr pScreen);
/*
* @brief call screen's PixmapDestroy hook
* @see dixScreenHookPixmapDestroy
* @param pPixmap the pixmap being destroyed
*
* Call the pluggable pixmap destroy pixmap hooks that extensions might have
* registered on the screen.
* Note that it's *only* called, when the pixmap is really being destroyed
* (instead of just unref'ed)
*
* Should only be called by DIX itself, by dixDestroyPixmap()
* It must be called *before* the ScreenRec->DestroyPixmap() is called, any
* only if the reference counter reaches 1.
*/
void dixScreenRaisePixmapDestroy(PixmapPtr pPixmap);
/*
* @brief lookup window by XID
*
* This globally looks for Window with given XID (all screens, all clients)
* and returns a pointer to it. If not found, returns NULL.
*
* Unlike ::dixLookupWindow() it doesn't scan only one given client, nor does
* it do any XACE calls.
*/
WindowPtr dixLookupWindowByXID(Window window);
#endif /* _XSERVER_DIX_PRIV_H */

View File

@ -60,6 +60,7 @@ Equipment Corporation.
#include "dix/dix_priv.h"
#include "dix/gc_priv.h"
#include "os/auth.h"
#include "os/log_priv.h"
#include "scrnintstr.h"
#include "resource.h"
@ -1103,7 +1104,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
int err = Success, lgerr; /* err is in X error, not font error, space */
enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT;
FontPathElementPtr fpe;
GC *origGC = NULL;
GCPtr origGC = NULL;
int itemSize = c->reqType == X_PolyText8 ? 1 : 2;
if (client->clientGone) {
@ -1213,7 +1214,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
if (lgerr == Suspended) {
if (!ClientIsAsleep(client)) {
int len;
GC *pGC;
GCPtr pGC;
PTclosurePtr new_closure;
/* We're putting the client to sleep. We need to do a few things
@ -1354,7 +1355,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
}
int
PolyText(ClientPtr client, DrawablePtr pDraw, GC * pGC, unsigned char *pElt,
PolyText(ClientPtr client, DrawablePtr pDraw, GCPtr pGC, unsigned char *pElt,
unsigned char *endReq, int xorg, int yorg, int reqType, XID did)
{
PTclosureRec local_closure = {
@ -1409,7 +1410,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
lgerr = LoadGlyphs(client, c->pGC->font, c->nChars, itemSize, c->data);
if (lgerr == Suspended) {
if (!ClientIsAsleep(client)) {
GC *pGC;
GCPtr pGC;
unsigned char *data;
ITclosurePtr new_closure;
ITclosurePtr old_closure;
@ -1500,7 +1501,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
}
int
ImageText(ClientPtr client, DrawablePtr pDraw, GC * pGC, int nChars,
ImageText(ClientPtr client, DrawablePtr pDraw, GCPtr pGC, int nChars,
unsigned char *data, int xorg, int yorg, int reqType, XID did)
{
ITclosureRec local_closure;

View File

@ -202,7 +202,7 @@ int
dixLookupFontable(FontPtr *pFont, XID id, ClientPtr client, Mask access)
{
int rc;
GC *pGC;
GCPtr pGC;
client->errorValue = id; /* EITHER font or gc */
rc = dixLookupResourceByType((void **) pFont, id, X11_RESTYPE_FONT, client,

View File

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

View File

@ -73,7 +73,7 @@ static Bool CreateDefaultTile(GCPtr pGC);
static unsigned char DefaultDash[2] = { 4, 4 };
void
ValidateGC(DrawablePtr pDraw, GC * pGC)
ValidateGC(DrawablePtr pDraw, GCPtr pGC)
{
(*pGC->funcs->ValidateGC) (pGC, pGC->stateChanges, pDraw);
pGC->stateChanges = 0;
@ -121,7 +121,7 @@ ValidateGC(DrawablePtr pDraw, GC * pGC)
_var = (_type)pUnion->ptr; pUnion++; }
int
ChangeGC(ClientPtr client, GC * pGC, BITS32 mask, ChangeGCValPtr pUnion)
ChangeGC(ClientPtr client, GCPtr pGC, BITS32 mask, ChangeGCValPtr pUnion)
{
BITS32 index2;
int error = 0;
@ -429,7 +429,7 @@ static const struct {
};
int
ChangeGCXIDs(ClientPtr client, GC * pGC, BITS32 mask, CARD32 *pC32)
ChangeGCXIDs(ClientPtr client, GCPtr pGC, BITS32 mask, CARD32 *pC32)
{
ChangeGCVal vals[GCLastBit + 1];
int i;
@ -466,7 +466,7 @@ NewGCObject(ScreenPtr pScreen, int depth)
{
GCPtr pGC;
pGC = dixAllocateScreenObjectWithPrivates(pScreen, GC, PRIVATE_GC);
pGC = dixAllocateScreenObjectWithPrivates(pScreen, GCRec, PRIVATE_GC);
if (!pGC) {
return (GCPtr) NULL;
}
@ -614,7 +614,7 @@ CreateDefaultTile(GCPtr pGC)
}
int
CopyGC(GC * pgcSrc, GC * pgcDst, BITS32 mask)
CopyGC(GCPtr pgcSrc, GCPtr pgcDst, BITS32 mask)
{
BITS32 index2;
BITS32 maskQ;

View File

@ -3,51 +3,6 @@
+ Copyright © 1987, 1998 The Open Group
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
/************************************************************
Copyright 1987, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
********************************************************/
#ifndef _XSERVER_INPUT_PRIV_H
#define _XSERVER_INPUT_PRIV_H

42
dix/lookup.c Normal file
View File

@ -0,0 +1,42 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*
* @brief DIX lookup functions
*/
#include <dix-config.h>
#include "dix/dix_priv.h"
#include "include/windowstr.h"
struct window_xid_match {
WindowPtr pWin;
Window id;
};
static int dix_match_window_xid(WindowPtr pWin, void *ptr)
{
struct window_xid_match *walk = (struct window_xid_match*) ptr;
if (walk->id == pWin->drawable.id) {
walk->pWin = pWin;
return WT_STOPWALKING;
}
else
return WT_WALKCHILDREN;
}
WindowPtr dixLookupWindowByXID(Window window)
{
struct window_xid_match walk = {
.id = window,
};
for (int i = 0; i < screenInfo.numScreens; i++) {
WalkTree(screenInfo.screens[i], dix_match_window_xid, &walk);
if (walk.pWin)
break;
}
return walk.pWin;
}

View File

@ -91,6 +91,7 @@ Equipment Corporation.
#include "dix/input_priv.h"
#include "dix/gc_priv.h"
#include "dix/registry_priv.h"
#include "dix/selection_priv.h"
#include "os/audit.h"
#include "os/auth.h"
#include "os/client_priv.h"
@ -110,7 +111,6 @@ Equipment Corporation.
#include "colormap.h"
#include "colormapst.h"
#include "cursorstr.h"
#include "selection.h"
#include "servermd.h"
#include "dixfont.h"
#include "extnsionst.h"

View File

@ -20,6 +20,7 @@ srcs_dix = [
'glyphcurs.c',
'grabs.c',
'inpututils.c',
'lookup.c',
'pixmap.c',
'privates.c',
'property.c',
@ -27,6 +28,7 @@ srcs_dix = [
'region.c',
'registry.c',
'resource.c',
'screen_hooks.c',
'selection.c',
'swaprep.c',
'swapreq.c',

View File

@ -565,7 +565,7 @@ static const int offsets[] = {
-1, /* X11_RESTYPE_NONE */
offsetof(WindowRec, devPrivates), /* X11_RESTYPE_WINDOW */
offsetof(PixmapRec, devPrivates), /* X11_RESTYPE_PIXMAP */
offsetof(GC, devPrivates), /* X11_RESTYPE_GC */
offsetof(GCRec, devPrivates), /* X11_RESTYPE_GC */
-1, /* X11_RESTYPE_FONT */
offsetof(CursorRec, devPrivates), /* X11_RESTYPE_CURSOR */
offsetof(ColormapRec, devPrivates), /* X11_RESTYPE_COLORMAP */

View File

@ -59,6 +59,11 @@ SOFTWARE.
#include "swaprep.h"
#include "xace.h"
#ifdef XINERAMA
#include "Xext/panoramiX.h"
#include "Xext/panoramiXsrv.h"
#endif
/*****************************************************************
* Property Stuff
*
@ -107,6 +112,46 @@ dixLookupProperty(PropertyPtr *result, WindowPtr pWin, Atom propertyName,
return rc;
}
static void
setVRRMode(WindowPtr pWin, WindowVRRMode mode)
{
SetWindowVRRModeProcPtr proc = pWin->drawable.pScreen->SetWindowVRRMode;
if (proc != NULL)
proc(pWin, mode);
}
static void
notifyVRRMode(ClientPtr pClient, WindowPtr pWindow, int state, PropertyPtr pProp)
{
const char *pName = NameForAtom(pProp->propertyName);
if (pName == NULL || strcmp(pName, "_VARIABLE_REFRESH") || pProp->format != 32 || pProp->size != 1)
return;
WindowVRRMode mode = (WindowVRRMode)(state == PropertyNewValue ? (*((uint32_t*)pProp->data)) : 0);
#ifdef XINERAMA
if (!noPanoramiXExtension) {
PanoramiXRes *win;
int rc, j;
rc = dixLookupResourceByType((void **) &win, pWindow->drawable.id, XRT_WINDOW,
pClient, DixWriteAccess);
if (rc != Success)
goto no_panoramix;
FOR_NSCREENS_BACKWARD(j) {
WindowPtr pWin;
rc = dixLookupWindow(&pWin, win->info[j].id, pClient, DixSetPropAccess);
if (rc == Success)
setVRRMode(pWin, mode);
}
}
return;
no_panoramix:
#endif
setVRRMode(pWindow, mode);
}
CallbackListPtr PropertyStateCallback;
static void
@ -187,6 +232,7 @@ ProcRotateProperties(ClientPtr client)
for (i = 0; i < stuff->nAtoms; i++) {
j = (i + delta) % stuff->nAtoms;
deliverPropertyNotifyEvent(pWin, PropertyNewValue, props[i]);
notifyVRRMode(client, pWin, PropertyNewValue, props[i]);
/* Preserve name and devPrivates */
props[j]->type = saved[i].type;
@ -366,8 +412,10 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
else
return rc;
if (sendevent)
if (sendevent) {
deliverPropertyNotifyEvent(pWin, PropertyNewValue, pProp);
notifyVRRMode(pClient, pWin, PropertyNewValue, pProp);
}
return Success;
}
@ -397,6 +445,7 @@ DeleteProperty(ClientPtr client, WindowPtr pWin, Atom propName)
}
deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp);
notifyVRRMode(client, pWin, PropertyDelete, pProp);
free(pProp->data);
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
}
@ -533,7 +582,10 @@ ProcGetProperty(ClientPtr client)
};
if (stuff->delete && (reply.bytesAfter == 0))
{
deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp);
notifyVRRMode(client, pWin, PropertyDelete, pProp);
}
WriteReplyToClient(client, sizeof(xGenericReply), &reply);
if (len) {

105
dix/screen_hooks.c Normal file
View File

@ -0,0 +1,105 @@
/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
*/
#include <dix-config.h>
#include "dix/dix_priv.h"
#include "include/dix.h"
#include "include/os.h"
#include "include/scrnintstr.h"
#include "include/windowstr.h"
#define ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
#define ARRAY_FOR_EACH(_ARRAY, _WALK) \
for (struct { int idx; typeof(_ARRAY[0])*ptr; } _WALK = { 0, _ARRAY }; _WALK.idx < ARRAY_LENGTH(_ARRAY); _WALK.idx++, _WALK.ptr++)
#define DECLARE_HOOK_LIST(NAME, FIELD) \
void dixScreenHook##NAME(ScreenPtr pScreen, typeof(((ScreenRec){0}).FIELD[0].func) func, void *arg) \
{ \
for (int i=0; i<ARRAY_LENGTH(pScreen->FIELD); i++) { \
if (!(pScreen->FIELD[i].func)) { \
pScreen->FIELD[i].func = func; \
pScreen->FIELD[i].arg = arg; \
return; \
} \
} \
FatalError("%s: out of slots", __FUNCTION__); \
} \
\
void dixScreenUnhook##NAME(ScreenPtr pScreen, typeof(((ScreenRec){0}).FIELD[0].func) func, void *arg) \
{ \
for (int i=0; i<ARRAY_LENGTH(pScreen->FIELD); i++) { \
if ((pScreen->FIELD[i].func == func) && (pScreen->FIELD[i].arg == arg)) { \
pScreen->FIELD[i].func = NULL; \
pScreen->FIELD[i].arg = NULL; \
return; \
} \
} \
}
DECLARE_HOOK_LIST(WindowDestroy, _notify_window_destroy)
DECLARE_HOOK_LIST(WindowPosition, _notify_window_position)
DECLARE_HOOK_LIST(Close, _notify_screen_close)
DECLARE_HOOK_LIST(PixmapDestroy, _notify_pixmap_destroy)
int dixScreenRaiseWindowDestroy(WindowPtr pWin)
{
if (!pWin)
return Success;
ScreenPtr pScreen = pWin->drawable.pScreen;
ARRAY_FOR_EACH(pScreen->_notify_window_destroy, walk) {
if (walk.ptr->func)
walk.ptr->func(pScreen, pWin, walk.ptr->arg);
}
return (pScreen->DestroyWindow ? (*pScreen->DestroyWindow) (pWin) : Success);
}
void dixScreenRaiseWindowPosition(WindowPtr pWin, uint32_t x, uint32_t y)
{
if (!pWin)
return;
ScreenPtr pScreen = pWin->drawable.pScreen;
ARRAY_FOR_EACH(pScreen->_notify_window_position, walk) {
if (walk.ptr->func)
walk.ptr->func(pScreen, pWin, walk.ptr->arg, x, y);
}
if (pScreen->PositionWindow)
(*pScreen->PositionWindow) (pWin, x, y);
}
void dixScreenRaiseClose(ScreenPtr pScreen)
{
if (!pScreen)
return;
ARRAY_FOR_EACH(pScreen->_notify_screen_close, walk) {
if (walk.ptr->func)
walk.ptr->func(pScreen, walk.ptr->arg);
}
if (pScreen->CloseScreen)
(*pScreen->CloseScreen) (pScreen);
}
void dixScreenRaisePixmapDestroy(PixmapPtr pPixmap)
{
if (!pPixmap)
return;
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ARRAY_FOR_EACH(pScreen->_notify_pixmap_destroy, walk) {
if (walk.ptr->func)
walk.ptr->func(pScreen, pPixmap, walk.ptr->arg);
}
/* we must not call the original ScreenRec->DestroyPixmap() here */
}

View File

@ -47,11 +47,11 @@ SOFTWARE.
#include <dix-config.h>
#include "dix/dix_priv.h"
#include "dix/selection_priv.h"
#include "windowstr.h"
#include "dixstruct.h"
#include "dispatch.h"
#include "selection.h"
#include "xace.h"
/*****************************************************************

View File

@ -68,12 +68,12 @@ typedef struct _Selection {
* Selection API
*/
extern _X_EXPORT int dixLookupSelection(Selection ** result, Atom name,
int dixLookupSelection(Selection ** result, Atom name,
ClientPtr client, Mask access_mode);
extern _X_EXPORT Selection *CurrentSelections;
extern Selection *CurrentSelections;
extern _X_EXPORT CallbackListPtr SelectionCallback;
extern CallbackListPtr SelectionCallback;
typedef enum {
SelectionSetOwner,
@ -91,10 +91,8 @@ typedef struct {
* Selection server internals
*/
extern _X_EXPORT void InitSelections(void);
extern _X_EXPORT void DeleteWindowFromAnySelections(WindowPtr pWin);
extern _X_EXPORT void DeleteClientFromAnySelections(ClientPtr client);
void InitSelections(void);
void DeleteWindowFromAnySelections(WindowPtr pWin);
void DeleteClientFromAnySelections(ClientPtr client);
#endif /* SELECTION_H */

View File

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

View File

@ -104,6 +104,7 @@ Equipment Corporation.
#include "dix/exevents_priv.h"
#include "dix/input_priv.h"
#include "dix/property_priv.h"
#include "dix/selection_priv.h"
#include "mi/mi_priv.h" /* miPaintWindow */
#include "os/auth.h"
#include "os/client_priv.h"
@ -133,7 +134,6 @@ Equipment Corporation.
#ifdef COMPOSITE
#include "compint.h"
#endif
#include "selection.h"
#include "inpututils.h"
#include "privates.h"
#include "xace.h"
@ -670,7 +670,8 @@ InitRootWindow(WindowPtr pWin)
if (!(*pScreen->CreateWindow) (pWin))
return; /* XXX */
(*pScreen->PositionWindow) (pWin, 0, 0);
dixScreenRaiseWindowPosition(pWin, 0, 0);
pWin->cursorIsNone = FALSE;
pWin->optional->cursor = RefCursor(rootCursor);
@ -820,12 +821,6 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
}
}
if (((vmask & (CWBorderPixmap | CWBorderPixel)) == 0) &&
(class != InputOnly) && (depth != pParent->drawable.depth)) {
*error = BadMatch;
return NullWindow;
}
if (((vmask & CWColormap) == 0) &&
(class != InputOnly) &&
((visual != ancwopt->visual) || (ancwopt->colormap == None))) {
@ -928,7 +923,7 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
return NullWindow;
}
/* We SHOULD check for an error value here XXX */
(*pScreen->PositionWindow) (pWin, pWin->drawable.x, pWin->drawable.y);
dixScreenRaiseWindowPosition(pWin, pWin->drawable.x, pWin->drawable.y);
if (!(vmask & CWEventMask))
RecalculateDeliverableEvents(pWin);
@ -998,8 +993,6 @@ DisposeWindowOptional(WindowPtr pWin)
static void
FreeWindowResources(WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
DeleteWindowFromAnySaveSet(pWin);
DeleteWindowFromAnySelections(pWin);
DeleteWindowFromAnyEvents(pWin, TRUE);
@ -1019,8 +1012,9 @@ FreeWindowResources(WindowPtr pWin)
dixDestroyPixmap(pWin->background.pixmap, 0);
DeleteAllWindowProperties(pWin);
/* We SHOULD check for an error value here XXX */
(*pScreen->DestroyWindow) (pWin);
dixScreenRaiseWindowDestroy(pWin);
DisposeWindowOptional(pWin);
}
@ -1849,12 +1843,9 @@ GravityTranslate(int x, int y, int oldx, int oldy,
void
ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh)
{
ScreenPtr pScreen;
WindowPtr pSib, pChild;
Bool resized = (dw || dh);
pScreen = pWin->drawable.pScreen;
for (pSib = pWin->firstChild; pSib; pSib = pSib->nextSib) {
if (resized && (pSib->winGravity > NorthWestGravity)) {
int cwsx, cwsy;
@ -1879,7 +1870,8 @@ ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh)
pSib->drawable.y = pWin->drawable.y + pSib->origin.y;
SetWinSize(pSib);
SetBorderSize(pSib);
(*pScreen->PositionWindow) (pSib, pSib->drawable.x, pSib->drawable.y);
dixScreenRaiseWindowPosition(pSib, pSib->drawable.x, pSib->drawable.y);
if ((pChild = pSib->firstChild)) {
while (1) {
@ -1889,7 +1881,7 @@ ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh)
pChild->origin.y;
SetWinSize(pChild);
SetBorderSize(pChild);
(*pScreen->PositionWindow) (pChild,
dixScreenRaiseWindowPosition(pChild,
pChild->drawable.x,
pChild->drawable.y);
if (pChild->firstChild) {
@ -2585,7 +2577,8 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent,
if (pScreen->ReparentWindow)
(*pScreen->ReparentWindow) (pWin, pPriorParent);
(*pScreen->PositionWindow) (pWin, pWin->drawable.x, pWin->drawable.y);
dixScreenRaiseWindowPosition(pWin, pWin->drawable.x, pWin->drawable.y);
ResizeChildrenWinSize(pWin, 0, 0, 0, 0);
CheckWindowOptionalNeed(pWin);

View File

@ -3285,9 +3285,8 @@ need to be done when these happen, such as allocating or deallocating
structures that are only needed for visible windows. RealizeWindow
does NOT draw the window border, background or contents;
UnrealizeWindow does NOT erase the window or generate exposure events
for underlying windows; this is taken care of by DIX. DIX does,
however, call PaintWindowBackground() and PaintWindowBorder() to
perform some of these.</para>
for underlying windows; this is taken care of by DIX.
</para>
<para>
<blockquote><programlisting>
@ -3391,7 +3390,7 @@ and all of its child windows.</para>
If generateExposures is false, the client is trying to simply erase part
of the window to the background fill style.
ClearToBackground should write the background color or tile to the
rectangle in question (probably using PaintWindowBackground).
rectangle in question.
If w or h is zero, it clears all the way to the right or lower edge of the window.</para>
<para>
The sample server implementation is in Xserver/mi/miwindow.c.</para>
@ -4052,7 +4051,7 @@ returned instead). Furthermore, the invalid bits of the source are
not copied to the destination and (when the destination is a window)
are filled with the background tile. The sample routine
miHandleExposures generates the appropriate return value and fills the
invalid area using pScreen->PaintWindowBackground.</para>
invalid area.</para>
<para>
For instance, imagine a window that is partially obscured by other
windows in front of it. As text is scrolled on your window, the pixels
@ -4994,8 +4993,6 @@ mi and fb implementations.</para>
<row><entry><function>ModifyPixmapHeader</function></entry><entry><literal>mi</literal></entry><entry><para>Screen</para></entry></row>
<row><entry><function>NextAvailableClient</function></entry><entry><literal>dix</literal></entry><entry><para></para></entry></row>
<row><entry><function>OsInit</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
<row><entry><function>PaintWindowBackground</function></entry><entry><literal>mi</literal></entry><entry><para>Window</para></entry></row>
<row><entry><function>PaintWindowBorder</function></entry><entry><literal>mi</literal></entry><entry><para>Window</para></entry></row>
<row><entry><function>PointerNonInterestBox</function></entry><entry><literal>hd</literal></entry><entry><para>Screen</para></entry></row>
<row><entry><function>PointInRegion</function></entry><entry><literal>mi</literal></entry><entry><para>Screen</para></entry></row>
<row><entry><function>PolyArc</function></entry><entry><literal>mi</literal></entry><entry><para>GC op</para></entry></row>

View File

@ -19,9 +19,11 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#include <dix-config.h>
#include "miext/extinit_priv.h"
#include "dri3_priv.h"
#include "extinit_priv.h"
#include <drm_fourcc.h>
static int dri3_request;
@ -29,15 +31,11 @@ DevPrivateKeyRec dri3_screen_private_key;
static int dri3_screen_generation;
static Bool
dri3_close_screen(ScreenPtr screen)
static void dri3_screen_close(ScreenPtr screen, void *arg)
{
dri3_screen_priv_ptr screen_priv = dri3_screen_priv(screen);
unwrap(screen_priv, screen, CloseScreen);
dixScreenUnhookClose(screen, dri3_screen_close, NULL);
free(screen_priv);
return (*screen->CloseScreen) (screen);
}
Bool
@ -53,7 +51,7 @@ dri3_screen_init(ScreenPtr screen, const dri3_screen_info_rec *info)
if (!screen_priv)
return FALSE;
wrap(screen_priv, screen, CloseScreen, dri3_close_screen);
dixScreenHookClose(screen, dri3_screen_close, NULL);
screen_priv->info = info;

View File

@ -42,9 +42,7 @@ typedef struct dri3_dmabuf_format {
} dri3_dmabuf_format_rec, *dri3_dmabuf_format_ptr;
typedef struct dri3_screen_priv {
CloseScreenProcPtr CloseScreen;
ConfigNotifyProcPtr ConfigNotify;
DestroyWindowProcPtr DestroyWindow;
Bool formats_cached;
CARD32 num_formats;

View File

@ -740,6 +740,11 @@ exaCloseScreen(ScreenPtr pScreen)
ExaScreenPriv(pScreen);
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
/* doesn't matter which one actually was registered */
dixScreenUnhookPixmapDestroy(pScreen, exaPixmapDestroy_classic, 0);
dixScreenUnhookPixmapDestroy(pScreen, exaPixmapDestroy_driver, 0);
dixScreenUnhookPixmapDestroy(pScreen, exaPixmapDestroy_mixed, 0);
if (ps->Glyphs == exaGlyphs)
exaGlyphsFini(pScreen);
@ -753,8 +758,6 @@ exaCloseScreen(ScreenPtr pScreen)
unwrap(pExaScr, pScreen, GetSpans);
if (pExaScr->SavedCreatePixmap)
unwrap(pExaScr, pScreen, CreatePixmap);
if (pExaScr->SavedDestroyPixmap)
unwrap(pExaScr, pScreen, DestroyPixmap);
if (pExaScr->SavedModifyPixmapHeader)
unwrap(pExaScr, pScreen, ModifyPixmapHeader);
unwrap(pExaScr, pScreen, CopyWindow);
@ -955,8 +958,9 @@ exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo)
}
if (pExaScr->info->flags & EXA_HANDLES_PIXMAPS) {
if (pExaScr->info->flags & EXA_MIXED_PIXMAPS) {
dixScreenHookPixmapDestroy(pScreen, exaPixmapDestroy_mixed, 0);
wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_mixed);
wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_mixed);
wrap(pExaScr, pScreen, ModifyPixmapHeader,
exaModifyPixmapHeader_mixed);
wrap(pExaScr, pScreen, SharePixmapBacking, exaSharePixmapBacking_mixed);
@ -969,8 +973,9 @@ exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo)
pExaScr->prepare_access_reg = exaPrepareAccessReg_mixed;
}
else {
dixScreenHookPixmapDestroy(pScreen, exaPixmapDestroy_driver, 0);
wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_driver);
wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_driver);
wrap(pExaScr, pScreen, ModifyPixmapHeader,
exaModifyPixmapHeader_driver);
pExaScr->do_migration = NULL;
@ -981,8 +986,9 @@ exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo)
}
}
else {
dixScreenHookPixmapDestroy(pScreen, exaPixmapDestroy_classic, 0);
wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_classic);
wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_classic);
wrap(pExaScr, pScreen, ModifyPixmapHeader,
exaModifyPixmapHeader_classic);
pExaScr->do_migration = exaDoMigration_classic;

View File

@ -206,18 +206,11 @@ exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height,
return ret;
}
Bool
exaDestroyPixmap_classic(PixmapPtr pPixmap)
void exaPixmapDestroy_classic(ScreenPtr pScreen, PixmapPtr pPixmap, void *arg)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPriv(pScreen);
Bool ret = TRUE;
if (pPixmap->refcnt == 1) {
ExaPixmapPriv(pPixmap);
if (!pExaPixmap) // we're called on an error path
goto out;
return;
exaDestroyPixmap(pPixmap);
@ -233,15 +226,6 @@ exaDestroyPixmap_classic(PixmapPtr pPixmap)
}
RegionUninit(&pExaPixmap->validSys);
RegionUninit(&pExaPixmap->validFB);
}
out:
// restore original (screen driver's) DestroyPixmap() handler and call it
swap(pExaScr, pScreen, DestroyPixmap);
dixDestroyPixmap(pPixmap, 0);
swap(pExaScr, pScreen, DestroyPixmap);
return ret;
}
Bool

View File

@ -185,33 +185,19 @@ exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height,
return ret;
}
Bool
exaDestroyPixmap_driver(PixmapPtr pPixmap)
void exaPixmapDestroy_driver(ScreenPtr pScreen, PixmapPtr pPixmap, void *arg)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPriv(pScreen);
Bool ret = TRUE;
if (pPixmap->refcnt == 1) {
ExaPixmapPriv(pPixmap);
if (!pExaPixmap) // we're called on an error path
goto out;
return;
exaDestroyPixmap(pPixmap);
if (pExaPixmap->driverPriv)
pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv);
pExaPixmap->driverPriv = NULL;
}
out:
// restore original (screen driver's) DestroyPixmap() handler and call it
swap(pExaScr, pScreen, DestroyPixmap);
dixDestroyPixmap(pPixmap, 0);
swap(pExaScr, pScreen, DestroyPixmap);
return ret;
}
Bool

View File

@ -239,18 +239,13 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
return ret;
}
Bool
exaDestroyPixmap_mixed(PixmapPtr pPixmap)
void exaPixmapDestroy_mixed(ScreenPtr pScreen, PixmapPtr pPixmap, void *arg)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPriv(pScreen);
Bool ret = TRUE;
if (pPixmap->refcnt == 1) {
ExaPixmapPriv(pPixmap);
if (!pExaPixmap)
goto out; // we're called on an error path
if (!pExaPixmap) // we're called on an error path
return;
exaDestroyPixmap(pPixmap);
@ -266,15 +261,6 @@ exaDestroyPixmap_mixed(PixmapPtr pPixmap)
pExaPixmap->sys_ptr = NULL;
pExaPixmap->pDamage = NULL;
}
}
out:
// restore original (screen driver's) DestroyPixmap() handler and call it
swap(pExaScr, pScreen, DestroyPixmap);
dixDestroyPixmap(pPixmap, 0);
swap(pExaScr, pScreen, DestroyPixmap);
return ret;
}
Bool

View File

@ -156,7 +156,6 @@ typedef struct {
GetImageProcPtr SavedGetImage;
GetSpansProcPtr SavedGetSpans;
CreatePixmapProcPtr SavedCreatePixmap;
DestroyPixmapProcPtr SavedDestroyPixmap;
CopyWindowProcPtr SavedCopyWindow;
ChangeWindowAttributesProcPtr SavedChangeWindowAttributes;
BitmapToRegionProcPtr SavedBitmapToRegion;
@ -590,8 +589,7 @@ exaModifyPixmapHeader_classic(PixmapPtr pPixmap, int width, int height,
int depth, int bitsPerPixel, int devKind,
void *pPixData);
Bool
exaDestroyPixmap_classic(PixmapPtr pPixmap);
void exaPixmapDestroy_classic(ScreenPtr pScreen, PixmapPtr pPixmap, void *arg);
Bool
exaPixmapHasGpuCopy_classic(PixmapPtr pPixmap);
@ -608,8 +606,7 @@ exaModifyPixmapHeader_driver(PixmapPtr pPixmap, int width, int height,
int depth, int bitsPerPixel, int devKind,
void *pPixData);
Bool
exaDestroyPixmap_driver(PixmapPtr pPixmap);
void exaPixmapDestroy_driver(ScreenPtr pScreen, PixmapPtr pPixmap, void *arg);
Bool
exaPixmapHasGpuCopy_driver(PixmapPtr pPixmap);
@ -625,8 +622,7 @@ Bool
exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
int bitsPerPixel, int devKind, void *pPixData);
Bool
exaDestroyPixmap_mixed(PixmapPtr pPixmap);
void exaPixmapDestroy_mixed(ScreenPtr pScreen, PixmapPtr pPixmap, void *arg);
Bool
exaPixmapHasGpuCopy_mixed(PixmapPtr pPixmap);

View File

@ -842,6 +842,12 @@ fbPolyFillRect(DrawablePtr pDrawable,
#define fbFillPolygon miFillPolygon
#define fbSetShape miSetShape
#define fbMoveWindow miMoveWindow
#define fbModifyPixmapHeader miModifyPixmapHeader
/*
* fbfillsp.c
*/

View File

@ -604,6 +604,11 @@ glamor_setup_formats(ScreenPtr screen)
glamor_priv->cbcr_format.texture_only = FALSE;
}
static void glamor_pixmap_destroy(ScreenPtr pScreen, PixmapPtr pPixmap, void *arg)
{
glamor_pixmap_destroy_fbo(pPixmap);
}
/** Set up glamor for an already-configured GL context. */
Bool
glamor_init(ScreenPtr screen, unsigned int flags)
@ -652,8 +657,7 @@ glamor_init(ScreenPtr screen, unsigned int flags)
glamor_priv->saved_procs.close_screen = screen->CloseScreen;
screen->CloseScreen = glamor_close_screen;
glamor_priv->saved_procs.destroy_pixmap = screen->DestroyPixmap;
screen->DestroyPixmap = glamor_destroy_pixmap;
dixScreenHookPixmapDestroy(screen, glamor_pixmap_destroy, NULL);
/* If we are using egl screen, call egl screen init to
* register correct close screen function. */
@ -879,7 +883,7 @@ glamor_init(ScreenPtr screen, unsigned int flags)
fail:
/* Restore default CloseScreen and DestroyPixmap handlers */
screen->CloseScreen = glamor_priv->saved_procs.close_screen;
screen->DestroyPixmap = glamor_priv->saved_procs.destroy_pixmap;
dixScreenUnhookPixmapDestroy(screen, glamor_pixmap_destroy, NULL);
free_glamor_private:
free(glamor_priv);
@ -913,9 +917,10 @@ glamor_close_screen(ScreenPtr screen)
glamor_set_glvnd_vendor(screen, NULL);
screen->CloseScreen = glamor_priv->saved_procs.close_screen;
dixScreenUnhookPixmapDestroy(screen, glamor_pixmap_destroy, NULL);
screen->CreateGC = glamor_priv->saved_procs.create_gc;
screen->CreatePixmap = glamor_priv->saved_procs.create_pixmap;
screen->DestroyPixmap = glamor_priv->saved_procs.destroy_pixmap;
screen->GetSpans = glamor_priv->saved_procs.get_spans;
screen->ChangeWindowAttributes =
glamor_priv->saved_procs.change_window_attributes;

View File

@ -62,7 +62,6 @@ struct glamor_egl_screen_private {
Bool force_vendor; /* if GLVND vendor is forced from options */
CloseScreenProcPtr saved_close_screen;
DestroyPixmapProcPtr saved_destroy_pixmap;
xf86FreeScreenProc *saved_free_screen;
};
@ -756,31 +755,18 @@ glamor_egl_get_driver_name(ScreenPtr screen)
return NULL;
}
static Bool
glamor_egl_destroy_pixmap(PixmapPtr pixmap)
static void glamor_egl_pixmap_destroy(ScreenPtr pScreen, PixmapPtr pixmap, void *arg)
{
ScreenPtr screen = pixmap->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
struct glamor_egl_screen_private *glamor_egl =
glamor_egl_get_screen_private(scrn);
Bool ret = TRUE;
if (pixmap->refcnt == 1) {
struct glamor_pixmap_private *pixmap_priv =
glamor_get_pixmap_private(pixmap);
if (pixmap_priv->image)
eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image);
}
screen->DestroyPixmap = glamor_egl->saved_destroy_pixmap;
if (screen->DestroyPixmap)
ret = screen->DestroyPixmap(pixmap);
glamor_egl->saved_destroy_pixmap = screen->DestroyPixmap;
screen->DestroyPixmap = glamor_egl_destroy_pixmap;
return ret;
}
void
@ -822,6 +808,7 @@ glamor_egl_close_screen(ScreenPtr screen)
eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image);
pixmap_priv->image = NULL;
dixScreenUnhookPixmapDestroy(screen, glamor_egl_pixmap_destroy, NULL);
screen->CloseScreen = glamor_egl->saved_close_screen;
return screen->CloseScreen(screen);
@ -907,8 +894,7 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
glamor_egl->saved_close_screen = screen->CloseScreen;
screen->CloseScreen = glamor_egl_close_screen;
glamor_egl->saved_destroy_pixmap = screen->DestroyPixmap;
screen->DestroyPixmap = glamor_egl_destroy_pixmap;
dixScreenHookPixmapDestroy(screen, glamor_egl_pixmap_destroy, NULL);
glamor_ctx->ctx = glamor_egl->context;
glamor_ctx->display = glamor_egl->display;

View File

@ -35,16 +35,18 @@
#include "glamor.h"
static XF86ModuleVersionInfo VersRec = {
GLAMOR_EGL_MODULE_NAME,
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
1, 0, 1, /* version */
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
MOD_CLASS_NONE,
{0, 0, 0, 0} /* signature, to be patched into the file by a tool */
.modname = GLAMOR_EGL_MODULE_NAME,
.vendor = MODULEVENDORSTRING,
._modinfo1_ = MODINFOSTRING1,
._modinfo2_ = MODINFOSTRING2,
.xf86version = XORG_VERSION_CURRENT,
.majorversion = 1,
.minorversion = 0,
.patchlevel = 1,
.abiclass = ABI_CLASS_ANSIC,
.abiversion = ABI_ANSIC_VERSION,
};
_X_EXPORT XF86ModuleData glamoreglModuleData = { &VersRec, NULL, NULL };
_X_EXPORT XF86ModuleData glamoreglModuleData = {
.vers = &VersRec
};

View File

@ -209,7 +209,6 @@ struct glamor_saved_procs {
CloseScreenProcPtr close_screen;
CreateGCProcPtr create_gc;
CreatePixmapProcPtr create_pixmap;
DestroyPixmapProcPtr destroy_pixmap;
GetSpansProcPtr get_spans;
GetImageProcPtr get_image;
CompositeProcPtr composite;

View File

@ -33,8 +33,10 @@
#include <GL/gl.h>
#include <GL/glxtokens.h>
#include <GL/internal/dri_interface.h>
#include "miext/extinit_priv.h"
#include <os.h>
#include "extinit.h"
#include "glxserver.h"
#include "glxext.h"
#include "glxcontext.h"

View File

@ -48,13 +48,6 @@
#include "extension_string.h"
/* RTLD_LOCAL is not defined on Cygwin */
#ifdef __CYGWIN__
#ifndef RTLD_LOCAL
#define RTLD_LOCAL 0
#endif
#endif
typedef struct __GLXDRIscreen __GLXDRIscreen;
typedef struct __GLXDRIcontext __GLXDRIcontext;
typedef struct __GLXDRIdrawable __GLXDRIdrawable;

View File

@ -36,7 +36,6 @@
#include <propertyst.h>
#include "privates.h"
#include <os.h>
#include "extinit.h"
#include "glx_extinit.h"
#include "unpack.h"
#include "glxutil.h"

View File

@ -36,7 +36,6 @@
#include <os.h>
#include <colormapst.h>
#include "extinit.h"
#include "privates.h"
#include "glxserver.h"
#include "glxutil.h"

View File

@ -33,7 +33,7 @@
#include "indirect_reqsize.h"
#include "misc.h"
#if defined(__CYGWIN__) || defined(__MINGW32__)
#if defined(__MINGW32__)
#undef HAVE_ALIAS
#endif
#ifdef HAVE_ALIAS

View File

@ -44,7 +44,7 @@
#define PURE
#endif
#if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
#if defined(__i386__) && defined(__GNUC__) && !defined(__MINGW32__)
#define FASTCALL __attribute__((fastcall))
#else
#define FASTCALL

View File

@ -39,14 +39,14 @@
#define PURE
#endif
#if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
#if defined(__i386__) && defined(__GNUC__) && !defined(__MINGW32__)
#define FASTCALL __attribute__((fastcall))
#else
#define FASTCALL
#endif
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(GLX_USE_APPLEGL)
#if defined(__MINGW32__) || defined(GLX_USE_APPLEGL)
#undef HAVE_ALIAS
#endif
#ifdef HAVE_ALIAS

View File

@ -44,7 +44,7 @@
#define PURE
#endif
#if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
#if defined(__i386__) && defined(__GNUC__) && !defined(__MINGW32__)
#define FASTCALL __attribute__((fastcall))
#else
#define FASTCALL

View File

@ -35,12 +35,12 @@
#include <dixstruct.h>
#include <extnsionst.h>
#include <glx_extinit.h>
#include "extinit_priv.h"
#include <GL/glxproto.h>
#include "vndservervendor.h"
#include "dix/dix_priv.h"
#include "miext/extinit_priv.h"
Bool noGlxExtension = FALSE;

View File

@ -28,6 +28,7 @@
#include "dix/dix_priv.h"
#include "os/cmdline.h"
#include "os/ddx_priv.h"
#include "os/log_priv.h"
#include "os/osdep.h"
#include "ephyr.h"
@ -288,10 +289,8 @@ ddxProcessArgument(int argc, char **argv, int i)
}
else if (!strcmp(argv[i], "-verbosity")) {
if (i + 1 < argc && argv[i + 1][0] != '-') {
int verbosity = atoi(argv[i + 1]);
LogSetParameter(XLOG_VERBOSITY, verbosity);
EPHYR_LOG("set verbosiry to %d\n", verbosity);
xorgLogVerbosity = atoi(argv[i + 1]);
EPHYR_LOG("set verbosiry to %d\n", xorgLogVerbosity);
return 2;
}
else {

View File

@ -26,7 +26,6 @@
#include "dix/screenint_priv.h"
#include "os/cmdline.h"
#include "os/ddx_priv.h"
#include "os/osdep.h"
#include "kdrive.h"
@ -53,7 +52,7 @@
/* This stub can be safely removed once we can
* split input and GPU parts in hotplug.h et al. */
#include <systemd-logind.h>
#include "../../xfree86/os-support/linux/systemd-logind.h"
typedef struct _kdDepths {
CARD8 depth;

View File

@ -46,7 +46,6 @@
#include "xkbsrv.h"
#include "XIstubs.h" /* even though we don't use stubs. cute, no? */
#include "exevents.h"
#include "extinit.h"
#include "exglobals.h"
#include "eventstr.h"
#include "xserver-properties.h"

View File

@ -82,9 +82,10 @@ static int KdXVPutImage(DrawablePtr, XvPortPtr, GCPtr,
static int KdXVQueryImageAttributes(XvPortPtr, XvImagePtr,
CARD16 *, CARD16 *, int *, int *);
static void KdXVWindowDestroy(ScreenPtr pScreen, WindowPtr pWin, void *arg);
/* ScreenRec fields */
static Bool KdXVDestroyWindow(WindowPtr pWin);
static void KdXVWindowExposures(WindowPtr pWin, RegionPtr r1);
static void KdXVClipNotify(WindowPtr pWin, int dx, int dy);
static Bool KdXVCloseScreen(ScreenPtr);
@ -139,14 +140,14 @@ KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr adaptors, int num)
if (!ScreenPriv)
return FALSE;
ScreenPriv->DestroyWindow = pScreen->DestroyWindow;
dixScreenHookWindowDestroy(pScreen, KdXVWindowDestroy, NULL);
ScreenPriv->WindowExposures = pScreen->WindowExposures;
ScreenPriv->ClipNotify = pScreen->ClipNotify;
ScreenPriv->CloseScreen = pScreen->CloseScreen;
/* fprintf(stderr,"XV: Wrapping screen funcs\n"); */
pScreen->DestroyWindow = KdXVDestroyWindow;
pScreen->WindowExposures = KdXVWindowExposures;
pScreen->ClipNotify = KdXVClipNotify;
pScreen->CloseScreen = KdXVCloseScreen;
@ -755,13 +756,10 @@ KdXVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
/**** ScreenRec fields ****/
static Bool
KdXVDestroyWindow(WindowPtr pWin)
static void
KdXVWindowDestroy(ScreenPtr pScreen, WindowPtr pWin, void *arg)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
KdXVScreenPtr ScreenPriv = GET_KDXV_SCREEN(pScreen);
KdXVWindowPtr tmp, WinPriv = GET_KDXV_WINDOW(pWin);
int ret;
while (WinPriv) {
XvPortRecPrivatePtr pPriv = WinPriv->PortRec;
@ -779,12 +777,6 @@ KdXVDestroyWindow(WindowPtr pWin)
}
dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, NULL);
pScreen->DestroyWindow = ScreenPriv->DestroyWindow;
ret = (*pScreen->DestroyWindow) (pWin);
pScreen->DestroyWindow = KdXVDestroyWindow;
return ret;
}
static void
@ -919,7 +911,6 @@ KdXVCloseScreen(ScreenPtr pScreen)
if (!ScreenPriv)
return TRUE;
pScreen->DestroyWindow = ScreenPriv->DestroyWindow;
pScreen->WindowExposures = ScreenPriv->WindowExposures;
pScreen->ClipNotify = ScreenPriv->ClipNotify;
pScreen->CloseScreen = ScreenPriv->CloseScreen;

View File

@ -151,7 +151,6 @@ Bool
/*** These are DDX layer privates ***/
typedef struct {
DestroyWindowProcPtr DestroyWindow;
ClipNotifyProcPtr ClipNotify;
WindowExposuresProcPtr WindowExposures;
CloseScreenProcPtr CloseScreen;

View File

@ -41,7 +41,6 @@ from The Open Group.
#include "xkbsrv.h"
#include "xserver-properties.h"
#include "exevents.h"
#include "extinit.h"
void
ProcessInputEvents(void)

View File

@ -41,6 +41,8 @@
#include <dix-config.h>
#endif
#include <X11/Xfuncproto.h>
#include "xf86str.h"
#include "xf86Opt.h"
#include <X11/Xfuncproto.h>

View File

@ -50,6 +50,7 @@
#include <sys/types.h>
#include <grp.h>
#include "os/log_priv.h"
#include "os/osdep.h"
#include "xf86.h"
@ -116,11 +117,6 @@
static ModuleDefault ModuleDefaults[] = {
#ifdef GLXEXT
{.name = "glx",.toLoad = TRUE,.load_opt = NULL},
#endif
#ifdef __CYGWIN__
/* load DIX modules used by drivers first */
{.name = "fb",.toLoad = TRUE,.load_opt = NULL},
{.name = "shadow",.toLoad = TRUE,.load_opt = NULL},
#endif
{.name = NULL,.toLoad = FALSE,.load_opt = NULL}
};
@ -827,13 +823,11 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
{
if ((s = xf86GetOptValString(FlagOptions, FLAG_LOG))) {
if (!xf86NameCmp(s, "flush")) {
LogMessageVerb(X_CONFIG, 1, "Flushing logfile enabled\n");
LogSetParameter(XLOG_FLUSH, TRUE);
LogMessageVerb(X_CONFIG, 1, "flush log flag is noop\n");
}
else if (!xf86NameCmp(s, "sync")) {
LogMessageVerb(X_CONFIG, 1, "Syncing logfile enabled\n");
LogSetParameter(XLOG_FLUSH, TRUE);
LogSetParameter(XLOG_SYNC, TRUE);
xorgLogSync = TRUE;
}
else {
LogMessageVerb(X_WARNING, 1, "Unknown Log option\n");

View File

@ -848,7 +848,7 @@ DoShowOptions(void)
int i = 0;
const char **vlist = NULL;
char *pSymbol = 0;
XF86ModuleData *initData = 0;
XF86ModuleData *initData = NULL;
if (!(vlist = GenerateDriverList())) {
ErrorF("Missing output drivers\n");

View File

@ -64,6 +64,7 @@
#include "dix/dix_priv.h"
#include "dix/input_priv.h"
#include "mi/mi_priv.h"
#include "os/log_priv.h"
#include "misc.h"
#include "xf86.h"
@ -88,7 +89,8 @@
#endif
#include "xf86platformBus.h"
#include "systemd-logind.h"
#include "../os-support/linux/systemd-logind.h"
extern void (*xf86OSPMClose) (void);

View File

@ -28,7 +28,6 @@
#endif
#include "extension.h"
#include "extinit.h"
#include "globals.h"
#include "xf86.h"

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