Compare commits

...

254 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 902320eeac io: unexport ReadFdFromClient()
Not used by any drivers (and really shouldn't be used by them),
so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:59:07 +01:00
Enrico Weigelt, metux IT consult 0d899a6ba7 os: io: improve some docs on discarding fd's passed along w/ request
It's a non-trivial topic that's deserving a bit more explainations.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:55:52 +01:00
Enrico Weigelt, metux IT consult 72b4a6af13 (submit/fix-xf86opt) xfree86: xf86Opt.h: fix missing include
<X11/Xdefs.h> is needed for `Bool` type.

Consumers shouldn't have to rely on Xdefs.h being accidentally included
by something else.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 9ee63525ca 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-11 11:46:50 +01:00
Doug Brown dfade85d11 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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 26ad158fc5 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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult f749819ff9 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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 720760b001 ci: always build with drivers 2025-02-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 3c4800755f ci: freebsd: fix missing xcb-aux and xcb-util-wm
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 821790cbfb 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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 4a590bf460 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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 7c29bb4cac 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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult b8434c1608 (!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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 80f22a5ca6 (!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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult ac5be5f86a (!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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 9679afccd4 (!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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 2275e74916 (!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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 573a4582ab (!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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 2c07b4d94e (!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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 2848f70987 (!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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult f8bdbea5a5 (!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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 05a1027510 (!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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 7bc8bd212b (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 1fe7e43c5a (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult d8521bb2d8 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 8b1169e6fc (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 5bfa80e3d4 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult a1a0794a23 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult b7068bc09f (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 1a7861b754 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 26b6d56a2d (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult d8ce233d5c (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 28aacbdc6c (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult f91a4a8100 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 4cbf5c7bb2 (!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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 9382d9cd0d (!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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 3f2784233b (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult e13338d94b (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult fa9a09dc39 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult c2237e1571 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 2eaf4ebc08 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 794e36cc49 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 761daedfdd (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult e55e4fde2a (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult bf84883e69 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult a628ab2283 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 7141c2f0c7 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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult bd8fe38d77 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 55005d340e (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult c731960834 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult f269934dea (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 7818f71a4e 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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 356a29eea0 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 6639a8131c 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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 5ffef244ef (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult f4d99f9d4a (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult fb06aac518 (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 42e13b561b (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-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 9a7fed7443 (submit/cleanup-damageext) damage: minor code formatting cleanups
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:46:50 +01:00
Enrico Weigelt, metux IT consult 99ee3f8979 (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-11 11:46:49 +01:00
Enrico Weigelt, metux IT consult e38d1197ba (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-11 11:45:56 +01:00
Enrico Weigelt, metux IT consult b4e2247306 (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-11 11:45:56 +01:00
Enrico Weigelt, metux IT consult 1ff92b1c21 (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-11 11:45:56 +01:00
Enrico Weigelt, metux IT consult 9d126ef1a1 (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-11 11:45:56 +01:00
Enrico Weigelt, metux IT consult 8b98cf3be3 (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-11 11:45:56 +01:00
Enrico Weigelt, metux IT consult 66db0b1282 (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-11 11:45:56 +01:00
Enrico Weigelt, metux IT consult a1c7da7375 (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-11 11:45:56 +01:00
Enrico Weigelt, metux IT consult ae12711804 (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-11 11:45:56 +01:00
Enrico Weigelt, metux IT consult 0f7d2aa478 (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-11 11:45:56 +01:00
Enrico Weigelt, metux IT consult bbceab0b01 (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-11 11:45:56 +01:00
Enrico Weigelt, metux IT consult 19915242d4 (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-11 11:45:56 +01:00
Enrico Weigelt, metux IT consult fceb970987 (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-11 11:45:56 +01:00
Enrico Weigelt, metux IT consult 09b80f3321 (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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 056508746a (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult ab4cfc72fb (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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 300c7e4b2c (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 6b1c2490ba (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 3a4d54eb56 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult b51ff3023f (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult d6f8939e11 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult b06a587f84 (!1654) Xnest: replace XConnectionNumber() by xcb_get_file_descriptor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult a5d16d9b98 (!1654) Xnest: replace XReparentWindow() by xcb_reparent_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 918d040ec8 (!1654) Xnest: drop using XLoadQueryFont()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 9954a2d9dd (!1654) Xnest: replace XTextWidth[16]() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 663e4a2d7f (!1654) Xnest: load fonts via xcb
FIXME: support xf86bigfont extension
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult ab4411dc60 (!1654) Xnest: replace XQueryBestSize() by xcb_query_best_size()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 1f9ea3bdba (!1654) Xnest: replace X(Un)InstallColormap() by xcb_(un)install_colormap()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 4f13284844 (!1654) Xnest: drop obsolete XGetVisualInfo() call and reundant colormaps
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 2524585305 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult d89c12bd5f (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult c0cbbd41f9 (!1654) Xnest: fetch visuals from XCB setup data instead of Xlib
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 11c2ca5989 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 7fa916fb98 (!1654) Xnest: replace XParseGeometry() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult f9b0e70bfa (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 715141a16a (!1654) Xnest: collect upstream window geometry in one xRectangle struct
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult c1258d66b3 (!1654) Xnest: replace XGetKeyboardControl() by xcb_get_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult bd74274407 (!1654) Xnest: replace XGetPointerMapping() by xcb_get_pointer_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 4f9802cdd2 (!1654) Xnest: replace XGetPointerControl() by xcb_get_pointer_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 18dd4b2993 (!1654) Xnest: replace XGetModifierMapping() by xcb_get_modifier_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult d9e946a58f (!1654) Xnest: fetch keyboard mapping via xcb
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 185d7b5a4c (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 867dc1ab94 (!1654) Xnest: use xcb for retrieving keymap controls
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult f9d9441c36 (!1654) Xnest: replace XSelectInput() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 07c620a04f (!1654) Xnest: replace XSetStandardProperties() by xcb functions
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 5240fc206d (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult d42cac61e1 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 5054b64802 (!1654) Xnest: Pixmap: replace XGetImage() by xcb_get_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 3673c8493f (!1654) Xnest: GC: replace XGetImage() by xcb_get_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 2aee1a2988 (!1654) Xnest: replace XDestroyWindow() by xnest_destroy_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult ce719e0477 (!1654) Xnest: replace XCreatePixmapFromBitmapData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 483ce7e0ec (!1654) Xnest: replace XCreateBitmapFromData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult e46f7ef26c (!1654) Xnest: replace XDefineCursor() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 28f54b0f71 (!1654) Xnest: replace xnestRecolorCursor() by xcb_recolor_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 0b4f4a40ed (!1654) Xnest: replace XFreeCursor() by xcb_free_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 77b069861c (!1654) Xnest: replace XStoreColors() by xcb_store_colors()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult aa48167e4a (!1654) Xnest: replace XQueryColors() by xcb_query_colors()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult ffcab5050c (!1654) Xnest: replace XSetWindowColormap() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 0ceb0f48b0 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 37086a8e46 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 3070d17333 (!1654) Xnest: GC: set stipple filling via xcb_change_gc
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 00726be059 (!1654) Xnest: replace XSetClipMask() by xcb_change_gc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 502e3c35d4 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 69f2bff781 (!1654) Xnest: replace XSetDashes() by xnest_set_dashes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult f772049b3d (!1654) Xnest: replace XChangeGC() by xcb_change_gc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 91315fe194 (!1654) Xnest: replace XChangeKeyboardControl() by xcb_change_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult b8dc104a60 (!1654) Xnest: replace XChangePointerControl() by xcb_change_pointer_control
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 836d549f95 (!1654) Xnest: replace XChangeWindowAttributes() by xcb_aux_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 4ad1888685 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult fcd1709263 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 43152a8a7b (!1654) Xnest: replace XFillRectangles() by xcb_poly_fill_rectangle()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 1f9aa74da7 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 39cb5e2328 (!1654) Xnest: replace XFillArcs() by xcb_poly_fill_arc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 8a5b0671d1 (!1654) Xnest: replace XFillPolygon() by xcb_fill_poly()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 3c8366023e (!1654) Xnest: replace XCopyPlane() by xcb_copy_plane()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult f9b3261256 (!1654) Xnest: replace XCopyArea() by xcb_copy_area()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult f2bd4bd93a (!1654) Xnest: replace XDrawArcs() by xcb_poly_arc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult deb33ced21 (!1654) Xnest: replace XDrawRectangles() by xcb_poly_rectangle()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult f09d43cad5 (!1654) Xnest: replace XDrawSegments() by xcb_poly_segment()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 9d396cf8e6 (!1654) Xnest: replace XDrawLines() by xcb_poly_line()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult a10f1e868e (!1654) Xnest: replace XDrawPoints() by xcb_poly_point()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult ee98129d84 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 03d647c4aa (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 4acacdd6a3 (!1654) Xnest: use xcb_put_image() for PutImage requests
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult f2c537644c (!1654) Xnest: use xcb_put_image() for creating cursors
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult f00702707d (!1654) Xnest: replace XCreatePixmapCursor() by xcb_create_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult e632b79016 (!1654) Xnest: replace XConfigureWindow() calls by xcb_configure_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 0283910a9b (!1654) Xnest: use xcb for creating / destroying pixmaps
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 16360bbf61 (!1654) Xnest: replace XBell() by xcb_bell()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult d73c0e594f (!1654) Xnest: use xcb for (un)mapping windows
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult be929f3a73 (!1654) Xnest: replace XCreateWindow() by use xcb_create_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult b2558bf811 (!1654) Xnest: fetch root visual ID from screen data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 1eba8bc6c2 (!1654) Xnest: fetch keycode min/max from setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult a7c1096229 (!1654) Xnest: fetch image metrics from xcb connection setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 395dd83267 (!1654) Xnest: fetch default screen's root window from screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 2ef5c6e430 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 3363a290b1 (!1654) Xnest: fetch default colormap from xcb screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult fce26a8d61 (!1654) Xnest: fetch root window depth from screen info
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 78e3e840ed (!1654) Xnest: fetch display size from xcb setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 555cea060a (!1654) Xnest: fetch BlackPixel and WhitePixel from xcb setup data
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 50af37f113 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 170ef293e0 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 8d4f5dea2b (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult 11b4451f15 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult c95c10c8ef (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult ee0d8bee71 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult fa0230d3c1 (!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-11 11:36:22 +01:00
Enrico Weigelt, metux IT consult dad900a3ad (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 0c4a909086 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 4595810aee (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult f05b426cea (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 4c3d4641d5 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult a9bdabe3da (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 476e6e7a6e (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 5a5400dc61 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 35466ec93e (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 493f9789c4 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 6bd50b720b (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 17d18080bf (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult ae14529ec4 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 594d746206 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 4b125de429 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 64fd561cb8 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 82b63e905a (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult daa673f5f9 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 21b106dad8 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 6d44dc0ac5 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 0cb73b1baa (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 96e80e83db (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 7c1ba7c4da (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 1447045d63 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 7c1b8b8b47 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult e929df7e2f (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult dd463f142b (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 7ba27e4e75 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 414f93fb8c (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 414b371295 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 447bf786ca (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 8bca4a16d0 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult b5e34518fa (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 5fcb5d9af7 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 62760ee40c (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 90b0d98d4d (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 2b0aa46d24 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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult c128a6c543 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 82c8a523de (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 01d9e9ab03 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult d2b191347c (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 91633cb52f (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 24edd86923 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult f9643a6bee (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 5cb24075b3 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult edf99fb15f (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult c22ef2671e (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult e7133056a5 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult c2a8948ffe (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult fef7d6e869 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 80710de470 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult d04285cd29 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 71fc3d55da (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 49c36f5880 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 5b746c1fdb (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 690268b08f (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 470f4f4b8d (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 82cb9c1b09 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult f3189547bf (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult e7c07ee166 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 58b4d3c6a1 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 5a5825d90f (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult f929762810 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 91a89c472b (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 2efad9e857 (!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-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 5d98dd24d9 (!1711) dix: add in-code docs for dixDestroyPixmap()
Give some more explaination for the dixDestroyPixmap() function.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 14609258c9 (!1711) exa: simplify CreatePixmap()/DestroyPixmap() handlers error pathes
Instead of complex wrap/unwrap trickery in the error path, just protect
the DestroyPixmap() handlers from half-initialized state.

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

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult a0e36ecf29 (!1711) glx: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 8d6889504c (!1711) xwayland: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 68d69239af (!1711) xfree86: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 1cd6dc85a6 (!1711) vfb: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 005c44461e (!1711) kdrive: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 485bbf0c2f (!1711) xnest: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 5bde314021 (!1711) render: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult df1f680647 (!1711) randr: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult fe7fd6157e (!1711) mi: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult a2cf361bae (!1711) miext: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 9c0f87c1a5 (!1711) glamor: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 336cee36e9 (!1711) fb: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 480b42227e (!1711) exa: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 533edd7d31 (!1711) dri3: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult f306be49fe (!1711) dbe: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 5041fcec1d (!1711) composite: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 74e7f4d644 (!1711) dix: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:21 +01:00
Enrico Weigelt, metux IT consult 747b520b56 (!1711) Xext: shm: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:20 +01:00
Enrico Weigelt, metux IT consult 4041b38684 (!1711) Xext: saver: use dixDestroyPixmap() instead of direct driver call
Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping
jungle, so use the proper dix function instead.

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:20 +01:00
Enrico Weigelt, metux IT consult 2407ebdc47 (!1711) document that ScreenRec->DestroyPixmap() shouldn't be called directly
Direct calls to ScreenRec->DestroyPixmap() is fragile and blocks cleaning up
the wrapping jungle, so use the proper dix function instead.

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

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

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-02-11 11:36:20 +01:00
Enrico Weigelt, metux IT consult df221e3876 .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-11 11:36:20 +01:00
323 changed files with 5591 additions and 4365 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: '2024-11-14-wayland-protocols-1-38'
XORG_DEBIAN_TAG: '2025-01-30-xvmc'
XORG_FREEBSD_VERSION: '14.0'
XORG_FREEBSD_EXEC: ''
XORG_FREEBSD_TAG: '2024-06-10.0'
XORG_FREEBSD_TAG: '2024-09-10-fix-freebsd-xcb'
include:
- project: 'freedesktop/ci-templates'
@ -109,7 +109,7 @@ stages:
FDO_DISTRIBUTION_TAG: '$XORG_FREEBSD_TAG'
FDO_DISTRIBUTION_VERSION: '$XORG_FREEBSD_VERSION'
FDO_DISTRIBUTION_EXEC: ''
FDO_DISTRIBUTION_PACKAGES: 'git gcc pkgconf autoconf automake libtool xorg-macros xorgproto bash meson ninja pixman xtrans libXau libXdmcp libXfont2 libxkbfile libxcvt libpciaccess font-util libepoll-shim'
FDO_DISTRIBUTION_PACKAGES: 'git gcc pkgconf autoconf automake libtool xorg-macros xorgproto bash meson ninja pixman xtrans libXau libXdmcp libXfont2 libxkbfile libxcvt libpciaccess font-util libepoll-shim libxvmc xcb-util xcb-util-wm'
debian-bullseye:
extends:
@ -152,7 +152,7 @@ freebsd-image:
- $MESON_BUILDDIR/meson-logs/
- $MESON_BUILDDIR/test/piglit-results/
variables:
MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true
MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=true -Dxcsecurity=true -Dxv=true -Dxvmc=true
CCACHE_COMPILERCHECK: content
CCACHE_DIR: /cache/xserver/cache
LC_ALL: C.UTF-8
@ -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
@ -250,24 +250,102 @@ xf86-driver-build-test:
stage: drivers
parallel:
matrix:
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-elographics
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-evdev
SHA: xf86-input-evdev-2.10.6
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-joystick
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput
SHA: xf86-input-libinput-1.4.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-mouse
SHA: xf86-input-mouse-1.9.5
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-synaptics
SHA: xf86-input-synaptics-1.9.2
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-vmmouse
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-input-void
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu
SHA: xf86-video-amdgpu-23.0.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-apm
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ark
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-armsoc
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ast
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-ati
SHA: xf86-video-ati-22.0.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-chips
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-cirrus
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-dummy
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-fbdev
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-i128
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-i740
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-mach64
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-mga
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-neomagic
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nested
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nouveau
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nv
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-qxl
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-r128
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-rendition
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-s3virge
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-savage
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-siliconmotion
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sis
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sisusb
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suncg14
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suncg3
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suncg6
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sunffb
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-sunleo
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-suntcx
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-tdfx
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-trident
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-v4l
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vbox
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vesa
SHA: xf86-video-vesa-2.6.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-vmware
SHA: xf86-video-vmware-13.4.0
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-voodoo
SHA: master
- REPO: https://gitlab.freedesktop.org/xorg/driver/xf86-video-xgi
SHA: master
script:
# Install the server first
- .gitlab-ci/meson-build.sh --skip-test --run-install
@ -288,13 +366,6 @@ xf86-driver-build-test:
GIT_DEPTH: 1
MESON_ARGS: -Dprefix=/usr/
MESON_EXTRA_ARGS: -Dxwayland=false -Dxnest=false -Dxvfb=false -Dxquartz=false -Ddocs=false
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
*dix_paths
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
*xorg_paths
#
# Verify that commit messages are as expected

View File

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

View File

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

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
@ -277,13 +277,10 @@ setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask)
static void
FreeAttrs(ScreenSaverAttrPtr pAttr)
{
PixmapPtr pPixmap;
CursorPtr pCursor;
if ((pPixmap = pAttr->pBackgroundPixmap) != 0)
(*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
if ((pPixmap = pAttr->pBorderPixmap) != 0)
(*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
dixDestroyPixmap(pAttr->pBackgroundPixmap, 0);
dixDestroyPixmap(pAttr->pBorderPixmap, 0);
if ((pCursor = pAttr->pCursor) != 0)
FreeCursor(pCursor, (Cursor) 0);
}

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,11 @@ 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/io_priv.h"
#include "os/log_priv.h"
#include "os/osdep.h"
#include "misc.h"
@ -59,7 +62,6 @@ in this Software without prior written authorization from The Open Group.
#include "servermd.h"
#include "shmint.h"
#include "xace.h"
#include "extinit_priv.h"
#include "protocol-versions.h"
/* Needed for Solaris cross-zone shared memory extension */
@ -95,9 +97,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 +108,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 +156,7 @@ static ShmFuncs fbFuncs = { fbShmCreatePixmap, NULL };
} \
}
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) || defined(__DragonFly__)
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
static Bool badSysCall = FALSE;
@ -194,15 +194,13 @@ CheckForShmSyscall(void)
#endif
static Bool
ShmCloseScreen(ScreenPtr pScreen)
static void
ShmScreenClose(ScreenPtr pScreen, void *arg)
{
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
pScreen->CloseScreen = screen_priv->CloseScreen;
dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, NULL);
free(screen_priv);
return (*pScreen->CloseScreen) (pScreen);
}
static ShmScrPrivateRec *
@ -212,9 +210,8 @@ ShmInitScreenPriv(ScreenPtr pScreen)
if (!screen_priv) {
screen_priv = calloc(1, sizeof(ShmScrPrivateRec));
screen_priv->CloseScreen = pScreen->CloseScreen;
dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, screen_priv);
pScreen->CloseScreen = ShmCloseScreen;
dixScreenHookClose(pScreen, ShmScreenClose, NULL);
}
return screen_priv;
}
@ -246,28 +243,6 @@ ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs)
ShmInitScreenPriv(pScreen)->shmFuncs = funcs;
}
static Bool
ShmDestroyPixmap(PixmapPtr pPixmap)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
void *shmdesc = NULL;
Bool ret = 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 +348,15 @@ shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly)
static int
ProcShmAttach(ClientPtr client)
{
REQUEST(xShmAttachReq);
REQUEST_SIZE_MATCH(xShmAttachReq);
if (!client->local)
return BadRequest;
SHMSTAT_TYPE buf;
ShmDescPtr shmdesc;
REQUEST(xShmAttachReq);
REQUEST_SIZE_MATCH(xShmAttachReq);
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
client->errorValue = stuff->readOnly;
@ -436,6 +414,9 @@ ShmDetachSegment(void *value, /* must conform to DeleteType */
ShmDescPtr shmdesc = (ShmDescPtr) value;
ShmDescPtr *prev;
if (!shmdesc)
return Success;
if (--shmdesc->refcnt)
return TRUE;
#if SHM_FD_PASSING
@ -455,11 +436,14 @@ ShmDetachSegment(void *value, /* must conform to DeleteType */
static int
ProcShmDetach(ClientPtr client)
{
REQUEST(xShmDetachReq);
REQUEST_SIZE_MATCH(xShmDetachReq);
if (!client->local)
return BadRequest;
ShmDescPtr shmdesc;
REQUEST(xShmDetachReq);
REQUEST_SIZE_MATCH(xShmDetachReq);
VERIFY_SHMSEG(stuff->shmseg, shmdesc, client);
FreeResource(stuff->shmseg, X11_RESTYPE_NONE);
return Success;
@ -511,21 +495,18 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
else
(void) (*pGC->ops->CopyArea) (&pPixmap->drawable, dst, pGC, 0, 0,
sw, sh, dx, dy);
(*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
dixDestroyPixmap(pPixmap, 0);
}
}
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 +596,7 @@ ProcShmPutImage(ClientPtr client)
}
static int
ProcShmGetImage(ClientPtr client)
ShmGetImage(ClientPtr client, xShmGetImageReq *stuff)
{
DrawablePtr pDraw;
long lenPer = 0, length;
@ -626,9 +607,6 @@ ProcShmGetImage(ClientPtr client)
RegionPtr pVisibleRegion = NULL;
int rc;
REQUEST(xShmGetImageReq);
REQUEST_SIZE_MATCH(xShmGetImageReq);
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
client->errorValue = stuff->format;
return BadValue;
@ -733,16 +711,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 +753,26 @@ ProcPanoramiXShmPutImage(ClientPtr client)
stuff->dstX = orig_x - screenInfo.screens[j]->x;
stuff->dstY = orig_y - screenInfo.screens[j]->y;
}
result = ProcShmPutImage(client);
result = ShmPutImage(client, stuff);
if (result != Success)
break;
}
return result;
#else
return ShmPutImage(client, stuff);
#endif /* XINERAMA */
}
static int
ProcPanoramiXShmGetImage(ClientPtr client)
ProcShmGetImage(ClientPtr client)
{
REQUEST(xShmGetImageReq);
REQUEST_SIZE_MATCH(xShmGetImageReq);
if (!client->local)
return BadRequest;
#ifdef XINERAMA
PanoramiXRes *draw;
DrawablePtr *drawables;
DrawablePtr pDraw;
@ -789,9 +783,8 @@ ProcPanoramiXShmGetImage(ClientPtr client)
long lenPer = 0, length, widthBytesLine;
Bool isRoot;
REQUEST(xShmGetImageReq);
REQUEST_SIZE_MATCH(xShmGetImageReq);
if (noPanoramiXExtension)
return ShmGetImage(client, stuff);
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
client->errorValue = stuff->format;
@ -804,7 +797,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
return (rc == BadValue) ? BadDrawable : rc;
if (draw->type == XRT_PIXMAP)
return ProcShmGetImage(client);
return ShmGetImage(client, stuff);
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReadAccess);
if (rc != Success)
@ -915,24 +908,34 @@ ProcPanoramiXShmGetImage(ClientPtr client)
WriteToClient(client, sizeof(xShmGetImageReply), &xgi);
return Success;
#else
return ShmGetImage(client, stuff);
#endif /* XINERAMA */
}
static int
ProcPanoramiXShmCreatePixmap(ClientPtr client)
ProcShmCreatePixmap(ClientPtr client)
{
REQUEST(xShmCreatePixmapReq);
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
if (!client->local)
return BadRequest;
#ifdef XINERAMA
if (noPanoramiXExtension)
return ShmCreatePixmap(client, stuff);
ScreenPtr pScreen = NULL;
PixmapPtr pMap = NULL;
DrawablePtr pDraw;
DepthPtr pDepth;
int i, j, result, rc;
ShmDescPtr shmdesc;
REQUEST(xShmCreatePixmapReq);
unsigned int width, height, depth;
unsigned long size;
PanoramiXRes *newPix;
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
client->errorValue = stuff->pid;
if (!sharedPixmaps)
return BadImplementation;
@ -1001,7 +1004,7 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
result = XaceHookResourceAccess(client, stuff->pid,
X11_RESTYPE_PIXMAP, pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (result != Success) {
pDraw->pScreen->DestroyPixmap(pMap);
dixDestroyPixmap(pMap, 0);
break;
}
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);
@ -1028,8 +1031,10 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
AddResource(stuff->pid, XRT_PIXMAP, newPix);
return result;
}
#else
return ShmCreatePixmap(client, stuff);
#endif /* XINERAMA */
}
static PixmapPtr
fbShmCreatePixmap(ScreenPtr pScreen,
@ -1045,14 +1050,14 @@ fbShmCreatePixmap(ScreenPtr pScreen,
BitsPerPixel(depth),
PixmapBytePad(width, depth),
(void *) addr)) {
(*pScreen->DestroyPixmap) (pPixmap);
dixDestroyPixmap(pPixmap, 0);
return NullPixmap;
}
return pPixmap;
}
static int
ProcShmCreatePixmap(ClientPtr client)
ShmCreatePixmap(ClientPtr client, xShmCreatePixmapReq *stuff)
{
PixmapPtr pMap;
DrawablePtr pDraw;
@ -1060,12 +1065,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;
@ -1116,7 +1118,7 @@ ProcShmCreatePixmap(ClientPtr client)
rc = XaceHookResourceAccess(client, stuff->pid, X11_RESTYPE_PIXMAP,
pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (rc != Success) {
pDraw->pScreen->DestroyPixmap(pMap);
dixDestroyPixmap(pMap, 0);
return rc;
}
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);
@ -1147,13 +1149,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 +1268,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 +1283,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 +1347,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 +1479,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 +1503,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 +1539,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 < num_types; i++) {
scratch[i].resource_type = resourceTypeAtom(i + 1);
scratch[i].count = cnt[i];
for (i = 0; i < lastResourceType; i++) {
if (!counts[i])
continue;
scratch.resource_type = resourceTypeAtom(i + 1);
scratch.count = counts[i];
if (client->swapped) {
swapl(&scratch.resource_type);
swapl(&scratch.count);
}
WriteToClient(client, sz_xXResType, &scratch);
if (client->swapped) {
swapl(&scratch[i].resource_type);
swapl(&scratch[i].count);
}
}
free(counts);
WriteToClient(client, sizeof(xXResQueryClientResourcesReply), &rep);
WriteToClient(client, sizeof(scratch), scratch);
return Success;
}
@ -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,15 +549,26 @@ ProcXResQueryClientIds (ClientPtr client)
rc = ConstructClientIds(client, stuff->numSpecs, specs, &ctx);
if (rc == Success) {
xXResQueryClientIdsReply rep = {
char *buf = calloc(1, ctx.resultBytes);
if (!buf) {
rc = BadAlloc;
goto out;
}
char *walk = buf;
FragmentList *it;
xorg_list_for_each_entry(it, &ctx.response, l) {
memcpy(walk, FRAGMENT_DATA(it), it->bytes);
walk += it->bytes;
}
xXResQueryClientIdsReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(ctx.resultBytes),
.numIds = ctx.numIds
};
assert((ctx.resultBytes & 3) == 0);
if (client->swapped) {
swaps (&rep.sequenceNumber);
swapl (&rep.length);
@ -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);
}
char *buf = calloc(1, ctx.resultBytes);
if (!buf) {
rc = BadAlloc;
goto out;
}
char *walk = buf;
FragmentList *it;
xorg_list_for_each_entry(it, &ctx.response, l) {
memcpy(walk, FRAGMENT_DATA(it), it->bytes);
walk += it->bytes;
}
WriteToClient(client, sizeof(rep), &rep);
WriteFragmentsToClient(client, &ctx.response);
WriteToClient(client, ctx.resultBytes, buf);
free(buf);
}
out:
DestroyConstructResourceBytesCtx(&ctx);
return rc;

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) {
return BadRequest;
switch (stuff->data) {
case xv_QueryExtension:
return ProcXvQueryExtension(client);
case xv_QueryAdaptors:
return ProcXvQueryAdaptors(client);
case xv_QueryEncodings:
return ProcXvQueryEncodings(client);
case xv_GrabPort:
return ProcXvGrabPort(client);
case xv_UngrabPort:
return ProcXvUngrabPort(client);
case xv_PutVideo:
return ProcXvPutVideo(client);
case xv_PutStill:
return ProcXvPutStill(client);
case xv_GetVideo:
return ProcXvGetVideo(client);
case xv_GetStill:
return ProcXvGetStill(client);
case xv_StopVideo:
return ProcXvStopVideo(client);
case xv_SelectVideoNotify:
return ProcXvSelectVideoNotify(client);
case xv_SelectPortNotify:
return ProcXvSelectPortNotify(client);
case xv_QueryBestSize:
return ProcXvQueryBestSize(client);
case xv_SetPortAttribute:
return ProcXvSetPortAttribute(client);
case xv_GetPortAttribute:
return ProcXvGetPortAttribute(client);
case xv_QueryPortAttributes:
return ProcXvQueryPortAttributes(client);
case xv_ListImageFormats:
return ProcXvListImageFormats(client);
case xv_QueryImageAttributes:
return ProcXvQueryImageAttributes(client);
case xv_PutImage:
return ProcXvPutImage(client);
case xv_ShmPutImage:
return ProcXvShmPutImage(client);
default:
return BadRequest;
}
return XvProcVector[stuff->data] (client);
}
/* Swapped Procs */
@ -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) {
return BadRequest;
switch (stuff->data) {
case xv_QueryExtension:
return ProcXvQueryExtension(client);
case xv_QueryAdaptors:
return SProcXvQueryAdaptors(client);
case xv_QueryEncodings:
return SProcXvQueryEncodings(client);
case xv_GrabPort:
return SProcXvGrabPort(client);
case xv_UngrabPort:
return SProcXvUngrabPort(client);
case xv_PutVideo:
return SProcXvPutVideo(client);
case xv_PutStill:
return SProcXvPutStill(client);
case xv_GetVideo:
return SProcXvGetVideo(client);
case xv_GetStill:
return SProcXvGetStill(client);
case xv_StopVideo:
return SProcXvStopVideo(client);
case xv_SelectVideoNotify:
return SProcXvSelectVideoNotify(client);
case xv_SelectPortNotify:
return SProcXvSelectPortNotify(client);
case xv_QueryBestSize:
return SProcXvQueryBestSize(client);
case xv_SetPortAttribute:
return SProcXvSetPortAttribute(client);
case xv_GetPortAttribute:
return SProcXvGetPortAttribute(client);
case xv_QueryPortAttributes:
return SProcXvQueryPortAttributes(client);
case xv_ListImageFormats:
return SProcXvListImageFormats(client);
case xv_QueryImageAttributes:
return SProcXvQueryImageAttributes(client);
case xv_PutImage:
return SProcXvPutImage(client);
case xv_ShmPutImage:
return SProcXvShmPutImage(client);
default:
return BadRequest;
}
return SXvProcVector[stuff->data] (client);
}
#ifdef 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

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

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

@ -180,7 +180,7 @@ compCheckRedirect(WindowPtr pWin)
compSetParentPixmap(pWin);
compRestoreWindow(pWin, pPixmap);
(*pScreen->DestroyPixmap) (pPixmap);
dixDestroyPixmap(pPixmap, 0);
}
}
else if (should) {
@ -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
@ -378,13 +366,11 @@ compImplicitRedirect(WindowPtr pWin, WindowPtr pParent)
static void
compFreeOldPixmap(WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
if (pWin->redirectDraw != RedirectDrawNone) {
CompWindowPtr cw = GetCompWindow(pWin);
if (cw->pOldPixmap) {
(*pScreen->DestroyPixmap) (cw->pOldPixmap);
dixDestroyPixmap(cw->pOldPixmap, 0);
cw->pOldPixmap = NullPixmap;
}
}
@ -598,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,18 +599,14 @@ compDestroyWindow(WindowPtr pWin)
PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin);
compSetParentPixmap(pWin);
(*pScreen->DestroyPixmap) (pPixmap);
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))
return BadRequest;
if (stuff->damageReqType > version_requests[pDamageClient->major_version])
return BadRequest;
return (*ProcDamageVector[stuff->damageReqType]) (client);
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;
}
}
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))
return BadRequest;
if (stuff->damageReqType > version_requests[pDamageClient->major_version])
return BadRequest;
return (*SProcDamageVector[stuff->damageReqType]) (client);
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;
}
}
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,94 +1221,39 @@ 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)
/**
* @brief window destroy callback
*
* Called by DIX when window is being destroyed.
*
*/
static void miDbeWindowDestroy(ScreenPtr pScreen, WindowPtr pWin, void *closure)
{
DbeScreenPrivPtr pDbeScreenPriv;
DbeWindowPrivPtr pDbeWindowPriv;
ScreenPtr pScreen;
Bool ret;
/*
**************************************************************************
** 1. Unwrap the member routine.
**************************************************************************
*/
pScreen = pWin->drawable.pScreen;
pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
pScreen->DestroyWindow = pDbeScreenPriv->DestroyWindow;
/*
**************************************************************************
** 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.
*/
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

@ -162,7 +162,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
(*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width,
pDbeWindowPriv->height,
pWin->drawable.depth, 0))) {
(*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
dixDestroyPixmap(pDbeWindowPriv->pFrontBuffer, 0);
return BadAlloc;
}
@ -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.
*
@ -426,31 +425,26 @@ miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId)
*/
/* Destroy the front and back pixmaps. */
if (pDbeWindowPriv->pFrontBuffer) {
(*pDbeWindowPriv->pWindow->drawable.pScreen->
DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
}
if (pDbeWindowPriv->pBackBuffer) {
(*pDbeWindowPriv->pWindow->drawable.pScreen->
DestroyPixmap) (pDbeWindowPriv->pBackBuffer);
}
if (pDbeWindowPriv->pFrontBuffer)
dixDestroyPixmap(pDbeWindowPriv->pFrontBuffer, 0);
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;
@ -463,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;
/*
**************************************************************************
@ -507,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;
@ -585,13 +543,8 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
if (!pFrontBuffer || !pBackBuffer) {
/* We failed at creating 1 or 2 of the pixmaps. */
if (pFrontBuffer) {
(*pScreen->DestroyPixmap) (pFrontBuffer);
}
if (pBackBuffer) {
(*pScreen->DestroyPixmap) (pBackBuffer);
}
dixDestroyPixmap(pFrontBuffer, 0);
dixDestroyPixmap(pBackBuffer, 0);
/* Destroy all buffers for this window. */
while (pDbeWindowPriv) {
@ -603,7 +556,7 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
}
FreeScratchGC(pGC);
return FALSE;
return;
}
else {
@ -642,8 +595,8 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
* pixmaps.
*/
(*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer);
(*pScreen->DestroyPixmap) (pDbeWindowPriv->pBackBuffer);
dixDestroyPixmap(pDbeWindowPriv->pFrontBuffer, 0);
dixDestroyPixmap(pDbeWindowPriv->pBackBuffer, 0);
pDbeWindowPriv->pFrontBuffer = pFrontBuffer;
pDbeWindowPriv->pBackBuffer = pBackBuffer;
@ -653,11 +606,8 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
FreeScratchGC(pGC);
}
}
return ret;
} /* miDbePositionWindow() */
/******************************************************************************
*
* DBE MI Procedure: miDbeInit
@ -672,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;
@ -1524,7 +1527,7 @@ ProcCreatePixmap(ClientPtr client)
rc = XaceHookResourceAccess(client, stuff->pid, X11_RESTYPE_PIXMAP,
pMap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (rc != Success) {
(*pDraw->pScreen->DestroyPixmap) (pMap);
dixDestroyPixmap(pMap, 0);
return rc;
}
if (AddResource(stuff->pid, X11_RESTYPE_PIXMAP, (void *) pMap))
@ -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;
@ -254,7 +254,7 @@ ChangeGC(ClientPtr client, GC * pGC, BITS32 mask, ChangeGCValPtr pUnion)
else {
pPixmap->refcnt++;
if (!pGC->tileIsPixel)
(*pGC->pScreen->DestroyPixmap) (pGC->tile.pixmap);
dixDestroyPixmap(pGC->tile.pixmap, 0);
pGC->tileIsPixel = FALSE;
pGC->tile.pixmap = pPixmap;
}
@ -271,7 +271,7 @@ ChangeGC(ClientPtr client, GC * pGC, BITS32 mask, ChangeGCValPtr pUnion)
if (pPixmap)
pPixmap->refcnt++;
if (pGC->stipple)
(*pGC->pScreen->DestroyPixmap) (pGC->stipple);
dixDestroyPixmap(pGC->stipple, 0);
pGC->stipple = pPixmap;
}
break;
@ -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;
}
@ -588,8 +588,7 @@ CreateDefaultTile(GCPtr pGC)
(*pGC->pScreen->CreatePixmap) (pGC->pScreen, w, h, pGC->depth, 0);
pgcScratch = GetScratchGC(pGC->depth, pGC->pScreen);
if (!pTile || !pgcScratch) {
if (pTile)
(*pTile->drawable.pScreen->DestroyPixmap) (pTile);
dixDestroyPixmap(pTile, 0);
if (pgcScratch)
FreeScratchGC(pgcScratch);
return FALSE;
@ -615,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;
@ -668,7 +667,7 @@ CopyGC(GC * pgcSrc, GC * pgcDst, BITS32 mask)
break;
}
if (!pgcDst->tileIsPixel)
(*pgcDst->pScreen->DestroyPixmap) (pgcDst->tile.pixmap);
dixDestroyPixmap(pgcDst->tile.pixmap, 0);
pgcDst->tileIsPixel = pgcSrc->tileIsPixel;
pgcDst->tile = pgcSrc->tile;
if (!pgcDst->tileIsPixel)
@ -680,7 +679,7 @@ CopyGC(GC * pgcSrc, GC * pgcDst, BITS32 mask)
if (pgcDst->stipple == pgcSrc->stipple)
break;
if (pgcDst->stipple)
(*pgcDst->pScreen->DestroyPixmap) (pgcDst->stipple);
dixDestroyPixmap(pgcDst->stipple, 0);
pgcDst->stipple = pgcSrc->stipple;
if (pgcDst->stipple)
pgcDst->stipple->refcnt++;
@ -775,9 +774,9 @@ FreeGC(void *value, XID gid)
(*pGC->funcs->DestroyClip) (pGC);
if (!pGC->tileIsPixel)
(*pGC->pScreen->DestroyPixmap) (pGC->tile.pixmap);
dixDestroyPixmap(pGC->tile.pixmap, 0);
if (pGC->stipple)
(*pGC->pScreen->DestroyPixmap) (pGC->stipple);
dixDestroyPixmap(pGC->stipple, 0);
if (pGC->funcs)
(*pGC->funcs->DestroyGC) (pGC);
@ -885,7 +884,7 @@ CreateDefaultStipple(int screenNum)
tmpval[2].val = FillSolid;
pgcScratch = GetScratchGC(1, pScreen);
if (!pgcScratch) {
(*pScreen->DestroyPixmap) (pScreen->defaultStipple);
dixDestroyPixmap(pScreen->defaultStipple, 0);
return FALSE;
}
(void) ChangeGC(NullClient, pgcScratch,
@ -905,8 +904,7 @@ void
FreeDefaultStipple(int screenNum)
{
ScreenPtr pScreen = screenInfo.screens[screenNum];
(*pScreen->DestroyPixmap) (pScreen->defaultStipple);
dixDestroyPixmap(pScreen->defaultStipple, 0);
}
int

View File

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

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

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

View File

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

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,
ClientPtr client, Mask access_mode);
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);
@ -1014,13 +1007,14 @@ FreeWindowResources(WindowPtr pWin)
if (wInputShape(pWin))
RegionDestroy(wInputShape(pWin));
if (pWin->borderIsPixel == FALSE)
(*pScreen->DestroyPixmap) (pWin->border.pixmap);
dixDestroyPixmap(pWin->border.pixmap, 0);
if (pWin->backgroundState == BackgroundPixmap)
(*pScreen->DestroyPixmap) (pWin->background.pixmap);
dixDestroyPixmap(pWin->background.pixmap, 0);
DeleteAllWindowProperties(pWin);
/* We SHOULD check for an error value here XXX */
(*pScreen->DestroyWindow) (pWin);
dixScreenRaiseWindowDestroy(pWin);
DisposeWindowOptional(pWin);
}
@ -1195,7 +1189,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
borderRelative = TRUE;
if (pixID == None) {
if (pWin->backgroundState == BackgroundPixmap)
(*pScreen->DestroyPixmap) (pWin->background.pixmap);
dixDestroyPixmap(pWin->background.pixmap, 0);
if (!pWin->parent)
SetRootWindowBackground(pWin, pScreen, &index2);
else {
@ -1210,7 +1204,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
goto PatchUp;
}
if (pWin->backgroundState == BackgroundPixmap)
(*pScreen->DestroyPixmap) (pWin->background.pixmap);
dixDestroyPixmap(pWin->background.pixmap, 0);
if (!pWin->parent)
SetRootWindowBackground(pWin, pScreen, &index2);
else
@ -1229,7 +1223,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
goto PatchUp;
}
if (pWin->backgroundState == BackgroundPixmap)
(*pScreen->DestroyPixmap) (pWin->background.pixmap);
dixDestroyPixmap(pWin->background.pixmap, 0);
pWin->backgroundState = BackgroundPixmap;
pWin->background.pixmap = pPixmap;
pPixmap->refcnt++;
@ -1245,7 +1239,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
if (pWin->backgroundState == ParentRelative)
borderRelative = TRUE;
if (pWin->backgroundState == BackgroundPixmap)
(*pScreen->DestroyPixmap) (pWin->background.pixmap);
dixDestroyPixmap(pWin->background.pixmap, 0);
pWin->backgroundState = BackgroundPixel;
pWin->background.pixel = (CARD32) *pVlist;
/* background pixel overrides background pixmap,
@ -1264,7 +1258,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
}
if (pWin->parent->borderIsPixel == TRUE) {
if (pWin->borderIsPixel == FALSE)
(*pScreen->DestroyPixmap) (pWin->border.pixmap);
dixDestroyPixmap(pWin->border.pixmap, 0);
pWin->border = pWin->parent->border;
pWin->borderIsPixel = TRUE;
index2 = CWBorderPixel;
@ -1283,7 +1277,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
goto PatchUp;
}
if (pWin->borderIsPixel == FALSE)
(*pScreen->DestroyPixmap) (pWin->border.pixmap);
dixDestroyPixmap(pWin->border.pixmap, 0);
pWin->borderIsPixel = FALSE;
pWin->border.pixmap = pPixmap;
pPixmap->refcnt++;
@ -1296,7 +1290,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
break;
case CWBorderPixel:
if (pWin->borderIsPixel == FALSE)
(*pScreen->DestroyPixmap) (pWin->border.pixmap);
dixDestroyPixmap(pWin->border.pixmap, 0);
pWin->borderIsPixel = TRUE;
pWin->border.pixel = (CARD32) *pVlist;
/* border pixel overrides border pixmap,
@ -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,9 +1881,9 @@ ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh)
pChild->origin.y;
SetWinSize(pChild);
SetBorderSize(pChild);
(*pScreen->PositionWindow) (pChild,
pChild->drawable.x,
pChild->drawable.y);
dixScreenRaiseWindowPosition(pChild,
pChild->drawable.x,
pChild->drawable.y);
if (pChild->firstChild) {
pChild = pChild->firstChild;
continue;
@ -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

@ -3057,6 +3057,9 @@ must deallocate the PixmapRec and all attached devPrivate blocks.
If successful, it returns TRUE.
See Xserver/fb/fbpixmap.c for the sample server implementation.</para>
<para>
Consumers should never ever call that proc directly, but call dixDestroyPixmap() instead.
</para>
<para>
<blockquote><programlisting>
Bool

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

@ -24,6 +24,7 @@
#include <unistd.h>
#include "dix/dix_priv.h"
#include "os/io_priv.h"
#include "dri3_priv.h"
#include <syncsrv.h>
@ -243,7 +244,7 @@ proc_dri3_pixmap_from_buffer(ClientPtr client)
pixmap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (rc != Success) {
(*drawable->pScreen->DestroyPixmap) (pixmap);
dixDestroyPixmap(pixmap, 0);
return rc;
}
if (!AddResource(stuff->pixmap, X11_RESTYPE_PIXMAP, (void *) pixmap))
@ -507,7 +508,7 @@ proc_dri3_pixmap_from_buffers(ClientPtr client)
pixmap, X11_RESTYPE_NONE, NULL, DixCreateAccess);
if (rc != Success) {
(*screen->DestroyPixmap) (pixmap);
dixDestroyPixmap(pixmap, 0);
return rc;
}
if (!AddResource(stuff->pixmap, X11_RESTYPE_PIXMAP, (void *) pixmap))

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

@ -96,10 +96,7 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
pExaPixmap->fb_size = pExaPixmap->fb_pitch * h;
if (pExaPixmap->fb_pitch > 131071) {
swap(pExaScr, pScreen, DestroyPixmap);
if (pScreen->DestroyPixmap)
pScreen->DestroyPixmap(pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
dixDestroyPixmap(pPixmap, 0);
return NULL;
}
@ -109,10 +106,7 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
pScreen, pPixmap);
if (pExaPixmap->pDamage == NULL) {
swap(pExaScr, pScreen, DestroyPixmap);
if (pScreen->DestroyPixmap)
pScreen->DestroyPixmap(pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
dixDestroyPixmap(pPixmap, 0);
return NULL;
}
@ -208,39 +202,26 @@ 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;
ExaPixmapPriv(pPixmap);
if (!pExaPixmap) // we're called on an error path
return;
ExaScreenPriv(pScreen);
Bool ret = TRUE;
exaDestroyPixmap(pPixmap);
if (pPixmap->refcnt == 1) {
ExaPixmapPriv(pPixmap);
exaDestroyPixmap(pPixmap);
if (pExaPixmap->area) {
DBG_PIXMAP(("-- 0x%p (0x%x) (%dx%d)\n",
(void *) pPixmap->drawable.id,
ExaGetPixmapPriv(pPixmap)->area->offset,
pPixmap->drawable.width, pPixmap->drawable.height));
/* Free the offscreen area */
exaOffscreenFree(pPixmap->drawable.pScreen, pExaPixmap->area);
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
pPixmap->devKind = pExaPixmap->sys_pitch;
}
RegionUninit(&pExaPixmap->validSys);
RegionUninit(&pExaPixmap->validFB);
if (pExaPixmap->area) {
DBG_PIXMAP(("-- 0x%p (0x%x) (%dx%d)\n",
(void *) pPixmap->drawable.id,
ExaGetPixmapPriv(pPixmap)->area->offset,
pPixmap->drawable.width, pPixmap->drawable.height));
/* Free the offscreen area */
exaOffscreenFree(pPixmap->drawable.pScreen, pExaPixmap->area);
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
pPixmap->devKind = pExaPixmap->sys_pitch;
}
swap(pExaScr, pScreen, DestroyPixmap);
if (pScreen->DestroyPixmap)
ret = pScreen->DestroyPixmap(pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
return ret;
RegionUninit(&pExaPixmap->validSys);
RegionUninit(&pExaPixmap->validFB);
}
Bool

View File

@ -98,10 +98,7 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
}
if (!pExaPixmap->driverPriv) {
swap(pExaScr, pScreen, DestroyPixmap);
if (pScreen->DestroyPixmap)
pScreen->DestroyPixmap(pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
dixDestroyPixmap(pPixmap, 0);
return NULL;
}
@ -186,30 +183,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);
ExaPixmapPriv(pPixmap);
if (!pExaPixmap) // we're called on an error path
return;
exaDestroyPixmap(pPixmap);
exaDestroyPixmap(pPixmap);
if (pExaPixmap->driverPriv)
pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv);
pExaPixmap->driverPriv = NULL;
}
swap(pExaScr, pScreen, DestroyPixmap);
if (pScreen->DestroyPixmap)
ret = pScreen->DestroyPixmap(pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
return ret;
if (pExaPixmap->driverPriv)
pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv);
pExaPixmap->driverPriv = NULL;
}
Bool

View File

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

View File

@ -239,39 +239,28 @@ 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);
ExaPixmapPriv(pPixmap);
if (!pExaPixmap) // we're called on an error path
return;
exaDestroyPixmap(pPixmap);
exaDestroyPixmap(pPixmap);
if (pExaScr->deferred_mixed_pixmap == pPixmap)
pExaScr->deferred_mixed_pixmap = NULL;
if (pExaScr->deferred_mixed_pixmap == pPixmap)
pExaScr->deferred_mixed_pixmap = NULL;
if (pExaPixmap->driverPriv)
pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv);
pExaPixmap->driverPriv = NULL;
if (pExaPixmap->driverPriv)
pExaScr->info->DestroyPixmap(pScreen, pExaPixmap->driverPriv);
pExaPixmap->driverPriv = NULL;
if (pExaPixmap->pDamage) {
free(pExaPixmap->sys_ptr);
pExaPixmap->sys_ptr = NULL;
pExaPixmap->pDamage = NULL;
}
if (pExaPixmap->pDamage) {
free(pExaPixmap->sys_ptr);
pExaPixmap->sys_ptr = NULL;
pExaPixmap->pDamage = NULL;
}
swap(pExaScr, pScreen, DestroyPixmap);
if (pScreen->DestroyPixmap)
ret = pScreen->DestroyPixmap(pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
return ret;
}
Bool

View File

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

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

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

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

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

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

@ -436,7 +436,7 @@ glamor_composite_glyphs(CARD8 op,
glyphs_queued = 0;
}
if (glyph_atlas->atlas) {
(*screen->DestroyPixmap)(glyph_atlas->atlas);
dixDestroyPixmap(glyph_atlas->atlas, 0);
glyph_atlas->atlas = NULL;
}
}
@ -571,8 +571,7 @@ glamor_free_glyph_atlas(struct glamor_glyph_atlas *atlas)
{
if (!atlas)
return;
if (atlas->atlas)
(*atlas->atlas->drawable.pScreen->DestroyPixmap)(atlas->atlas);
dixDestroyPixmap(atlas->atlas, 0);
free (atlas);
}

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;
};
@ -346,7 +345,7 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok)
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Failed to make %dx%dx%dbpp pixmap from GBM bo\n",
width, height, pixmap->drawable.bitsPerPixel);
screen->DestroyPixmap(exported);
dixDestroyPixmap(exported, 0);
gbm_bo_destroy(bo);
return FALSE;
}
@ -367,7 +366,7 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok)
/* Swap the devKind into the original pixmap, reflecting the bo's stride */
screen->ModifyPixmapHeader(pixmap, 0, 0, 0, 0, exported->devKind, NULL);
screen->DestroyPixmap(exported);
dixDestroyPixmap(exported, 0);
return TRUE;
}
@ -632,7 +631,7 @@ glamor_pixmap_from_fds(ScreenPtr screen,
error:
if (ret == FALSE) {
screen->DestroyPixmap(pixmap);
dixDestroyPixmap(pixmap, 0);
return NULL;
}
return pixmap;
@ -654,7 +653,7 @@ glamor_pixmap_from_fd(ScreenPtr screen,
stride, depth, bpp);
if (ret == FALSE) {
screen->DestroyPixmap(pixmap);
dixDestroyPixmap(pixmap, 0);
return NULL;
}
return pixmap;
@ -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);
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;
if (pixmap_priv->image)
eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image);
}
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

@ -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

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

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 {

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